| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 unsigned long transport_rtt_msec, | 168 unsigned long transport_rtt_msec, |
| 169 double downlink_throughput_mbps) { | 169 double downlink_throughput_mbps) { |
| 170 DCHECK(IsMainThread()); | 170 DCHECK(IsMainThread()); |
| 171 ScopedNotifier notifier(*this); | 171 ScopedNotifier notifier(*this); |
| 172 { | 172 { |
| 173 MutexLocker locker(mutex_); | 173 MutexLocker locker(mutex_); |
| 174 has_override_ = true; | 174 has_override_ = true; |
| 175 override_.on_line_initialized = true; | 175 override_.on_line_initialized = true; |
| 176 override_.connection_initialized = true; | 176 override_.connection_initialized = true; |
| 177 override_.effective_type = effective_type; | 177 override_.effective_type = effective_type; |
| 178 override_.transport_rtt = | 178 override_.http_rtt = base::TimeDelta::FromMilliseconds(transport_rtt_msec); |
| 179 base::TimeDelta::FromMilliseconds(transport_rtt_msec); | |
| 180 override_.downlink_throughput_mbps = base::nullopt; | 179 override_.downlink_throughput_mbps = base::nullopt; |
| 181 if (downlink_throughput_mbps >= 0) | 180 if (downlink_throughput_mbps >= 0) |
| 182 override_.downlink_throughput_mbps = downlink_throughput_mbps; | 181 override_.downlink_throughput_mbps = downlink_throughput_mbps; |
| 183 } | 182 } |
| 184 } | 183 } |
| 185 | 184 |
| 186 void NetworkStateNotifier::ClearOverride() { | 185 void NetworkStateNotifier::ClearOverride() { |
| 187 DCHECK(IsMainThread()); | 186 DCHECK(IsMainThread()); |
| 188 ScopedNotifier notifier(*this); | 187 ScopedNotifier notifier(*this); |
| 189 { | 188 { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 306 |
| 308 list->zeroed_observers.clear(); | 307 list->zeroed_observers.clear(); |
| 309 | 308 |
| 310 if (list->observers.IsEmpty()) { | 309 if (list->observers.IsEmpty()) { |
| 311 MutexLocker locker(mutex_); | 310 MutexLocker locker(mutex_); |
| 312 map.erase(task_runner); // deletes list | 311 map.erase(task_runner); // deletes list |
| 313 } | 312 } |
| 314 } | 313 } |
| 315 | 314 |
| 316 } // namespace blink | 315 } // namespace blink |
| OLD | NEW |