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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 #include "content/public/browser/web_contents.h" | 162 #include "content/public/browser/web_contents.h" |
163 #include "content/public/common/child_process_host.h" | 163 #include "content/public/common/child_process_host.h" |
164 #include "content/public/common/content_descriptors.h" | 164 #include "content/public/common/content_descriptors.h" |
165 #include "content/public/common/content_features.h" | 165 #include "content/public/common/content_features.h" |
166 #include "content/public/common/content_switches.h" | 166 #include "content/public/common/content_switches.h" |
167 #include "content/public/common/mojo_shell_connection.h" | 167 #include "content/public/common/mojo_shell_connection.h" |
168 #include "content/public/common/sandbox_type.h" | 168 #include "content/public/common/sandbox_type.h" |
169 #include "content/public/common/service_names.h" | 169 #include "content/public/common/service_names.h" |
170 #include "content/public/common/url_utils.h" | 170 #include "content/public/common/url_utils.h" |
171 #include "content/public/common/web_preferences.h" | 171 #include "content/public/common/web_preferences.h" |
172 #include "device/bluetooth/adapter.h" | |
173 #include "device/bluetooth/public/interfaces/adapter.mojom.h" | |
172 #include "device/usb/public/interfaces/chooser_service.mojom.h" | 174 #include "device/usb/public/interfaces/chooser_service.mojom.h" |
173 #include "device/usb/public/interfaces/device_manager.mojom.h" | 175 #include "device/usb/public/interfaces/device_manager.mojom.h" |
174 #include "gin/v8_initializer.h" | 176 #include "gin/v8_initializer.h" |
175 #include "net/base/mime_util.h" | 177 #include "net/base/mime_util.h" |
176 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 178 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
177 #include "net/cookies/canonical_cookie.h" | 179 #include "net/cookies/canonical_cookie.h" |
178 #include "net/cookies/cookie_options.h" | 180 #include "net/cookies/cookie_options.h" |
179 #include "net/ssl/ssl_cert_request_info.h" | 181 #include "net/ssl/ssl_cert_request_info.h" |
180 #include "ppapi/host/ppapi_host.h" | 182 #include "ppapi/host/ppapi_host.h" |
181 #include "services/shell/public/cpp/interface_provider.h" | 183 #include "services/shell/public/cpp/interface_provider.h" |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1251 #else | 1253 #else |
1252 return true; | 1254 return true; |
1253 #endif | 1255 #endif |
1254 } | 1256 } |
1255 | 1257 |
1256 bool ChromeContentBrowserClient::MayReuseHost( | 1258 bool ChromeContentBrowserClient::MayReuseHost( |
1257 content::RenderProcessHost* process_host) { | 1259 content::RenderProcessHost* process_host) { |
1258 // If there is currently a prerender in progress for the host provided, | 1260 // If there is currently a prerender in progress for the host provided, |
1259 // it may not be shared. We require prerenders to be by themselves in a | 1261 // it may not be shared. We require prerenders to be by themselves in a |
1260 // separate process so that we can monitor their resource usage. | 1262 // separate process so that we can monitor their resource usage. |
1263 Profile* profile = | |
scheib
2016/09/30 04:25:37
Is this a merge glitch? git map-branches will show
| |
1264 Profile::FromBrowserContext(process_host->GetBrowserContext()); | |
1261 prerender::PrerenderManager* prerender_manager = | 1265 prerender::PrerenderManager* prerender_manager = |
1262 prerender::PrerenderManagerFactory::GetForBrowserContext( | 1266 prerender::PrerenderManagerFactory::GetForBrowserContext( |
1263 process_host->GetBrowserContext()); | 1267 process_host->GetBrowserContext()); |
1264 if (prerender_manager && | 1268 if (prerender_manager && |
1265 !prerender_manager->MayReuseProcessHost(process_host)) { | 1269 !prerender_manager->MayReuseProcessHost(process_host)) { |
1266 return false; | 1270 return false; |
1267 } | 1271 } |
1268 | 1272 |
1269 return true; | 1273 return true; |
1270 } | 1274 } |
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2939 !render_frame_host->GetSiteInstance()->GetSiteURL().SchemeIs( | 2943 !render_frame_host->GetSiteInstance()->GetSiteURL().SchemeIs( |
2940 extensions::kExtensionScheme) | 2944 extensions::kExtensionScheme) |
2941 #endif | 2945 #endif |
2942 ) { | 2946 ) { |
2943 registry->AddInterface( | 2947 registry->AddInterface( |
2944 base::Bind(&CreateUsbDeviceManager, render_frame_host)); | 2948 base::Bind(&CreateUsbDeviceManager, render_frame_host)); |
2945 registry->AddInterface( | 2949 registry->AddInterface( |
2946 base::Bind(&CreateWebUsbChooserService, render_frame_host)); | 2950 base::Bind(&CreateWebUsbChooserService, render_frame_host)); |
2947 } | 2951 } |
2948 | 2952 |
2953 registry->AddInterface<bluetooth::mojom::Adapter>( | |
2954 base::Bind(&bluetooth::Adapter::Create)); | |
2955 | |
2949 if (!render_frame_host->GetParent()) { | 2956 if (!render_frame_host->GetParent()) { |
2950 // Register mojo CredentialManager interface only for main frame. | 2957 // Register mojo CredentialManager interface only for main frame. |
2951 registry->AddInterface( | 2958 registry->AddInterface( |
2952 base::Bind(&ChromePasswordManagerClient::BindCredentialManager, | 2959 base::Bind(&ChromePasswordManagerClient::BindCredentialManager, |
2953 render_frame_host)); | 2960 render_frame_host)); |
2954 // Register mojo ContentTranslateDriver interface only for main frame. | 2961 // Register mojo ContentTranslateDriver interface only for main frame. |
2955 registry->AddInterface(base::Bind( | 2962 registry->AddInterface(base::Bind( |
2956 &ChromeTranslateClient::BindContentTranslateDriver, render_frame_host)); | 2963 &ChromeTranslateClient::BindContentTranslateDriver, render_frame_host)); |
2957 } | 2964 } |
2958 | 2965 |
(...skipping 16 matching lines...) Expand all Loading... | |
2975 registry->AddInterface( | 2982 registry->AddInterface( |
2976 web_contents->GetJavaInterfaces() | 2983 web_contents->GetJavaInterfaces() |
2977 ->CreateInterfaceFactory<blink::mojom::ShareService>()); | 2984 ->CreateInterfaceFactory<blink::mojom::ShareService>()); |
2978 } | 2985 } |
2979 #endif | 2986 #endif |
2980 | 2987 |
2981 #if defined(ENABLE_MEDIA_ROUTER) | 2988 #if defined(ENABLE_MEDIA_ROUTER) |
2982 registry->AddInterface( | 2989 registry->AddInterface( |
2983 base::Bind(&CastRemotingConnector::CreateRemoterFactory, | 2990 base::Bind(&CastRemotingConnector::CreateRemoterFactory, |
2984 render_frame_host)); | 2991 render_frame_host)); |
2992 ChromeInterfaceRegistrarAndroid::ExposeInterfacesToFrame(registry, | |
scheib
2016/09/30 04:25:37
Merge glitch?
| |
2993 render_frame_host); | |
2985 #endif | 2994 #endif |
2986 } | 2995 } |
2987 | 2996 |
2988 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( | 2997 void ChromeContentBrowserClient::ExposeInterfacesToGpuProcess( |
2989 shell::InterfaceRegistry* registry, | 2998 shell::InterfaceRegistry* registry, |
2990 content::GpuProcessHost* render_process_host) { | 2999 content::GpuProcessHost* render_process_host) { |
2991 registry->AddInterface( | 3000 registry->AddInterface( |
2992 base::Bind(&metrics::CallStackProfileCollector::Create, | 3001 base::Bind(&metrics::CallStackProfileCollector::Create, |
2993 metrics::CallStackProfileParams::GPU_PROCESS)); | 3002 metrics::CallStackProfileParams::GPU_PROCESS)); |
2994 } | 3003 } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3240 if (channel <= kMaxDisableEncryptionChannel) { | 3249 if (channel <= kMaxDisableEncryptionChannel) { |
3241 static const char* const kWebRtcDevSwitchNames[] = { | 3250 static const char* const kWebRtcDevSwitchNames[] = { |
3242 switches::kDisableWebRtcEncryption, | 3251 switches::kDisableWebRtcEncryption, |
3243 }; | 3252 }; |
3244 to_command_line->CopySwitchesFrom(from_command_line, | 3253 to_command_line->CopySwitchesFrom(from_command_line, |
3245 kWebRtcDevSwitchNames, | 3254 kWebRtcDevSwitchNames, |
3246 arraysize(kWebRtcDevSwitchNames)); | 3255 arraysize(kWebRtcDevSwitchNames)); |
3247 } | 3256 } |
3248 } | 3257 } |
3249 #endif // defined(ENABLE_WEBRTC) | 3258 #endif // defined(ENABLE_WEBRTC) |
OLD | NEW |