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

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

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.cc
diff --git a/components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.cc b/components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5a75b5afcf6a1b5335ec3362018ca37d60a8788c
--- /dev/null
+++ b/components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.cc
@@ -0,0 +1,37 @@
+// 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.
+
+#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
+
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "components/keyed_service/core/keyed_service_shutdown_notifier.h"
+
+BrowserContextKeyedServiceShutdownNotifierFactory::
+ BrowserContextKeyedServiceShutdownNotifierFactory(const char* name)
+ : BrowserContextKeyedServiceFactory(
+ name,
+ BrowserContextDependencyManager::GetInstance()) {
+}
+BrowserContextKeyedServiceShutdownNotifierFactory::
+ ~BrowserContextKeyedServiceShutdownNotifierFactory() {
+}
+
+KeyedServiceShutdownNotifier*
+BrowserContextKeyedServiceShutdownNotifierFactory::Get(
+ content::BrowserContext* context) {
+ return static_cast<KeyedServiceShutdownNotifier*>(
+ GetServiceForBrowserContext(context, true));
+}
+
+KeyedService*
+BrowserContextKeyedServiceShutdownNotifierFactory::BuildServiceInstanceFor(
+ content::BrowserContext* context) const {
+ return new KeyedServiceShutdownNotifier;
+}
+
+content::BrowserContext*
+BrowserContextKeyedServiceShutdownNotifierFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ return context;
+}

Powered by Google App Engine
This is Rietveld 408576698