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

Unified Diff: net/http/http_auth_controller.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/http/http_auth_controller.h ('k') | net/http/http_auth_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_controller.cc
===================================================================
--- net/http/http_auth_controller.cc (revision 71164)
+++ net/http/http_auth_controller.cc (working copy)
@@ -96,8 +96,8 @@
DCHECK_EQ(first_thread, base::PlatformThread::CurrentId());
#endif
- HttpAuthHandler::AuthScheme auth_scheme = handler->auth_scheme();
- DCHECK(auth_scheme >= 0 && auth_scheme < HttpAuthHandler::AUTH_SCHEME_MAX);
+ HttpAuth::Scheme auth_scheme = handler->auth_scheme();
+ DCHECK(auth_scheme >= 0 && auth_scheme < HttpAuth::AUTH_SCHEME_MAX);
// Record start and rejection events for authentication.
//
@@ -111,7 +111,7 @@
// Negotiate Start: 6
// Negotiate Reject: 7
static const int kEventBucketsEnd =
- HttpAuthHandler::AUTH_SCHEME_MAX * AUTH_EVENT_MAX;
+ HttpAuth::AUTH_SCHEME_MAX * AUTH_EVENT_MAX;
int event_bucket = auth_scheme * AUTH_EVENT_MAX + auth_event;
DCHECK(event_bucket >= 0 && event_bucket < kEventBucketsEnd);
UMA_HISTOGRAM_ENUMERATION("Net.HttpAuthCount", event_bucket,
@@ -139,7 +139,7 @@
if (auth_event != AUTH_EVENT_START)
return;
static const int kTargetBucketsEnd =
- HttpAuthHandler::AUTH_SCHEME_MAX * AUTH_TARGET_MAX;
+ HttpAuth::AUTH_SCHEME_MAX * AUTH_TARGET_MAX;
AuthTarget auth_target = DetermineAuthTarget(handler);
int target_bucket = auth_scheme * AUTH_TARGET_MAX + auth_target;
DCHECK(target_bucket >= 0 && target_bucket < kTargetBucketsEnd);
@@ -282,7 +282,7 @@
case HttpAuth::AUTHORIZATION_RESULT_STALE:
if (http_auth_cache_->UpdateStaleChallenge(auth_origin_,
handler_->realm(),
- handler_->scheme(),
+ handler_->auth_scheme(),
challenge_used)) {
handler_.reset();
identity_ = HttpAuth::Identity();
@@ -388,7 +388,7 @@
break;
default:
http_auth_cache_->Add(auth_origin_, handler_->realm(),
- handler_->scheme(), handler_->challenge(),
+ handler_->auth_scheme(), handler_->challenge(),
identity_.username, identity_.password,
auth_path_);
break;
@@ -426,7 +426,7 @@
// Note: we require the username/password to match before invalidating
// since the entry in the cache may be newer than what we used last time.
http_auth_cache_->Remove(auth_origin_, handler_->realm(),
- handler_->scheme(), identity_.username,
+ handler_->auth_scheme(), identity_.username,
identity_.password);
}
@@ -453,7 +453,7 @@
// Check the auth cache for a realm entry.
HttpAuthCache::Entry* entry =
http_auth_cache_->Lookup(auth_origin_, handler_->realm(),
- handler_->scheme());
+ handler_->auth_scheme());
if (entry) {
identity_.source = HttpAuth::IDENT_SRC_REALM_LOOKUP;
@@ -487,7 +487,8 @@
auth_info_ = new AuthChallengeInfo;
auth_info_->is_proxy = target_ == HttpAuth::AUTH_PROXY;
auth_info_->host_and_port = ASCIIToWide(GetHostAndPort(auth_origin_));
- auth_info_->scheme = ASCIIToWide(handler_->scheme());
+ auth_info_->scheme = ASCIIToWide(
+ HttpAuth::SchemeToString(handler_->auth_scheme()));
// TODO(eroman): decode realm according to RFC 2047.
auth_info_->realm = ASCIIToWide(handler_->realm());
}
@@ -497,7 +498,7 @@
// This error occurs with GSSAPI, if the user has not already logged in.
// In that case, disable the current scheme as it cannot succeed.
if (result == ERR_MISSING_AUTH_CREDENTIALS) {
- DisableAuthScheme(handler_->scheme());
+ DisableAuthScheme(handler_->auth_scheme());
auth_token_.clear();
result = OK;
}
@@ -513,12 +514,12 @@
return auth_info_;
}
-bool HttpAuthController::IsAuthSchemeDisabled(const std::string& scheme) const {
+bool HttpAuthController::IsAuthSchemeDisabled(HttpAuth::Scheme scheme) const {
DCHECK(CalledOnValidThread());
return disabled_schemes_.find(scheme) != disabled_schemes_.end();
}
-void HttpAuthController::DisableAuthScheme(const std::string& scheme) {
+void HttpAuthController::DisableAuthScheme(HttpAuth::Scheme scheme) {
DCHECK(CalledOnValidThread());
disabled_schemes_.insert(scheme);
}
« no previous file with comments | « net/http/http_auth_controller.h ('k') | net/http/http_auth_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698