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 #ifndef PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_ |
6 #define PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_ | 6 #define PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "ppapi/proxy/network_list_resource.h" | 10 #include "ppapi/proxy/network_list_resource.h" |
11 #include "ppapi/proxy/plugin_resource.h" | 11 #include "ppapi/proxy/plugin_resource.h" |
12 #include "ppapi/shared_impl/scoped_pp_resource.h" | 12 #include "ppapi/shared_impl/scoped_pp_resource.h" |
13 #include "ppapi/thunk/ppb_network_monitor_api.h" | 13 #include "ppapi/thunk/ppb_network_monitor_api.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class MessageLoopProxy; | 16 class MessageLoopProxy; |
17 } // namespace base | 17 } // namespace base |
18 | 18 |
19 namespace ppapi { | 19 namespace ppapi { |
20 namespace proxy { | 20 namespace proxy { |
21 | 21 |
22 class NetworkMonitorResource : public PluginResource, | 22 class NetworkMonitorResource : public PluginResource, |
23 public thunk::PPB_NetworkMonitor_API { | 23 public thunk::PPB_NetworkMonitor_API { |
24 public: | 24 public: |
25 explicit NetworkMonitorResource(Connection connection, | 25 explicit NetworkMonitorResource(Connection connection, |
26 PP_Instance instance); | 26 PP_Instance instance); |
27 virtual ~NetworkMonitorResource(); | 27 virtual ~NetworkMonitorResource(); |
28 | 28 |
29 // PluginResource overrides. | 29 // PluginResource overrides. |
30 ppapi::thunk::PPB_NetworkMonitor_API* AsPPB_NetworkMonitor_API() OVERRIDE; | 30 ppapi::thunk::PPB_NetworkMonitor_API* AsPPB_NetworkMonitor_API() override; |
31 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, | 31 virtual void OnReplyReceived(const ResourceMessageReplyParams& params, |
32 const IPC::Message& msg) OVERRIDE; | 32 const IPC::Message& msg) override; |
33 | 33 |
34 // thunk::PPB_NetworkMonitor_API interface | 34 // thunk::PPB_NetworkMonitor_API interface |
35 virtual int32_t UpdateNetworkList( | 35 virtual int32_t UpdateNetworkList( |
36 PP_Resource* network_list, | 36 PP_Resource* network_list, |
37 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 37 scoped_refptr<TrackedCallback> callback) override; |
38 | 38 |
39 private: | 39 private: |
40 // IPC message handlers for the messages received from the browser. | 40 // IPC message handlers for the messages received from the browser. |
41 void OnPluginMsgNetworkList(const ResourceMessageReplyParams& params, | 41 void OnPluginMsgNetworkList(const ResourceMessageReplyParams& params, |
42 const SerializedNetworkList& list); | 42 const SerializedNetworkList& list); |
43 void OnPluginMsgForbidden(const ResourceMessageReplyParams& params); | 43 void OnPluginMsgForbidden(const ResourceMessageReplyParams& params); |
44 | 44 |
45 ScopedPPResource current_list_; | 45 ScopedPPResource current_list_; |
46 bool forbidden_; | 46 bool forbidden_; |
47 | 47 |
48 // Parameters passed to UpdateNetworkList(). | 48 // Parameters passed to UpdateNetworkList(). |
49 PP_Resource* network_list_; | 49 PP_Resource* network_list_; |
50 scoped_refptr<TrackedCallback> update_callback_; | 50 scoped_refptr<TrackedCallback> update_callback_; |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(NetworkMonitorResource); | 52 DISALLOW_COPY_AND_ASSIGN(NetworkMonitorResource); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace proxy | 55 } // namespace proxy |
56 } // namespace ppapi | 56 } // namespace ppapi |
57 | 57 |
58 #endif // PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_ | 58 #endif // PPAPI_PROXY_NETWORK_MONITOR_RESOURCE_H_ |
OLD | NEW |