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

Issue 114363002: Structured cloning: improve DataCloneError reporting. (Closed)

Created:
7 years ago by sof
Modified:
7 years ago
CC:
blink-reviews, Nils Barth (inactive), kojih, arv+blink, jsbell+bindings_chromium.org, eae+blinkwatch, abarth-chromium, kinuko, marja+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, haraken, Nate Chapin, watchdog-blink-watchlist_google.com, Inactive
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Structured cloning: improve DataCloneError reporting. The spec tells us that cloning of neutered objects should throw DataCloneError: http://www.whatwg.org/specs/web-apps/current-work/#safe-passing-of-structured-data And if an attempt, like in the above, to re-transfer a neutered object is made, DataCloneError should also be thrown: http://www.whatwg.org/specs/web-apps/current-work/#dom-window-postmessage http://www.whatwg.org/specs/web-apps/current-work/#dom-messageport-postmessage The implementation used InvalidStateError instead. Switch to throwing DataCloneError in SerializedScriptValue, both during the handling of transferables and the actual cloning step. Hand in hand with that switch away from the older InvalidStateError, improve the quality of the error messages that go with the failed cloning operations. i.e., * SerializedScriptValue::create() now takes an ExceptionState for reporting exceptions. This allows context (e.g., what postMessage() that is attempting to clone) to be included in the error message. (As a result, removed the old method for signalling errors via a bool reference.) * Rephrase the unmarshalling/extraction of transferable arrays to also be reported over an incoming ExceptionState. * Make the error messages emitted by MessagePort.postMessage() a little bit more consistent. R=mkwst@chromium.org,dslomov@chromium.org BUG=327994 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164106

Patch Set 1 #

Total comments: 3

Patch Set 2 : Remove 'didThrow' support altogether #

Patch Set 3 : Update 'storage' expected outputs #

Patch Set 4 : Rebased + reset V8TestInterfaceConstructor.cpp result #

Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -227 lines) Patch
M LayoutTests/fast/canvas/webgl/script-tests/arraybuffer-transfer-of-control.js View 3 chunks +10 lines, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js View 1 chunk +6 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/script-tests/postmessage-test.js View 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/Window/window-postmessage-args.html View 2 chunks +6 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt View 1 1 chunk +6 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt View 1 2 chunks +7 lines, -3 lines 0 comments Download
M LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/events/message-port-clone.html View 1 2 chunks +20 lines, -3 lines 0 comments Download
M LayoutTests/fast/events/message-port-clone-expected.txt View 1 1 chunk +8 lines, -3 lines 0 comments Download
M LayoutTests/fast/events/message-port-multi-expected.txt View 2 chunks +10 lines, -10 lines 0 comments Download
M LayoutTests/fast/events/resources/message-port-multi.js View 1 chunk +6 lines, -6 lines 0 comments Download
M LayoutTests/fast/filesystem/filesystem-unserializable-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/workers/worker-context-multi-port-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/fast/workers/worker-multi-port-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/http/tests/loading/state-object-security-exception-expected.txt View 1 chunk +12 lines, -12 lines 0 comments Download
M LayoutTests/storage/indexeddb/clone-exception-expected.txt View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/storage/indexeddb/exceptions-expected.txt View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/storage/indexeddb/objectstore-basics-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/storage/indexeddb/structured-clone-expected.txt View 1 2 1 chunk +5 lines, -5 lines 0 comments Download
M Source/bindings/scripts/code_generator_v8.pm View 1 2 3 17 chunks +58 lines, -18 lines 0 comments Download
M Source/bindings/tests/results/V8SupportTestInterface.cpp View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M Source/bindings/tests/results/V8TestInterface.cpp View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterfaceConstructor.cpp View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 3 6 chunks +12 lines, -9 lines 0 comments Download
M Source/bindings/tests/results/V8TestObjectPython.cpp View 1 2 3 2 chunks +6 lines, -5 lines 0 comments Download
M Source/bindings/v8/ExceptionState.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M Source/bindings/v8/SerializedScriptValue.h View 1 2 3 3 chunks +5 lines, -8 lines 0 comments Download
M Source/bindings/v8/SerializedScriptValue.cpp View 1 2 3 20 chunks +39 lines, -59 lines 0 comments Download
M Source/bindings/v8/V8Utilities.h View 2 chunks +3 lines, -4 lines 0 comments Download
M Source/bindings/v8/V8Utilities.cpp View 4 chunks +5 lines, -5 lines 0 comments Download
M Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp View 1 chunk +6 lines, -8 lines 0 comments Download
M Source/bindings/v8/custom/V8HistoryCustom.cpp View 2 chunks +6 lines, -8 lines 0 comments Download
M Source/bindings/v8/custom/V8MessagePortCustom.cpp View 1 chunk +4 lines, -9 lines 0 comments Download
M Source/bindings/v8/custom/V8WindowCustom.cpp View 1 2 3 2 chunks +5 lines, -9 lines 0 comments Download
M Source/bindings/v8/custom/V8WorkerCustom.cpp View 1 chunk +4 lines, -9 lines 0 comments Download
M Source/core/dom/MessagePort.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/indexeddb/IDBObjectStore.cpp View 1 2 3 1 chunk +2 lines, -4 lines 0 comments Download
M Source/web/WebSerializedScriptValue.cpp View 1 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
sof
Please take a look when you next have a moment to spare. dslomov: would appreciate ...
7 years ago (2013-12-12 21:30:38 UTC) #1
Mike West
This looks pretty reasonable to me, with the exception of the single question below: LGTM ...
7 years ago (2013-12-13 21:22:58 UTC) #2
sof
https://codereview.chromium.org/114363002/diff/1/Source/bindings/v8/ExceptionState.h File Source/bindings/v8/ExceptionState.h (right): https://codereview.chromium.org/114363002/diff/1/Source/bindings/v8/ExceptionState.h#newcode109 Source/bindings/v8/ExceptionState.h:109: void setException(v8::Handle<v8::Value>); On 2013/12/13 21:22:59, Mike West wrote: > ...
7 years ago (2013-12-13 21:51:32 UTC) #3
Dmitry Lomov (no reviews)
I like the direction where it is going, but I think it does not go ...
7 years ago (2013-12-16 09:14:38 UTC) #4
jsbell
Drive-by comment: Over in Source/modules/indexeddb/IDBObjectStore.cpp:170 there's a comment: // FIXME: Make SerializedScriptValue::create etc take an ...
7 years ago (2013-12-16 17:00:28 UTC) #5
sof
On 2013/12/16 17:00:28, jsbell wrote: > Drive-by comment: > > Over in Source/modules/indexeddb/IDBObjectStore.cpp:170 there's a ...
7 years ago (2013-12-16 17:24:53 UTC) #6
jsbell
On 2013/12/16 17:24:53, sof wrote: > I'll have a closer look if it can be ...
7 years ago (2013-12-16 18:16:32 UTC) #7
sof
On 2013/12/16 09:14:38, Dmitry Lomov (chromium) wrote: > I like the direction where it is ...
7 years ago (2013-12-17 13:41:31 UTC) #8
Dmitry Lomov (no reviews)
Great work. LGTM. On 2013/12/17 13:41:31, sof wrote: > On 2013/12/16 09:14:38, Dmitry Lomov (chromium) ...
7 years ago (2013-12-17 15:24:55 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/114363002/40001
7 years ago (2013-12-17 15:31:22 UTC) #10
commit-bot: I haz the power
Retried try job too often on blink_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_presubmit&number=13001
7 years ago (2013-12-17 15:51:43 UTC) #11
sof
Rebased + reset one bindings/ test result (brought about by meeting code_generator_v8.pm improvements from 783e6c8ddd ...
7 years ago (2013-12-17 16:48:42 UTC) #12
sof
+jsbell, +jochen Two call sites that had to be adjusted needs approval, could you have ...
7 years ago (2013-12-18 07:10:07 UTC) #13
jochen (gone - plz use gerrit)
lgtm
7 years ago (2013-12-18 08:01:32 UTC) #14
jsbell
Source/modules/indexeddb change LGTM
7 years ago (2013-12-18 16:49:30 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/114363002/60001
7 years ago (2013-12-18 16:52:56 UTC) #16
commit-bot: I haz the power
7 years ago (2013-12-18 18:09:59 UTC) #17
Message was sent while issue was closed.
Change committed as 164106

Powered by Google App Engine
This is Rietveld 408576698