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

Issue 2647643002: Fix V8 bindings for named constructors to set prototype object correctly (Closed)

Created:
3 years, 11 months ago by sashab
Modified:
3 years, 9 months ago
Reviewers:
tkent, haraken, bashi, Yuki
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix V8 bindings for named constructors to set prototype object correctly Fix V8 bindings for named constructors to set prototype object correctly by explicitly setting the prototype of the object after constructing the Function. Also adds a V8PrivateProperty to store whether the prototype has been set, so that it is only set once per object. BUG=310776 Review-Url: https://codereview.chromium.org/2647643002 Cr-Commit-Position: refs/heads/master@{#455659} Committed: https://chromium.googlesource.com/chromium/src/+/a47c72562d1182fb1ee8c62cbc252f9965103d53

Patch Set 1 #

Total comments: 23

Patch Set 2 : Review feedback #

Total comments: 2

Patch Set 3 : Fixed failing test #

Total comments: 15

Patch Set 4 : Review feedback #

Total comments: 14

Patch Set 5 : Haraken review feedback #

Total comments: 11

Patch Set 6 : Review feedback #

Total comments: 7

Patch Set 7 : Fixed named constructor name #

Patch Set 8 : Rebase #

Patch Set 9 : Rebaselined tests #

Total comments: 7

Patch Set 10 : Review feedback and updated test #

Patch Set 11 : Test rebase fix #

Patch Set 12 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+354 lines, -19 lines) Patch
M third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/Image-constructor.html View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-img-element/Image-constructor-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -7 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +57 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +57 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +57 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_attributes.py View 1 2 3 4 5 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/scripts/v8_interface.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl View 1 2 3 4 5 1 chunk +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl View 1 2 3 4 5 6 7 8 9 10 1 chunk +30 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface.h.tmpl View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +31 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +31 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp View 1 2 3 4 5 6 7 8 9 10 3 chunks +32 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +31 lines, -1 line 0 comments Download

Messages

Total messages: 100 (51 generated)
sashab
PTAL :-)
3 years, 11 months ago (2017-01-19 08:16:56 UTC) #2
Yuki
Overall, looks great. Mostly nitpicks. https://codereview.chromium.org/2647643002/diff/1/third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html File third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html (right): https://codereview.chromium.org/2647643002/diff/1/third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html#newcode9 third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html:9: assert_not_equals(Image.prototype.__proto__, HTMLImageElement.prototype, "Image.prototype __proto__ ...
3 years, 11 months ago (2017-01-19 09:57:28 UTC) #6
bashi
Thank you for fixing this! lgtm on my side, but please wait for yukishiino@'s review. ...
3 years, 11 months ago (2017-01-19 09:58:01 UTC) #8
Yuki
https://codereview.chromium.org/2647643002/diff/1/third_party/WebKit/Source/bindings/scripts/v8_attributes.py File third_party/WebKit/Source/bindings/scripts/v8_attributes.py (right): https://codereview.chromium.org/2647643002/diff/1/third_party/WebKit/Source/bindings/scripts/v8_attributes.py#newcode576 third_party/WebKit/Source/bindings/scripts/v8_attributes.py:576: # FIXME: replace this with [NamedConstructor] extended attribute On ...
3 years, 11 months ago (2017-01-19 10:09:30 UTC) #11
sashab
Thanks for all your review feedback - yuki i just had one question, about a ...
3 years, 11 months ago (2017-01-20 04:37:06 UTC) #12
sashab
Tyvm! Fixed failing test. :)
3 years, 11 months ago (2017-01-20 05:26:49 UTC) #14
Yuki
Mostly l-g-t-m. https://codereview.chromium.org/2647643002/diff/40001/third_party/WebKit/Source/bindings/scripts/v8_interface.py File third_party/WebKit/Source/bindings/scripts/v8_interface.py (right): https://codereview.chromium.org/2647643002/diff/40001/third_party/WebKit/Source/bindings/scripts/v8_interface.py#newcode335 third_party/WebKit/Source/bindings/scripts/v8_interface.py:335: includes.add('bindings/core/v8/V8PrivateProperty.h') nit: You can do this only ...
3 years, 11 months ago (2017-01-20 05:54:42 UTC) #16
haraken
https://codereview.chromium.org/2647643002/diff/40001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/40001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode570 third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl:570: v8::Local<v8::Function> interface = perContextData->constructorForType(&{{v8_class}}::wrapperTypeInfo); Move this code into the ...
3 years, 11 months ago (2017-01-20 08:07:04 UTC) #20
Yuki
https://codereview.chromium.org/2647643002/diff/40001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/40001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode573 third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl:573: v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext(); On 2017/01/20 08:07:04, haraken wrote: ...
3 years, 11 months ago (2017-01-20 15:20:30 UTC) #21
sashab
Thanks everyone, responded to all your review feedback :) yuki -- if you could PTAL ...
3 years, 11 months ago (2017-01-25 02:34:51 UTC) #23
haraken
LGTM https://codereview.chromium.org/2647643002/diff/60001/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl File third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/60001/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl#newcode428 third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl:428: if attribute.needs_constructor_getter_callback else Can you clean up the ...
3 years, 11 months ago (2017-01-25 03:37:16 UTC) #24
sashab
Thanks haraken; I had a few questions so ptal :-) https://codereview.chromium.org/2647643002/diff/60001/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl File third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/60001/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl#newcode428 ...
3 years, 11 months ago (2017-01-25 04:54:15 UTC) #26
haraken
LGTM
3 years, 11 months ago (2017-01-25 05:54:28 UTC) #28
Yuki
I'm sorry that I was not clear on this point, but there are "current context" ...
3 years, 11 months ago (2017-01-26 07:08:53 UTC) #31
Yuki
https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode537 third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl:537: const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::trace, {{v8_class}}::traceWrappers, ...
3 years, 11 months ago (2017-01-26 07:42:26 UTC) #32
haraken
https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode573 third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl:573: v8::Local<v8::Value> privateValue = privateProperty.get(creationContext, namedConstructor); On 2017/01/26 07:08:53, Yuki ...
3 years, 11 months ago (2017-01-26 09:43:55 UTC) #33
Yuki
https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode573 third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl:573: v8::Local<v8::Value> privateValue = privateProperty.get(creationContext, namedConstructor); On 2017/01/26 09:43:55, haraken ...
3 years, 11 months ago (2017-01-26 10:07:11 UTC) #34
haraken
On 2017/01/26 10:07:11, Yuki wrote: > https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl > File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): > > https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode573 > ...
3 years, 11 months ago (2017-01-26 10:11:11 UTC) #35
sashab
Sorry for the silence - ptal haraken and yukishiino :) https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/80001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode537 ...
3 years, 10 months ago (2017-02-21 06:37:29 UTC) #36
Yuki
LGTM. https://codereview.chromium.org/2647643002/diff/100001/third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html File third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html (right): https://codereview.chromium.org/2647643002/diff/100001/third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html#newcode8 third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html:8: //assert_equals(Image.name, "Image", "Image name should be Image (not ...
3 years, 10 months ago (2017-02-21 06:57:36 UTC) #37
haraken
LGTM
3 years, 10 months ago (2017-02-21 09:53:54 UTC) #38
Yuki
https://codereview.chromium.org/2647643002/diff/100001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/100001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode554 third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl:554: result->SetClassName(v8AtomicString(isolate, "{{cpp_class}}")); You need to set the class name ...
3 years, 10 months ago (2017-02-23 06:26:10 UTC) #39
sashab
Thanks yukishiino; ptal. https://codereview.chromium.org/2647643002/diff/100001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl File third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl (right): https://codereview.chromium.org/2647643002/diff/100001/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl#newcode554 third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl:554: result->SetClassName(v8AtomicString(isolate, "{{cpp_class}}")); On 2017/02/23 at 06:26:10, ...
3 years, 10 months ago (2017-02-24 03:06:14 UTC) #40
sashab
Ping yukishiino :)
3 years, 9 months ago (2017-02-28 01:16:26 UTC) #41
bashi
yukishiino@ was ooo yesterday and he may be ooo today too. I think you can ...
3 years, 9 months ago (2017-02-28 01:22:31 UTC) #42
sashab
Thanks bashi! :)
3 years, 9 months ago (2017-02-28 01:24:04 UTC) #43
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/2647643002/140001
3 years, 9 months ago (2017-02-28 01:25:18 UTC) #49
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/390823)
3 years, 9 months ago (2017-02-28 03:20:54 UTC) #51
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/2647643002/140001
3 years, 9 months ago (2017-02-28 03:52:21 UTC) #53
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/390942)
3 years, 9 months ago (2017-02-28 05:30:25 UTC) #55
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/2647643002/140001
3 years, 9 months ago (2017-02-28 05:40:31 UTC) #57
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/398985)
3 years, 9 months ago (2017-02-28 06:58:13 UTC) #59
bashi
On 2017/02/28 06:58:13, commit-bot: I haz the power wrote: > Try jobs failed on following ...
3 years, 9 months ago (2017-02-28 07:04:22 UTC) #60
Yuki
On 2017/02/28 07:04:22, bashi wrote: > On 2017/02/28 06:58:13, commit-bot: I haz the power wrote: ...
3 years, 9 months ago (2017-03-01 06:58:50 UTC) #61
sashab
Thanks yukishiino; I rebaselined the test expectations. But now I have concerns about the results... ...
3 years, 9 months ago (2017-03-01 23:58:59 UTC) #64
bashi
https://codereview.chromium.org/2647643002/diff/160001/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt File third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt (right): https://codereview.chromium.org/2647643002/diff/160001/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt#newcode6 third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt:6: Constructor object isn't created. On 2017/03/01 23:58:59, sashab wrote: ...
3 years, 9 months ago (2017-03-02 00:21:52 UTC) #65
Yuki
LGTM. https://codereview.chromium.org/2647643002/diff/160001/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt File third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt (right): https://codereview.chromium.org/2647643002/diff/160001/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt#newcode3016 third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt:3016: attribute @@toStringTag On 2017/03/02 00:21:52, bashi wrote: > ...
3 years, 9 months ago (2017-03-02 05:30:16 UTC) #68
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/2647643002/160001
3 years, 9 months ago (2017-03-02 05:55:33 UTC) #71
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/376628)
3 years, 9 months ago (2017-03-02 06:04:04 UTC) #73
sashab
Hmm: ** Presubmit ERRORS ** Missing LGTM from an OWNER for these files: third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt Missing ...
3 years, 9 months ago (2017-03-02 06:16:20 UTC) #74
sof
On 2017/03/02 06:16:20, sashab wrote: > Hmm: > > ** Presubmit ERRORS ** > Missing ...
3 years, 9 months ago (2017-03-02 06:19:41 UTC) #75
sashab
tkent RS please on virtual/stable/* :)
3 years, 9 months ago (2017-03-02 06:21:37 UTC) #77
tkent
This CL needs to update LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt too. https://codereview.chromium.org/2647643002/diff/160001/third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html File third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html (right): https://codereview.chromium.org/2647643002/diff/160001/third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html#newcode1 third_party/WebKit/LayoutTests/fast/dom/named-constructor-prototype-chain.html:1: Please do ...
3 years, 9 months ago (2017-03-02 06:32:30 UTC) #78
sashab
Thanks tkent; did both those things. :)
3 years, 9 months ago (2017-03-08 03:26:56 UTC) #85
tkent
lgtm
3 years, 9 months ago (2017-03-08 03:38:17 UTC) #89
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/2647643002/200001
3 years, 9 months ago (2017-03-08 03:39:16 UTC) #92
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/379001)
3 years, 9 months ago (2017-03-08 04:11:17 UTC) #94
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/2647643002/220001
3 years, 9 months ago (2017-03-09 01:06:07 UTC) #97
commit-bot: I haz the power
3 years, 9 months ago (2017-03-09 04:00:43 UTC) #100
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/a47c72562d1182fb1ee8c62cbc25...

Powered by Google App Engine
This is Rietveld 408576698