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( |