| Index: content/renderer/pepper/ppb_uma_private_impl.cc
|
| diff --git a/content/renderer/pepper/ppb_uma_private_impl.cc b/content/renderer/pepper/ppb_uma_private_impl.cc
|
| index ae9fe10f9a65cdf2fbb033b6306c75a897d37355..de03098e5b90d6585f7cbbdbd8c2860e699439b8 100644
|
| --- a/content/renderer/pepper/ppb_uma_private_impl.cc
|
| +++ b/content/renderer/pepper/ppb_uma_private_impl.cc
|
| @@ -13,8 +13,6 @@ using ppapi::StringVar;
|
|
|
| namespace content {
|
|
|
| -namespace {
|
| -
|
| #define RETURN_IF_BAD_ARGS(_name, _sample, _min, _max, _bucket_count) \
|
| do { \
|
| if (_name.type != PP_VARTYPE_STRING || _name.value.as_id == 0) \
|
| @@ -25,10 +23,23 @@ namespace {
|
| return; \
|
| } while (0)
|
|
|
| -void HistogramCustomTimes(PP_Var name,
|
| - int64_t sample,
|
| - int64_t min, int64_t max,
|
| - uint32_t bucket_count) {
|
| +UMA_Private_Impl::UMA_Private_Impl() : Resource(ppapi::Resource::Untracked()) {
|
| +}
|
| +
|
| +UMA_Private_Impl::~UMA_Private_Impl() {
|
| +}
|
| +
|
| +ppapi::thunk::PPB_UMA_Singleton_API*
|
| + UMA_Private_Impl::AsPPB_UMA_Singleton_API() {
|
| + fprintf(stderr, "BLARG:::::::::::::::::::::in process api\n");
|
| + return this;
|
| +}
|
| +
|
| +void UMA_Private_Impl::HistogramCustomTimes(PP_Instance instance,
|
| + PP_Var name,
|
| + int64_t sample,
|
| + int64_t min, int64_t max,
|
| + uint32_t bucket_count) {
|
| RETURN_IF_BAD_ARGS(name, sample, min, max, bucket_count);
|
|
|
| StringVar* name_string = StringVar::FromPPVar(name);
|
| @@ -44,10 +55,11 @@ void HistogramCustomTimes(PP_Var name,
|
| counter->AddTime(base::TimeDelta::FromMilliseconds(sample));
|
| }
|
|
|
| -void HistogramCustomCounts(PP_Var name,
|
| - int32_t sample,
|
| - int32_t min, int32_t max,
|
| - uint32_t bucket_count) {
|
| +void UMA_Private_Impl::HistogramCustomCounts(PP_Instance instance,
|
| + PP_Var name,
|
| + int32_t sample,
|
| + int32_t min, int32_t max,
|
| + uint32_t bucket_count) {
|
| RETURN_IF_BAD_ARGS(name, sample, min, max, bucket_count);
|
|
|
| StringVar* name_string = StringVar::FromPPVar(name);
|
| @@ -63,9 +75,10 @@ void HistogramCustomCounts(PP_Var name,
|
| counter->Add(sample);
|
| }
|
|
|
| -void HistogramEnumeration(PP_Var name,
|
| - int32_t sample,
|
| - int32_t boundary_value) {
|
| +void UMA_Private_Impl::HistogramEnumeration(PP_Instance instance,
|
| + PP_Var name,
|
| + int32_t sample,
|
| + int32_t boundary_value) {
|
| RETURN_IF_BAD_ARGS(name, sample, 1, boundary_value, boundary_value + 1);
|
|
|
| StringVar* name_string = StringVar::FromPPVar(name);
|
| @@ -81,17 +94,4 @@ void HistogramEnumeration(PP_Var name,
|
| counter->Add(sample);
|
| }
|
|
|
| -} // namespace
|
| -
|
| -const PPB_UMA_Private ppb_uma = {
|
| - &HistogramCustomTimes,
|
| - &HistogramCustomCounts,
|
| - &HistogramEnumeration,
|
| -};
|
| -
|
| -// static
|
| -const PPB_UMA_Private* PPB_UMA_Private_Impl::GetInterface() {
|
| - return &ppb_uma;
|
| -}
|
| -
|
| } // namespace content
|
|
|