summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/bridge/qt/qt_runtime.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Import WebKit commit 85c24b4e854b971f0705bb3411cfd4c0b821f491Konstantin Tokarev2017-10-131-1/+1
| | | | | Change-Id: I3f9320f43d5d1fc5169a6c1b9dcea454974d6578 Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
* Imported WebKit commit fbdeb5a5c78f666271a638ba10137127bcea61f4Konstantin Tokarev2017-02-021-5/+4
| | | | | Change-Id: Ie14bf4e3f1f1f7e3b9e5cf60e69a7572dd481006 Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
* Imported WebKit commit 2730223e8fe1776419fae168986b9e77f55d02d3Konstantin Tokarev2017-02-021-1/+6
| | | | | Change-Id: I46d453477a779a8db544ffc50d088fa13331da9b Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
* Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)Konstantin Tokarev2017-02-021-22/+34
| | | | | Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
* Fix fallback conversion of recognized objectsAllan Sandfeld Jensen2014-08-151-1/+1
| | | | | | | | | | | All objects are added the list of visited objects, but only those that were not recognized more specific than 'Object' are removed before trying the fallback conversion. This prevents the fallback from working as the algorithm will assume we are looping. Task-number: QTBUG-39951 Change-Id: I1d538c452092485b371c335e53f16db162bd4fb1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix crash when converting QObjectListAllan Sandfeld Jensen2013-11-161-1/+2
| | | | | | | | | | We were passing on a PassRefPtr to multiple lower calls, since any conversion from a PassRefPtr to a RefPtr will reset the PassRefPtr to null, it should not be used for multiple calls. Task-number: QTBUG-34278 Change-Id: I8d4bf28e25eb6e66baef38e0352c40a08f504538 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Import Qt5x2 branch of QtWebkit for Qt 5.2Allan Sandfeld Jensen2013-09-191-9/+9
| | | | | | | Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* [Qt] Fix minor memory leak in slot executionSimon Hausmann2013-08-061-1/+1
| | | | | | | | | | | | | Reviewed by Allan Sandfeld Jensen. Don't leak the "length" string when executing a slot in JavaScript. * bridge/qt/qt_runtime.cpp: (JSC::Bindings::QtConnectionObject::execute): Change-Id: I7e7cd3c0bbe18e5345d9f024a95284c2c8ef09e9 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141420 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Crash when calling QWebFrame::evaluateJavaScriptAllan Sandfeld Jensen2013-05-211-1/+8
| | | | | | | | | | | | | | | | | https://bugs.webkit.org/show_bug.cgi?id=113434 Reviewed by Simon Hausmann. We must take the JS API lock before accessing internal JS methods. * bridge/qt/qt_runtime.cpp: (JSC::Bindings::unwrapBoxedPrimitive): (JSC::Bindings::getGregorianDateTimeUTC): (JSC::Bindings::convertQVariantToValue): Change-Id: Id06381d1a68da8e33020da7960e6b6943fd374f1 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149521 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* [Qt][WK1] Reflect recursion limit and loop checks also for list conversions.Michael Brüning2013-04-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | https://bugs.webkit.org/show_bug.cgi?id=107950 Reviewed by Allan Sandfeld Jensen. No new tests, bugfix, no behavioral change. Make conversions from Javascript values to QLists take the maximum recursion depth into consideration and check for objects that were already visited. Otherwise, the conversion may recurse until the stack is full and then cause a segmentation fault. * bridge/qt/qt_runtime.cpp: (JSC::Bindings::convertToList): (JSC::Bindings::convertValueToQVariant): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141085 268f45cc-cd09-0410-ab3c-d52691b4dbfc Change-Id: I598fee74144c5298f81952b122e07e7eac47a8db Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* JS bridge does not transmit QVariants anymore in Qt5 ↵Simon Hausmann2012-12-201-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugs.webkit.org/show_bug.cgi?id=104540 Patch by Simon Hausmann <simon.hausmann@digia.com>, Jedrzej Nowacki <jedrzej.nowacki@digia.com> on 2012-12-19 Reviewed by Kenneth Rohde Christiansen. A data corruption exists in the QObject bridge when calling slots that take a QVariant. The calling convention for slots is that the void* parameter array must contain pointers to the actually required destination argument type. If a function takes an int for example, the corresponding entry in the void* parameter array must be a pointer to an int that the moc generated code then can "safely" cast to an int* and dereference. Similarly if the function takes a QVariant it must be a pointer to a QVariant. We implement this calling convention by constructing QVariants of the requested parameter types and passing the value of data() into the void* parameter array. This works fine for all types except if the requested type is a QVariant. In that case data() will _not_ return a pointer that can later be safely casted to a QVariant pointer and dereferenced. Instead we must use the address of our variant to ensure a working cast. Our auto tests cover this case, but they worked by accident because the provided pointer when casted to a QVariant happens to have the correct type id that doesn't produce the warning seen in the test case of the provided example and the unit test just copies the QVariant and thus pointer. * bridge/qt/qt_runtime.cpp: (JSC::Bindings::QtMethodMatchType::typeId): Replace string based meta type id determination of QVariant with a quicker table lookup. (JSC::Bindings::findMethodIndex): Remember the chosen (requested) types and pass the pointer to the QVariant instead of its data() pointer if requested. (JSC::Bindings::QtRuntimeMethod::call): Fixed determination of whether we need to convert a return value or not solely based on the return type _specified_ in the meta method instead of the variant value returned. The latter is not sufficient because a slot can return an invalid variant, which is not the same as returning void. This was triggered by an unit test that accidentally passed due to this memory corruption in the first place. Change-Id: Ie8ed983a7b7f530c038956c9f32eef3738a3cc9d git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138247 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 ↵Simon Hausmann2012-10-171-2/+2
| | | | | | | (http://svn.webkit.org/repository/webkit/trunk@131592) New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well as the previously cherry-picked changes
* Revert "Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 ↵Simon Hausmann2012-10-161-2/+2
| | | | | | | | (http://svn.webkit.org/repository/webkit/trunk@131300)" This reverts commit 5466563f4b5b6b86523e3f89bb7f77e5b5270c78. Caused OOM issues on some CI machines :(
* Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 ↵Simon Hausmann2012-10-151-2/+2
| | | | | | | | | (http://svn.webkit.org/repository/webkit/trunk@131300) WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314
* Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d ↵Simon Hausmann2012-09-101-419/+257
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@128073) New snapshot
* Imported WebKit commit bf0b0213bbf3886c96610020602012ca7d11b084 ↵Simon Hausmann2012-08-241-2/+2
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@126545) New snapshot with clang and python build fixes
* Imported WebKit commit a5ae8a56a48e44ebfb9b81aaa5488affaffdb175 ↵Simon Hausmann2012-08-231-51/+79
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@126420) New snapshot with OS X 10.6 build fix
* Imported WebKit commit 35255d8c2fd37ba4359e75fe0ebe6aec87687f9c ↵Simon Hausmann2012-08-221-37/+36
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@126284) New snapshot that includes MSVC 64-bit build fix
* Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 ↵Simon Hausmann2012-08-211-369/+185
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@126147) New snapshot including various build fixes for newer Qt 5
* Remove the use of QWidgetStarMarius Storm-Olsen2012-08-201-2/+1
| | | | | We can now properly convert any QObject-derived object to the QObject*, so we don't need to use the QWidgetStar.
* Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 ↵Simon Hausmann2012-08-121-106/+50
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@125365) New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
* Imported WebKit commit 0282df8ca7c11d8c8a66ea18543695c69f545a27 ↵Simon Hausmann2012-07-301-5/+5
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@124002) New snapshot with prospective Mountain Lion build fix
* Imported WebKit commit 0fbd41c4e13f5a190faf160bf993eee614e6e18e ↵Simon Hausmann2012-07-241-13/+13
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@123477) New snapshot that adapts to latest Qt API changes
* Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 ↵Simon Hausmann2012-07-111-4/+4
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@122325) New snapshot that should work with the latest Qt build system changes
* Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 ↵Simon Hausmann2012-06-201-5/+5
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@120813) New snapshot with Windows build fixes
* Remove dependency to QtScript for the Qt 5 build ↵hausmann@webkit.org2012-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugs.webkit.org/show_bug.cgi?id=88993 Reviewed by Kenneth Rohde Christiansen. Source/WebCore: Replace the use of QScriptEngine::ValueOwnership with an enum local to the class where it is used (QtInstance). * Target.pri: * bindings/js/ScriptControllerQt.cpp: (WebCore::ScriptController::createScriptInstanceForWidget): * bridge/qt/qt_instance.cpp: (JSC::Bindings::QtInstance::QtInstance): (JSC::Bindings::QtInstance::~QtInstance): (JSC::Bindings::QtInstance::getQtInstance): * bridge/qt/qt_instance.h: (QtInstance): (JSC::Bindings::QtInstance::create): * bridge/qt/qt_runtime.cpp: (JSC::Bindings::convertQVariantToValue): * bridge/qt/qt_runtime_qt4.cpp: (JSC::Bindings::convertQVariantToValue): Source/WebKit/qt: When building against Qt 5, replace the use of QScriptEngine::ValueOwnership with a (compatible) QWebFrame::ValueOwnership enum. * Api/qwebframe.cpp: (qtSenderCallback): (QWebFrame::addToJavaScriptWindowObject): * Api/qwebframe.h: * tests/qobjectbridge/tst_qobjectbridge.cpp: (tst_QObjectBridge::arrayObjectEnumerable): (tst_QObjectBridge::ownership): (tst_QObjectBridge::qObjectWrapperWithSameIdentity): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
* Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 ↵Simon Hausmann2012-05-271-1/+1
| | | | (http://svn.webkit.org/repository/webkit/trunk@118629)
* Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 ↵Simon Hausmann2012-05-251-4/+4
| | | | (http://svn.webkit.org/repository/webkit/trunk@118516)
* Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 ↵Simon Hausmann2012-05-181-21/+23
| | | | | | (http://svn.webkit.org/repository/webkit/trunk@117578) Weekly snapshot
* Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b ↵Simon Hausmann2012-05-071-64/+94
| | | | (http://svn.webkit.org/repository/webkit/trunk@116286)
* Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 ↵Simon Hausmann2012-02-241-1/+1
| | | | (http://svn.webkit.org/repository/webkit/trunk@108790)
* Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 ↵Simon Hausmann2012-02-031-10/+10
| | | | (http://svn.webkit.org/repository/webkit/trunk@106560)
* Imported WebKit commit 2ea9d364d0f6efa8fa64acf19f451504c59be0e4 ↵Simon Hausmann2012-01-061-0/+1922
(http://svn.webkit.org/repository/webkit/trunk@104285)