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

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: Rebase after great git cl format event. 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 2e5496bf47d2d528b5972b8fdcacc61002f11f50..03a2b0216fc7c4b1da152964583d6797bfd32470 100644
--- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
+++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
@@ -131,7 +131,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(
@@ -141,8 +141,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;
}
@@ -167,15 +166,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();
}
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