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

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

Issue 13811030: Simplify ExtensionProcessManager to only load extension background pages when a browser window is o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « chrome/browser/extensions/extension_process_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_process_manager.cc
===================================================================
--- chrome/browser/extensions/extension_process_manager.cc (revision 193114)
+++ chrome/browser/extensions/extension_process_manager.cc (working copy)
@@ -20,7 +20,6 @@
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_finder.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/background_info.h"
@@ -138,8 +137,6 @@
Profile* original_profile = profile->GetOriginalProfile();
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY,
content::NotificationService::AllSources());
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
- content::Source<Profile>(original_profile));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
content::Source<Profile>(original_profile));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
@@ -555,23 +552,13 @@
break;
ExtensionService* service = GetProfile()->GetExtensionService();
- if (!service || !service->is_ready())
+ if (!service)
break;
+ CHECK(service->is_ready());
CreateBackgroundHostsForProfileStartup();
break;
}
- case chrome::NOTIFICATION_EXTENSIONS_READY: {
- // Don't load background hosts now if the loading should be deferred.
- // Instead they will be loaded when a browser window for this profile
- // (or an incognito profile from this profile) is ready.
- if (DeferLoadingBackgroundHosts())
- break;
-
- CreateBackgroundHostsForProfileStartup();
- break;
- }
-
case chrome::NOTIFICATION_EXTENSION_LOADED: {
Profile* profile = content::Source<Profile>(source).ptr();
ExtensionService* service = profile->GetExtensionService();
@@ -772,15 +759,6 @@
}
}
-bool ExtensionProcessManager::DeferLoadingBackgroundHosts() const {
-#if defined(OS_ANDROID)
- return false;
-#else
- return chrome::GetTotalBrowserCountForProfile(GetProfile()) == 0 &&
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kShowAppList);
-#endif
-}
-
//
// IncognitoExtensionProcessManager
//
@@ -791,13 +769,6 @@
original_manager_(extensions::ExtensionSystem::Get(
profile->GetOriginalProfile())->process_manager()) {
DCHECK(profile->IsOffTheRecord());
-
- // The original profile will have its own ExtensionProcessManager to
- // load the background pages of the spanning extensions. This process
- // manager need only worry about the split mode extensions, which is handled
- // in the NOTIFICATION_BROWSER_WINDOW_READY notification handler.
- registrar_.Remove(this, chrome::NOTIFICATION_EXTENSIONS_READY,
- content::Source<Profile>(profile->GetOriginalProfile()));
}
IncognitoExtensionProcessManager::~IncognitoExtensionProcessManager() {
« no previous file with comments | « chrome/browser/extensions/extension_process_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698