diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-10 15:03:24 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-10 15:03:24 +0000 |
commit | bcc528ed85d5fa3b4f327d2875d14de7c4506bd8 (patch) | |
tree | ab065ed2bb270b71a4a946cc2f782a25fc117cdb /net/http/http_network_transaction.cc | |
parent | 00257536889322b1f97ac5ce1c224b09f4734063 (diff) | |
download | chromium_src-bcc528ed85d5fa3b4f327d2875d14de7c4506bd8.zip chromium_src-bcc528ed85d5fa3b4f327d2875d14de7c4506bd8.tar.gz chromium_src-bcc528ed85d5fa3b4f327d2875d14de7c4506bd8.tar.bz2 |
Async support for HttpAuthHandler::GenerateAuthToken.
This CL changes the signature of GenerateAuthToken to support an async
completion of GenerateAuthToken. At this point, all of the
implementations complete synchronously, but a future version will
change Negotiate to complete asynchronously.
TEST=net_unittests
BUG=42222
Review URL: http://codereview.chromium.org/2671001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49398 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction.cc')
-rw-r--r-- | net/http/http_network_transaction.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index d5361ce..b6dda2d 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -1905,18 +1905,16 @@ void HttpNetworkTransaction::AddAuthorizationHeader( DCHECK(HaveAuth(target)); // Add a Authorization/Proxy-Authorization header line. - std::string auth_token; - int rv; - if (auth_identity_[target].source == - HttpAuth::IDENT_SRC_DEFAULT_CREDENTIALS) { - rv = auth_handler_[target]->GenerateDefaultAuthToken( - request_, &proxy_info_, &auth_token); - } else { - rv = auth_handler_[target]->GenerateAuthToken( - auth_identity_[target].username, - auth_identity_[target].password, - request_, &proxy_info_, &auth_token); + const std::wstring* username = NULL; + const std::wstring* password = NULL; + const HttpAuth::Identity& identity = auth_identity_[target]; + if (identity.source != HttpAuth::IDENT_SRC_DEFAULT_CREDENTIALS) { + username = &identity.username; + password = &identity.password; } + std::string auth_token; + int rv = auth_handler_[target]->GenerateAuthToken( + username, password, request_, NULL, &auth_token); if (rv == OK) { authorization_headers->SetHeader( HttpAuth::GetAuthorizationHeaderName(target), auth_token); |