[Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2012 09:42:31 +0000 (09:42 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Aug 2012 09:42:31 +0000 (09:42 +0000)
commit78bc52395ab34e46bfcb23b9c110649d9e508e57
tree1cde118b404659ce5b16d354d797de3a1b5a0448
parent6cef26ad4c69d18ddb73a4929114df86da931cad
[Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
https://bugs.webkit.org/show_bug.cgi?id=93872

Reviewed by Kenneth Rohde Christiansen.

Source/JavaScriptCore:

* Target.pri: Add missing JSWeakObjectMap file to build.

Source/WebCore:

The intention of this patch series is to replace use of internal JSC
API with use of the stable and public C API.

The JSC::Weak template is internal API and the only part of the C API
that exposes similar functionality is the JSWeakObjectMap. It is
special in the sense that its life-time is tied to the life-time of the
JS global object, which in turn is subject to garbage collection. In
order to maximize re-use of the same map across different JSContextRef
instances, we use one JSWeakObjectMap per context group and store the
map in a separate context.

* bridge/qt/qt_instance.cpp:
(JSC::Bindings::unusedWeakObjectMapCallback):
(Bindings):
(JSC::Bindings::WeakMapImpl::WeakMapImpl):
(JSC::Bindings::WeakMapImpl::~WeakMapImpl):
(JSC::Bindings::WeakMap::~WeakMap):
(JSC::Bindings::WeakMap::set):
(JSC::Bindings::WeakMap::get):
(JSC::Bindings::WeakMap::remove):
* bridge/qt/qt_instance.h:
(WeakMapImpl):
(Bindings):
(WeakMap):
(QtInstance):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
(JSC::Bindings::QtRuntimeMethod::jsObjectRef):
* bridge/qt/qt_runtime.h:
(QtRuntimeMethod):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Target.pri
Source/WebCore/ChangeLog
Source/WebCore/bridge/qt/qt_instance.cpp
Source/WebCore/bridge/qt/qt_instance.h
Source/WebCore/bridge/qt/qt_runtime.cpp
Source/WebCore/bridge/qt/qt_runtime.h