mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
chrome: Fix shutdown crashes with multi-threaded-message-loop (fixes issue #3403)
This commit is contained in:
@@ -15,8 +15,10 @@
|
||||
#include "libcef/common/resource_util.h"
|
||||
#include "libcef/renderer/chrome/chrome_content_renderer_client_cef.h"
|
||||
|
||||
#include "base/base_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/threading/threading_features.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "components/embedder_support/switches.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
@@ -124,6 +126,29 @@ absl::optional<int> ChromeMainDelegateCef::BasicStartupComplete() {
|
||||
switches::kUncaughtExceptionStackSize,
|
||||
base::NumberToString(settings_->uncaught_exception_stack_size));
|
||||
}
|
||||
|
||||
std::vector<std::string> disable_features;
|
||||
|
||||
if (!!settings_->multi_threaded_message_loop &&
|
||||
base::kEnableHangWatcher.default_state ==
|
||||
base::FEATURE_ENABLED_BY_DEFAULT) {
|
||||
// Disable EnableHangWatcher when running with multi-threaded-message-loop
|
||||
// to avoid shutdown crashes (see issue #3403).
|
||||
disable_features.push_back(base::kEnableHangWatcher.name);
|
||||
}
|
||||
|
||||
if (!disable_features.empty()) {
|
||||
DCHECK(!base::FeatureList::GetInstance());
|
||||
std::string disable_features_str =
|
||||
command_line->GetSwitchValueASCII(switches::kDisableFeatures);
|
||||
for (auto feature_str : disable_features) {
|
||||
if (!disable_features_str.empty())
|
||||
disable_features_str += ",";
|
||||
disable_features_str += feature_str;
|
||||
}
|
||||
command_line->AppendSwitchASCII(switches::kDisableFeatures,
|
||||
disable_features_str);
|
||||
}
|
||||
}
|
||||
|
||||
if (application_) {
|
||||
|
@@ -74,6 +74,7 @@ void ChromeMainRunnerDelegate::AfterUIThreadShutdown() {
|
||||
static_cast<ChromeContentBrowserClient*>(
|
||||
CefAppManager::Get()->GetContentClient()->browser())
|
||||
->CleanupOnUIThread();
|
||||
main_delegate_->CleanupOnUIThread();
|
||||
}
|
||||
|
||||
void ChromeMainRunnerDelegate::AfterMainThreadShutdown() {
|
||||
|
Reference in New Issue
Block a user