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

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: cleanup (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..3c4394e0bb894810a2897c0c568d60e6dfbcf475 100644
--- a/chrome/browser/chromeos/drive/drive_integration_service.h
+++ b/chrome/browser/chromeos/drive/drive_integration_service.h
@@ -208,7 +208,9 @@ class DriveIntegrationServiceFactory
static DriveIntegrationServiceFactory* GetInstance();
// Sets a factory function for tests.
- static void SetFactoryForTest(const FactoryCallback& factory_for_test);
+ // NOTE: Call SetFactoryForTest(NULL) during your test TearDown so you don't
+ // pollute the next test.
+ static void SetFactoryForTest(FactoryCallback* factory_for_test);
xiyuan 2014/01/09 17:53:22 nit: How about making this private and use a Scope
private:
friend struct DefaultSingletonTraits<DriveIntegrationServiceFactory>;
@@ -220,7 +222,12 @@ class DriveIntegrationServiceFactory
virtual BrowserContextKeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const OVERRIDE;
- FactoryCallback factory_for_test_;
+ // This is static so it can be set without instantiating the factory. This
+ // allows factory creation to be delayed until it normally happens (on profile
+ // creation) rather than when tests are set up. DriveIntegrationServiceFactory
+ // transitively depends on ExtensionSystemFactory which crashes if created too
+ // soon (i.e. before the BrowserProcess exists).
+ static FactoryCallback* factory_for_test_;
};
} // namespace drive
« no previous file with comments | « apps/shell/shell_extensions_browser_client.cc ('k') | chrome/browser/chromeos/drive/drive_integration_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698