| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 28 matching lines...) Expand all Loading... |
| 39 ADAPTER_TYPE_LOOPBACK = 1 << 4 | 39 ADAPTER_TYPE_LOOPBACK = 1 << 4 |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 class NetworkBinderInterface { | 42 class NetworkBinderInterface { |
| 43 public: | 43 public: |
| 44 // Binds a socket to the network that is attached to |address| so that all | 44 // Binds a socket to the network that is attached to |address| so that all |
| 45 // packets on the socket |socket_fd| will be sent via that network. | 45 // packets on the socket |socket_fd| will be sent via that network. |
| 46 // This is needed because some operating systems (like Android) require a | 46 // This is needed because some operating systems (like Android) require a |
| 47 // special bind call to put packets on a non-default network interface. | 47 // special bind call to put packets on a non-default network interface. |
| 48 virtual int BindSocketToNetwork(int socket_fd, const IPAddress& address) = 0; | 48 virtual int BindSocketToNetwork(int socket_fd, const IPAddress& address) = 0; |
| 49 virtual ~NetworkBinderInterface() {} |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 /* | 52 /* |
| 52 * Receives network-change events via |OnNetworksChanged| and signals the | 53 * Receives network-change events via |OnNetworksChanged| and signals the |
| 53 * networks changed event. | 54 * networks changed event. |
| 54 * | 55 * |
| 55 * Threading consideration: | 56 * Threading consideration: |
| 56 * It is expected that all upstream operations (from native to Java) are | 57 * It is expected that all upstream operations (from native to Java) are |
| 57 * performed from the worker thread. This includes creating, starting and | 58 * performed from the worker thread. This includes creating, starting and |
| 58 * stopping the monitor. This avoids the potential race condition when creating | 59 * stopping the monitor. This avoids the potential race condition when creating |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 119 |
| 119 virtual ~NetworkMonitorFactory(); | 120 virtual ~NetworkMonitorFactory(); |
| 120 | 121 |
| 121 protected: | 122 protected: |
| 122 NetworkMonitorFactory(); | 123 NetworkMonitorFactory(); |
| 123 }; | 124 }; |
| 124 | 125 |
| 125 } // namespace rtc | 126 } // namespace rtc |
| 126 | 127 |
| 127 #endif // WEBRTC_BASE_NETWORKMONITOR_H_ | 128 #endif // WEBRTC_BASE_NETWORKMONITOR_H_ |
| OLD | NEW |