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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 GetStaticMethodID( | 170 GetStaticMethodID( |
171 jni(), | 171 jni(), |
172 *j_network_monitor_class_, | 172 *j_network_monitor_class_, |
173 "init", | 173 "init", |
174 "(Landroid/content/Context;)Lorg/webrtc/NetworkMonitor;"), | 174 "(Landroid/content/Context;)Lorg/webrtc/NetworkMonitor;"), |
175 application_context_)) { | 175 application_context_)) { |
176 ASSERT(application_context_ != nullptr); | 176 ASSERT(application_context_ != nullptr); |
177 CHECK_EXCEPTION(jni()) << "Error during NetworkMonitor.init"; | 177 CHECK_EXCEPTION(jni()) << "Error during NetworkMonitor.init"; |
178 } | 178 } |
179 | 179 |
| 180 AndroidNetworkMonitor::~AndroidNetworkMonitor() {} |
| 181 |
180 void AndroidNetworkMonitor::Start() { | 182 void AndroidNetworkMonitor::Start() { |
181 RTC_CHECK(thread_checker_.CalledOnValidThread()); | 183 RTC_CHECK(thread_checker_.CalledOnValidThread()); |
182 if (started_) { | 184 if (started_) { |
183 return; | 185 return; |
184 } | 186 } |
185 started_ = true; | 187 started_ = true; |
186 | 188 |
187 // This is kind of magic behavior, but doing this allows the SocketServer to | 189 // This is kind of magic behavior, but doing this allows the SocketServer to |
188 // use this as a NetworkBinder to bind sockets on a particular network when | 190 // use this as a NetworkBinder to bind sockets on a particular network when |
189 // it creates sockets. | 191 // it creates sockets. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 JOW(void, NetworkMonitor_nativeNotifyOfNetworkDisconnect)( | 361 JOW(void, NetworkMonitor_nativeNotifyOfNetworkDisconnect)( |
360 JNIEnv* jni, jobject j_monitor, jlong j_native_monitor, | 362 JNIEnv* jni, jobject j_monitor, jlong j_native_monitor, |
361 jint network_handle) { | 363 jint network_handle) { |
362 AndroidNetworkMonitor* network_monitor = | 364 AndroidNetworkMonitor* network_monitor = |
363 reinterpret_cast<AndroidNetworkMonitor*>(j_native_monitor); | 365 reinterpret_cast<AndroidNetworkMonitor*>(j_native_monitor); |
364 network_monitor->OnNetworkDisconnected( | 366 network_monitor->OnNetworkDisconnected( |
365 static_cast<NetworkHandle>(network_handle)); | 367 static_cast<NetworkHandle>(network_handle)); |
366 } | 368 } |
367 | 369 |
368 } // namespace webrtc_jni | 370 } // namespace webrtc_jni |
OLD | NEW |