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

Issue 2529163002: Don't touch the prototype chain to get the private script controller. (Closed)

Created:
4 years ago by Mariusz Mlynski
Modified:
4 years ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't touch the prototype chain to get the private script controller. Prior to this patch, private scripts attempted to get the "privateScriptController" property off the global object without verifying if the property actually exists on the global. If the property hasn't been set yet, this operation could descend into the prototype chain and potentially return a named property from the WindowProperties object, leading to release asserts and general confusion. BUG=668552 Committed: https://crrev.com/c093b7a74ddce32dd3b0e0be60f31becc6ce32f9 Cr-Commit-Position: refs/heads/master@{#434627}

Patch Set 1 : Don't touch the prototype chain to get the private script controller. #

Patch Set 2 : Added test. #

Total comments: 3

Patch Set 3 : v8CallBoolean removed. #

Total comments: 3

Patch Set 4 : Use ToChecked(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -7 lines) Patch
A third_party/WebKit/LayoutTests/fast/dom/marquee-named-property-crash.html View 1 1 chunk +15 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/dom/marquee-named-property-crash-expected.txt View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp View 1 2 3 1 chunk +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.js View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 20 (8 generated)
haraken
LGTM, thanks for the fix!
4 years ago (2016-11-26 01:26:46 UTC) #3
Mariusz Mlynski
Thanks for the feedback! I've added the test.
4 years ago (2016-11-26 12:00:41 UTC) #5
haraken
On 2016/11/26 12:00:41, Mariusz Mlynski wrote: > Thanks for the feedback! I've added the test. ...
4 years ago (2016-11-26 12:06:29 UTC) #6
Yuki
https://codereview.chromium.org/2529163002/diff/20001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp File third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp (right): https://codereview.chromium.org/2529163002/diff/20001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp#newcode62 third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp:62: if (v8CallBoolean(global->HasOwnProperty(context, key))) { nit: v8CallBoolean is obsolete. Please ...
4 years ago (2016-11-28 05:13:34 UTC) #7
Mariusz Mlynski
https://codereview.chromium.org/2529163002/diff/20001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp File third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp (right): https://codereview.chromium.org/2529163002/diff/20001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp#newcode62 third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp:62: if (v8CallBoolean(global->HasOwnProperty(context, key))) { On 2016/11/28 05:13:34, Yuki wrote: ...
4 years ago (2016-11-28 07:51:44 UTC) #8
Yuki
LGTM. Thanks for finding and fixing the issue. https://codereview.chromium.org/2529163002/diff/20001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp File third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp (right): https://codereview.chromium.org/2529163002/diff/20001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp#newcode62 third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp:62: if ...
4 years ago (2016-11-28 08:01:29 UTC) #9
haraken
https://codereview.chromium.org/2529163002/diff/40001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp File third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp (right): https://codereview.chromium.org/2529163002/diff/40001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp#newcode62 third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp:62: if (global->HasOwnProperty(context, key).FromMaybe(false)) { On 2016/11/28 08:01:29, Yuki wrote: ...
4 years ago (2016-11-28 08:04:57 UTC) #10
Mariusz Mlynski
https://codereview.chromium.org/2529163002/diff/40001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp File third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp (right): https://codereview.chromium.org/2529163002/diff/40001/third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp#newcode62 third_party/WebKit/Source/bindings/core/v8/PrivateScriptRunner.cpp:62: if (global->HasOwnProperty(context, key).FromMaybe(false)) { On 2016/11/28 08:04:57, haraken wrote: ...
4 years ago (2016-11-28 08:18:20 UTC) #11
jochen (gone - plz use gerrit)
lgtm
4 years ago (2016-11-28 08:27:00 UTC) #12
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/2529163002/60001
4 years ago (2016-11-28 08:38:27 UTC) #15
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-11-28 10:18:30 UTC) #18
commit-bot: I haz the power
4 years ago (2016-11-28 10:20:43 UTC) #20
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/c093b7a74ddce32dd3b0e0be60f31becc6ce32f9
Cr-Commit-Position: refs/heads/master@{#434627}

Powered by Google App Engine
This is Rietveld 408576698