OLD | NEW |
---|---|
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 CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_ |
7 | 7 |
8 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" | 8 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" |
9 | 9 |
10 template <typename T> | 10 template <typename T> |
11 struct DefaultSingletonTraits; | 11 struct DefaultSingletonTraits; |
12 | 12 |
13 class Profile; | 13 class Profile; |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 | 16 |
17 class ExtensionGarbageCollector; | 17 class ExtensionGarbageCollector; |
18 | 18 |
19 class ExtensionGarbageCollectorFactory | 19 class ExtensionGarbageCollectorFactory |
20 : public BrowserContextKeyedServiceFactory { | 20 : public BrowserContextKeyedServiceFactory { |
21 public: | 21 public: |
22 static ExtensionGarbageCollector* GetForBrowserContext( | 22 static ExtensionGarbageCollector* GetForBrowserContext( |
23 content::BrowserContext* context); | 23 content::BrowserContext* context); |
24 | 24 |
25 static ExtensionGarbageCollectorFactory* GetInstance(); | 25 static ExtensionGarbageCollectorFactory* GetInstance(); |
26 | 26 |
27 static KeyedService* BuildInstanceFor(content::BrowserContext* profile); | 27 static scoped_ptr<KeyedService> BuildInstanceFor( |
28 content::BrowserContext* profile); | |
Devlin
2015/06/08 19:29:43
nit: rename
Ilya Sherman
2015/06/08 22:11:43
Done.
| |
28 | 29 |
29 private: | 30 private: |
30 friend struct DefaultSingletonTraits<ExtensionGarbageCollectorFactory>; | 31 friend struct DefaultSingletonTraits<ExtensionGarbageCollectorFactory>; |
31 | 32 |
32 ExtensionGarbageCollectorFactory(); | 33 ExtensionGarbageCollectorFactory(); |
33 ~ExtensionGarbageCollectorFactory() override; | 34 ~ExtensionGarbageCollectorFactory() override; |
34 | 35 |
35 // BrowserContextKeyedServiceFactory overrides: | 36 // BrowserContextKeyedServiceFactory overrides: |
36 KeyedService* BuildServiceInstanceFor( | 37 KeyedService* BuildServiceInstanceFor( |
37 content::BrowserContext* context) const override; | 38 content::BrowserContext* context) const override; |
38 | 39 |
39 bool ServiceIsCreatedWithBrowserContext() const override; | 40 bool ServiceIsCreatedWithBrowserContext() const override; |
40 bool ServiceIsNULLWhileTesting() const override; | 41 bool ServiceIsNULLWhileTesting() const override; |
41 | 42 |
42 DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollectorFactory); | 43 DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollectorFactory); |
43 }; | 44 }; |
44 | 45 |
45 } // namespace extensions | 46 } // namespace extensions |
46 | 47 |
47 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_ | 48 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_ |
OLD | NEW |