| 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/renderer/chrome_render_thread_observer.h" | 5 #include "chrome/renderer/chrome_render_thread_observer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 thread->GetInterfaceRegistry()->AddInterface( | 243 thread->GetInterfaceRegistry()->AddInterface( |
| 244 base::Bind(CreateResourceUsageReporter, weak_factory_.GetWeakPtr())); | 244 base::Bind(CreateResourceUsageReporter, weak_factory_.GetWeakPtr())); |
| 245 | 245 |
| 246 // Configure modules that need access to resources. | 246 // Configure modules that need access to resources. |
| 247 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); | 247 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); |
| 248 media::SetLocalizedStringProvider( | 248 media::SetLocalizedStringProvider( |
| 249 chrome_common_media::LocalizedStringProvider); | 249 chrome_common_media::LocalizedStringProvider); |
| 250 | 250 |
| 251 // chrome-native: is a scheme used for placeholder navigations that allow | 251 // chrome-native: is a scheme used for placeholder navigations that allow |
| 252 // UIs to be drawn with platform native widgets instead of HTML. These pages | 252 // UIs to be drawn with platform native widgets instead of HTML. These pages |
| 253 // should not be accessible, and should also be treated as empty documents | 253 // should not be accessible. No code should be runnable in these pages, |
| 254 // that can commit synchronously. No code should be runnable in these pages, | |
| 255 // so it should not need to access anything nor should it allow javascript | 254 // so it should not need to access anything nor should it allow javascript |
| 256 // URLs since it should never be visible to the user. | 255 // URLs since it should never be visible to the user. |
| 256 // See also ChromeContentClient::AddAdditionalSchemes that adds it as an |
| 257 // empty document scheme. |
| 257 WebString native_scheme(WebString::fromASCII(chrome::kChromeNativeScheme)); | 258 WebString native_scheme(WebString::fromASCII(chrome::kChromeNativeScheme)); |
| 258 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(native_scheme); | 259 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(native_scheme); |
| 259 WebSecurityPolicy::registerURLSchemeAsEmptyDocument(native_scheme); | |
| 260 WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs( | 260 WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs( |
| 261 native_scheme); | 261 native_scheme); |
| 262 | 262 |
| 263 thread->GetInterfaceRegistry()->AddInterface( | 263 thread->GetInterfaceRegistry()->AddInterface( |
| 264 visited_link_slave_->GetBindCallback()); | 264 visited_link_slave_->GetBindCallback()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 ChromeRenderThreadObserver::~ChromeRenderThreadObserver() {} | 267 ChromeRenderThreadObserver::~ChromeRenderThreadObserver() {} |
| 268 | 268 |
| 269 void ChromeRenderThreadObserver::RegisterMojoInterfaces( | 269 void ChromeRenderThreadObserver::RegisterMojoInterfaces( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 304 |
| 305 void ChromeRenderThreadObserver::OnRendererConfigurationAssociatedRequest( | 305 void ChromeRenderThreadObserver::OnRendererConfigurationAssociatedRequest( |
| 306 chrome::mojom::RendererConfigurationAssociatedRequest request) { | 306 chrome::mojom::RendererConfigurationAssociatedRequest request) { |
| 307 renderer_configuration_bindings_.AddBinding(this, std::move(request)); | 307 renderer_configuration_bindings_.AddBinding(this, std::move(request)); |
| 308 } | 308 } |
| 309 | 309 |
| 310 const RendererContentSettingRules* | 310 const RendererContentSettingRules* |
| 311 ChromeRenderThreadObserver::content_setting_rules() const { | 311 ChromeRenderThreadObserver::content_setting_rules() const { |
| 312 return &content_setting_rules_; | 312 return &content_setting_rules_; |
| 313 } | 313 } |
| OLD | NEW |