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

Issue 2583273002: [Extensions Bindings] Allow for argument validation without conversion (Closed)

Created:
4 years ago by Devlin
Modified:
3 years, 11 months 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 Bindings] Allow for argument validation without conversion Currently, the argument validation and and argument conversion happens in a single step. This is good for the case when we need the JSON serialized arguments, but in the case of custom JS hooks, the work is unnecessary. However, we still need to match arguments to a signature in that case. Add another method to allow for matching, but not converting, the arguments, and use it when we have a handle request JS hook. This is in line with what the curent JS implementation does, and thus what our custom bindings expect. We also need to add support for parsing arguments that are functions, since we are now validating for requests with custom handlers (which can have functions as arguments other than callbacks). Add a test that invoking a method with a custom binding with an invalid invocation throws an error. BUG=653596 Committed: https://crrev.com/6598b14ac84919777d8019054114b7b0aa6baec0 Cr-Commit-Position: refs/heads/master@{#440816}

Patch Set 1 : format #

Total comments: 6

Patch Set 2 : . #

Patch Set 3 : jbroman #

Patch Set 4 : add function support in ArgumentSpec::ParseArgument() #

Total comments: 2

Patch Set 5 : lazyboy's #

Unified diffs Side-by-side diffs Delta from patch set Stats (+464 lines, -242 lines) Patch
M extensions/renderer/api_binding.cc View 1 1 chunk +23 lines, -11 lines 0 comments Download
M extensions/renderer/api_binding_hooks.h View 1 4 chunks +19 lines, -7 lines 0 comments Download
M extensions/renderer/api_binding_hooks.cc View 1 4 chunks +25 lines, -16 lines 0 comments Download
M extensions/renderer/api_binding_unittest.cc View 1 2 chunks +13 lines, -3 lines 0 comments Download
M extensions/renderer/api_bindings_system_unittest.cc View 1 1 chunk +8 lines, -2 lines 0 comments Download
M extensions/renderer/api_signature.h View 1 2 1 chunk +18 lines, -28 lines 0 comments Download
M extensions/renderer/api_signature.cc View 1 2 3 4 2 chunks +186 lines, -60 lines 0 comments Download
M extensions/renderer/argument_spec.h View 2 chunks +26 lines, -24 lines 0 comments Download
M extensions/renderer/argument_spec.cc View 1 2 3 5 chunks +116 lines, -80 lines 0 comments Download
M extensions/renderer/argument_spec_unittest.cc View 1 2 3 5 chunks +30 lines, -11 lines 0 comments Download

Messages

Total messages: 27 (16 generated)
Devlin
4 years ago (2016-12-19 23:31:50 UTC) #8
Devlin
friendly ping :)
4 years ago (2016-12-22 17:10:03 UTC) #9
jbroman
This largely looks good (though I wish we didn't have to have this forked logic). ...
3 years, 12 months ago (2016-12-22 20:01:34 UTC) #10
Devlin
On 2016/12/22 20:01:34, jbroman wrote: > Sorry for the review delay; it slipped past me ...
3 years, 12 months ago (2016-12-22 22:35:04 UTC) #11
jbroman
lgtm
3 years, 12 months ago (2016-12-23 18:20:30 UTC) #13
Devlin
lazyboy@, wanna take a look?
3 years, 12 months ago (2016-12-27 16:27:06 UTC) #14
lazyboy
lgtm w/ an optional nit https://codereview.chromium.org/2583273002/diff/80001/extensions/renderer/api_signature.cc File extensions/renderer/api_signature.cc (right): https://codereview.chromium.org/2583273002/diff/80001/extensions/renderer/api_signature.cc#newcode31 extensions/renderer/api_signature.cc:31: // resulting list as ...
3 years, 11 months ago (2016-12-27 23:48:44 UTC) #15
Devlin
https://codereview.chromium.org/2583273002/diff/80001/extensions/renderer/api_signature.cc File extensions/renderer/api_signature.cc (right): https://codereview.chromium.org/2583273002/diff/80001/extensions/renderer/api_signature.cc#newcode31 extensions/renderer/api_signature.cc:31: // resulting list as it goes. On 2016/12/27 23:48:44, ...
3 years, 11 months ago (2016-12-28 00:56:18 UTC) #18
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/2583273002/100001
3 years, 11 months ago (2016-12-28 00:56:41 UTC) #22
commit-bot: I haz the power
Committed patchset #5 (id:100001)
3 years, 11 months ago (2016-12-28 01:09:26 UTC) #25
commit-bot: I haz the power
3 years, 11 months ago (2017-01-02 15:48:07 UTC) #27
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/6598b14ac84919777d8019054114b7b0aa6baec0
Cr-Commit-Position: refs/heads/master@{#440816}

Powered by Google App Engine
This is Rietveld 408576698