| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ |
| 7 |
| 8 #include <list> |
| 9 |
| 10 #include "base/observer_list_threadsafe.h" |
| 11 #include "ppapi/proxy/interface_proxy.h" |
| 12 #include "ppapi/shared_impl/ppb_network_list_private_shared.h" |
| 13 #include "ppapi/shared_impl/scoped_pp_resource.h" |
| 14 #include "ppapi/thunk/ppb_network_monitor_private_api.h" |
| 15 |
| 16 namespace base { |
| 17 class MessageLoopProxy; |
| 18 } // namespace base |
| 19 |
| 20 namespace ppapi { |
| 21 namespace proxy { |
| 22 |
| 23 class PPAPI_SHARED_EXPORT PPB_NetworkMonitor_Private_Proxy |
| 24 : public InterfaceProxy { |
| 25 public: |
| 26 explicit PPB_NetworkMonitor_Private_Proxy(Dispatcher* dispatcher); |
| 27 virtual ~PPB_NetworkMonitor_Private_Proxy(); |
| 28 |
| 29 // Creates n NetworkManager object in the plugin process. |
| 30 static PP_Resource CreateProxyResource(PP_Instance instance, |
| 31 PPB_NetworkMonitor_Callback callback, |
| 32 void* user_data); |
| 33 |
| 34 // InterfaceProxy implementation. |
| 35 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 36 |
| 37 static const ApiID kApiID = API_ID_PPB_NETWORKMANAGER_PRIVATE; |
| 38 |
| 39 private: |
| 40 class NetworkMonitor; |
| 41 friend class NetworkMonitor; |
| 42 |
| 43 // IPC message handler for the messages received from the browser. |
| 44 void OnPluginMsgNetworkList(uint32 plugin_dispatcher_id, |
| 45 const ppapi::NetworkList& list); |
| 46 |
| 47 // Called by NetworkMonitor destructor. |
| 48 void OnNetworkMonitorDeleted(NetworkMonitor* monitor, |
| 49 PP_Instance instance); |
| 50 |
| 51 scoped_refptr<ObserverListThreadSafe<NetworkMonitor> > monitors_; |
| 52 |
| 53 int monitors_count_; |
| 54 scoped_refptr<NetworkListStorage> current_list_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(PPB_NetworkMonitor_Private_Proxy); |
| 57 }; |
| 58 |
| 59 } // namespace proxy |
| 60 } // namespace ppapi |
| 61 |
| 62 #endif // PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ |
| OLD | NEW |