summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-06-22 17:16:54 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-16 07:50:46 +0000
commit9669a4cdf302d7791d1888702cb2b5731a656fa6 (patch)
treeb9a238da8e566cfc3d070f6192bb3fecd2be29cb /src
parent57b5982690399d0b5713e8129707c3ffc45fe0a1 (diff)
Fix single process crash when proxy pac is used
Using proxy v8 resolver ends up in race condition when render thread tries to evaluate extension handle and v8 proxy resolver evaluates proxy pac script. Disable v8 proxy resolver for single process mode. Issue tracked upstream http://crbug.com/474654 Modify the unit test to catch the crash case, the test loads now network resource but it does not matter as we do not check for failure or success. Fixes: QTBUG-104436 Change-Id: Id3221d1b8b3896f0ced3d0cd7cb9d9eceeb929cc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1b6633d1ce86eaf43b750a03a785793512e487ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/core/net/system_network_context_manager.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index 7e5de7d2b..3ee06b7c9 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -267,7 +267,15 @@ void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams(network::
// respect prefs::kEnableReferrers from the appropriate pref store.
network_context_params->enable_referrers = false;
- network_context_params->proxy_resolver_factory = ChromeMojoProxyResolverFactory::CreateWithSelfOwnedReceiver();
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(switches::kSingleProcess)) {
+ LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode.";
+ } else {
+ network_context_params->proxy_resolver_factory =
+ ChromeMojoProxyResolverFactory::CreateWithSelfOwnedReceiver();
+ }
// Use the SystemNetworkContextManager to populate and update SSL
// configuration. The SystemNetworkContextManager is owned by the