OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 sigslot::signal0<> SignalError; | 66 sigslot::signal0<> SignalError; |
67 | 67 |
68 // Start/Stop monitoring of network interfaces | 68 // Start/Stop monitoring of network interfaces |
69 // list. SignalNetworksChanged or SignalError is emitted immediately | 69 // list. SignalNetworksChanged or SignalError is emitted immediately |
70 // after StartUpdating() is called. After that SignalNetworksChanged | 70 // after StartUpdating() is called. After that SignalNetworksChanged |
71 // is emitted whenever list of networks changes. | 71 // is emitted whenever list of networks changes. |
72 virtual void StartUpdating() = 0; | 72 virtual void StartUpdating() = 0; |
73 virtual void StopUpdating() = 0; | 73 virtual void StopUpdating() = 0; |
74 | 74 |
75 // Returns the current list of networks available on this machine. | 75 // Returns the current list of networks available on this machine. |
76 // UpdateNetworks() must be called before this method is called. | 76 // StartUpdating() must be called before this method is called. |
77 // It makes sure that repeated calls return the same object for a | 77 // It makes sure that repeated calls return the same object for a |
78 // given network, so that quality is tracked appropriately. Does not | 78 // given network, so that quality is tracked appropriately. Does not |
79 // include ignored networks. | 79 // include ignored networks. |
80 virtual void GetNetworks(NetworkList* networks) const = 0; | 80 virtual void GetNetworks(NetworkList* networks) const = 0; |
juberti1
2015/08/13 20:45:58
suggest that GetNetworks return a bool so that you
guoweis_webrtc
2015/08/13 20:54:14
Do you mean returning false here to reprenset the
juberti1
2015/08/13 22:10:11
yes, or any other sort of error occurred. The API
guoweis_webrtc
2015/08/13 22:49:36
there are existing override in chromium which prev
juberti1
2015/08/13 23:05:27
If you have to add a new function, I suggest addin
| |
81 | 81 |
82 // When this returns true, GetNetworks will not return any networks. | |
83 // GetAnyAddressNetworks should be used to retrieve the any address | |
84 // This function should only be called after SignalNetworksChanged is | |
85 // first signaled. | |
86 virtual bool adapter_enumeration_disabled() const { | |
juberti1
2015/08/13 20:45:58
If it's virtual, typically it won't have the all-l
guoweis_webrtc
2015/08/13 20:54:14
I think "can_get_networks" doesn't seem to convey
juberti1
2015/08/13 22:10:11
If enumeration is disabled, can_get_networks will
guoweis_webrtc
2015/08/13 22:49:36
I'll just use RetrieveNetworks, instead of introdu
| |
87 return false; | |
88 } | |
89 | |
82 // "AnyAddressNetwork" is a network which only contains single "any address" | 90 // "AnyAddressNetwork" is a network which only contains single "any address" |
83 // IP address. (i.e. INADDR_ANY for IPv4 or in6addr_any for IPv6). This is | 91 // IP address. (i.e. INADDR_ANY for IPv4 or in6addr_any for IPv6). This is |
84 // useful as binding to such interfaces allow default routing behavior like | 92 // useful as binding to such interfaces allow default routing behavior like |
85 // http traffic. | 93 // http traffic. |
86 // TODO(guoweis): remove this body when chromium implements this. | 94 // TODO(guoweis): remove this body when chromium implements this. |
87 virtual void GetAnyAddressNetworks(NetworkList* networks) {} | 95 virtual void GetAnyAddressNetworks(NetworkList* networks) {} |
88 | 96 |
89 // Dumps a list of networks available to LS_INFO. | 97 // Dumps a list of networks available to LS_INFO. |
90 virtual void DumpNetworks(bool include_ignored) {} | 98 virtual void DumpNetworks(bool include_ignored) {} |
91 | 99 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 bool ignored_; | 309 bool ignored_; |
302 AdapterType type_; | 310 AdapterType type_; |
303 int preference_; | 311 int preference_; |
304 | 312 |
305 friend class NetworkManager; | 313 friend class NetworkManager; |
306 }; | 314 }; |
307 | 315 |
308 } // namespace rtc | 316 } // namespace rtc |
309 | 317 |
310 #endif // WEBRTC_BASE_NETWORK_H_ | 318 #endif // WEBRTC_BASE_NETWORK_H_ |
OLD | NEW |