diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-15 06:43:48 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-15 06:43:48 +0000 |
commit | 515838ce76cb8bec7f51f6143cac74f113e247ad (patch) | |
tree | 71b70d594974310b35d1c8f7843aeda5717c044b /net/url_request | |
parent | 92352a66515fd9a01f538529356ad45870109f28 (diff) | |
download | chromium_src-515838ce76cb8bec7f51f6143cac74f113e247ad.zip chromium_src-515838ce76cb8bec7f51f6143cac74f113e247ad.tar.gz chromium_src-515838ce76cb8bec7f51f6143cac74f113e247ad.tar.bz2 |
post-winhttp cleanup: refactor net/base/auth_cache into net/ftp/ftp_auth_cache.
Also moves AuthCache::HttpKey() --> GetSignonRealmKey().
Review URL: http://codereview.chromium.org/18218
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request_context.h | 8 | ||||
-rw-r--r-- | net/url_request/url_request_ftp_job.cc | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h index ee05c9d..5941df8 100644 --- a/net/url_request/url_request_context.h +++ b/net/url_request/url_request_context.h @@ -15,8 +15,8 @@ #include "base/basictypes.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" -#include "net/base/auth_cache.h" #include "net/base/cookie_policy.h" +#include "net/ftp/ftp_auth_cache.h" #include "net/http/http_transaction_factory.h" namespace net { @@ -50,8 +50,8 @@ class URLRequestContext : // Gets the cookie policy for this context. net::CookiePolicy* cookie_policy() { return &cookie_policy_; } - // Gets the FTP realm authentication cache for this context. - net::AuthCache* ftp_auth_cache() { return &ftp_auth_cache_; } + // Gets the FTP authentication cache for this context. + net::FtpAuthCache* ftp_auth_cache() { return &ftp_auth_cache_; } // Gets the UA string to use for this context. const std::string& user_agent() const { return user_agent_; } @@ -73,7 +73,7 @@ class URLRequestContext : net::HttpTransactionFactory* http_transaction_factory_; net::CookieMonster* cookie_store_; net::CookiePolicy cookie_policy_; - net::AuthCache ftp_auth_cache_; + net::FtpAuthCache ftp_auth_cache_; std::string user_agent_; std::string accept_language_; std::string accept_charset_; diff --git a/net/url_request/url_request_ftp_job.cc b/net/url_request/url_request_ftp_job.cc index 7b72118..d63d248 100644 --- a/net/url_request/url_request_ftp_job.cc +++ b/net/url_request/url_request_ftp_job.cc @@ -127,7 +127,7 @@ void URLRequestFtpJob::SendRequest() { have_auth = true; username = WideToUTF8(server_auth_->username); password = WideToUTF8(server_auth_->password); - request_->context()->ftp_auth_cache()->Add(request_->url().host(), + request_->context()->ftp_auth_cache()->Add(request_->url().GetOrigin(), server_auth_.get()); } else { if (request_->url().has_username()) { @@ -169,18 +169,17 @@ void URLRequestFtpJob::OnIOComplete(const AsyncResult& result) { case ERROR_INTERNET_INCORRECT_USER_NAME: // fall through case ERROR_INTERNET_INCORRECT_PASSWORD: { - // TODO(eroman): shouldn't the port be part of the key? - std::string cache_key = request_->url().host(); + GURL origin = request_->url().GetOrigin(); if (server_auth_ != NULL && server_auth_->state == net::AUTH_STATE_HAVE_AUTH) { - request_->context()->ftp_auth_cache()->Remove(cache_key); + request_->context()->ftp_auth_cache()->Remove(origin); } else { server_auth_ = new net::AuthData(); } server_auth_->state = net::AUTH_STATE_NEED_AUTH; scoped_refptr<net::AuthData> cached_auth = - request_->context()->ftp_auth_cache()->Lookup(cache_key); + request_->context()->ftp_auth_cache()->Lookup(origin); if (cached_auth) { // Retry using cached auth data. |