Bug 112262

Summary: [V8] Get rid of more function-level static FunctionTemplates and ObjectTemplates in bindings
Product: WebKit Reporter: Marja Hölttä <marja>
Component: New BugsAssignee: Marja Hölttä <marja>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, buildbot, dcarney, haraken, japhet, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 111724    
Attachments:
Description Flags
Patch none

Description Marja Hölttä 2013-03-13 08:41:10 PDT
Bug 111971 wasn't quite enough, there is more. :/

This will also make some tests pass even if we add the original (reverted) patch from bug 111724 (but not all, so more fixes are needed).
Comment 1 Marja Hölttä 2013-03-13 10:00:13 PDT
Created attachment 192940 [details]
Patch
Comment 2 Build Bot 2013-03-13 11:46:49 PDT
Comment on attachment 192940 [details]
Patch

Attachment 192940 [details] did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17134546

New failing tests:
fast/forms/range/slider-delete-while-dragging-thumb.html
Comment 3 jochen 2013-03-13 14:46:16 PDT
Comment on attachment 192940 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192940&action=review

> Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp:58
> +    static const char* shadowTemplateUniqueKey = "wrapInShadowObjectShadowTemplate";

why are you not just duplicating the static as in V8DOMWindow::GetShadowObjectTemplate?
Comment 4 Marja Hölttä 2013-03-13 14:54:01 PDT
Comment on attachment 192940 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192940&action=review

>> Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp:58
>> +    static const char* shadowTemplateUniqueKey = "wrapInShadowObjectShadowTemplate";
> 
> why are you not just duplicating the static as in V8DOMWindow::GetShadowObjectTemplate?

Because we have a mechanism for storing these kind of "private" FunctionTemplates (but not private ObjectTemplates). And this is (supposedly) more sane than having non-trivial statics inside funcs.
Comment 5 jochen 2013-03-13 15:25:36 PDT
Comment on attachment 192940 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192940&action=review

>>> Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp:58
>>> +    static const char* shadowTemplateUniqueKey = "wrapInShadowObjectShadowTemplate";
>> 
>> why are you not just duplicating the static as in V8DOMWindow::GetShadowObjectTemplate?
> 
> Because we have a mechanism for storing these kind of "private" FunctionTemplates (but not private ObjectTemplates). And this is (supposedly) more sane than having non-trivial statics inside funcs.

wouldn't it be more sane to introduce private object templates then?
Comment 6 Marja Hölttä 2013-03-13 15:34:12 PDT
Comment on attachment 192940 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192940&action=review

>>>> Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp:58
>>>> +    static const char* shadowTemplateUniqueKey = "wrapInShadowObjectShadowTemplate";
>>> 
>>> why are you not just duplicating the static as in V8DOMWindow::GetShadowObjectTemplate?
>> 
>> Because we have a mechanism for storing these kind of "private" FunctionTemplates (but not private ObjectTemplates). And this is (supposedly) more sane than having non-trivial statics inside funcs.
> 
> wouldn't it be more sane to introduce private object templates then?

For only this one case?
Comment 7 jochen 2013-03-13 15:43:13 PDT
Comment on attachment 192940 [details]
Patch

ok
Comment 8 WebKit Review Bot 2013-03-13 15:52:25 PDT
Comment on attachment 192940 [details]
Patch

Clearing flags on attachment: 192940

Committed r145765: <http://trac.webkit.org/changeset/145765>
Comment 9 WebKit Review Bot 2013-03-13 15:52:29 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Kentaro Hara 2013-03-13 17:19:30 PDT
Comment on attachment 192940 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192940&action=review

>>>>> Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp:58
>>>>> +    static const char* shadowTemplateUniqueKey = "wrapInShadowObjectShadowTemplate";
>>>> 
>>>> why are you not just duplicating the static as in V8DOMWindow::GetShadowObjectTemplate?
>>> 
>>> Because we have a mechanism for storing these kind of "private" FunctionTemplates (but not private ObjectTemplates). And this is (supposedly) more sane than having non-trivial statics inside funcs.
>> 
>> wouldn't it be more sane to introduce private object templates then?
> 
> For only this one case?

The way wrapInShadowObject() is called is very special and weird... I'm going to move the logic to V8HTMLDocument::wrap().