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

Issue 2809003004: bindings: Use ExceptionMessages when an interface/callback conversion fails. (Closed)

Created:
3 years, 8 months ago by Raphael Kubo da Costa (rakuco)
Modified:
3 years, 8 months ago
Reviewers:
haraken, Yuki, agrieve, jbroman, bashi
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chasej+watch_chromium.org, chromium-reviews, iclelland+watch_chromuim.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

bindings: Use ExceptionMessages when an interface/callback conversion fails. https://codereview.chromium.org/2802223002 ("bindings: Throw a type error if converting an interface or callback function fails") introduced a 32kb size regression on release Android builds (is_official_build=true), as the new error strings being thrown as type errors could not be shared and all made it into the .rodata section. Start using ExceptionMessages::FailedToConstruct() in the error messages. Not only do we use the existing error infrastructure, but it allows us to separate the part that always changes (the callback or interface name) from the actual details (the "Unable to convert value" bit). With commit 07c092298a6243fc2c829e517cf2b19f4caea26c ("Fetch: Make Headers' constructor match the current spec IDL") as a baseline, the following data can be observed with //tools/binary_size/map2size.py and console.py: * Reverting the changes from https://codereview.chromium.org/2802223002 versus this commit: Section Sizes (Total=-168 bytes): .bss: 0 bytes (not included in totals) .data: 0 bytes (-0.0%) .data.rel.ro: 0 bytes (-0.0%) .data.rel.ro.local: 0 bytes (-0.0%) .rodata: 256 bytes (-152.4%) .text: -424 bytes (252.4%) 0 symbols added (+), 27 changed (~), 3 removed (-), 313837 unchanged (not shown) Showing 30 symbols with total size: -160 bytes .text=-416 bytes .rodata=256 bytes other=0 bytes total=-160 bytes Number of object files: 28 * Commit b1bbca356abfa6f8fdec3cd5815f18b164491a45 versus this commit: Section Sizes (Total=-33,704 bytes): .bss: 0 bytes (not included in totals) .data: 0 bytes (-0.0%) .data.rel.ro: 0 bytes (-0.0%) .data.rel.ro.local: 0 bytes (-0.0%) .rodata: -33,280 bytes (98.7%) .text: -424 bytes (1.3%) 0 symbols added (+), 27 changed (~), 3 removed (-), 313837 unchanged (not shown) Showing 30 symbols with total size: -33696 bytes .text=-416 bytes .rodata=-32.5kb other=0 bytes total=-32.9kb Number of object files: 28 BUG=690428, 710035 R=agrieve@chromium.org,bashi@chromium.org,haraken@chromium.org,jbroman@chromium.org,yukishiino@chromium.org Review-Url: https://codereview.chromium.org/2809003004 Cr-Commit-Position: refs/heads/master@{#463753} Committed: https://chromium.googlesource.com/chromium/src/+/81c4e4ab9d81757ce3dcb49185be46c880f3f22a

Patch Set 1 #

Patch Set 2 : Fix test expectations #

Patch Set 3 : Add ExceptionMessages::FailedToConvertJSValue #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -92 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.cpp View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/StringSequenceCallbackFunctionLongSequenceArg.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBufferView.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8DataView.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestCallbackFunctions.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestConstants.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceOriginTrialEnabled.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceSecureContext.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunction.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionTypedef.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/VoidCallbackFunctionModules.cpp View 1 2 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (17 generated)
Raphael Kubo da Costa (rakuco)
PTAL
3 years, 8 months ago (2017-04-11 13:35:14 UTC) #1
Yuki
LGTM.
3 years, 8 months ago (2017-04-11 14:01:17 UTC) #6
haraken
LGTM
3 years, 8 months ago (2017-04-11 14:03:01 UTC) #7
agrieve
On 2017/04/11 14:03:01, haraken wrote: > LGTM lgtm thanks!
3 years, 8 months ago (2017-04-11 14:26:44 UTC) #10
jbroman
Approach looks good to me in general, but I'm not sure FailedToConstruct is a clear ...
3 years, 8 months ago (2017-04-11 14:34:31 UTC) #11
Raphael Kubo da Costa (rakuco)
On 2017/04/11 14:34:31, jbroman wrote: > Approach looks good to me in general, but I'm ...
3 years, 8 months ago (2017-04-11 16:04:14 UTC) #14
Raphael Kubo da Costa (rakuco)
Patch v3 is up with a new ExceptionMessage method. I've also updated the measurements in ...
3 years, 8 months ago (2017-04-11 16:26:13 UTC) #16
jbroman
lgtm
3 years, 8 months ago (2017-04-11 17:07:24 UTC) #19
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/2809003004/40001
3 years, 8 months ago (2017-04-11 20:05:04 UTC) #24
commit-bot: I haz the power
3 years, 8 months ago (2017-04-11 20:37:42 UTC) #27
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/81c4e4ab9d81757ce3dcb49185be...

Powered by Google App Engine
This is Rietveld 408576698