[webkit-reviews] review granted: [Bug 64732] Refactor automatically generated JS DOM bindings to replace operator new with static create methods : [Attachment 101379] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 19 13:55:30 PDT 2011


Darin Adler <darin at apple.com> has granted Mark Hahnenberg
<mhahnenberg at apple.com>'s request for review:
Bug 64732: Refactor automatically generated JS DOM bindings to replace operator
new with static create methods
https://bugs.webkit.org/show_bug.cgi?id=64732

Attachment 101379: Patch
https://bugs.webkit.org/attachment.cgi?id=101379&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=101379&action=review


> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1492
> +    if ($interfaceName eq "DOMWindow") {
> +	   push(@implContent, "$className* ${className}::create(JSGlobalData&
globalData, Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell*
windowShell)\n");
> +	   push(@implContent, "{\n");
> +	   push(@implContent, "    return new
(allocateCell<$className>(globalData.heap)) ${className}(globalData, structure,
impl, windowShell);\n");
> +	   push(@implContent, "}\n\n");
> +    } elsif ($dataNode->extendedAttributes->{"IsWorkerContext"}) {
> +	   push(@implContent, "$className* ${className}::create(JSGlobalData&
globalData, Structure* structure, PassRefPtr<$implType> impl)\n");
> +	   push(@implContent, "{\n");
> +	   push(@implContent, "    return new
(allocateCell<$className>(globalData.heap)) ${className}(globalData, structure,
impl);\n");
> +	   push(@implContent, "}\n\n");
> +    } else {
> +	   push(@implContent, "$className* ${className}::create(Structure*
structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n");
> +	   push(@implContent, "{\n");
> +	   push(@implContent, "    return new
(allocateCell<$className>(globalObject->globalData().heap))
${className}(structure, globalObject, impl);\n");
> +	   push(@implContent, "}\n\n");
> +    }

I wonder if any of these should be inlined, and thus in the header?


More information about the webkit-reviews mailing list