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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2924723002: Network service: SafeBrowsing check for frame-resources from browser. (Closed)
Patch Set: . Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "chrome/browser/printing/printing_message_filter.h" 68 #include "chrome/browser/printing/printing_message_filter.h"
69 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" 69 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h"
70 #include "chrome/browser/profiles/profile.h" 70 #include "chrome/browser/profiles/profile.h"
71 #include "chrome/browser/profiles/profile_io_data.h" 71 #include "chrome/browser/profiles/profile_io_data.h"
72 #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h" 72 #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h"
73 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" 73 #include "chrome/browser/renderer_host/chrome_render_message_filter.h"
74 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory .h" 74 #include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory .h"
75 #include "chrome/browser/safe_browsing/certificate_reporting_service.h" 75 #include "chrome/browser/safe_browsing/certificate_reporting_service.h"
76 #include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h" 76 #include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h"
77 #include "chrome/browser/safe_browsing/mojo_safe_browsing_impl.h" 77 #include "chrome/browser/safe_browsing/mojo_safe_browsing_impl.h"
78 #include "chrome/browser/safe_browsing/safe_browsing_browser_throttle.h"
78 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 79 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
79 #include "chrome/browser/search/instant_service.h" 80 #include "chrome/browser/search/instant_service.h"
80 #include "chrome/browser/search/instant_service_factory.h" 81 #include "chrome/browser/search/instant_service_factory.h"
81 #include "chrome/browser/search/search.h" 82 #include "chrome/browser/search/search.h"
82 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" 83 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h"
83 #include "chrome/browser/speech/tts_controller.h" 84 #include "chrome/browser/speech/tts_controller.h"
84 #include "chrome/browser/speech/tts_message_filter.h" 85 #include "chrome/browser/speech/tts_message_filter.h"
85 #include "chrome/browser/ssl/ssl_blocking_page.h" 86 #include "chrome/browser/ssl/ssl_blocking_page.h"
86 #include "chrome/browser/ssl/ssl_cert_reporter.h" 87 #include "chrome/browser/ssl/ssl_cert_reporter.h"
87 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" 88 #include "chrome/browser/ssl/ssl_client_certificate_selector.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 #include "content/public/browser/storage_partition.h" 181 #include "content/public/browser/storage_partition.h"
181 #include "content/public/browser/vpn_service_proxy.h" 182 #include "content/public/browser/vpn_service_proxy.h"
182 #include "content/public/browser/web_contents.h" 183 #include "content/public/browser/web_contents.h"
183 #include "content/public/common/child_process_host.h" 184 #include "content/public/common/child_process_host.h"
184 #include "content/public/common/content_descriptors.h" 185 #include "content/public/common/content_descriptors.h"
185 #include "content/public/common/content_features.h" 186 #include "content/public/common/content_features.h"
186 #include "content/public/common/content_switches.h" 187 #include "content/public/common/content_switches.h"
187 #include "content/public/common/sandbox_type.h" 188 #include "content/public/common/sandbox_type.h"
188 #include "content/public/common/service_manager_connection.h" 189 #include "content/public/common/service_manager_connection.h"
189 #include "content/public/common/service_names.mojom.h" 190 #include "content/public/common/service_names.mojom.h"
191 #include "content/public/common/url_loader_throttle.h"
190 #include "content/public/common/url_utils.h" 192 #include "content/public/common/url_utils.h"
191 #include "content/public/common/web_preferences.h" 193 #include "content/public/common/web_preferences.h"
192 #include "device/bluetooth/adapter_factory.h" 194 #include "device/bluetooth/adapter_factory.h"
193 #include "device/bluetooth/public/interfaces/adapter.mojom.h" 195 #include "device/bluetooth/public/interfaces/adapter.mojom.h"
194 #include "device/usb/public/interfaces/chooser_service.mojom.h" 196 #include "device/usb/public/interfaces/chooser_service.mojom.h"
195 #include "device/usb/public/interfaces/device_manager.mojom.h" 197 #include "device/usb/public/interfaces/device_manager.mojom.h"
196 #include "extensions/features/features.h" 198 #include "extensions/features/features.h"
197 #include "gpu/config/gpu_switches.h" 199 #include "gpu/config/gpu_switches.h"
198 #include "media/audio/audio_manager.h" 200 #include "media/audio/audio_manager.h"
199 #include "media/media_features.h" 201 #include "media/media_features.h"
(...skipping 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 } 2509 }
2508 return false; 2510 return false;
2509 } 2511 }
2510 #endif 2512 #endif
2511 2513
2512 return true; 2514 return true;
2513 } 2515 }
2514 2516
2515 void ChromeContentBrowserClient::ResourceDispatcherHostCreated() { 2517 void ChromeContentBrowserClient::ResourceDispatcherHostCreated() {
2516 DCHECK_CURRENTLY_ON(BrowserThread::UI); 2518 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2519
2520 safe_browsing_ = g_browser_process->safe_browsing_service();
2521
2517 for (size_t i = 0; i < extra_parts_.size(); ++i) 2522 for (size_t i = 0; i < extra_parts_.size(); ++i)
2518 extra_parts_[i]->ResourceDispatcherHostCreated(); 2523 extra_parts_[i]->ResourceDispatcherHostCreated();
2519 2524
2520 return g_browser_process->ResourceDispatcherHostCreated(); 2525 return g_browser_process->ResourceDispatcherHostCreated();
2521 } 2526 }
2522 2527
2523 content::SpeechRecognitionManagerDelegate* 2528 content::SpeechRecognitionManagerDelegate*
2524 ChromeContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { 2529 ChromeContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
2525 return new speech::ChromeSpeechRecognitionManagerDelegate(); 2530 return new speech::ChromeSpeechRecognitionManagerDelegate();
2526 } 2531 }
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); 2994 Profile::FromBrowserContext(render_process_host->GetBrowserContext());
2990 net::URLRequestContextGetter* context = 2995 net::URLRequestContextGetter* context =
2991 render_process_host->GetStoragePartition()->GetURLRequestContext(); 2996 render_process_host->GetStoragePartition()->GetURLRequestContext();
2992 registry->AddInterface( 2997 registry->AddInterface(
2993 base::Bind(&NetBenchmarking::Create, profile, context)); 2998 base::Bind(&NetBenchmarking::Create, profile, context));
2994 } 2999 }
2995 3000
2996 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 3001 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
2997 switches::kEnableNetworkService)) { 3002 switches::kEnableNetworkService)) {
2998 registry->AddInterface( 3003 registry->AddInterface(
2999 base::Bind( 3004 base::Bind(&safe_browsing::MojoSafeBrowsingImpl::Create,
3000 &safe_browsing::MojoSafeBrowsingImpl::Create, 3005 safe_browsing_->database_manager(),
3001 g_browser_process->safe_browsing_service()->database_manager(), 3006 safe_browsing_->ui_manager(), render_process_host->GetID()),
3002 g_browser_process->safe_browsing_service()->ui_manager(),
3003 render_process_host->GetID()),
3004 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 3007 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
3005 } 3008 }
3006 3009
3007 #if defined(OS_WIN) 3010 #if defined(OS_WIN)
3008 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) { 3011 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) {
3009 // Add the ModuleDatabase interface. This is the interface used by renderer 3012 // Add the ModuleDatabase interface. This is the interface used by renderer
3010 // processes to notify the browser of modules in their address space. It 3013 // processes to notify the browser of modules in their address space. It
3011 // ultimately drives the chrome://conflicts UI. The process handle is not 3014 // ultimately drives the chrome://conflicts UI. The process handle is not
3012 // yet available at this point so pass in a callback to allow it to be 3015 // yet available at this point so pass in a callback to allow it to be
3013 // retrieved at the time the interface is actually created. It is safe to 3016 // retrieved at the time the interface is actually created. It is safe to
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
3496 return variations::GetVariationParamValue( 3499 return variations::GetVariationParamValue(
3497 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; 3500 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true";
3498 } 3501 }
3499 3502
3500 bool ChromeContentBrowserClient:: 3503 bool ChromeContentBrowserClient::
3501 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3504 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3502 return variations::GetVariationParamValue( 3505 return variations::GetVariationParamValue(
3503 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3506 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3504 } 3507 }
3505 3508
3509 std::vector<std::unique_ptr<content::URLLoaderThrottle>>
3510 ChromeContentBrowserClient::CreateURLLoaderThrottles(
3511 const base::Callback<content::WebContents*()>& wc_getter) {
3512 DCHECK_CURRENTLY_ON(BrowserThread::IO);
3513 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
3514 switches::kEnableNetworkService));
3515
3516 std::vector<std::unique_ptr<content::URLLoaderThrottle>> result;
3517 result.push_back(base::MakeUnique<safe_browsing::SafeBrowsingBrowserThrottle>(
3518 safe_browsing_->database_manager(), safe_browsing_->ui_manager(),
3519 wc_getter));
3520 return result;
3521 }
3522
3506 // static 3523 // static
3507 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3524 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3508 const storage::QuotaSettings* settings) { 3525 const storage::QuotaSettings* settings) {
3509 g_default_quota_settings = settings; 3526 g_default_quota_settings = settings;
3510 } 3527 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698