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

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

Issue 23618014: This defers starting background extension page RenderViews (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged logic into DeferLoadingBackgroundHosts Created 7 years, 3 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/extensions/extension_process_manager.h
diff --git a/chrome/browser/extensions/extension_process_manager.h b/chrome/browser/extensions/extension_process_manager.h
index 12fdf4a9c6358a1bb9cab6113f78680fd2189a79..b234b3c0e5e06082f793db08998ad90a503aea06 100644
--- a/chrome/browser/extensions/extension_process_manager.h
+++ b/chrome/browser/extensions/extension_process_manager.h
@@ -134,6 +134,11 @@ class ExtensionProcessManager : public content::NotificationObserver {
// onSuspendCanceled() event to it.
void CancelSuspend(const extensions::Extension* extension);
+ // If |defer| is true background host creation is to be deferred until this is
+ // called again with |defer| set to false, at which point all deferred
+ // background hosts will be created. Defaults to false.
+ void DeferBackgroundHostCreation(bool defer);
+
protected:
explicit ExtensionProcessManager(Profile* profile);
@@ -199,7 +204,8 @@ class ExtensionProcessManager : public content::NotificationObserver {
// Returns true if loading background pages should be deferred. This is
// true if there are no browser windows open and the browser process was
- // started to show the app launcher.
+ // started to show the app launcher, or if DeferBackgroundHostCreation was
+ // called with true, or if the profile is not yet valid.
bool DeferLoadingBackgroundHosts() const;
void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached);
@@ -219,6 +225,9 @@ class ExtensionProcessManager : public content::NotificationObserver {
// sending a Suspend message; read from command-line switch.
base::TimeDelta event_page_suspending_time_;
+ // If true, then creation of background hosts is suspended.
+ bool defer_background_host_creation_;
+
base::WeakPtrFactory<ExtensionProcessManager> weak_ptr_factory_;
base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_;

Powered by Google App Engine
This is Rietveld 408576698