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

Issue 2452073002: Freeze global prototype chain per WebIDL (Closed)

Created:
4 years, 1 month ago by Dan Ehrenberg
Modified:
4 years, 1 month ago
Reviewers:
haraken, domenic, adamk, Yuki
CC:
adamk, blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Freeze global prototype chain per WebIDL There are three places where WebIDL freezes the global object prototype chain: - Named properties objects have an immutable prototype - Prototypes of interfaces declared with [Global] or [PrimaryGlobal], and classes which are inherited from by those. For the latter, this patch introduces an [ImmutablePrototype] synthetic extended attribute. - Instances of [Global] or [PrimaryGlobal] This patch causes all three types of objects to be immutable prototype exotic objects. A number of tests previously checked what behavior occurs when the prototype chain of the global object is mutated. This patch changes the tests to just check that the prototype chain of the global object is immutable; tests which check what happens after mutating are deleted as the path is unreachable. BUG=v8:5149 Committed: https://crrev.com/c65700010f3c557867e23b24373499170959f845 Cr-Commit-Position: refs/heads/master@{#431204}

Patch Set 1 #

Patch Set 2 : A fix and a test which crashes #

Patch Set 3 : Fix up tests; remove instance freezing #

Patch Set 4 : Fix up test #

Patch Set 5 : Make it work for all global objects #

Patch Set 6 : Also freeze named properties objects #

Total comments: 4

Patch Set 7 : Improve tests #

Patch Set 8 : Improve one of the links #

Patch Set 9 : Fix another worker global scope link #

Patch Set 10 : Test for SharedWorkers #

Patch Set 11 : Full good test results together with a V8 change #

Patch Set 12 : serviceworker test, undo an unnecessary IDL change, and only freeze instances of global objects #

Total comments: 1

Patch Set 13 : Freeze worklet global scope too #

Total comments: 2

Patch Set 14 : Remove paint worklet tests #

Patch Set 15 : Fix failing tests #

Patch Set 16 : Removing outdated tests #

Total comments: 4

Patch Set 17 : Remove useless test #

Total comments: 7

Patch Set 18 : Test improvements #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -214 lines) Patch
M third_party/WebKit/LayoutTests/fast/dom/Window/lookup-behavior.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +6 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/window-custom-prototype.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +10 lines, -8 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -10 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +9 lines, -8 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/resources/doc-with-iframe.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -5 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/resources/iframe-with-element.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -1 line 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-htmlelelment-with-iframe-proto.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -23 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-htmlelelment-with-iframe-proto-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -4 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -38 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -14 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-non-shadowable-propterty-with-iframe-proto.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -26 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-non-shadowable-propterty-with-iframe-proto-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -5 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-regular-propterty-with-iframe-proto.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -26 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-DENIED-regular-propterty-with-iframe-proto-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -5 lines 0 comments Download
D third_party/WebKit/LayoutTests/http/tests/security/xss-getownproperty.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -35 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/immutable-prototype-serviceworker.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +23 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/immutable-prototype-serviceworker.js View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +19 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/security/immutable-prototype.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +15 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/security/immutable-prototype.js View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/security/immutable-prototype-sharedworker.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +18 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/security/immutable-prototype-worker.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/security/immutable-prototype-worker.js View 1 2 3 4 5 6 7 8 9 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_interface.py View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/EventTarget.idl View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkletGlobalScope.idl View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 60 (27 generated)
Dan Ehrenberg
4 years, 1 month ago (2016-10-26 20:40:02 UTC) #4
domenic
> From my read, this means that objects like Window.prototype, EventTarget.prototype and SharedWorkerGlobalScope.prototype need to ...
4 years, 1 month ago (2016-10-26 20:46:32 UTC) #5
Dan Ehrenberg
On 2016/10/26 at 20:46:32, domenic wrote: > > From my read, this means that objects ...
4 years, 1 month ago (2016-10-26 20:53:10 UTC) #6
haraken
https://codereview.chromium.org/2452073002/diff/100001/third_party/WebKit/Source/bindings/scripts/v8_interface.py File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/2452073002/diff/100001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode204 third_party/WebKit/Source/bindings/scripts/v8_interface.py:204: is_immutable_prototype = is_global or 'ImmutablePrototype' in extended_attributes Why is ...
4 years, 1 month ago (2016-10-27 08:47:06 UTC) #8
Dan Ehrenberg
https://codereview.chromium.org/2452073002/diff/100001/third_party/WebKit/Source/bindings/scripts/v8_interface.py File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/2452073002/diff/100001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode204 third_party/WebKit/Source/bindings/scripts/v8_interface.py:204: is_immutable_prototype = is_global or 'ImmutablePrototype' in extended_attributes On 2016/10/27 ...
4 years, 1 month ago (2016-10-27 09:03:45 UTC) #9
Yuki
lgtm with domenic@'s comments.
4 years, 1 month ago (2016-10-27 09:45:54 UTC) #11
Dan Ehrenberg
I changed the tests per comments (demonstrating further remaining issues); PTAL
4 years, 1 month ago (2016-11-03 19:02:57 UTC) #12
domenic
On 2016/11/03 at 19:02:57, littledan wrote: > I changed the tests per comments (demonstrating further ...
4 years, 1 month ago (2016-11-03 19:13:04 UTC) #13
Dan Ehrenberg
The new version of this patch actually makes the whole chain immutable, once the V8 ...
4 years, 1 month ago (2016-11-04 00:50:10 UTC) #15
haraken
https://codereview.chromium.org/2452073002/diff/220001/third_party/WebKit/Source/bindings/scripts/v8_interface.py File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/2452073002/diff/220001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode204 third_party/WebKit/Source/bindings/scripts/v8_interface.py:204: is_immutable_prototype = is_global or 'ImmutablePrototype' in extended_attributes Won't this ...
4 years, 1 month ago (2016-11-04 00:57:08 UTC) #16
domenic
On 2016/11/04 at 00:57:08, haraken wrote: > https://codereview.chromium.org/2452073002/diff/220001/third_party/WebKit/Source/bindings/scripts/v8_interface.py > File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): > > https://codereview.chromium.org/2452073002/diff/220001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode204 ...
4 years, 1 month ago (2016-11-04 01:14:27 UTC) #17
Dan Ehrenberg
On 2016/11/04 at 01:14:27, domenic wrote: > On 2016/11/04 at 00:57:08, haraken wrote: > > ...
4 years, 1 month ago (2016-11-04 01:23:52 UTC) #18
haraken
On 2016/11/04 01:23:52, Dan Ehrenberg wrote: > On 2016/11/04 at 01:14:27, domenic wrote: > > ...
4 years, 1 month ago (2016-11-04 01:28:28 UTC) #19
domenic
On 2016/11/04 at 01:28:28, haraken wrote: > On 2016/11/04 01:23:52, Dan Ehrenberg wrote: > > ...
4 years, 1 month ago (2016-11-04 02:20:20 UTC) #20
haraken
On 2016/11/04 02:20:20, domenic wrote: > On 2016/11/04 at 01:28:28, haraken wrote: > > On ...
4 years, 1 month ago (2016-11-04 02:27:20 UTC) #21
haraken
LGTM https://codereview.chromium.org/2452073002/diff/240001/third_party/WebKit/Source/bindings/scripts/v8_interface.py File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/2452073002/diff/240001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode203 third_party/WebKit/Source/bindings/scripts/v8_interface.py:203: # as in the WebIDL spec? Then this ...
4 years, 1 month ago (2016-11-04 02:28:57 UTC) #22
Dan Ehrenberg
https://codereview.chromium.org/2452073002/diff/240001/third_party/WebKit/Source/bindings/scripts/v8_interface.py File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/2452073002/diff/240001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode203 third_party/WebKit/Source/bindings/scripts/v8_interface.py:203: # as in the WebIDL spec? On 2016/11/04 at ...
4 years, 1 month ago (2016-11-04 16:04:57 UTC) #23
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/2452073002/260001
4 years, 1 month ago (2016-11-05 02:55:15 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/329705)
4 years, 1 month ago (2016-11-05 04:06:59 UTC) #34
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/2452073002/260001
4 years, 1 month ago (2016-11-07 20:19:11 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/327065)
4 years, 1 month ago (2016-11-07 21:51:40 UTC) #38
adamk
Looks like some actual test failures? E.g., https://storage.googleapis.com/chromium-layout-test-archives/linux_chromium_rel_ng/331860/layout-test-results/fast/dom/Window/lookup-behavior-actual.txt: This is a testharness.js-based test. PASS Named ...
4 years, 1 month ago (2016-11-07 22:09:05 UTC) #40
Dan Ehrenberg
Changed some tests, PTAL
4 years, 1 month ago (2016-11-09 01:01:14 UTC) #43
adamk
https://codereview.chromium.org/2452073002/diff/300001/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html File third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html (right): https://codereview.chromium.org/2452073002/diff/300001/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html#newcode10 third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html:10: If this did crash the test has succeeded. This ...
4 years, 1 month ago (2016-11-09 01:08:50 UTC) #45
Dan Ehrenberg
https://codereview.chromium.org/2452073002/diff/300001/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html File third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html (right): https://codereview.chromium.org/2452073002/diff/300001/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html#newcode10 third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-crash.html:10: If this did crash the test has succeeded. On ...
4 years, 1 month ago (2016-11-09 01:12:32 UTC) #48
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/2452073002/320001
4 years, 1 month ago (2016-11-09 01:12:52 UTC) #49
adamk
lgtm, but I'd like yukishiino to take a last look at this (particularly make sure ...
4 years, 1 month ago (2016-11-09 01:15:42 UTC) #51
Yuki
LGTM. I'm fine with deleting these tests. https://codereview.chromium.org/2452073002/diff/320001/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt File third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt (left): https://codereview.chromium.org/2452073002/diff/320001/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt#oldcode6 third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt:6: PASS __proto__ ...
4 years, 1 month ago (2016-11-09 07:06:44 UTC) #52
Dan Ehrenberg
Made the cleanups suggested; I'd like a quick review of the new test. https://codereview.chromium.org/2452073002/diff/320001/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt File ...
4 years, 1 month ago (2016-11-09 23:51:12 UTC) #53
Yuki
LGTM. Thanks for adding a test.
4 years, 1 month ago (2016-11-10 06:19:40 UTC) #54
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/2452073002/340001
4 years, 1 month ago (2016-11-10 06:20:04 UTC) #57
commit-bot: I haz the power
Committed patchset #18 (id:340001)
4 years, 1 month ago (2016-11-10 07:47:27 UTC) #58
commit-bot: I haz the power
4 years, 1 month ago (2016-11-10 07:49:37 UTC) #60
Message was sent while issue was closed.
Patchset 18 (id:??) landed as
https://crrev.com/c65700010f3c557867e23b24373499170959f845
Cr-Commit-Position: refs/heads/master@{#431204}

Powered by Google App Engine
This is Rietveld 408576698