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

Unified Diff: net/http/http_auth_handler_basic.cc

Issue 8340026: Use AuthCredentials throughout the network stack instead of username/password. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix comments Created 9 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_basic.h ('k') | net/http/http_auth_handler_basic_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_handler_basic.cc
diff --git a/net/http/http_auth_handler_basic.cc b/net/http/http_auth_handler_basic.cc
index 5303ac34f2a83a482ed0e1a37f91b42e2820ec82..df24d0e89656c4df8b2a25f5e5430fdc414f91e2 100644
--- a/net/http/http_auth_handler_basic.cc
+++ b/net/http/http_auth_handler_basic.cc
@@ -86,15 +86,17 @@ HttpAuth::AuthorizationResult HttpAuthHandlerBasic::HandleAnotherChallenge(
}
int HttpAuthHandlerBasic::GenerateAuthTokenImpl(
- const string16* username,
- const string16* password,
+ const AuthCredentials* credentials,
const HttpRequestInfo*,
OldCompletionCallback*,
std::string* auth_token) {
+ DCHECK(credentials);
// TODO(eroman): is this the right encoding of username/password?
std::string base64_username_password;
- if (!base::Base64Encode(UTF16ToUTF8(*username) + ":" + UTF16ToUTF8(*password),
- &base64_username_password)) {
+ if (!base::Base64Encode(
+ UTF16ToUTF8(credentials->username()) + ":" +
+ UTF16ToUTF8(credentials->password()),
+ &base64_username_password)) {
LOG(ERROR) << "Unexpected problem Base64 encoding.";
return ERR_UNEXPECTED;
}
« no previous file with comments | « net/http/http_auth_handler_basic.h ('k') | net/http/http_auth_handler_basic_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698