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

Unified Diff: chrome/browser/extensions/api/profile_keyed_api_factory.h

Issue 171813010: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 1). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/profile_keyed_api_factory.h
diff --git a/chrome/browser/extensions/api/profile_keyed_api_factory.h b/chrome/browser/extensions/api/profile_keyed_api_factory.h
index 7a5f3ab4b5b1c55a1a743dfe41d7b2151d0c9b4b..83f0d8c9a59590876e5441a0b55d6e2e3524a22f 100644
--- a/chrome/browser/extensions/api/profile_keyed_api_factory.h
+++ b/chrome/browser/extensions/api/profile_keyed_api_factory.h
@@ -61,11 +61,17 @@ class ProfileKeyedAPI : public BrowserContextKeyedService {
template <typename T>
class ProfileKeyedAPIFactory : public BrowserContextKeyedServiceFactory {
public:
+ // TODO(yoz): Delete this one.
static T* GetForProfile(Profile* profile) {
return static_cast<T*>(
T::GetFactoryInstance()->GetServiceForBrowserContext(profile, true));
}
+ static T* GetForProfile(content::BrowserContext* context) {
Yoyo Zhou 2014/02/19 22:44:57 This is for making the transition easier.
James Cook 2014/02/20 17:47:21 I presume at some point this will become GetForBro
Yoyo Zhou 2014/02/20 22:44:54 Sure, we can rename it to Get() later. So the conv
+ return static_cast<T*>(T::GetFactoryInstance()->GetServiceForBrowserContext(
+ Profile::FromBrowserContext(context), true));
+ }
+
// Declare dependencies on other factories.
// By default, ExtensionSystemFactory is the only dependency; however,
// specializations can override this. Declare your specialization in

Powered by Google App Engine
This is Rietveld 408576698