Make UMA_HISTOGRAM_ENUMERATION work with scoped enums.

Internally, the macro does some math on the macro arguments, which
doesn't interact well with scoped enums. To work around this, the
internal macro now explicitly casts the enum values to integral
types.

To ensure some modicum of safety, there are new static asserts to
verify that the enum values are in range of HistogramBase::Sample.
This breaks code that was using UMA_HISTOGRAM_ENUMERATION to record
things that aren't C++ enumerations, so switch those to use
UMA_HISTOGRAM_EXACT_LINEAR as well.

BUG=705171
R=rkaplow,jochen,mrefaat,sky,thestig,xhwang
TBR=mukai

Review-Url: https://codereview.chromium.org/2776853002
Cr-Commit-Position: refs/heads/master@{#460938}
25 files changed