Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Side by Side Diff: net/url_request/url_request_throttler_manager.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/tools/quic/spdy_utils.cc ('k') | net/websockets/websocket_handshake_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 void URLRequestThrottlerManager::OnConnectionTypeChanged( 156 void URLRequestThrottlerManager::OnConnectionTypeChanged(
157 NetworkChangeNotifier::ConnectionType type) { 157 NetworkChangeNotifier::ConnectionType type) {
158 OnNetworkChange(); 158 OnNetworkChange();
159 } 159 }
160 160
161 std::string URLRequestThrottlerManager::GetIdFromUrl(const GURL& url) const { 161 std::string URLRequestThrottlerManager::GetIdFromUrl(const GURL& url) const {
162 if (!url.is_valid()) 162 if (!url.is_valid())
163 return url.possibly_invalid_spec(); 163 return url.possibly_invalid_spec();
164 164
165 GURL id = url.ReplaceComponents(url_id_replacements_); 165 GURL id = url.ReplaceComponents(url_id_replacements_);
166 return StringToLowerASCII(id.spec()).c_str(); 166 return base::StringToLowerASCII(id.spec()).c_str();
167 } 167 }
168 168
169 void URLRequestThrottlerManager::GarbageCollectEntriesIfNecessary() { 169 void URLRequestThrottlerManager::GarbageCollectEntriesIfNecessary() {
170 requests_since_last_gc_++; 170 requests_since_last_gc_++;
171 if (requests_since_last_gc_ < kRequestsBetweenCollecting) 171 if (requests_since_last_gc_ < kRequestsBetweenCollecting)
172 return; 172 return;
173 requests_since_last_gc_ = 0; 173 requests_since_last_gc_ = 0;
174 174
175 GarbageCollectEntries(); 175 GarbageCollectEntries();
176 } 176 }
(...skipping 17 matching lines...) Expand all
194 void URLRequestThrottlerManager::OnNetworkChange() { 194 void URLRequestThrottlerManager::OnNetworkChange() {
195 // Remove all entries. Any entries that in-flight requests have a reference 195 // Remove all entries. Any entries that in-flight requests have a reference
196 // to will live until those requests end, and these entries may be 196 // to will live until those requests end, and these entries may be
197 // inconsistent with new entries for the same URLs, but since what we 197 // inconsistent with new entries for the same URLs, but since what we
198 // want is a clean slate for the new connection type, this is OK. 198 // want is a clean slate for the new connection type, this is OK.
199 url_entries_.clear(); 199 url_entries_.clear();
200 requests_since_last_gc_ = 0; 200 requests_since_last_gc_ = 0;
201 } 201 }
202 202
203 } // namespace net 203 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/spdy_utils.cc ('k') | net/websockets/websocket_handshake_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698