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

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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "chrome/browser/prerender/prerender_manager.h" 65 #include "chrome/browser/prerender/prerender_manager.h"
66 #include "chrome/browser/prerender/prerender_manager_factory.h" 66 #include "chrome/browser/prerender/prerender_manager_factory.h"
67 #include "chrome/browser/prerender/prerender_message_filter.h" 67 #include "chrome/browser/prerender/prerender_message_filter.h"
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/browser_url_loader_throttle.h"
75 #include "chrome/browser/safe_browsing/certificate_reporting_service.h" 76 #include "chrome/browser/safe_browsing/certificate_reporting_service.h"
76 #include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h" 77 #include "chrome/browser/safe_browsing/certificate_reporting_service_factory.h"
77 #include "chrome/browser/safe_browsing/mojo_safe_browsing_impl.h" 78 #include "chrome/browser/safe_browsing/mojo_safe_browsing_impl.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"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 #include "content/public/browser/storage_partition.h" 180 #include "content/public/browser/storage_partition.h"
180 #include "content/public/browser/vpn_service_proxy.h" 181 #include "content/public/browser/vpn_service_proxy.h"
181 #include "content/public/browser/web_contents.h" 182 #include "content/public/browser/web_contents.h"
182 #include "content/public/common/child_process_host.h" 183 #include "content/public/common/child_process_host.h"
183 #include "content/public/common/content_descriptors.h" 184 #include "content/public/common/content_descriptors.h"
184 #include "content/public/common/content_features.h" 185 #include "content/public/common/content_features.h"
185 #include "content/public/common/content_switches.h" 186 #include "content/public/common/content_switches.h"
186 #include "content/public/common/sandbox_type.h" 187 #include "content/public/common/sandbox_type.h"
187 #include "content/public/common/service_manager_connection.h" 188 #include "content/public/common/service_manager_connection.h"
188 #include "content/public/common/service_names.mojom.h" 189 #include "content/public/common/service_names.mojom.h"
190 #include "content/public/common/url_loader_throttle.h"
189 #include "content/public/common/url_utils.h" 191 #include "content/public/common/url_utils.h"
190 #include "content/public/common/web_preferences.h" 192 #include "content/public/common/web_preferences.h"
191 #include "device/bluetooth/adapter_factory.h" 193 #include "device/bluetooth/adapter_factory.h"
192 #include "device/bluetooth/public/interfaces/adapter.mojom.h" 194 #include "device/bluetooth/public/interfaces/adapter.mojom.h"
193 #include "device/usb/public/interfaces/chooser_service.mojom.h" 195 #include "device/usb/public/interfaces/chooser_service.mojom.h"
194 #include "device/usb/public/interfaces/device_manager.mojom.h" 196 #include "device/usb/public/interfaces/device_manager.mojom.h"
195 #include "extensions/features/features.h" 197 #include "extensions/features/features.h"
196 #include "gpu/config/gpu_switches.h" 198 #include "gpu/config/gpu_switches.h"
197 #include "media/audio/audio_manager.h" 199 #include "media/audio/audio_manager.h"
198 #include "media/media_features.h" 200 #include "media/media_features.h"
(...skipping 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 } 2447 }
2446 return false; 2448 return false;
2447 } 2449 }
2448 #endif 2450 #endif
2449 2451
2450 return true; 2452 return true;
2451 } 2453 }
2452 2454
2453 void ChromeContentBrowserClient::ResourceDispatcherHostCreated() { 2455 void ChromeContentBrowserClient::ResourceDispatcherHostCreated() {
2454 DCHECK_CURRENTLY_ON(BrowserThread::UI); 2456 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2457
2458 safe_browsing_service_ = g_browser_process->safe_browsing_service();
2459
2455 for (size_t i = 0; i < extra_parts_.size(); ++i) 2460 for (size_t i = 0; i < extra_parts_.size(); ++i)
2456 extra_parts_[i]->ResourceDispatcherHostCreated(); 2461 extra_parts_[i]->ResourceDispatcherHostCreated();
2457 2462
2458 return g_browser_process->ResourceDispatcherHostCreated(); 2463 return g_browser_process->ResourceDispatcherHostCreated();
2459 } 2464 }
2460 2465
2461 content::SpeechRecognitionManagerDelegate* 2466 content::SpeechRecognitionManagerDelegate*
2462 ChromeContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { 2467 ChromeContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
2463 return new speech::ChromeSpeechRecognitionManagerDelegate(); 2468 return new speech::ChromeSpeechRecognitionManagerDelegate();
2464 } 2469 }
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); 2936 Profile::FromBrowserContext(render_process_host->GetBrowserContext());
2932 net::URLRequestContextGetter* context = 2937 net::URLRequestContextGetter* context =
2933 render_process_host->GetStoragePartition()->GetURLRequestContext(); 2938 render_process_host->GetStoragePartition()->GetURLRequestContext();
2934 registry->AddInterface( 2939 registry->AddInterface(
2935 base::Bind(&NetBenchmarking::Create, profile, context)); 2940 base::Bind(&NetBenchmarking::Create, profile, context));
2936 } 2941 }
2937 2942
2938 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 2943 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
2939 switches::kEnableNetworkService)) { 2944 switches::kEnableNetworkService)) {
2940 registry->AddInterface( 2945 registry->AddInterface(
2941 base::Bind( 2946 base::Bind(&safe_browsing::MojoSafeBrowsingImpl::Create,
2942 &safe_browsing::MojoSafeBrowsingImpl::Create, 2947 safe_browsing_service_->database_manager(),
2943 g_browser_process->safe_browsing_service()->database_manager(), 2948 safe_browsing_service_->ui_manager(),
2944 g_browser_process->safe_browsing_service()->ui_manager(), 2949 render_process_host->GetID()),
2945 render_process_host->GetID()),
2946 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 2950 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
2947 } 2951 }
2948 2952
2949 #if defined(OS_WIN) 2953 #if defined(OS_WIN)
2950 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) { 2954 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) {
2951 // Add the ModuleDatabase interface. This is the interface used by renderer 2955 // Add the ModuleDatabase interface. This is the interface used by renderer
2952 // processes to notify the browser of modules in their address space. It 2956 // processes to notify the browser of modules in their address space. It
2953 // ultimately drives the chrome://conflicts UI. The process handle is not 2957 // ultimately drives the chrome://conflicts UI. The process handle is not
2954 // yet available at this point so pass in a callback to allow it to be 2958 // yet available at this point so pass in a callback to allow it to be
2955 // retrieved at the time the interface is actually created. It is safe to 2959 // retrieved at the time the interface is actually created. It is safe to
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
3426 3430
3427 std::unique_ptr<base::TaskScheduler::InitParams> 3431 std::unique_ptr<base::TaskScheduler::InitParams>
3428 ChromeContentBrowserClient::GetTaskSchedulerInitParams() { 3432 ChromeContentBrowserClient::GetTaskSchedulerInitParams() {
3429 return task_scheduler_util::GetBrowserTaskSchedulerInitParamsFromVariations(); 3433 return task_scheduler_util::GetBrowserTaskSchedulerInitParamsFromVariations();
3430 } 3434 }
3431 3435
3432 base::FilePath ChromeContentBrowserClient::GetLoggingFileName() { 3436 base::FilePath ChromeContentBrowserClient::GetLoggingFileName() {
3433 return logging::GetLogFileName(); 3437 return logging::GetLogFileName();
3434 } 3438 }
3435 3439
3440 std::vector<std::unique_ptr<content::URLLoaderThrottle>>
3441 ChromeContentBrowserClient::CreateURLLoaderThrottles(
3442 const base::Callback<content::WebContents*()>& wc_getter) {
3443 DCHECK_CURRENTLY_ON(BrowserThread::IO);
3444 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
3445 switches::kEnableNetworkService));
3446
3447 std::vector<std::unique_ptr<content::URLLoaderThrottle>> result;
3448 result.push_back(base::MakeUnique<safe_browsing::BrowserURLLoaderThrottle>(
3449 safe_browsing_service_->database_manager(),
3450 safe_browsing_service_->ui_manager(), wc_getter));
3451 return result;
3452 }
3453
3436 // static 3454 // static
3437 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3455 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3438 const storage::QuotaSettings* settings) { 3456 const storage::QuotaSettings* settings) {
3439 g_default_quota_settings = settings; 3457 g_default_quota_settings = settings;
3440 } 3458 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/safe_browsing/browser_url_loader_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698