diff options
author | ycxiao@chromium.org <ycxiao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 19:06:26 +0000 |
---|---|---|
committer | ycxiao@chromium.org <ycxiao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 19:06:26 +0000 |
commit | 03d845f833e7f85ff8cdb4d6bb7c56aab2bc65e8 (patch) | |
tree | 24b6f95ffb2e3c90e53fb52d7e95210221e85c0b /content | |
parent | 3529138ef50534cf1d4ee99e5de32158a2bda83a (diff) | |
download | chromium_src-03d845f833e7f85ff8cdb4d6bb7c56aab2bc65e8.zip chromium_src-03d845f833e7f85ff8cdb4d6bb7c56aab2bc65e8.tar.gz chromium_src-03d845f833e7f85ff8cdb4d6bb7c56aab2bc65e8.tar.bz2 |
Change CanGetCookies signature, add CookieList as parameters in order to remove the getting cookies call inside ResourceDispatcherHost::CanGetCookies.
BUG=68657
TEST=XXXX
Review URL: http://codereview.chromium.org/7461121
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94724 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/renderer_host/resource_dispatcher_host.cc | 18 | ||||
-rw-r--r-- | content/browser/renderer_host/resource_dispatcher_host.h | 22 |
2 files changed, 21 insertions, 19 deletions
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc index 7030b10..0b78183 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.cc +++ b/content/browser/renderer_host/resource_dispatcher_host.cc @@ -11,6 +11,7 @@ #include "base/bind.h" #include "base/command_line.h" +#include "base/compiler_specific.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" @@ -1182,34 +1183,31 @@ void ResourceDispatcherHost::OnSSLCertificateError( SSLManager::OnSSLCertificateError(this, request, cert_error, cert); } -bool ResourceDispatcherHost::CanGetCookies(net::URLRequest* request) { +bool ResourceDispatcherHost::CanGetCookies( + const net::URLRequest* request, + const net::CookieList& cookie_list) const { VLOG(1) << "OnGetCookies: " << request->url().spec(); int render_process_id, render_view_id; if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) return false; - const net::URLRequestContext* context = request->context(); - net::CookieMonster* cookie_monster = - context->cookie_store()->GetCookieMonster(); - net::CookieList cookie_list = - cookie_monster->GetAllCookiesForURL(request->url()); - ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); + const ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); return content::GetContentClient()->browser()->AllowGetCookie( request->url(), request->first_party_for_cookies(), cookie_list, *info->context(), render_process_id, render_view_id); } -bool ResourceDispatcherHost::CanSetCookie(net::URLRequest* request, +bool ResourceDispatcherHost::CanSetCookie(const net::URLRequest* request, const std::string& cookie_line, - net::CookieOptions* options) { + net::CookieOptions* options) const { VLOG(1) << "OnSetCookie: " << request->url().spec(); int render_process_id, render_view_id; if (!RenderViewForRequest(request, &render_process_id, &render_view_id)) return false; - ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); + const ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); return content::GetContentClient()->browser()->AllowSetCookie( request->url(), request->first_party_for_cookies(), cookie_line, *info->context(), render_process_id, render_view_id, options); diff --git a/content/browser/renderer_host/resource_dispatcher_host.h b/content/browser/renderer_host/resource_dispatcher_host.h index 49500a2..415d0c2 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.h +++ b/content/browser/renderer_host/resource_dispatcher_host.h @@ -50,6 +50,7 @@ namespace content { class ResourceContext; } namespace net { +class CookieList; class URLRequestJobFactory; } // namespace net @@ -174,21 +175,24 @@ class ResourceDispatcherHost : public net::URLRequest::Delegate { // net::URLRequest::Delegate virtual void OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, - bool* defer_redirect); + bool* defer_redirect) OVERRIDE; virtual void OnAuthRequired(net::URLRequest* request, - net::AuthChallengeInfo* auth_info); + net::AuthChallengeInfo* auth_info) OVERRIDE; virtual void OnCertificateRequested( net::URLRequest* request, - net::SSLCertRequestInfo* cert_request_info); + net::SSLCertRequestInfo* cert_request_info) OVERRIDE; virtual void OnSSLCertificateError(net::URLRequest* request, int cert_error, - net::X509Certificate* cert); - virtual bool CanGetCookies(net::URLRequest* request); - virtual bool CanSetCookie(net::URLRequest* request, + net::X509Certificate* cert) OVERRIDE; + virtual bool CanGetCookies(const net::URLRequest* request, + const net::CookieList& cookie_list) const OVERRIDE; + virtual bool CanSetCookie(const net::URLRequest* request, const std::string& cookie_line, - net::CookieOptions* options); - virtual void OnResponseStarted(net::URLRequest* request); - virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); + net::CookieOptions* options) const OVERRIDE; + virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; + virtual void OnReadCompleted(net::URLRequest* request, + int bytes_read) OVERRIDE; + void OnResponseCompleted(net::URLRequest* request); // Helper functions to get the dispatcher's request info for the request. |