| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/network_monitor_resource.h" | 5 #include "ppapi/proxy/network_monitor_resource.h" |
| 6 | 6 |
| 7 #include "ppapi/proxy/dispatch_reply_message.h" | 7 #include "ppapi/proxy/dispatch_reply_message.h" |
| 8 #include "ppapi/proxy/ppapi_messages.h" | 8 #include "ppapi/proxy/ppapi_messages.h" |
| 9 #include "ppapi/thunk/enter.h" | 9 #include "ppapi/thunk/enter.h" |
| 10 #include "ppapi/thunk/ppb_network_monitor_api.h" | 10 #include "ppapi/thunk/ppb_network_monitor_api.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 NetworkMonitorResource::~NetworkMonitorResource() {} | 24 NetworkMonitorResource::~NetworkMonitorResource() {} |
| 25 | 25 |
| 26 ppapi::thunk::PPB_NetworkMonitor_API* | 26 ppapi::thunk::PPB_NetworkMonitor_API* |
| 27 NetworkMonitorResource::AsPPB_NetworkMonitor_API() { | 27 NetworkMonitorResource::AsPPB_NetworkMonitor_API() { |
| 28 return this; | 28 return this; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void NetworkMonitorResource::OnReplyReceived( | 31 void NetworkMonitorResource::OnReplyReceived( |
| 32 const ResourceMessageReplyParams& params, | 32 const ResourceMessageReplyParams& params, |
| 33 const IPC::Message& msg) { | 33 const IPC::Message& msg) { |
| 34 IPC_BEGIN_MESSAGE_MAP(NetworkMonitorResource, msg) | 34 PPAPI_BEGIN_MESSAGE_MAP(NetworkMonitorResource, msg) |
| 35 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( | 35 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL( |
| 36 PpapiPluginMsg_NetworkMonitor_NetworkList, OnPluginMsgNetworkList) | 36 PpapiPluginMsg_NetworkMonitor_NetworkList, OnPluginMsgNetworkList) |
| 37 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_0( | 37 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_0( |
| 38 PpapiPluginMsg_NetworkMonitor_Forbidden, OnPluginMsgForbidden) | 38 PpapiPluginMsg_NetworkMonitor_Forbidden, OnPluginMsgForbidden) |
| 39 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED( | 39 PPAPI_DISPATCH_PLUGIN_RESOURCE_CALL_UNHANDLED( |
| 40 PluginResource::OnReplyReceived(params, msg)) | 40 PluginResource::OnReplyReceived(params, msg)) |
| 41 IPC_END_MESSAGE_MAP() | 41 PPAPI_END_MESSAGE_MAP() |
| 42 } | 42 } |
| 43 | 43 |
| 44 int32_t NetworkMonitorResource::UpdateNetworkList( | 44 int32_t NetworkMonitorResource::UpdateNetworkList( |
| 45 PP_Resource* network_list, | 45 PP_Resource* network_list, |
| 46 scoped_refptr<TrackedCallback> callback) { | 46 scoped_refptr<TrackedCallback> callback) { |
| 47 if (!network_list) | 47 if (!network_list) |
| 48 return PP_ERROR_BADARGUMENT; | 48 return PP_ERROR_BADARGUMENT; |
| 49 if (TrackedCallback::IsPending(update_callback_)) | 49 if (TrackedCallback::IsPending(update_callback_)) |
| 50 return PP_ERROR_INPROGRESS; | 50 return PP_ERROR_INPROGRESS; |
| 51 if (forbidden_) | 51 if (forbidden_) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 76 void NetworkMonitorResource::OnPluginMsgForbidden( | 76 void NetworkMonitorResource::OnPluginMsgForbidden( |
| 77 const ResourceMessageReplyParams& params) { | 77 const ResourceMessageReplyParams& params) { |
| 78 forbidden_ = true; | 78 forbidden_ = true; |
| 79 | 79 |
| 80 if (TrackedCallback::IsPending(update_callback_)) | 80 if (TrackedCallback::IsPending(update_callback_)) |
| 81 update_callback_->Run(PP_ERROR_NOACCESS); | 81 update_callback_->Run(PP_ERROR_NOACCESS); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace proxy | 84 } // namespace proxy |
| 85 } // namespace ppapi | 85 } // namespace ppapi |
| OLD | NEW |