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

Unified Diff: extensions/renderer/event_bindings.cc

Issue 2236133002: Ignore filtered event if an event matcher cannot be added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/event_bindings.cc
diff --git a/extensions/renderer/event_bindings.cc b/extensions/renderer/event_bindings.cc
index de99257c3824e78046708ef98c51fe8fc8ca15ed..c56d1a97a5b2dd8d3b6585a41c41ad5521ebbebc 100644
--- a/extensions/renderer/event_bindings.cc
+++ b/extensions/renderer/event_bindings.cc
@@ -277,6 +277,8 @@ void EventBindings::AttachFilteredEvent(
base::DictionaryValue* filter_weak = filter.get();
Devlin 2016/08/11 19:08:12 This makes me sad, because there's an awful lot of
meacer 2016/08/11 21:53:00 Done. It seems safe to do this, but I wonder if I
Devlin 2016/08/11 21:57:39 I wouldn't be opposed to a DCHECK, if you want to
meacer 2016/08/11 22:04:27 On second thought this seemed overkill so decided
int id = g_event_filter.Get().AddEventMatcher(
event_name, ParseEventMatcher(std::move(filter)));
+ if (id == -1)
+ return;
Devlin 2016/08/11 19:08:12 It looks like other places this fails, we return -
meacer 2016/08/11 21:53:00 Line 259 doesn't set it to -1. Should I add it the
Devlin 2016/08/11 21:57:39 I think line 259 throws an error if it fails, so w
meacer 2016/08/11 22:04:27 Ah, okay didn't read it well.
attached_matcher_ids_.insert(id);
// Only send IPCs the first time a filter gets added.
« 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