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

Issue 87963002: Improve Crypto::getRandomValues exception messages. (Closed)

Created:
7 years ago by Mike West
Modified:
7 years ago
CC:
blink-reviews, Nils Barth (inactive), kojih, arv+blink, jsbell+bindings_chromium.org, yurys+blink_chromium.org, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, loislo+blink_chromium.org, Nate Chapin, Inactive
Visibility:
Public.

Description

Improve Crypto::getRandomValues exception messages. This CL improves the detail available in the Crypto::getRandomValues exceptions generated when the array is either too long, nonexistent, or incorrectly typed. The interesting bit of the CL is, however, not the new error message, but the mechanism by which it's generated. ExceptionState may now have some additional context passed in via the constructor, which allows us to generate the boilerplate bits of the exception message ("Failed to execute XXX on YYY:") inside ExceptionState rather than out in the calling code. This isn't a huge deal for Crypto, but it will substantially reduce the duplication we're currently forcing developers into when throwing detailed exceptions, as we'll be able to set these values once and only once (eventually in the generated bindings) rather than for each exception individually. BUG=270033 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162761

Patch Set 1 #

Total comments: 2

Patch Set 2 : Compile. #

Patch Set 3 : Names. #

Patch Set 4 : DEBUG. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -13 lines) Patch
M LayoutTests/crypto/random-values-limits-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/crypto/random-values-types-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/crypto/worker-random-values-limits-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/crypto/worker-random-values-types-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/bindings/v8/ExceptionState.h View 1 2 3 2 chunks +35 lines, -0 lines 0 comments Download
M Source/bindings/v8/ExceptionState.cpp View 1 2 2 chunks +16 lines, -1 line 0 comments Download
M Source/bindings/v8/custom/V8CryptoCustom.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/crypto/Crypto.cpp View 1 chunk +7 lines, -3 lines 0 comments Download
M Source/wtf/ArrayBufferView.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/wtf/ArrayBufferView.cpp View 1 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Mike West
Jochen, Kentaro-san, mind taking a look at this? I think it's an improvement on the ...
7 years ago (2013-11-26 10:21:27 UTC) #1
haraken
https://codereview.chromium.org/87963002/diff/1/Source/bindings/v8/ExceptionState.h File Source/bindings/v8/ExceptionState.h (right): https://codereview.chromium.org/87963002/diff/1/Source/bindings/v8/ExceptionState.h#newcode113 Source/bindings/v8/ExceptionState.h:113: const char* m_interface; Don't you want to use String ...
7 years ago (2013-11-26 10:49:36 UTC) #2
Mike West
Thanks for taking a look! https://codereview.chromium.org/87963002/diff/1/Source/bindings/v8/ExceptionState.h File Source/bindings/v8/ExceptionState.h (right): https://codereview.chromium.org/87963002/diff/1/Source/bindings/v8/ExceptionState.h#newcode113 Source/bindings/v8/ExceptionState.h:113: const char* m_interface; On ...
7 years ago (2013-11-26 10:53:26 UTC) #3
haraken
> > Don't you want to use String instead of char*? > > I don't ...
7 years ago (2013-11-26 11:14:27 UTC) #4
Mike West
+arv, now that I think about it. :) WDYT about this approach?
7 years ago (2013-11-26 12:22:01 UTC) #5
jochen (gone - plz use gerrit)
lgtm
7 years ago (2013-11-27 11:50:28 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkwst@chromium.org/87963002/50001
7 years ago (2013-11-27 12:01:01 UTC) #7
commit-bot: I haz the power
Retried try job too often on linux_blink for step(s) blink_platform_unittests, webkit_lint, webkit_python_tests, webkit_tests, webkit_unit_tests, wtf_unittests ...
7 years ago (2013-11-27 12:32:48 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkwst@chromium.org/87963002/70001
7 years ago (2013-11-27 12:52:13 UTC) #9
commit-bot: I haz the power
Failed to trigger a try job on win_layout HTTP Error 400: Bad Request
7 years ago (2013-11-27 12:59:04 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkwst@chromium.org/87963002/80001
7 years ago (2013-11-27 12:59:10 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkwst@chromium.org/87963002/100001
7 years ago (2013-11-27 13:23:06 UTC) #12
commit-bot: I haz the power
Change committed as 162761
7 years ago (2013-11-27 14:17:11 UTC) #13
arv (Not doing code reviews)
Did this have any performance implications? I intentionally kept ExceptionState as small as possible because ...
7 years ago (2013-11-27 15:22:49 UTC) #14
Mike West
On 2013/11/27 15:22:49, arv wrote: > Did this have any performance implications? I intentionally kept ...
7 years ago (2013-11-27 15:26:20 UTC) #15
arv (Not doing code reviews)
7 years ago (2013-11-27 15:26:25 UTC) #16
Message was sent while issue was closed.
LGTM. I like this approach. Lets hope Dromaeo does not go bonkers.

Powered by Google App Engine
This is Rietveld 408576698