Compare commits

...

3 Commits

Author SHA1 Message Date
Marshall Greenblatt
8f4a47479c mac: cefclient: Fix zombie NSWindow object on exit (fixes #3602)
- Don't create a TempWindow when using Views.
- Don't call `close` on an NSWindow that is never opened.
2024-07-15 16:44:38 -04:00
Marshall Greenblatt
02ea88f79f Call SetIsShutdown after CefInitialize (fixes #3738)
Delay shutdown checking until after CefInitialize has drained existing
task pools.
2024-07-15 16:44:38 -04:00
Marshall Greenblatt
ddb0ab8187 Fix DCHECK adding menu separator with hidden items (fixes #3577) 2024-07-15 12:20:43 -04:00
8 changed files with 51 additions and 21 deletions

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=bc230d77e2985959bc5a6a2af80b500eec070384$
// $hash=4a4490df4b9440aeb853d6625fddb7de5741f5b0$
//
#include "include/capi/cef_app_capi.h"
@ -131,12 +131,12 @@ CEF_EXPORT int cef_get_exit_code() {
CEF_EXPORT void cef_shutdown() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
CefShutdown();
#if DCHECK_IS_ON()
shutdown_checker::SetIsShutdown();
#endif
// Execute
CefShutdown();
}
CEF_EXPORT void cef_do_message_loop_work() {

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=16d4e51ecbe1fd8eb6915d951a84f707f73dfb1a$
// $hash=e9099c29c9695cabcedfde25b85c1f77f14cb516$
//
#include "include/capi/cef_app_capi.h"
@ -119,12 +119,12 @@ NO_SANITIZE("cfi-icall") CEF_GLOBAL int CefGetExitCode() {
NO_SANITIZE("cfi-icall") CEF_GLOBAL void CefShutdown() {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_shutdown();
#if DCHECK_IS_ON()
shutdown_checker::SetIsShutdown();
#endif
// Execute
cef_shutdown();
}
NO_SANITIZE("cfi-icall") CEF_GLOBAL void CefDoMessageLoopWork() {

View File

@ -726,5 +726,11 @@ patches = [
# Linux: Fix ARM build broken by build_tflite_with_xnnpack change.
# https://issues.chromium.org/issues/348117454
'name': 'linux_tflite_348117454'
},
{
# Fix DCHECK in SimpleMenuModel::AddSeparator when adding a separator with
# hidden menu items.
# https://github.com/chromiumembedded/cef/issues/3577
'name': 'ui_menu_model_3577'
}
]

View File

@ -0,0 +1,23 @@
diff --git ui/base/models/simple_menu_model.cc ui/base/models/simple_menu_model.cc
index 88e27362452e5..9c18ac5c77544 100644
--- ui/base/models/simple_menu_model.cc
+++ ui/base/models/simple_menu_model.cc
@@ -10,6 +10,7 @@
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/task/single_thread_task_runner.h"
+#include "cef/libcef/features/features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/image_model.h"
#include "ui/gfx/image/image.h"
@@ -170,8 +171,10 @@ void SimpleMenuModel::AddSeparator(MenuSeparatorType separator_type) {
}
if (items_.at(last_visible_item).type == TYPE_SEPARATOR) {
+#if !BUILDFLAG(ENABLE_CEF)
DCHECK_EQ(NORMAL_SEPARATOR, separator_type);
DCHECK_EQ(NORMAL_SEPARATOR, items_.at(last_visible_item).separator_type);
+#endif
// The last item is already a separator. Don't add another.
return;
}

View File

@ -141,8 +141,9 @@ scoped_refptr<RootWindow> RootWindowManager::CreateRootWindowAsPopup(
SanityCheckWindowConfig(is_devtools, use_views, use_alloy_style, with_osr);
if (!temp_window_) {
// TempWindow must be created on the UI thread.
if (!temp_window_ && !use_views) {
// TempWindow must be created on the UI thread. It is only used with
// native (non-Views) parent windows.
temp_window_.reset(new TempWindow());
}

View File

@ -29,7 +29,7 @@ class TempWindowMacImpl {
}
~TempWindowMacImpl() {
DCHECK(window_);
[window_ close];
window_ = nil;
}
private:

View File

@ -320,11 +320,6 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names, base_scoped):
result += '\n'
result_len = len(result)
if is_cef_shutdown:
result += '\n\n#if DCHECK_IS_ON()'\
'\n shutdown_checker::SetIsShutdown();'\
'\n#endif\n'
# execution
result += '\n // Execute\n '
@ -355,6 +350,11 @@ def make_cpptoc_function_impl_new(cls, name, func, defined_names, base_scoped):
result += ');\n'
if is_cef_shutdown:
result += '\n\n#if DCHECK_IS_ON()'\
'\n shutdown_checker::SetIsShutdown();'\
'\n#endif\n'
result_len = len(result)
# parameter restoration

View File

@ -335,11 +335,6 @@ def make_ctocpp_function_impl_new(clsname, name, func, base_scoped):
result += '\n'
result_len = len(result)
if is_cef_shutdown:
result += '\n\n#if DCHECK_IS_ON()'\
'\n shutdown_checker::SetIsShutdown();'\
'\n#endif\n'
# execution
result += '\n // Execute\n '
@ -369,6 +364,11 @@ def make_ctocpp_function_impl_new(clsname, name, func, base_scoped):
result += ');\n'
if is_cef_shutdown:
result += '\n\n#if DCHECK_IS_ON()'\
'\n shutdown_checker::SetIsShutdown();'\
'\n#endif\n'
result_len = len(result)
# parameter restoration