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

Issue 16708002: Simplify Custom Element constructors to be functions, not wrappers (Closed)

Created:
7 years, 6 months ago by dominicc (has gone to gerrit)
Modified:
7 years, 6 months ago
CC:
blink-reviews, jsbell+bindings_chromium.org, webcomponents-bugzilla_chromium.org, eae+blinkwatch, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, dominicc+watchlist_chromium.org, adamk+blink_chromium.org, Nate Chapin
Visibility:
Public.

Description

Simplify Custom Element constructors to be functions, not wrappers Custom Element constructors are returned to script and not used by the bindings again. It is not necessary for them to be full-blown wrapped objects. BUG=234509 R=haraken@chromium.org, morrita@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=152430

Patch Set 1 #

Patch Set 2 : Uses WebIDL callback function #

Patch Set 3 : Fix callback functions as parameters #

Total comments: 2

Patch Set 4 : Address morrita1's first round of feedback #

Total comments: 24

Patch Set 5 : Address more feedback. #

Patch Set 6 : Handle empty constructors. #

Patch Set 7 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+216 lines, -497 lines) Patch
M Source/bindings/bindings.gypi View 1 2 3 4 5 6 2 chunks +0 lines, -3 lines 0 comments Download
M Source/bindings/scripts/CodeGeneratorV8.pm View 1 2 3 4 5 6 16 chunks +24 lines, -19 lines 0 comments Download
M Source/bindings/scripts/IDLAttributes.txt View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M Source/bindings/scripts/IDLParser.pm View 1 2 3 4 5 6 4 chunks +19 lines, -7 lines 0 comments Download
M Source/bindings/tests/idls/TestObject.idl View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 3 4 5 6 5 chunks +60 lines, -1 line 0 comments Download
M Source/bindings/v8/CustomElementHelpers.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M Source/bindings/v8/CustomElementHelpers.cpp View 1 2 3 4 5 6 2 chunks +77 lines, -21 lines 0 comments Download
D Source/bindings/v8/V8AdaptorFunction.h View 1 1 chunk +0 lines, -79 lines 0 comments Download
D Source/bindings/v8/V8AdaptorFunction.cpp View 1 1 chunk +0 lines, -89 lines 0 comments Download
M Source/bindings/v8/V8DOMWrapper.h View 1 1 chunk +0 lines, -5 lines 0 comments Download
M Source/bindings/v8/V8DOMWrapper.cpp View 1 2 chunks +0 lines, -18 lines 0 comments Download
M Source/bindings/v8/V8HiddenPropertyName.h View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
D Source/bindings/v8/custom/V8CustomElementConstructorCustom.cpp View 1 chunk +0 lines, -65 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 2 chunks +0 lines, -3 lines 0 comments Download
D Source/core/dom/CustomElementConstructor.h View 1 chunk +0 lines, -64 lines 0 comments Download
D Source/core/dom/CustomElementConstructor.cpp View 1 chunk +0 lines, -67 lines 0 comments Download
D Source/core/dom/CustomElementConstructor.idl View 1 chunk +0 lines, -31 lines 0 comments Download
M Source/core/dom/CustomElementRegistry.h View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/CustomElementRegistry.cpp View 1 2 3 4 5 6 4 chunks +13 lines, -12 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 2 chunks +3 lines, -4 lines 0 comments Download
M Source/core/dom/Document.idl View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
dominicc (has gone to gerrit)
This is a WIP but if you have preliminary feedback I welcome it. I think ...
7 years, 6 months ago (2013-06-09 23:33:54 UTC) #1
haraken
Here are just rough comments: > I understand now why ScriptValue is hated so--RefPtr SharedPersistent! ...
7 years, 6 months ago (2013-06-10 01:18:19 UTC) #2
dominicc (has gone to gerrit)
PTAL
7 years, 6 months ago (2013-06-10 03:26:47 UTC) #3
dominicc (has gone to gerrit)
PTAL
7 years, 6 months ago (2013-06-10 03:32:02 UTC) #4
dominicc (has gone to gerrit)
On 2013/06/10 01:18:19, haraken wrote: > BTW, why do you need to make the return ...
7 years, 6 months ago (2013-06-10 03:37:22 UTC) #5
Hajime Morrita
We can close https://code.google.com/p/chromium/issues/detail?id=234501 once this CL is in.
7 years, 6 months ago (2013-06-10 04:25:19 UTC) #6
Hajime Morrita
https://codereview.chromium.org/16708002/diff/7001/Source/bindings/v8/CustomElementHelpers.cpp File Source/bindings/v8/CustomElementHelpers.cpp (right): https://codereview.chromium.org/16708002/diff/7001/Source/bindings/v8/CustomElementHelpers.cpp#newcode123 Source/bindings/v8/CustomElementHelpers.cpp:123: void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>& args) Nit: can be static. https://codereview.chromium.org/16708002/diff/7001/Source/core/dom/CustomElementRegistry.cpp ...
7 years, 6 months ago (2013-06-10 04:32:21 UTC) #7
Hajime Morrita
lgtm other than these nits.
7 years, 6 months ago (2013-06-10 04:44:21 UTC) #8
dominicc (has gone to gerrit)
Thanks for the review. createConstructor fails in document-register-reentrant-throwing-constructor. I have made this an early return ...
7 years, 6 months ago (2013-06-10 04:45:29 UTC) #9
haraken
This is great improvement! Now we have 'callback' in the Web IDL spec! https://codereview.chromium.org/16708002/diff/16001/Source/bindings/scripts/CodeGeneratorV8.pm File ...
7 years, 6 months ago (2013-06-10 09:11:02 UTC) #10
abarth-chromium
https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp File Source/bindings/v8/CustomElementHelpers.cpp (right): https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp#newcode138 Source/bindings/v8/CustomElementHelpers.cpp:138: V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, args.Callee()->GetHiddenValue(v8String("namespaceURI", isolate))); Please use V8HiddenPropertyNames rather than ...
7 years, 6 months ago (2013-06-10 17:42:18 UTC) #11
dominicc (has gone to gerrit)
On 2013/06/10 17:42:18, abarth wrote: > https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp > File Source/bindings/v8/CustomElementHelpers.cpp (right): > > https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp#newcode138 > ...
7 years, 6 months ago (2013-06-11 01:28:20 UTC) #12
dominicc (has gone to gerrit)
Thanks for the detailed feedback. Some comments inline. Not otherwise noted => done. https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp File ...
7 years, 6 months ago (2013-06-11 01:29:02 UTC) #13
haraken
https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp File Source/bindings/v8/CustomElementHelpers.cpp (right): https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp#newcode171 Source/bindings/v8/CustomElementHelpers.cpp:171: constructor->SetName(v8Name); On 2013/06/11 01:29:02, dominicc wrote: > On 2013/06/10 ...
7 years, 6 months ago (2013-06-11 01:39:20 UTC) #14
dominicc (has gone to gerrit)
https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp File Source/bindings/v8/CustomElementHelpers.cpp (right): https://codereview.chromium.org/16708002/diff/16001/Source/bindings/v8/CustomElementHelpers.cpp#newcode171 Source/bindings/v8/CustomElementHelpers.cpp:171: constructor->SetName(v8Name); On 2013/06/11 01:39:21, haraken wrote: > On 2013/06/11 ...
7 years, 6 months ago (2013-06-11 02:41:33 UTC) #15
haraken
LGTM
7 years, 6 months ago (2013-06-14 08:08:40 UTC) #16
dominicc (has gone to gerrit)
7 years, 6 months ago (2013-06-14 08:17:23 UTC) #17
Message was sent while issue was closed.
Committed patchset #7 manually as r152430 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698