aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlxmlhttprequest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix compilation with ICC on WindowsThiago Macieira2015-09-021-4/+0
| | | | | | | | | | | | | | | | | | QV4::Managed is not copyable and its default constructor is deleted. However, it and classes derived from it are exported, which on Windows means the compiler will instantiate all possible functions and add to the DLL. ICC on Windows, unlike MSVC, attempts to instantiate the default constructor of the derived classes (like CallContext) and then the build fails due to the deleted Managed() constructor. Instead, use V4_MANAGED to mark each and every managed class as non- default-constructible and non-copyable. Only one note: the V4_MANAGED macro in QV4::Managed itself takes different parameters, so it needs to be slightly different. Task-number: QTBUG-48063 Change-Id: I42e7ef1a481840699a8dffff140007c65a7a35db Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix default value for XMLHttpRequest.response propertySimon Hausmann2015-05-031-1/+1
| | | | | | | | | | | | | | The default value for responseType is the empty string, for which the expected data type for the response property is a string - same as when the response type is set to "text". In other words: By default the response property should contain the string representation of the data. Task-number: QTBUG-45862 Change-Id: I563160e5cdfbf93aca7e283e455d77a6b9deceb4 Reviewed-by: Pasi Keränen <pasi.keranen@digia.com> Reviewed-by: Valery Kotov <kotov.valery@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QML Engine: ArrayBuffer XHR response type supportValery Kotov2015-03-091-0/+76
| | | | | | | | | | | Support for "arraybuffer" response type for QQmlXMLHttpRequest was added. [ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now supports "arraybuffer" binary response type. Change-Id: I866e543cc7bc6ab037ffff1ef6628057b73daf90 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* NamedNodeMap: Remove logically dead codeHolger Hans Peter Freyther2015-02-181-6/+2
| | | | | | | | | | | | | | | The code has been changed by Lars in the git commit 47fbcb47771a36ab9fd0a4d5ede7b7504ab1410d. Now "r->engine()" is called before the "if (!r)" check is being executed. We can assume that "m->as<NamedNodeMap>()" will always return a non nullptr and this allows us to remove the extra null check. Fixes CID: 86703 Change-Id: Ib4f1103e38c7e1e8e5175d91e795d2621e3a79c4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* CleanupsLars Knoll2015-01-231-51/+51
| | | | | | | | Simplify some code in BooleanObject Simplify access to call arguments and thisObject Change-Id: I2f8e844019bc587385608beb02f05b15f827535c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of most uses of ValueRefLars Knoll2015-01-231-16/+16
| | | | | | | | | | | | Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of all uses of Managed::engine()Lars Knoll2015-01-211-7/+7
| | | | | Change-Id: I596f14554d81f5e9af9996294d96047f2e810bef Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove all the setVTable() calls that aren't required anymoreLars Knoll2015-01-211-10/+0
| | | | | | | | The memory manager's allocation methods now set this up correctly for us :) Change-Id: I8492bf732df601f95a1a851fb3804127ffc83935 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't require an ExecutionEngine member in String anymoreLars Knoll2015-01-161-2/+2
| | | | | Change-Id: I7c1a5471507669871564d79dc17d1026c268b6d0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make sure we always have an engine when assigning to a PersistentLars Knoll2015-01-131-8/+8
| | | | | | | This prepares things for a rewrite of the internals of Persistent. Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove most v8engine references in xhrLars Knoll2015-01-081-81/+45
| | | | | Change-Id: Ibbb38d57782f8566502852a2cb3cfd4a28f9dfc3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove qv8engine usage in the contextwrapperLars Knoll2015-01-081-1/+1
| | | | | Change-Id: Iaf807add5d971e96cac57e38e13385e901f9c930 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of QV8Engine::toStringLars Knoll2015-01-081-24/+11
| | | | | Change-Id: Ib51fa09ae251c1b7b8878ecdf920016f8fcc0067 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedObject typedef instead of actual typeOleg Shparber2015-01-031-12/+12
| | | | | Change-Id: I0b68c534ea513a7c230b12114f6b42b069f9864b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use QV4::ScopedFunctionObject typedef instead of actual typeOleg Shparber2015-01-021-1/+1
| | | | | Change-Id: I6b4effaa5bef992b4ae9402eea7fe655bc7b18f0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* support XMLHttpRequest sync modeTasuku Suzuki2014-12-261-11/+30
| | | | | | | [ChangeLog][QtQml][XMLHttpRequest] Supported synchronous requests Change-Id: Ia38fcf97f212a14657bb519240d8406368a72390 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove most of the places where getPointer() is usedLars Knoll2014-12-201-19/+19
| | | | | | | This is no longer required, and simply uglifies the code Change-Id: Iba91a1d7735ebe23a43437f137a488423b6eb743 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add default parameter value for ScopedCallData()Oleg Shparber2014-12-121-1/+1
| | | | | Change-Id: I16b6662a47c682e145d3e2201f9e90f58405a599 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Better encapsulate access to the global objectLars Knoll2014-12-111-1/+1
| | | | | Change-Id: I8a76112d821cb3fc172ba0d16ee8410d39b4422a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Encapsulate accesses to the root contextLars Knoll2014-12-111-1/+1
| | | | | Change-Id: I668cef1363a5c1a5c5b9a7e138f3bd0338712eea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup destruction of heap objectsLars Knoll2014-11-211-16/+4
| | | | | | | | Generate the code from a macro instead of duplicating boiler plate code. Operate on Heap::Base instead of Managed. Change-Id: I84c5a705980899be3e5b931a093645e50d3923bf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove the executioncontext in a few more places where it's not neededLars Knoll2014-11-211-3/+2
| | | | | Change-Id: I4c92c7bc9d94d8265e306f45d863fdc080a5e2a6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup exception catching codeLars Knoll2014-11-151-2/+1
| | | | | Change-Id: I85afd5758f72e19c280dc196601ee145f0c25f01 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use heap objects in the remaining managed objectsLars Knoll2014-11-121-19/+20
| | | | | Change-Id: Id6dc6e34113a287a40e0122dfbdf977f0fc1f3b3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move XHR object data to Heap namespaceLars Knoll2014-11-111-112/+142
| | | | | Change-Id: I6c18132917f4609fda80813c6e2b696b1146efa7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Data of FunctionObject and related classes into HeapLars Knoll2014-11-081-2/+2
| | | | | Change-Id: Iadf74f953798c1884e0ec704ccb7c70d971e3273 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move Object::Data into the Heap namespaceLars Knoll2014-11-081-11/+11
| | | | | Change-Id: I9d30081f71b83bc86f5e5714e23396b18c4d54c5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Begin moving the data out of Managed objectsLars Knoll2014-11-081-1/+1
| | | | | | | | | | | We need to move the Data objects out of the Managed objects, to avoid lots of trouble because inner classes can't be forward declared in C++. Instead move them all into a Heap namespace. Change-Id: I736af60702b68a1759f4643aa16d64108693dea2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Let markObjects() operate directly on HeapObjectsLars Knoll2014-11-041-4/+4
| | | | | | | | | This decouples things a bit better and helps moving over to directly store heapobject pointers in other objects. Change-Id: I798f922e018b0a3ca6f8768e4a810187f34d82f6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the throw methods from ExecutionContext to ExecutionEngineLars Knoll2014-11-041-16/+16
| | | | | | | | The methods don't require a context, and thus shouldn't be implemented there. Change-Id: If058e0c5067093a4161f2275ac4288aa2bc500f3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-10-311-17/+11
|\ | | | | | | Change-Id: I30f9c925631991ceb22339d1333936faecffbaf4
| * Get rid of !this and similar constructsLars Knoll2014-10-311-17/+11
| | | | | | | | | | | | | | | | | | The C++ standard doesn't allow calling member functions on a mull object. Fix all such places, by moving the checks to the caller where required. Change-Id: I10fb22acaf0324d8ffd3a6d8e19152e5d32f56bb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | QML Engine: Support for "OPTIONS" method for XMLHTTPRequest was added.Valery Kotov2014-09-151-6/+15
|/ | | | | | | | | | | | Support for OPTIONS method was added to QQmlXMLHttpRequest. Tests for OPTIONS method in XMLHttpRequest were added. [ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now supports the OPTION method in HTTP requests. Task-number: QTBUG-35892 Change-Id: Ibbcf3ecddeb8ced64d8c3e52b777dd6ec0ed98f7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Cleanup: Get rid of __data membersSimon Hausmann2014-07-221-20/+0
| | | | | | | These are not needed anymore Change-Id: Ib834aa294e84ca9fbdd5b6850d5bc172e8b54ba1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix Managed::as<>() methodLars Knoll2014-07-221-6/+6
| | | | | | | | | | | | | | | The as<> casting method was not doing the right thing in 100% of the cases. It only checked if the object in question was exactly of the type being asked for. It however didn't check if the object was derived from the type. This commit fixes this by adding a parent chain to the vtables, that is then being used to check this safely at runtime. Change-Id: I9e0b13adbda668aee8c7451e2bb71cd6d4e316d9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change the object allocation schemeSimon Hausmann2014-07-221-9/+9
| | | | | | | | | Instead of allocating the data directly, centralize the object and its ::Data allocation in one place in the memory manager. This is in preparation for additional pointer indirection later. Change-Id: I7880e1e7354b3258b6a8965be378cd09c9467d25 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Construct xhr objects the new wayLars Knoll2014-07-221-120/+101
| | | | | Change-Id: I52085f9b807c6d796ba8ed06d9846cde17e068b6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of StringRefLars Knoll2014-07-221-11/+11
| | | | | | | | Remove the Ref classes, as they won't be required anymore once Managed and Managed::Data are separated. Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix compiler warningLars Knoll2014-07-221-0/+1
| | | | | Change-Id: Ib1d83a3d14aa0ef3f62b8ec26ff5b8571cdb485c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert ExecutionContext to new storage schemeLars Knoll2014-07-221-76/+76
| | | | | Change-Id: I9fcc13da5360f37cef3149b114ed9263b9b74281 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename V4_OBJECT_NEW back to V4_OBJECTLars Knoll2014-07-221-6/+6
| | | | | | | | The _NEW variant was there only temporarily to aid converting to the new data layout. Change-Id: I1d126ee0999c8f0a49f5a08c2e8c090497dd6dd5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert xmlhttprequest to new data layoutLars Knoll2014-07-221-124/+151
| | | | | Change-Id: Ia5d9ca1f3ed35290eef82cf1f83b9f0f094092be Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of different macros for vtable specializationsLars Knoll2014-07-221-2/+2
| | | | | | | Detect existence of a a vtable entry at compile time. Change-Id: Ieed5d34b063184bc4435b22c6685ac0e3fabf493 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Avoid calling destroy() on most objectsLars Knoll2014-07-221-2/+2
| | | | | | | | | The method is now optional, and we can simply avoid calling it if all members an object has are themselves garbage collected. Change-Id: If560fce051908bcc10409ead1a7d8a5bd5fa71d2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix unreliable behavior of array methods on qml list propertiesSimon Hausmann2014-04-091-2/+8
| | | | | | | | | | | Array methods such as forEach rely on the hasProperty boolean of getIndexed to be set appropriately. Some getIndexed implementation - such as the QQmlListProperty one - didn't initialize it correctly and therefore the behavior was undefined. Task-number: QTBUG-38088 Change-Id: I34bc3136d8cc2bc280397d0c4d5051e7d72269e8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix XHR auto tests always failingSimon Hausmann2014-04-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The test (rightly so) expects that even for a 400 response, the responseBody must be preserved - as per commit 0949071f13e7bcbc16a0f07f496e0b6a23b04edd. However before commit fd5dd2712656cbc674c8360754394e41dd82e40c in qtbase, 400 was mapped to QNetworkReply::UnknownContentError, which is "handled" by QQmlXMLHttpRequest::error in the sense that the body is preserved. After the qtbase behavioral change, 400 now maps to QNetworkReply::ProtocolInvalidOperationError, which was _not_ handled, the body was cleared and the test failed. The revdep of qtdeclarative for qtbase should've caught the behavioral change in qtbase, but unfortunately the auto-test was disabled (marked insignificant). This patch adjusts the xhr implementation to the behavioral change in qtbase and also re-activates the xhr auto-test (we really should be testing our xhr implementation in the CI system...). Task-number: QTBUG-38180 Change-Id: I7655fd9037752ad644a98d01257bf5f81e7daa15 Reviewed-by: Mandeep Sandhu <mandeepsandhu.chd@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* Fix memory corruption in XHR implementationSimon Hausmann2014-04-081-0/+1
| | | | | | | | | | | | Now that the member data of Object is also on the GC heap, it is even more important to call the base implementation of markObjects when re-implementing it ;-) Fixes also three XHR auto tests (text, cdata and stateChangeCallingContext) Change-Id: Ifd033cac64a8cf27a9186d8cd9eb94369d8a60a5 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* fix whitespaceOswald Buddenhagen2014-01-221-29/+29
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>