summaryrefslogtreecommitdiffstats
path: root/src/core/profile_io_data_qt.h
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2018-12-04 13:05:13 +0100
committerJüri Valdmann <juri.valdmann@qt.io>2019-01-02 10:47:46 +0000
commitd8eaae80844eed5be48a606f2c604157c9cba7b4 (patch)
tree3c432d88667a6676460c63cdf33a4828b2a423cb /src/core/profile_io_data_qt.h
parent024aef49ee324bf45c29e85c9a637b1495292503 (diff)
Lock profile mutex during interceptRequest
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>
Diffstat (limited to 'src/core/profile_io_data_qt.h')
-rw-r--r--src/core/profile_io_data_qt.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h
index 6961e2ad2..5b416861c 100644
--- a/src/core/profile_io_data_qt.h
+++ b/src/core/profile_io_data_qt.h
@@ -89,10 +89,13 @@ public:
void generateUserAgent();
void generateJobFactory();
void regenerateJobFactory();
- QWebEngineUrlRequestInterceptor *requestInterceptor();
bool canSetCookie(const QUrl &firstPartyUrl, const QByteArray &cookieLine, const QUrl &url) const;
bool canGetCookies(const QUrl &firstPartyUrl, const QUrl &url) const;
+ // Used in NetworkDelegateQt::OnBeforeURLRequest.
+ QWebEngineUrlRequestInterceptor *acquireInterceptor();
+ void releaseInterceptor();
+
void setRequestContextData(content::ProtocolHandlerMap *protocolHandlers,
content::URLRequestInterceptorScopedVector request_interceptors);
void setFullConfiguration(); // runs on ui thread