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 "net/url_request/url_request_throttler_manager.h" | 5 #include "net/url_request/url_request_throttler_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "net/base/url_util.h" | 9 #include "net/base/url_util.h" |
10 #include "net/log/net_log.h" | 10 #include "net/log/net_log.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 void URLRequestThrottlerManager::set_enable_thread_checks(bool enable) { | 115 void URLRequestThrottlerManager::set_enable_thread_checks(bool enable) { |
116 enable_thread_checks_ = enable; | 116 enable_thread_checks_ = enable; |
117 } | 117 } |
118 | 118 |
119 bool URLRequestThrottlerManager::enable_thread_checks() const { | 119 bool URLRequestThrottlerManager::enable_thread_checks() const { |
120 return enable_thread_checks_; | 120 return enable_thread_checks_; |
121 } | 121 } |
122 | 122 |
123 void URLRequestThrottlerManager::set_net_log(NetLog* net_log) { | 123 void URLRequestThrottlerManager::set_net_log(NetLog* net_log) { |
124 DCHECK(net_log); | 124 DCHECK(net_log); |
125 net_log_ = BoundNetLog::Make( | 125 net_log_ = NetLogWithSource::Make( |
126 net_log, NetLogSourceType::EXPONENTIAL_BACKOFF_THROTTLING); | 126 net_log, NetLogSourceType::EXPONENTIAL_BACKOFF_THROTTLING); |
127 } | 127 } |
128 | 128 |
129 NetLog* URLRequestThrottlerManager::net_log() const { | 129 NetLog* URLRequestThrottlerManager::net_log() const { |
130 return net_log_.net_log(); | 130 return net_log_.net_log(); |
131 } | 131 } |
132 | 132 |
133 void URLRequestThrottlerManager::OnIPAddressChanged() { | 133 void URLRequestThrottlerManager::OnIPAddressChanged() { |
134 OnNetworkChange(); | 134 OnNetworkChange(); |
135 } | 135 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 void URLRequestThrottlerManager::OnNetworkChange() { | 175 void URLRequestThrottlerManager::OnNetworkChange() { |
176 // Remove all entries. Any entries that in-flight requests have a reference | 176 // Remove all entries. Any entries that in-flight requests have a reference |
177 // to will live until those requests end, and these entries may be | 177 // to will live until those requests end, and these entries may be |
178 // inconsistent with new entries for the same URLs, but since what we | 178 // inconsistent with new entries for the same URLs, but since what we |
179 // want is a clean slate for the new connection type, this is OK. | 179 // want is a clean slate for the new connection type, this is OK. |
180 url_entries_.clear(); | 180 url_entries_.clear(); |
181 requests_since_last_gc_ = 0; | 181 requests_since_last_gc_ = 0; |
182 } | 182 } |
183 | 183 |
184 } // namespace net | 184 } // namespace net |
OLD | NEW |