diff options
author | Michal Klocek <michal.klocek@qt.io> | 2018-09-27 14:51:24 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2018-09-28 15:04:01 +0000 |
commit | 6b347edb557bf0bbcf6b7b1ef30494f2c2db2397 (patch) | |
tree | 15f1c966dbfc85c31187a72141c56fbd7547e8ac | |
parent | dd7c3f92c4668ed9ebdb1714d00de1cb61ab7dd4 (diff) |
Do not bind resolve proxy factory on ui thread
Pass interface to io thread and bind there.
Task-number: QTBUG-69281
Change-Id: Ia8630cb7ff216cecaec5274a0b3da3ef0881fcea
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
-rw-r--r-- | src/core/net/url_request_context_getter_qt.cpp | 6 | ||||
-rw-r--r-- | src/core/net/url_request_context_getter_qt.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/core/net/url_request_context_getter_qt.cpp b/src/core/net/url_request_context_getter_qt.cpp index 1bb7b080f..e964aff65 100644 --- a/src/core/net/url_request_context_getter_qt.cpp +++ b/src/core/net/url_request_context_getter_qt.cpp @@ -182,7 +182,8 @@ void URLRequestContextGetterQt::updateStorageSettings() new ProxyConfigServiceQt( net::ProxyService::CreateSystemProxyConfigService( content::BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); - m_proxyResolverFactory = ChromeMojoProxyResolverFactory::CreateWithStrongBinding(); + //pass interface to io thread + m_proxyResolverFactoryInterface = ChromeMojoProxyResolverFactory::CreateWithStrongBinding().PassInterface(); if (m_contextInitialized) content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, @@ -259,8 +260,9 @@ void URLRequestContextGetterQt::generateStorage() if (!m_dhcpProxyScriptFetcherFactory) m_dhcpProxyScriptFetcherFactory.reset(new net::DhcpProxyScriptFetcherFactory); + proxy_resolver::mojom::ProxyResolverFactoryPtr proxyResolver(std::move(m_proxyResolverFactoryInterface)); m_storage->set_proxy_service(content::CreateProxyServiceUsingMojoFactory( - std::move(m_proxyResolverFactory), + std::move(proxyResolver), std::unique_ptr<net::ProxyConfigService>(proxyConfigService), std::make_unique<net::ProxyScriptFetcherImpl>(m_urlRequestContext.get()), m_dhcpProxyScriptFetcherFactory->Create(m_urlRequestContext.get()), diff --git a/src/core/net/url_request_context_getter_qt.h b/src/core/net/url_request_context_getter_qt.h index 717827543..0e4e84b4a 100644 --- a/src/core/net/url_request_context_getter_qt.h +++ b/src/core/net/url_request_context_getter_qt.h @@ -126,7 +126,7 @@ private: content::URLRequestInterceptorScopedVector m_requestInterceptors; std::unique_ptr<net::HttpNetworkSession> m_httpNetworkSession; std::unique_ptr<net::HttpAuthPreferences> m_httpAuthPreferences; - proxy_resolver::mojom::ProxyResolverFactoryPtr m_proxyResolverFactory; + mojo::InterfacePtrInfo<proxy_resolver::mojom::ProxyResolverFactory> m_proxyResolverFactoryInterface; std::unique_ptr<net::TransportSecurityPersister> m_transportSecurityPersister; QList<QByteArray> m_installedCustomSchemes; |