Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: extensions/browser/event_router.h

Issue 411733002: WIP: diff which plumbs through the event URL. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/event_listener_map_unittest.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/event_router.h
diff --git a/extensions/browser/event_router.h b/extensions/browser/event_router.h
index af0fdfd3a1f4a47d9067223ee8f9318f99985a56..aed05e2dd67b7eb0c5d0a7c5d6eeaa5d57f235ea 100644
--- a/extensions/browser/event_router.h
+++ b/extensions/browser/event_router.h
@@ -93,7 +93,9 @@ class EventRouter : public content::NotificationObserver,
ExtensionPrefs* extension_prefs);
virtual ~EventRouter();
- // Add or remove the process/extension pair as a listener for |event_name|.
+ // Add or remove a listener for |event_name| given the listener's
+ // |extension_id| and/or |listener_url|.
+ //
// Note that multiple extensions can share a process due to process
// collapsing. Also, a single extension can have 2 processes if it is a split
// mode extension.
@@ -104,6 +106,15 @@ class EventRouter : public content::NotificationObserver,
content::RenderProcessHost* process,
const std::string& extension_id);
+ // Add or remove a listener for |event_name| given the listener's
+ // URL. TODO better comment.
+ void AddEventListenerForURL(const std::string& event_name,
+ content::RenderProcessHost* process,
+ const GURL& listener_url);
+ void RemoveEventListenerForURL(const std::string& event_name,
+ content::RenderProcessHost* process,
+ const GURL& listener_url);
+
EventListenerMap& listeners() { return listeners_; }
// Registers an observer to be notified when an event listener for
@@ -223,6 +234,7 @@ class EventRouter : public content::NotificationObserver,
// Dispatches the event to the specified extension running in |process|.
void DispatchEventToProcess(const std::string& extension_id,
+ const GURL& listener_url,
content::RenderProcessHost* process,
const linked_ptr<Event>& event);
@@ -357,12 +369,14 @@ struct Event {
struct EventListenerInfo {
EventListenerInfo(const std::string& event_name,
const std::string& extension_id,
+ const GURL& listener_url,
content::BrowserContext* browser_context);
// The event name including any sub-event, e.g. "runtime.onStartup" or
// "webRequest.onCompleted/123".
const std::string event_name;
const std::string extension_id;
+ const GURL listener_url;
content::BrowserContext* browser_context;
};
« no previous file with comments | « extensions/browser/event_listener_map_unittest.cc ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698