From bcc528ed85d5fa3b4f327d2875d14de7c4506bd8 Mon Sep 17 00:00:00 2001 From: "cbentzel@chromium.org" Date: Thu, 10 Jun 2010 15:03:24 +0000 Subject: 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 --- net/http/http_network_transaction.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'net/http/http_network_transaction.cc') 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); -- cgit v1.1