From 32f83d9c2c884dfa516095c07f8590b2c4c99321 Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Thu, 3 Dec 2015 11:16:32 +0100 Subject: Reuse or clean up HttpNetworkSession when (re-) setting a cache type. 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 --- src/core/url_request_context_getter_qt.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/url_request_context_getter_qt.h') diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h index 38cfd7957..dc861f8da 100644 --- a/src/core/url_request_context_getter_qt.h +++ b/src/core/url_request_context_getter_qt.h @@ -45,6 +45,7 @@ #include "base/single_thread_task_runner.h" #include "content/public/browser/content_browser_client.h" #include "content/public/common/url_constants.h" +#include "net/http/http_network_session.h" #include "net/url_request/url_request_context_storage.h" #include "net/url_request/url_request_job_factory_impl.h" #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" @@ -84,6 +85,8 @@ private: void generateHttpCache(); void generateUserAgent(); void generateJobFactory(); + void cancelAllUrlRequests(); + net::HttpNetworkSession::Params generateNetworkSessionParams(); bool m_ignoreCertificateErrors; QAtomicInt m_updateCookieStore; -- cgit v1.2.3 From 318cd591e2af2a8f825a0742762a5d93345e0753 Mon Sep 17 00:00:00 2001 From: Aleksey Yermakov Date: Tue, 15 Dec 2015 17:13:05 +0300 Subject: Use default URLRequestInterceptors passed from Chromium 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 Reviewed-by: Allan Sandfeld Jensen --- src/core/url_request_context_getter_qt.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/url_request_context_getter_qt.h') diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h index 247247f7c..f61e4f09b 100644 --- a/src/core/url_request_context_getter_qt.h +++ b/src/core/url_request_context_getter_qt.h @@ -67,7 +67,7 @@ class BrowserContextAdapter; class URLRequestContextGetterQt : public net::URLRequestContextGetter { public: - explicit URLRequestContextGetterQt(BrowserContextAdapter *browserContext, content::ProtocolHandlerMap *protocolHandlers); + explicit URLRequestContextGetterQt(BrowserContextAdapter *browserContext, content::ProtocolHandlerMap *protocolHandlers, content::URLRequestInterceptorScopedVector request_interceptors); virtual net::URLRequestContext *GetURLRequestContext() Q_DECL_OVERRIDE; virtual scoped_refptr GetNetworkTaskRunner() const Q_DECL_OVERRIDE; @@ -100,9 +100,11 @@ private: scoped_ptr m_urlRequestContext; scoped_ptr m_networkDelegate; scoped_ptr m_storage; - scoped_ptr m_jobFactory; + scoped_ptr m_jobFactory; scoped_ptr m_dhcpProxyScriptFetcherFactory; scoped_refptr m_cookieDelegate; + content::URLRequestInterceptorScopedVector m_requestInterceptors; + friend class NetworkDelegateQt; }; -- cgit v1.2.3