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

Unified Diff: net/http/http_auth_controller.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 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_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_controller.cc
diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc
index 1ab12adda7655dfc241fec54db51db9f0565f1dc..019f95b1431e0483dbcff05d14d3d1da1a112eb0 100644
--- a/net/http/http_auth_controller.cc
+++ b/net/http/http_auth_controller.cc
@@ -98,8 +98,10 @@ void HistogramAuthEvent(HttpAuthHandler* handler, AuthEvent auth_event) {
DCHECK_EQ(first_thread, base::PlatformThread::CurrentId());
#endif
- HttpAuth::Scheme auth_scheme = handler->auth_scheme();
- DCHECK(auth_scheme >= 0 && auth_scheme < HttpAuth::AUTH_SCHEME_MAX);
+ std::string auth_scheme = handler->auth_scheme();
+
+#if 0
+ // TODO(cbentzel): This would need to convert to string -> bucket conversion.
// Record start and rejection events for authentication.
//
@@ -147,6 +149,7 @@ void HistogramAuthEvent(HttpAuthHandler* handler, AuthEvent auth_event) {
DCHECK(target_bucket >= 0 && target_bucket < kTargetBucketsEnd);
UMA_HISTOGRAM_ENUMERATION("Net.HttpAuthTarget", target_bucket,
kTargetBucketsEnd);
+#endif
}
} // namespace
@@ -503,7 +506,7 @@ void HttpAuthController::PopulateAuthChallenge() {
auth_info_ = new AuthChallengeInfo;
auth_info_->is_proxy = (target_ == HttpAuth::AUTH_PROXY);
auth_info_->challenger = HostPortPair::FromURL(auth_origin_);
- auth_info_->scheme = HttpAuth::SchemeToString(handler_->auth_scheme());
+ auth_info_->scheme = handler_->auth_scheme();
auth_info_->realm = handler_->realm();
}
@@ -553,14 +556,18 @@ scoped_refptr<AuthChallengeInfo> HttpAuthController::auth_info() {
return auth_info_;
}
-bool HttpAuthController::IsAuthSchemeDisabled(HttpAuth::Scheme scheme) const {
+bool HttpAuthController::IsAuthSchemeDisabled(const std::string& scheme) const {
DCHECK(CalledOnValidThread());
- return disabled_schemes_.find(scheme) != disabled_schemes_.end();
+ // TODO(cbentzel): Needed?
+ std::string lower_scheme = StringToLowerASCII(scheme);
+ return disabled_schemes_.find(lower_scheme) != disabled_schemes_.end();
}
-void HttpAuthController::DisableAuthScheme(HttpAuth::Scheme scheme) {
+void HttpAuthController::DisableAuthScheme(const std::string& scheme) {
DCHECK(CalledOnValidThread());
- disabled_schemes_.insert(scheme);
+ // TODO(cbentzel): Needed?
+ std::string lower_scheme = StringToLowerASCII(scheme);
+ disabled_schemes_.insert(lower_scheme);
}
} // namespace net
« no previous file with comments | « net/http/http_auth_controller.h ('k') | net/http/http_auth_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698