diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 22:58:46 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 22:58:46 +0000 |
commit | 8c40da60d2915af9fe4189da603d65330299b708 (patch) | |
tree | 1ea88a3837a7caaede7c578454602b8c4e9a5828 /content/browser | |
parent | 29b05f40d45d6b6916ac17adc8c033c44bf7e74c (diff) | |
download | chromium_src-8c40da60d2915af9fe4189da603d65330299b708.zip chromium_src-8c40da60d2915af9fe4189da603d65330299b708.tar.gz chromium_src-8c40da60d2915af9fe4189da603d65330299b708.tar.bz2 |
Make safe browsing work in a multi-profile environment.
A single safe browsing service will be triggered per-profile, by passing the profile's safe browsing preference to the ResourceDispatcherHost through the ResourceContext.
References to the Default Profile used in starting and configuring the SafeBrowsingService have also been replaced with references to the appropriate profile for each situation.
BUG=83770
TEST=safe browsing is triggered correctly.
Review URL: http://codereview.chromium.org/7134017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92438 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
3 files changed, 20 insertions, 12 deletions
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc index 4e99336..0243717 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.cc +++ b/content/browser/renderer_host/resource_dispatcher_host.cc @@ -493,8 +493,8 @@ void ResourceDispatcherHost::BeginRequest( if (delegate_) { bool sub = request_data.resource_type != ResourceType::MAIN_FRAME; - handler = delegate_->RequestBeginning( - handler, request, sub, child_id, route_id); + handler = delegate_->RequestBeginning(handler, request, resource_context, + sub, child_id, route_id); } // Make extra info and read footer (contains request ID). @@ -710,8 +710,10 @@ void ResourceDispatcherHost::BeginDownload( prompt_for_save_location, save_info)); - if (delegate_) - handler = delegate_->DownloadStarting(handler, child_id, route_id); + if (delegate_) { + handler = delegate_->DownloadStarting(handler, context, child_id, + route_id); + } const net::URLRequestContext* request_context = context.request_context(); diff --git a/content/browser/renderer_host/resource_dispatcher_host_delegate.cc b/content/browser/renderer_host/resource_dispatcher_host_delegate.cc index 784dd42..65af22a 100644 --- a/content/browser/renderer_host/resource_dispatcher_host_delegate.cc +++ b/content/browser/renderer_host/resource_dispatcher_host_delegate.cc @@ -21,6 +21,7 @@ bool ResourceDispatcherHostDelegate::ShouldBeginRequest( ResourceHandler* ResourceDispatcherHostDelegate::RequestBeginning( ResourceHandler* handler, net::URLRequest* request, + const content::ResourceContext& resource_context, bool is_subresource, int child_id, int route_id) { @@ -29,6 +30,7 @@ ResourceHandler* ResourceDispatcherHostDelegate::RequestBeginning( ResourceHandler* ResourceDispatcherHostDelegate::DownloadStarting( ResourceHandler* handler, + const content::ResourceContext& resource_context, int child_id, int route_id) { return handler; diff --git a/content/browser/renderer_host/resource_dispatcher_host_delegate.h b/content/browser/renderer_host/resource_dispatcher_host_delegate.h index 694d36c..cf60d03 100644 --- a/content/browser/renderer_host/resource_dispatcher_host_delegate.h +++ b/content/browser/renderer_host/resource_dispatcher_host_delegate.h @@ -42,17 +42,21 @@ class ResourceDispatcherHostDelegate { // content layer have been added. To add new handlers to the front, return // a new handler that is chained to the given one, otherwise just reutrn the // given handler. - virtual ResourceHandler* RequestBeginning(ResourceHandler* handler, - net::URLRequest* request, - bool is_subresource, - int child_id, - int route_id); + virtual ResourceHandler* RequestBeginning( + ResourceHandler* handler, + net::URLRequest* request, + const content::ResourceContext& resource_context, + bool is_subresource, + int child_id, + int route_id); // Called when a download is starting, after the resource handles from the // content layer have been added. - virtual ResourceHandler* DownloadStarting(ResourceHandler* handler, - int child_id, - int route_id); + virtual ResourceHandler* DownloadStarting( + ResourceHandler* handler, + const content::ResourceContext& resource_context, + int child_id, + int route_id); // Called to determine whether a request's start should be deferred. This // is only called if the ResourceHandler associated with the request does |