From 6b347edb557bf0bbcf6b7b1ef30494f2c2db2397 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 27 Sep 2018 14:51:24 +0200 Subject: 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 --- src/core/net/url_request_context_getter_qt.cpp | 6 ++++-- 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(proxyConfigService), std::make_unique(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 m_httpNetworkSession; std::unique_ptr m_httpAuthPreferences; - proxy_resolver::mojom::ProxyResolverFactoryPtr m_proxyResolverFactory; + mojo::InterfacePtrInfo m_proxyResolverFactoryInterface; std::unique_ptr m_transportSecurityPersister; QList m_installedCustomSchemes; -- cgit v1.2.3