| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/device_enumeration_resource_helper.h" | 5 #include "ppapi/proxy/device_enumeration_resource_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 owner_->Post(PluginResource::RENDERER, | 87 owner_->Post(PluginResource::RENDERER, |
| 88 PpapiHostMsg_DeviceEnumeration_StopMonitoringDeviceChange()); | 88 PpapiHostMsg_DeviceEnumeration_StopMonitoringDeviceChange()); |
| 89 } | 89 } |
| 90 return PP_OK; | 90 return PP_OK; |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool DeviceEnumerationResourceHelper::HandleReply( | 93 bool DeviceEnumerationResourceHelper::HandleReply( |
| 94 const ResourceMessageReplyParams& params, | 94 const ResourceMessageReplyParams& params, |
| 95 const IPC::Message& msg) { | 95 const IPC::Message& msg) { |
| 96 IPC_BEGIN_MESSAGE_MAP(DeviceEnumerationResourceHelper, msg) | 96 PPAPI_BEGIN_MESSAGE_MAP(DeviceEnumerationResourceHelper, msg) |
| 97 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( | 97 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( |
| 98 PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange, | 98 PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange, |
| 99 OnPluginMsgNotifyDeviceChange) | 99 OnPluginMsgNotifyDeviceChange) |
| 100 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED(return false) | 100 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED(return false) |
| 101 IPC_END_MESSAGE_MAP() | 101 PPAPI_END_MESSAGE_MAP() |
| 102 | 102 |
| 103 return true; | 103 return true; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void DeviceEnumerationResourceHelper::LastPluginRefWasDeleted() { | 106 void DeviceEnumerationResourceHelper::LastPluginRefWasDeleted() { |
| 107 // Make sure that no further notifications are sent to the plugin. | 107 // Make sure that no further notifications are sent to the plugin. |
| 108 monitor_callback_id_++; | 108 monitor_callback_id_++; |
| 109 monitor_callback_.reset(NULL); | 109 monitor_callback_.reset(NULL); |
| 110 monitor_user_data_ = NULL; | 110 monitor_user_data_ = NULL; |
| 111 | 111 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 OBJECT_IS_PROXY, owner_->pp_instance(), devices[i])); | 175 OBJECT_IS_PROXY, owner_->pp_instance(), devices[i])); |
| 176 } | 176 } |
| 177 if (!writer.StoreResourceVector(device_resources)) | 177 if (!writer.StoreResourceVector(device_resources)) |
| 178 return PP_ERROR_FAILED; | 178 return PP_ERROR_FAILED; |
| 179 | 179 |
| 180 return PP_OK; | 180 return PP_OK; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace proxy | 183 } // namespace proxy |
| 184 } // namespace ppapi | 184 } // namespace ppapi |
| OLD | NEW |