Skip to content

Commit 6b347ed

Browse files
Michal Klocekkkoehne
authored andcommitted
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 <[email protected]>
1 parent dd7c3f9 commit 6b347ed

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/core/net/url_request_context_getter_qt.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ void URLRequestContextGetterQt::updateStorageSettings()
182182
new ProxyConfigServiceQt(
183183
net::ProxyService::CreateSystemProxyConfigService(
184184
content::BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)));
185-
m_proxyResolverFactory = ChromeMojoProxyResolverFactory::CreateWithStrongBinding();
185+
//pass interface to io thread
186+
m_proxyResolverFactoryInterface = ChromeMojoProxyResolverFactory::CreateWithStrongBinding().PassInterface();
186187

187188
if (m_contextInitialized)
188189
content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
@@ -259,8 +260,9 @@ void URLRequestContextGetterQt::generateStorage()
259260
if (!m_dhcpProxyScriptFetcherFactory)
260261
m_dhcpProxyScriptFetcherFactory.reset(new net::DhcpProxyScriptFetcherFactory);
261262

263+
proxy_resolver::mojom::ProxyResolverFactoryPtr proxyResolver(std::move(m_proxyResolverFactoryInterface));
262264
m_storage->set_proxy_service(content::CreateProxyServiceUsingMojoFactory(
263-
std::move(m_proxyResolverFactory),
265+
std::move(proxyResolver),
264266
std::unique_ptr<net::ProxyConfigService>(proxyConfigService),
265267
std::make_unique<net::ProxyScriptFetcherImpl>(m_urlRequestContext.get()),
266268
m_dhcpProxyScriptFetcherFactory->Create(m_urlRequestContext.get()),

src/core/net/url_request_context_getter_qt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class URLRequestContextGetterQt : public net::URLRequestContextGetter {
126126
content::URLRequestInterceptorScopedVector m_requestInterceptors;
127127
std::unique_ptr<net::HttpNetworkSession> m_httpNetworkSession;
128128
std::unique_ptr<net::HttpAuthPreferences> m_httpAuthPreferences;
129-
proxy_resolver::mojom::ProxyResolverFactoryPtr m_proxyResolverFactory;
129+
mojo::InterfacePtrInfo<proxy_resolver::mojom::ProxyResolverFactory> m_proxyResolverFactoryInterface;
130130
std::unique_ptr<net::TransportSecurityPersister> m_transportSecurityPersister;
131131

132132
QList<QByteArray> m_installedCustomSchemes;

0 commit comments

Comments
 (0)