[JSC] Move WeakValueRef class to its own file and use it from Objc and GLib
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2018 09:16:15 +0000 (09:16 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2018 09:16:15 +0000 (09:16 +0000)
commit21bc05981dbe23a4026ba39244729ca72e1071cb
tree9403cb9ba5a2b2f063c51822f5c5310eaf19b643
parent2d4f0ebf4b79f44c70282d0ce45c774f14213aa5
[JSC] Move WeakValueRef class to its own file and use it from Objc and GLib
https://bugs.webkit.org/show_bug.cgi?id=184073

Reviewed by Yusuke Suzuki.

We currently have duplicated code in Obj and GLib implementations.

* API/JSManagedValue.mm:
(managedValueHandleOwner):
(-[JSManagedValue initWithValue:]):
* API/JSWeakValue.cpp: Added.
(JSC::JSWeakValue::~JSWeakValue):
(JSC::JSWeakValue::clear):
(JSC::JSWeakValue::isClear const):
(JSC::JSWeakValue::setPrimitive):
(JSC::JSWeakValue::setObject):
(JSC::JSWeakValue::setString):
* API/JSWeakValue.h: Added.
(JSC::JSWeakValue::isSet const):
(JSC::JSWeakValue::isPrimitive const):
(JSC::JSWeakValue::isObject const):
(JSC::JSWeakValue::isString const):
(JSC::JSWeakValue::object const):
(JSC::JSWeakValue::primitive const):
(JSC::JSWeakValue::string const):
* API/glib/JSCWeakValue.cpp:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/API/JSManagedValue.mm
Source/JavaScriptCore/API/JSWeakValue.cpp [new file with mode: 0644]
Source/JavaScriptCore/API/JSWeakValue.h [new file with mode: 0644]
Source/JavaScriptCore/API/glib/JSCWeakValue.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Sources.txt