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

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

Issue 10916272: Remove HttpAuth::Scheme enum in favor of a string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/http/http_auth_handler.cc ('k') | net/http/http_auth_handler_digest.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_handler_basic.h" 5 #include "net/http/http_auth_handler_basic.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/i18n/icu_string_conversions.h" 10 #include "base/i18n/icu_string_conversions.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 if (!base::ConvertToUtf8AndNormalize( 45 if (!base::ConvertToUtf8AndNormalize(
46 parameters.value(), base::kCodepageLatin1, realm)) 46 parameters.value(), base::kCodepageLatin1, realm))
47 return false; 47 return false;
48 } 48 }
49 return parameters.valid(); 49 return parameters.valid();
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 bool HttpAuthHandlerBasic::Init(HttpAuth::ChallengeTokenizer* challenge) { 54 bool HttpAuthHandlerBasic::Init(HttpAuth::ChallengeTokenizer* challenge) {
55 auth_scheme_ = HttpAuth::AUTH_SCHEME_BASIC; 55 auth_scheme_ = "basic";
56 score_ = 1; 56 score_ = 1;
57 properties_ = 0; 57 properties_ = 0;
58 return ParseChallenge(challenge); 58 return ParseChallenge(challenge);
59 } 59 }
60 60
61 bool HttpAuthHandlerBasic::ParseChallenge( 61 bool HttpAuthHandlerBasic::ParseChallenge(
62 HttpAuth::ChallengeTokenizer* challenge) { 62 HttpAuth::ChallengeTokenizer* challenge) {
63 // Verify the challenge's auth-scheme. 63 // Verify the challenge's auth-scheme.
64 if (!LowerCaseEqualsASCII(challenge->scheme(), "basic")) 64 if (!LowerCaseEqualsASCII(challenge->scheme(), "basic"))
65 return false; 65 return false;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // TODO(cbentzel): Move towards model of parsing in the factory 119 // TODO(cbentzel): Move towards model of parsing in the factory
120 // method and only constructing when valid. 120 // method and only constructing when valid.
121 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerBasic()); 121 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerBasic());
122 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) 122 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log))
123 return ERR_INVALID_RESPONSE; 123 return ERR_INVALID_RESPONSE;
124 handler->swap(tmp_handler); 124 handler->swap(tmp_handler);
125 return OK; 125 return OK;
126 } 126 }
127 127
128 } // namespace net 128 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler.cc ('k') | net/http/http_auth_handler_digest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698