Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1436)

Side by Side Diff: components/subresource_filter/content/renderer/subresource_filter_agent.h

Issue 2697363005: Move DocumentSubresourceFilter to core/common. (Closed)
Patch Set: Clean up. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 12 #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" 13 #include "components/subresource_filter/core/common/activation_level.h"
15 #include "content/public/renderer/render_frame_observer.h" 14 #include "content/public/renderer/render_frame_observer.h"
16 #include "url/gurl.h" 15 #include "url/gurl.h"
engedy 2017/02/17 16:44:04 nit: Do we need a complete type for std::vector he
pkalinnikov 2017/02/17 17:16:48 Nope. Deleted.
17 16
18 class GURL;
19
20 namespace blink { 17 namespace blink {
21 class WebDocumentSubresourceFilter; 18 class WebDocumentSubresourceFilter;
22 } // namespace blink 19 } // namespace blink
23 20
24 namespace subresource_filter { 21 namespace subresource_filter {
25 22
23 struct DocumentLoadStatistics;
26 class UnverifiedRulesetDealer; 24 class UnverifiedRulesetDealer;
27 class DocumentSubresourceFilter; 25 class WebDocumentSubresourceFilterImpl;
28 26
29 // The renderer-side agent of the ContentSubresourceFilterDriver. There is one 27 // The renderer-side agent of the ContentSubresourceFilterDriver. There is one
30 // instance per RenderFrame, responsible for setting up the subresource filter 28 // instance per RenderFrame, responsible for setting up the subresource filter
31 // for the ongoing provisional document load in the frame when instructed to do 29 // for the ongoing provisional document load in the frame when instructed to do
32 // so by the driver. 30 // so by the driver.
33 class SubresourceFilterAgent 31 class SubresourceFilterAgent
34 : public content::RenderFrameObserver, 32 : public content::RenderFrameObserver,
35 public base::SupportsWeakPtr<SubresourceFilterAgent> { 33 public base::SupportsWeakPtr<SubresourceFilterAgent> {
36 public: 34 public:
37 // The |ruleset_dealer| must not be null and must outlive this instance. The 35 // 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
75 void DidFailProvisionalLoad(const blink::WebURLError& error) override; 73 void DidFailProvisionalLoad(const blink::WebURLError& error) override;
76 void DidFinishLoad() override; 74 void DidFinishLoad() override;
77 bool OnMessageReceived(const IPC::Message& message) override; 75 bool OnMessageReceived(const IPC::Message& message) override;
78 76
79 // Owned by the ChromeContentRendererClient and outlives us. 77 // Owned by the ChromeContentRendererClient and outlives us.
80 UnverifiedRulesetDealer* ruleset_dealer_; 78 UnverifiedRulesetDealer* ruleset_dealer_;
81 79
82 ActivationLevel activation_level_for_next_commit_ = ActivationLevel::DISABLED; 80 ActivationLevel activation_level_for_next_commit_ = ActivationLevel::DISABLED;
83 bool measure_performance_for_next_commit_ = false; 81 bool measure_performance_for_next_commit_ = false;
84 82
85 base::WeakPtr<DocumentSubresourceFilter> filter_for_last_committed_load_; 83 base::WeakPtr<WebDocumentSubresourceFilterImpl>
84 filter_for_last_committed_load_;
86 85
87 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterAgent); 86 DISALLOW_COPY_AND_ASSIGN(SubresourceFilterAgent);
88 }; 87 };
89 88
90 } // namespace subresource_filter 89 } // namespace subresource_filter
91 90
92 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGE NT_H_ 91 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_SUBRESOURCE_FILTER_AGE NT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698