| 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 //////////////////////////////////////////////////////////////////////////////// | 5 //////////////////////////////////////////////////////////////////////////////// |
| 6 // Threading considerations: | 6 // Threading considerations: |
| 7 // | 7 // |
| 8 // This class is designed to meet various threading guarantees starting from the | 8 // This class is designed to meet various threading guarantees starting from the |
| 9 // ones imposed by NetworkChangeNotifier: | 9 // ones imposed by NetworkChangeNotifier: |
| 10 // - The notifier can be constructed on any thread. | 10 // - The notifier can be constructed on any thread. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // (network change notifier). The network change notifier than processes the | 53 // (network change notifier). The network change notifier than processes the |
| 54 // state change, and notifies each of its observers on their threads. | 54 // state change, and notifies each of its observers on their threads. |
| 55 // | 55 // |
| 56 // This can also be seen as: | 56 // This can also be seen as: |
| 57 // Android platform -> NetworkChangeNotifier (Java) -> | 57 // Android platform -> NetworkChangeNotifier (Java) -> |
| 58 // NetworkChangeNotifierDelegateAndroid -> NetworkChangeNotifierAndroid. | 58 // NetworkChangeNotifierDelegateAndroid -> NetworkChangeNotifierAndroid. |
| 59 | 59 |
| 60 #include "net/android/network_change_notifier_android.h" | 60 #include "net/android/network_change_notifier_android.h" |
| 61 | 61 |
| 62 #include "base/android/build_info.h" | 62 #include "base/android/build_info.h" |
| 63 #include "base/macros.h" |
| 63 #include "base/threading/thread.h" | 64 #include "base/threading/thread.h" |
| 64 #include "net/base/address_tracker_linux.h" | 65 #include "net/base/address_tracker_linux.h" |
| 65 #include "net/dns/dns_config_service_posix.h" | 66 #include "net/dns/dns_config_service_posix.h" |
| 66 | 67 |
| 67 namespace net { | 68 namespace net { |
| 68 | 69 |
| 69 // Expose kInvalidNetworkHandle out to Java as NetId.INVALID. The notion of | 70 // Expose kInvalidNetworkHandle out to Java as NetId.INVALID. The notion of |
| 70 // a NetID is an Android framework one, see android.net.Network.netId. | 71 // a NetID is an Android framework one, see android.net.Network.netId. |
| 71 // NetworkChangeNotifierAndroid implements NetworkHandle to simply be the NetID. | 72 // NetworkChangeNotifierAndroid implements NetworkHandle to simply be the NetID. |
| 72 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net | 73 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // so delay IPAddressChanged so they get merged with the following | 257 // so delay IPAddressChanged so they get merged with the following |
| 257 // ConnectionTypeChanged signal. | 258 // ConnectionTypeChanged signal. |
| 258 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1); | 259 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1); |
| 259 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1); | 260 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1); |
| 260 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0); | 261 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0); |
| 261 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0); | 262 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0); |
| 262 return params; | 263 return params; |
| 263 } | 264 } |
| 264 | 265 |
| 265 } // namespace net | 266 } // namespace net |
| OLD | NEW |