Chromium Code Reviews| Index: chrome/browser/extensions/extension_process_manager.h |
| diff --git a/chrome/browser/extensions/extension_process_manager.h b/chrome/browser/extensions/extension_process_manager.h |
| index eddf0cfa9571f9748cd0713f3bf448fbfdbae987..08e6f09dba58ec0f5105a62934a3f912378080a3 100644 |
| --- a/chrome/browser/extensions/extension_process_manager.h |
| +++ b/chrome/browser/extensions/extension_process_manager.h |
| @@ -25,6 +25,7 @@ class Profile; |
| namespace content { |
| class RenderViewHost; |
| class SiteInstance; |
| +class WebContents; |
|
Aaron Boodman
2012/04/20 06:34:56
You can remove this.
benwells
2012/04/23 05:00:26
Done.
|
| }; |
| // Manages dynamic state of running Chromium extensions. There is one instance |
| @@ -32,9 +33,23 @@ class SiteInstance; |
| // track of split-mode extensions only. |
| class ExtensionProcessManager : public content::NotificationObserver { |
| public: |
| + typedef std::set<ExtensionHost*> ExtensionHostSet; |
| + typedef ExtensionHostSet::const_iterator const_iterator; |
| + |
| static ExtensionProcessManager* Create(Profile* profile); |
| virtual ~ExtensionProcessManager(); |
| + const ExtensionHostSet& background_hosts() const { |
| + return background_hosts_; |
| + } |
| + |
| + const ExtensionHostSet& platform_app_hosts() const { |
|
Aaron Boodman
2012/04/20 06:34:56
It seems like this is only needed for one test. Ca
benwells
2012/04/23 05:00:26
They can removed for all platform app tests, excep
Aaron Boodman
2012/04/25 21:27:05
I see. Since you know the view type, perhaps you c
|
| + return platform_app_hosts_; |
| + } |
| + |
| + typedef std::set<content::RenderViewHost*> ViewSet; |
| + const ViewSet GetAllViews() const; |
| + |
| // Creates a new ExtensionHost with its associated view, grouping it in the |
| // appropriate SiteInstance (and therefore process) based on the URL and |
| // profile. |
| @@ -86,8 +101,10 @@ class ExtensionProcessManager : public content::NotificationObserver { |
| std::set<content::RenderViewHost*> GetRenderViewHostsForExtension( |
| const std::string& extension_id); |
| - // Returns true if |host| is managed by this process manager. |
| - bool HasExtensionHost(ExtensionHost* host) const; |
| + // Returns the extension associated with the specified RenderViewHost, or |
| + // NULL. |
| + const Extension* GetExtensionForRenderViewHost( |
| + content::RenderViewHost* render_view_host); |
| // Returns true if the (lazy) background host for the given extension has |
| // already been sent the unload event and is shutting down. |
| @@ -113,11 +130,6 @@ class ExtensionProcessManager : public content::NotificationObserver { |
| void OnNetworkRequestStarted(content::RenderViewHost* render_view_host); |
| void OnNetworkRequestDone(content::RenderViewHost* render_view_host); |
| - typedef std::set<ExtensionHost*> ExtensionHostSet; |
| - typedef ExtensionHostSet::const_iterator const_iterator; |
| - const_iterator begin() const { return all_hosts_.begin(); } |
| - const_iterator end() const { return all_hosts_.end(); } |
| - |
| protected: |
| explicit ExtensionProcessManager(Profile* profile); |
| @@ -138,12 +150,12 @@ class ExtensionProcessManager : public content::NotificationObserver { |
| content::NotificationRegistrar registrar_; |
| - // The set of all ExtensionHosts managed by this process manager. |
| - ExtensionHostSet all_hosts_; |
| - |
| - // The set of running viewless background extensions. |
| + // The set of ExtensionHosts running viewless background extensions. |
| ExtensionHostSet background_hosts_; |
| + // The set of ExtensionHosts running platform apps. |
| + ExtensionHostSet platform_app_hosts_; |
| + |
| // A SiteInstance related to the SiteInstance for all extensions in |
| // this profile. We create it in such a way that a new |
| // browsing instance is created. This controls process grouping. |