| 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 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/common/chrome_paths.h" | 31 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/media/media_resource_provider.h" | 32 #include "chrome/common/media/media_resource_provider.h" |
| 33 #include "chrome/common/net/net_resource_provider.h" | 33 #include "chrome/common/net/net_resource_provider.h" |
| 34 #include "chrome/common/render_messages.h" | 34 #include "chrome/common/render_messages.h" |
| 35 #include "chrome/common/resource_usage_reporter.mojom.h" | 35 #include "chrome/common/resource_usage_reporter.mojom.h" |
| 36 #include "chrome/common/resource_usage_reporter_type_converters.h" | 36 #include "chrome/common/resource_usage_reporter_type_converters.h" |
| 37 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
| 38 #include "chrome/renderer/content_settings_observer.h" | 38 #include "chrome/renderer/content_settings_observer.h" |
| 39 #include "chrome/renderer/security_filter_peer.h" | 39 #include "chrome/renderer/security_filter_peer.h" |
| 40 #include "content/public/child/resource_dispatcher_delegate.h" | 40 #include "content/public/child/resource_dispatcher_delegate.h" |
| 41 #include "content/public/common/service_registry.h" | |
| 42 #include "content/public/renderer/render_thread.h" | 41 #include "content/public/renderer/render_thread.h" |
| 43 #include "content/public/renderer/render_view.h" | 42 #include "content/public/renderer/render_view.h" |
| 44 #include "content/public/renderer/render_view_visitor.h" | 43 #include "content/public/renderer/render_view_visitor.h" |
| 45 #include "media/base/media_resources.h" | 44 #include "media/base/media_resources.h" |
| 46 #include "mojo/public/cpp/bindings/strong_binding.h" | 45 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 47 #include "net/base/net_errors.h" | 46 #include "net/base/net_errors.h" |
| 48 #include "net/base/net_module.h" | 47 #include "net/base/net_module.h" |
| 48 #include "services/shell/public/cpp/interface_registry.h" |
| 49 #include "third_party/WebKit/public/web/WebCache.h" | 49 #include "third_party/WebKit/public/web/WebCache.h" |
| 50 #include "third_party/WebKit/public/web/WebDocument.h" | 50 #include "third_party/WebKit/public/web/WebDocument.h" |
| 51 #include "third_party/WebKit/public/web/WebFrame.h" | 51 #include "third_party/WebKit/public/web/WebFrame.h" |
| 52 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 52 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
| 53 #include "third_party/WebKit/public/web/WebView.h" | 53 #include "third_party/WebKit/public/web/WebView.h" |
| 54 | 54 |
| 55 #if defined(ENABLE_EXTENSIONS) | 55 #if defined(ENABLE_EXTENSIONS) |
| 56 #include "chrome/renderer/extensions/extension_localization_peer.h" | 56 #include "chrome/renderer/extensions/extension_localization_peer.h" |
| 57 #endif | 57 #endif |
| 58 | 58 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 236 |
| 237 ChromeRenderThreadObserver::ChromeRenderThreadObserver() | 237 ChromeRenderThreadObserver::ChromeRenderThreadObserver() |
| 238 : field_trial_syncer_(this), weak_factory_(this) { | 238 : field_trial_syncer_(this), weak_factory_(this) { |
| 239 const base::CommandLine& command_line = | 239 const base::CommandLine& command_line = |
| 240 *base::CommandLine::ForCurrentProcess(); | 240 *base::CommandLine::ForCurrentProcess(); |
| 241 | 241 |
| 242 RenderThread* thread = RenderThread::Get(); | 242 RenderThread* thread = RenderThread::Get(); |
| 243 resource_delegate_.reset(new RendererResourceDelegate()); | 243 resource_delegate_.reset(new RendererResourceDelegate()); |
| 244 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); | 244 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); |
| 245 | 245 |
| 246 thread->GetServiceRegistry()->AddService( | 246 thread->GetInterfaceRegistry()->AddInterface( |
| 247 base::Bind(CreateResourceUsageReporter, weak_factory_.GetWeakPtr())); | 247 base::Bind(CreateResourceUsageReporter, weak_factory_.GetWeakPtr())); |
| 248 | 248 |
| 249 // Configure modules that need access to resources. | 249 // Configure modules that need access to resources. |
| 250 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); | 250 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); |
| 251 media::SetLocalizedStringProvider( | 251 media::SetLocalizedStringProvider( |
| 252 chrome_common_media::LocalizedStringProvider); | 252 chrome_common_media::LocalizedStringProvider); |
| 253 | 253 |
| 254 field_trial_syncer_.InitFieldTrialObserving(command_line); | 254 field_trial_syncer_.InitFieldTrialObserving(command_line); |
| 255 | 255 |
| 256 // chrome-native: is a scheme used for placeholder navigations that allow | 256 // chrome-native: is a scheme used for placeholder navigations that allow |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( | 303 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( |
| 304 const std::string& trial_name, | 304 const std::string& trial_name, |
| 305 const std::string& group_name) { | 305 const std::string& group_name) { |
| 306 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); | 306 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); |
| 307 } | 307 } |
| 308 | 308 |
| 309 const RendererContentSettingRules* | 309 const RendererContentSettingRules* |
| 310 ChromeRenderThreadObserver::content_setting_rules() const { | 310 ChromeRenderThreadObserver::content_setting_rules() const { |
| 311 return &content_setting_rules_; | 311 return &content_setting_rules_; |
| 312 } | 312 } |
| OLD | NEW |