Chromium Code Reviews| 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,20 +112,21 @@ |
| ResourceHandler* ChromeResourceDispatcherHostDelegate::RequestBeginning( |
| ResourceHandler* handler, |
| net::URLRequest* request, |
| + const content::ResourceContext& resource_context, |
| bool is_subresource, |
| int child_id, |
| int route_id) { |
| if (prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id)) |
| request->set_load_flags(request->load_flags() | net::LOAD_PRERENDERING); |
| -#if defined(ENABLE_SAFE_BROWSING) |
|
mattm
2011/07/12 21:41:58
dropped merges
Miranda Callahan
2011/07/13 18:13:51
Done.
|
| // 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); |
| } |
| -#endif |
| #if defined(OS_CHROMEOS) |
| // We check offline first, then check safe browsing so that we still can block |
| @@ -138,16 +139,15 @@ |
| 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); |
| -#else |
| - return handler; |
| -#endif |
| } |
| bool ChromeResourceDispatcherHostDelegate::ShouldDeferStart( |
| @@ -215,7 +215,6 @@ |
| &ExternalProtocolHandler::LaunchUrl, url, child_id, route_id)); |
| } |
| -#if defined(ENABLE_SAFE_BROWSING) |
| ResourceHandler* |
| ChromeResourceDispatcherHostDelegate::CreateSafeBrowsingResourceHandler( |
| ResourceHandler* handler, int child_id, int route_id, |
| @@ -224,7 +223,6 @@ |
| handler, child_id, route_id, subresource, safe_browsing_, |
| resource_dispatcher_host_); |
| } |
| -#endif |
| bool ChromeResourceDispatcherHostDelegate::ShouldForceDownloadResource( |
| const GURL& url, const std::string& mime_type) { |