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

Side by Side Diff: net/http/http_auth_cache.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.cc ('k') | net/http/http_response_headers.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/http/http_auth_cache.h" 5 #include "net/http/http_auth_cache.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 10
(...skipping 19 matching lines...) Expand all
30 // (should be absolute path, or empty string). 30 // (should be absolute path, or empty string).
31 void CheckPathIsValid(const std::string& path) { 31 void CheckPathIsValid(const std::string& path) {
32 DCHECK(path.empty() || path[0] == '/'); 32 DCHECK(path.empty() || path[0] == '/');
33 } 33 }
34 34
35 // Return true if |path| is a subpath of |container|. In other words, is 35 // Return true if |path| is a subpath of |container|. In other words, is
36 // |container| an ancestor of |path|? 36 // |container| an ancestor of |path|?
37 bool IsEnclosingPath(const std::string& container, const std::string& path) { 37 bool IsEnclosingPath(const std::string& container, const std::string& path) {
38 DCHECK(container.empty() || *(container.end() - 1) == '/'); 38 DCHECK(container.empty() || *(container.end() - 1) == '/');
39 return ((container.empty() && path.empty()) || 39 return ((container.empty() && path.empty()) ||
40 (!container.empty() && StartsWithASCII(path, container, true))); 40 (!container.empty() && base::StartsWithASCII(path, container, true)));
41 } 41 }
42 42
43 // Debug helper to check that |origin| arguments are properly formed. 43 // Debug helper to check that |origin| arguments are properly formed.
44 void CheckOriginIsValid(const GURL& origin) { 44 void CheckOriginIsValid(const GURL& origin) {
45 DCHECK(origin.is_valid()); 45 DCHECK(origin.is_valid());
46 // Note that the scheme may be FTP when we're using a HTTP proxy. 46 // Note that the scheme may be FTP when we're using a HTTP proxy.
47 DCHECK(origin.SchemeIsHTTPOrHTTPS() || origin.SchemeIs("ftp") || 47 DCHECK(origin.SchemeIsHTTPOrHTTPS() || origin.SchemeIs("ftp") ||
48 origin.SchemeIsWSOrWSS()); 48 origin.SchemeIsWSOrWSS());
49 DCHECK(origin.GetOrigin() == origin); 49 DCHECK(origin.GetOrigin() == origin);
50 } 50 }
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // Copy all other paths. 276 // Copy all other paths.
277 for (Entry::PathList::const_reverse_iterator it2 = ++it->paths_.rbegin(); 277 for (Entry::PathList::const_reverse_iterator it2 = ++it->paths_.rbegin();
278 it2 != it->paths_.rend(); ++it2) 278 it2 != it->paths_.rend(); ++it2)
279 entry->AddPath(*it2); 279 entry->AddPath(*it2);
280 // Copy nonce count (for digest authentication). 280 // Copy nonce count (for digest authentication).
281 entry->nonce_count_ = it->nonce_count_; 281 entry->nonce_count_ = it->nonce_count_;
282 } 282 }
283 } 283 }
284 284
285 } // namespace net 285 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_directory_listing_parser_vms.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698