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

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

Issue 684513002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
(...skipping 25 matching lines...) Expand all
36 // attached to a single |context|. Only test code is allowed to call this 36 // attached to a single |context|. Only test code is allowed to call this
37 // method. 37 // method.
38 // TODO(gab): This method can be removed entirely when 38 // TODO(gab): This method can be removed entirely when
39 // PrefService::DeprecatedGetPrefRegistry() is phased out. 39 // PrefService::DeprecatedGetPrefRegistry() is phased out.
40 void RegisterUserPrefsOnBrowserContextForTest( 40 void RegisterUserPrefsOnBrowserContextForTest(
41 content::BrowserContext* context); 41 content::BrowserContext* context);
42 42
43 protected: 43 protected:
44 BrowserContextKeyedBaseFactory(const char* name, 44 BrowserContextKeyedBaseFactory(const char* name,
45 BrowserContextDependencyManager* manager); 45 BrowserContextDependencyManager* manager);
46 virtual ~BrowserContextKeyedBaseFactory(); 46 ~BrowserContextKeyedBaseFactory() override;
47 47
48 // Interface for people building a concrete FooServiceFactory: -------------- 48 // Interface for people building a concrete FooServiceFactory: --------------
49 49
50 // Finds which browser context (if any) to use. 50 // Finds which browser context (if any) to use.
51 virtual content::BrowserContext* GetBrowserContextToUse( 51 virtual content::BrowserContext* GetBrowserContextToUse(
52 content::BrowserContext* context) const; 52 content::BrowserContext* context) const;
53 53
54 // By default, we create instances of a service lazily and wait until 54 // By default, we create instances of a service lazily and wait until
55 // GetForBrowserContext() is called on our subclass. Some services need to be 55 // GetForBrowserContext() is called on our subclass. Some services need to be
56 // created as soon as the BrowserContext has been brought up. 56 // created as soon as the BrowserContext has been brought up.
57 virtual bool ServiceIsCreatedWithBrowserContext() const; 57 virtual bool ServiceIsCreatedWithBrowserContext() const;
58 58
59 // By default, TestingBrowserContexts will be treated like normal contexts. 59 // By default, TestingBrowserContexts will be treated like normal contexts.
60 // You can override this so that by default, the service associated with the 60 // You can override this so that by default, the service associated with the
61 // TestingBrowserContext is NULL. (This is just a shortcut around 61 // TestingBrowserContext is NULL. (This is just a shortcut around
62 // SetTestingFactory() to make sure our contexts don't directly refer to the 62 // SetTestingFactory() to make sure our contexts don't directly refer to the
63 // services they use.) 63 // services they use.)
64 virtual bool ServiceIsNULLWhileTesting() const override; 64 bool ServiceIsNULLWhileTesting() const override;
65 65
66 // Interface for people building a type of BrowserContextKeyedFactory: ------- 66 // Interface for people building a type of BrowserContextKeyedFactory: -------
67 67
68 // A helper object actually listens for notifications about BrowserContext 68 // A helper object actually listens for notifications about BrowserContext
69 // destruction, calculates the order in which things are destroyed and then 69 // destruction, calculates the order in which things are destroyed and then
70 // does a two pass shutdown. 70 // does a two pass shutdown.
71 // 71 //
72 // It is up to the individual factory types to determine what this two pass 72 // It is up to the individual factory types to determine what this two pass
73 // shutdown means. The general framework guarantees the following: 73 // shutdown means. The general framework guarantees the following:
74 // 74 //
(...skipping 20 matching lines...) Expand all
95 virtual void SetEmptyTestingFactory(content::BrowserContext* context) = 0; 95 virtual void SetEmptyTestingFactory(content::BrowserContext* context) = 0;
96 96
97 // Returns true if a testing factory function has been set for |context|. 97 // Returns true if a testing factory function has been set for |context|.
98 virtual bool HasTestingFactory(content::BrowserContext* context) = 0; 98 virtual bool HasTestingFactory(content::BrowserContext* context) = 0;
99 99
100 // We also need a generalized, non-returning method that generates the object 100 // We also need a generalized, non-returning method that generates the object
101 // now for when we're creating the context. 101 // now for when we're creating the context.
102 virtual void CreateServiceNow(content::BrowserContext* context) = 0; 102 virtual void CreateServiceNow(content::BrowserContext* context) = 0;
103 103
104 // KeyedServiceBaseFactory: 104 // KeyedServiceBaseFactory:
105 virtual user_prefs::PrefRegistrySyncable* GetAssociatedPrefRegistry( 105 user_prefs::PrefRegistrySyncable* GetAssociatedPrefRegistry(
106 base::SupportsUserData* context) const final; 106 base::SupportsUserData* context) const final;
107 virtual base::SupportsUserData* GetContextToUse( 107 base::SupportsUserData* GetContextToUse(
108 base::SupportsUserData* context) const final; 108 base::SupportsUserData* context) const final;
109 virtual bool ServiceIsCreatedWithContext() const final; 109 bool ServiceIsCreatedWithContext() const final;
110 virtual void ContextShutdown(base::SupportsUserData* context) final; 110 void ContextShutdown(base::SupportsUserData* context) final;
111 virtual void ContextDestroyed(base::SupportsUserData* context) final; 111 void ContextDestroyed(base::SupportsUserData* context) final;
112 virtual void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) final; 112 void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) final;
113 virtual void SetEmptyTestingFactory(base::SupportsUserData* context) final; 113 void SetEmptyTestingFactory(base::SupportsUserData* context) final;
114 virtual bool HasTestingFactory(base::SupportsUserData* context) final; 114 bool HasTestingFactory(base::SupportsUserData* context) final;
115 virtual void CreateServiceNow(base::SupportsUserData* context) final; 115 void CreateServiceNow(base::SupportsUserData* context) final;
116 }; 116 };
117 117
118 #endif // COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H _ 118 #endif // COMPONENTS_KEYED_SERVICE_CONTENT_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698