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

Issue 1297223004: ScriptValueSerializer should throw, not crash, when handling unknown types (Closed)

Created:
5 years, 4 months ago by adamk
Modified:
5 years, 4 months ago
Reviewers:
haraken, jsbell
CC:
blink-reviews, vivekg, blink-reviews-bindings_chromium.org, vivekg_samsung, tasak
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

ScriptValueSerializer should throw, not crash, when handling unknown types JavaScript Symbols are a new (in ES2015) primitive type. This caused ScriptValueSerializer to go off the rails when it had exhausted its known list of primitives and then assumed anything else might be an object. Now the code checks for Object-ness before assuming it. Also refactored the if/else-if cascade to group all Object handling together, and prune dead branches. BUG=522227 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200874

Patch Set 1 #

Total comments: 14

Patch Set 2 : Fix returns and tests #

Patch Set 3 : Fix build #

Patch Set 4 : Use nullptr #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -24 lines) Patch
M LayoutTests/fast/js/structured-clone.html View 1 2 chunks +11 lines, -2 lines 0 comments Download
M Source/bindings/core/v8/ScriptValueSerializer.cpp View 1 2 3 3 chunks +22 lines, -22 lines 0 comments Download

Messages

Total messages: 14 (5 generated)
adamk
5 years, 4 months ago (2015-08-18 22:53:18 UTC) #2
haraken
LGTM but I want to have jsbell confirm.
5 years, 4 months ago (2015-08-19 00:04:43 UTC) #3
jsbell
Ah, the advantage of reviewing *after* the try bots have their say. :) https://codereview.chromium.org/1297223004/diff/1/LayoutTests/fast/js/structured-clone.html File ...
5 years, 4 months ago (2015-08-19 01:24:11 UTC) #4
adamk
https://codereview.chromium.org/1297223004/diff/1/LayoutTests/fast/js/structured-clone.html File LayoutTests/fast/js/structured-clone.html (right): https://codereview.chromium.org/1297223004/diff/1/LayoutTests/fast/js/structured-clone.html#newcode211 LayoutTests/fast/js/structured-clone.html:211: }).catch(function(ex) { On 2015/08/19 01:24:11, jsbell wrote: > I ...
5 years, 4 months ago (2015-08-19 20:19:35 UTC) #5
jsbell
lgtm https://codereview.chromium.org/1297223004/diff/1/Source/bindings/core/v8/ScriptValueSerializer.cpp File Source/bindings/core/v8/ScriptValueSerializer.cpp (right): https://codereview.chromium.org/1297223004/diff/1/Source/bindings/core/v8/ScriptValueSerializer.cpp#newcode742 Source/bindings/core/v8/ScriptValueSerializer.cpp:742: m_writer.writeTransferredMessagePort(messagePortIndex); On 2015/08/19 20:19:34, adamk wrote: > It's ...
5 years, 4 months ago (2015-08-19 20:53:15 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1297223004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1297223004/60001
5 years, 4 months ago (2015-08-19 20:55:14 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/57876)
5 years, 4 months ago (2015-08-20 00:01:40 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1297223004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1297223004/60001
5 years, 4 months ago (2015-08-20 01:44:50 UTC) #13
commit-bot: I haz the power
5 years, 4 months ago (2015-08-20 03:08:24 UTC) #14
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=200874

Powered by Google App Engine
This is Rietveld 408576698