diff options
author | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-12 02:13:55 +0000 |
---|---|---|
committer | creis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-12 02:13:55 +0000 |
commit | 056ad2a8ef3d941e6e116fbc7ef1a6d747a6c691 (patch) | |
tree | 342be06819c9bbfe9901c4ef1c93dc00fd8966cb /chrome/browser/extensions/extension_process_manager.h | |
parent | 3e4aabc2c524579517ec69c4cc32ec2b3297faef (diff) | |
download | chromium_src-056ad2a8ef3d941e6e116fbc7ef1a6d747a6c691.zip chromium_src-056ad2a8ef3d941e6e116fbc7ef1a6d747a6c691.tar.gz chromium_src-056ad2a8ef3d941e6e116fbc7ef1a6d747a6c691.tar.bz2 |
Use process-per-app-instance for hosted apps without background permission.
Also update ExtensionProcessManager to map SiteInstances to extensions,
rather than extensions to processes.
BUG=87644
TEST=AppApiTest.AppProcessInstances
Review URL: http://codereview.chromium.org/7328029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_process_manager.h')
-rw-r--r-- | chrome/browser/extensions/extension_process_manager.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/chrome/browser/extensions/extension_process_manager.h b/chrome/browser/extensions/extension_process_manager.h index c2a7710..fd7682f 100644 --- a/chrome/browser/extensions/extension_process_manager.h +++ b/chrome/browser/extensions/extension_process_manager.h @@ -68,20 +68,25 @@ class ExtensionProcessManager : public NotificationObserver { // Returns the SiteInstance that the given URL belongs to. virtual SiteInstance* GetSiteInstanceForURL(const GURL& url); - // Registers an extension process by |extension_id| and specifying which - // |process_id| it belongs to. - void RegisterExtensionProcess(const std::string& extension_id, - int process_id); + // Registers a SiteInstance with |site_instance_id| as hosting the extension + // with |extension_id|. + void RegisterExtensionSiteInstance(int site_instance_id, + const std::string& extension_id); - // Unregisters an extension process with specified |process_id|. - void UnregisterExtensionProcess(int process_id); + // Unregisters the extension associated with |site_instance_id|. + void UnregisterExtensionSiteInstance(int site_instance_id); // Returns the extension process that |url| is associated with if it exists. + // This is not valid for hosted apps without the background permission, since + // such apps may have multiple processes. virtual RenderProcessHost* GetExtensionProcess(const GURL& url); // Returns the process that the extension with the given ID is running in. RenderProcessHost* GetExtensionProcess(const std::string& extension_id); + // Returns the Extension associated with the given SiteInstance id, if any. + virtual const Extension* GetExtensionForSiteInstance(int site_instance_id); + // Returns true if |host| is managed by this process manager. bool HasExtensionHost(ExtensionHost* host) const; @@ -116,9 +121,9 @@ class ExtensionProcessManager : public NotificationObserver { // controls process grouping. scoped_refptr<BrowsingInstance> browsing_instance_; - // A map of extension ID to the render_process_id that the extension lives in. - typedef std::map<std::string, int> ProcessIDMap; - ProcessIDMap process_ids_; + // A map of site instance ID to the ID of the extension it hosts. + typedef std::map<int, std::string> SiteInstanceIDMap; + SiteInstanceIDMap extension_ids_; DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); }; |