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

Side by Side Diff: components/keyed_service/content/browser_context_keyed_base_factory.h

Issue 654753010: Refactor (Refcounted)BrowserContextKeyedServiceFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H_ 5 #ifndef COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H_
6 #define COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H_ 6 #define COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H_
7 7
8 #include "components/keyed_service/core/keyed_service_base_factory.h" 8 #include "components/keyed_service/core/keyed_service_base_factory.h"
9 #include "components/keyed_service/core/keyed_service_export.h" 9 #include "components/keyed_service/core/keyed_service_export.h"
10 10
11 class BrowserContextDependencyManager; 11 class BrowserContextDependencyManager;
12 class PrefService; 12 class PrefService;
13 13
14 namespace content { 14 namespace content {
15 class BrowserContext; 15 class BrowserContext;
16 } 16 }
17 17
18 namespace user_prefs { 18 namespace user_prefs {
19 class PrefRegistrySyncable; 19 class PrefRegistrySyncable;
20 } 20 }
21 21
22 // Base class for Factories that take a BrowserContext object and return some 22 // Base class for Factories that take a BrowserContext object and return some
23 // service. 23 // service.
24 // 24 //
25 // Unless you're trying to make a new type of Factory, you probably don't want 25 // Unless you're trying to make a new type of Factory, you probably don't want
26 // this class, but its subclasses: BrowserContextKeyedServiceFactory and 26 // this class, but its subclasses: BrowserContextKeyedServiceFactory and
27 // RefcountedBrowserContextKeyedServiceFactory. This object describes general 27 // RefcountedBrowserContextKeyedServiceFactory. This object describes general
28 // dependency management between Factories; subclasses react to lifecycle 28 // dependency management between Factories; subclasses react to lifecycle
29 // events and implement memory management. 29 // events and implement memory management.
30 //
31 // Note: this class is deprecated and should not be used and will be removed
32 // once http://crbug.com/131843 and http://crbug.com/131844 are closed. If you
33 // need to implement a new way to manage KeyedService lifetime, base your code
34 // on KeyedServiceBaseFactory instead.
30 class KEYED_SERVICE_EXPORT BrowserContextKeyedBaseFactory 35 class KEYED_SERVICE_EXPORT BrowserContextKeyedBaseFactory
31 : public KeyedServiceBaseFactory { 36 : public KeyedServiceBaseFactory {
32 public: 37 public:
33 // Registers preferences used in this service on the pref service of 38 // Registers preferences used in this service on the pref service of
34 // |context|. This is the public interface and is safe to be called multiple 39 // |context|. This is the public interface and is safe to be called multiple
35 // times because testing code can have multiple services of the same type 40 // times because testing code can have multiple services of the same type
36 // attached to a single |context|. Only test code is allowed to call this 41 // attached to a single |context|. Only test code is allowed to call this
37 // method. 42 // method.
38 // TODO(gab): This method can be removed entirely when 43 // TODO(gab): This method can be removed entirely when
39 // PrefService::DeprecatedGetPrefRegistry() is phased out. 44 // PrefService::DeprecatedGetPrefRegistry() is phased out.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 virtual bool ServiceIsCreatedWithContext() const final; 114 virtual bool ServiceIsCreatedWithContext() const final;
110 virtual void ContextShutdown(base::SupportsUserData* context) final; 115 virtual void ContextShutdown(base::SupportsUserData* context) final;
111 virtual void ContextDestroyed(base::SupportsUserData* context) final; 116 virtual void ContextDestroyed(base::SupportsUserData* context) final;
112 virtual void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) final; 117 virtual void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) final;
113 virtual void SetEmptyTestingFactory(base::SupportsUserData* context) final; 118 virtual void SetEmptyTestingFactory(base::SupportsUserData* context) final;
114 virtual bool HasTestingFactory(base::SupportsUserData* context) final; 119 virtual bool HasTestingFactory(base::SupportsUserData* context) final;
115 virtual void CreateServiceNow(base::SupportsUserData* context) final; 120 virtual void CreateServiceNow(base::SupportsUserData* context) final;
116 }; 121 };
117 122
118 #endif // COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H _ 123 #endif // COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H _
OLDNEW
« no previous file with comments | « components/keyed_service.gypi ('k') | components/keyed_service/content/browser_context_keyed_base_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698