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 #include "extensions/browser/extension_throttle_manager.h" | 5 #include "extensions/browser/extension_throttle_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void ExtensionThrottleManager::set_enable_thread_checks(bool enable) { | 151 void ExtensionThrottleManager::set_enable_thread_checks(bool enable) { |
152 enable_thread_checks_ = enable; | 152 enable_thread_checks_ = enable; |
153 } | 153 } |
154 | 154 |
155 bool ExtensionThrottleManager::enable_thread_checks() const { | 155 bool ExtensionThrottleManager::enable_thread_checks() const { |
156 return enable_thread_checks_; | 156 return enable_thread_checks_; |
157 } | 157 } |
158 | 158 |
159 void ExtensionThrottleManager::set_net_log(net::NetLog* net_log) { | 159 void ExtensionThrottleManager::set_net_log(net::NetLog* net_log) { |
160 DCHECK(net_log); | 160 DCHECK(net_log); |
161 net_log_ = net::BoundNetLog::Make( | 161 net_log_ = net::NetLogWithSource::Make( |
162 net_log, net::NetLogSourceType::EXPONENTIAL_BACKOFF_THROTTLING); | 162 net_log, net::NetLogSourceType::EXPONENTIAL_BACKOFF_THROTTLING); |
163 } | 163 } |
164 | 164 |
165 net::NetLog* ExtensionThrottleManager::net_log() const { | 165 net::NetLog* ExtensionThrottleManager::net_log() const { |
166 return net_log_.net_log(); | 166 return net_log_.net_log(); |
167 } | 167 } |
168 | 168 |
169 void ExtensionThrottleManager::OnIPAddressChanged() { | 169 void ExtensionThrottleManager::OnIPAddressChanged() { |
170 OnNetworkChange(); | 170 OnNetworkChange(); |
171 } | 171 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 void ExtensionThrottleManager::OnNetworkChange() { | 211 void ExtensionThrottleManager::OnNetworkChange() { |
212 // Remove all entries. Any entries that in-flight requests have a reference | 212 // Remove all entries. Any entries that in-flight requests have a reference |
213 // to will live until those requests end, and these entries may be | 213 // to will live until those requests end, and these entries may be |
214 // inconsistent with new entries for the same URLs, but since what we | 214 // inconsistent with new entries for the same URLs, but since what we |
215 // want is a clean slate for the new connection type, this is OK. | 215 // want is a clean slate for the new connection type, this is OK. |
216 url_entries_.clear(); | 216 url_entries_.clear(); |
217 requests_since_last_gc_ = 0; | 217 requests_since_last_gc_ = 0; |
218 } | 218 } |
219 | 219 |
220 } // namespace extensions | 220 } // namespace extensions |
OLD | NEW |