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

Side by Side Diff: chrome/browser/previews/previews_service_factory.h

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ 5 #ifndef CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ 6 #define CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_
7 7
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
11 11
12 namespace content { 12 namespace content {
13 class BrowserContext; 13 class BrowserContext;
14 } 14 }
15 15
16 class PreviewsService; 16 class PreviewsService;
17 class Profile; 17 class Profile;
18 18
19 // LazyInstance that owns all PreviewsServices and associates them with 19 // LazyInstance that owns all PreviewsServices and associates them with
20 // Profiles. 20 // Profiles.
21 class PreviewsServiceFactory : public BrowserContextKeyedServiceFactory { 21 class PreviewsServiceFactory : public BrowserContextKeyedServiceFactory {
22 public: 22 public:
23 // Gets the PreviewsService instance for |profile|. 23 // Gets the PreviewsService instance for |profile|.
24 static PreviewsService* GetForProfile(Profile* profile); 24 static PreviewsService* GetForProfile(Profile* profile);
25 25
26 // Gets the LazyInstance that owns all PreviewsServices. 26 // Gets the LazyInstance that owns all PreviewsServices.
27 static PreviewsServiceFactory* GetInstance(); 27 static PreviewsServiceFactory* GetInstance();
28 28
29 private: 29 private:
30 friend struct base::DefaultLazyInstanceTraits<PreviewsServiceFactory>; 30 friend struct base::LazyInstanceTraitsBase<PreviewsServiceFactory>;
31 31
32 PreviewsServiceFactory(); 32 PreviewsServiceFactory();
33 ~PreviewsServiceFactory() override; 33 ~PreviewsServiceFactory() override;
34 34
35 // BrowserContextKeyedServiceFactory: 35 // BrowserContextKeyedServiceFactory:
36 KeyedService* BuildServiceInstanceFor( 36 KeyedService* BuildServiceInstanceFor(
37 content::BrowserContext* context) const override; 37 content::BrowserContext* context) const override;
38 38
39 DISALLOW_COPY_AND_ASSIGN(PreviewsServiceFactory); 39 DISALLOW_COPY_AND_ASSIGN(PreviewsServiceFactory);
40 }; 40 };
41 41
42 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_ 42 #endif // CHROME_BROWSER_PREVIEWS_PREVIEWS_SERVICE_FACTORY_H_
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/performance_monitor.cc ('k') | chrome/browser/previews/previews_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698