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

Unified Diff: components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h

Issue 905703002: Add KeyedServiceShutdownNotifier for classes that depend on keyed services but can't be keyed servi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h
diff --git a/components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h b/components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..dee630283e37948f16059209be55e3c79193a609
--- /dev/null
+++ b/components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h
@@ -0,0 +1,35 @@
+// Copyright 2015 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_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_SERVICE_SHUTDOWN_NOTIFIER_FACTORY_H_
+#define COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_SERVICE_SHUTDOWN_NOTIFIER_FACTORY_H_
+
+#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+#include "components/keyed_service/core/keyed_service_export.h"
+
+class KeyedServiceShutdownNotifier;
+
+// A base class for factories for KeyedServiceShutdownNotifier objects that are
+// keyed on a BrowserContext.
+// To use this class, create a singleton subclass and declare its dependencies
+// in the constructor.
+class KEYED_SERVICE_EXPORT BrowserContextKeyedServiceShutdownNotifierFactory
+ : public BrowserContextKeyedServiceFactory {
+ public:
+ KeyedServiceShutdownNotifier* Get(content::BrowserContext* context);
+
+ protected:
+ explicit BrowserContextKeyedServiceShutdownNotifierFactory(const char* name);
+ ~BrowserContextKeyedServiceShutdownNotifierFactory() override;
+
+ private:
+ KeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* context) const override;
+ content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* context) const override;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserContextKeyedServiceShutdownNotifierFactory);
+};
+
+#endif // COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_SERVICE_SHUTDOWN_NOTIFIER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698