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

Issue 2552343006: [Extensions Binding] Allow for registering custom hooks (Closed)

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

Description

[Extensions Binding] Allow for registering custom hooks Add an APIBindingHooks class to allow for registering custom hooks to handle various API calls. This can be needed for a number of reasons, such as returning renderer concepts, executing synchronously, or simply not needing to be performed on the browser side. This first patch only allows for the creation of C++ custom hooks, but we'll need to allow for both C++ and JS versions in order to reuse any of our current custom bindings code. That will come in the next patch. BUG=653596 Committed: https://crrev.com/d399335bfa3e978a8bc5e74a2fcf31213099a45a Cr-Commit-Position: refs/heads/master@{#438308}

Patch Set 1 #

Patch Set 2 : polish #

Total comments: 20

Patch Set 3 : jbroman #

Total comments: 4

Patch Set 4 : . #

Total comments: 6

Patch Set 5 : lazyboy's #

Patch Set 6 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+264 lines, -13 lines) Patch
M extensions/renderer/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding.h View 1 2 3 chunks +6 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding.cc View 1 2 6 chunks +20 lines, -7 lines 0 comments Download
A extensions/renderer/api_binding_hooks.h View 1 2 3 4 5 1 chunk +64 lines, -0 lines 0 comments Download
A extensions/renderer/api_binding_hooks.cc View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_types.h View 2 chunks +7 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_unittest.cc View 1 2 3 7 chunks +52 lines, -5 lines 0 comments Download
M extensions/renderer/api_bindings_system.h View 1 2 3 4 2 chunks +14 lines, -0 lines 0 comments Download
M extensions/renderer/api_bindings_system.cc View 1 2 3 4 3 chunks +20 lines, -1 line 0 comments Download
M extensions/renderer/api_bindings_system_unittest.cc View 1 2 2 chunks +51 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (21 generated)
Devlin
Hey folks, mind taking a look?
4 years ago (2016-12-07 23:55:24 UTC) #6
jbroman
https://codereview.chromium.org/2552343006/diff/20001/extensions/renderer/api_binding_hooks.cc File extensions/renderer/api_binding_hooks.cc (right): https://codereview.chromium.org/2552343006/diff/20001/extensions/renderer/api_binding_hooks.cc#newcode20 extensions/renderer/api_binding_hooks.cc:20: auto global_iter = request_hooks_.find(method_name); What's global about this iterator? ...
4 years ago (2016-12-08 16:58:56 UTC) #7
Devlin
https://codereview.chromium.org/2552343006/diff/20001/extensions/renderer/api_binding_hooks.cc File extensions/renderer/api_binding_hooks.cc (right): https://codereview.chromium.org/2552343006/diff/20001/extensions/renderer/api_binding_hooks.cc#newcode20 extensions/renderer/api_binding_hooks.cc:20: auto global_iter = request_hooks_.find(method_name); On 2016/12/08 16:58:56, jbroman wrote: ...
4 years ago (2016-12-08 19:12:03 UTC) #8
jbroman
ok lgtm https://codereview.chromium.org/2552343006/diff/20001/extensions/renderer/api_binding_hooks.h File extensions/renderer/api_binding_hooks.h (right): https://codereview.chromium.org/2552343006/diff/20001/extensions/renderer/api_binding_hooks.h#newcode31 extensions/renderer/api_binding_hooks.h:31: base::Callback<void(const binding::APISignature*, gin::Arguments*)>; On 2016/12/08 at 19:12:02, ...
4 years ago (2016-12-09 15:53:08 UTC) #9
Devlin
lazyboy@, wanna take a quick look? https://codereview.chromium.org/2552343006/diff/20001/extensions/renderer/api_binding_hooks.h File extensions/renderer/api_binding_hooks.h (right): https://codereview.chromium.org/2552343006/diff/20001/extensions/renderer/api_binding_hooks.h#newcode31 extensions/renderer/api_binding_hooks.h:31: base::Callback<void(const binding::APISignature*, gin::Arguments*)>; ...
4 years ago (2016-12-09 16:35:07 UTC) #11
lazyboy
https://codereview.chromium.org/2552343006/diff/60001/extensions/renderer/api_bindings_system.cc File extensions/renderer/api_bindings_system.cc (right): https://codereview.chromium.org/2552343006/diff/60001/extensions/renderer/api_bindings_system.cc#newcode51 extensions/renderer/api_bindings_system.cc:51: // Find the hooks for the API. If none ...
4 years ago (2016-12-13 01:52:32 UTC) #15
Devlin
https://codereview.chromium.org/2552343006/diff/60001/extensions/renderer/api_bindings_system.cc File extensions/renderer/api_bindings_system.cc (right): https://codereview.chromium.org/2552343006/diff/60001/extensions/renderer/api_bindings_system.cc#newcode51 extensions/renderer/api_bindings_system.cc:51: // Find the hooks for the API. If none ...
4 years ago (2016-12-13 18:41:30 UTC) #17
lazyboy
https://codereview.chromium.org/2552343006/diff/60001/extensions/renderer/api_bindings_system_unittest.cc File extensions/renderer/api_bindings_system_unittest.cc (right): https://codereview.chromium.org/2552343006/diff/60001/extensions/renderer/api_bindings_system_unittest.cc#newcode317 extensions/renderer/api_bindings_system_unittest.cc:317: APIBindingHooks* hooks = bindings_system()->GetHooksForAPI(kAlphaAPIName); On 2016/12/13 18:41:30, Devlin wrote: ...
4 years ago (2016-12-13 18:58:25 UTC) #19
Devlin
https://codereview.chromium.org/2552343006/diff/60001/extensions/renderer/api_bindings_system_unittest.cc File extensions/renderer/api_bindings_system_unittest.cc (right): https://codereview.chromium.org/2552343006/diff/60001/extensions/renderer/api_bindings_system_unittest.cc#newcode317 extensions/renderer/api_bindings_system_unittest.cc:317: APIBindingHooks* hooks = bindings_system()->GetHooksForAPI(kAlphaAPIName); On 2016/12/13 18:58:25, lazyboy wrote: ...
4 years ago (2016-12-13 19:05:40 UTC) #20
lazyboy
lgtm.
4 years ago (2016-12-13 19:06:37 UTC) #23
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/2552343006/100001
4 years ago (2016-12-13 19:10:21 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/355530)
4 years ago (2016-12-13 20:18:22 UTC) #29
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/2552343006/100001
4 years ago (2016-12-13 20:23:46 UTC) #31
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years ago (2016-12-13 22:07:11 UTC) #34
commit-bot: I haz the power
4 years ago (2016-12-13 22:09:29 UTC) #36
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/d399335bfa3e978a8bc5e74a2fcf31213099a45a
Cr-Commit-Position: refs/heads/master@{#438308}

Powered by Google App Engine
This is Rietveld 408576698