Bug 130553

Summary: Change CodeGeneratorJS.pm special cases for "DOMWindow" to be general purpose
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, cgarcia, commit-queue, esprehn+autocc, kondapallykalyan
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 130554    
Attachments:
Description Flags
Patch ggaren: review+

Michael Saboff
Reported 2014-03-20 18:40:22 PDT
There are many places in CodeGeneratorJS.pm where there is if ($interfaceName eq "DOMWindow") that will emit code to return the JSDOMWindowShell* associated with the JSDOMWindow. This should be changed to be more general purpose so it can be used by JSWorkerGlobalScope based objects that have a similar need.
Attachments
Patch (8.70 KB, patch)
2014-03-20 21:02 PDT, Michael Saboff
ggaren: review+
Michael Saboff
Comment 1 2014-03-20 21:02:33 PDT
Mark Lam
Comment 2 2014-03-20 22:36:54 PDT
Comment on attachment 227374 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=227374&action=review > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2379 > push(@implContent, " if (UNLIKELY(!castedThis)) {\n"); > push(@implContent, " if (JSDOMWindowShell* shell = jsDynamicCast<JSDOMWindowShell*>(JSValue::decode(thisValue)))\n"); > push(@implContent, " castedThis = shell->window();\n"); > push(@implContent, " }\n"); Is this section still needed? In the other 3 sites where you did this change, you removed this null check and the computing of the result from shell->window().
Michael Saboff
Comment 3 2014-03-20 22:59:40 PDT
(In reply to comment #2) > (From update of attachment 227374 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=227374&action=review > > > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2379 > > push(@implContent, " if (UNLIKELY(!castedThis)) {\n"); > > push(@implContent, " if (JSDOMWindowShell* shell = jsDynamicCast<JSDOMWindowShell*>(JSValue::decode(thisValue)))\n"); > > push(@implContent, " castedThis = shell->window();\n"); > > push(@implContent, " }\n"); > > Is this section still needed? In the other 3 sites where you did this change, you removed this null check and the computing of the result from shell->window(). You are right, this section is redundant with what's in toJSDOMWimdow(). I'll remove it.
Geoffrey Garen
Comment 4 2014-03-20 23:20:19 PDT
Comment on attachment 227374 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=227374&action=review r=me > Source/WebCore/bindings/scripts/IDLAttributes.txt:46 > +CustomProxyToJSObject Seems like we should just call this "CustomToJSObject". Even though only proxies happen to use this feature, the feature doesn't need to be tightly coupled to proxies.
Michael Saboff
Comment 5 2014-03-21 07:12:51 PDT
(In reply to comment #4) > (From update of attachment 227374 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=227374&action=review > > r=me > > > Source/WebCore/bindings/scripts/IDLAttributes.txt:46 > > +CustomProxyToJSObject > > Seems like we should just call this "CustomToJSObject". Even though only proxies happen to use this feature, the feature doesn't need to be tightly coupled to proxies. CustomToJSObject is already taken and used in a wider variety of places. Also there are two instances where the custom to*() returns a RefPtr. Therefore I chose a different name. I'm open to suggestions.
Michael Saboff
Comment 6 2014-03-21 10:16:38 PDT
(In reply to comment #5) > (In reply to comment #4) > > (From update of attachment 227374 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=227374&action=review > > > > r=me > > > > > Source/WebCore/bindings/scripts/IDLAttributes.txt:46 > > > +CustomProxyToJSObject > > > > Seems like we should just call this "CustomToJSObject". Even though only proxies happen to use this feature, the feature doesn't need to be tightly coupled to proxies. > > CustomToJSObject is already taken and used in a wider variety of places. Also there are two instances where the custom to*() returns a RefPtr. Therefore I chose a different name. I'm open to suggestions. I looked into this again. CustomToJSObject is used for a custom "toJS()". It is JSCustomToNativeObject that is used for a custom "to<className>()", which I also tried.
Michael Saboff
Comment 7 2014-03-21 10:29:36 PDT
Michael Saboff
Comment 8 2014-03-25 13:28:01 PDT
Michael Saboff
Comment 9 2014-03-26 10:30:19 PDT
Reopened as changed was rolled out in <http://trac.webkit.org/changeset/166249> due to page load time performance regression.
Michael Saboff
Comment 10 2014-03-28 11:14:08 PDT
Note You need to log in before you can comment on or make changes to this bug.