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] Port meta method/signal/slot handling in run-time bridge to use …
…JSC C API https://bugs.webkit.org/show_bug.cgi?id=93476 Reviewed by Kenneth Rohde Christiansen. Source/WebCore: Based on patch by No'am Rosenthal and lots of good suggestions by Caio Marcelo. Ported the code that mapped invokable methods (and signals/slots) as well as the code that provides the connect() and disconnect() functions over to use the JSC C API. In the process one behavioural change was implemented: Previously meta methods were actually function objects that through Function.prototype allowed calling via object.method.call(object). Through the use of plain JS objects that is not possible anymore. If we tried to continue to use function objects (JSObjectMakeFunction) then we would loose the ability to store the private pointer. An alternative approach would be to use a regular object and install the Function prototype (Function.prototype), but unfortunately we cannot do that without loosing the common prototype for signals and slots. * bridge/qt/qt_class.cpp: (JSC::Bindings::QtClass::fallbackObject): * bridge/qt/qt_instance.cpp: (JSC::Bindings::QtInstance::~QtInstance): (JSC::Bindings::QtInstance::newRuntimeObject): * bridge/qt/qt_instance.h: (Bindings): (QtInstance): * bridge/qt/qt_runtime.cpp: (JSC::Bindings::prototypeForSignalsAndSlots): (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod): (JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod): (JSC::Bindings::QtRuntimeMethod::call): (JSC::Bindings::QtRuntimeMethod::connect): (JSC::Bindings::QtRuntimeMethod::disconnect): (JSC::Bindings::QtRuntimeMethod::jsObjectRef): (JSC::Bindings::QtRuntimeMethod::connectOrDisconnect): (Bindings): (JSC::Bindings::QtConnectionObject::~QtConnectionObject): * bridge/qt/qt_runtime.h: (JSC::Bindings::QtRuntimeMethod::name): (QtRuntimeMethod): (QtConnectionObject): Source/WebKit/qt: Changed semantics of some test expectations. Similarly to r125032 when generating error exceptions for connect/disconnect, we cannot generate explicit type error exceptions but only generic errors. Another change is that the meta-method wrapper doesn't support the call() through Function.prototype anymore. See WebCore changelog for details. * tests/qobjectbridge/tst_qobjectbridge.cpp: (tst_QObjectBridge::connectAndDisconnect): (tst_QObjectBridge::objectDeleted): (tst_QObjectBridge::introspectQtMethods): Canonical link: https://commits.webkit.org/111703@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
8 changed files
with
346 additions
and
572 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
Oops, something went wrong.