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

Unified Diff: extensions/renderer/event_bindings.cc

Issue 2940893002: [Extensions] Pass EventFilteringInfo directly in DispatchEvent message (Closed)
Patch Set: . Created 3 years, 6 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/renderer/event_bindings.h ('k') | extensions/renderer/extension_bindings_system.h » ('j') | 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 63b9c31e07aa3399f650565898d527788699dd74..59cc404d8b7daa7499f336b9a86a0f5ee9058b12 100644
--- a/extensions/renderer/event_bindings.cc
+++ b/extensions/renderer/event_bindings.cc
@@ -128,12 +128,10 @@ bool RemoveFilter(const std::string& event_name,
// Returns a v8::Array containing the ids of the listeners that match the given
// |event_filter_dict| in the given |script_context|.
-v8::Local<v8::Array> GetMatchingListeners(
- ScriptContext* script_context,
- const std::string& event_name,
- const base::DictionaryValue& event_filter_dict) {
+v8::Local<v8::Array> GetMatchingListeners(ScriptContext* script_context,
+ const std::string& event_name,
+ const EventFilteringInfo& info) {
const EventFilter& event_filter = g_event_filter.Get();
- EventFilteringInfo info(event_filter_dict);
v8::Isolate* isolate = script_context->isolate();
v8::Local<v8::Context> context = script_context->v8_context();
@@ -207,13 +205,13 @@ bool EventBindings::HasListener(ScriptContext* script_context,
void EventBindings::DispatchEventInContext(
const std::string& event_name,
const base::ListValue* event_args,
- const base::DictionaryValue* filtering_info,
+ const EventFilteringInfo* filtering_info,
ScriptContext* context) {
v8::HandleScope handle_scope(context->isolate());
v8::Context::Scope context_scope(context->v8_context());
v8::Local<v8::Array> listener_ids;
- if (filtering_info && !filtering_info->empty())
+ if (filtering_info && !filtering_info->is_empty())
listener_ids = GetMatchingListeners(context, event_name, *filtering_info);
else
listener_ids = v8::Array::New(context->isolate());
« no previous file with comments | « extensions/renderer/event_bindings.h ('k') | extensions/renderer/extension_bindings_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698