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

Unified Diff: components/subresource_filter/core/browser/ruleset_service.h

Issue 2731283009: Swap ownership of RulesetService and the content delegate (Closed)
Patch Set: Swap ownership of RulesetService and the content delegate Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/core/browser/ruleset_service.h
diff --git a/components/subresource_filter/core/browser/ruleset_service.h b/components/subresource_filter/core/browser/ruleset_service.h
index d460f14fde38d76aa574f2de76a64da164eaf3bf..df391abc250ab9834b0f3d3c054f36254fadf5b2 100644
--- a/components/subresource_filter/core/browser/ruleset_service.h
+++ b/components/subresource_filter/core/browser/ruleset_service.h
@@ -170,7 +170,7 @@ class RulesetService : public base::SupportsWeakPtr<RulesetService> {
// See class comments for details of arguments.
RulesetService(PrefService* local_state,
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
- std::unique_ptr<RulesetServiceDelegate> delegate,
+ RulesetServiceDelegate* delegate,
const base::FilePath& indexed_ruleset_base_dir);
virtual ~RulesetService();
@@ -187,9 +187,6 @@ class RulesetService : public base::SupportsWeakPtr<RulesetService> {
virtual void IndexAndStoreAndPublishRulesetIfNeeded(
const UnindexedRulesetInfo& unindexed_ruleset_info);
- // Exposed for browser tests.
- RulesetServiceDelegate* delegate() { return delegate_.get(); }
-
private:
friend class SubresourceFilteringRulesetServiceTest;
FRIEND_TEST_ALL_PREFIXES(SubresourceFilteringRulesetServiceTest,
@@ -252,7 +249,9 @@ class RulesetService : public base::SupportsWeakPtr<RulesetService> {
PrefService* const local_state_;
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
- std::unique_ptr<RulesetServiceDelegate> delegate_;
+
+ // Must outlive this class.
pkalinnikov 2017/03/09 16:09:01 nit: Must outlive |this| object.
Charlie Harrison 2017/03/09 16:12:44 Done.
+ RulesetServiceDelegate* delegate_;
UnindexedRulesetInfo queued_unindexed_ruleset_info_;
bool is_after_startup_;

Powered by Google App Engine
This is Rietveld 408576698