diff options
author | Michal Klocek <michal.klocek@qt.io> | 2022-06-22 17:16:54 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-06 03:08:07 +0000 |
commit | e83ed04bd3ee4d9aedbda1ac71a3ebc019d54459 (patch) | |
tree | de52aef86eb61d08201cb538034ce4bcd3f96442 /src/core | |
parent | f04afb9c7adabbd9db680318da8323168601c676 (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/core')
-rw-r--r-- | src/core/net/system_network_context_manager.cpp | 10 |
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 962266d78..f6e7cb630 100644 --- a/src/core/net/system_network_context_manager.cpp +++ b/src/core/net/system_network_context_manager.cpp @@ -292,7 +292,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 |