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

Unified Diff: extensions/browser/event_listener_map.cc

Issue 2594193002: Only use host() for chrome:// urls in EventListener (Closed)
Patch Set: Use url::Origin Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/event_listener_map.cc
diff --git a/extensions/browser/event_listener_map.cc b/extensions/browser/event_listener_map.cc
index bd2524c26b11a43413f9d90fa81d3e72e3dc8d1c..12dd5b4499da1f744e97585ba8f6ce54251d50d4 100644
--- a/extensions/browser/event_listener_map.cc
+++ b/extensions/browser/event_listener_map.cc
@@ -14,6 +14,7 @@
#include "extensions/browser/event_router.h"
#include "ipc/ipc_message.h"
#include "url/gurl.h"
+#include "url/origin.h"
using base::DictionaryValue;
@@ -37,7 +38,12 @@ std::unique_ptr<EventListener> EventListener::ForURL(
const GURL& listener_url,
content::RenderProcessHost* process,
std::unique_ptr<base::DictionaryValue> filter) {
- return base::WrapUnique(new EventListener(event_name, "", listener_url,
+ // Use only the origin to identify the event listener, e.g. chrome://settings
+ // for chrome://settings/accounts, to avoid multiple events being triggered
+ // for the same process. See crbug.com/536858 for details. // TODO(devlin): If
+ // we dispatched events to processes more intelligently this could be avoided.
+ return base::WrapUnique(new EventListener(event_name, "",
+ url::Origin(listener_url).GetURL(),
process, std::move(filter)));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698