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

Issue 2909673003: [Extensions Bindings] Request JS execution from messaging bindings (Closed)

Created:
3 years, 7 months ago by Devlin
Modified:
3 years, 6 months ago
Reviewers:
lazyboy
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions Bindings] Request JS execution from messaging bindings Instead of synchronously forcing JS execution in messaging bindings, use safer alternatives to request JS execution. Since this modifies the ability of the called function to return a result (synchronously, at least), change messaging bindings to query for listeners natively rather than in JS (which is also less likely to be incorrect). This involves introducing a way to query if a given context has a listener for an event. Provide this functionality for both native and JS bindings. For native bindings, simply expose a method on APIEventHandler. For JS bindings, make the NullAttachmentStrategy register unmanaged events with the event bindings. Also expose a way to get the Dispatcher statically from the messaging bindings in order to get at the ExtensionBindingsSystem, and restructure ownership of the dispatcher in extensions/shell. BUG=629431 Review-Url: https://codereview.chromium.org/2909673003 Cr-Commit-Position: refs/heads/master@{#478492} Committed: https://chromium.googlesource.com/chromium/src/+/978464a97d85014ca4414366789702be3b35fa15

Patch Set 1 #

Patch Set 2 : nativefix #

Patch Set 3 : . #

Total comments: 13

Patch Set 4 : rebase #

Patch Set 5 : lazyboy's #

Unified diffs Side-by-side diffs Delta from patch set Stats (+237 lines, -47 lines) Patch
M chrome/renderer/extensions/chrome_extensions_renderer_client.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/extensions/chrome_extensions_renderer_client.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/renderer/api_event_handler.h View 1 2 3 4 2 chunks +9 lines, -3 lines 0 comments Download
M extensions/renderer/api_event_handler.cc View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M extensions/renderer/dispatcher.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/event_bindings.h View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M extensions/renderer/event_bindings.cc View 1 2 3 4 6 chunks +55 lines, -0 lines 0 comments Download
M extensions/renderer/event_emitter.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/extension_bindings_system.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M extensions/renderer/extensions_renderer_client.h View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
M extensions/renderer/js_extension_bindings_system.h View 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/js_extension_bindings_system.cc View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M extensions/renderer/messaging_bindings.h View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
M extensions/renderer/messaging_bindings.cc View 1 2 3 4 4 chunks +30 lines, -23 lines 0 comments Download
M extensions/renderer/native_extension_bindings_system.h View 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/native_extension_bindings_system.cc View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M extensions/renderer/native_extension_bindings_system_unittest.cc View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M extensions/renderer/resources/event.js View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M extensions/renderer/resources/messaging.js View 1 2 3 4 1 chunk +28 lines, -0 lines 0 comments Download
M extensions/renderer/test_extensions_renderer_client.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M extensions/renderer/test_extensions_renderer_client.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/shell/renderer/shell_content_renderer_client.h View 1 2 3 2 chunks +0 lines, -4 lines 0 comments Download
M extensions/shell/renderer/shell_content_renderer_client.cc View 1 2 3 5 chunks +11 lines, -12 lines 0 comments Download
M extensions/shell/renderer/shell_extensions_renderer_client.h View 1 2 chunks +8 lines, -0 lines 0 comments Download
M extensions/shell/renderer/shell_extensions_renderer_client.cc View 1 2 chunks +11 lines, -2 lines 0 comments Download

Messages

Total messages: 32 (25 generated)
Devlin
lazyboy@, mind taking a look when you get back? (The bots are red on the ...
3 years, 7 months ago (2017-05-27 01:29:12 UTC) #15
Devlin
lazyboy@, friendly ping? :)
3 years, 6 months ago (2017-06-03 01:14:43 UTC) #20
lazyboy
Very sorry for slipping this one, I had drafts saved hence didn't see it in ...
3 years, 6 months ago (2017-06-05 18:18:33 UTC) #21
Devlin
https://codereview.chromium.org/2909673003/diff/40001/extensions/renderer/api_event_handler.cc File extensions/renderer/api_event_handler.cc (right): https://codereview.chromium.org/2909673003/diff/40001/extensions/renderer/api_event_handler.cc#newcode271 extensions/renderer/api_event_handler.cc:271: return emitter->GetNumListeners() > 0; On 2017/06/05 18:18:32, lazyboy wrote: ...
3 years, 6 months ago (2017-06-09 20:18:02 UTC) #26
lazyboy
lgtm https://codereview.chromium.org/2909673003/diff/40001/extensions/renderer/api_event_handler.cc File extensions/renderer/api_event_handler.cc (right): https://codereview.chromium.org/2909673003/diff/40001/extensions/renderer/api_event_handler.cc#newcode271 extensions/renderer/api_event_handler.cc:271: return emitter->GetNumListeners() > 0; On 2017/06/09 20:18:01, Devlin ...
3 years, 6 months ago (2017-06-10 00:09:05 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2909673003/80001
3 years, 6 months ago (2017-06-10 01:26:19 UTC) #29
commit-bot: I haz the power
3 years, 6 months ago (2017-06-10 01:30:22 UTC) #32
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/978464a97d85014ca44143667897...

Powered by Google App Engine
This is Rietveld 408576698