| 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 namespace base { |
| 10 template <typename T> | 11 template <typename T> |
| 11 struct DefaultSingletonTraits; | 12 struct DefaultSingletonTraits; |
| 13 } |
| 12 | 14 |
| 13 class Profile; | 15 class Profile; |
| 14 | 16 |
| 15 namespace extensions { | 17 namespace extensions { |
| 16 | 18 |
| 17 class ExtensionGarbageCollector; | 19 class ExtensionGarbageCollector; |
| 18 | 20 |
| 19 class ExtensionGarbageCollectorFactory | 21 class ExtensionGarbageCollectorFactory |
| 20 : public BrowserContextKeyedServiceFactory { | 22 : public BrowserContextKeyedServiceFactory { |
| 21 public: | 23 public: |
| 22 static ExtensionGarbageCollector* GetForBrowserContext( | 24 static ExtensionGarbageCollector* GetForBrowserContext( |
| 23 content::BrowserContext* context); | 25 content::BrowserContext* context); |
| 24 | 26 |
| 25 static ExtensionGarbageCollectorFactory* GetInstance(); | 27 static ExtensionGarbageCollectorFactory* GetInstance(); |
| 26 | 28 |
| 27 static scoped_ptr<KeyedService> BuildInstanceFor( | 29 static scoped_ptr<KeyedService> BuildInstanceFor( |
| 28 content::BrowserContext* context); | 30 content::BrowserContext* context); |
| 29 | 31 |
| 30 private: | 32 private: |
| 31 friend struct DefaultSingletonTraits<ExtensionGarbageCollectorFactory>; | 33 friend struct base::DefaultSingletonTraits<ExtensionGarbageCollectorFactory>; |
| 32 | 34 |
| 33 ExtensionGarbageCollectorFactory(); | 35 ExtensionGarbageCollectorFactory(); |
| 34 ~ExtensionGarbageCollectorFactory() override; | 36 ~ExtensionGarbageCollectorFactory() override; |
| 35 | 37 |
| 36 // BrowserContextKeyedServiceFactory overrides: | 38 // BrowserContextKeyedServiceFactory overrides: |
| 37 KeyedService* BuildServiceInstanceFor( | 39 KeyedService* BuildServiceInstanceFor( |
| 38 content::BrowserContext* context) const override; | 40 content::BrowserContext* context) const override; |
| 39 | 41 |
| 40 bool ServiceIsCreatedWithBrowserContext() const override; | 42 bool ServiceIsCreatedWithBrowserContext() const override; |
| 41 bool ServiceIsNULLWhileTesting() const override; | 43 bool ServiceIsNULLWhileTesting() const override; |
| 42 | 44 |
| 43 DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollectorFactory); | 45 DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollectorFactory); |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 } // namespace extensions | 48 } // namespace extensions |
| 47 | 49 |
| 48 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_ | 50 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_ |
| OLD | NEW |