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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_
8 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
12 struct DefaultSingletonTraits
;
17 namespace extensions
{
19 class ExtensionGarbageCollector
;
21 class ExtensionGarbageCollectorFactory
22 : public BrowserContextKeyedServiceFactory
{
24 static ExtensionGarbageCollector
* GetForBrowserContext(
25 content::BrowserContext
* context
);
27 static ExtensionGarbageCollectorFactory
* GetInstance();
29 static scoped_ptr
<KeyedService
> BuildInstanceFor(
30 content::BrowserContext
* context
);
33 friend struct base::DefaultSingletonTraits
<ExtensionGarbageCollectorFactory
>;
35 ExtensionGarbageCollectorFactory();
36 ~ExtensionGarbageCollectorFactory() override
;
38 // BrowserContextKeyedServiceFactory overrides:
39 KeyedService
* BuildServiceInstanceFor(
40 content::BrowserContext
* context
) const override
;
42 bool ServiceIsCreatedWithBrowserContext() const override
;
43 bool ServiceIsNULLWhileTesting() const override
;
45 DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollectorFactory
);
48 } // namespace extensions
50 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_FACTORY_H_