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

Unified Diff: extensions/browser/process_manager.h

Issue 381283002: Refactor code that defers extension background page loading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on top of chrome_browser_extensions.gypi GN changes Created 6 years, 5 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 | « extensions/browser/extensions_browser_client.h ('k') | extensions/browser/process_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/process_manager.h
diff --git a/extensions/browser/process_manager.h b/extensions/browser/process_manager.h
index e580bbd9335205b8b22ec164c25930d9e9853802..80736e4844b33e7f830a6834b27f6fab0345ef27 100644
--- a/extensions/browser/process_manager.h
+++ b/extensions/browser/process_manager.h
@@ -33,6 +33,7 @@ namespace extensions {
class Extension;
class ExtensionHost;
+class ProcessManagerDelegate;
class ProcessManagerObserver;
// Manages dynamic state of running Chromium extensions. There is one instance
@@ -122,8 +123,9 @@ class ProcessManager : public content::NotificationObserver {
// onSuspendCanceled() event to it.
void CancelSuspend(const Extension* extension);
- // Ensures background hosts are loaded for a new browser window.
- void OnBrowserWindowReady();
+ // Creates background hosts if the embedder is ready and they are not already
+ // loaded.
+ void MaybeCreateStartupBackgroundHosts();
// Gets the BrowserContext associated with site_instance_ and all other
// related SiteInstances.
@@ -144,6 +146,10 @@ class ProcessManager : public content::NotificationObserver {
content::BrowserContext* original_context,
ProcessManager* original_manager);
+ bool startup_background_hosts_created_for_test() const {
+ return startup_background_hosts_created_;
+ }
+
protected:
// If |context| is incognito pass the master context as |original_context|.
// Otherwise pass the same context for both.
@@ -158,10 +164,6 @@ class ProcessManager : public content::NotificationObserver {
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // Load all background pages once the profile data is ready and the pages
- // should be loaded.
- void CreateBackgroundHostsForProfileStartup();
-
content::NotificationRegistrar registrar_;
// The set of ExtensionHosts running viewless background extensions.
@@ -182,6 +184,10 @@ class ProcessManager : public content::NotificationObserver {
typedef std::map<content::RenderViewHost*,
extensions::ViewType> ExtensionRenderViews;
+ // Load all background pages once the profile data is ready and the pages
+ // should be loaded.
+ void CreateStartupBackgroundHosts();
+
// Called just after |host| is created so it can be registered in our lists.
void OnBackgroundHostCreated(ExtensionHost* host);
@@ -216,9 +222,6 @@ class ProcessManager : public content::NotificationObserver {
// Clears background page data for this extension.
void ClearBackgroundPageData(const std::string& extension_id);
- // Returns true if loading background pages should be deferred.
- bool DeferLoadingBackgroundHosts() const;
-
void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached);
// Contains all active extension-related RenderViewHost instances for all
« no previous file with comments | « extensions/browser/extensions_browser_client.h ('k') | extensions/browser/process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698