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

Unified Diff: chrome/browser/chromeos/drive/drive_integration_service.h

Issue 118043003: Fix app_shell shutdown crash due to BrowserContextKeyedServices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix FileSystem tests (shutdown_crash) 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/drive_integration_service.h
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.h b/chrome/browser/chromeos/drive/drive_integration_service.h
index 2f6dd45c30978893135fd32ad38f00d939e039d9..dac74ff925e77684e15572e4d1cf6412be9620f2 100644
--- a/chrome/browser/chromeos/drive/drive_integration_service.h
+++ b/chrome/browser/chromeos/drive/drive_integration_service.h
@@ -185,8 +185,8 @@ class DriveIntegrationServiceFactory
: public BrowserContextKeyedServiceFactory {
public:
// Factory function used by tests.
- typedef base::Callback<DriveIntegrationService*(Profile* profile)>
- FactoryCallback;
+ typedef DriveIntegrationService*(FactoryFunction)(Profile* profile,
+ void* data);
// Returns the DriveIntegrationService for |profile|, creating it if it is
// not yet created.
@@ -208,7 +208,7 @@ class DriveIntegrationServiceFactory
static DriveIntegrationServiceFactory* GetInstance();
// Sets a factory function for tests.
- static void SetFactoryForTest(const FactoryCallback& factory_for_test);
+ static void SetFactoryForTest(FactoryFunction factory_for_test, void* data);
private:
friend struct DefaultSingletonTraits<DriveIntegrationServiceFactory>;
@@ -220,7 +220,10 @@ class DriveIntegrationServiceFactory
virtual BrowserContextKeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const OVERRIDE;
- FactoryCallback factory_for_test_;
+ // These are static so we can delay creating an instance of this factory
+ // (and all its dependent factories) until the profile is created.
tbarzic 2014/01/09 01:58:25 nit: What do you think about slightly more context
James Cook 2014/01/09 17:32:19 That's a much better comment. Done.
+ static FactoryFunction* factory_function_for_test_;
+ static void* factory_data_for_test_;
};
} // namespace drive

Powered by Google App Engine
This is Rietveld 408576698