| OLD | NEW |
| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 #include "net/base/mime_util.h" | 189 #include "net/base/mime_util.h" |
| 190 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 190 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 191 #include "net/cookies/canonical_cookie.h" | 191 #include "net/cookies/canonical_cookie.h" |
| 192 #include "net/cookies/cookie_options.h" | 192 #include "net/cookies/cookie_options.h" |
| 193 #include "net/ssl/ssl_cert_request_info.h" | 193 #include "net/ssl/ssl_cert_request_info.h" |
| 194 #include "ppapi/features/features.h" | 194 #include "ppapi/features/features.h" |
| 195 #include "ppapi/host/ppapi_host.h" | 195 #include "ppapi/host/ppapi_host.h" |
| 196 #include "printing/features/features.h" | 196 #include "printing/features/features.h" |
| 197 #include "services/image_decoder/public/interfaces/constants.mojom.h" | 197 #include "services/image_decoder/public/interfaces/constants.mojom.h" |
| 198 #include "services/preferences/public/interfaces/preferences.mojom.h" | 198 #include "services/preferences/public/interfaces/preferences.mojom.h" |
| 199 #include "services/resource_coordinator/memory/coordinator/coordinator_impl.h" |
| 199 #include "services/service_manager/public/cpp/interface_provider.h" | 200 #include "services/service_manager/public/cpp/interface_provider.h" |
| 200 #include "services/service_manager/public/cpp/interface_registry.h" | 201 #include "services/service_manager/public/cpp/interface_registry.h" |
| 201 #include "services/service_manager/public/cpp/service.h" | 202 #include "services/service_manager/public/cpp/service.h" |
| 202 #include "storage/browser/fileapi/external_mount_points.h" | 203 #include "storage/browser/fileapi/external_mount_points.h" |
| 203 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" | 204 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" |
| 204 #include "ui/base/l10n/l10n_util.h" | 205 #include "ui/base/l10n/l10n_util.h" |
| 205 #include "ui/base/resource/resource_bundle.h" | 206 #include "ui/base/resource/resource_bundle.h" |
| 206 #include "ui/resources/grit/ui_resources.h" | 207 #include "ui/resources/grit/ui_resources.h" |
| 207 #include "url/gurl.h" | 208 #include "url/gurl.h" |
| 208 #include "url/origin.h" | 209 #include "url/origin.h" |
| (...skipping 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2994 base::Unretained(ModuleDatabase::GetInstance())), | 2995 base::Unretained(ModuleDatabase::GetInstance())), |
| 2995 ui_task_runner); | 2996 ui_task_runner); |
| 2996 } | 2997 } |
| 2997 #endif | 2998 #endif |
| 2998 | 2999 |
| 2999 #if defined(OS_CHROMEOS) | 3000 #if defined(OS_CHROMEOS) |
| 3000 registry->AddInterface<metrics::mojom::LeakDetector>( | 3001 registry->AddInterface<metrics::mojom::LeakDetector>( |
| 3001 base::Bind(&metrics::LeakDetectorRemoteController::Create), | 3002 base::Bind(&metrics::LeakDetectorRemoteController::Create), |
| 3002 ui_task_runner); | 3003 ui_task_runner); |
| 3003 #endif | 3004 #endif |
| 3005 |
| 3006 BrowserThread::PostTask( |
| 3007 BrowserThread::UI, FROM_HERE, |
| 3008 base::Bind( |
| 3009 &ChromeContentBrowserClient::ExposeMemoryInstrumentationOnUIThread, |
| 3010 base::Unretained(this), base::Unretained(registry))); |
| 3004 } | 3011 } |
| 3005 | 3012 |
| 3006 void ChromeContentBrowserClient::ExposeInterfacesToMediaService( | 3013 void ChromeContentBrowserClient::ExposeInterfacesToMediaService( |
| 3007 service_manager::InterfaceRegistry* registry, | 3014 service_manager::InterfaceRegistry* registry, |
| 3008 content::RenderFrameHost* render_frame_host) { | 3015 content::RenderFrameHost* render_frame_host) { |
| 3009 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. | 3016 // TODO(xhwang): Only register this when ENABLE_MOJO_MEDIA. |
| 3010 #if defined(OS_CHROMEOS) | 3017 #if defined(OS_CHROMEOS) |
| 3011 registry->AddInterface( | 3018 registry->AddInterface( |
| 3012 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, | 3019 base::Bind(&chromeos::attestation::PlatformVerificationImpl::Create, |
| 3013 render_frame_host)); | 3020 render_frame_host)); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3090 } | 3097 } |
| 3091 #endif | 3098 #endif |
| 3092 } | 3099 } |
| 3093 | 3100 |
| 3094 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( | 3101 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( |
| 3095 service_manager::InterfaceRegistry* registry, | 3102 service_manager::InterfaceRegistry* registry, |
| 3096 content::GpuProcessHost* render_process_host) { | 3103 content::GpuProcessHost* render_process_host) { |
| 3097 registry->AddInterface( | 3104 registry->AddInterface( |
| 3098 base::Bind(&metrics::CallStackProfileCollector::Create, | 3105 base::Bind(&metrics::CallStackProfileCollector::Create, |
| 3099 metrics::CallStackProfileParams::GPU_PROCESS)); | 3106 metrics::CallStackProfileParams::GPU_PROCESS)); |
| 3107 |
| 3108 BrowserThread::PostTask( |
| 3109 BrowserThread::UI, FROM_HERE, |
| 3110 base::Bind( |
| 3111 &ChromeContentBrowserClient::ExposeMemoryInstrumentationOnUIThread, |
| 3112 base::Unretained(this), base::Unretained(registry))); |
| 3113 } |
| 3114 |
| 3115 void ChromeContentBrowserClient::ExposeMemoryInstrumentationOnUIThread( |
| 3116 service_manager::InterfaceRegistry* registry) { |
| 3117 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 3118 registry->AddInterface( |
| 3119 base::Bind( |
| 3120 &memory_instrumentation::CoordinatorImpl::BindCoordinatorRequest, |
| 3121 base::Unretained( |
| 3122 memory_instrumentation::CoordinatorImpl::GetInstance())), |
| 3123 content::BrowserThread::GetTaskRunnerForThread( |
| 3124 content::BrowserThread::UI)); |
| 3100 } | 3125 } |
| 3101 | 3126 |
| 3102 void ChromeContentBrowserClient::RegisterInProcessServices( | 3127 void ChromeContentBrowserClient::RegisterInProcessServices( |
| 3103 StaticServiceMap* services) { | 3128 StaticServiceMap* services) { |
| 3104 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) | 3129 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) |
| 3105 content::ServiceInfo info; | 3130 content::ServiceInfo info; |
| 3106 info.factory = base::Bind(&media::CreateMediaService); | 3131 info.factory = base::Bind(&media::CreateMediaService); |
| 3107 services->insert(std::make_pair("media", info)); | 3132 services->insert(std::make_pair("media", info)); |
| 3108 #endif | 3133 #endif |
| 3109 #if defined(OS_CHROMEOS) | 3134 #if defined(OS_CHROMEOS) |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3434 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3459 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3435 return variations::GetVariationParamValue( | 3460 return variations::GetVariationParamValue( |
| 3436 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3461 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3437 } | 3462 } |
| 3438 | 3463 |
| 3439 // static | 3464 // static |
| 3440 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3465 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3441 const storage::QuotaSettings* settings) { | 3466 const storage::QuotaSettings* settings) { |
| 3442 g_default_quota_settings = settings; | 3467 g_default_quota_settings = settings; |
| 3443 } | 3468 } |
| OLD | NEW |