diff options
author | elijahtaylor@chromium.org <elijahtaylor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-21 22:44:01 +0000 |
---|---|---|
committer | elijahtaylor@chromium.org <elijahtaylor@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-21 22:44:01 +0000 |
commit | 1ef13cf522915b73185907981d10802f1e45fdb5 (patch) | |
tree | 3b98db85e311ff0ab99cfa03efb42215c10ad5be /ppapi/proxy | |
parent | bca4951052ae6cea48d405eeb002de704de08cfa (diff) | |
download | chromium_src-1ef13cf522915b73185907981d10802f1e45fdb5.zip chromium_src-1ef13cf522915b73185907981d10802f1e45fdb5.tar.gz chromium_src-1ef13cf522915b73185907981d10802f1e45fdb5.tar.bz2 |
Add IsCrashReportingEnabled call to Pepper UMA API
This mirrors the existing metricsPrivate JS API.
BUG=341130
Review URL: https://codereview.chromium.org/195793026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258702 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 2 | ||||
-rw-r--r-- | ppapi/proxy/uma_private_resource.cc | 21 | ||||
-rw-r--r-- | ppapi/proxy/uma_private_resource.h | 8 |
3 files changed, 31 insertions, 0 deletions
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index ead5680..5691b0c 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -1277,6 +1277,8 @@ IPC_MESSAGE_CONTROL3(PpapiHostMsg_UMA_HistogramEnumeration, std::string /* name */, int32_t /* sample */, int32_t /* boundary_value */) +IPC_MESSAGE_CONTROL0(PpapiHostMsg_UMA_IsCrashReportingEnabled); +IPC_MESSAGE_CONTROL0(PpapiPluginMsg_UMA_IsCrashReportingEnabledReply); // File chooser. IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileChooser_Create) diff --git a/ppapi/proxy/uma_private_resource.cc b/ppapi/proxy/uma_private_resource.cc index d17a005..2932e6c 100644 --- a/ppapi/proxy/uma_private_resource.cc +++ b/ppapi/proxy/uma_private_resource.cc @@ -84,6 +84,27 @@ void UMAPrivateResource::HistogramEnumeration( boundary_value)); } +int32_t UMAPrivateResource::IsCrashReportingEnabled( + PP_Instance instance, + scoped_refptr<TrackedCallback> callback) { + if (pending_callback_ != NULL) + return PP_ERROR_INPROGRESS; + pending_callback_ = callback; + Call<PpapiPluginMsg_UMA_IsCrashReportingEnabledReply>( + RENDERER, + PpapiHostMsg_UMA_IsCrashReportingEnabled(), + base::Bind(&UMAPrivateResource::OnPluginMsgIsCrashReportingEnabled, + this)); + return PP_OK_COMPLETIONPENDING; +} + +void UMAPrivateResource::OnPluginMsgIsCrashReportingEnabled( + const ResourceMessageReplyParams& params) { + if (TrackedCallback::IsPending(pending_callback_)) + pending_callback_->Run(params.result()); + pending_callback_ = NULL; +} + } // namespace proxy } // namespace ppapi diff --git a/ppapi/proxy/uma_private_resource.h b/ppapi/proxy/uma_private_resource.h index 94c7d3c..93328e8 100644 --- a/ppapi/proxy/uma_private_resource.h +++ b/ppapi/proxy/uma_private_resource.h @@ -44,7 +44,15 @@ class PPAPI_PROXY_EXPORT UMAPrivateResource int32_t sample, int32_t boundary_value) OVERRIDE; + virtual int32_t IsCrashReportingEnabled( + PP_Instance instance, + scoped_refptr<TrackedCallback> callback) OVERRIDE; + private: + void OnPluginMsgIsCrashReportingEnabled( + const ResourceMessageReplyParams& params); + scoped_refptr<TrackedCallback> pending_callback_; + DISALLOW_COPY_AND_ASSIGN(UMAPrivateResource); }; |