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

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

Issue 448143008: Move StringToUpperASCII and LowerCaseEqualsASCII to the 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/filter/filter.cc ('k') | net/http/http_auth_gssapi_posix.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.h" 5 #include "net/http/http_auth.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/strings/string_tokenizer.h" 10 #include "base/strings/string_tokenizer.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (disabled_schemes.find(current_scheme) != disabled_schemes.end()) 69 if (disabled_schemes.find(current_scheme) != disabled_schemes.end())
70 return HttpAuth::AUTHORIZATION_RESULT_REJECT; 70 return HttpAuth::AUTHORIZATION_RESULT_REJECT;
71 std::string current_scheme_name = SchemeToString(current_scheme); 71 std::string current_scheme_name = SchemeToString(current_scheme);
72 const std::string header_name = GetChallengeHeaderName(target); 72 const std::string header_name = GetChallengeHeaderName(target);
73 void* iter = NULL; 73 void* iter = NULL;
74 std::string challenge; 74 std::string challenge;
75 HttpAuth::AuthorizationResult authorization_result = 75 HttpAuth::AuthorizationResult authorization_result =
76 HttpAuth::AUTHORIZATION_RESULT_INVALID; 76 HttpAuth::AUTHORIZATION_RESULT_INVALID;
77 while (headers->EnumerateHeader(&iter, header_name, &challenge)) { 77 while (headers->EnumerateHeader(&iter, header_name, &challenge)) {
78 HttpAuthChallengeTokenizer props(challenge.begin(), challenge.end()); 78 HttpAuthChallengeTokenizer props(challenge.begin(), challenge.end());
79 if (!LowerCaseEqualsASCII(props.scheme(), current_scheme_name.c_str())) 79 if (!base::LowerCaseEqualsASCII(props.scheme(),
80 current_scheme_name.c_str()))
80 continue; 81 continue;
81 authorization_result = handler->HandleAnotherChallenge(&props); 82 authorization_result = handler->HandleAnotherChallenge(&props);
82 if (authorization_result != HttpAuth::AUTHORIZATION_RESULT_INVALID) { 83 if (authorization_result != HttpAuth::AUTHORIZATION_RESULT_INVALID) {
83 *challenge_used = challenge; 84 *challenge_used = challenge;
84 return authorization_result; 85 return authorization_result;
85 } 86 }
86 } 87 }
87 // Finding no matches is equivalent to rejection. 88 // Finding no matches is equivalent to rejection.
88 return HttpAuth::AUTHORIZATION_RESULT_REJECT; 89 return HttpAuth::AUTHORIZATION_RESULT_REJECT;
89 } 90 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 COMPILE_ASSERT(arraysize(kSchemeNames) == AUTH_SCHEME_MAX, 141 COMPILE_ASSERT(arraysize(kSchemeNames) == AUTH_SCHEME_MAX,
141 http_auth_scheme_names_incorrect_size); 142 http_auth_scheme_names_incorrect_size);
142 if (scheme < AUTH_SCHEME_BASIC || scheme >= AUTH_SCHEME_MAX) { 143 if (scheme < AUTH_SCHEME_BASIC || scheme >= AUTH_SCHEME_MAX) {
143 NOTREACHED(); 144 NOTREACHED();
144 return "invalid_scheme"; 145 return "invalid_scheme";
145 } 146 }
146 return kSchemeNames[scheme]; 147 return kSchemeNames[scheme];
147 } 148 }
148 149
149 } // namespace net 150 } // namespace net
OLDNEW
« no previous file with comments | « net/filter/filter.cc ('k') | net/http/http_auth_gssapi_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698