Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[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): Canonical link: https://commits.webkit.org/112124@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
7 changed files
with
137 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -122,7 +122,6 @@ class QtRuntimeMethod { | ||
QByteArray m_identifier; | ||
int m_index; | ||
int m_flags; | ||
Weak<JSObject> m_jsObject; | ||
QtInstance* m_instance; | ||
}; | ||
|
||