summaryrefslogtreecommitdiffstats
path: root/src/core/net
Commit message (Collapse)AuthorAgeFilesLines
* Tie client certificate stores to profilesAllan Sandfeld Jensen2019-03-012-10/+11
| | | | | | | | Move the client certificate store from being global to being tied to individual profiles. Change-Id: Ib21ae14c501b7d0612b84ae7535120291aeeada2 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* API cleanupAllan Sandfeld Jensen2019-02-272-2/+2
| | | | | | | Based on review feedback Change-Id: Ide40d4fd563ea682eaa2cc457d857445adea85cd Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Make client certificate store thread safeAllan Sandfeld Jensen2019-02-254-18/+64
| | | | | | | | If the users manipulate the API from the UI, we need to read from the UI thread as well. Change-Id: I8af787a357954cff4fbdd94bcf27b880fb6aecb4 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Do not create the native client cert store on every requestAllan Sandfeld Jensen2019-02-112-17/+13
| | | | | | | | | Create it once and keep it around. Also contains drive-by coding style fixes. Change-Id: I8b159ae332080b31ed64fab99ad6bb3d8b4d5e3b Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Cleanup client cert store filesAllan Sandfeld Jensen2019-02-114-0/+452
| | | | | | | | The files were not in the right places and wasn't split correctly in domains. Change-Id: Ia0d3b1c8f9bc6082f338a09cb64c4bb4b1aa16ad Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Move QWebEngineUrlRequestInterceptor::intercept to ui threadMichal Klocek2019-02-043-34/+61
| | | | | | | | | | | | | | | | | | | Currently interceptor sufferers thread safety issues, when custom profiles are deleted, interceptor is set to be nullptr, however it can be still referenced in IO thread. Since profile was split to ui and io part, where io part can outlive the ui part, this can boost thread safety issues. Since QWebEngineUrlRequestInterceptor is living on ui thread simplify the logic move intercept call to ui thread. This fixes the issue of referencing interceptor in io thread. Add new method to install interceptor setUrlRequestInterceptor, and deprecate old one. Update interceptor install method name on page to match the profile one. Task-number: QTBUG-69844 Change-Id: I5dd2b6b734fd91906cccc6c1408ffbe7b1b4250c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move url_request_notification to own unitMichal Klocek2019-02-043-135/+255
| | | | | Change-Id: I37a0a7194e339136d73e9c8f7faebb8c97ee2c97 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add proxy switches handlingMichal Klocek2019-02-042-5/+19
| | | | | | | | | | | This change adds switches for proxy: https://www.chromium.org/developers/design-documents/network-settings [ChangeLog] Uses proxy switches for initial proxy configuration Fixes: QTBUG-71229 Change-Id: I1bc02f20c20d737234c650a18f0e0f7c1c63a464 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add HTTP request headers to custom URL schemes (reland)Allan Sandfeld Jensen2019-01-305-7/+38
| | | | | | | | | | Makes it possible to read extra headers added to the request. This reverts commit 9cbe64c54dee8451794e29f4357ccfac6d883e6b. Task-number: QTBUG-69844 Change-Id: I5c5e0c06655d5f764227fdc97fdb0c2a189f532d Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chromium 71Allan Sandfeld Jensen2019-01-286-62/+76
| | | | | | | Change-Id: Ib650113b05dfd4771240804f94e33c07aa317bf2 Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Adaptations for Chromium 70Allan Sandfeld Jensen2019-01-282-1/+4
| | | | | | | Change-Id: I8bb77784dbc8a0b9debd96a4c49421bd34e6a0df Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devMichael Brüning2019-01-181-3/+11
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/core/net/network_delegate_qt.cpp src/core/profile_io_data_qt.cpp src/core/web_engine_context.h tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp Change-Id: Id98e3f52f548ceb5b68abd80aedd6ae59db72cc0
| * Fix QWebEngineUrlRequestInfo::firstPartyUrl() after 69-basedTamas Zakor2019-01-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue was introduced by this Chromium change: https://chromium-review.googlesource.com/c/chromium/src/+/1025772/ Add new auto tests for first party url. Depends on Chromium change: d2f5d6869f Add net::URLRequest::first_party_url() Task-number: QTBUG-70790 Change-Id: Ib43bde69990e7fb1d495cc32ac2f6860a613f185 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Lock profile mutex during interceptRequestJüri Valdmann2019-01-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes setRequestInterceptor take effect atomically, so it's always safe to delete the interceptor after unsetting it from the profile. On the other hand, we run into a deadlock if the user code tries to wait for a profile operation on the UI thread to finish. It seems quite unlikely though that user code would do that and it would probably still be easier for users to understand and debug than the current non-deterministic use-after-free problems. Task-number: QTBUG-72260 Change-Id: I1784a9d9f00029d440508f0bb076d1081a326758 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-281-0/+1
|\| | | | | | | Change-Id: Idf2c89bebf5e09855d764808cac487bc4b76faaa
| * Fix use-after-free in URLRequestCustomJobProxy::replyJüri Valdmann2018-11-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following operations are executing concurrently on the UI & IO threads: 1. UI thread executes QWebEngineUrlRequestJob::reply --> PostTask(IO, URLRequestCustomJobProxy::reply). IO thread executes URLRequestCustomJob::Kill --> PostTask(UI, URLRequestCustomJobProxy::release). 2. UI thread executes URLRequestCustomJobProxy::release, then deletes the QWebEngineUrlRequestJob and the QIODevice. IO thread executes URLRequestCustomJobProxy::reply and tries to use the QIODevice. Depending on scheduling, the IO thread will try to use the QIODevice after it has been deleted on the UI thread. Change-Id: I7a9793a7492a493e1787e7ee6d0058c0d1aa00ac Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devAllan Sandfeld Jensen2018-11-051-7/+0
|\| | | | | | | | | | | | | | | | | Conflicts: src/core/render_widget_host_view_qt.cpp src/core/web_contents_adapter_client.h src/webenginewidgets/api/qwebenginepage_p.h Change-Id: Ibd011c40839c09469218ac4c71a13d0a0b1c9778
| * Remove some outdated Qt version checksAllan Sandfeld Jensen2018-10-231-7/+0
| | | | | | | | | | | | | | | | We can't not build with older than Qt 5.9 anyway due to QSG and qmake changes. Change-Id: Iff0247e70d9ffc1e045e2c571f0089d68df9a589 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Use QWebEngineUrlSchemeHandler for qrcJüri Valdmann2018-10-314-252/+33
| | | | | | | | | | | | | | | | Delete qrc protocol handler and use custom scheme protocol handler instead. Fixes: QTBUG-71215 Change-Id: I8aa390552c80b591a92f52b8a388e5a707d28f9e Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Move the profiles' url scheme handler API to coreJüri Valdmann2018-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | Implementation of the url scheme handler API in QWebEngineProfile and QQuickWebEngineProfile is exactly identical, so move it to the ProfileAdapter instead. Change-Id: I01baf1c4e5b3c393675adefb0470def90b8b2813 Task-number: QTBUG-71215 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devJüri Valdmann2018-10-221-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/net/network_delegate_qt.cpp Changed to src/3rdparty: 156c2b70 Disable "some invariants violation checks" for Qt 52bf8b45 Support non-base::Thread GPU thread ba4a51bc [Backport] Speculative fix for mac DCHECK failure 508fda09 Add support for static-libraries to our GN integration Change-Id: If0205ce032ce86b5759b321b6d907b0431b6a978
| * Cleanup web_contents_view_qt.hAllan Sandfeld Jensen2018-10-211-0/+1
| | | | | | | | | | | | | | It had too many headers, and many files depending on its over inclusion. Change-Id: I5add1c4e07a14e017ac60db75efab5fc11e4166f Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Add setRequestInterceptor to QWebEnginePageAllan Sandfeld Jensen2018-10-171-46/+72
|/ | | | | | | | | | | | Makes it possible to make page specific intercepts, and is at the same time safer by running in the UI-thread. [ChangeLog][QtWebEngineWidgets][QWebEnginePage] Added setRequestInterceptor, similar to the same call on profile except it operates on a per-page basis and on the UI-thread. Change-Id: Id5a7173156c25d0f030f00b6ef314d283c7c8cdd Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Update Chromiumv5.12.0-beta1Allan Sandfeld Jensen2018-10-022-5/+4
| | | | | | | | | | | | | | | Changes: 8e6f5751e5 Restore media::FFmpegGlue::InitializeFFmpeg() 0c8d188f16 Add x86 target support for gn 2a52817b6e Fix creation of 'x86' toolchain in gn 3a84c2a8bc Add support for modules limiting jumbo width c69fdae9c7 BASELINE: Update Chromium to 69.0.3497.113 3a783ba38b Merge remote-tracking branch 'origin/upstream-master' into 69-based a4ecaddc7c Remove missing symlink to gen from perfetto/ui/src 3f8994c671 [Backport] Use newer GrGLFunction based on templated function types rather than pointers. Change-Id: Ibfe810c1c9b88e25e9093fbb2aa213249f1a77bf Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* General adaptations for Chromium 69Allan Sandfeld Jensen2018-09-228-35/+36
| | | | | Change-Id: Ifeaf0ee13213dc5a24d2f2b4655cf7f405cddef7 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Michael Brüning2018-08-211-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf configure.json examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc mkspecs/features/platform.prf src/3rdparty src/core/media_capture_devices_dispatcher.cpp src/core/net/url_request_context_getter_qt.cpp src/core/net/url_request_context_getter_qt.h src/core/web_contents_adapter.cpp Change-Id: I467133ba455b1f85f6bb61793794c31cb1094541
| * Use net::TransportSecurityPersister to persist HSTS stateJüri Valdmann2018-07-252-1/+20
| | | | | | | | | | | | Task-number: QTBUG-69605 Change-Id: I863db484ff2bcf558585f75c73963097fb43148a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * QWebEngineUrlRequestJob: QUrl("null") for unique initiator originsJüri Valdmann2018-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The empty URL is used both for representing a missing origin (browser-initiated navigation request) and a unique/opaque origin. This is problematic since the security implications are very different in these two cases: browser-initiated requests usually should have high security clearance, while requests from unique origins should be restricted. Task-number: QTBUG-69372 Change-Id: Iff73fd1c9a29f1c5c281a8945536333081ff2d6b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Unfriend NetworkDeleagte from ProfileIODataMichal Klocek2018-08-103-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Directly accessing IOProfileData's m_requestInterceptor from NetworkDelegateQt is not thread safe, unfriend the class. This change does not fix the issue of thread safety of accessing the requestinterceptor from NetworkDelegateQt, it is just a cleanup for following commit. Task-number: QTBUG-69844 Change-Id: I488f8968b38ad200178cea2cb0304e1c93aec711 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Revert "Add HTTP request headers to custom URL schemes"Michal Klocek2018-08-095-36/+8
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a5bdc6236ad52586579a9a3da6a059835ed60761 and 04355f4d6f311adebfc354b094a5f79c6327e86f. CI still crashes on tst_QWebEngineProfile::urlSchemeHandler tests, issue is not reproducible locally and it will take time to investigate. Task-number: QTBUG-69844 Change-Id: I7ddb6a32383400d553fe692c24effb6dfb7b6102 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Add HTTP request headers to custom URL schemesAllan Sandfeld Jensen2018-08-035-8/+36
| | | | | | | | | | | | | | Makes it possible to read extra headers added to the request. Change-Id: I4af0ba8a5b28488b8f12a2cff29807575c24f026 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Rename BrowserContextAdapter to ProfileAdapterMichal Klocek2018-07-098-20/+20
| | | | | | | | | | | | | | | | | | Follow change of BrowserContextQt to ProfileQt. Fix wrong naming usage of browserContext instead of browserContextAdapter. Change-Id: I75fdac685d9bffd44f0144921d3e87305d6d44c9 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Adaptations for Chromium 67Allan Sandfeld Jensen2018-06-264-16/+15
| | | | | | | | | | Change-Id: I13cedba56012f74651a044d6fa8f0957487bf3eb Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Adaptations for Chromium 66Allan Sandfeld Jensen2018-06-266-15/+16
| | | | | | | | | | Change-Id: Iee88721a50036d4ef85a23dd1708d4fb84218708 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Update export symbols for webenginecore moduleMichal Klocek2018-06-153-6/+39
| | | | | | | | | | | | | | | | | | | | | | Use own WEBENGINECORE_EXPORT define, mark most headers private and use WEBENGINECORE_PRIVATE_EXPORT for it. For sanity, add "WARNING" as for private headers even though they are never installed. Change-Id: I523d28c1d00217f48bc63dabf138dd3a7eb482d4 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Fix use-after-free of QWebEngineCookieStorePrivateJüri Valdmann2018-06-062-24/+60
| | | | | | | | | | | | | | | | | | After cfddf26f7 tst_qwebenginecookiestore is crashing for me due to onDeleteCallbackResult being invoked after QWebEngineCookieStorePrivate has been already destroyed. Change-Id: I890c15ed789a0e7410b5577ab545a6021f6d6ece Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Refactor out ProfileIODataQtMichal Klocek2018-05-254-684/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we can crash due to use-after-free of browser context, it happens due to fact that resource context has pointer to browser context which is destroyed on ui thread, while resource context is destroyed on io thread. We used url request getter to maintain objects destruction on io thread. Refactor the code and create profile io data, which will live on io thread, move all the objects currently maintained by url request getter qt to newly created class. Fix destruction order and remove references to browser context from resource context. Compared to url request getter, profile io data is not ref counted class and uses weak pointer factory to handle all "generate" requests. Task-number: QTBUG-67865 Change-Id: Iee4fec854eda1c1600d26e991657d4877cbc966f Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Rename BrowserContextQt to ProfileQtMichal Klocek2018-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Following commits are going to introduce ProfileIODataQt and to keep things self documented just rename the class so it reflects Chromium one. Fix minor style issues in profile_qt.h Presort include headers as requested on review. Change-Id: If58f5aec8ac64cfaf30642195838a77497b75244 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Track BrowserContextAdapter in WebEngineContextMichal Klocek2018-05-231-0/+1
| | | | | | | | | | | | | | | | Instead of keeping BrowserContextAdapter as a child of global object add them to the list kept by WebEngineContext. Change-Id: I626ca6ff6dec3eb76530e3cfb6d589cb961a5795 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Change BrowserContextAdapter to be QPointerMichal Klocek2018-05-188-52/+54
|/ | | | | | | | | | | | | | | | | | | BrowserContextAdapter is living and accessed only in UI thread, remove QSharedPointer usage and change QWebengineProfile to use QPointer. Prevent BrowserContextAdapter outliving WebEngineContext by setting globalObject as a parent to track WebEngineContext destruction. This commits tries to simplify the life cycle handling of browser context, it removes profile shutdown methods and QWebEngineBrowserContext, which was used to track profile destruction. Task-number: QTBUG-62147 Change-Id: I79f2c38a123cd053e3a59f4900afbdc759a396fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Remove some unused header includes from corePeter Varga2018-03-212-13/+1
| | | | | Change-Id: Ie5bcf9cfb249f364dbe01a8bee98aada2acdd38f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Cleanup file locationsAllan Sandfeld Jensen2018-03-2024-0/+3731
Move printing and network specific classes to subdirectories so we have fewer files in the main dir. Change-Id: I675b1b8b8fd1588061104cec181087f305b44f98 Reviewed-by: Kai Koehne <kai.koehne@qt.io>