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

Side by Side Diff: chrome/browser/extensions/extension_garbage_collector_factory.h

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 months 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 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* context);
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698