summaryrefslogtreecommitdiffstats
path: root/net/http/http_auth_handler_ntlm.cc
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-10 15:03:24 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-10 15:03:24 +0000
commitbcc528ed85d5fa3b4f327d2875d14de7c4506bd8 (patch)
treeab065ed2bb270b71a4a946cc2f782a25fc117cdb /net/http/http_auth_handler_ntlm.cc
parent00257536889322b1f97ac5ce1c224b09f4734063 (diff)
downloadchromium_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_ntlm.cc')
-rw-r--r--net/http/http_auth_handler_ntlm.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc
index ed3eb3a..b50a0a9 100644
--- a/net/http/http_auth_handler_ntlm.cc
+++ b/net/http/http_auth_handler_ntlm.cc
@@ -13,19 +13,18 @@
namespace net {
-int HttpAuthHandlerNTLM::GenerateAuthToken(
- const std::wstring& username,
- const std::wstring& password,
+int HttpAuthHandlerNTLM::GenerateAuthTokenImpl(
+ const std::wstring* username,
+ const std::wstring* password,
const HttpRequestInfo* request,
- const ProxyInfo* proxy,
+ CompletionCallback* callback,
std::string* auth_token) {
#if defined(NTLM_SSPI)
return auth_sspi_.GenerateAuthToken(
- &username,
- &password,
+ username,
+ password,
CreateSPN(origin_),
request,
- proxy,
auth_token);
#else // !defined(NTLM_SSPI)
// TODO(wtc): See if we can use char* instead of void* for in_buf and
@@ -40,16 +39,16 @@ int HttpAuthHandlerNTLM::GenerateAuthToken(
// components.
std::wstring domain;
std::wstring user;
- size_t backslash_idx = username.find(L'\\');
+ size_t backslash_idx = username->find(L'\\');
if (backslash_idx == std::wstring::npos) {
- user = username;
+ user = *username;
} else {
- domain = username.substr(0, backslash_idx);
- user = username.substr(backslash_idx + 1);
+ domain = username->substr(0, backslash_idx);
+ user = username->substr(backslash_idx + 1);
}
domain_ = WideToUTF16(domain);
username_ = WideToUTF16(user);
- password_ = WideToUTF16(password);
+ password_ = WideToUTF16(*password);
// Initial challenge.
if (auth_data_.empty()) {