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

Unified Diff: net/socket_stream/socket_stream.cc

Issue 6191001: Cleanup: Use AUTH_SCHEME enum instead of a string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Merge with trunk Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/ssl_client_socket_pool_unittest.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket_stream/socket_stream.cc
===================================================================
--- net/socket_stream/socket_stream.cc (revision 71164)
+++ net/socket_stream/socket_stream.cc (working copy)
@@ -614,7 +614,8 @@
// Support basic authentication scheme only, because we don't have
// HttpRequestInfo.
// TODO(ukai): Add support other authentication scheme.
- if (auth_handler_.get() && auth_handler_->scheme() == "basic") {
+ if (auth_handler_.get() &&
+ auth_handler_->auth_scheme() == HttpAuth::AUTH_SCHEME_BASIC) {
HttpRequestInfo request_info;
std::string auth_token;
int rv = auth_handler_->GenerateAuthToken(
@@ -749,7 +750,8 @@
auth_info_->is_proxy = true;
auth_info_->host_and_port =
ASCIIToWide(proxy_info_.proxy_server().host_port_pair().ToString());
- auth_info_->scheme = ASCIIToWide(auth_handler_->scheme());
+ auth_info_->scheme = ASCIIToWide(
+ HttpAuth::SchemeToString(auth_handler_->auth_scheme()));
auth_info_->realm = ASCIIToWide(auth_handler_->realm());
// Wait until RestartWithAuth or Close is called.
MessageLoop::current()->PostTask(
@@ -944,7 +946,7 @@
if (auth_identity_.source != HttpAuth::IDENT_SRC_PATH_LOOKUP)
auth_cache_.Remove(auth_origin,
auth_handler_->realm(),
- auth_handler_->scheme(),
+ auth_handler_->auth_scheme(),
auth_identity_.username,
auth_identity_.password);
auth_handler_.reset();
@@ -952,7 +954,7 @@
}
auth_identity_.invalid = true;
- std::set<std::string> disabled_schemes;
+ std::set<HttpAuth::Scheme> disabled_schemes;
HttpAuth::ChooseBestChallenge(http_auth_handler_factory_, headers,
HttpAuth::AUTH_PROXY,
auth_origin, disabled_schemes,
@@ -964,8 +966,8 @@
if (auth_handler_->NeedsIdentity()) {
// We only support basic authentication scheme now.
// TODO(ukai): Support other authentication scheme.
- HttpAuthCache::Entry* entry =
- auth_cache_.Lookup(auth_origin, auth_handler_->realm(), "basic");
+ HttpAuthCache::Entry* entry = auth_cache_.Lookup(
+ auth_origin, auth_handler_->realm(), HttpAuth::AUTH_SCHEME_BASIC);
if (entry) {
auth_identity_.source = HttpAuth::IDENT_SRC_REALM_LOOKUP;
auth_identity_.invalid = false;
@@ -991,7 +993,7 @@
DCHECK_EQ(next_state_, STATE_AUTH_REQUIRED);
auth_cache_.Add(ProxyAuthOrigin(),
auth_handler_->realm(),
- auth_handler_->scheme(),
+ auth_handler_->auth_scheme(),
auth_handler_->challenge(),
auth_identity_.username,
auth_identity_.password,
« no previous file with comments | « net/socket/ssl_client_socket_pool_unittest.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698