summaryrefslogtreecommitdiffstats
path: root/net/http/http_auth_handler_factory.h
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-20 11:09:24 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-20 11:09:24 +0000
commitfa82f93da256dede111ee4143c340e55a195d7e3 (patch)
tree36082a958021799fd1de1e5e30d4a861cda4bba6 /net/http/http_auth_handler_factory.h
parent6278df2e8f1e77409e499addf16fa4679f3dca0b (diff)
downloadchromium_src-fa82f93da256dede111ee4143c340e55a195d7e3.zip
chromium_src-fa82f93da256dede111ee4143c340e55a195d7e3.tar.gz
chromium_src-fa82f93da256dede111ee4143c340e55a195d7e3.tar.bz2
Remove handler from HttpAuthCache.
This is part of a refactoring meant to simplify the connection phase of HttpNetworkTransaction. BUG=None TEST=net_unittests (which already includes unit tests for preemptive auth, as well as using values from cache). Review URL: http://codereview.chromium.org/2056003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_handler_factory.h')
-rw-r--r--net/http/http_auth_handler_factory.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/net/http/http_auth_handler_factory.h b/net/http/http_auth_handler_factory.h
index 0b65f1e..96213db 100644
--- a/net/http/http_auth_handler_factory.h
+++ b/net/http/http_auth_handler_factory.h
@@ -37,6 +37,11 @@ class HttpAuthHandlerFactory {
return url_security_manager_;
}
+ enum CreateReason {
+ CREATE_CHALLENGE, // Create a handler in response to a challenge.
+ CREATE_PREEMPTIVE, // Create a handler preemptively.
+ };
+
// Creates an HttpAuthHandler object based on the authentication
// challenge specified by |*challenge|. |challenge| must point to a valid
// non-NULL tokenizer.
@@ -50,6 +55,13 @@ class HttpAuthHandlerFactory {
// If |*challenge| is improperly formed, |*handler| is set to NULL and
// ERR_INVALID_RESPONSE is returned.
//
+ // |create_reason| indicates why the handler is being created. This is used
+ // since NTLM and Negotiate schemes do not support preemptive creation.
+ //
+ // |digest_nonce_count| is specifically intended for the Digest authentication
+ // scheme, and indicates the number of handlers generated for a particular
+ // server nonce challenge.
+ //
// For the NTLM and Negotiate handlers:
// If |origin| does not match the authentication method's filters for
// the specified |target|, ERR_INVALID_AUTH_CREDENTIALS is returned.
@@ -59,6 +71,8 @@ class HttpAuthHandlerFactory {
virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge,
HttpAuth::Target target,
const GURL& origin,
+ CreateReason create_reason,
+ int digest_nonce_count,
scoped_refptr<HttpAuthHandler>* handler) = 0;
// Creates an HTTP authentication handler based on the authentication
@@ -71,6 +85,18 @@ class HttpAuthHandlerFactory {
const GURL& origin,
scoped_refptr<HttpAuthHandler>* handler);
+ // Creates an HTTP authentication handler based on the authentication
+ // challenge string |challenge|.
+ // This is a convenience function which creates a ChallengeTokenizer for
+ // |challenge| and calls |CreateAuthHandler|. See |CreateAuthHandler| for
+ // more details on return values.
+ int CreatePreemptiveAuthHandlerFromString(
+ const std::string& challenge,
+ HttpAuth::Target target,
+ const GURL& origin,
+ int digest_nonce_count,
+ scoped_refptr<HttpAuthHandler>* handler);
+
// Creates a standard HttpAuthHandlerRegistryFactory. The caller is
// responsible for deleting the factory.
// The default factory supports Basic, Digest, NTLM, and Negotiate schemes.
@@ -117,6 +143,8 @@ class HttpAuthHandlerRegistryFactory : public HttpAuthHandlerFactory {
virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge,
HttpAuth::Target target,
const GURL& origin,
+ CreateReason reason,
+ int digest_nonce_count,
scoped_refptr<HttpAuthHandler>* handler);
private: