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 #ifndef PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/observer_list_threadsafe.h" | 10 #include "base/observer_list_threadsafe.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 friend class NetworkMonitor; | 40 friend class NetworkMonitor; |
41 | 41 |
42 // IPC message handler for the messages received from the browser. | 42 // IPC message handler for the messages received from the browser. |
43 void OnPluginMsgNetworkList(uint32 plugin_dispatcher_id, | 43 void OnPluginMsgNetworkList(uint32 plugin_dispatcher_id, |
44 const ppapi::NetworkList& list); | 44 const ppapi::NetworkList& list); |
45 | 45 |
46 // Called by NetworkMonitor destructor. | 46 // Called by NetworkMonitor destructor. |
47 void OnNetworkMonitorDeleted(NetworkMonitor* monitor, | 47 void OnNetworkMonitorDeleted(NetworkMonitor* monitor, |
48 PP_Instance instance); | 48 PP_Instance instance); |
49 | 49 |
| 50 // We use ObserverListThreadSafe because we want to send notifications to the |
| 51 // same thread that created the NetworkMonitor. |
50 scoped_refptr<ObserverListThreadSafe<NetworkMonitor> > monitors_; | 52 scoped_refptr<ObserverListThreadSafe<NetworkMonitor> > monitors_; |
51 | 53 |
52 int monitors_count_; | 54 int monitors_count_; |
53 scoped_refptr<NetworkListStorage> current_list_; | 55 scoped_refptr<NetworkListStorage> current_list_; |
54 | 56 |
55 DISALLOW_COPY_AND_ASSIGN(PPB_NetworkMonitor_Private_Proxy); | 57 DISALLOW_COPY_AND_ASSIGN(PPB_NetworkMonitor_Private_Proxy); |
56 }; | 58 }; |
57 | 59 |
58 } // namespace proxy | 60 } // namespace proxy |
59 } // namespace ppapi | 61 } // namespace ppapi |
60 | 62 |
61 #endif // PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ | 63 #endif // PPAPI_PROXY_PPB_NETWORK_MONITOR_PRIVATE_PROXY_H_ |
OLD | NEW |