From fa55e1931013409ddbce59ed39f8b12a351fd0c4 Mon Sep 17 00:00:00 2001 From: "cbentzel@chromium.org" Date: Mon, 15 Feb 2010 14:25:50 +0000 Subject: Added factories for HttpAuthHandler. The driving rationale for this change was to prevent choosing an AuthHandler when it is not supported on the system due to a missing runtime component (such as not being able to locate a gssapi shared library when seeing a Negotiate scheme). It also has the advantage (currently unused) of determining some per-auth-scheme properties only the first time that a challenge for that scheme is seen (such as maximum token length for the SSPI implementation of NTLM). Finally, it may make unit tests easier to generate since the factory can be easily mocked. BUG=34795 TEST=New unit test for HttpAuthHandlerDispatchFactory. Review URL: http://codereview.chromium.org/582007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39065 0039d316-1c4b-4281-b951-d872f2087c98 --- net/http/http_auth_handler_negotiate.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'net/http/http_auth_handler_negotiate.h') diff --git a/net/http/http_auth_handler_negotiate.h b/net/http/http_auth_handler_negotiate.h index b057f5c..c8e5585 100644 --- a/net/http/http_auth_handler_negotiate.h +++ b/net/http/http_auth_handler_negotiate.h @@ -10,6 +10,7 @@ #include #include "net/http/http_auth_handler.h" +#include "net/http/http_auth_handler_factory.h" #if defined(OS_WIN) #include "net/http/http_auth_sspi_win.h" @@ -24,6 +25,17 @@ namespace net { class HttpAuthHandlerNegotiate : public HttpAuthHandler { public: + class Factory : public HttpAuthHandlerFactory { + public: + Factory(); + virtual ~Factory(); + + virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, + HttpAuth::Target target, + const GURL& origin, + scoped_refptr* handler); + }; + HttpAuthHandlerNegotiate(); virtual bool NeedsIdentity(); @@ -43,8 +55,7 @@ class HttpAuthHandlerNegotiate : public HttpAuthHandler { std::string* auth_token); protected: - virtual bool Init(std::string::const_iterator challenge_begin, - std::string::const_iterator challenge_end); + virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); private: ~HttpAuthHandlerNegotiate(); -- cgit v1.1