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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 11572036: Do not load extension system in the Profile import process. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comment about test-only function Created 8 years 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/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 0a3c1bd9f78f75a8350e9a7e3fcd7181beb6bf58..937234183792db3ce6c60fbbd1a69db8d961ebd3 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -412,11 +412,9 @@ ExtensionService::ExtensionService(Profile* profile,
app_notification_manager_->Init();
if (extensions_enabled_) {
- if (!command_line->HasSwitch(switches::kImport) &&
- !command_line->HasSwitch(switches::kImportFromFile)) {
- extensions::ExternalProviderImpl::CreateExternalProviders(
- this, profile_, &external_extension_providers_);
- }
+ CHECK(!ProfileManager::IsImportProcess(*command_line));
+ extensions::ExternalProviderImpl::CreateExternalProviders(
+ this, profile_, &external_extension_providers_);
}
// Set this as the ExtensionService for extension sorting to ensure it
@@ -603,24 +601,17 @@ void ExtensionService::Init() {
wipeout_is_active_ = false; // Wipeout is only on during load.
}
- // If we are running in the import process, don't bother initializing the
- // extension service since this can interfere with the main browser process
- // that is already running an extension service for this profile.
- // TODO(aa): can we start up even less of ExtensionService?
- // http://crbug.com/107636
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kImport) &&
- !CommandLine::ForCurrentProcess()->HasSwitch(switches::kImportFromFile)) {
- if (g_browser_process->profile_manager() &&
- g_browser_process->profile_manager()->will_import()) {
- RegisterForImportFinished();
- } else {
- // TODO(erikkay) this should probably be deferred to a future point
- // rather than running immediately at startup.
- CheckForExternalUpdates();
+ CHECK(!ProfileManager::IsImportProcess(*CommandLine::ForCurrentProcess()));
+ if (g_browser_process->profile_manager() &&
+ g_browser_process->profile_manager()->will_import()) {
+ RegisterForImportFinished();
+ } else {
+ // TODO(erikkay) this should probably be deferred to a future point
+ // rather than running immediately at startup.
+ CheckForExternalUpdates();
- // TODO(erikkay) this should probably be deferred as well.
- GarbageCollectExtensions();
- }
+ // TODO(erikkay) this should probably be deferred as well.
+ GarbageCollectExtensions();
}
if (extension_prefs_->NeedsStorageGarbageCollection()) {

Powered by Google App Engine
This is Rietveld 408576698