Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(898)

Unified Diff: content/renderer/pepper/ppb_uma_private_impl.cc

Issue 61643022: Proxy private UMA pepper interface for out-of-process and NaCl plugins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add back browser impl for testing Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698