summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-06-22 17:16:54 +0200
committerMichal Klocek <michal.klocek@qt.io>2022-08-05 22:33:23 +0200
commit1b6633d1ce86eaf43b750a03a785793512e487ed (patch)
tree1d75f025e8674841e72b5206aa392a49a5f4d522 /src
parenteac1777e88f93e50f57c16cf0d4ec0c60b473e66 (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 Pick-to: 6.4 6.3 Change-Id: Id3221d1b8b3896f0ced3d0cd7cb9d9eceeb929cc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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