OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/proxy/uma_private_resource.h" | 5 #include "ppapi/proxy/uma_private_resource.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ppapi/proxy/ppapi_messages.h" | 8 #include "ppapi/proxy/ppapi_messages.h" |
9 #include "ppapi/proxy/resource_message_params.h" | 9 #include "ppapi/proxy/resource_message_params.h" |
10 #include "ppapi/shared_impl/var.h" | 10 #include "ppapi/shared_impl/var.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 return; | 80 return; |
81 | 81 |
82 Post(RENDERER, PpapiHostMsg_UMA_HistogramEnumeration(StringFromPPVar(name), | 82 Post(RENDERER, PpapiHostMsg_UMA_HistogramEnumeration(StringFromPPVar(name), |
83 sample, | 83 sample, |
84 boundary_value)); | 84 boundary_value)); |
85 } | 85 } |
86 | 86 |
87 int32_t UMAPrivateResource::IsCrashReportingEnabled( | 87 int32_t UMAPrivateResource::IsCrashReportingEnabled( |
88 PP_Instance instance, | 88 PP_Instance instance, |
89 scoped_refptr<TrackedCallback> callback) { | 89 scoped_refptr<TrackedCallback> callback) { |
90 if (pending_callback_ != NULL) | 90 if (pending_callback_.get() != NULL) |
91 return PP_ERROR_INPROGRESS; | 91 return PP_ERROR_INPROGRESS; |
92 pending_callback_ = callback; | 92 pending_callback_ = callback; |
93 Call<PpapiPluginMsg_UMA_IsCrashReportingEnabledReply>( | 93 Call<PpapiPluginMsg_UMA_IsCrashReportingEnabledReply>( |
94 RENDERER, | 94 RENDERER, |
95 PpapiHostMsg_UMA_IsCrashReportingEnabled(), | 95 PpapiHostMsg_UMA_IsCrashReportingEnabled(), |
96 base::Bind(&UMAPrivateResource::OnPluginMsgIsCrashReportingEnabled, | 96 base::Bind(&UMAPrivateResource::OnPluginMsgIsCrashReportingEnabled, |
97 this)); | 97 this)); |
98 return PP_OK_COMPLETIONPENDING; | 98 return PP_OK_COMPLETIONPENDING; |
99 } | 99 } |
100 | 100 |
101 void UMAPrivateResource::OnPluginMsgIsCrashReportingEnabled( | 101 void UMAPrivateResource::OnPluginMsgIsCrashReportingEnabled( |
102 const ResourceMessageReplyParams& params) { | 102 const ResourceMessageReplyParams& params) { |
103 if (TrackedCallback::IsPending(pending_callback_)) | 103 if (TrackedCallback::IsPending(pending_callback_)) |
104 pending_callback_->Run(params.result()); | 104 pending_callback_->Run(params.result()); |
105 pending_callback_ = NULL; | 105 pending_callback_ = NULL; |
106 } | 106 } |
107 | 107 |
108 } // namespace proxy | 108 } // namespace proxy |
109 } // namespace ppapi | 109 } // namespace ppapi |
110 | 110 |
OLD | NEW |