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_UNVERIFIED_RULESET_DEALER
_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_UNVERIFIED_RULESET_DEALER
_H_ |
6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_UNVERIFIED_RULESET_DEALER
_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_UNVERIFIED_RULESET_DEALER
_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/subresource_filter/content/common/ruleset_dealer.h" | 9 #include "components/subresource_filter/content/common/ruleset_dealer.h" |
10 #include "content/public/renderer/render_thread_observer.h" | 10 #include "content/public/renderer/render_thread_observer.h" |
11 #include "ipc/ipc_platform_file.h" | 11 #include "ipc/ipc_platform_file.h" |
12 | 12 |
13 namespace IPC { | 13 namespace IPC { |
14 class Message; | 14 class Message; |
15 } // namespace IPC | 15 } // namespace IPC |
16 | 16 |
17 namespace subresource_filter { | 17 namespace subresource_filter { |
18 | 18 |
19 class MemoryMappedRuleset; | 19 class MemoryMappedRuleset; |
20 | 20 |
21 // Memory maps the subresource filtering ruleset file received over IPC from the | 21 // Memory maps the subresource filtering ruleset file received over IPC from the |
22 // RulesetDistributor, and makes it available to all SubresourceFilterAgents | 22 // RulesetDistributor, and makes it available to all SubresourceFilterAgents |
23 // within the current render process through GetRuleset() method. Does not make | 23 // within the current render process through GetRuleset() method. Does not make |
24 // sure that the file is valid. | 24 // sure that the file is valid. |
25 // | 25 // |
26 // See RulesetDealerBase for details on the lifetime of MemoryMappedRuleset, and | 26 // See RulesetDealerBase for details on the lifetime of MemoryMappedRuleset, and |
27 // the distribution pipeline diagram in content_ruleset_service_delegate.h. | 27 // the distribution pipeline diagram in content_ruleset_service.h. |
28 class UnverifiedRulesetDealer : public RulesetDealer, | 28 class UnverifiedRulesetDealer : public RulesetDealer, |
29 public content::RenderThreadObserver { | 29 public content::RenderThreadObserver { |
30 public: | 30 public: |
31 UnverifiedRulesetDealer(); | 31 UnverifiedRulesetDealer(); |
32 ~UnverifiedRulesetDealer() override; | 32 ~UnverifiedRulesetDealer() override; |
33 | 33 |
34 private: | 34 private: |
35 // content::RenderThreadObserver: | 35 // content::RenderThreadObserver: |
36 bool OnControlMessageReceived(const IPC::Message& message) override; | 36 bool OnControlMessageReceived(const IPC::Message& message) override; |
37 void OnSetRulesetForProcess(const IPC::PlatformFileForTransit& file); | 37 void OnSetRulesetForProcess(const IPC::PlatformFileForTransit& file); |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(UnverifiedRulesetDealer); | 39 DISALLOW_COPY_AND_ASSIGN(UnverifiedRulesetDealer); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace subresource_filter | 42 } // namespace subresource_filter |
43 | 43 |
44 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_RULESET_DEALER_H_ | 44 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_RENDERER_RULESET_DEALER_H_ |
OLD | NEW |