summaryrefslogtreecommitdiffstats
path: root/src/core/url_request_context_getter_qt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Adaptations to Chromium 52Allan Sandfeld Jensen2016-09-141-19/+20
| | | | | Change-Id: Idf8a511ba26d263fd9d014d87d5e1101d706da71 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Fix crash on changing persistent storage pathAllan Sandfeld Jensen2016-08-211-0/+1
| | | | | | | | | | The deletion of HttpNetworkSession references the old HttpServerProperties so delete the session before we replace the properties. Task-number: QTBUG-55322 Change-Id: I420dc0523fda44423adaa5f4f0fa1df9ade4b584 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-051-7/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove() and comboBoxPopupPositionAfterMove(). Conflicts: .qmake.conf src/3rdparty src/core/render_widget_host_view_qt.cpp src/core/resources/resources.gyp src/webengine/doc/src/qtwebengine-platform-notes.qdoc src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h tests/auto/widgets/qwebenginepage/BLACKLIST tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp tools/qmake/mkspecs/features/functions.prf Task-number: QTBUG-55158 Change-Id: I1d73ac9b3ca5293ad3c7e3a56f4c395da930e6f4
| * Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-08-021-7/+18
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/resources/resources.gyp src/webengine/doc/src/qtwebengine-overview.qdoc src/webenginewidgets/api/qwebenginepage.cpp src/webenginewidgets/api/qwebenginescriptcollection.cpp src/webenginewidgets/api/qwebenginescriptcollection_p.h tests/auto/widgets/qwebenginepage/BLACKLIST And readded newly in 5.6 enabled tests to the BLACKLIST. Change-Id: I4ab1fc54ebfaaf940df81b0d8d6bdd15cae8b7c4
| | * Add persistent backend to channel id serviceAllan Sandfeld Jensen2016-07-191-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Channel-ids are only supposed to be memory only when running in off the record profiles. We have just never initialized the sql-based backend. We follow the cookie-settings, because channel-ids are used together with cookies, have similar implications, and newer Chromium versions will assert that cookie-store and channel-id store have matching storage models. Change-Id: I0a64146f0ed36a8913706bfc3fcadd7404894745 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
| | * Fix regression in updating cookie store settingsAllan Sandfeld Jensen2016-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | A copy-paste error meant we only updated user-agent settings when cookie store settings changed on a profile. Change-Id: I173ea7dfc309a30a3d3b98ee5ccab74e2abec456 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | | Basic porting to Chromium 51Allan Sandfeld Jensen2016-06-011-7/+6
|/ / | | | | | | | | | | | | Trivial changes in methods, arguments and types. Change-Id: Ic707c376249f816268223e696ed5f6251df1f85f Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-05-091-43/+128
|\| | | | | | | Change-Id: I2843a633721212850db77c772caf24e0ea82b450
| * Fix threading issues with URLRequestContextAllan Sandfeld Jensen2016-05-031-43/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | URLRequestContextGetterQt contains data which is shared between UI and IO thread. Make the class more thread friendly by making copies of the data that can be accessed from the IO thread, and protect synchronization with a full mutex instead of atomics. Also fixes circular reference between URLRequestContextGetterQt and BrowserContextAdapter. Task-number: QTBUG-50160 Task-number: QTBUG-52509 Change-Id: Idaba211533cfad229e1d1872cdfdf4e7dffeb3d8 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-04-251-38/+58
|\| | | | | | | Change-Id: I329397621f19ba3890be5daf44a6bb2d668ad2d8
| * Fix regenerating job-factoryAllan Sandfeld Jensen2016-04-221-6/+31
| | | | | | | | | | | | | | | | | | | | | | Only update installed custom url scheme handlers, and leave the rest of the job factory untouched, so we don't delete the protocol handlers and request interceptors Chromium passed us, and that are now owned by the job-factory. Change-Id: I640527487dda053463f8fa9986ceb47941593f2b Task-number: QTBUG-52790 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
| * Cleanup and comment URLRequestContextGetterQtAllan Sandfeld Jensen2016-04-211-11/+16
| | | | | | | | | | | | | | | | | | | | | | Add comments to parts of URLRequestContextGetterQt that are subtle and I already forgot once. Also adds another update atomic to match the rest. Change-Id: I8193247ce76435ac0d169b740a4543099b3ffac2 Task-number: QTBUG-52790 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * Do not access browser-context to read user-agent or accept languageAllan Sandfeld Jensen2016-04-211-21/+2
| | | | | | | | | | | | | | | | | | | | | | | | Switches HttpUserAgentSettingsQt to reading local string that lives on the IO thread, instead of accessing a pointer that may be deleted. Also adds a test and fixes updating accept-language of already initialized WebContents. Change-Id: Iff4e3bd1ac40482a92bed50c3f703ed8b974b0ad Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
| * Fix saving cookiesMichal Klocek2016-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | Release CookieStore in URLRequestContextGetterQt destructor, this will eventually delete CookieMonsterDelegateQt and trigger commit of cookies in cookie store backend. Task-bumber: QTBUG-52121 Change-Id: Ic83c7ee3ece1c64ac9e47cba5dcf40e084d9c3dc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| * Improve thread-safety of custom scheme handlersAllan Sandfeld Jensen2016-04-201-5/+3
| | | | | | | | | | | | | | | | | | Avoids accessing the QWebEngineUrlSchemeHandler from any other thread than the UI thread, since it may be deleted at any time on the UI thread. Change-Id: Icb4331b3c36f6f619a9fd975d155a9fd608dc5e9 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * Switch BrowserContextAdapter to QSharedPointerAllan Sandfeld Jensen2016-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | BrowserContextAdapter is not a form of shared data, and using QExplicitSharedDataPointer on it as always been a misuse of the class. Instead we should switch it to QSharedPointer, which also allows us to use QWeakPointer. Change-Id: I8eb489b4a12d3fdddcde55821be294814a156a9d Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
| * Assert thread assumptionsAllan Sandfeld Jensen2016-04-191-0/+10
| | | | | | | | | | | | | | Assert and thereby also document thread assumptions. Change-Id: I44cd8b015ed8a6e38b9328f334f55d9d2f72b50d Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Merge branch '5.6' into 5.7Allan Sandfeld Jensen2016-04-181-1/+4
|\| | | | | | | Change-Id: I490e0ee46d3ff040ca26426feb7e4d6ef7098f94
| * Fix crash while settingPersistentStoragePathMichal Klocek2016-04-131-1/+4
| | | | | | | | | | | | | | | | | | | | Get rid of dangling pointer on storage removal in URLRequestContextGetterQt. This is accessed later in generateHttpCache. Task-number: QTBUG-52468 Change-Id: I03c0b3186b01046e17258af838bf5f9adc435da0 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Basic adaptation to Chromium 49Allan Sandfeld Jensen2016-03-071-13/+10
| | | | | | | | | | | | | | | | Converts types, callbacks and headers to match Chromium 49. Task-number: QTBUG-51173 Change-Id: I544ef46e187105e250fea1b48b72d2c81a906640 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Merge branch '5.6' into devAllan Sandfeld Jensen2016-02-041-4/+11
|\| | | | | | | Change-Id: I0bb971f01ee1e02da768f336680c8ec0254ab2b0
| * Fix crash on exit for view-owned QWebEngineUrlSchemeHandler objectsJoerg Bornemann2016-01-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For view-owned URL scheme handlers the destructor would remove the handler and then trigger URLRequestContextGetterQt::generateStorage. This would access the browser context from the IO thread while it already has been destroyed on the browser thread. Increment the ref count for the browser context before every call of generateStorage, and decrement it when generateStorage is finished. Task-number: QTBUG-50160 Change-Id: Id8b1505891ec56e93bf9d47f33bb8bc3304eb55a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
| * Avoid full storage update on installing URL scheme handlersJoerg Bornemann2016-01-191-2/+8
| | | | | | | | | | | | | | | | | | | | | | When installing/removing URL scheme handlers, do not update the full URLRequestContextStorage. Only update the job factory. This avoids calling the - potentially expensive - generateStorage() method superfluously often. Change-Id: I99c4ec479fcfdee4e97d86b858ea42f3cdccfec4 Task-number: QTBUG-50160 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Unify license header usage.Jani Heikkinen2016-02-011-11/+14
| | | | | | | | | | | | | | | | | | Update files using old header.LGPL3 to use header.LGPL Update files using old header.FLD to use new header.FDL Update files using old header.BSD to use new header.BSD Change-Id: I36a67aaa8c3ca6c7946308defc9c03c3571a7d23 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Extend HttpCacheType with NoCache optionSzabolcs David2016-01-271-0/+3
| | | | | | | | | | | | | | | | | | Add option to disable cache with passing NULL as cache backend. It behaves the same way as using HttpCache::set_mode(DISABLE), but saves some memory without instantiating backend factory. Change-Id: I1565cc773eda21a6bc73eebe14ab8046252a7755 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge branch '5.6' into devAllan Sandfeld Jensen2016-01-121-33/+100
|\| | | | | | | Change-Id: I4272eb59cac08c69eaa58dd4d94debf1b8c5cf78
| * Fix an assertion in QWebEngineCookieStoreSzabolcs David2016-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | Don't process pending cookies after resetting the CookieMonster to 0 in the CookieMonsterDelegateQt. We are destroying the old cookie store, so we can reject the pending cookies here. Task-number: QTBUG-50160 Change-Id: I0b2ca7ee0f5e3fdcf99680bb9c0a2772a10ff3f4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| * Use default URLRequestInterceptors passed from ChromiumAleksey Yermakov2015-12-161-8/+21
| | | | | | | | | | | | | | | | | | | | | | Default URLRequestInterceptors are required for App Cache and Service Workers support. They were previously ignored and dropped in BrowserContextQt::CreateRequestContext. Implementation in content shell was taken as a reference. Change-Id: I5a12e90febdb4c639f9ead9faf044df09431bdd0 Reviewed-by: Aleksey Yermakov <jp.kuraisu@gmail.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| * Merge remote-tracking branch 'origin/5.5' into 5.6Michael Bruning2015-12-091-24/+78
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp Change-Id: I451bc61673014db8e87b2a2cf98fb6879ce0e58d
| | * Reuse or clean up HttpNetworkSession when (re-) setting a cache type.Michael Bruning2015-12-041-24/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not reusing or cleaning up the session led to race conditions which in turn lead to crashes and asserts. Reuse the session if parameters match, clean up and it recreate otherwise. Task-number: QTBUG-49397 Change-Id: I4f846a448b50d80a3cf7c4f9bb833fa6d64974d7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | | Add function to clear data from the cacheSzabolcs David2016-01-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | It marks the entries of the current cache backend for deletion and starts to remove them. Task-number: QTBUG-48177 Change-Id: I85ec25048ff5429976f1b2dcacd74666bdbe6624 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-031-3/+3
|\| | | | | | | | | | | Change-Id: I052fdc4245e25e58457d51f6e49703bc7dd8ff00
| * | Rename QWebEngineCookieStoreClient to QWebEngineCookieStoreMichal Klocek2015-12-011-3/+3
| | | | | | | | | | | | | | | Change-Id: I8f9a4c5c155a65ede24908799218fd867db0767c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | Adapting to Chromium 47Allan Sandfeld Jensen2015-10-271-11/+11
|/ / | | | | | | | | | | | | Updating to Chromium 47 and adapting API. Change-Id: Id465bbcd4facd7c47cb8a9f4bd4e18cbdc0d1120 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Decouple scheme and url scheme handlerAllan Sandfeld Jensen2015-10-161-8/+11
| | | | | | | | | | | | | | | | | | Remove the scheme from the url scheme handler constructor, this way the same handler can handle multiple schemes, the API look more natural and we can get rid of the private class. Change-Id: I33906b8a5ea51641e28a53f93f4feb1472c24baf Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Remove unnecessay delegation over CustomUrlSchemeHandlerAllan Sandfeld Jensen2015-10-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | With QWebEngineSchemeHandler in QtWebEngineCore, we do not need the indirection and delegation CustomUrlSchemeHandler provided. This means the class can be removed and we can also store the handlers directly in BrowserContextAdapter and save a copy of the installed handlers in the QWebEngineProfile. Change-Id: Iabb5cc9d364c2f2a879bc77bfb2ff14b3c2ff640 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Revert "Introduce ProxyResolverQt"Pierre Rossi2015-08-191-16/+11
| | | | | | | | | | | | | | | | | | This reverts commit 0e006b8ea755ebad01faf3e747e61abdf158289a. The workaround is not needed anymore since the v8 proxy resolver is now used by default. Change-Id: Ifea4ca6c6a0b0442cc1d8d22b1eb1553f3319524 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge branch '5.5' into 5.6Allan Sandfeld Jensen2015-08-181-6/+24
|\| | | | | | | Change-Id: I9977663123560a22f493b8c02d02de8897b38666
| * Use v8 backend for proxy resolutionKai Koehne2015-07-231-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the v8 proxy resolution backend instead of the native one in the multi-process case. This fixes a particular issue on windows where the winhttp one will attempt to find proxy servers for every single request: https://crbug.com/40797 . Chrome uses the v8 backend too. Resort to the native backend though if started with --single-process. This is because the Chromium renderer and the V8 ProxyResolver can't run in the same process. See also proxy_resolver_v8.h: // It is important that *ALL* instances of V8 in the process be using // v8::Locker. If not there can be race conditions between the non-locked V8 // instances and the locked V8 instances used by ProxyResolverV8 (assuming they // run on different threads). // // This is the case with the V8 instance used by chromium's renderer -- it runs // on a different thread from ProxyResolver (renderer thread vs PAC thread), // and does not use locking since it expects to be alone. Task-number: QTBUG-44763 Change-Id: I7b48cb9d0f3c41fdddffc9eb9f51d83442d80622 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | add API to set the Accept-Language HTTP request-header fieldJoerg Bornemann2015-08-041-2/+21
| | | | | | | | | | | | | | | | | | | | Add methods to set the Accept-Language field in QWebEngineProfile and QQuickWebEngineProfile. Task-number: QTBUG-47412 Change-Id: Ifa376bb3551fdc1fb3d68279d734b7f7735782fc Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Add API for intercepting url requestsAndras Becsi2015-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is adding a QWebEngineUrlRequestInterceptor interface that can be subclassed to observe or intercept all resource requests making it possible to implement browser features like adblocking and setting custom request headers for url requests. The interceptRequest virtual function is executed on the IO thread. This patch also includes a unit test for the testable API parts. Change-Id: Ibe740fc55551a9a5da40794088ccb6d03d913631 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Martin Rotter <rotter.martinos@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Add cookie API testsAndras Becsi2015-07-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tests the part of the cookie API that can be tested locally. The notification about third-party cookies (acceptCookieFromUrl) can not be tested locally since it requires cookies to be set from a different domain than the main frame, which requires a remote host or a local web server with support for virtual DNS. Testing requires the ability to set cookies for local pages loaded through the qrc scheme. We could eventually extend this in the future to enable setting cookies on registered custom schemes, but for that we might have to implement our own cookie store. Since Chromium's cookie store relies on source url's to manage cookies and qrc:// cookies do not specify a domain, a specific source url is needed to be able to delete an individual cookie that has been set by a page loaded through qrc://. This patch requires a new function on QNetworkCookie to be able to forward the source url of the cookie to Chromium. Change-Id: I97dd04b27fbb8ec63060f9b741ad65c29a773a6c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Other changes for Chromium 44Allan Sandfeld Jensen2015-07-011-3/+2
| | | | | | | | | | | | | | Minor changes for Chromium 44 that didn't fit in anywhere else. Change-Id: I569422239acd077e33e1878a1d5dc7afeac0bea6 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Fix ProxyResolverQt for Chromium 44Allan Sandfeld Jensen2015-06-231-3/+4
| | | | | | | | | | | | | | | | | | We now have to construct the proxy service using a proxy resolver factory. Change-Id: Id5c7957165f997c4a7f05d24d77b4ae68efd5a62 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com> Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* | Add QWebEngineCookieStoreClient core APIAndras Becsi2015-06-161-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class or its subclass can be set on the QWebEngineProfile and its API enables intercepting Chromium's cookies, setting and deleting cookies in the cookie store. These functions are asynchronous so if the result of the task is needed the user can provide a callback which will be run on the calling thread when the requested operation finishes. This does not include a hook for QQuick layer yet, there we have to figure out what the most convenient way is from a developer's perspective. Change-Id: I6a3af071883ce632df7a2fb952da93f306ac3fe2 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* | Introduce ProxyResolverQtPierre Rossi2015-06-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | This allows using QtNetwork's proxy auto conf detection code from QNetworkProxyFactory, by setting the QTWEBENGINE_USE_QT_PROXYRESOLVER environment variable. Otherwise, we still rely on chromium's implementation. Task-number: QTBUG-45376 Change-Id: I7b8b77c932060ad36090d388d616b713d93cad0a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Support QNetworkProxy::applicationProxyPierre Rossi2015-05-291-2/+3
|/ | | | | | | | | Implement a ProxyConfigService that keeps track of the state of Qt's application proxy which, if set, takes precedence over the system settings. Change-Id: I7f1eba9015b70cf90f53a41736dd0a6d0ad28489 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix crash when updating a storage context with active requestsAllan Sandfeld Jensen2015-05-061-0/+12
| | | | | | | | | | Requests keep pointers to objects owneded by the storage context such as the SSL context handler and HTTP cache. This means we must stop all requests before destroying the context, otherwise the requests will access deleted data. Change-Id: I67863287b3ffb470c8d84ff6cac143493998a6da Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Add namespace to internal QtWebEngine APIAllan Sandfeld Jensen2015-03-021-0/+4
| | | | | | | | Adds the QtWebEngineCore namespace to all internal core API. This ensures we don't export any internal symbols in the global namespace. Change-Id: I26af888ea7c6c4c4d0f04c24a377c1a9d3c92751 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Synchronize with QAtomic instead of volatileAllan Sandfeld Jensen2015-02-201-23/+21
| | | | | | | | Replaces the three volatile bool with two atomic ints and an atomic pointer. Change-Id: Iad41aef4952bbf7de77523ffd729bd00ace68ee9 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>