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

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

Issue 231883002: Refactor some ResourceMessageReply usages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use ReplyMessageContext.is_valid() method. Created 6 years, 8 months 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
« no previous file with comments | « content/renderer/pepper/pepper_device_enumeration_host_helper.h ('k') | ppapi/host/host_message_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_device_enumeration_host_helper.cc
diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
index 28beb20936eca35601a28bf9018b655e21e0d87a..25d85c578ad7f465e4fb22efd1f0399dfa1cb75b 100644
--- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
+++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
@@ -135,7 +135,7 @@ int32_t PepperDeviceEnumerationHostHelper::InternalHandleResourceMessage(
int32_t PepperDeviceEnumerationHostHelper::OnEnumerateDevices(
HostMessageContext* context) {
- if (enumerate_devices_context_)
+ if (enumerate_devices_context_.is_valid())
return PP_ERROR_INPROGRESS;
enumerate_.reset(new ScopedRequest(
@@ -145,8 +145,7 @@ int32_t PepperDeviceEnumerationHostHelper::OnEnumerateDevices(
if (!enumerate_->requested())
return PP_ERROR_FAILED;
- enumerate_devices_context_.reset(
- new ppapi::host::ReplyMessageContext(context->MakeReplyMessageContext()));
+ enumerate_devices_context_ = context->MakeReplyMessageContext();
return PP_OK_COMPLETIONPENDING;
}
@@ -170,15 +169,15 @@ int32_t PepperDeviceEnumerationHostHelper::OnStopMonitoringDeviceChange(
void PepperDeviceEnumerationHostHelper::OnEnumerateDevicesComplete(
int /* request_id */,
const std::vector<ppapi::DeviceRefData>& devices) {
- DCHECK(enumerate_devices_context_.get());
+ DCHECK(enumerate_devices_context_.is_valid());
enumerate_.reset(NULL);
- enumerate_devices_context_->params.set_result(PP_OK);
+ enumerate_devices_context_.params.set_result(PP_OK);
resource_host_->host()->SendReply(
- *enumerate_devices_context_,
+ enumerate_devices_context_,
PpapiPluginMsg_DeviceEnumeration_EnumerateDevicesReply(devices));
- enumerate_devices_context_.reset();
+ enumerate_devices_context_ = ppapi::host::ReplyMessageContext();
dmichael (off chromium) 2014/04/11 20:56:14 optional: you could alternatively have a "clear()"
bbudge 2014/04/11 22:46:05 Going through RMC usage and copying sounds like a
}
void PepperDeviceEnumerationHostHelper::OnNotifyDeviceChange(
« no previous file with comments | « content/renderer/pepper/pepper_device_enumeration_host_helper.h ('k') | ppapi/host/host_message_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698