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

Unified Diff: net/http/http_auth_handler.cc

Issue 1383613002: [net/http auth] Cleanup. Method names, and constness. Base URL: https://chromium.googlesource.com/chromium/src.git@mock-auth-handler-generalization
Patch Set: Created 5 years, 2 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_handler.h ('k') | net/http/http_auth_handler_basic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler.cc
diff --git a/net/http/http_auth_handler.cc b/net/http/http_auth_handler.cc
index 2185e4f7dad8b43b3cd875e1527d6189e724c68a..32028c247d159bd5bbc24ac3b7cc1f0064f2649f 100644
--- a/net/http/http_auth_handler.cc
+++ b/net/http/http_auth_handler.cc
@@ -18,8 +18,8 @@ HttpAuthHandler::HttpAuthHandler() : target_(HttpAuth::AUTH_NONE) {}
HttpAuthHandler::~HttpAuthHandler() {
}
-bool HttpAuthHandler::InitFromChallenge(
- HttpAuthChallengeTokenizer* challenge,
+int HttpAuthHandler::HandleInitialChallenge(
+ const HttpAuthChallengeTokenizer& challenge,
HttpAuth::Target target,
const GURL& origin,
const BoundNetLog& net_log) {
@@ -27,15 +27,14 @@ bool HttpAuthHandler::InitFromChallenge(
target_ = target;
net_log_ = net_log;
- auth_challenge_ = challenge->challenge_text();
- bool ok = Init(challenge);
+ auth_challenge_ = challenge.challenge_text();
+ int result = Init(challenge);
- // Init() is expected to set the scheme, realm, and properties. The realm may
- // be empty.
- DCHECK_IMPLIES(ok,
- HttpUtil::IsToken(auth_scheme_.begin(), auth_scheme_.end()) &&
- base::ToLowerASCII(auth_scheme_) == auth_scheme_);
- return ok;
+ // Init() is expected to set the scheme, realm, score, and properties. The
+ // realm may be empty.
+ DCHECK_IMPLIES(result == OK, HttpAuth::IsValidNormalizedScheme(auth_scheme_));
+
+ return result;
}
namespace {
@@ -54,11 +53,11 @@ NetLog::EventType EventTypeFromAuthTarget(HttpAuth::Target target) {
} // namespace
-int HttpAuthHandler::GenerateAuthToken(
- const AuthCredentials* credentials, const HttpRequestInfo* request,
- const CompletionCallback& callback, std::string* auth_token) {
+int HttpAuthHandler::GenerateAuthToken(const AuthCredentials* credentials,
+ const HttpRequestInfo& request,
+ const CompletionCallback& callback,
+ std::string* auth_token) {
DCHECK(!callback.is_null());
- DCHECK(request);
DCHECK(credentials != NULL || AllowsDefaultCredentials());
DCHECK(auth_token != NULL);
DCHECK(callback_.is_null());
« no previous file with comments | « net/http/http_auth_handler.h ('k') | net/http/http_auth_handler_basic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698