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 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "components/subresource_filter/core/common/activation_level.h" | 12 #include "components/subresource_filter/core/common/activation_level.h" |
13 #include "content/public/renderer/render_frame_observer.h" | 13 #include "content/public/renderer/render_frame_observer.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 class WebDocumentSubresourceFilter; | 17 class WebDocumentSubresourceFilter; |
18 } // namespace blink | 18 } // namespace blink |
19 | 19 |
20 namespace subresource_filter { | 20 namespace subresource_filter { |
21 | 21 |
22 struct DocumentLoadStatistics; | 22 struct DocumentLoadStatistics; |
23 class UnverifiedRulesetDealer; | 23 class UnverifiedRulesetDealer; |
24 class WebDocumentSubresourceFilterImpl; | 24 class WebDocumentSubresourceFilterImpl; |
25 | 25 |
26 // The renderer-side agent of the ContentSubresourceFilterDriver. There is one | 26 // The renderer-side agent of ContentSubresourceFilterDriverFactory. There is |
27 // instance per RenderFrame, responsible for setting up the subresource filter | 27 // one instance per RenderFrame, responsible for setting up the subresource |
28 // for the ongoing provisional document load in the frame when instructed to do | 28 // filter for the ongoing provisional document load in the frame when instructed |
29 // so by the driver. | 29 // to do so by the driver. |
30 class SubresourceFilterAgent | 30 class SubresourceFilterAgent |
31 : public content::RenderFrameObserver, | 31 : public content::RenderFrameObserver, |
32 public base::SupportsWeakPtr<SubresourceFilterAgent> { | 32 public base::SupportsWeakPtr<SubresourceFilterAgent> { |
33 public: | 33 public: |
34 // 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 |
35 // |render_frame| may be null in unittests. | 35 // |render_frame| may be null in unittests. |
36 explicit SubresourceFilterAgent(content::RenderFrame* render_frame, | 36 explicit SubresourceFilterAgent(content::RenderFrame* render_frame, |
37 UnverifiedRulesetDealer* ruleset_dealer); | 37 UnverifiedRulesetDealer* ruleset_dealer); |
38 ~SubresourceFilterAgent() override; | 38 ~SubresourceFilterAgent() override; |
39 | 39 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 base::WeakPtr<WebDocumentSubresourceFilterImpl> | 82 base::WeakPtr<WebDocumentSubresourceFilterImpl> |
83 filter_for_last_committed_load_; | 83 filter_for_last_committed_load_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterAgent); | 85 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterAgent); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace subresource_filter | 88 } // namespace subresource_filter |
89 | 89 |
90 #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 |