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

Unified Diff: components/subresource_filter/content/browser/content_ruleset_service_delegate.h

Issue 2731283009: Swap ownership of RulesetService and the content delegate (Closed)
Patch Set: engedy review 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/content/browser/content_ruleset_service_delegate.h
diff --git a/components/subresource_filter/content/browser/content_ruleset_service_delegate.h b/components/subresource_filter/content/browser/content_ruleset_service_delegate.h
deleted file mode 100644
index ba5338c6fcdf18bbb4b24780a7aa434b667ab625..0000000000000000000000000000000000000000
--- a/components/subresource_filter/content/browser/content_ruleset_service_delegate.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_RULESET_SERVICE_DELEGATE_H_
-#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_RULESET_SERVICE_DELEGATE_H_
-
-#include "base/callback.h"
-#include "base/files/file.h"
-#include "base/macros.h"
-#include "components/subresource_filter/core/browser/ruleset_service_delegate.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-
-namespace subresource_filter {
-
-// The content-layer specific implementation of RulesetServiceDelegate.
-//
-// Its main responsibility is receiving new versions of subresource filtering
-// rules from the RulesetService, and distributing them to renderer processes,
-// where they will be memory-mapped as-needed by the UnverifiedRulesetDealer.
-//
-// The distribution pipeline looks like this:
-//
-// RulesetService
-// |
-// v Browser
-// RulesetServiceDelegate
-// | |
-// - - - - - - -|- - - - - - - |- - - - - - - - - -
-// | | |
-// v v
-// *RulesetDealer | *RulesetDealer
-// | | |
-// | | | v
-// v | SubresourceFilterAgent
-// SubresourceFilterAgent | v
-// SubresourceFilterAgent
-// |
-//
-// Renderer #1 | Renderer #n
-//
-// Note: UnverifiedRulesetDealer is shortened to *RulesetDealer above. There is
-// also a VerifiedRulesetDealer which is used similarly on the browser side.
-class ContentRulesetServiceDelegate : public RulesetServiceDelegate,
- content::NotificationObserver {
- public:
- ContentRulesetServiceDelegate();
- ~ContentRulesetServiceDelegate() override;
-
- void SetRulesetPublishedCallbackForTesting(base::Closure callback);
-
- // RulesetServiceDelegate:
- void PostAfterStartupTask(base::Closure task) override;
- void PublishNewRulesetVersion(base::File ruleset_data) override;
-
- private:
- // content::NotificationObserver:
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
-
- content::NotificationRegistrar notification_registrar_;
- base::File ruleset_data_;
- base::Closure ruleset_published_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(ContentRulesetServiceDelegate);
-};
-
-} // namespace subresource_filter
-
-#endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_RULESET_SERVICE_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698