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_auth_handler_digest.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_auth_handler_digest.cc')
-rw-r--r-- | net/http/http_auth_handler_digest.cc | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc index b15d01b..90090a6 100644 --- a/net/http/http_auth_handler_digest.cc +++ b/net/http/http_auth_handler_digest.cc @@ -85,11 +85,11 @@ std::string HttpAuthHandlerDigest::AlgorithmToString(int algorithm) { } } -int HttpAuthHandlerDigest::GenerateAuthToken( - const std::wstring& username, - const std::wstring& password, +int HttpAuthHandlerDigest::GenerateAuthTokenImpl( + const std::wstring* username, + const std::wstring* password, const HttpRequestInfo* request, - const ProxyInfo* proxy, + CompletionCallback* callback, std::string* auth_token) { // Generate a random client nonce. std::string cnonce = GenerateNonce(); @@ -98,32 +98,21 @@ int HttpAuthHandlerDigest::GenerateAuthToken( // in certain cases, to be a hostname. std::string method; std::string path; - GetRequestMethodAndPath(request, proxy, &method, &path); + GetRequestMethodAndPath(request, &method, &path); *auth_token = AssembleCredentials(method, path, // TODO(eroman): is this the right encoding? - WideToUTF8(username), - WideToUTF8(password), + WideToUTF8(*username), + WideToUTF8(*password), cnonce, nonce_count_); return OK; } -int HttpAuthHandlerDigest::GenerateDefaultAuthToken( - const HttpRequestInfo* request, - const ProxyInfo* proxy, - std::string* auth_token) { - NOTREACHED(); - LOG(ERROR) << ErrorToString(ERR_NOT_IMPLEMENTED); - return ERR_NOT_IMPLEMENTED; -} - void HttpAuthHandlerDigest::GetRequestMethodAndPath( const HttpRequestInfo* request, - const ProxyInfo* proxy, std::string* method, std::string* path) const { DCHECK(request); - DCHECK(proxy); const GURL& url = request->url; |