Commit 0f6e4ea2 authored by ggaren@apple.com's avatar ggaren@apple.com

2010-02-05 Kwang Yul Seo <skyul@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@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: svn://svn.chromium.org/blink/trunk@54428 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 99d92be4
...@@ -118,7 +118,7 @@ static void clearReferenceToPrototype(JSObjectRef prototype) ...@@ -118,7 +118,7 @@ static void clearReferenceToPrototype(JSObjectRef prototype)
{ {
OpaqueJSClassContextData* jsClassData = static_cast<OpaqueJSClassContextData*>(JSObjectGetPrivate(prototype)); OpaqueJSClassContextData* jsClassData = static_cast<OpaqueJSClassContextData*>(JSObjectGetPrivate(prototype));
ASSERT(jsClassData); ASSERT(jsClassData);
jsClassData->cachedPrototype = 0; jsClassData->cachedPrototype.clear(toJS(prototype));
} }
PassRefPtr<OpaqueJSClass> OpaqueJSClass::create(const JSClassDefinition* clientDefinition) PassRefPtr<OpaqueJSClass> OpaqueJSClass::create(const JSClassDefinition* clientDefinition)
......
...@@ -37,6 +37,28 @@ ...@@ -37,6 +37,28 @@
* runtime/JSStringBuilder.h: Changed #include <X.h> notation #include "X.h". * runtime/JSStringBuilder.h: Changed #include <X.h> notation #include "X.h".
2010-02-04 Geoffrey Garen <ggaren@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@apple.com> 2010-02-04 Geoffrey Garen <ggaren@apple.com>
Build fix: export a header. Build fix: export a header.
......
...@@ -44,7 +44,11 @@ public: ...@@ -44,7 +44,11 @@ public:
return m_ptr; 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(); }
T* operator->() const { return get(); } T* operator->() const { return get(); }
......
...@@ -258,6 +258,16 @@ ...@@ -258,6 +258,16 @@
* WebCore.base.exp: Remove symbol. * WebCore.base.exp: Remove symbol.
* WebCore.xcodeproj/project.pbxproj: Accommodate rename of script. * WebCore.xcodeproj/project.pbxproj: Accommodate rename of script.
2010-02-04 Geoffrey Garen <ggaren@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@apple.com> 2010-02-04 Geoffrey Garen <ggaren@apple.com>
Build fix: Added a forwarding header. Build fix: Added a forwarding header.
......
...@@ -56,15 +56,6 @@ void JSEventListener::markJSFunction(MarkStack& markStack) ...@@ -56,15 +56,6 @@ void JSEventListener::markJSFunction(MarkStack& markStack)
markStack.append(m_jsFunction); 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) void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
{ {
ASSERT(scriptExecutionContext); ASSERT(scriptExecutionContext);
......
...@@ -92,6 +92,11 @@ namespace WebCore { ...@@ -92,6 +92,11 @@ namespace WebCore {
return m_jsFunction; return m_jsFunction;
} }
inline void JSEventListener::invalidateJSFunction(JSC::JSObject* wrapper)
{
m_wrapper.clear(wrapper);
}
// Creates a JS EventListener for an "onXXX" event attribute. // Creates a JS EventListener for an "onXXX" event attribute.
inline PassRefPtr<JSEventListener> createJSAttributeEventListener(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper) inline PassRefPtr<JSEventListener> createJSAttributeEventListener(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment