OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGENT_
H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGENT_
H_ |
6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGENT_
H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGENT_
H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | |
10 | 9 |
11 #include "base/macros.h" | 10 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
13 #include "components/subresource_filter/content/common/document_load_statistics.
h" | |
14 #include "components/subresource_filter/core/common/activation_level.h" | 12 #include "components/subresource_filter/core/common/activation_level.h" |
15 #include "content/public/renderer/render_frame_observer.h" | 13 #include "content/public/renderer/render_frame_observer.h" |
16 #include "url/gurl.h" | 14 #include "url/gurl.h" |
17 | 15 |
18 class GURL; | |
19 | |
20 namespace blink { | 16 namespace blink { |
21 class WebDocumentSubresourceFilter; | 17 class WebDocumentSubresourceFilter; |
22 } // namespace blink | 18 } // namespace blink |
23 | 19 |
24 namespace subresource_filter { | 20 namespace subresource_filter { |
25 | 21 |
| 22 struct DocumentLoadStatistics; |
26 class UnverifiedRulesetDealer; | 23 class UnverifiedRulesetDealer; |
27 class DocumentSubresourceFilter; | 24 class WebDocumentSubresourceFilterImpl; |
28 | 25 |
29 // The renderer-side agent of the ContentSubresourceFilterDriver. There is one | 26 // The renderer-side agent of the ContentSubresourceFilterDriver. There is one |
30 // instance per RenderFrame, responsible for setting up the subresource filter | 27 // instance per RenderFrame, responsible for setting up the subresource filter |
31 // for the ongoing provisional document load in the frame when instructed to do | 28 // for the ongoing provisional document load in the frame when instructed to do |
32 // so by the driver. | 29 // so by the driver. |
33 class SubresourceFilterAgent | 30 class SubresourceFilterAgent |
34 : public content::RenderFrameObserver, | 31 : public content::RenderFrameObserver, |
35 public base::SupportsWeakPtr<SubresourceFilterAgent> { | 32 public base::SupportsWeakPtr<SubresourceFilterAgent> { |
36 public: | 33 public: |
37 // The |ruleset_dealer| must not be null and must outlive this instance. The | 34 // The |ruleset_dealer| must not be null and must outlive this instance. The |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void DidFailProvisionalLoad(const blink::WebURLError& error) override; | 72 void DidFailProvisionalLoad(const blink::WebURLError& error) override; |
76 void DidFinishLoad() override; | 73 void DidFinishLoad() override; |
77 bool OnMessageReceived(const IPC::Message& message) override; | 74 bool OnMessageReceived(const IPC::Message& message) override; |
78 | 75 |
79 // Owned by the ChromeContentRendererClient and outlives us. | 76 // Owned by the ChromeContentRendererClient and outlives us. |
80 UnverifiedRulesetDealer* ruleset_dealer_; | 77 UnverifiedRulesetDealer* ruleset_dealer_; |
81 | 78 |
82 ActivationLevel activation_level_for_next_commit_ = ActivationLevel::DISABLED; | 79 ActivationLevel activation_level_for_next_commit_ = ActivationLevel::DISABLED; |
83 bool measure_performance_for_next_commit_ = false; | 80 bool measure_performance_for_next_commit_ = false; |
84 | 81 |
85 base::WeakPtr<DocumentSubresourceFilter> filter_for_last_committed_load_; | 82 base::WeakPtr<WebDocumentSubresourceFilterImpl> |
| 83 filter_for_last_committed_load_; |
86 | 84 |
87 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterAgent); | 85 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterAgent); |
88 }; | 86 }; |
89 | 87 |
90 } // namespace subresource_filter | 88 } // namespace subresource_filter |
91 | 89 |
92 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGE
NT_H_ | 90 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGE
NT_H_ |
OLD | NEW |