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_auth_handler_basic.cc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to '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 21bfc44..efd8c5e 100644 --- a/net/http/http_auth_handler_basic.cc +++ b/net/http/http_auth_handler_basic.cc @@ -41,15 +41,15 @@ bool HttpAuthHandlerBasic::Init(HttpAuth::ChallengeTokenizer* challenge) { return challenge->valid(); } -int HttpAuthHandlerBasic::GenerateAuthToken( - const std::wstring& username, - const std::wstring& password, +int HttpAuthHandlerBasic::GenerateAuthTokenImpl( + const std::wstring* username, + const std::wstring* password, const HttpRequestInfo*, - const ProxyInfo*, + CompletionCallback*, std::string* auth_token) { // TODO(eroman): is this the right encoding of username/password? std::string base64_username_password; - if (!base::Base64Encode(WideToUTF8(username) + ":" + WideToUTF8(password), + if (!base::Base64Encode(WideToUTF8(*username) + ":" + WideToUTF8(*password), &base64_username_password)) { LOG(ERROR) << "Unexpected problem Base64 encoding."; return ERR_UNEXPECTED; @@ -58,15 +58,6 @@ int HttpAuthHandlerBasic::GenerateAuthToken( return OK; } -int HttpAuthHandlerBasic::GenerateDefaultAuthToken( - const HttpRequestInfo* request, - const ProxyInfo* proxy, - std::string* auth_token) { - NOTREACHED(); - LOG(ERROR) << ErrorToString(ERR_NOT_IMPLEMENTED); - return ERR_NOT_IMPLEMENTED; -} - HttpAuthHandlerBasic::Factory::Factory() { } -- cgit v1.1