Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5808)

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 7134017: Make safe browsing work in a multi-profile environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: addressed sky's nit Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
===================================================================
--- chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (revision 92179)
+++ chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (working copy)
@@ -112,6 +112,7 @@
ResourceHandler* ChromeResourceDispatcherHostDelegate::RequestBeginning(
ResourceHandler* handler,
net::URLRequest* request,
+ const content::ResourceContext& resource_context,
bool is_subresource,
int child_id,
int route_id) {
@@ -121,7 +122,9 @@
#if defined(ENABLE_SAFE_BROWSING)
// Insert safe browsing at the front of the chain, so it gets to decide
// on policies first.
- if (safe_browsing_->enabled()) {
+ ProfileIOData* io_data = reinterpret_cast<ProfileIOData*>(
+ resource_context.GetUserData(NULL));
+ if (io_data->safe_browsing_enabled()->GetValue()) {
handler = CreateSafeBrowsingResourceHandler(
handler, child_id, route_id, is_subresource);
}
@@ -138,10 +141,13 @@
ResourceHandler* ChromeResourceDispatcherHostDelegate::DownloadStarting(
ResourceHandler* handler,
+ const content::ResourceContext& resource_context,
int child_id,
int route_id) {
#if defined(ENABLE_SAFE_BROWSING)
- if (!safe_browsing_->enabled())
+ ProfileIOData* io_data = reinterpret_cast<ProfileIOData*>(
+ resource_context.GetUserData(NULL));
+ if (!io_data->safe_browsing_enabled()->GetValue())
return handler;
return CreateSafeBrowsingResourceHandler(handler, child_id, route_id, false);

Powered by Google App Engine
This is Rietveld 408576698