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

Side by Side Diff: chrome/browser/extensions/api/profile_keyed_api_factory.h

Issue 140613002: Cleanup: Replace &LazyInstance::Get() with LazyInstance::Pointer(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_API_PROFILE_KEYED_API_FACTORY_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PROFILE_KEYED_API_FACTORY_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_PROFILE_KEYED_API_FACTORY_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_PROFILE_KEYED_API_FACTORY_H_
7 7
8 #include "chrome/browser/extensions/extension_system_factory.h" 8 #include "chrome/browser/extensions/extension_system_factory.h"
9 #include "chrome/browser/profiles/incognito_helpers.h" 9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // static ProfileKeyedAPIFactory<ProcessesAPI>* GetFactoryInstance(); 42 // static ProfileKeyedAPIFactory<ProcessesAPI>* GetFactoryInstance();
43 // }; 43 // };
44 // 44 //
45 // In the cc file, provide the implementation, e.g.: 45 // In the cc file, provide the implementation, e.g.:
46 // static base::LazyInstance<ProfileKeyedAPIFactory<ProcessesAPI> > 46 // static base::LazyInstance<ProfileKeyedAPIFactory<ProcessesAPI> >
47 // g_factory = LAZY_INSTANCE_INITIALIZER; 47 // g_factory = LAZY_INSTANCE_INITIALIZER;
48 // 48 //
49 // // static 49 // // static
50 // ProfileKeyedAPIFactory<ProcessesAPI>* 50 // ProfileKeyedAPIFactory<ProcessesAPI>*
51 // ProcessesAPI::GetFactoryInstance() { 51 // ProcessesAPI::GetFactoryInstance() {
52 // return &g_factory.Get(); 52 // return g_factory.Pointer();
53 // } 53 // }
54 }; 54 };
55 55
56 // A template for factories for BrowserContextKeyedServices that manage 56 // A template for factories for BrowserContextKeyedServices that manage
57 // extension APIs. T is a BrowserContextKeyedService that uses this factory 57 // extension APIs. T is a BrowserContextKeyedService that uses this factory
58 // template instead of its own separate factory definition to manage its 58 // template instead of its own separate factory definition to manage its
59 // per-profile instances. 59 // per-profile instances.
60 template <typename T> 60 template <typename T>
61 class ProfileKeyedAPIFactory : public BrowserContextKeyedServiceFactory { 61 class ProfileKeyedAPIFactory : public BrowserContextKeyedServiceFactory {
62 public: 62 public:
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE { 116 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE {
117 return T::kServiceIsNULLWhileTesting; 117 return T::kServiceIsNULLWhileTesting;
118 } 118 }
119 119
120 DISALLOW_COPY_AND_ASSIGN(ProfileKeyedAPIFactory); 120 DISALLOW_COPY_AND_ASSIGN(ProfileKeyedAPIFactory);
121 }; 121 };
122 122
123 } // namespace extensions 123 } // namespace extensions
124 124
125 #endif // CHROME_BROWSER_EXTENSIONS_API_PROFILE_KEYED_API_FACTORY_H_ 125 #endif // CHROME_BROWSER_EXTENSIONS_API_PROFILE_KEYED_API_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698