summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_process_manager.h
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 19:30:12 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 19:30:12 +0000
commit103f19fbcf7d78efd8edc28bfabb3d4915a246de (patch)
tree5bd99fea32252ef037bc8b936ec19f04bd50e868 /chrome/browser/extensions/extension_process_manager.h
parent3a7e89dbebd7e48b132ef2dab3a8ff7cf2235634 (diff)
downloadchromium_src-103f19fbcf7d78efd8edc28bfabb3d4915a246de.zip
chromium_src-103f19fbcf7d78efd8edc28bfabb3d4915a246de.tar.gz
chromium_src-103f19fbcf7d78efd8edc28bfabb3d4915a246de.tar.bz2
Add chrome.experimental.extension.onBackgroundPageUnloadingSoon event for when transient background
pages unload. Also restructured the background page data in ExtensionProcessManager and ExtensionHost to be a simple map, instead of scattered all over. BUG=119619 TEST=no Review URL: https://chromiumcodereview.appspot.com/9924024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_process_manager.h')
-rw-r--r--chrome/browser/extensions/extension_process_manager.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_process_manager.h b/chrome/browser/extensions/extension_process_manager.h
index 464dadc..c5a936a 100644
--- a/chrome/browser/extensions/extension_process_manager.h
+++ b/chrome/browser/extensions/extension_process_manager.h
@@ -97,9 +97,12 @@ class ExtensionProcessManager : public content::NotificationObserver {
int IncrementLazyKeepaliveCount(const Extension* extension);
int DecrementLazyKeepaliveCount(const Extension* extension);
- // Handles a response to the ShouldClose message, used for lazy background
+ // Handles a response to the ShouldUnload message, used for lazy background
// pages.
- void OnShouldCloseAck(const std::string& extension_id, int sequence_id);
+ void OnShouldUnloadAck(const std::string& extension_id, int sequence_id);
+
+ // Same as above, for the Unload message.
+ void OnUnloadAck(const std::string& extension_id);
// Tracks network requests for a given RenderViewHost, used to know
// when network activity is idle for lazy background pages.
@@ -143,6 +146,11 @@ class ExtensionProcessManager : public content::NotificationObserver {
scoped_refptr<content::SiteInstance> site_instance_;
private:
+ // Extra information we keep for each extension's background page.
+ struct BackgroundPageData;
+ typedef std::string ExtensionId;
+ typedef std::map<ExtensionId, BackgroundPageData> BackgroundPageDataMap;
+
// Contains all extension-related RenderViewHost instances for all extensions.
// We also keep a cache of the host's view type, because that information
// is not accessible at registration/deregistration time.
@@ -167,6 +175,8 @@ class ExtensionProcessManager : public content::NotificationObserver {
// was not available when the host was first registered.
void UpdateRegisteredRenderView(content::RenderViewHost* render_view_host);
+ BackgroundPageDataMap background_page_data_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager);
};