[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

ggaren at apple.com ggaren at apple.com
Wed Feb 10 22:16:39 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit fa3b6d6e833c039aa3f4cd9451c9748f88cfd3dc
Author: ggaren at apple.com <ggaren at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 5 17:46:45 2010 +0000

    2010-02-05  Kwang Yul Seo  <skyul at company100.net>
    
            Reviewed by Alexey Proskuryakov.
    
            Don't call CRASH() in fastMalloc and fastCalloc when the requested memory size is 0
            https://bugs.webkit.org/show_bug.cgi?id=34569
    
            With USE_SYSTEM_MALLOC=1, fastMalloc and fastCalloc call CRASH()
            if the return value of malloc and calloc is 0.
    
            However, these functions can return 0 when the request size is 0.
            Libc manual says, "If size is 0, then malloc() returns either NULL,
            or a unique pointer value that can later be successfully passed to free()."
            Though malloc returns a unique pointer in most systems,
            0 can be returned in some systems. For instance, BREW's MALLOC returns 0
            when size is 0.
    
            If malloc or calloc returns 0 due to allocation size, increase the size
            to 1 and try again.
    
            * wtf/FastMalloc.cpp:
            (WTF::fastMalloc):
            (WTF::fastCalloc):
    2010-02-05  Sebastian Dröge  <sebastian.droege at collabora.co.uk>
    
            Reviewed by Gustavo Noronha.
    
            Add a GStreamer HTTP/HTTPS source, using WebKit infrastructure
            https://bugs.webkit.org/show_bug.cgi?id=34317
    
            * GNUmakefile.am:
            * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
            (WebCore::mediaPlayerPrivateSourceChangedCallback):
            (WebCore::doGstInit):
            * platform/graphics/gtk/WebKitWebSourceGStreamer.cpp:
            * platform/graphics/gtk/WebKitWebSourceGStreamer.h:
            Add a GStreamer HTTP/HTTPS source, using the WebKit infrastructure.
            This makes sure that referer, cookies, authentication information
            and all kinds of other context are passed to GStreamer for websites
            like Vimeo or YouTube.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54428 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/API/JSClassRef.cpp b/JavaScriptCore/API/JSClassRef.cpp
index c6685bf..d75d5cd 100644
--- a/JavaScriptCore/API/JSClassRef.cpp
+++ b/JavaScriptCore/API/JSClassRef.cpp
@@ -118,7 +118,7 @@ static void clearReferenceToPrototype(JSObjectRef prototype)
 {
     OpaqueJSClassContextData* jsClassData = static_cast<OpaqueJSClassContextData*>(JSObjectGetPrivate(prototype));
     ASSERT(jsClassData);
-    jsClassData->cachedPrototype = 0;
+    jsClassData->cachedPrototype.clear(toJS(prototype));
 }
 
 PassRefPtr<OpaqueJSClass> OpaqueJSClass::create(const JSClassDefinition* clientDefinition)
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 811f510..ef38040 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -39,6 +39,28 @@
 
 2010-02-04  Geoffrey Garen  <ggaren at apple.com>
 
+        Reviewed by Oliver Hunt.
+
+        Clearing a WeakGCPtr is weird
+        https://bugs.webkit.org/show_bug.cgi?id=34627
+
+        Added a WeakGCPtr::clear interface.
+        
+        As discussed in https://bugs.webkit.org/show_bug.cgi?id=33383, the old
+        interface made it pretty weird for a client to conditionally clear a
+        WeakGCPtr, which is exactly what clients want to do when objects are
+        finalized.
+
+        * API/JSClassRef.cpp:
+        (clearReferenceToPrototype): Use the new WeakGCPtr::clear() interface. 
+
+        * runtime/WeakGCPtr.h:
+        (JSC::WeakGCPtr::clear): Added an interface for clearing a WeakGCPtr,
+        iff its current value is the value passed in. It's cumbersome for the
+        client to do this test, since WeakGCPtr sometimes pretends to be null.
+
+2010-02-04  Geoffrey Garen  <ggaren at apple.com>
+
         Build fix: export a header.
 
         * JavaScriptCore.xcodeproj/project.pbxproj:
diff --git a/JavaScriptCore/runtime/WeakGCPtr.h b/JavaScriptCore/runtime/WeakGCPtr.h
index 8653721..3ed4645 100644
--- a/JavaScriptCore/runtime/WeakGCPtr.h
+++ b/JavaScriptCore/runtime/WeakGCPtr.h
@@ -44,7 +44,11 @@ public:
         return m_ptr;
     }
     
-    void clear() { m_ptr = 0; }
+    void clear(JSCell* ptr)
+    {
+        if (ptr == m_ptr)
+            m_ptr = 0;
+    }
 
     T& operator*() const { return *get(); }
     T* operator->() const { return get(); }
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2a74986..dbd7242 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -260,6 +260,16 @@
 
 2010-02-04  Geoffrey Garen  <ggaren at apple.com>
 
+        Reviewed by Oliver Hunt.
+
+        Updated to use new WeakGCPtr::clear interface.
+
+        * bindings/js/JSEventListener.cpp:
+        * bindings/js/JSEventListener.h:
+        (WebCore::JSEventListener::invalidateJSFunction):
+
+2010-02-04  Geoffrey Garen  <ggaren at apple.com>
+
         Build fix: Added a forwarding header.
 
         * ForwardingHeaders/runtime/WeakGCPtr.h: Added.
diff --git a/WebCore/bindings/js/JSEventListener.cpp b/WebCore/bindings/js/JSEventListener.cpp
index 93e059f..61f21be 100644
--- a/WebCore/bindings/js/JSEventListener.cpp
+++ b/WebCore/bindings/js/JSEventListener.cpp
@@ -56,15 +56,6 @@ void JSEventListener::markJSFunction(MarkStack& markStack)
         markStack.append(m_jsFunction);
 }
 
-void JSEventListener::invalidateJSFunction(JSC::JSObject* wrapper)
-{
-    // Since m_wrapper is a WeakGCPtr, it pretends to be null, and therefore !=
-    // to wrapper, when it's awaiting destruction. So, we check for == wrapper
-    // or == null.
-    if (!m_wrapper || m_wrapper == wrapper)
-        m_wrapper = 0;
-}
-
 void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
 {
     ASSERT(scriptExecutionContext);
diff --git a/WebCore/bindings/js/JSEventListener.h b/WebCore/bindings/js/JSEventListener.h
index 9612f98..569c192 100644
--- a/WebCore/bindings/js/JSEventListener.h
+++ b/WebCore/bindings/js/JSEventListener.h
@@ -92,6 +92,11 @@ namespace WebCore {
         return m_jsFunction;
     }
 
+    inline void JSEventListener::invalidateJSFunction(JSC::JSObject* wrapper)
+    {
+        m_wrapper.clear(wrapper);
+    }
+
     // Creates a JS EventListener for an "onXXX" event attribute.
     inline PassRefPtr<JSEventListener> createJSAttributeEventListener(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
     {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list