summaryrefslogtreecommitdiffstats
path: root/chromium/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/renderer/pepper/pepper_device_enumeration_host_helper.cc')
-rw-r--r--chromium/content/renderer/pepper/pepper_device_enumeration_host_helper.cc36
1 files changed, 16 insertions, 20 deletions
diff --git a/chromium/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/chromium/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
index 28beb20936e..d983f4a5816 100644
--- a/chromium/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
+++ b/chromium/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
@@ -26,9 +26,8 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest
: public base::SupportsWeakPtr<ScopedRequest> {
public:
// |owner| must outlive this object.
- ScopedRequest(
- PepperDeviceEnumerationHostHelper* owner,
- const Delegate::EnumerateDevicesCallback& callback)
+ ScopedRequest(PepperDeviceEnumerationHostHelper* owner,
+ const Delegate::EnumerateDevicesCallback& callback)
: owner_(owner),
callback_(callback),
requested_(false),
@@ -98,11 +97,9 @@ PepperDeviceEnumerationHostHelper::PepperDeviceEnumerationHostHelper(
: resource_host_(resource_host),
delegate_(delegate),
device_type_(device_type),
- document_url_(document_url) {
-}
+ document_url_(document_url) {}
-PepperDeviceEnumerationHostHelper::~PepperDeviceEnumerationHostHelper() {
-}
+PepperDeviceEnumerationHostHelper::~PepperDeviceEnumerationHostHelper() {}
bool PepperDeviceEnumerationHostHelper::HandleResourceMessage(
const IPC::Message& msg,
@@ -118,7 +115,7 @@ int32_t PepperDeviceEnumerationHostHelper::InternalHandleResourceMessage(
HostMessageContext* context,
bool* handled) {
*handled = true;
- IPC_BEGIN_MESSAGE_MAP(PepperDeviceEnumerationHostHelper, msg)
+ PPAPI_BEGIN_MESSAGE_MAP(PepperDeviceEnumerationHostHelper, msg)
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(
PpapiHostMsg_DeviceEnumeration_EnumerateDevices, OnEnumerateDevices)
PPAPI_DISPATCH_HOST_RESOURCE_CALL(
@@ -127,7 +124,7 @@ int32_t PepperDeviceEnumerationHostHelper::InternalHandleResourceMessage(
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(
PpapiHostMsg_DeviceEnumeration_StopMonitoringDeviceChange,
OnStopMonitoringDeviceChange)
- IPC_END_MESSAGE_MAP()
+ PPAPI_END_MESSAGE_MAP()
*handled = false;
return PP_ERROR_FAILED;
@@ -135,7 +132,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 +142,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;
}
@@ -156,7 +152,8 @@ int32_t PepperDeviceEnumerationHostHelper::OnMonitorDeviceChange(
monitor_.reset(new ScopedRequest(
this,
base::Bind(&PepperDeviceEnumerationHostHelper::OnNotifyDeviceChange,
- base::Unretained(this), callback_id)));
+ base::Unretained(this),
+ callback_id)));
return monitor_->requested() ? PP_OK : PP_ERROR_FAILED;
}
@@ -170,15 +167,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(
@@ -187,9 +184,8 @@ void PepperDeviceEnumerationHostHelper::OnNotifyDeviceChange(
const std::vector<ppapi::DeviceRefData>& devices) {
resource_host_->host()->SendUnsolicitedReply(
resource_host_->pp_resource(),
- PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(
- callback_id,
- devices));
+ PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange(callback_id,
+ devices));
}
} // namespace content