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

Issue 798163002: Add failure messages to gin and js mojom encoder (Closed)

Created:
6 years ago by eseidel
Modified:
6 years ago
CC:
abarth-chromium, Aaron Boodman, ben+mojo_chromium.org, darin (slow to review), mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Add failure messages to gin and js mojom encoder I hit two failures while trying to use network_service today, both of which would have been much easier to catch with these two validators. This CL adds validation of encoding array pointers. We already validate in a few other places in codec.js and clearly need many more. This CL also makes it more clear in gin when type coercion fails what argument (0-indexed) failed to convert and what js type was seen in the process. I started down the path of logging the c++ destination type as well, but found I couldn't with our current RTTI-less build. R=abarth@chromium.org, hansmuller@chromium.org BUG= Committed: https://chromium.googlesource.com/external/mojo/+/4df7c4d89873e0efd93001d7fc6986e2aac0d732

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -3 lines) Patch
M gin/arguments.cc View 1 chunk +16 lines, -2 lines 0 comments Download
M gin/function_template.h View 1 chunk +5 lines, -1 line 0 comments Download
M mojo/public/js/codec.js View 2 chunks +4 lines, -0 lines 1 comment Download
M mojo/public/js/codec_unittests.js View 2 chunks +15 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (1 generated)
eseidel
6 years ago (2014-12-13 01:35:22 UTC) #1
abarth-chromium
LGTM, but you'll need to land the gin changes in the Chromium repo. Gin is ...
6 years ago (2014-12-13 05:42:58 UTC) #3
hansmuller
https://codereview.chromium.org/798163002/diff/1/mojo/public/js/codec.js File mojo/public/js/codec.js (right): https://codereview.chromium.org/798163002/diff/1/mojo/public/js/codec.js#newcode357 mojo/public/js/codec.js:357: throw new Error(kErrorArray); I suppose another indication that val ...
6 years ago (2014-12-15 16:56:17 UTC) #4
eseidel
I wasn't sure what the right pattern is. I'm happy to move to instanceof array ...
6 years ago (2014-12-15 20:25:18 UTC) #5
hansmuller
On 2014/12/15 20:25:18, eseidel wrote: > I wasn't sure what the right pattern is. I'm ...
6 years ago (2014-12-15 20:26:21 UTC) #6
eseidel
What about array-like objects? NodeList for example?
6 years ago (2014-12-15 20:27:24 UTC) #7
eseidel
Committed patchset #1 (id:1) manually as 4df7c4d89873e0efd93001d7fc6986e2aac0d732 (presubmit successful).
6 years ago (2014-12-15 20:46:34 UTC) #8
hansmuller
On 2014/12/15 20:27:24, eseidel wrote: > What about array-like objects? NodeList for example? I'd rather ...
6 years ago (2014-12-15 21:54:09 UTC) #9
eseidel
Will post a patch to fix shortly.
6 years ago (2014-12-15 22:12:34 UTC) #10
eseidel
6 years ago (2014-12-15 23:53:34 UTC) #11
Message was sent while issue was closed.
Posted https://codereview.chromium.org/803173003/

Powered by Google App Engine
This is Rietveld 408576698