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

Unified Diff: net/url_request/url_request_http_job.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/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 7e0d8daa066a2d120dc68c2274a0cbf59196216e..7fca837a700f9fabd00f1c0fe578b698df8578f6 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -282,7 +282,7 @@ void URLRequestHttpJob::NotifyHeadersComplete() {
// URLRequestTestHTTP.BasicAuthWithCookies
// where OnBeforeSendHeaders -> OnSendHeaders -> OnBeforeSendHeaders
// occurs.
- RestartTransactionWithAuth(string16(), string16());
+ RestartTransactionWithAuth(AuthCredentials());
return;
}
@@ -334,7 +334,7 @@ void URLRequestHttpJob::StartTransactionInternal() {
// NOTE: This method assumes that request_info_ is already setup properly.
// If we already have a transaction, then we should restart the transaction
- // with auth provided by username_ and password_.
+ // with auth provided by auth_credentials_.
int rv;
@@ -344,9 +344,8 @@ void URLRequestHttpJob::StartTransactionInternal() {
}
if (transaction_.get()) {
- rv = transaction_->RestartWithAuth(username_, password_, &start_callback_);
- username_.clear();
- password_.clear();
+ rv = transaction_->RestartWithAuth(auth_credentials_, &start_callback_);
+ auth_credentials_ = AuthCredentials();
} else {
DCHECK(request_->context());
DCHECK(request_->context()->http_transaction_factory());
@@ -765,10 +764,8 @@ void URLRequestHttpJob::OnReadCompleted(int result) {
}
void URLRequestHttpJob::RestartTransactionWithAuth(
- const string16& username,
- const string16& password) {
- username_ = username;
- password_ = password;
+ const AuthCredentials& credentials) {
+ auth_credentials_ = credentials;
// These will be reset in OnStartCompleted.
response_info_ = NULL;
@@ -997,8 +994,7 @@ void URLRequestHttpJob::GetAuthChallengeInfo(
*result = response_info_->auth_challenge;
}
-void URLRequestHttpJob::SetAuth(const string16& username,
- const string16& password) {
+void URLRequestHttpJob::SetAuth(const AuthCredentials& credentials) {
DCHECK(transaction_.get());
// Proxy gets set first, then WWW.
@@ -1009,7 +1005,7 @@ void URLRequestHttpJob::SetAuth(const string16& username,
server_auth_state_ = AUTH_STATE_HAVE_AUTH;
}
- RestartTransactionWithAuth(username, password);
+ RestartTransactionWithAuth(credentials);
}
void URLRequestHttpJob::CancelAuth() {
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698