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

Unified Diff: trunk/src/extensions/browser/process_manager.h

Issue 399153002: Revert 283678 "Refactor code that defers extension background pa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
Index: trunk/src/extensions/browser/process_manager.h
===================================================================
--- trunk/src/extensions/browser/process_manager.h (revision 283800)
+++ trunk/src/extensions/browser/process_manager.h (working copy)
@@ -33,7 +33,6 @@
class Extension;
class ExtensionHost;
-class ProcessManagerDelegate;
class ProcessManagerObserver;
// Manages dynamic state of running Chromium extensions. There is one instance
@@ -123,9 +122,8 @@
// onSuspendCanceled() event to it.
void CancelSuspend(const Extension* extension);
- // Creates background hosts if the embedder is ready and they are not already
- // loaded.
- void MaybeCreateStartupBackgroundHosts();
+ // Ensures background hosts are loaded for a new browser window.
+ void OnBrowserWindowReady();
// Gets the BrowserContext associated with site_instance_ and all other
// related SiteInstances.
@@ -146,10 +144,6 @@
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.
@@ -164,6 +158,10 @@
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.
@@ -184,10 +182,6 @@
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);
@@ -222,6 +216,9 @@
// 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 | « trunk/src/extensions/browser/extensions_browser_client.h ('k') | trunk/src/extensions/browser/process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698