diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 11:09:24 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 11:09:24 +0000 |
commit | fa82f93da256dede111ee4143c340e55a195d7e3 (patch) | |
tree | 36082a958021799fd1de1e5e30d4a861cda4bba6 /net/http/http_auth_cache.h | |
parent | 6278df2e8f1e77409e499addf16fa4679f3dca0b (diff) | |
download | chromium_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_cache.h')
-rw-r--r-- | net/http/http_auth_cache.h | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h index 7062c76..1d238af1 100644 --- a/net/http/http_auth_cache.h +++ b/net/http/http_auth_cache.h @@ -10,7 +10,6 @@ #include "base/ref_counted.h" #include "googleurl/src/gurl.h" -#include "net/http/http_auth_handler.h" // This is needed for the FRIEND_TEST() macro. #include "testing/gtest/include/gtest/gtest_prod.h" @@ -51,14 +50,17 @@ class HttpAuthCache { // already exists, update it rather than replace it -- this preserves the // paths list. // |origin| - the {scheme, host, port} of the server. - // |handler| - handler for the challenge. + // |realm| - the auth realm for the challenge. + // |scheme| - the authentication scheme for the challenge. // |username| - login information for the realm. // |password| - login information for the realm. // |path| - absolute path for a resource contained in the protection // space; this will be added to the list of known paths. // returns - the entry that was just added/updated. Entry* Add(const GURL& origin, - HttpAuthHandler* handler, + const std::string& realm, + const std::string& scheme, + const std::string& auth_challenge, const std::wstring& username, const std::wstring& password, const std::string& path); @@ -98,29 +100,33 @@ class HttpAuthCache::Entry { // The case-sensitive realm string of the challenge. const std::string realm() const { - return handler_->realm(); + return realm_; } // The authentication scheme string of the challenge const std::string scheme() const { - return handler_->scheme(); + return scheme_; } - // The handler for the challenge. - HttpAuthHandler* handler() const { - return handler_.get(); + // The authentication challenge. + const std::string auth_challenge() const { + return auth_challenge_; } // The login username. - const std::wstring& username() const { + const std::wstring username() const { return username_; } // The login password. - const std::wstring& password() const { + const std::wstring password() const { return password_; } + int IncrementNonceCount() { + return ++nonce_count_; + } + private: friend class HttpAuthCache; FRIEND_TEST(HttpAuthCacheTest, AddPath); @@ -137,13 +143,15 @@ class HttpAuthCache::Entry { // |origin_| contains the {scheme, host, port} of the server. GURL origin_; + std::string realm_; + std::string scheme_; // Identity. + std::string auth_challenge_; std::wstring username_; std::wstring password_; - // Auth handler for the challenge. - scoped_refptr<HttpAuthHandler> handler_; + int nonce_count_; // List of paths that define the realm's protection space. typedef std::list<std::string> PathList; |