Skip to content
Permalink
Browse files
Unreviewed, rolling out r125444.
http://trac.webkit.org/changeset/125444
https://bugs.webkit.org/show_bug.cgi?id=93872

Broke some tests

Source/JavaScriptCore:

* Target.pri:

Source/WebCore:

* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
(JSC::Bindings::QtRuntimeMethod::jsObjectRef):
* bridge/qt/qt_runtime.h:
(QtRuntimeMethod):

Canonical link: https://commits.webkit.org/111725@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
tronical committed Aug 13, 2012
1 parent d8ebf3f commit 0d5f95fd8743551fa587a66300d817e8520c8531
Showing 5 changed files with 30 additions and 32 deletions.
@@ -1,3 +1,13 @@
2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>

Unreviewed, rolling out r125444.
http://trac.webkit.org/changeset/125444
https://bugs.webkit.org/show_bug.cgi?id=93872

Broke some tests

* Target.pri:

2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>

[Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
@@ -40,7 +40,6 @@ SOURCES += \
API/JSObjectRef.cpp \
API/JSStringRef.cpp \
API/JSValueRef.cpp \
API/JSWeakObjectMapRefPrivate.cpp \
API/OpaqueJSString.cpp \
assembler/ARMAssembler.cpp \
assembler/ARMv7Assembler.cpp \
@@ -1,3 +1,17 @@
2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>

Unreviewed, rolling out r125444.
http://trac.webkit.org/changeset/125444
https://bugs.webkit.org/show_bug.cgi?id=93872

Broke some tests

* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
(JSC::Bindings::QtRuntimeMethod::jsObjectRef):
* bridge/qt/qt_runtime.h:
(QtRuntimeMethod):

2012-08-13 Thiago Marcos P. Santos <thiago.santos@intel.com>

CanvasRenderContext2D::font() does not re-serialize the font
@@ -38,7 +38,6 @@
#include "JSObject.h"
#include "JSRetainPtr.h"
#include "JSUint8ClampedArray.h"
#include "JSWeakObjectMapRefPrivate.h"
#include "ObjectPrototype.h"
#include "PropertyNameArray.h"
#include "qdatetime.h"
@@ -1291,15 +1290,6 @@ static JSClassRef prototypeForSignalsAndSlots()
return cls;
}

typedef HashMap<JSGlobalContextRef, JSWeakObjectMapRef> WeakRuntimeMethodMap;
static WeakRuntimeMethodMap weakRuntimeMethodCache;

static void methodMapCleaner(JSWeakObjectMapRef, void* data)
{
JSGlobalContextRef ref = static_cast<JSGlobalContextRef>(data);
weakRuntimeMethodCache.remove(ref);
}

QtRuntimeMethod::QtRuntimeMethod(JSContextRef ctx, QObject* object, const QByteArray& identifier, int index, int flags, QtInstance* instance)
: m_object(object)
, m_identifier(identifier)
@@ -1311,13 +1301,8 @@ QtRuntimeMethod::QtRuntimeMethod(JSContextRef ctx, QObject* object, const QByteA

QtRuntimeMethod::~QtRuntimeMethod()
{
for (WeakRuntimeMethodMap::const_iterator it = weakRuntimeMethodCache.begin(), end = weakRuntimeMethodCache.end();
it != end; ++it) {
if (JSObjectRef obj = JSWeakObjectMapGet(it->first, it->second, this)) {
JSObjectSetPrivate(obj, 0);
JSWeakObjectMapRemove(it->first, it->second, this);
}
}
if (m_jsObject)
JSObjectSetPrivate(toRef(m_jsObject.get()), 0);
}

JSValueRef QtRuntimeMethod::call(JSContextRef context, JSObjectRef function, JSObjectRef /*thisObject*/, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
@@ -1365,12 +1350,8 @@ JSValueRef QtRuntimeMethod::disconnect(JSContextRef context, JSObjectRef functio

JSObjectRef QtRuntimeMethod::jsObjectRef(JSContextRef context, JSValueRef* exception)
{
JSGlobalContextRef globalContext = JSContextGetGlobalContext(context);
WeakRuntimeMethodMap::iterator cache = weakRuntimeMethodCache.find(globalContext);
if (cache != weakRuntimeMethodCache.end()) {
if (JSObjectRef cachedMethod = JSWeakObjectMapGet(cache->first, cache->second, this))
return cachedMethod;
}
if (m_jsObject)
return toRef(m_jsObject.get());

static const JSClassDefinition classDefForConnect = {
0, 0, "connect", 0, 0, 0,
@@ -1406,14 +1387,7 @@ JSObjectRef QtRuntimeMethod::jsObjectRef(JSContextRef context, JSValueRef* excep
JSObjectSetProperty(context, object, lengthStr, JSValueMakeNumber(context, 0), attributes, exception);
JSObjectSetProperty(context, object, nameStr, JSValueMakeString(context, actualNameStr.get()), attributes, exception);

JSWeakObjectMapRef map;
if (cache == weakRuntimeMethodCache.end()) {
map = JSWeakObjectMapCreate(globalContext, globalContext, methodMapCleaner);
weakRuntimeMethodCache.add(globalContext, map);
} else
map = cache->second;
JSWeakObjectMapSet(globalContext, map, this, object);

m_jsObject = PassWeak<JSObject>(toJS(object));
return object;
}

@@ -122,6 +122,7 @@ class QtRuntimeMethod {
QByteArray m_identifier;
int m_index;
int m_flags;
Weak<JSObject> m_jsObject;
QtInstance* m_instance;
};

0 comments on commit 0d5f95f

Please sign in to comment.