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 11 matching lines...) Expand all Loading... |
22 #include "base/metrics/histogram.h" | 22 #include "base/metrics/histogram.h" |
23 #include "base/metrics/statistics_recorder.h" | 23 #include "base/metrics/statistics_recorder.h" |
24 #include "base/path_service.h" | 24 #include "base/path_service.h" |
25 #include "base/single_thread_task_runner.h" | 25 #include "base/single_thread_task_runner.h" |
26 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
27 #include "base/threading/platform_thread.h" | 27 #include "base/threading/platform_thread.h" |
28 #include "base/threading/thread_task_runner_handle.h" | 28 #include "base/threading/thread_task_runner_handle.h" |
29 #include "build/build_config.h" | 29 #include "build/build_config.h" |
30 #include "chrome/common/child_process_logging.h" | 30 #include "chrome/common/child_process_logging.h" |
31 #include "chrome/common/chrome_paths.h" | 31 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/field_trial_recorder.mojom.h" |
32 #include "chrome/common/media/media_resource_provider.h" | 33 #include "chrome/common/media/media_resource_provider.h" |
33 #include "chrome/common/net/net_resource_provider.h" | 34 #include "chrome/common/net/net_resource_provider.h" |
34 #include "chrome/common/render_messages.h" | 35 #include "chrome/common/render_messages.h" |
35 #include "chrome/common/resource_usage_reporter.mojom.h" | 36 #include "chrome/common/resource_usage_reporter.mojom.h" |
36 #include "chrome/common/resource_usage_reporter_type_converters.h" | 37 #include "chrome/common/resource_usage_reporter_type_converters.h" |
37 #include "chrome/common/url_constants.h" | 38 #include "chrome/common/url_constants.h" |
38 #include "chrome/renderer/content_settings_observer.h" | 39 #include "chrome/renderer/content_settings_observer.h" |
39 #include "chrome/renderer/security_filter_peer.h" | 40 #include "chrome/renderer/security_filter_peer.h" |
40 #include "components/visitedlink/renderer/visitedlink_slave.h" | 41 #include "components/visitedlink/renderer/visitedlink_slave.h" |
41 #include "content/public/child/resource_dispatcher_delegate.h" | 42 #include "content/public/child/resource_dispatcher_delegate.h" |
42 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
43 #include "content/public/renderer/render_thread.h" | 44 #include "content/public/renderer/render_thread.h" |
44 #include "content/public/renderer/render_view.h" | 45 #include "content/public/renderer/render_view.h" |
45 #include "content/public/renderer/render_view_visitor.h" | 46 #include "content/public/renderer/render_view_visitor.h" |
46 #include "extensions/features/features.h" | 47 #include "extensions/features/features.h" |
47 #include "media/base/media_resources.h" | 48 #include "media/base/media_resources.h" |
48 #include "mojo/public/cpp/bindings/strong_binding.h" | 49 #include "mojo/public/cpp/bindings/strong_binding.h" |
49 #include "net/base/net_errors.h" | 50 #include "net/base/net_errors.h" |
50 #include "net/base/net_module.h" | 51 #include "net/base/net_module.h" |
| 52 #include "services/service_manager/public/cpp/interface_provider.h" |
51 #include "services/service_manager/public/cpp/interface_registry.h" | 53 #include "services/service_manager/public/cpp/interface_registry.h" |
52 #include "third_party/WebKit/public/web/WebCache.h" | 54 #include "third_party/WebKit/public/web/WebCache.h" |
53 #include "third_party/WebKit/public/web/WebDocument.h" | 55 #include "third_party/WebKit/public/web/WebDocument.h" |
54 #include "third_party/WebKit/public/web/WebFrame.h" | 56 #include "third_party/WebKit/public/web/WebFrame.h" |
55 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 57 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
56 #include "third_party/WebKit/public/web/WebView.h" | 58 #include "third_party/WebKit/public/web/WebView.h" |
57 | 59 |
58 #if BUILDFLAG(ENABLE_EXTENSIONS) | 60 #if BUILDFLAG(ENABLE_EXTENSIONS) |
59 #include "chrome/renderer/extensions/extension_localization_peer.h" | 61 #include "chrome/renderer/extensions/extension_localization_peer.h" |
60 #endif | 62 #endif |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 return handled; | 288 return handled; |
287 } | 289 } |
288 | 290 |
289 void ChromeRenderThreadObserver::OnRenderProcessShutdown() { | 291 void ChromeRenderThreadObserver::OnRenderProcessShutdown() { |
290 visited_link_slave_.reset(); | 292 visited_link_slave_.reset(); |
291 } | 293 } |
292 | 294 |
293 void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized( | 295 void ChromeRenderThreadObserver::OnFieldTrialGroupFinalized( |
294 const std::string& trial_name, | 296 const std::string& trial_name, |
295 const std::string& group_name) { | 297 const std::string& group_name) { |
296 content::RenderThread::Get()->Send( | 298 chrome::mojom::FieldTrialRecorderPtr field_trial_recorder; |
297 new ChromeViewHostMsg_FieldTrialActivated(trial_name)); | 299 content::RenderThread::Get()->GetRemoteInterfaces()->GetInterface( |
| 300 &field_trial_recorder); |
| 301 field_trial_recorder->FieldTrialActivated(trial_name); |
298 } | 302 } |
299 | 303 |
300 void ChromeRenderThreadObserver::OnSetIsIncognitoProcess( | 304 void ChromeRenderThreadObserver::OnSetIsIncognitoProcess( |
301 bool is_incognito_process) { | 305 bool is_incognito_process) { |
302 is_incognito_process_ = is_incognito_process; | 306 is_incognito_process_ = is_incognito_process; |
303 } | 307 } |
304 | 308 |
305 void ChromeRenderThreadObserver::OnSetContentSettingRules( | 309 void ChromeRenderThreadObserver::OnSetContentSettingRules( |
306 const RendererContentSettingRules& rules) { | 310 const RendererContentSettingRules& rules) { |
307 content_setting_rules_ = rules; | 311 content_setting_rules_ = rules; |
308 } | 312 } |
309 | 313 |
310 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( | 314 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( |
311 const std::string& trial_name, | 315 const std::string& trial_name, |
312 const std::string& group_name) { | 316 const std::string& group_name) { |
313 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); | 317 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); |
314 } | 318 } |
315 | 319 |
316 const RendererContentSettingRules* | 320 const RendererContentSettingRules* |
317 ChromeRenderThreadObserver::content_setting_rules() const { | 321 ChromeRenderThreadObserver::content_setting_rules() const { |
318 return &content_setting_rules_; | 322 return &content_setting_rules_; |
319 } | 323 } |
OLD | NEW |