diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-15 03:24:36 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-15 03:24:36 +0000 |
commit | cf9a246cf386c7af0fb6524ac5d025c0d4e8563a (patch) | |
tree | 914b55375eee47f6d21f2fc3f106c4ba506637ec /chrome/browser/extensions/extension_process_manager.h | |
parent | 0c48c17f7ebcc0c8f79eba1aeae56d32b3c2f03f (diff) | |
download | chromium_src-cf9a246cf386c7af0fb6524ac5d025c0d4e8563a.zip chromium_src-cf9a246cf386c7af0fb6524ac5d025c0d4e8563a.tar.gz chromium_src-cf9a246cf386c7af0fb6524ac5d025c0d4e8563a.tar.bz2 |
EFD now notifies EPM of renderviews created, which in turn notifies the renderer of page actions that it knows about.
Remove generic event "page-action-executed" in favor of page action specific event (sent as extension_id/page_action_id).
In the bindings, we now setup events for each page action we know about so we can register for specific events, and not receive broadcast events from all page actions. To setup these events I added a GetCurrentPageActions() to extension_process_bindings.cc and a helper function GetCurrentExtensionId().
And, finally, I simplified the page action background page by removing the check to see if we are already subscribed to the feed (since we now support multiple feed readers, it doesn't make sense anymore to always check Google Reader). This check might make a comeback later in a different form.
BUG=13936
TEST=The RSS sample extension should work as before.
Review URL: http://codereview.chromium.org/155514
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20714 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 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_process_manager.h b/chrome/browser/extensions/extension_process_manager.h index 58f6639..e3d6b76 100644 --- a/chrome/browser/extensions/extension_process_manager.h +++ b/chrome/browser/extensions/extension_process_manager.h @@ -5,7 +5,9 @@ #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ +#include <map> #include <set> +#include <string> #include "base/ref_counted.h" #include "chrome/common/notification_registrar.h" @@ -43,6 +45,13 @@ class ExtensionProcessManager : public NotificationObserver { // Returns the SiteInstance that the given URL belongs to. SiteInstance* GetSiteInstanceForURL(const GURL& url); + // Register an extension process by |extension_id| and specifying which + // |process_id| it belongs to. + void RegisterExtensionProcess(std::string extension_id, int process_id); + + // Unregister an extension process with specified |process_id|. + void UnregisterExtensionProcess(int process_id); + // NotificationObserver: virtual void Observe(NotificationType type, const NotificationSource& source, @@ -69,6 +78,10 @@ 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_; + DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); }; |