diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-17 17:21:45 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-17 17:21:45 +0000 |
commit | 46a19f626f5794f298cd1e4d8bdcbfcb07fd0b4e (patch) | |
tree | 5a04abc6c4c823a4ddf1ca0d76fcc1ea47ff009a /extensions/browser/process_manager.h | |
parent | dddea5bb5ab70ac91118754eb09ccb30dcb178a2 (diff) | |
download | chromium_src-46a19f626f5794f298cd1e4d8bdcbfcb07fd0b4e.zip chromium_src-46a19f626f5794f298cd1e4d8bdcbfcb07fd0b4e.tar.gz chromium_src-46a19f626f5794f298cd1e4d8bdcbfcb07fd0b4e.tar.bz2 |
Revert 283678 "Refactor code that defers extension background pa..."
This broke Chrome OS valgrind bots, for example:
http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20OS%20%28valgrind%29%284%29/builds/27033
> Refactor code that defers extension background page loading
>
> src/extensions depends on chrome::NOTIFICATION_PROFILE_CREATED to support deferred loading of extension background pages when the profile isn't ready yet. This is a layering violation.
>
> * Remove Chrome concepts like "browser window ready" and "profile created" from ProcessManager. Introduce ProcessManagerDelegate with a general concept of deferring background page loading.
> * Consolidate all the tricky Chrome-specific background page loading rules into ChromeProcessManagerDelegate. This keeps all the rules in one place. Annotate each block of special case code with the bug that inspired it.
> * Extend unit test coverage for ProcessManager.
>
> This will make it easier to eliminate chrome::NOTIFICATION_PROFILE_DESTROYED in ProcessManager in a later CL.
>
> BUG=392658
> TEST=unit_tests ProcessManagerTest, browser_tests ProcessManagerBrowserTest, manual
>
> Review URL: https://codereview.chromium.org/381283002
TBR=jamescook@chromium.org
Review URL: https://codereview.chromium.org/399153002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser/process_manager.h')
-rw-r--r-- | extensions/browser/process_manager.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/extensions/browser/process_manager.h b/extensions/browser/process_manager.h index 80736e4..e580bbd 100644 --- a/extensions/browser/process_manager.h +++ b/extensions/browser/process_manager.h @@ -33,7 +33,6 @@ namespace extensions { class Extension; class ExtensionHost; -class ProcessManagerDelegate; class ProcessManagerObserver; // Manages dynamic state of running Chromium extensions. There is one instance @@ -123,9 +122,8 @@ class ProcessManager : public content::NotificationObserver { // 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 @@ 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. @@ -164,6 +158,10 @@ 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. @@ -184,10 +182,6 @@ 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); @@ -222,6 +216,9 @@ 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 |