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_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_ | 5 #ifndef PPAPI_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_ |
6 #define PPAPI_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_ | 6 #define PPAPI_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_ |
7 | 7 |
8 #include "ppapi/cpp/private/network_monitor_private.h" | 8 #include "ppapi/cpp/private/network_monitor_private.h" |
9 | 9 |
10 namespace pp { | 10 namespace pp { |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 protected: | 25 protected: |
26 /// Called once after this object is created and later every time | 26 /// Called once after this object is created and later every time |
27 /// network configuration changes. Child classes must implement this | 27 /// network configuration changes. Child classes must implement this |
28 /// method. | 28 /// method. |
29 /// | 29 /// |
30 /// @param[in] list The current list of network interfaces. | 30 /// @param[in] list The current list of network interfaces. |
31 virtual void OnNetworkListChanged(const NetworkListPrivate& list) = 0; | 31 virtual void OnNetworkListChanged(const NetworkListPrivate& list) = 0; |
32 | 32 |
33 private: | 33 private: |
| 34 // Private copy constructor and assign operator to disallow copying of this |
| 35 // object. This is necessary to guarantee that |monitor_| is not shared with |
| 36 // another list observer and is always destroyed when this object is |
| 37 // destroyed. |
| 38 NetworkListObserverPrivate(const NetworkListObserverPrivate&); |
| 39 void operator=(const NetworkListObserverPrivate&); |
| 40 |
34 static void NetworkListCallbackHandler(void* user_data, | 41 static void NetworkListCallbackHandler(void* user_data, |
35 PP_Resource list_resource); | 42 PP_Resource list_resource); |
36 | 43 |
37 NetworkMonitorPrivate monitor_; | 44 NetworkMonitorPrivate monitor_; |
38 }; | 45 }; |
39 | 46 |
40 } // namespace pp | 47 } // namespace pp |
41 | 48 |
42 #endif // PPAPI_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_ | 49 #endif // PPAPI_UTILITY_PRIVATE_NETWORK_LIST_OBSERVER_H_ |
OLD | NEW |