Title: [105221] branches/safari-534.54-branch/Source/WebCore
Revision
105221
Author
lforsch...@apple.com
Date
2012-01-17 17:33:29 -0800 (Tue, 17 Jan 2012)

Log Message

Merged r103913 & r103915.

Modified Paths

Diff

Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (105220 => 105221)


--- branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-18 01:23:06 UTC (rev 105220)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-01-18 01:33:29 UTC (rev 105221)
@@ -1,3 +1,25 @@
+2011-01-17  Lucas Forschler  <lforsch...@apple.com>
+
+    Merge 103913 & 103915
+
+    2012-01-02  Sam Weinig  <s...@webkit.org>
+
+            Fix the build.
+
+            * bindings/scripts/CodeGeneratorJS.pm:
+
+    2012-01-02  Sam Weinig  <s...@webkit.org>
+
+            REGRESSION(r100517): We're leaking many, many DOM objects!
+            https://bugs.webkit.org/show_bug.cgi?id=75451
+
+            Reviewed by Mark Rowe.
+
+            * bindings/scripts/CodeGeneratorJS.pm:
+            Add a temporary workaround to the problem of handle finalizers
+            not getting called by adding back the destructors (or rather
+            their replacement, destroy() functions).
+
 2011-1-17  Lucas Forschler  <lforsch...@apple.com>
 
     Merge 104593

Modified: branches/safari-534.54-branch/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (105220 => 105221)


--- branches/safari-534.54-branch/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-01-18 01:23:06 UTC (rev 105220)
+++ branches/safari-534.54-branch/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-01-18 01:33:29 UTC (rev 105221)
@@ -810,6 +810,10 @@
         push(@headerContent, "    bool putDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSC::PutPropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingPutFunction"};
     }
 
+    if (!$hasParent) {
+        push(@headerContent, "    static void destroy(JSC::JSCell*);\n");
+    }
+
     # Class info
     push(@headerContent, "    static const JSC::ClassInfo s_info;\n\n");
 
@@ -931,6 +935,7 @@
     if (!$hasParent) {
         push(@headerContent, "    $implType* impl() const { return m_impl.get(); }\n");
         push(@headerContent, "    void clearImpl() { m_impl.clear(); }\n\n");
+        push(@headerContent, "    void releaseImplIfNotNull() { if (m_impl) { m_impl->deref(); m_impl = 0; } }\n\n");
         push(@headerContent, "private:\n");
         push(@headerContent, "    RefPtr<$implType> m_impl;\n");
     } elsif ($dataNode->extendedAttributes->{"GenerateNativeConverter"}) {
@@ -1565,6 +1570,20 @@
         push(@implContent, "}\n\n");
     }
 
+    if (!$hasParent) {
+        # FIXME: This destroy function should not be necessary, as 
+        # a finalizer should be called for each DOM object wrapper.
+        # However, that seems not to be the case, so this has been
+        # added back to avoid leaking while we figure out why the
+        # finalizers are not always getting called. The work tracking
+        # the finalizer issue is being tracked in http://webkit.org/b/75451
+        push(@implContent, "void ${className}::destroy(JSC::JSCell* cell)\n");
+        push(@implContent, "{\n");
+        push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
+        push(@implContent, "    thisObject->releaseImplIfNotNull();\n");
+        push(@implContent, "}\n\n");
+    }
+
     my $hasGetter = $numAttributes > 0 
                  || !($dataNode->extendedAttributes->{"OmitConstructor"} 
                  || $dataNode->extendedAttributes->{"CustomConstructor"})
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to