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

Unified Diff: extensions/browser/process_manager.cc

Issue 111253003: Remove DeferBackgroundExtensionCreation field trial and supporting code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: extension_system.h header still needed for GetDisabledPlatformApp Created 7 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
« no previous file with comments | « extensions/browser/process_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/process_manager.cc
diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc
index 7cd0ecfb3c3243e077b2edc8210f8aa2b28b3371..6a57d8e600ac1eba65ec9eeef9d6c5b582c08baf 100644
--- a/extensions/browser/process_manager.cc
+++ b/extensions/browser/process_manager.cc
@@ -175,7 +175,6 @@ ProcessManager* ProcessManager::Create(BrowserContext* context) {
ProcessManager::ProcessManager(BrowserContext* context,
BrowserContext* original_context)
: site_instance_(SiteInstance::Create(context)),
- defer_background_host_creation_(false),
startup_background_hosts_created_(false),
devtools_callback_(base::Bind(
&ProcessManager::OnDevToolsStateChanged,
@@ -536,16 +535,6 @@ void ProcessManager::CancelSuspend(const Extension* extension) {
}
}
-void ProcessManager::DeferBackgroundHostCreation(bool defer) {
- bool previous = defer_background_host_creation_;
- defer_background_host_creation_ = defer;
-
- // If we were deferred, and we switch to non-deferred, then create the
- // background hosts.
- if (previous && !defer_background_host_creation_)
- CreateBackgroundHostsForProfileStartup();
-}
-
void ProcessManager::OnBrowserWindowReady() {
ExtensionService* service = ExtensionSystem::GetForBrowserContext(
GetBrowserContext())->extension_service();
@@ -568,6 +557,12 @@ void ProcessManager::Observe(int type,
switch (type) {
case chrome::NOTIFICATION_EXTENSIONS_READY:
case chrome::NOTIFICATION_PROFILE_CREATED: {
+ // 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;
}
@@ -699,13 +694,6 @@ void ProcessManager::CreateBackgroundHostsForProfileStartup() {
if (startup_background_hosts_created_)
return;
- // 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, or when
- // DeferBackgroundHostCreation is called with false.
- if (DeferLoadingBackgroundHosts())
- return;
-
ExtensionService* service = ExtensionSystem::GetForBrowserContext(
GetBrowserContext())->extension_service();
DCHECK(service);
@@ -805,10 +793,6 @@ void ProcessManager::ClearBackgroundPageData(const std::string& extension_id) {
}
bool ProcessManager::DeferLoadingBackgroundHosts() const {
- // Don't load background hosts now if the loading should be deferred.
- if (defer_background_host_creation_)
- return true;
-
// The extensions embedder may have special rules about background hosts.
return ExtensionsBrowserClient::Get()->DeferLoadingBackgroundHosts(
GetBrowserContext());
« no previous file with comments | « extensions/browser/process_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698