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 24 matching lines...) Expand all Loading... |
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 "components/visitedlink/renderer/visitedlink_slave.h" | 40 #include "components/visitedlink/renderer/visitedlink_slave.h" |
41 #include "content/public/child/resource_dispatcher_delegate.h" | 41 #include "content/public/child/resource_dispatcher_delegate.h" |
42 #include "content/public/renderer/render_thread.h" | 42 #include "content/public/renderer/render_thread.h" |
43 #include "content/public/renderer/render_view.h" | 43 #include "content/public/renderer/render_view.h" |
44 #include "content/public/renderer/render_view_visitor.h" | 44 #include "content/public/renderer/render_view_visitor.h" |
| 45 #include "extensions/features/features.h" |
45 #include "media/base/media_resources.h" | 46 #include "media/base/media_resources.h" |
46 #include "mojo/public/cpp/bindings/strong_binding.h" | 47 #include "mojo/public/cpp/bindings/strong_binding.h" |
47 #include "net/base/net_errors.h" | 48 #include "net/base/net_errors.h" |
48 #include "net/base/net_module.h" | 49 #include "net/base/net_module.h" |
49 #include "services/service_manager/public/cpp/interface_registry.h" | 50 #include "services/service_manager/public/cpp/interface_registry.h" |
50 #include "third_party/WebKit/public/web/WebCache.h" | 51 #include "third_party/WebKit/public/web/WebCache.h" |
51 #include "third_party/WebKit/public/web/WebDocument.h" | 52 #include "third_party/WebKit/public/web/WebDocument.h" |
52 #include "third_party/WebKit/public/web/WebFrame.h" | 53 #include "third_party/WebKit/public/web/WebFrame.h" |
53 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 54 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
54 #include "third_party/WebKit/public/web/WebView.h" | 55 #include "third_party/WebKit/public/web/WebView.h" |
55 | 56 |
56 #if defined(ENABLE_EXTENSIONS) | 57 #if BUILDFLAG(ENABLE_EXTENSIONS) |
57 #include "chrome/renderer/extensions/extension_localization_peer.h" | 58 #include "chrome/renderer/extensions/extension_localization_peer.h" |
58 #endif | 59 #endif |
59 | 60 |
60 using blink::WebCache; | 61 using blink::WebCache; |
61 using blink::WebSecurityPolicy; | 62 using blink::WebSecurityPolicy; |
62 using blink::WebString; | 63 using blink::WebString; |
63 using content::RenderThread; | 64 using content::RenderThread; |
64 | 65 |
65 namespace { | 66 namespace { |
66 | 67 |
(...skipping 25 matching lines...) Expand all Loading... |
92 | 93 |
93 // Resource canceled with a specific error are filtered. | 94 // Resource canceled with a specific error are filtered. |
94 return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest( | 95 return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest( |
95 resource_type, std::move(current_peer), error_code); | 96 resource_type, std::move(current_peer), error_code); |
96 } | 97 } |
97 | 98 |
98 std::unique_ptr<content::RequestPeer> OnReceivedResponse( | 99 std::unique_ptr<content::RequestPeer> OnReceivedResponse( |
99 std::unique_ptr<content::RequestPeer> current_peer, | 100 std::unique_ptr<content::RequestPeer> current_peer, |
100 const std::string& mime_type, | 101 const std::string& mime_type, |
101 const GURL& url) override { | 102 const GURL& url) override { |
102 #if defined(ENABLE_EXTENSIONS) | 103 #if BUILDFLAG(ENABLE_EXTENSIONS) |
103 return ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( | 104 return ExtensionLocalizationPeer::CreateExtensionLocalizationPeer( |
104 std::move(current_peer), RenderThread::Get(), mime_type, url); | 105 std::move(current_peer), RenderThread::Get(), mime_type, url); |
105 #else | 106 #else |
106 return current_peer; | 107 return current_peer; |
107 #endif | 108 #endif |
108 } | 109 } |
109 | 110 |
110 private: | 111 private: |
111 void InformHostOfCacheStats() { | 112 void InformHostOfCacheStats() { |
112 WebCache::UsageStats stats; | 113 WebCache::UsageStats stats; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( | 310 void ChromeRenderThreadObserver::OnSetFieldTrialGroup( |
310 const std::string& trial_name, | 311 const std::string& trial_name, |
311 const std::string& group_name) { | 312 const std::string& group_name) { |
312 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); | 313 field_trial_syncer_.OnSetFieldTrialGroup(trial_name, group_name); |
313 } | 314 } |
314 | 315 |
315 const RendererContentSettingRules* | 316 const RendererContentSettingRules* |
316 ChromeRenderThreadObserver::content_setting_rules() const { | 317 ChromeRenderThreadObserver::content_setting_rules() const { |
317 return &content_setting_rules_; | 318 return &content_setting_rules_; |
318 } | 319 } |
OLD | NEW |