|
[Reland][Extensions Bindings] Add support for filtered events
Some extension API events support "filtering", which allows extensions
to only receive event notifications for a subset of the total events.
For instance, the webNavigation API allows an extension to specify
a set of url filters in order to specify which urls the listener is
interested in, and not be notified of every navigation.
Expand the native event bindings to support filtering for applicable
events. Abstract out an APIEventListeners class to handle adding,
removing, and querying event listeners, including retrieving those
for certain filtering info. This currently has two implementations -
FilteredEventListeners and UnfilteredFilteredEventListeners.
Add tests for the same.
Expand the end-to-end test with webNavigation events to test filtered
events.
Fix for reland: change the url in the web navigation test and allow old
urls from previous test cases.
BUG= 653596
Review-Url: https://codereview.chromium.org/2768093002
Cr-Commit-Position: refs/heads/master@{#458962}
Committed: https://chromium.googlesource.com/chromium/src/+/ddc50bcb9cd192d117d23e025ce39c5a4da33e19
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1180 lines, -176 lines) |
Patch |
|
M |
chrome/test/data/extensions/api_test/native_bindings/extension/background.js
|
View
|
1
|
1 chunk |
+48 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/test/data/extensions/api_test/native_bindings/extension/manifest.json
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
A |
chrome/test/data/extensions/api_test/native_bindings/simple2.html
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
|
M |
extensions/common/event_filtering_info.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
extensions/common/event_filtering_info.cc
|
View
|
|
3 chunks |
+31 lines, -4 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/BUILD.gn
|
View
|
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/api_binding.cc
|
View
|
|
3 chunks |
+11 lines, -3 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/api_binding_js_util.h
|
View
|
|
1 chunk |
+5 lines, -3 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/api_binding_js_util.cc
|
View
|
|
2 chunks |
+12 lines, -8 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/api_binding_unittest.cc
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/api_bindings_system.h
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
extensions/renderer/api_bindings_system.cc
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/api_bindings_system_unittest.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/api_bindings_system_unittest.cc
|
View
|
|
3 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
extensions/renderer/api_event_handler.h
|
View
|
|
6 chunks |
+9 lines, -1 line |
0 comments
|
Download
|
|
M |
extensions/renderer/api_event_handler.cc
|
View
|
|
12 chunks |
+28 lines, -13 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/api_event_handler_unittest.cc
|
View
|
|
29 chunks |
+50 lines, -41 lines |
0 comments
|
Download
|
|
A |
extensions/renderer/api_event_listeners.h
|
View
|
|
1 chunk |
+155 lines, -0 lines |
0 comments
|
Download
|
|
A |
extensions/renderer/api_event_listeners.cc
|
View
|
|
1 chunk |
+254 lines, -0 lines |
0 comments
|
Download
|
|
A |
extensions/renderer/api_event_listeners_unittest.cc
|
View
|
|
1 chunk |
+427 lines, -0 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/chrome_setting.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
extensions/renderer/dispatcher.cc
|
View
|
|
1 chunk |
+27 lines, -7 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/event_emitter.h
|
View
|
|
3 chunks |
+13 lines, -21 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/event_emitter.cc
|
View
|
|
8 chunks |
+42 lines, -36 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/native_extension_bindings_system.h
|
View
|
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
extensions/renderer/native_extension_bindings_system.cc
|
View
|
|
3 chunks |
+11 lines, -6 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/native_extension_bindings_system_unittest.cc
|
View
|
|
5 chunks |
+15 lines, -15 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/resources/guest_view/guest_view_events.js
|
View
|
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/resources/messaging.js
|
View
|
|
2 chunks |
+10 lines, -8 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/worker_thread_dispatcher.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
Total messages: 16 (10 generated)
|