From 4a1b172ebda54d587db7ecfc61af5443d0c11d0d Mon Sep 17 00:00:00 2001 From: Roger Zanoni Date: Sun, 22 Oct 2023 01:07:31 +0000 Subject: [cef][wam] Make the recipe work with official chromium release tarballs This change drops the chromium mirror repository that was being used for milestone 108 in favor of using the official release tarballs from https://commondatastorage.googleapis.com/chromium-browser-official in an effort to make it easier to upgrade the current chromium milestones (also to improve download and build times). Also, the current milestone is being upgraded from 108 to 118. Bug-AGL: SPEC-3872 Signed-off-by: Roger Zanoni Change-Id: Iba4a94ef762d278864114c02bb9e36a308ff5a7a Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/29417 Reviewed-by: Jan-Simon Moeller ci-image-build: Jenkins Job builder account Tested-by: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account --- ...tor-Add-agl_shell_wrapper-AGL-wayland-ext.patch | 914 +++++++++++++ ...relax-constraints-on-VirtualCursor-layout.patch | 51 - ...for-depot_tools-in-chrommium-s-third_part.patch | 32 - ...landwindow-window-tree-host-essential-par.patch | 1376 +++++++++++++++++++ ...GN-settings-done-for-clang-that-conflict-.patch | 116 -- ...nd-to-agl_shell-if-it-s-the-browser-proce.patch | 41 + .../chromium/0004-Don-t-use-DRI-for-renesas.patch | 42 - ...ethod-to-check-if-the-agl-window-is-confi.patch | 69 + ...ential-parts-of-wayland-extensions-and-ag.patch | 912 ------------- .../0005-agl-Start-using-agl-shell-version-4.patch | 348 +++++ ...gl-waylandwindow-window-tree-host-essenti.patch | 1379 -------------------- .../0006-agl-Don-t-use-DRI-for-renesas.patch | 72 + ...-to-agl_shell-if-it-s-the-browser-process.patch | 39 - ...r-Remove-the-GN-settings-done-for-clang-t.patch | 117 ++ ...d-to-check-if-the-agl-window-is-configure.patch | 64 - ...-browser-Pass-no-static-libstdc-to-gen.py.patch | 31 + .../0009-Start-using-agl-shell-version-4.patch | 347 ----- ...r-IWYU-Add-includes-for-size_t-and-int64_.patch | 42 + ...browser-BUILD-do-not-specify-march-on-arm.patch | 43 + ...r-Avoid-parenthesized-initialization-of-a.patch | 164 +++ ...r-Fix-constexpr-variable-cannot-have-non-.patch | 78 ++ .../0013-meta-browser-Add-missing-typename-s.patch | 105 ++ ...014-meta-browser-Avoid-std-ranges-find_if.patch | 70 + ...owser-Avoid-capturing-structured-bindings.patch | 56 + ...r-Delete-compiler-options-not-available-i.patch | 32 + ...r-Don-t-pass-disable-auto-upgrade-debug-i.patch | 39 + ...r-Fix-undefined-symbol-PaintOpWriter-Seri.patch | 49 + ...itialize-ServerCvc-with-designated-initia.patch | 45 + ...n-t-look-for-depot_tools-in-chrommium-s-t.patch | 37 + ...21-M118-fix-Add-multiple-missing-includes.patch | 69 + ...Fix-aggregate-initialization-in-trace_log.patch | 34 + ...d-missing-typename-keyword-in-multiple-st.patch | 140 ++ ...8-fix-Fix-comparison-in-HostResolverCache.patch | 34 + ...oid-using-std-ranges-any_of-find_if-none_.patch | 92 ++ ...18-fix-Add-deleted-constructors-operators.patch | 339 +++++ ...itialize-percentages-member-on-blink-Font.patch | 52 + ...n-t-delete-ZstdSourceStream-copy-move-cto.patch | 32 + ...x-issue-with-structured-bindinds-captured.patch | 68 + ...ly-default-arm_use_neon-to-true-if-its-va.patch | 107 ++ ...d-a-way-to-set-different-lib-paths-host-a.patch | 135 ++ .../0032-M118-fix-zlib-Fix-arm-build.patch | 48 + ...8-fix-Fix-skia-linker-issues-for-arm-neon.patch | 56 + 42 files changed, 4934 insertions(+), 2982 deletions(-) create mode 100644 recipes-wam/cef/files/chromium/0001-agl-compositor-Add-agl_shell_wrapper-AGL-wayland-ext.patch delete mode 100644 recipes-wam/cef/files/chromium/0001-sql-relax-constraints-on-VirtualCursor-layout.patch delete mode 100644 recipes-wam/cef/files/chromium/0002-Don-t-look-for-depot_tools-in-chrommium-s-third_part.patch create mode 100644 recipes-wam/cef/files/chromium/0002-agl-Add-waylandwindow-window-tree-host-essential-par.patch delete mode 100644 recipes-wam/cef/files/chromium/0003-Remove-the-GN-settings-done-for-clang-that-conflict-.patch create mode 100644 recipes-wam/cef/files/chromium/0003-agl-Only-bind-to-agl_shell-if-it-s-the-browser-proce.patch delete mode 100644 recipes-wam/cef/files/chromium/0004-Don-t-use-DRI-for-renesas.patch create mode 100644 recipes-wam/cef/files/chromium/0004-agl-Add-a-method-to-check-if-the-agl-window-is-confi.patch delete mode 100644 recipes-wam/cef/files/chromium/0005-Add-the-essential-parts-of-wayland-extensions-and-ag.patch create mode 100644 recipes-wam/cef/files/chromium/0005-agl-Start-using-agl-shell-version-4.patch delete mode 100644 recipes-wam/cef/files/chromium/0006-Add-webos-agl-waylandwindow-window-tree-host-essenti.patch create mode 100644 recipes-wam/cef/files/chromium/0006-agl-Don-t-use-DRI-for-renesas.patch delete mode 100644 recipes-wam/cef/files/chromium/0007-Only-bind-to-agl_shell-if-it-s-the-browser-process.patch create mode 100644 recipes-wam/cef/files/chromium/0007-meta-browser-Remove-the-GN-settings-done-for-clang-t.patch delete mode 100644 recipes-wam/cef/files/chromium/0008-Add-a-method-to-check-if-the-agl-window-is-configure.patch create mode 100644 recipes-wam/cef/files/chromium/0008-meta-browser-Pass-no-static-libstdc-to-gen.py.patch delete mode 100644 recipes-wam/cef/files/chromium/0009-Start-using-agl-shell-version-4.patch create mode 100644 recipes-wam/cef/files/chromium/0009-meta-browser-IWYU-Add-includes-for-size_t-and-int64_.patch create mode 100644 recipes-wam/cef/files/chromium/0010-meta-browser-BUILD-do-not-specify-march-on-arm.patch create mode 100644 recipes-wam/cef/files/chromium/0011-meta-browser-Avoid-parenthesized-initialization-of-a.patch create mode 100644 recipes-wam/cef/files/chromium/0012-meta-browser-Fix-constexpr-variable-cannot-have-non-.patch create mode 100644 recipes-wam/cef/files/chromium/0013-meta-browser-Add-missing-typename-s.patch create mode 100644 recipes-wam/cef/files/chromium/0014-meta-browser-Avoid-std-ranges-find_if.patch create mode 100644 recipes-wam/cef/files/chromium/0015-meta-browser-Avoid-capturing-structured-bindings.patch create mode 100644 recipes-wam/cef/files/chromium/0016-meta-browser-Delete-compiler-options-not-available-i.patch create mode 100644 recipes-wam/cef/files/chromium/0017-meta-browser-Don-t-pass-disable-auto-upgrade-debug-i.patch create mode 100644 recipes-wam/cef/files/chromium/0018-meta-browser-Fix-undefined-symbol-PaintOpWriter-Seri.patch create mode 100644 recipes-wam/cef/files/chromium/0019-upstream-Initialize-ServerCvc-with-designated-initia.patch create mode 100644 recipes-wam/cef/files/chromium/0020-M118-fix-Don-t-look-for-depot_tools-in-chrommium-s-t.patch create mode 100644 recipes-wam/cef/files/chromium/0021-M118-fix-Add-multiple-missing-includes.patch create mode 100644 recipes-wam/cef/files/chromium/0022-M118-fix-Fix-aggregate-initialization-in-trace_log.patch create mode 100644 recipes-wam/cef/files/chromium/0023-M118-fix-Add-missing-typename-keyword-in-multiple-st.patch create mode 100644 recipes-wam/cef/files/chromium/0024-M118-fix-Fix-comparison-in-HostResolverCache.patch create mode 100644 recipes-wam/cef/files/chromium/0025-M118-fix-Avoid-using-std-ranges-any_of-find_if-none_.patch create mode 100644 recipes-wam/cef/files/chromium/0026-M118-fix-Add-deleted-constructors-operators.patch create mode 100644 recipes-wam/cef/files/chromium/0027-M118-fix-Initialize-percentages-member-on-blink-Font.patch create mode 100644 recipes-wam/cef/files/chromium/0028-M118-fix-Don-t-delete-ZstdSourceStream-copy-move-cto.patch create mode 100644 recipes-wam/cef/files/chromium/0029-M118-fix-Fix-issue-with-structured-bindinds-captured.patch create mode 100644 recipes-wam/cef/files/chromium/0030-M118-fix-Only-default-arm_use_neon-to-true-if-its-va.patch create mode 100644 recipes-wam/cef/files/chromium/0031-M118-fix-Add-a-way-to-set-different-lib-paths-host-a.patch create mode 100644 recipes-wam/cef/files/chromium/0032-M118-fix-zlib-Fix-arm-build.patch create mode 100644 recipes-wam/cef/files/chromium/0033-M118-fix-Fix-skia-linker-issues-for-arm-neon.patch (limited to 'recipes-wam/cef/files/chromium') diff --git a/recipes-wam/cef/files/chromium/0001-agl-compositor-Add-agl_shell_wrapper-AGL-wayland-ext.patch b/recipes-wam/cef/files/chromium/0001-agl-compositor-Add-agl_shell_wrapper-AGL-wayland-ext.patch new file mode 100644 index 00000000..6ab4d5b8 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0001-agl-compositor-Add-agl_shell_wrapper-AGL-wayland-ext.patch @@ -0,0 +1,914 @@ +From 019d5dea79b9ac8ec17d5925546aab66473f67f5 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Mon, 15 May 2023 20:32:06 +0200 +Subject: [PATCH 01/33] [agl][compositor] Add agl_shell_wrapper / AGL wayland + extension + +This is a backport of the chages we did on top of chromium webosose to +be able to communicate with the agl-compositor + +Signed-off-by: Roger Zanoni +--- + ui/base/ui_base_switches.cc | 2 + + ui/base/ui_base_switches.h | 3 + + ui/ozone/platform/wayland/BUILD.gn | 7 + + .../platform/wayland/extensions/agl/BUILD.gn | 40 ++++ + .../agl/common/wayland_object_agl.cc | 26 +++ + .../agl/common/wayland_object_agl.h | 34 ++++ + .../extensions/agl/host/agl_shell_wrapper.cc | 113 +++++++++++ + .../extensions/agl/host/agl_shell_wrapper.h | 62 ++++++ + .../agl/host/wayland_extensions_agl.h | 37 ++++ + .../agl/host/wayland_extensions_agl_impl.cc | 93 +++++++++ + .../agl/host/wayland_extensions_agl_impl.h | 54 ++++++ + .../extensions/agl/protocol/agl-shell.xml | 179 ++++++++++++++++++ + .../wayland/host/wayland_connection.cc | 12 +- + .../wayland/host/wayland_connection.h | 4 + + .../wayland/host/wayland_extensions.h | 56 ++++++ + 15 files changed, 720 insertions(+), 2 deletions(-) + create mode 100644 ui/ozone/platform/wayland/extensions/agl/BUILD.gn + create mode 100644 ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.cc + create mode 100644 ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h + create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc + create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h + create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h + create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc + create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h + create mode 100644 ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml + create mode 100644 ui/ozone/platform/wayland/host/wayland_extensions.h + +diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc +index 514bb3cdb580d..d94e2c5e78306 100644 +--- a/ui/base/ui_base_switches.cc ++++ b/ui/base/ui_base_switches.cc +@@ -112,4 +112,6 @@ const char kUIDisablePartialSwap[] = "ui-disable-partial-swap"; + // Enables the ozone x11 clipboard for linux-chromeos. + const char kUseSystemClipboard[] = "use-system-clipboard"; + ++const char kAglShellAppId[] = "agl-shell-appid"; ++ + } // namespace switches +diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h +index ec664b866c5d2..cf483e0339072 100644 +--- a/ui/base/ui_base_switches.h ++++ b/ui/base/ui_base_switches.h +@@ -53,6 +53,9 @@ COMPONENT_EXPORT(UI_BASE) extern const char kTopChromeTouchUiEnabled[]; + COMPONENT_EXPORT(UI_BASE) extern const char kUIDisablePartialSwap[]; + COMPONENT_EXPORT(UI_BASE) extern const char kUseSystemClipboard[]; + ++// Agl related ++COMPONENT_EXPORT(UI_BASE) extern const char kAglShellAppId[]; ++ + // Test related. + COMPONENT_EXPORT(UI_BASE) extern const char kDisallowNonExactResourceReuse[]; + COMPONENT_EXPORT(UI_BASE) extern const char kMangleLocalizedStrings[]; +diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn +index ae763d441d55c..8a436de0fafe3 100644 +--- a/ui/ozone/platform/wayland/BUILD.gn ++++ b/ui/ozone/platform/wayland/BUILD.gn +@@ -397,6 +397,13 @@ source_set("wayland") { + ] + + configs += [ "//third_party/khronos:khronos_headers" ] ++ ++ sources += [ ++ "host/wayland_extensions.h", ++ "host/wayland_extensions_stub.cc", ++ ] ++ ++ deps += [ "extensions/agl" ] + } + + source_set("test_support") { +diff --git a/ui/ozone/platform/wayland/extensions/agl/BUILD.gn b/ui/ozone/platform/wayland/extensions/agl/BUILD.gn +new file mode 100644 +index 0000000000000..ce289bc5dbbca +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/BUILD.gn +@@ -0,0 +1,40 @@ ++# Copyright 2021 LG Electronics, Inc. ++# ++# Licensed under the Apache License, Version 2.0 (the "License"); ++# you may not use this file except in compliance with the License. ++# You may obtain a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, software ++# distributed under the License is distributed on an "AS IS" BASIS, ++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++# See the License for the specific language governing permissions and ++# limitations under the License. ++# ++# SPDX-License-Identifier: Apache-2.0 ++ ++import("//third_party/wayland/wayland_protocol.gni") ++ ++visibility = [ "//ui/ozone/*" ] ++ ++wayland_protocol("agl_shell_protocol") { ++ sources = [ "protocol/agl-shell.xml" ] ++} ++ ++source_set("agl") { ++ sources = [ ++ "common/wayland_object_agl.cc", ++ "common/wayland_object_agl.h", ++ "host/agl_shell_wrapper.cc", ++ "host/agl_shell_wrapper.h", ++ "host/wayland_extensions_agl.h", ++ "host/wayland_extensions_agl_impl.cc", ++ "host/wayland_extensions_agl_impl.h", ++ ] ++ ++ deps = [ ++ ":agl_shell_protocol", ++ "//ui/ozone/platform/wayland/mojom", ++ ] ++} +diff --git a/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.cc b/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.cc +new file mode 100644 +index 0000000000000..9f3300766df2c +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.cc +@@ -0,0 +1,26 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#include "ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h" ++ ++#include ++ ++namespace wl { ++ ++const wl_interface* ObjectTraits::interface = &agl_shell_interface; ++void (*ObjectTraits::deleter)(agl_shell*) = &agl_shell_destroy; ++ ++} // namespace wl +\ No newline at end of file +diff --git a/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h b/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h +new file mode 100644 +index 0000000000000..e91ac0da8d2fc +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h +@@ -0,0 +1,34 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_COMMON_WAYLAND_OBJECT_AGL_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_COMMON_WAYLAND_OBJECT_AGL_H_ ++ ++#include "ui/ozone/platform/wayland/common/wayland_object.h" ++ ++struct agl_shell; ++ ++namespace wl { ++ ++template <> ++struct ObjectTraits { ++ static const wl_interface* interface; ++ static void (*deleter)(agl_shell*); ++}; ++ ++} // namespace wl ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_COMMON_WAYLAND_OBJECT_AGL_H_ +\ No newline at end of file +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc +new file mode 100644 +index 0000000000000..c74fa5d9cd221 +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc +@@ -0,0 +1,113 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" ++ ++#include "agl_shell_wrapper.h" ++#include "base/logging.h" ++#include "ui/base/ui_base_switches.h" ++#include "ui/ozone/platform/wayland/host/wayland_connection.h" ++#include "ui/ozone/platform/wayland/host/wayland_output_manager.h" ++#include "ui/ozone/platform/wayland/host/wayland_window.h" ++ ++namespace ui { ++ ++static const struct agl_shell_listener shell_listener = { ++ &AglShellWrapper::AglShellBoundOk, ++ &AglShellWrapper::AglShellBoundFail, ++#ifdef AGL_SHELL_APP_STATE_SINCE_VERSION ++ &AglShellWrapper::AglAppState, ++#endif ++}; ++ ++AglShellWrapper::AglShellWrapper(agl_shell* agl_shell, ++ WaylandConnection* wayland_connection) ++ : agl_shell_(agl_shell), connection_(wayland_connection) { ++ if (wl::get_version_of_object(agl_shell) >= AGL_SHELL_BOUND_OK_SINCE_VERSION) ++ agl_shell_add_listener(agl_shell, &shell_listener, this); ++} ++ ++AglShellWrapper::~AglShellWrapper() = default; ++ ++void AglShellWrapper::SetAglActivateApp(const std::string& app_id) { ++ wl_output* output = ++ connection_->wayland_output_manager()->GetPrimaryOutput()->get_output(); ++ agl_shell_activate_app(agl_shell_.get(), app_id.c_str(), output); ++} ++ ++void AglShellWrapper::SetAglPanel(WaylandWindow* window, uint32_t edge) { ++ wl_surface* surface = window->root_surface()->surface(); ++ wl_output* output = ++ connection_->wayland_output_manager()->GetPrimaryOutput()->get_output(); ++ ++ agl_shell_set_panel(agl_shell_.get(), surface, output, edge); ++} ++ ++void AglShellWrapper::SetAglBackground(WaylandWindow* window) { ++ wl_surface* surface = window->root_surface()->surface(); ++ wl_output* output = ++ connection_->wayland_output_manager()->GetPrimaryOutput()->get_output(); ++ ++ agl_shell_set_background(agl_shell_.get(), surface, output); ++} ++ ++void AglShellWrapper::SetAglReady() { ++ agl_shell_ready(agl_shell_.get()); ++} ++ ++// static ++void AglShellWrapper::AglShellBoundOk(void* data, struct agl_shell*) { ++ AglShellWrapper* wrapper = static_cast(data); ++ wrapper->wait_for_bound_ = false; ++ wrapper->bound_ok_ = true; ++ LOG(INFO) << "Bound to agl_shell (bound_ok)"; ++} ++ ++// static ++void AglShellWrapper::AglShellBoundFail(void* data, struct agl_shell*) { ++ AglShellWrapper* wrapper = static_cast(data); ++ wrapper->wait_for_bound_ = false; ++ wrapper->bound_ok_ = false; ++ LOG(INFO) << "Failed to bind to agl_shell (bound_fail)"; ++} ++ ++#ifdef AGL_SHELL_APP_STATE_SINCE_VERSION ++// static ++void AglShellWrapper::AglAppState(void* data, ++ struct agl_shell*, ++ const char* app_id, ++ uint32_t state) { ++ AglShellWrapper* wrapper = static_cast(data); ++ ++ LOG(INFO) << "State for app " << app_id << " changed to " << state; ++ ++ if (state == AGL_SHELL_APP_STATE_STARTED) { ++ wrapper->SetAglActivateApp(app_id); ++ LOG(INFO) << "Activating app " << app_id; ++ } ++} ++#endif ++ ++bool AglShellWrapper::WaitUntilBoundOk() { ++ int ret = 0; ++ while (ret != -1 && wait_for_bound_) { ++ ret = wl_display_dispatch(connection_->display()); ++ } ++ ++ return bound_ok_; ++} ++ ++} // namespace ui +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h +new file mode 100644 +index 0000000000000..2ab765883057e +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h +@@ -0,0 +1,62 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_AGL_SHELL_WRAPPER_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_AGL_SHELL_WRAPPER_H_ ++ ++#include ++ ++#include ++ ++#include "ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h" ++ ++namespace ui { ++ ++class WaylandConnection; ++class WaylandWindow; ++ ++class AglShellWrapper { ++ public: ++ AglShellWrapper(agl_shell* agl_shell, WaylandConnection* wayland_connection); ++ AglShellWrapper(const AglShellWrapper&) = delete; ++ AglShellWrapper& operator=(const AglShellWrapper&) = delete; ++ ~AglShellWrapper(); ++ ++ void SetAglActivateApp(const std::string& app_id); ++ void SetAglPanel(WaylandWindow* window, uint32_t edge); ++ void SetAglBackground(WaylandWindow* window); ++ void SetAglReady(); ++ bool WaitUntilBoundOk(); ++ ++ static void AglShellBoundOk(void* data, struct agl_shell*); ++ static void AglShellBoundFail(void* data, struct agl_shell*); ++#ifdef AGL_SHELL_APP_STATE_SINCE_VERSION ++ static void AglAppState(void* data, ++ struct agl_shell*, ++ const char* app_id, ++ uint32_t state); ++#endif ++ ++ private: ++ wl::Object agl_shell_; ++ WaylandConnection* connection_; ++ bool wait_for_bound_ = true; ++ bool bound_ok_ = false; ++}; ++ ++} // namespace ui ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_AGL_SHELL_WRAPPER_H_ +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h +new file mode 100644 +index 0000000000000..df42fc00c84da +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h +@@ -0,0 +1,37 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ ++ ++namespace ui { ++ ++class AglShellWrapper; ++ ++// AGL extensions implementation for webOS/Lite ++class WaylandExtensionsAgl { ++ public: ++ WaylandExtensionsAgl() = default; ++ WaylandExtensionsAgl(const WaylandExtensionsAgl&) = delete; ++ WaylandExtensionsAgl& operator=(const WaylandExtensionsAgl&) = delete; ++ virtual ~WaylandExtensionsAgl() = default; ++ ++ virtual AglShellWrapper* GetAglShell() = 0; ++}; ++ ++} // namespace ui ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ +\ No newline at end of file +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc +new file mode 100644 +index 0000000000000..26a5f0550c302 +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc +@@ -0,0 +1,93 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h" ++ ++#include ++ ++#include "base/command_line.h" ++#include "base/logging.h" ++#include "ui/base/ui_base_switches.h" ++#include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" ++#include "ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h" ++#include "ui/ozone/platform/wayland/host/wayland_connection.h" ++ ++namespace ui { ++ ++namespace { ++ ++constexpr uint32_t kMinAglShellExtensionVersion = 1; ++constexpr uint32_t kMaxAglShellExtensionVersion = 3; ++ ++} // namespace ++ ++WaylandExtensionsAglImpl::WaylandExtensionsAglImpl( ++ WaylandConnection* connection) ++ : connection_(connection) {} ++ ++WaylandExtensionsAglImpl::~WaylandExtensionsAglImpl() = default; ++ ++bool WaylandExtensionsAglImpl::Bind(wl_registry* registry, ++ uint32_t name, ++ const char* interface, ++ uint32_t version) { ++ bool should_use_agl_shell = base::CommandLine::ForCurrentProcess()->HasSwitch( ++ switches::kAglShellAppId); ++ bool can_bind = wl::CanBind(interface, version, kMinAglShellExtensionVersion, ++ kMaxAglShellExtensionVersion); ++ bool is_agl_shell_interface = (strcmp(interface, "agl_shell") == 0); ++ ++ if (!is_agl_shell_interface) { ++ return false; ++ } ++ ++ LOG(INFO) << "should_use_agl_shell: " << should_use_agl_shell << ++ " can_bind: " << can_bind; ++ ++ if (should_use_agl_shell && !agl_shell_ && ++ is_agl_shell_interface && can_bind) { ++ wl::Object aglshell = wl::Bind( ++ registry, name, std::min(version, kMaxAglShellExtensionVersion)); ++ if (!aglshell) { ++ LOG(ERROR) << "Failed to bind to agl_shell global"; ++ return false; ++ } ++ agl_shell_ = ++ std::make_unique(aglshell.release(), connection_); ++ ++ LOG(INFO) << "Waiting until bound..."; ++ return agl_shell_->WaitUntilBoundOk(); ++ } else { ++ LOG(INFO) << "Cant bind."; ++ } ++ ++ return false; ++} ++ ++bool WaylandExtensionsAglImpl::HasShellObject() const { ++ return !!agl_shell_; ++} ++ ++AglShellWrapper* WaylandExtensionsAglImpl::GetAglShell() { ++ return agl_shell_.get(); ++} ++ ++std::unique_ptr CreateWaylandExtensions( ++ WaylandConnection* connection) { ++ return std::make_unique(connection); ++} ++ ++} // namespace ui +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h +new file mode 100644 +index 0000000000000..f6cbabe99ed0b +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h +@@ -0,0 +1,54 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ ++ ++#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h" ++#include "ui/ozone/platform/wayland/host/wayland_extensions.h" ++ ++namespace ui { ++ ++class AglShellWrapper; ++ ++// AGL extension implementation for webOS/Lite ++class WaylandExtensionsAglImpl : public WaylandExtensions, ++ public WaylandExtensionsAgl { ++ public: ++ explicit WaylandExtensionsAglImpl(WaylandConnection* connection); ++ WaylandExtensionsAglImpl(const WaylandExtensionsAglImpl&) = delete; ++ WaylandExtensionsAglImpl& operator=(const WaylandExtensionsAglImpl&) = delete; ++ ~WaylandExtensionsAglImpl() override; ++ ++ // WaylandExtensions overrides ++ bool Bind(wl_registry* registry, ++ uint32_t name, ++ const char* interface, ++ uint32_t version) override; ++ ++ bool HasShellObject() const override; ++ ++ // WaylandExtensionsAgl overrides ++ AglShellWrapper* GetAglShell() override; ++ ++ private: ++ std::unique_ptr agl_shell_; ++ WaylandConnection* connection_; ++}; ++ ++} // namespace ui ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ +diff --git a/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml b/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml +new file mode 100644 +index 0000000000000..ad5553d61f189 +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml +@@ -0,0 +1,179 @@ ++ ++ ++ ++ Copyright © 2019, 2022 Collabora, Ltd. ++ ++ Permission is hereby granted, free of charge, to any person obtaining a ++ copy of this software and associated documentation files (the "Software"), ++ to deal in the Software without restriction, including without limitation ++ the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ and/or sell copies of the Software, and to permit persons to whom the ++ Software is furnished to do so, subject to the following conditions: ++ ++ The above copyright notice and this permission notice (including the next ++ paragraph) shall be included in all copies or substantial portions of the ++ Software. ++ ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ DEALINGS IN THE SOFTWARE. ++ ++ ++ ++ Starting with version 2 of the protocol, the client is required to wait ++ for the 'bound_ok' or 'bound_fail' events in order to proceed further. ++ ++ In case the client gets a 'bound_fail' event then it should consider that ++ there's another client already bound to the agl_shell protocol. ++ A client that receives a 'bound_ok' event should consider that there's ++ no other client already bound to the interface and can proceed further. ++ ++ If the client uses an older version of the protocol it will receive ++ automatically an error and the compositor will terminate the connection, ++ if there's another client already bound the interface. ++ ++ If the client receives the 'bound_fail' event and attempts to use the ++ interface further it will receive an error and the compositor will ++ terminate the connection. After the 'bound_fail' event was received the ++ client should call the destructor, which has been added with version 2 ++ of the protocol. The client is free to try at a later point in time to ++ see if it will receive the 'bound_ok' event, but there's no explicit way ++ of finding out when that event will be delivered. ++ It is assumed that it can infer that information through other ++ means/other channels. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Tell the server that this client is ready to be shown. The server ++ will delay presentation during start-up until all shell clients are ++ ready to be shown, and will display a black screen instead. ++ This gives the client an opportunity to set up and configure several ++ surfaces into a coherent interface. ++ ++ The client that binds to this interface must send this request, otherwise ++ they may stall the compositor unnecessarily. ++ ++ If this request is called after the compositor has already finished ++ start-up, no operation is performed. ++ ++ ++ ++ ++ ++ Set the surface to act as the background of an output. After this ++ request, the server will immediately send a configure event with ++ the dimensions the client should use to cover the entire output. ++ ++ The surface must have a "desktop" surface role, as supported by ++ libweston-desktop. ++ ++ Only a single surface may be the background for any output. If a ++ background surface already exists, a protocol error is raised. ++ ++ ++ ++ ++ ++ ++ ++ Set the surface to act as a panel of an output. The 'edge' argument ++ says what edge of the output the surface will be anchored to. ++ After this request, the server will send a configure event with the ++ corresponding width/height that the client should use, and 0 for the ++ other dimension. E.g. if the edge is 'top', the width will be the ++ output's width, and the height will be 0. ++ ++ The surface must have a "desktop" surface role, as supported by ++ libweston-desktop. ++ ++ The compositor will take the panel's window geometry into account when ++ positioning other windows, so the panels are not covered. ++ ++ XXX: What happens if e.g. both top and left are used at the same time? ++ Who gets to have the corner? ++ ++ Only a single surface may be the panel for an output's edge. If a ++ surface already exists on an edge, a protocol error is raised. ++ ++ ++ ++ ++ ++ ++ ++ ++ Ask the compositor to make a toplevel to become the current/focused ++ window for window management purposes. ++ ++ See xdg_toplevel.set_app_id from the xdg-shell protocol for a ++ description of app_id. ++ ++ If multiple toplevels have the same app_id, the result is unspecified. ++ ++ XXX: Do we need feedback to say it didn't work? (e.g. client does ++ not exist) ++ ++ ++ ++ ++ ++ ++ ++ Informs the client that it was able to bind the agl_shell ++ interface succesfully. Clients are required to wait for this ++ event before continuing further. ++ ++ ++ ++ ++ ++ Informs the client that binding to the agl_shell interface was ++ unsuccesfull. Clients are required to wait for this event for ++ continuing further. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Informs the client that an application has changed its state to another, ++ specified by the app_state enum. Client can use this event to track ++ current application state. For instance to know when the application has ++ started, or when terminated/stopped. ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc +index ad3bbd6e37157..7a47d4a636998 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.cc ++++ b/ui/ozone/platform/wayland/host/wayland_connection.cc +@@ -68,6 +68,8 @@ + #include "ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.h" + #include "ui/platform_window/common/platform_window_defaults.h" + ++#include "ui/ozone/platform/wayland/host/wayland_extensions.h" ++ + namespace ui { + + namespace { +@@ -212,6 +214,10 @@ bool WaylandConnection::Initialize(bool use_threaded_polling) { + use_threaded_polling = false; + } + ++ if (!extensions_) { ++ extensions_ = CreateWaylandExtensions(this); ++ } ++ + // Now that the connection with the display server has been properly + // estabilished, initialize the event source and input objects. + DCHECK(!event_source_); +@@ -243,7 +249,7 @@ bool WaylandConnection::Initialize(bool use_threaded_polling) { + LOG(ERROR) << "No wl_shm object"; + return false; + } +- if (!shell_) { ++ if (!shell_ && !(extensions_ && extensions_->HasShellObject())) { + LOG(ERROR) << "No Wayland shell found"; + return false; + } +@@ -538,7 +544,9 @@ void WaylandConnection::HandleGlobal(wl_registry* registry, + const char* interface, + uint32_t version) { + auto factory_it = global_object_factories_.find(interface); +- if (factory_it != global_object_factories_.end()) { ++ if (extensions_->Bind(registry, name, interface, version)) { ++ DVLOG(1) << "Successfully bound to " << interface; ++ } else if (factory_it != global_object_factories_.end()) { + (*factory_it->second)(this, registry, name, interface, version); + } else if (!compositor_ && strcmp(interface, "wl_compositor") == 0) { + compositor_ = wl::Bind( +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h +index 6659bc54bd475..ba293e5bcd088 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.h ++++ b/ui/ozone/platform/wayland/host/wayland_connection.h +@@ -50,6 +50,7 @@ class WaylandBufferManagerHost; + class WaylandCursor; + class WaylandCursorBufferListener; + class WaylandEventSource; ++class WaylandExtensions; + class WaylandOutputManager; + class WaylandSeat; + class WaylandZAuraShell; +@@ -201,6 +202,8 @@ class WaylandConnection { + + WaylandZAuraShell* zaura_shell() const { return zaura_shell_.get(); } + ++ WaylandExtensions* extensions() { return extensions_.get(); } ++ + WaylandZcrColorManager* zcr_color_manager() const { + return zcr_color_manager_.get(); + } +@@ -486,6 +489,7 @@ class WaylandConnection { + std::unique_ptr overlay_prioritizer_; + std::unique_ptr surface_augmenter_; + std::unique_ptr single_pixel_buffer_; ++ std::unique_ptr extensions_; + + // Clipboard-related objects. |clipboard_| must be declared after all + // DeviceManager instances it depends on, otherwise tests may crash with +diff --git a/ui/ozone/platform/wayland/host/wayland_extensions.h b/ui/ozone/platform/wayland/host/wayland_extensions.h +new file mode 100644 +index 0000000000000..3bd2fd7a211ae +--- /dev/null ++++ b/ui/ozone/platform/wayland/host/wayland_extensions.h +@@ -0,0 +1,56 @@ ++// Copyright 2019 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_EXTENSIONS_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_EXTENSIONS_H_ ++ ++#include ++ ++#include "ui/ozone/platform/wayland/common/wayland_object.h" ++ ++namespace ui { ++ ++class ShellToplevelWrapper; ++class ShellPopupWrapper; ++class WaylandConnection; ++ ++// Wayland extensions abstract interface to support extending of the Wayland ++// protocol. Inherit it to provide your own Wayland extensions implementation. ++class WaylandExtensions { ++ public: ++ WaylandExtensions() = default; ++ WaylandExtensions(const WaylandExtensions&) = delete; ++ WaylandExtensions& operator=(const WaylandExtensions&) = delete; ++ virtual ~WaylandExtensions() = default; ++ ++ // Binds to the extensions interface(s). Can encapsulate binding of several ++ // interfaces, defined by |interface|. ++ virtual bool Bind(wl_registry* registry, ++ uint32_t name, ++ const char* interface, ++ uint32_t version) = 0; ++ ++ // Checks whether the extensions have bound shell object(s). ++ virtual bool HasShellObject() const = 0; ++}; ++ ++// Creates Wayland extensions. ++std::unique_ptr CreateWaylandExtensions( ++ WaylandConnection* connection); ++ ++} // namespace ui ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_EXTENSIONS_H_ +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0001-sql-relax-constraints-on-VirtualCursor-layout.patch b/recipes-wam/cef/files/chromium/0001-sql-relax-constraints-on-VirtualCursor-layout.patch deleted file mode 100644 index 624dd501..00000000 --- a/recipes-wam/cef/files/chromium/0001-sql-relax-constraints-on-VirtualCursor-layout.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 94ffefa81d00466fabcf1050080c95fa4b294dda Mon Sep 17 00:00:00 2001 -From: Elly Fong-Jones -Date: Thu, 2 Mar 2023 00:15:11 +0000 -Subject: [PATCH 1/9] sql: relax constraints on VirtualCursor layout - -VirtualCursor::FromSqliteCursor required that VirtualCursor had a -standard layout, but in fact VirtualCursor shouldn't have a standard -layout, and the fact that it does with libc++ is a deviation from the -C++ standard. This change: - -1. Relaxes the requirement that VirtualCursor has a standard layout, and -2. Relaxes the requirement that the sqlite_cursor_ field has to be at - offset 0 - -by use of offsetof() and pointer subtraction. This change both improves -standards compliance and makes this code build with libstdc++. - -Bug: 1380656 -Change-Id: I9c47abd9197b187da0360ca5619ccf7dadab4f33 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4292313 -Reviewed-by: Austin Sullivan -Commit-Queue: Elly Fong-Jones -Cr-Commit-Position: refs/heads/main@{#1111925} ---- - sql/recover_module/cursor.h | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h -index 1970bdca8c6f1..4cb0655700977 100644 ---- a/sql/recover_module/cursor.h -+++ b/sql/recover_module/cursor.h -@@ -63,12 +63,10 @@ class VirtualCursor { - // |sqlite_cursor| must have been returned by VirtualTable::SqliteCursor(). - static inline VirtualCursor* FromSqliteCursor( - sqlite3_vtab_cursor* sqlite_cursor) { -- static_assert(std::is_standard_layout::value, -- "needed for the reinterpret_cast below"); -- static_assert(offsetof(VirtualCursor, sqlite_cursor_) == 0, -- "sqlite_cursor_ must be the first member of the class"); -- VirtualCursor* result = reinterpret_cast(sqlite_cursor); -- DCHECK_EQ(sqlite_cursor, &result->sqlite_cursor_); -+ VirtualCursor* result = reinterpret_cast( -+ (reinterpret_cast(sqlite_cursor) - -+ offsetof(VirtualCursor, sqlite_cursor_))); -+ CHECK_EQ(sqlite_cursor, &result->sqlite_cursor_); - return result; - } - --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0002-Don-t-look-for-depot_tools-in-chrommium-s-third_part.patch b/recipes-wam/cef/files/chromium/0002-Don-t-look-for-depot_tools-in-chrommium-s-third_part.patch deleted file mode 100644 index dd05b373..00000000 --- a/recipes-wam/cef/files/chromium/0002-Don-t-look-for-depot_tools-in-chrommium-s-third_part.patch +++ /dev/null @@ -1,32 +0,0 @@ -From dd5ce9e0d0dbf55184a9c57c4c81eeaf9a7dd3a9 Mon Sep 17 00:00:00 2001 -From: Roger Zanoni -Date: Fri, 7 Apr 2023 16:28:51 +0200 -Subject: [PATCH 2/9] Don't look for depot_tools in chrommium's third_party - folder - ---- - build/find_depot_tools.py | 8 -------- - 1 file changed, 8 deletions(-) - -diff --git a/build/find_depot_tools.py b/build/find_depot_tools.py -index 94985fe7b3495..6d2adcfa63531 100755 ---- a/build/find_depot_tools.py -+++ b/build/find_depot_tools.py -@@ -28,14 +28,6 @@ def IsRealDepotTools(path): - - def add_depot_tools_to_path(): - """Search for depot_tools and add it to sys.path.""" -- # First, check if we have a DEPS'd in "depot_tools". -- deps_depot_tools = os.path.join(SRC, 'third_party', 'depot_tools') -- if IsRealDepotTools(deps_depot_tools): -- # Put the pinned version at the start of the sys.path, in case there -- # are other non-pinned versions already on the sys.path. -- sys.path.insert(0, deps_depot_tools) -- return deps_depot_tools -- - # Then look if depot_tools is already in PYTHONPATH. - for i in sys.path: - if i.rstrip(os.sep).endswith('depot_tools') and IsRealDepotTools(i): --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0002-agl-Add-waylandwindow-window-tree-host-essential-par.patch b/recipes-wam/cef/files/chromium/0002-agl-Add-waylandwindow-window-tree-host-essential-par.patch new file mode 100644 index 00000000..488b398b --- /dev/null +++ b/recipes-wam/cef/files/chromium/0002-agl-Add-waylandwindow-window-tree-host-essential-par.patch @@ -0,0 +1,1376 @@ +From d50bcc010ca2856979f58b2ffbd0015514c4231f Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Wed, 17 May 2023 21:25:53 +0200 +Subject: [PATCH 02/33] [agl] Add waylandwindow/window tree host essential + parts + +This is a backport of the work we did on top of chromium webosose to be +able to communicate with the agl compositor. + +Signed-off-by: Roger Zanoni +--- + ui/aura/BUILD.gn | 7 ++ + ui/aura/agl/window_tree_host_agl.h | 42 +++++++++ + ui/aura/agl/window_tree_host_platform_agl.cc | 50 +++++++++++ + ui/aura/agl/window_tree_host_platform_agl.h | 51 +++++++++++ + ui/aura/window_tree_host.h | 5 +- + ui/aura/window_tree_host_platform.cc | 4 +- + ui/aura/window_tree_host_platform.h | 4 +- + ui/ozone/platform/wayland/BUILD.gn | 1 - + .../platform/wayland/extensions/agl/BUILD.gn | 2 + + .../agl/host/wayland_extensions_agl.h | 10 ++- + .../agl/host/wayland_extensions_agl_impl.cc | 11 ++- + .../agl/host/wayland_extensions_agl_impl.h | 9 ++ + .../extensions/agl/host/wayland_window_agl.cc | 86 +++++++++++++++++++ + .../extensions/agl/host/wayland_window_agl.h | 49 +++++++++++ + .../wayland/gpu/gl_surface_wayland.cc | 9 +- + .../host/gtk_primary_selection_device.cc | 2 +- + .../gtk_primary_selection_device_manager.cc | 4 +- + .../wayland/host/proxy/wayland_proxy_impl.cc | 2 +- + .../wayland/host/wayland_connection.cc | 19 +++- + .../wayland/host/wayland_connection.h | 9 +- + .../platform/wayland/host/wayland_cursor.cc | 4 +- + .../wayland/host/wayland_data_device.cc | 10 +-- + .../wayland/host/wayland_data_device_base.cc | 2 +- + .../host/wayland_data_drag_controller.cc | 2 +- + .../wayland/host/wayland_data_source.cc | 6 +- + ui/ozone/platform/wayland/host/wayland_drm.cc | 6 +- + .../wayland/host/wayland_extensions.h | 6 ++ + .../platform/wayland/host/wayland_keyboard.cc | 4 +- + .../platform/wayland/host/wayland_popup.cc | 8 +- + .../platform/wayland/host/wayland_seat.cc | 2 +- + ui/ozone/platform/wayland/host/wayland_shm.cc | 2 +- + .../platform/wayland/host/wayland_surface.cc | 2 +- + .../wayland/host/wayland_toplevel_window.cc | 18 ++-- + .../platform/wayland/host/wayland_window.cc | 6 +- + .../platform/wayland/host/wayland_window.h | 2 + + .../host/wayland_window_drag_controller.cc | 2 +- + .../wayland/host/wayland_window_factory.cc | 14 +++ + .../wayland/host/wayland_zwp_linux_dmabuf.cc | 4 +- + .../wayland/host/xdg_foreign_wrapper.cc | 4 +- + .../wayland/host/xdg_popup_wrapper_impl.cc | 2 +- + .../wayland/host/xdg_surface_wrapper_impl.cc | 2 +- + .../wayland/host/xdg_toplevel_wrapper_impl.cc | 2 +- + .../host/zwp_primary_selection_device.cc | 2 +- + .../zwp_primary_selection_device_manager.cc | 4 +- + ui/platform_window/agl/platform_window_agl.h | 36 ++++++++ + ui/platform_window/platform_window.h | 4 +- + 46 files changed, 469 insertions(+), 63 deletions(-) + create mode 100644 ui/aura/agl/window_tree_host_agl.h + create mode 100644 ui/aura/agl/window_tree_host_platform_agl.cc + create mode 100644 ui/aura/agl/window_tree_host_platform_agl.h + create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc + create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h + create mode 100644 ui/platform_window/agl/platform_window_agl.h + +diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn +index 50ca856b9da18..8fa04492f69f7 100644 +--- a/ui/aura/BUILD.gn ++++ b/ui/aura/BUILD.gn +@@ -99,6 +99,13 @@ component("aura") { + "window_tree_host_platform.cc", + ] + ++ public += [ ++ "agl/window_tree_host_agl.h", ++ "agl/window_tree_host_platform_agl.h" ++ ] ++ ++ sources += [ "agl/window_tree_host_platform_agl.cc" ] ++ + friend = [ ":*" ] + + defines = [ "AURA_IMPLEMENTATION" ] +diff --git a/ui/aura/agl/window_tree_host_agl.h b/ui/aura/agl/window_tree_host_agl.h +new file mode 100644 +index 0000000000000..858a078d939d0 +--- /dev/null ++++ b/ui/aura/agl/window_tree_host_agl.h +@@ -0,0 +1,42 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#ifndef UI_AURA_AGL_WINDOW_TREE_HOST_AGL_H_ ++#define UI_AURA_AGL_WINDOW_TREE_HOST_AGL_H_ ++ ++#include ++ ++#include "ui/aura/aura_export.h" ++ ++namespace aura { ++ ++class AURA_EXPORT WindowTreeHostAgl { ++ public: ++ WindowTreeHostAgl() = default; ++ WindowTreeHostAgl(const WindowTreeHostAgl&) = delete; ++ WindowTreeHostAgl& operator=(const WindowTreeHostAgl&) = delete; ++ ~WindowTreeHostAgl() = default; ++ ++ virtual void SetAglActivateApp(const std::string& app) {} ++ virtual void SetAglAppId(const std::string& title) {} ++ virtual void SetAglReady() {} ++ virtual void SetAglBackground() {} ++ virtual void SetAglPanel(uint32_t edge) {} ++}; ++ ++} // namespace aura ++ ++#endif // UI_AURA_AGL_WINDOW_TREE_HOST_AGL_H_ +diff --git a/ui/aura/agl/window_tree_host_platform_agl.cc b/ui/aura/agl/window_tree_host_platform_agl.cc +new file mode 100644 +index 0000000000000..e34595fe0ed9c +--- /dev/null ++++ b/ui/aura/agl/window_tree_host_platform_agl.cc +@@ -0,0 +1,50 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#include "ui/aura/agl/window_tree_host_platform_agl.h" ++ ++#include "ui/aura/window_tree_host_platform.h" ++#include "ui/platform_window/platform_window.h" ++ ++namespace aura { ++ ++WindowTreeHostPlatformAgl::WindowTreeHostPlatformAgl( ++ std::unique_ptr window, ++ aura::WindowTreeHostPlatform* window_tree_host_platform) ++ : aura::WindowTreeHost(std::move(window)), ++ window_tree_host_platform_(window_tree_host_platform) {} ++ ++void WindowTreeHostPlatformAgl::SetAglActivateApp(const std::string& app) { ++ window_tree_host_platform_->platform_window()->SetAglActivateApp(app); ++} ++ ++void WindowTreeHostPlatformAgl::SetAglAppId(const std::string& title) { ++ window_tree_host_platform_->platform_window()->SetAglAppId(title); ++} ++ ++void WindowTreeHostPlatformAgl::SetAglReady() { ++ window_tree_host_platform_->platform_window()->SetAglReady(); ++} ++ ++void WindowTreeHostPlatformAgl::SetAglBackground() { ++ window_tree_host_platform_->platform_window()->SetAglBackground(); ++} ++ ++void WindowTreeHostPlatformAgl::SetAglPanel(uint32_t edge) { ++ window_tree_host_platform_->platform_window()->SetAglPanel(edge); ++} ++ ++} // namespace aura +diff --git a/ui/aura/agl/window_tree_host_platform_agl.h b/ui/aura/agl/window_tree_host_platform_agl.h +new file mode 100644 +index 0000000000000..181eefae346f7 +--- /dev/null ++++ b/ui/aura/agl/window_tree_host_platform_agl.h +@@ -0,0 +1,51 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#ifndef UI_AURA_AGL_WINDOW_TREE_HOST_PLATFORM_AGL_H_ ++#define UI_AURA_AGL_WINDOW_TREE_HOST_PLATFORM_AGL_H_ ++ ++#include ++ ++#include "ui/aura/aura_export.h" ++#include "ui/aura/window_tree_host.h" ++ ++namespace aura { ++ ++class Window; ++class WindowTreeHostPlatform; ++ ++class AURA_EXPORT WindowTreeHostPlatformAgl : public aura::WindowTreeHost { ++ public: ++ explicit WindowTreeHostPlatformAgl( ++ std::unique_ptr window, ++ aura::WindowTreeHostPlatform* window_tree_host_platform); ++ WindowTreeHostPlatformAgl(const WindowTreeHostPlatformAgl&) = delete; ++ WindowTreeHostPlatformAgl& operator=(const WindowTreeHostPlatformAgl&) = delete; ++ ~WindowTreeHostPlatformAgl() override = default; ++ ++ void SetAglActivateApp(const std::string& app) override; ++ void SetAglAppId(const std::string& title) override; ++ void SetAglReady() override; ++ void SetAglBackground() override; ++ void SetAglPanel(uint32_t edge) override; ++ ++ private: ++ aura::WindowTreeHostPlatform* window_tree_host_platform_; ++}; ++ ++} // namespace aura ++ ++#endif // UI_AURA_AGL_WINDOW_TREE_HOST_PLATFORM_AGL_H_ +diff --git a/ui/aura/window_tree_host.h b/ui/aura/window_tree_host.h +index b4b6e7022ea34..afb37a3a3ed13 100644 +--- a/ui/aura/window_tree_host.h ++++ b/ui/aura/window_tree_host.h +@@ -30,6 +30,8 @@ + #include "ui/gfx/native_widget_types.h" + #include "ui/gfx/overlay_transform.h" + ++#include "ui/aura/agl/window_tree_host_agl.h" ++ + namespace gfx { + class Point; + class Rect; +@@ -66,7 +68,8 @@ class WindowTreeHostObserver; + class AURA_EXPORT WindowTreeHost : public ui::ImeKeyEventDispatcher, + public ui::EventSource, + public display::DisplayObserver, +- public ui::CompositorObserver { ++ public ui::CompositorObserver, ++ public WindowTreeHostAgl { + public: + // VideoCaptureLock ensures state necessary for capturing video remains in + // effect. For example, this may force keeping the compositor visible when +diff --git a/ui/aura/window_tree_host_platform.cc b/ui/aura/window_tree_host_platform.cc +index fd4a560f6cdd1..33b9e892c0212 100644 +--- a/ui/aura/window_tree_host_platform.cc ++++ b/ui/aura/window_tree_host_platform.cc +@@ -52,7 +52,7 @@ std::unique_ptr WindowTreeHost::Create( + WindowTreeHostPlatform::WindowTreeHostPlatform( + ui::PlatformWindowInitProperties properties, + std::unique_ptr window) +- : WindowTreeHost(std::move(window)) { ++ : WindowTreeHostPlatformAgl(std::move(window), this) { + size_in_pixels_ = properties.bounds.size(); + CreateCompositor(false, false, properties.enable_compositing_based_throttling, + properties.compositor_memory_limit_mb); +@@ -60,7 +60,7 @@ WindowTreeHostPlatform::WindowTreeHostPlatform( + } + + WindowTreeHostPlatform::WindowTreeHostPlatform(std::unique_ptr window) +- : WindowTreeHost(std::move(window)), ++ : WindowTreeHostPlatformAgl(std::move(window), this), + widget_(gfx::kNullAcceleratedWidget), + current_cursor_(ui::mojom::CursorType::kNull) {} + +diff --git a/ui/aura/window_tree_host_platform.h b/ui/aura/window_tree_host_platform.h +index 92ae0f0229e70..9c3f742c30ad3 100644 +--- a/ui/aura/window_tree_host_platform.h ++++ b/ui/aura/window_tree_host_platform.h +@@ -15,6 +15,8 @@ + #include "ui/gfx/native_widget_types.h" + #include "ui/platform_window/platform_window_delegate.h" + ++#include "ui/aura/agl/window_tree_host_platform_agl.h" ++ + namespace ui { + enum class DomCode; + class PlatformWindow; +@@ -26,7 +28,7 @@ namespace aura { + + // The unified WindowTreeHost implementation for platforms + // that implement PlatformWindow. +-class AURA_EXPORT WindowTreeHostPlatform : public WindowTreeHost, ++class AURA_EXPORT WindowTreeHostPlatform : public WindowTreeHostPlatformAgl, + public ui::PlatformWindowDelegate { + public: + explicit WindowTreeHostPlatform(ui::PlatformWindowInitProperties properties, +diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn +index 8a436de0fafe3..754cb123043a9 100644 +--- a/ui/ozone/platform/wayland/BUILD.gn ++++ b/ui/ozone/platform/wayland/BUILD.gn +@@ -400,7 +400,6 @@ source_set("wayland") { + + sources += [ + "host/wayland_extensions.h", +- "host/wayland_extensions_stub.cc", + ] + + deps += [ "extensions/agl" ] +diff --git a/ui/ozone/platform/wayland/extensions/agl/BUILD.gn b/ui/ozone/platform/wayland/extensions/agl/BUILD.gn +index ce289bc5dbbca..01c590e53df58 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/BUILD.gn ++++ b/ui/ozone/platform/wayland/extensions/agl/BUILD.gn +@@ -31,6 +31,8 @@ source_set("agl") { + "host/wayland_extensions_agl.h", + "host/wayland_extensions_agl_impl.cc", + "host/wayland_extensions_agl_impl.h", ++ "host/wayland_window_agl.cc", ++ "host/wayland_window_agl.h", + ] + + deps = [ +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h +index df42fc00c84da..295154dfb437d 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h +@@ -20,6 +20,9 @@ + namespace ui { + + class AglShellWrapper; ++class PlatformWindowDelegate; ++class WaylandConnection; ++class WaylandWindow; + + // AGL extensions implementation for webOS/Lite + class WaylandExtensionsAgl { +@@ -29,9 +32,14 @@ class WaylandExtensionsAgl { + WaylandExtensionsAgl& operator=(const WaylandExtensionsAgl&) = delete; + virtual ~WaylandExtensionsAgl() = default; + ++ virtual std::unique_ptr CreateWaylandWindow( ++ PlatformWindowDelegate* delegate, ++ WaylandConnection* connection) = 0; ++ ++ + virtual AglShellWrapper* GetAglShell() = 0; + }; + + } // namespace ui + +-#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ +\ No newline at end of file ++#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc +index 26a5f0550c302..87376cbb8a9d3 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc +@@ -22,6 +22,7 @@ + #include "base/logging.h" + #include "ui/base/ui_base_switches.h" + #include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" ++#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h" + #include "ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h" + #include "ui/ozone/platform/wayland/host/wayland_connection.h" + +@@ -68,8 +69,8 @@ bool WaylandExtensionsAglImpl::Bind(wl_registry* registry, + agl_shell_ = + std::make_unique(aglshell.release(), connection_); + +- LOG(INFO) << "Waiting until bound..."; +- return agl_shell_->WaitUntilBoundOk(); ++ //LOG(INFO) << "Waiting until bound..."; ++ //return agl_shell_->WaitUntilBoundOk(); + } else { + LOG(INFO) << "Cant bind."; + } +@@ -85,6 +86,12 @@ AglShellWrapper* WaylandExtensionsAglImpl::GetAglShell() { + return agl_shell_.get(); + } + ++std::unique_ptr WaylandExtensionsAglImpl::CreateWaylandWindow( ++ PlatformWindowDelegate* delegate, ++ WaylandConnection* connection) { ++ return std::make_unique(delegate, connection, this); ++} ++ + std::unique_ptr CreateWaylandExtensions( + WaylandConnection* connection) { + return std::make_unique(connection); +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h +index f6cbabe99ed0b..3218589f1a09a 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h +@@ -17,12 +17,17 @@ + #ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ + #define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ + ++#include ++ + #include "ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h" + #include "ui/ozone/platform/wayland/host/wayland_extensions.h" + + namespace ui { + + class AglShellWrapper; ++class PlatformWindowDelegate; ++class WaylandConnection; ++class WaylandWindow; + + // AGL extension implementation for webOS/Lite + class WaylandExtensionsAglImpl : public WaylandExtensions, +@@ -44,6 +49,10 @@ class WaylandExtensionsAglImpl : public WaylandExtensions, + // WaylandExtensionsAgl overrides + AglShellWrapper* GetAglShell() override; + ++ std::unique_ptr CreateWaylandWindow( ++ PlatformWindowDelegate* delegate, ++ WaylandConnection* connection) override; ++ + private: + std::unique_ptr agl_shell_; + WaylandConnection* connection_; +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc +new file mode 100644 +index 0000000000000..97b21ae537658 +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc +@@ -0,0 +1,86 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h" ++ ++#include "base/logging.h" ++#include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" ++#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h" ++#include "ui/ozone/platform/wayland/host/shell_surface_wrapper.h" ++#include "ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h" ++#include "ui/ozone/platform/wayland/host/wayland_connection.h" ++ ++namespace ui { ++ ++WaylandWindowAgl::WaylandWindowAgl(PlatformWindowDelegate* delegate, ++ WaylandConnection* connection, ++ WaylandExtensionsAgl* agl_extensions) ++ : WaylandToplevelWindow(delegate, connection), ++ agl_extensions_(agl_extensions) {} ++ ++WaylandWindowAgl::~WaylandWindowAgl() = default; ++ ++void WaylandWindowAgl::SetAglActivateApp(const std::string& app) { ++ if (!agl_extensions_->GetAglShell()) { ++ LOG(ERROR) << "Agl shell wrapper is not created"; ++ return; ++ } ++ ++ agl_extensions_->GetAglShell()->SetAglActivateApp(app); ++ connection()->ScheduleFlush(); ++} ++ ++void WaylandWindowAgl::SetAglAppId(const std::string& title) { ++ if (!shell_toplevel()) { ++ LOG(ERROR) << "Shell toplevel is not created"; ++ return; ++ } ++ ++ shell_toplevel()->SetAppId(title); ++ connection()->ScheduleFlush(); ++} ++ ++void WaylandWindowAgl::SetAglReady() { ++ if (!agl_extensions_->GetAglShell()) { ++ LOG(ERROR) << "Agl shell wrapper is not created"; ++ return; ++ } ++ ++ agl_extensions_->GetAglShell()->SetAglReady(); ++ connection()->ScheduleFlush(); ++} ++ ++void WaylandWindowAgl::SetAglBackground() { ++ if (!agl_extensions_->GetAglShell()) { ++ LOG(ERROR) << "Agl shell wrapper is not created"; ++ return; ++ } ++ ++ agl_extensions_->GetAglShell()->SetAglBackground(this); ++ connection()->ScheduleFlush(); ++} ++ ++void WaylandWindowAgl::SetAglPanel(uint32_t edge) { ++ if (!agl_extensions_->GetAglShell()) { ++ LOG(ERROR) << "Agl shell wrapper is not created"; ++ return; ++ } ++ ++ agl_extensions_->GetAglShell()->SetAglPanel(this, edge); ++ connection()->ScheduleFlush(); ++} ++ ++} // namespace ui +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h +new file mode 100644 +index 0000000000000..b2a922604c001 +--- /dev/null ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h +@@ -0,0 +1,49 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++// ++ ++#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_WINDOW_AGL_H_ ++#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_WINDOW_AGL_H_ ++ ++#include "ui/ozone/platform/wayland/host/wayland_toplevel_window.h" ++ ++namespace ui { ++ ++class WaylandExtensionsAgl; ++ ++class WaylandWindowAgl : public WaylandToplevelWindow { ++ public: ++ explicit WaylandWindowAgl(PlatformWindowDelegate* delegate, ++ WaylandConnection* connection, ++ WaylandExtensionsAgl* agl_extensions); ++ WaylandWindowAgl(const WaylandWindowAgl&) = delete; ++ WaylandWindowAgl& operator=(const WaylandWindowAgl&) = delete; ++ ~WaylandWindowAgl() override; ++ ++ // Overrides PlatformWindowAgl ++ void SetAglActivateApp(const std::string& app) override; ++ void SetAglAppId(const std::string& title) override; ++ void SetAglReady() override; ++ void SetAglBackground() override; ++ void SetAglPanel(uint32_t edge) override; ++ ++ private: ++ WaylandExtensionsAgl* agl_extensions_; ++}; ++ ++} // namespace ui ++ ++#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_WINDOW_AGL_H_ +diff --git a/ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc b/ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc +index 1cda8aa671ddb..220f759ff30a1 100644 +--- a/ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc ++++ b/ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc +@@ -90,7 +90,14 @@ gfx::SwapResult GLSurfaceWayland::SwapBuffers(PresentationCallback callback, + return scoped_swap_buffers.result(); + } + window_->root_surface()->set_surface_buffer_scale(scale_factor_); +- return gl::NativeViewGLSurfaceEGL::SwapBuffers(std::move(callback), data); ++ ++ gfx::SwapResult result = gl::NativeViewGLSurfaceEGL::SwapBuffers(std::move(callback), data); ++ ++ if (window_) { ++ window_->OnSurfaceContentChanged(); ++ } ++ ++ return result; + } + + gfx::SwapResult GLSurfaceWayland::PostSubBuffer(int x, +diff --git a/ui/ozone/platform/wayland/host/gtk_primary_selection_device.cc b/ui/ozone/platform/wayland/host/gtk_primary_selection_device.cc +index c62dd62be4fbf..2959593cfeb5b 100644 +--- a/ui/ozone/platform/wayland/host/gtk_primary_selection_device.cc ++++ b/ui/ozone/platform/wayland/host/gtk_primary_selection_device.cc +@@ -32,7 +32,7 @@ void GtkPrimarySelectionDevice::SetSelectionSource( + auto* data_source = source ? source->data_source() : nullptr; + gtk_primary_selection_device_set_selection(data_device_.get(), data_source, + serial); +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + // static +diff --git a/ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.cc b/ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.cc +index 2c39409808128..1e07ae6009776 100644 +--- a/ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.cc ++++ b/ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.cc +@@ -66,7 +66,7 @@ GtkPrimarySelectionDevice* GtkPrimarySelectionDeviceManager::GetDevice() { + connection_, + gtk_primary_selection_device_manager_get_device( + device_manager_.get(), connection_->seat()->wl_object())); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + DCHECK(device_); + return device_.get(); +@@ -77,7 +77,7 @@ GtkPrimarySelectionDeviceManager::CreateSource( + GtkPrimarySelectionSource::Delegate* delegate) { + auto* data_source = + gtk_primary_selection_device_manager_create_source(device_manager_.get()); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + return std::make_unique(data_source, connection_, + delegate); + } +diff --git a/ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.cc b/ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.cc +index f2407d1c306ec..7a7868ded8a52 100644 +--- a/ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.cc ++++ b/ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.cc +@@ -69,7 +69,7 @@ void WaylandProxyImpl::DestroyShmForWlBuffer(wl_buffer* buffer) { + } + + void WaylandProxyImpl::FlushForTesting() { +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + ui::PlatformWindowType WaylandProxyImpl::GetWindowType( +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc +index 7a47d4a636998..8d9e8eea6fd79 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.cc ++++ b/ui/ozone/platform/wayland/host/wayland_connection.cc +@@ -264,6 +264,20 @@ bool WaylandConnection::Initialize(bool use_threaded_polling) { + return true; + } + ++void WaylandConnection::ScheduleFlush() { ++ // When we are in tests, the message loop is set later when the ++ // initialization of the OzonePlatform complete. Thus, just ++ // flush directly. This doesn't happen in normal run. ++ if (!base::CurrentUIThread::IsSet()) { ++ Flush(); ++ } else if (!scheduled_flush_) { ++ base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( ++ FROM_HERE, ++ base::BindOnce(&WaylandConnection::Flush, base::Unretained(this))); ++ scheduled_flush_ = true; ++ } ++} ++ + void WaylandConnection::RoundTripQueue() { + if (roundtrip_closure_for_testing_) { + roundtrip_closure_for_testing_.Run(); +@@ -333,6 +347,7 @@ void WaylandConnection::RegisterGlobalObjectFactory( + + void WaylandConnection::Flush() { + wl_display_flush(display_.get()); ++ scheduled_flush_ = false; + } + + void WaylandConnection::UpdateInputDevices() { +@@ -526,7 +541,7 @@ void WaylandConnection::OnPing(void* data, + uint32_t serial) { + auto* connection = static_cast(data); + xdg_wm_base_pong(shell, serial); +- connection->Flush(); ++ connection->ScheduleFlush(); + } + + // static +@@ -707,7 +722,7 @@ void WaylandConnection::HandleGlobal(wl_registry* registry, + } + + available_globals_.emplace_back(interface, version); +- Flush(); ++ ScheduleFlush(); + } + + } // namespace ui +diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h +index ba293e5bcd088..641f36f13db35 100644 +--- a/ui/ozone/platform/wayland/host/wayland_connection.h ++++ b/ui/ozone/platform/wayland/host/wayland_connection.h +@@ -100,8 +100,8 @@ class WaylandConnection { + + bool Initialize(bool use_threaded_polling = false); + +- // Immediately flushes the Wayland display. +- void Flush(); ++ // Schedules a flush of the Wayland connection. ++ void ScheduleFlush(); + + // Calls wl_display_roundtrip_queue. Might be required during initialization + // of some objects that should block until they are initialized. +@@ -388,6 +388,9 @@ class WaylandConnection { + friend class ZwpIdleInhibitManager; + friend class ZwpPrimarySelectionDeviceManager; + ++ // Immediately flushes the Wayland display. ++ void Flush(); ++ + void RegisterGlobalObjectFactory(const char* interface_name, + wl::GlobalObjectFactory factory); + +@@ -535,6 +538,8 @@ class WaylandConnection { + // This is set if delegated composition should not be used. + bool overlay_delegation_disabled_ = false; + ++ bool scheduled_flush_ = false; ++ + wl::SerialTracker serial_tracker_; + + // Global Wayland interfaces available in the current session, with their +diff --git a/ui/ozone/platform/wayland/host/wayland_cursor.cc b/ui/ozone/platform/wayland/host/wayland_cursor.cc +index 1b7d303291cff..a384212c84134 100644 +--- a/ui/ozone/platform/wayland/host/wayland_cursor.cc ++++ b/ui/ozone/platform/wayland/host/wayland_cursor.cc +@@ -107,7 +107,7 @@ void WaylandCursor::HideCursor() { + wl_surface_attach(pointer_surface_.get(), nullptr, 0, 0); + wl_surface_commit(pointer_surface_.get()); + +- connection_->Flush(); ++ connection_->ScheduleFlush(); + + if (listener_) + listener_->OnCursorBufferAttached(nullptr); +@@ -166,7 +166,7 @@ void WaylandCursor::AttachAndCommit(wl_buffer* buffer, + wl_pointer_set_cursor(pointer_->wl_object(), pointer_enter_serial->value, + pointer_surface_.get(), hotspot_x_dip, hotspot_y_dip); + +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + } // namespace ui +diff --git a/ui/ozone/platform/wayland/host/wayland_data_device.cc b/ui/ozone/platform/wayland/host/wayland_data_device.cc +index a7adfd313188b..fe16d8577fd35 100644 +--- a/ui/ozone/platform/wayland/host/wayland_data_device.cc ++++ b/ui/ozone/platform/wayland/host/wayland_data_device.cc +@@ -51,7 +51,7 @@ void WaylandDataDevice::StartDrag(const WaylandDataSource& data_source, + origin_window.root_surface()->surface(), + icon_surface, serial); + drag_delegate_->DrawIcon(); +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + void WaylandDataDevice::ResetDragDelegate() { +@@ -92,7 +92,7 @@ void WaylandDataDevice::SetSelectionSource(WaylandDataSource* source, + uint32_t serial) { + auto* data_source = source ? source->data_source() : nullptr; + wl_data_device_set_selection(data_device_.get(), data_source, serial); +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + void WaylandDataDevice::ReadDragDataFromFD(base::ScopedFD fd, +@@ -146,7 +146,7 @@ void WaylandDataDevice::OnEnter(void* data, + gfx::PointF(wl_fixed_to_double(x), wl_fixed_to_double(y)), window); + self->drag_delegate_->OnDragEnter(window, point, serial); + +- self->connection()->Flush(); ++ self->connection()->ScheduleFlush(); + } + + void WaylandDataDevice::OnMotion(void* data, +@@ -167,7 +167,7 @@ void WaylandDataDevice::OnDrop(void* data, wl_data_device* data_device) { + auto* self = static_cast(data); + if (self->drag_delegate_) { + self->drag_delegate_->OnDragDrop(); +- self->connection()->Flush(); ++ self->connection()->ScheduleFlush(); + } + + // There are buggy Exo versions, which send 'drop' event (even for +@@ -184,7 +184,7 @@ void WaylandDataDevice::OnLeave(void* data, wl_data_device* data_device) { + auto* self = static_cast(data); + if (self->drag_delegate_) { + self->drag_delegate_->OnDragLeave(); +- self->connection()->Flush(); ++ self->connection()->ScheduleFlush(); + } + self->ResetDragDelegateIfNotDragSource(); + } +diff --git a/ui/ozone/platform/wayland/host/wayland_data_device_base.cc b/ui/ozone/platform/wayland/host/wayland_data_device_base.cc +index 203e907f92bfa..a0c72971ac567 100644 +--- a/ui/ozone/platform/wayland/host/wayland_data_device_base.cc ++++ b/ui/ozone/platform/wayland/host/wayland_data_device_base.cc +@@ -64,7 +64,7 @@ void WaylandDataDeviceBase::RegisterDeferredReadCallback() { + static constexpr wl_callback_listener kSyncCallbackListener = { + .done = &OnSyncDone}; + wl_callback_add_listener(sync_callback_.get(), &kSyncCallbackListener, this); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + void WaylandDataDeviceBase::RegisterDeferredReadClosure( +diff --git a/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc +index 705bdec41a1b7..dfa5789e8d149 100644 +--- a/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc ++++ b/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc +@@ -256,7 +256,7 @@ void WaylandDataDragController::OnDragSurfaceFrame(void* data, + DCHECK(self); + self->DrawIconInternal(); + self->icon_frame_callback_.reset(); +- self->connection_->Flush(); ++ self->connection_->ScheduleFlush(); + } + + SkBitmap WaylandDataDragController::GetIconBitmap() { +diff --git a/ui/ozone/platform/wayland/host/wayland_data_source.cc b/ui/ozone/platform/wayland/host/wayland_data_source.cc +index c0e95c8a22e48..c294ffb8836aa 100644 +--- a/ui/ozone/platform/wayland/host/wayland_data_source.cc ++++ b/ui/ozone/platform/wayland/host/wayland_data_source.cc +@@ -130,7 +130,7 @@ void DataSource::Offer( + const std::vector& mime_types) { + for (auto& mime_type : mime_types) + wl_data_source_offer(data_source_.get(), mime_type.c_str()); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + template +@@ -165,7 +165,7 @@ void DataSource::Offer( + const std::vector& mime_types) { + for (const auto& mime_type : mime_types) + gtk_primary_selection_source_offer(data_source_.get(), mime_type.c_str()); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + template <> +@@ -185,7 +185,7 @@ void DataSource::Offer( + for (const auto& mime_type : mime_types) + zwp_primary_selection_source_v1_offer(data_source_.get(), + mime_type.c_str()); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + template class DataSource; +diff --git a/ui/ozone/platform/wayland/host/wayland_drm.cc b/ui/ozone/platform/wayland/host/wayland_drm.cc +index 68570a9aacb2c..2b3b16e8859cb 100644 +--- a/ui/ozone/platform/wayland/host/wayland_drm.cc ++++ b/ui/ozone/platform/wayland/host/wayland_drm.cc +@@ -58,7 +58,7 @@ WaylandDrm::WaylandDrm(wl_drm* drm, WaylandConnection* connection) + .capabilities = &OnCapabilities, + }; + wl_drm_add_listener(wl_drm_.get(), &kDrmListener, this); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + + // A roundtrip after binding guarantees that the client has received all + // supported formats and capabilities of the device. +@@ -92,7 +92,7 @@ void WaylandDrm::CreateBuffer(const base::ScopedFD& fd, + wl::Object buffer(wl_drm_create_prime_buffer( + wl_drm_.get(), fd.get(), size.width(), size.height(), format, offset[0], + stride[0], offset[1], stride[1], offset[2], stride[2])); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + + std::move(callback).Run(std::move(buffer)); + } +@@ -146,7 +146,7 @@ void WaylandDrm::Authenticate(const char* drm_device_path) { + } + + wl_drm_authenticate(wl_drm_.get(), magic); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + + // Do the roundtrip to make sure the server processes this request and + // authenticates us. +diff --git a/ui/ozone/platform/wayland/host/wayland_extensions.h b/ui/ozone/platform/wayland/host/wayland_extensions.h +index 3bd2fd7a211ae..f6ed47507d217 100644 +--- a/ui/ozone/platform/wayland/host/wayland_extensions.h ++++ b/ui/ozone/platform/wayland/host/wayland_extensions.h +@@ -25,7 +25,9 @@ namespace ui { + + class ShellToplevelWrapper; + class ShellPopupWrapper; ++class PlatformWindowDelegate; + class WaylandConnection; ++class WaylandWindow; + + // Wayland extensions abstract interface to support extending of the Wayland + // protocol. Inherit it to provide your own Wayland extensions implementation. +@@ -45,6 +47,10 @@ class WaylandExtensions { + + // Checks whether the extensions have bound shell object(s). + virtual bool HasShellObject() const = 0; ++ ++ virtual std::unique_ptr CreateWaylandWindow( ++ PlatformWindowDelegate* delegate, ++ WaylandConnection* connection) = 0; + }; + + // Creates Wayland extensions. +diff --git a/ui/ozone/platform/wayland/host/wayland_keyboard.cc b/ui/ozone/platform/wayland/host/wayland_keyboard.cc +index 2b7fc05d426e1..f24d6993b26ac 100644 +--- a/ui/ozone/platform/wayland/host/wayland_keyboard.cc ++++ b/ui/ozone/platform/wayland/host/wayland_keyboard.cc +@@ -114,7 +114,7 @@ class WaylandKeyboard::ZCRExtendedKeyboard { + + void AckKey(uint32_t serial, bool handled) { + zcr_extended_keyboard_v1_ack_key(obj_.get(), serial, handled); +- keyboard_->connection_->Flush(); ++ keyboard_->connection_->ScheduleFlush(); + } + + // Returns true if connected object will send zcr_extended_keyboard::peek_key. +@@ -373,7 +373,7 @@ void WaylandKeyboard::FlushInput(base::OnceClosure closure) { + .done = &OnSyncDone, + }; + wl_callback_add_listener(sync_callback_.get(), &kSyncCallbackListener, this); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + void WaylandKeyboard::DispatchKey(unsigned int key, +diff --git a/ui/ozone/platform/wayland/host/wayland_popup.cc b/ui/ozone/platform/wayland/host/wayland_popup.cc +index f1e886f8675fb..28903c031e6ce 100644 +--- a/ui/ozone/platform/wayland/host/wayland_popup.cc ++++ b/ui/ozone/platform/wayland/host/wayland_popup.cc +@@ -132,7 +132,7 @@ void WaylandPopup::Show(bool inactive) { + return; + } + +- connection()->Flush(); ++ connection()->ScheduleFlush(); + WaylandWindow::Show(inactive); + } + +@@ -158,7 +158,7 @@ void WaylandPopup::Hide() { + decorated_via_aura_popup_ = false; + } + +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + bool WaylandPopup::IsVisible() const { +@@ -256,14 +256,14 @@ void WaylandPopup::ShowTooltip(const std::u16string& text, + if (zaura_surface && + zaura_surface->ShowTooltip(text, position, zaura_shell_trigger, + show_delay, hide_delay)) { +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + } + + void WaylandPopup::HideTooltip() { + auto* zaura_surface = GetZAuraSurface(); + if (zaura_surface && zaura_surface->HideTooltip()) { +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + } + +diff --git a/ui/ozone/platform/wayland/host/wayland_seat.cc b/ui/ozone/platform/wayland/host/wayland_seat.cc +index 3b05da49eb6b8..5f70725a9a9dd 100644 +--- a/ui/ozone/platform/wayland/host/wayland_seat.cc ++++ b/ui/ozone/platform/wayland/host/wayland_seat.cc +@@ -128,7 +128,7 @@ void WaylandSeat::HandleCapabilities(void* data, + + connection_->UpdateInputDevices(); + connection_->UpdateCursor(); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + } // namespace ui +diff --git a/ui/ozone/platform/wayland/host/wayland_shm.cc b/ui/ozone/platform/wayland/host/wayland_shm.cc +index b264ad88962bb..95c19d9962085 100644 +--- a/ui/ozone/platform/wayland/host/wayland_shm.cc ++++ b/ui/ozone/platform/wayland/host/wayland_shm.cc +@@ -62,7 +62,7 @@ wl::Object WaylandShm::CreateBuffer(const base::ScopedFD& fd, + with_alpha_channel ? WL_SHM_FORMAT_ARGB8888 : WL_SHM_FORMAT_XRGB8888; + wl::Object shm_buffer(wl_shm_pool_create_buffer( + pool.get(), 0, size.width(), size.height(), size.width() * 4, format)); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + return shm_buffer; + } + +diff --git a/ui/ozone/platform/wayland/host/wayland_surface.cc b/ui/ozone/platform/wayland/host/wayland_surface.cc +index 47dc846390898..2a04d28b05484 100644 +--- a/ui/ozone/platform/wayland/host/wayland_surface.cc ++++ b/ui/ozone/platform/wayland/host/wayland_surface.cc +@@ -305,7 +305,7 @@ void WaylandSurface::UpdateBufferDamageRegion(const gfx::Rect& damage_px) { + void WaylandSurface::Commit(bool flush) { + wl_surface_commit(surface_.get()); + if (flush) +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + void WaylandSurface::set_surface_buffer_scale(float scale) { +diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +index 898113178a783..1b489b327fa29 100644 +--- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc ++++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc +@@ -127,7 +127,7 @@ void WaylandToplevelWindow::DispatchHostWindowDragMovement( + else + shell_toplevel_->SurfaceResize(connection(), hittest); + +- connection()->Flush(); ++ connection()->ScheduleFlush(); + #if !BUILDFLAG(IS_CHROMEOS_LACROS) + // TODO(crbug.com/1454893): Revisit to resolve the correct impl. + connection()->event_source()->ResetPointerFlags(); +@@ -176,7 +176,7 @@ void WaylandToplevelWindow::Hide() { + gtk_surface1_.reset(); + + shell_toplevel_.reset(); +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + bool WaylandToplevelWindow::IsVisible() const { +@@ -193,7 +193,7 @@ void WaylandToplevelWindow::SetTitle(const std::u16string& title) { + + if (shell_toplevel_) { + shell_toplevel_->SetTitle(title); +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + } + +@@ -288,13 +288,13 @@ void WaylandToplevelWindow::Activate() { + // but nothing more happens (until the user moves the mouse over a Lacros + // window in which case events will start and the activation will come + // through). +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + void WaylandToplevelWindow::Deactivate() { + if (shell_toplevel_ && shell_toplevel_->SupportsActivation()) { + shell_toplevel_->Deactivate(); +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + } + +@@ -722,14 +722,14 @@ void WaylandToplevelWindow::ShowTooltip( + if (zaura_surface && + zaura_surface->ShowTooltip(text, position, zaura_shell_trigger, + show_delay, hide_delay)) { +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + } + + void WaylandToplevelWindow::HideTooltip() { + auto* zaura_surface = GetZAuraSurface(); + if (zaura_surface && zaura_surface->HideTooltip()) { +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + } + +@@ -1001,7 +1001,7 @@ void WaylandToplevelWindow::TriggerStateChanges() { + } + + delegate()->OnWindowStateChanged(previous_state_, state_); +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + void WaylandToplevelWindow::SetWindowState(PlatformWindowState state) { +@@ -1035,7 +1035,7 @@ void WaylandToplevelWindow::SetSizeConstraints() { + shell_toplevel_->SetCanMaximize(delegate()->CanMaximize()); + shell_toplevel_->SetCanFullscreen(delegate()->CanFullscreen()); + +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + void WaylandToplevelWindow::SetOrResetRestoredBounds() { +diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc +index ad4366edfe4db..9a18c567bcbcc 100644 +--- a/ui/ozone/platform/wayland/host/wayland_window.cc ++++ b/ui/ozone/platform/wayland/host/wayland_window.cc +@@ -686,6 +686,10 @@ std::string WaylandWindow::WindowStates::ToString() const { + return states; + } + ++void WaylandWindow::OnSurfaceContentChanged() { ++ connection_->ScheduleFlush(); ++} ++ + void WaylandWindow::HandleToplevelConfigure(int32_t widht, + int32_t height, + const WindowStates& window_states) { +@@ -832,7 +836,7 @@ bool WaylandWindow::Initialize(PlatformWindowInitProperties properties) { + root_surface_->EnableTrustedDamageIfPossible(); + root_surface_->ApplyPendingState(); + +- connection_->Flush(); ++ connection_->ScheduleFlush(); + + return true; + } +diff --git a/ui/ozone/platform/wayland/host/wayland_window.h b/ui/ozone/platform/wayland/host/wayland_window.h +index d68d4d818f28f..2c5afbb3de99c 100644 +--- a/ui/ozone/platform/wayland/host/wayland_window.h ++++ b/ui/ozone/platform/wayland/host/wayland_window.h +@@ -230,6 +230,8 @@ class WaylandWindow : public PlatformWindow, + // currently bound to. + virtual void HandleSurfaceConfigure(uint32_t serial); + ++ void OnSurfaceContentChanged(); ++ + struct WindowStates { + bool is_maximized = false; + bool is_fullscreen = false; +diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc +index e38565635a583..ff201c038efb7 100644 +--- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc ++++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc +@@ -91,7 +91,7 @@ class WaylandWindowDragController::ExtendedDragSource { + auto* surface = window ? window->root_surface()->surface() : nullptr; + zcr_extended_drag_source_v1_drag(source_.get(), surface, offset.x(), + offset.y()); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + private: +diff --git a/ui/ozone/platform/wayland/host/wayland_window_factory.cc b/ui/ozone/platform/wayland/host/wayland_window_factory.cc +index 6f66c6654819c..e2bc045e4b3fb 100644 +--- a/ui/ozone/platform/wayland/host/wayland_window_factory.cc ++++ b/ui/ozone/platform/wayland/host/wayland_window_factory.cc +@@ -12,6 +12,8 @@ + #include "ui/ozone/platform/wayland/host/wayland_window.h" + #include "ui/platform_window/platform_window_init_properties.h" + ++#include "ui/ozone/platform/wayland/host/wayland_extensions.h" ++ + namespace ui { + + // static +@@ -29,6 +31,12 @@ std::unique_ptr WaylandWindow::Create( + // toplevel window instead. + if (auto* parent = connection->window_manager()->GetWindow( + properties.parent_widget)) { ++ if (connection->extensions()) { ++ window = connection->extensions()->CreateWaylandWindow(delegate, ++ connection); ++ if (window) ++ break; ++ } + window = std::make_unique(delegate, connection, parent); + } else { + DLOG(WARNING) << "Failed to determine parent for menu/popup window."; +@@ -40,6 +48,12 @@ std::unique_ptr WaylandWindow::Create( + case PlatformWindowType::kDrag: + // TODO(crbug.com/1399419): Figure out what kind of surface we need to + // create for kBubble and kDrag windows. ++ if (connection->extensions()) { ++ window = ++ connection->extensions()->CreateWaylandWindow(delegate, connection); ++ if (window) ++ break; ++ } + window = std::make_unique(delegate, connection); + break; + default: +diff --git a/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc b/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc +index 33935db68eadd..15f600ed7a126 100644 +--- a/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc ++++ b/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc +@@ -104,7 +104,7 @@ void WaylandZwpLinuxDmabuf::CreateBuffer(const base::ScopedFD& fd, + // created buffer and notify the client about it via the |callback|. + pending_params_.emplace(std::move(params), std::move(callback)); + } +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + bool WaylandZwpLinuxDmabuf::CanCreateBufferImmed() const { +@@ -147,7 +147,7 @@ void WaylandZwpLinuxDmabuf::NotifyRequestCreateBufferDone( + DCHECK(it != pending_params_.end()); + std::move(it->second).Run(wl::Object(new_buffer)); + pending_params_.erase(it); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + // static +diff --git a/ui/ozone/platform/wayland/host/xdg_foreign_wrapper.cc b/ui/ozone/platform/wayland/host/xdg_foreign_wrapper.cc +index 293c09a7e35f2..d36db127ec057 100644 +--- a/ui/ozone/platform/wayland/host/xdg_foreign_wrapper.cc ++++ b/ui/ozone/platform/wayland/host/xdg_foreign_wrapper.cc +@@ -158,7 +158,7 @@ void XdgForeignWrapperImpl:: + &kXdgExportedListener, this); + + exported_surfaces_.emplace_back(std::move(exported_surface)); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + template <> +@@ -174,7 +174,7 @@ void XdgForeignWrapperImpl:: + &kXdgExportedListener, this); + + exported_surfaces_.emplace_back(std::move(exported_surface)); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + // static +diff --git a/ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.cc b/ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.cc +index 64c8f2663ae60..b0d8f27aebbf9 100644 +--- a/ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.cc ++++ b/ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.cc +@@ -239,7 +239,7 @@ bool XDGPopupWrapperImpl::SetBounds(const gfx::Rect& new_bounds) { + xdg_popup_reposition(xdg_popup_.get(), positioner.get(), + ++next_reposition_token_); + +- connection_->Flush(); ++ connection_->ScheduleFlush(); + return true; + } + +diff --git a/ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.cc b/ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.cc +index c4dd8c8e78ce4..67702ecc8fa4f 100644 +--- a/ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.cc ++++ b/ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.cc +@@ -39,7 +39,7 @@ bool XDGSurfaceWrapperImpl::Initialize() { + }; + xdg_surface_add_listener(xdg_surface_.get(), &kXdgSurfaceListener, this); + +- connection_->Flush(); ++ connection_->ScheduleFlush(); + return true; + } + +diff --git a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc +index 0673c59185348..b9462c60a2eee 100644 +--- a/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc ++++ b/ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.cc +@@ -720,7 +720,7 @@ void XDGToplevelWrapperImpl::ShowSnapPreview( + + void XDGToplevelWrapperImpl::AckRotateFocus(uint32_t serial, uint32_t handled) { + zaura_toplevel_ack_rotate_focus(aura_toplevel_.get(), serial, handled); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + + XDGToplevelWrapperImpl* XDGToplevelWrapperImpl::AsXDGToplevelWrapper() { +diff --git a/ui/ozone/platform/wayland/host/zwp_primary_selection_device.cc b/ui/ozone/platform/wayland/host/zwp_primary_selection_device.cc +index 9057d1bea0116..97c1624e200ac 100644 +--- a/ui/ozone/platform/wayland/host/zwp_primary_selection_device.cc ++++ b/ui/ozone/platform/wayland/host/zwp_primary_selection_device.cc +@@ -32,7 +32,7 @@ void ZwpPrimarySelectionDevice::SetSelectionSource( + auto* data_source = source ? source->data_source() : nullptr; + zwp_primary_selection_device_v1_set_selection(data_device_.get(), data_source, + serial); +- connection()->Flush(); ++ connection()->ScheduleFlush(); + } + + // static +diff --git a/ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.cc b/ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.cc +index 9d5d79635b66d..2ca82ce6031ba 100644 +--- a/ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.cc ++++ b/ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.cc +@@ -66,7 +66,7 @@ ZwpPrimarySelectionDevice* ZwpPrimarySelectionDeviceManager::GetDevice() { + connection_, + zwp_primary_selection_device_manager_v1_get_device( + device_manager_.get(), connection_->seat()->wl_object())); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + } + DCHECK(device_); + return device_.get(); +@@ -77,7 +77,7 @@ ZwpPrimarySelectionDeviceManager::CreateSource( + ZwpPrimarySelectionSource::Delegate* delegate) { + auto* data_source = zwp_primary_selection_device_manager_v1_create_source( + device_manager_.get()); +- connection_->Flush(); ++ connection_->ScheduleFlush(); + return std::make_unique(data_source, connection_, + delegate); + } +diff --git a/ui/platform_window/agl/platform_window_agl.h b/ui/platform_window/agl/platform_window_agl.h +new file mode 100644 +index 0000000000000..4bc915d663e72 +--- /dev/null ++++ b/ui/platform_window/agl/platform_window_agl.h +@@ -0,0 +1,36 @@ ++// Copyright 2021 LG Electronics, Inc. ++// ++// Licensed under the Apache License, Version 2.0 (the "License"); ++// you may not use this file except in compliance with the License. ++// You may obtain a copy of the License at ++// ++// http://www.apache.org/licenses/LICENSE-2.0 ++// ++// Unless required by applicable law or agreed to in writing, software ++// distributed under the License is distributed on an "AS IS" BASIS, ++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++// See the License for the specific language governing permissions and ++// limitations under the License. ++// ++// SPDX-License-Identifier: Apache-2.0 ++ ++#ifndef UI_PLATFORM_WINDOW_AGL_PLATFORM_WINDOW_AGL_H_ ++#define UI_PLATFORM_WINDOW_AGL_PLATFORM_WINDOW_AGL_H_ ++ ++#include ++ ++namespace ui { ++ ++// AGL additions for platform window. ++class PlatformWindowAgl { ++ public: ++ virtual void SetAglActivateApp(const std::string& app) {} ++ virtual void SetAglAppId(const std::string& title) {} ++ virtual void SetAglReady() {} ++ virtual void SetAglBackground() {} ++ virtual void SetAglPanel(uint32_t edge) {} ++}; ++ ++} // namespace ui ++ ++#endif // UI_PLATFORM_WINDOW_AGL_PLATFORM_WINDOW_AGL_H_ +diff --git a/ui/platform_window/platform_window.h b/ui/platform_window/platform_window.h +index 845da9467d6a4..a9b28388ec649 100644 +--- a/ui/platform_window/platform_window.h ++++ b/ui/platform_window/platform_window.h +@@ -9,6 +9,7 @@ + #include + #include + ++#include "agl/platform_window_agl.h" + #include "base/component_export.h" + #include "ui/base/class_property.h" + #include "ui/base/ui_base_types.h" +@@ -32,7 +33,8 @@ class PlatformCursor; + + // Generic PlatformWindow interface. + class COMPONENT_EXPORT(PLATFORM_WINDOW) PlatformWindow +- : public PropertyHandler { ++ : public PropertyHandler, ++ public PlatformWindowAgl { + public: + PlatformWindow(); + ~PlatformWindow() override; +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0003-Remove-the-GN-settings-done-for-clang-that-conflict-.patch b/recipes-wam/cef/files/chromium/0003-Remove-the-GN-settings-done-for-clang-that-conflict-.patch deleted file mode 100644 index 68c37f25..00000000 --- a/recipes-wam/cef/files/chromium/0003-Remove-the-GN-settings-done-for-clang-that-conflict-.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 22de50ac2371aed1e04e4cb248beabb7f8ad3ebe Mon Sep 17 00:00:00 2001 -From: Roger Zanoni -Date: Thu, 27 Apr 2023 16:16:28 +0200 -Subject: [PATCH 3/9] Remove the GN settings done for clang that conflict with - OE - -clang cross compiler that is build with meta-clang has lot of these -settings built-in and specifying them here confuses the compiler - ---target option and -no-canonical-prefixes options result in clang - -finding the headers in target sysroot - -Upstream-Status: Inappropriate [OE-Specific] - -Signed-off-by: Khem Raj -Rebased-by: Maksim Sisov -Rebased-by: Randy MacLeod -Rebased-by: Roger Zanoni ---- - build/config/compiler/BUILD.gn | 37 ---------------------------------- - 1 file changed, 37 deletions(-) - -diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 531b326c498d0..244a6757613d5 100644 ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -924,11 +924,6 @@ config("compiler_cpu_abi") { - ] - } - } else if (current_cpu == "arm") { -- if (is_clang && !is_android && !is_nacl && -- !(is_chromeos_lacros && is_chromeos_device)) { -- cflags += [ "--target=arm-linux-gnueabihf" ] -- ldflags += [ "--target=arm-linux-gnueabihf" ] -- } - if (!is_nacl) { - cflags += [ - "-march=$arm_arch", -@@ -939,11 +934,6 @@ config("compiler_cpu_abi") { - cflags += [ "-mtune=$arm_tune" ] - } - } else if (current_cpu == "arm64") { -- if (is_clang && !is_android && !is_nacl && !is_fuchsia && -- !(is_chromeos_lacros && is_chromeos_device)) { -- cflags += [ "--target=aarch64-linux-gnu" ] -- ldflags += [ "--target=aarch64-linux-gnu" ] -- } - if (is_android) { - # Outline atomics crash on Exynos 9810. http://crbug.com/1272795 - cflags += [ "-mno-outline-atomics" ] -@@ -955,9 +945,6 @@ config("compiler_cpu_abi") { - if (is_android) { - cflags += [ "--target=mipsel-linux-android" ] - ldflags += [ "--target=mipsel-linux-android" ] -- } else { -- cflags += [ "--target=mipsel-linux-gnu" ] -- ldflags += [ "--target=mipsel-linux-gnu" ] - } - } else { - cflags += [ "-EL" ] -@@ -1037,8 +1024,6 @@ config("compiler_cpu_abi") { - ldflags += [ "-Wl,--hash-style=sysv" ] - if (custom_toolchain == "") { - if (is_clang) { -- cflags += [ "--target=mips-linux-gnu" ] -- ldflags += [ "--target=mips-linux-gnu" ] - } else { - cflags += [ "-EB" ] - ldflags += [ "-EB" ] -@@ -1086,9 +1071,6 @@ config("compiler_cpu_abi") { - if (is_android) { - cflags += [ "--target=mips64el-linux-android" ] - ldflags += [ "--target=mips64el-linux-android" ] -- } else { -- cflags += [ "--target=mips64el-linux-gnuabi64" ] -- ldflags += [ "--target=mips64el-linux-gnuabi64" ] - } - } else { - cflags += [ -@@ -1146,8 +1128,6 @@ config("compiler_cpu_abi") { - ldflags += [ "-Wl,--hash-style=sysv" ] - if (custom_toolchain == "") { - if (is_clang) { -- cflags += [ "--target=mips64-linux-gnuabi64" ] -- ldflags += [ "--target=mips64-linux-gnuabi64" ] - } else { - cflags += [ - "-EB", -@@ -1309,23 +1289,6 @@ config("compiler_deterministic") { - } - } - } -- -- # Tells the compiler not to use absolute paths when passing the default -- # paths to the tools it invokes. We don't want this because we don't -- # really need it and it can mess up the goma cache entries. -- if (is_clang && (!is_nacl || is_nacl_saigo)) { -- cflags += [ "-no-canonical-prefixes" ] -- -- # Same for links: Let the compiler driver invoke the linker -- # with a relative path and pass relative paths to built-in -- # libraries. Not needed on Windows because we call the linker -- # directly there, not through the compiler driver. -- # We don't link on goma, so this change is just for cleaner -- # internal linker invocations, for people who work on the build. -- if (!is_win) { -- ldflags += [ "-no-canonical-prefixes" ] -- } -- } - } - - config("clang_revision") { --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0003-agl-Only-bind-to-agl_shell-if-it-s-the-browser-proce.patch b/recipes-wam/cef/files/chromium/0003-agl-Only-bind-to-agl_shell-if-it-s-the-browser-proce.patch new file mode 100644 index 00000000..4de7779f --- /dev/null +++ b/recipes-wam/cef/files/chromium/0003-agl-Only-bind-to-agl_shell-if-it-s-the-browser-proce.patch @@ -0,0 +1,41 @@ +From ab07780e04f15b511967cd609b70fb97abcea96f Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Sat, 27 May 2023 15:55:17 +0200 +Subject: [PATCH 03/33] [agl] Only bind to agl_shell if it's the browser + process + +Signed-off-by: Roger Zanoni +--- + .../extensions/agl/host/wayland_extensions_agl_impl.cc | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc +index 87376cbb8a9d3..075b3010ea8a1 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc +@@ -20,6 +20,7 @@ + + #include "base/command_line.h" + #include "base/logging.h" ++#include "content/public/common/content_switches.h" + #include "ui/base/ui_base_switches.h" + #include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" + #include "ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h" +@@ -45,8 +46,12 @@ bool WaylandExtensionsAglImpl::Bind(wl_registry* registry, + uint32_t name, + const char* interface, + uint32_t version) { +- bool should_use_agl_shell = base::CommandLine::ForCurrentProcess()->HasSwitch( +- switches::kAglShellAppId); ++ bool has_agl_shell_switch = base::CommandLine::ForCurrentProcess()->HasSwitch( ++ switches::kAglShellAppId); ++ bool is_browser_process = !base::CommandLine::ForCurrentProcess()->HasSwitch( ++ switches::kProcessType); ++ bool should_use_agl_shell = has_agl_shell_switch && is_browser_process; ++ + bool can_bind = wl::CanBind(interface, version, kMinAglShellExtensionVersion, + kMaxAglShellExtensionVersion); + bool is_agl_shell_interface = (strcmp(interface, "agl_shell") == 0); +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0004-Don-t-use-DRI-for-renesas.patch b/recipes-wam/cef/files/chromium/0004-Don-t-use-DRI-for-renesas.patch deleted file mode 100644 index 332e1f2d..00000000 --- a/recipes-wam/cef/files/chromium/0004-Don-t-use-DRI-for-renesas.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 60b8b1379f2eb154a3c58c00dabbf0f9f0bd5445 Mon Sep 17 00:00:00 2001 -From: Roger Zanoni -Date: Thu, 4 May 2023 10:42:06 +0200 -Subject: [PATCH 4/9] Don't use DRI for renesas - -This adds the use_dri flag that defauls to true and -can be disabled if we are building CEF using ozone + wayland - -Signed-off-by: Roger Zanoni ---- - content/gpu/BUILD.gn | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn -index 9f5f303b2f220..f7639030ac30c 100644 ---- a/content/gpu/BUILD.gn -+++ b/content/gpu/BUILD.gn -@@ -8,6 +8,10 @@ import("//build/config/ui.gni") - import("//gpu/vulkan/features.gni") - import("//media/media_options.gni") - -+declare_args() { -+ use_dri = true -+} -+ - # See //content/BUILD.gn for how this works. - group("gpu") { - visibility = [ "//content/*" ] # This is an internal content API. -@@ -137,8 +141,8 @@ target(link_target_type, "gpu_sources") { - } - - # Use DRI on desktop Linux builds. -- if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux && -- !is_castos) { -+ if (use_dri && current_cpu != "s390x" && current_cpu != "ppc64" && -+ is_linux && !is_castos) { - configs += [ "//build/config/linux/dri" ] - } - } --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0004-agl-Add-a-method-to-check-if-the-agl-window-is-confi.patch b/recipes-wam/cef/files/chromium/0004-agl-Add-a-method-to-check-if-the-agl-window-is-confi.patch new file mode 100644 index 00000000..398023ca --- /dev/null +++ b/recipes-wam/cef/files/chromium/0004-agl-Add-a-method-to-check-if-the-agl-window-is-confi.patch @@ -0,0 +1,69 @@ +From 76cb42f0773ecff97710d7d5ea20cd16b8781d51 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Fri, 30 Jun 2023 10:25:10 +0200 +Subject: [PATCH 04/33] [agl] Add a method to check if the agl window is + configured + +This will be used on cef side to know the time when the window can be +displayed. + +Signed-off-by: Roger Zanoni +--- + ui/aura/agl/window_tree_host_agl.h | 1 + + ui/aura/agl/window_tree_host_platform_agl.cc | 4 ++++ + ui/aura/agl/window_tree_host_platform_agl.h | 1 + + ui/platform_window/agl/platform_window_agl.h | 1 + + 4 files changed, 7 insertions(+) + +diff --git a/ui/aura/agl/window_tree_host_agl.h b/ui/aura/agl/window_tree_host_agl.h +index 858a078d939d0..b9aa451c8332e 100644 +--- a/ui/aura/agl/window_tree_host_agl.h ++++ b/ui/aura/agl/window_tree_host_agl.h +@@ -35,6 +35,7 @@ class AURA_EXPORT WindowTreeHostAgl { + virtual void SetAglReady() {} + virtual void SetAglBackground() {} + virtual void SetAglPanel(uint32_t edge) {} ++ virtual bool IsSurfaceConfigured() const { return false; } + }; + + } // namespace aura +diff --git a/ui/aura/agl/window_tree_host_platform_agl.cc b/ui/aura/agl/window_tree_host_platform_agl.cc +index e34595fe0ed9c..67190e1da6973 100644 +--- a/ui/aura/agl/window_tree_host_platform_agl.cc ++++ b/ui/aura/agl/window_tree_host_platform_agl.cc +@@ -47,4 +47,8 @@ void WindowTreeHostPlatformAgl::SetAglPanel(uint32_t edge) { + window_tree_host_platform_->platform_window()->SetAglPanel(edge); + } + ++bool WindowTreeHostPlatformAgl::IsSurfaceConfigured() const { ++ return window_tree_host_platform_->platform_window()->IsSurfaceConfigured(); ++} ++ + } // namespace aura +diff --git a/ui/aura/agl/window_tree_host_platform_agl.h b/ui/aura/agl/window_tree_host_platform_agl.h +index 181eefae346f7..e5a29fa1bfca3 100644 +--- a/ui/aura/agl/window_tree_host_platform_agl.h ++++ b/ui/aura/agl/window_tree_host_platform_agl.h +@@ -41,6 +41,7 @@ class AURA_EXPORT WindowTreeHostPlatformAgl : public aura::WindowTreeHost { + void SetAglReady() override; + void SetAglBackground() override; + void SetAglPanel(uint32_t edge) override; ++ bool IsSurfaceConfigured() const override; + + private: + aura::WindowTreeHostPlatform* window_tree_host_platform_; +diff --git a/ui/platform_window/agl/platform_window_agl.h b/ui/platform_window/agl/platform_window_agl.h +index 4bc915d663e72..cab1f42272772 100644 +--- a/ui/platform_window/agl/platform_window_agl.h ++++ b/ui/platform_window/agl/platform_window_agl.h +@@ -29,6 +29,7 @@ class PlatformWindowAgl { + virtual void SetAglReady() {} + virtual void SetAglBackground() {} + virtual void SetAglPanel(uint32_t edge) {} ++ virtual bool IsSurfaceConfigured() { return false; } + }; + + } // namespace ui +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0005-Add-the-essential-parts-of-wayland-extensions-and-ag.patch b/recipes-wam/cef/files/chromium/0005-Add-the-essential-parts-of-wayland-extensions-and-ag.patch deleted file mode 100644 index fea8c04a..00000000 --- a/recipes-wam/cef/files/chromium/0005-Add-the-essential-parts-of-wayland-extensions-and-ag.patch +++ /dev/null @@ -1,912 +0,0 @@ -From 7e927a21ecaa70c14873d5f06667dfc3bdaa4d25 Mon Sep 17 00:00:00 2001 -From: Roger Zanoni -Date: Mon, 15 May 2023 20:32:06 +0200 -Subject: [PATCH 5/9] Add the essential parts of wayland extensions and - agl_shell - ---- - ui/base/ui_base_switches.cc | 2 + - ui/base/ui_base_switches.h | 3 + - ui/ozone/platform/wayland/BUILD.gn | 7 + - .../platform/wayland/extensions/agl/BUILD.gn | 40 ++++ - .../agl/common/wayland_object_agl.cc | 26 +++ - .../agl/common/wayland_object_agl.h | 34 ++++ - .../extensions/agl/host/agl_shell_wrapper.cc | 113 +++++++++++ - .../extensions/agl/host/agl_shell_wrapper.h | 62 ++++++ - .../agl/host/wayland_extensions_agl.h | 37 ++++ - .../agl/host/wayland_extensions_agl_impl.cc | 93 +++++++++ - .../agl/host/wayland_extensions_agl_impl.h | 54 ++++++ - .../extensions/agl/protocol/agl-shell.xml | 179 ++++++++++++++++++ - .../wayland/host/wayland_connection.cc | 12 +- - .../wayland/host/wayland_connection.h | 6 + - .../wayland/host/wayland_extensions.h | 56 ++++++ - 15 files changed, 722 insertions(+), 2 deletions(-) - create mode 100644 ui/ozone/platform/wayland/extensions/agl/BUILD.gn - create mode 100644 ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.cc - create mode 100644 ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h - create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc - create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h - create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h - create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc - create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h - create mode 100644 ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml - create mode 100644 ui/ozone/platform/wayland/host/wayland_extensions.h - -diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc -index f8556679a79d8..e72ae83737c04 100644 ---- a/ui/base/ui_base_switches.cc -+++ b/ui/base/ui_base_switches.cc -@@ -100,4 +100,6 @@ const char kUIDisablePartialSwap[] = "ui-disable-partial-swap"; - // Enables the ozone x11 clipboard for linux-chromeos. - const char kUseSystemClipboard[] = "use-system-clipboard"; - -+const char kAglShellAppId[] = "agl-shell-appid"; -+ - } // namespace switches -diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h -index d35e544f2bc2f..019ba0e5151e5 100644 ---- a/ui/base/ui_base_switches.h -+++ b/ui/base/ui_base_switches.h -@@ -45,6 +45,9 @@ COMPONENT_EXPORT(UI_BASE) extern const char kTopChromeTouchUiEnabled[]; - COMPONENT_EXPORT(UI_BASE) extern const char kUIDisablePartialSwap[]; - COMPONENT_EXPORT(UI_BASE) extern const char kUseSystemClipboard[]; - -+// Agl related -+COMPONENT_EXPORT(UI_BASE) extern const char kAglShellAppId[]; -+ - // Test related. - COMPONENT_EXPORT(UI_BASE) extern const char kDisallowNonExactResourceReuse[]; - COMPONENT_EXPORT(UI_BASE) extern const char kMangleLocalizedStrings[]; -diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn -index e0f0d7dea3747..1a2f889dc8947 100644 ---- a/ui/ozone/platform/wayland/BUILD.gn -+++ b/ui/ozone/platform/wayland/BUILD.gn -@@ -407,6 +407,13 @@ source_set("wayland") { - ] - } - -+ sources += [ -+ "host/wayland_extensions.h", -+ "host/wayland_extensions_stub.cc", -+ ] -+ -+ deps += [ "extensions/agl" ] -+ - configs += [ "//third_party/khronos:khronos_headers" ] - } - -diff --git a/ui/ozone/platform/wayland/extensions/agl/BUILD.gn b/ui/ozone/platform/wayland/extensions/agl/BUILD.gn -new file mode 100644 -index 0000000000000..ce289bc5dbbca ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/BUILD.gn -@@ -0,0 +1,40 @@ -+# Copyright 2021 LG Electronics, Inc. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+# SPDX-License-Identifier: Apache-2.0 -+ -+import("//third_party/wayland/wayland_protocol.gni") -+ -+visibility = [ "//ui/ozone/*" ] -+ -+wayland_protocol("agl_shell_protocol") { -+ sources = [ "protocol/agl-shell.xml" ] -+} -+ -+source_set("agl") { -+ sources = [ -+ "common/wayland_object_agl.cc", -+ "common/wayland_object_agl.h", -+ "host/agl_shell_wrapper.cc", -+ "host/agl_shell_wrapper.h", -+ "host/wayland_extensions_agl.h", -+ "host/wayland_extensions_agl_impl.cc", -+ "host/wayland_extensions_agl_impl.h", -+ ] -+ -+ deps = [ -+ ":agl_shell_protocol", -+ "//ui/ozone/platform/wayland/mojom", -+ ] -+} -diff --git a/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.cc b/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.cc -new file mode 100644 -index 0000000000000..9f3300766df2c ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.cc -@@ -0,0 +1,26 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#include "ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h" -+ -+#include -+ -+namespace wl { -+ -+const wl_interface* ObjectTraits::interface = &agl_shell_interface; -+void (*ObjectTraits::deleter)(agl_shell*) = &agl_shell_destroy; -+ -+} // namespace wl -\ No newline at end of file -diff --git a/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h b/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h -new file mode 100644 -index 0000000000000..e91ac0da8d2fc ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h -@@ -0,0 +1,34 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_COMMON_WAYLAND_OBJECT_AGL_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_COMMON_WAYLAND_OBJECT_AGL_H_ -+ -+#include "ui/ozone/platform/wayland/common/wayland_object.h" -+ -+struct agl_shell; -+ -+namespace wl { -+ -+template <> -+struct ObjectTraits { -+ static const wl_interface* interface; -+ static void (*deleter)(agl_shell*); -+}; -+ -+} // namespace wl -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_COMMON_WAYLAND_OBJECT_AGL_H_ -\ No newline at end of file -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc -new file mode 100644 -index 0000000000000..c74fa5d9cd221 ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc -@@ -0,0 +1,113 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" -+ -+#include "agl_shell_wrapper.h" -+#include "base/logging.h" -+#include "ui/base/ui_base_switches.h" -+#include "ui/ozone/platform/wayland/host/wayland_connection.h" -+#include "ui/ozone/platform/wayland/host/wayland_output_manager.h" -+#include "ui/ozone/platform/wayland/host/wayland_window.h" -+ -+namespace ui { -+ -+static const struct agl_shell_listener shell_listener = { -+ &AglShellWrapper::AglShellBoundOk, -+ &AglShellWrapper::AglShellBoundFail, -+#ifdef AGL_SHELL_APP_STATE_SINCE_VERSION -+ &AglShellWrapper::AglAppState, -+#endif -+}; -+ -+AglShellWrapper::AglShellWrapper(agl_shell* agl_shell, -+ WaylandConnection* wayland_connection) -+ : agl_shell_(agl_shell), connection_(wayland_connection) { -+ if (wl::get_version_of_object(agl_shell) >= AGL_SHELL_BOUND_OK_SINCE_VERSION) -+ agl_shell_add_listener(agl_shell, &shell_listener, this); -+} -+ -+AglShellWrapper::~AglShellWrapper() = default; -+ -+void AglShellWrapper::SetAglActivateApp(const std::string& app_id) { -+ wl_output* output = -+ connection_->wayland_output_manager()->GetPrimaryOutput()->get_output(); -+ agl_shell_activate_app(agl_shell_.get(), app_id.c_str(), output); -+} -+ -+void AglShellWrapper::SetAglPanel(WaylandWindow* window, uint32_t edge) { -+ wl_surface* surface = window->root_surface()->surface(); -+ wl_output* output = -+ connection_->wayland_output_manager()->GetPrimaryOutput()->get_output(); -+ -+ agl_shell_set_panel(agl_shell_.get(), surface, output, edge); -+} -+ -+void AglShellWrapper::SetAglBackground(WaylandWindow* window) { -+ wl_surface* surface = window->root_surface()->surface(); -+ wl_output* output = -+ connection_->wayland_output_manager()->GetPrimaryOutput()->get_output(); -+ -+ agl_shell_set_background(agl_shell_.get(), surface, output); -+} -+ -+void AglShellWrapper::SetAglReady() { -+ agl_shell_ready(agl_shell_.get()); -+} -+ -+// static -+void AglShellWrapper::AglShellBoundOk(void* data, struct agl_shell*) { -+ AglShellWrapper* wrapper = static_cast(data); -+ wrapper->wait_for_bound_ = false; -+ wrapper->bound_ok_ = true; -+ LOG(INFO) << "Bound to agl_shell (bound_ok)"; -+} -+ -+// static -+void AglShellWrapper::AglShellBoundFail(void* data, struct agl_shell*) { -+ AglShellWrapper* wrapper = static_cast(data); -+ wrapper->wait_for_bound_ = false; -+ wrapper->bound_ok_ = false; -+ LOG(INFO) << "Failed to bind to agl_shell (bound_fail)"; -+} -+ -+#ifdef AGL_SHELL_APP_STATE_SINCE_VERSION -+// static -+void AglShellWrapper::AglAppState(void* data, -+ struct agl_shell*, -+ const char* app_id, -+ uint32_t state) { -+ AglShellWrapper* wrapper = static_cast(data); -+ -+ LOG(INFO) << "State for app " << app_id << " changed to " << state; -+ -+ if (state == AGL_SHELL_APP_STATE_STARTED) { -+ wrapper->SetAglActivateApp(app_id); -+ LOG(INFO) << "Activating app " << app_id; -+ } -+} -+#endif -+ -+bool AglShellWrapper::WaitUntilBoundOk() { -+ int ret = 0; -+ while (ret != -1 && wait_for_bound_) { -+ ret = wl_display_dispatch(connection_->display()); -+ } -+ -+ return bound_ok_; -+} -+ -+} // namespace ui -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h -new file mode 100644 -index 0000000000000..2ab765883057e ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h -@@ -0,0 +1,62 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_AGL_SHELL_WRAPPER_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_AGL_SHELL_WRAPPER_H_ -+ -+#include -+ -+#include -+ -+#include "ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h" -+ -+namespace ui { -+ -+class WaylandConnection; -+class WaylandWindow; -+ -+class AglShellWrapper { -+ public: -+ AglShellWrapper(agl_shell* agl_shell, WaylandConnection* wayland_connection); -+ AglShellWrapper(const AglShellWrapper&) = delete; -+ AglShellWrapper& operator=(const AglShellWrapper&) = delete; -+ ~AglShellWrapper(); -+ -+ void SetAglActivateApp(const std::string& app_id); -+ void SetAglPanel(WaylandWindow* window, uint32_t edge); -+ void SetAglBackground(WaylandWindow* window); -+ void SetAglReady(); -+ bool WaitUntilBoundOk(); -+ -+ static void AglShellBoundOk(void* data, struct agl_shell*); -+ static void AglShellBoundFail(void* data, struct agl_shell*); -+#ifdef AGL_SHELL_APP_STATE_SINCE_VERSION -+ static void AglAppState(void* data, -+ struct agl_shell*, -+ const char* app_id, -+ uint32_t state); -+#endif -+ -+ private: -+ wl::Object agl_shell_; -+ WaylandConnection* connection_; -+ bool wait_for_bound_ = true; -+ bool bound_ok_ = false; -+}; -+ -+} // namespace ui -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_AGL_SHELL_WRAPPER_H_ -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h -new file mode 100644 -index 0000000000000..df42fc00c84da ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h -@@ -0,0 +1,37 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ -+ -+namespace ui { -+ -+class AglShellWrapper; -+ -+// AGL extensions implementation for webOS/Lite -+class WaylandExtensionsAgl { -+ public: -+ WaylandExtensionsAgl() = default; -+ WaylandExtensionsAgl(const WaylandExtensionsAgl&) = delete; -+ WaylandExtensionsAgl& operator=(const WaylandExtensionsAgl&) = delete; -+ virtual ~WaylandExtensionsAgl() = default; -+ -+ virtual AglShellWrapper* GetAglShell() = 0; -+}; -+ -+} // namespace ui -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ -\ No newline at end of file -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -new file mode 100644 -index 0000000000000..26a5f0550c302 ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -@@ -0,0 +1,93 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h" -+ -+#include -+ -+#include "base/command_line.h" -+#include "base/logging.h" -+#include "ui/base/ui_base_switches.h" -+#include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" -+#include "ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h" -+#include "ui/ozone/platform/wayland/host/wayland_connection.h" -+ -+namespace ui { -+ -+namespace { -+ -+constexpr uint32_t kMinAglShellExtensionVersion = 1; -+constexpr uint32_t kMaxAglShellExtensionVersion = 3; -+ -+} // namespace -+ -+WaylandExtensionsAglImpl::WaylandExtensionsAglImpl( -+ WaylandConnection* connection) -+ : connection_(connection) {} -+ -+WaylandExtensionsAglImpl::~WaylandExtensionsAglImpl() = default; -+ -+bool WaylandExtensionsAglImpl::Bind(wl_registry* registry, -+ uint32_t name, -+ const char* interface, -+ uint32_t version) { -+ bool should_use_agl_shell = base::CommandLine::ForCurrentProcess()->HasSwitch( -+ switches::kAglShellAppId); -+ bool can_bind = wl::CanBind(interface, version, kMinAglShellExtensionVersion, -+ kMaxAglShellExtensionVersion); -+ bool is_agl_shell_interface = (strcmp(interface, "agl_shell") == 0); -+ -+ if (!is_agl_shell_interface) { -+ return false; -+ } -+ -+ LOG(INFO) << "should_use_agl_shell: " << should_use_agl_shell << -+ " can_bind: " << can_bind; -+ -+ if (should_use_agl_shell && !agl_shell_ && -+ is_agl_shell_interface && can_bind) { -+ wl::Object aglshell = wl::Bind( -+ registry, name, std::min(version, kMaxAglShellExtensionVersion)); -+ if (!aglshell) { -+ LOG(ERROR) << "Failed to bind to agl_shell global"; -+ return false; -+ } -+ agl_shell_ = -+ std::make_unique(aglshell.release(), connection_); -+ -+ LOG(INFO) << "Waiting until bound..."; -+ return agl_shell_->WaitUntilBoundOk(); -+ } else { -+ LOG(INFO) << "Cant bind."; -+ } -+ -+ return false; -+} -+ -+bool WaylandExtensionsAglImpl::HasShellObject() const { -+ return !!agl_shell_; -+} -+ -+AglShellWrapper* WaylandExtensionsAglImpl::GetAglShell() { -+ return agl_shell_.get(); -+} -+ -+std::unique_ptr CreateWaylandExtensions( -+ WaylandConnection* connection) { -+ return std::make_unique(connection); -+} -+ -+} // namespace ui -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h -new file mode 100644 -index 0000000000000..f6cbabe99ed0b ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h -@@ -0,0 +1,54 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ -+ -+#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h" -+#include "ui/ozone/platform/wayland/host/wayland_extensions.h" -+ -+namespace ui { -+ -+class AglShellWrapper; -+ -+// AGL extension implementation for webOS/Lite -+class WaylandExtensionsAglImpl : public WaylandExtensions, -+ public WaylandExtensionsAgl { -+ public: -+ explicit WaylandExtensionsAglImpl(WaylandConnection* connection); -+ WaylandExtensionsAglImpl(const WaylandExtensionsAglImpl&) = delete; -+ WaylandExtensionsAglImpl& operator=(const WaylandExtensionsAglImpl&) = delete; -+ ~WaylandExtensionsAglImpl() override; -+ -+ // WaylandExtensions overrides -+ bool Bind(wl_registry* registry, -+ uint32_t name, -+ const char* interface, -+ uint32_t version) override; -+ -+ bool HasShellObject() const override; -+ -+ // WaylandExtensionsAgl overrides -+ AglShellWrapper* GetAglShell() override; -+ -+ private: -+ std::unique_ptr agl_shell_; -+ WaylandConnection* connection_; -+}; -+ -+} // namespace ui -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ -diff --git a/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml b/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml -new file mode 100644 -index 0000000000000..ad5553d61f189 ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml -@@ -0,0 +1,179 @@ -+ -+ -+ -+ Copyright © 2019, 2022 Collabora, Ltd. -+ -+ Permission is hereby granted, free of charge, to any person obtaining a -+ copy of this software and associated documentation files (the "Software"), -+ to deal in the Software without restriction, including without limitation -+ the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ and/or sell copies of the Software, and to permit persons to whom the -+ Software is furnished to do so, subject to the following conditions: -+ -+ The above copyright notice and this permission notice (including the next -+ paragraph) shall be included in all copies or substantial portions of the -+ Software. -+ -+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ DEALINGS IN THE SOFTWARE. -+ -+ -+ -+ Starting with version 2 of the protocol, the client is required to wait -+ for the 'bound_ok' or 'bound_fail' events in order to proceed further. -+ -+ In case the client gets a 'bound_fail' event then it should consider that -+ there's another client already bound to the agl_shell protocol. -+ A client that receives a 'bound_ok' event should consider that there's -+ no other client already bound to the interface and can proceed further. -+ -+ If the client uses an older version of the protocol it will receive -+ automatically an error and the compositor will terminate the connection, -+ if there's another client already bound the interface. -+ -+ If the client receives the 'bound_fail' event and attempts to use the -+ interface further it will receive an error and the compositor will -+ terminate the connection. After the 'bound_fail' event was received the -+ client should call the destructor, which has been added with version 2 -+ of the protocol. The client is free to try at a later point in time to -+ see if it will receive the 'bound_ok' event, but there's no explicit way -+ of finding out when that event will be delivered. -+ It is assumed that it can infer that information through other -+ means/other channels. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Tell the server that this client is ready to be shown. The server -+ will delay presentation during start-up until all shell clients are -+ ready to be shown, and will display a black screen instead. -+ This gives the client an opportunity to set up and configure several -+ surfaces into a coherent interface. -+ -+ The client that binds to this interface must send this request, otherwise -+ they may stall the compositor unnecessarily. -+ -+ If this request is called after the compositor has already finished -+ start-up, no operation is performed. -+ -+ -+ -+ -+ -+ Set the surface to act as the background of an output. After this -+ request, the server will immediately send a configure event with -+ the dimensions the client should use to cover the entire output. -+ -+ The surface must have a "desktop" surface role, as supported by -+ libweston-desktop. -+ -+ Only a single surface may be the background for any output. If a -+ background surface already exists, a protocol error is raised. -+ -+ -+ -+ -+ -+ -+ -+ Set the surface to act as a panel of an output. The 'edge' argument -+ says what edge of the output the surface will be anchored to. -+ After this request, the server will send a configure event with the -+ corresponding width/height that the client should use, and 0 for the -+ other dimension. E.g. if the edge is 'top', the width will be the -+ output's width, and the height will be 0. -+ -+ The surface must have a "desktop" surface role, as supported by -+ libweston-desktop. -+ -+ The compositor will take the panel's window geometry into account when -+ positioning other windows, so the panels are not covered. -+ -+ XXX: What happens if e.g. both top and left are used at the same time? -+ Who gets to have the corner? -+ -+ Only a single surface may be the panel for an output's edge. If a -+ surface already exists on an edge, a protocol error is raised. -+ -+ -+ -+ -+ -+ -+ -+ -+ Ask the compositor to make a toplevel to become the current/focused -+ window for window management purposes. -+ -+ See xdg_toplevel.set_app_id from the xdg-shell protocol for a -+ description of app_id. -+ -+ If multiple toplevels have the same app_id, the result is unspecified. -+ -+ XXX: Do we need feedback to say it didn't work? (e.g. client does -+ not exist) -+ -+ -+ -+ -+ -+ -+ -+ Informs the client that it was able to bind the agl_shell -+ interface succesfully. Clients are required to wait for this -+ event before continuing further. -+ -+ -+ -+ -+ -+ Informs the client that binding to the agl_shell interface was -+ unsuccesfull. Clients are required to wait for this event for -+ continuing further. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Informs the client that an application has changed its state to another, -+ specified by the app_state enum. Client can use this event to track -+ current application state. For instance to know when the application has -+ started, or when terminated/stopped. -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc -index 6d44128e56458..93427c52e1284 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.cc -+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc -@@ -64,6 +64,8 @@ - #include "ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.h" - #include "ui/platform_window/common/platform_window_defaults.h" - -+#include "ui/ozone/platform/wayland/host/wayland_extensions.h" -+ - #if defined(USE_LIBWAYLAND_STUBS) - #include - -@@ -238,6 +240,10 @@ bool WaylandConnection::Initialize() { - return false; - } - -+ if (!extensions_) { -+ extensions_ = CreateWaylandExtensions(this); -+ } -+ - // Now that the connection with the display server has been properly - // estabilished, initialize the event source and input objects. - DCHECK(!event_source_); -@@ -264,7 +270,7 @@ bool WaylandConnection::Initialize() { - LOG(ERROR) << "No wl_shm object"; - return false; - } -- if (!shell_v6_ && !shell_) { -+ if (!shell_v6_ && !shell_ && !(extensions_ && extensions_->HasShellObject())) { - LOG(ERROR) << "No Wayland shell found"; - return false; - } -@@ -434,7 +440,9 @@ void WaylandConnection::Global(void* data, - auto* connection = static_cast(data); - - auto factory_it = connection->global_object_factories_.find(interface); -- if (factory_it != connection->global_object_factories_.end()) { -+ if (connection->extensions_->Bind(registry, name, interface, version)) { -+ DVLOG(1) << "Successfully bound to " << interface; -+ } else if (factory_it != connection->global_object_factories_.end()) { - (*factory_it->second)(connection, registry, name, interface, version); - } else if (!connection->compositor_ && - strcmp(interface, "wl_compositor") == 0) { -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h -index d33959ad4066f..dfd1d060c73f2 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.h -+++ b/ui/ozone/platform/wayland/host/wayland_connection.h -@@ -45,6 +45,7 @@ class WaylandBufferManagerHost; - class WaylandCursor; - class WaylandCursorBufferListener; - class WaylandEventSource; -+class WaylandExtensions; - class WaylandOutputManager; - class WaylandSeat; - class WaylandZAuraShell; -@@ -185,6 +186,8 @@ class WaylandConnection { - - WaylandZAuraShell* zaura_shell() const { return zaura_shell_.get(); } - -+ WaylandExtensions* extensions() { return extensions_.get(); } -+ - WaylandZcrColorManager* zcr_color_manager() const { - return zcr_color_manager_.get(); - } -@@ -424,6 +427,9 @@ class WaylandConnection { - std::unique_ptr overlay_prioritizer_; - std::unique_ptr surface_augmenter_; - -+ std::unique_ptr extensions_; -+ -+ - // Clipboard-related objects. |clipboard_| must be declared after all - // DeviceManager instances it depends on, otherwise tests may crash with - // UAFs while attempting to access already destroyed manager pointers. -diff --git a/ui/ozone/platform/wayland/host/wayland_extensions.h b/ui/ozone/platform/wayland/host/wayland_extensions.h -new file mode 100644 -index 0000000000000..3bd2fd7a211ae ---- /dev/null -+++ b/ui/ozone/platform/wayland/host/wayland_extensions.h -@@ -0,0 +1,56 @@ -+// Copyright 2019 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_EXTENSIONS_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_EXTENSIONS_H_ -+ -+#include -+ -+#include "ui/ozone/platform/wayland/common/wayland_object.h" -+ -+namespace ui { -+ -+class ShellToplevelWrapper; -+class ShellPopupWrapper; -+class WaylandConnection; -+ -+// Wayland extensions abstract interface to support extending of the Wayland -+// protocol. Inherit it to provide your own Wayland extensions implementation. -+class WaylandExtensions { -+ public: -+ WaylandExtensions() = default; -+ WaylandExtensions(const WaylandExtensions&) = delete; -+ WaylandExtensions& operator=(const WaylandExtensions&) = delete; -+ virtual ~WaylandExtensions() = default; -+ -+ // Binds to the extensions interface(s). Can encapsulate binding of several -+ // interfaces, defined by |interface|. -+ virtual bool Bind(wl_registry* registry, -+ uint32_t name, -+ const char* interface, -+ uint32_t version) = 0; -+ -+ // Checks whether the extensions have bound shell object(s). -+ virtual bool HasShellObject() const = 0; -+}; -+ -+// Creates Wayland extensions. -+std::unique_ptr CreateWaylandExtensions( -+ WaylandConnection* connection); -+ -+} // namespace ui -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_EXTENSIONS_H_ --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0005-agl-Start-using-agl-shell-version-4.patch b/recipes-wam/cef/files/chromium/0005-agl-Start-using-agl-shell-version-4.patch new file mode 100644 index 00000000..8b5a3812 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0005-agl-Start-using-agl-shell-version-4.patch @@ -0,0 +1,348 @@ +From 98de96755da14f4cabf2447ce88a01cd3cdca770 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Sun, 2 Jul 2023 11:11:07 +0200 +Subject: [PATCH 05/33] [agl] Start using agl-shell version 4 + +Signed-off-by: Roger Zanoni +--- + ui/aura/agl/window_tree_host_agl.h | 1 + + ui/aura/agl/window_tree_host_platform_agl.cc | 4 + + ui/aura/agl/window_tree_host_platform_agl.h | 1 + + .../extensions/agl/host/agl_shell_wrapper.cc | 9 + + .../extensions/agl/host/agl_shell_wrapper.h | 1 + + .../agl/host/wayland_extensions_agl_impl.cc | 2 +- + .../extensions/agl/host/wayland_window_agl.cc | 10 + + .../extensions/agl/host/wayland_window_agl.h | 1 + + .../extensions/agl/protocol/agl-shell.xml | 185 +++++++++++++++++- + ui/platform_window/agl/platform_window_agl.h | 1 + + 10 files changed, 213 insertions(+), 2 deletions(-) + +diff --git a/ui/aura/agl/window_tree_host_agl.h b/ui/aura/agl/window_tree_host_agl.h +index b9aa451c8332e..c5213f75e623e 100644 +--- a/ui/aura/agl/window_tree_host_agl.h ++++ b/ui/aura/agl/window_tree_host_agl.h +@@ -36,6 +36,7 @@ class AURA_EXPORT WindowTreeHostAgl { + virtual void SetAglBackground() {} + virtual void SetAglPanel(uint32_t edge) {} + virtual bool IsSurfaceConfigured() const { return false; } ++ virtual void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) {} + }; + + } // namespace aura +diff --git a/ui/aura/agl/window_tree_host_platform_agl.cc b/ui/aura/agl/window_tree_host_platform_agl.cc +index 67190e1da6973..b9bae3f3b9bdc 100644 +--- a/ui/aura/agl/window_tree_host_platform_agl.cc ++++ b/ui/aura/agl/window_tree_host_platform_agl.cc +@@ -51,4 +51,8 @@ bool WindowTreeHostPlatformAgl::IsSurfaceConfigured() const { + return window_tree_host_platform_->platform_window()->IsSurfaceConfigured(); + } + ++void WindowTreeHostPlatformAgl::SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { ++ window_tree_host_platform_->platform_window()->SetupActivationArea(x, y, width, height); ++} ++ + } // namespace aura +diff --git a/ui/aura/agl/window_tree_host_platform_agl.h b/ui/aura/agl/window_tree_host_platform_agl.h +index e5a29fa1bfca3..30e160736e327 100644 +--- a/ui/aura/agl/window_tree_host_platform_agl.h ++++ b/ui/aura/agl/window_tree_host_platform_agl.h +@@ -42,6 +42,7 @@ class AURA_EXPORT WindowTreeHostPlatformAgl : public aura::WindowTreeHost { + void SetAglBackground() override; + void SetAglPanel(uint32_t edge) override; + bool IsSurfaceConfigured() const override; ++ void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) override; + + private: + aura::WindowTreeHostPlatform* window_tree_host_platform_; +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc +index c74fa5d9cd221..0d5d79c4738df 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc ++++ b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc +@@ -110,4 +110,13 @@ bool AglShellWrapper::WaitUntilBoundOk() { + return bound_ok_; + } + ++void AglShellWrapper::SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { ++#ifdef AGL_SHELL_SET_ACTIVATE_REGION_SINCE_VERSION ++ wl_output* output = ++ connection_->wayland_output_manager()->GetPrimaryOutput()->get_output(); ++ agl_shell_set_activate_region(agl_shell_.get(), output, x, y, ++ width, height); ++#endif ++} ++ + } // namespace ui +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h +index 2ab765883057e..1c2074e1b4306 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h ++++ b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h +@@ -39,6 +39,7 @@ class AglShellWrapper { + void SetAglPanel(WaylandWindow* window, uint32_t edge); + void SetAglBackground(WaylandWindow* window); + void SetAglReady(); ++ void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height); + bool WaitUntilBoundOk(); + + static void AglShellBoundOk(void* data, struct agl_shell*); +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc +index 075b3010ea8a1..8f9d938cdd1f6 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc +@@ -32,7 +32,7 @@ namespace ui { + namespace { + + constexpr uint32_t kMinAglShellExtensionVersion = 1; +-constexpr uint32_t kMaxAglShellExtensionVersion = 3; ++constexpr uint32_t kMaxAglShellExtensionVersion = 4; + + } // namespace + +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc +index 97b21ae537658..f92406d455de1 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc +@@ -83,4 +83,14 @@ void WaylandWindowAgl::SetAglPanel(uint32_t edge) { + connection()->ScheduleFlush(); + } + ++void WaylandWindowAgl::SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { ++ if (!agl_extensions_->GetAglShell()) { ++ LOG(ERROR) << "Agl shell wrapper is not created"; ++ return; ++ } ++ ++ agl_extensions_->GetAglShell()->SetupActivationArea(x, y, width, height); ++ connection()->ScheduleFlush(); ++} ++ + } // namespace ui +diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h +index b2a922604c001..d21d2d9387215 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h ++++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h +@@ -39,6 +39,7 @@ class WaylandWindowAgl : public WaylandToplevelWindow { + void SetAglReady() override; + void SetAglBackground() override; + void SetAglPanel(uint32_t edge) override; ++ void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) override; + + private: + WaylandExtensionsAgl* agl_extensions_; +diff --git a/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml b/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml +index ad5553d61f189..e010a80808c69 100644 +--- a/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml ++++ b/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml +@@ -22,7 +22,7 @@ + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + +- ++ + + Starting with version 2 of the protocol, the client is required to wait + for the 'bound_ok' or 'bound_fail' events in order to proceed further. +@@ -174,6 +174,189 @@ + + + ++ ++ ++ A hint for the compositor to use a custom area, rather than ++ inferring the activation area. If any panels are used ++ the compositor computes the activation area by subtracting the ++ panels geometry area. If no panels are used then the entire output ++ is being used. This request changes that as to hint the compositor ++ to use the supplied rectangle and ignore any potential panels ++ that might been set-up previously. + ++ In order for this request to take effect it will need to happen ++ before the 'ready' request in order for the compositor to make use of it. ++ Note that any 'set_panel' request be will not be honored, if this request ++ has been called. ++ ++ The x and y coordinates use the top-left corner as the origin. The ++ rectangle area shouldn't exceed the output area, while an area smaller ++ than the output, would basically result in showing up the background ++ surface. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Ask the compositor to hide the toplevel window for window ++ management purposes. Depending on the window role, this request ++ will either display the previously active window (or the background ++ in case there's no previously active surface) or temporarily (or ++ until a 'activate_app' is called upon) hide the surface. ++ ++ All the surfaces are identifiable by using the app_id, and no actions ++ are taken in case the app_id is not/was not present. ++ ++ See xdg_toplevel.set_app_id from the xdg-shell protocol for a ++ description of app_id. ++ ++ ++ ++ ++ ++ ++ Makes the application identified by app_id as floating. If the ++ application's window is already mapped, in a maximized, normal state, ++ it would transition to the float state. ++ ++ For applications that want to modify their own state, this request ++ must be done before the initial surface commit in order to take effect. ++ ++ If the application is already in floating state, this request wouldn't ++ do anything. ++ ++ There's no persistence of this request, once the application terminated ++ you'll to issue this request again for that particular app_id. ++ ++ The x, and y values would be initial position of the window where the ++ window surface will be placed. ++ ++ See xdg_toplevel.set_app_id from the xdg-shell protocol for a ++ description of app_id. ++ ++ ++ ++ ++ ++ ++ ++ ++ Returns the application identified by app_id as it was in the normal state. ++ This is useful to come back from other states to the maximized state, the ++ normal state applications are started. ++ ++ ++ ++ ++ ++ ++ Makes the application identified by app_id as fullscreen. If the ++ application's window is already mapped, in a maximized, normal state, ++ it would transition to the fullscreen state. ++ ++ For applications that want to modify their own state, this request ++ must be done before the initial surface commit in order to take effect. ++ ++ If the application is already in fullscreen state, this request wouldn't ++ do anything. ++ ++ There's no persistence of this request, once the application terminated ++ you'll to issue this request again for that particular app_id. ++ ++ See xdg_toplevel.set_app_id from the xdg-shell protocol for a ++ description of app_id. ++ ++ ++ ++ ++ ++ ++ This would allow the compositor to place an application on a particular ++ output, if that output is indeed available. This can happen before ++ application is started which would make the application start on that ++ particular output. If the application is already started it would ++ move the application to that output. ++ ++ There's no persistence of this request, once the application terminated ++ you'll need to issue this request again for that particular app_id. ++ ++ See xdg_toplevel.set_app_id from the xdg-shell protocol for a ++ description of app_id. ++ ++ ++ ++ ++ ++ ++ ++ Clients can use this event to be notified when an application ++ wants to be displayed on a certain output. This event is sent in ++ response to the set_app_output request. ++ ++ See xdg_toplevel.set_app_id from the xdg-shell protocol for a ++ description of app_id. ++ ++ ++ ++ ++ ++ ++ ++ ++ This interface allows another client bind to the agl_shell interface, ++ while there's another shell client already present. ++ ++ The client should first bind to this interface and then inform the ++ compositor with the 'doas_shell_client' request and it wants to bind to ++ the agl_shell interface. The client is still expected, if using a new ++ version of the agl_shell interface, to wait for the 'bound_ok' and ++ 'bound_fail' events before issueing any other requests/events. ++ ++ Note that this interface has its limitations, and the compositor would ++ still refuse the act for 'set_panel' or 'set_background' requests ++ of the agl_shell interface if there's already a client that used them. ++ ++ Any other requests or events should be delievered and handled as it would ++ a client bound to the agl_shell interface. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Call the destructor once you're ready with agl_shell_ext interface. ++ This would reset the state and would make any requests made ++ on the agl_shell interface be terminated. The client would need ++ to bind again the agl_shell_ext and issue a 'doas_shell_client' ++ request. ++ ++ ++ ++ ++ ++ Prior to binding to agl_shell interface, this request would inform ++ the compositor that it wants to gain access the agl_shell interface. ++ The client is expected to wait for 'doas_shell_client_done' event and ++ check for a successful status before going further with binding to ++ the agl_shell interface. ++ ++ ++ ++ ++ ++ The client should check the status event to verify that the ++ compositor was able to handle the request. ++ ++ ++ + + +diff --git a/ui/platform_window/agl/platform_window_agl.h b/ui/platform_window/agl/platform_window_agl.h +index cab1f42272772..b1a6150fff950 100644 +--- a/ui/platform_window/agl/platform_window_agl.h ++++ b/ui/platform_window/agl/platform_window_agl.h +@@ -30,6 +30,7 @@ class PlatformWindowAgl { + virtual void SetAglBackground() {} + virtual void SetAglPanel(uint32_t edge) {} + virtual bool IsSurfaceConfigured() { return false; } ++ virtual void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) {} + }; + + } // namespace ui +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0006-Add-webos-agl-waylandwindow-window-tree-host-essenti.patch b/recipes-wam/cef/files/chromium/0006-Add-webos-agl-waylandwindow-window-tree-host-essenti.patch deleted file mode 100644 index 5ea8b83e..00000000 --- a/recipes-wam/cef/files/chromium/0006-Add-webos-agl-waylandwindow-window-tree-host-essenti.patch +++ /dev/null @@ -1,1379 +0,0 @@ -From a99977eb329ca0e114ad13ce31acc6ed38bb6a7b Mon Sep 17 00:00:00 2001 -From: Roger Zanoni -Date: Wed, 17 May 2023 21:25:53 +0200 -Subject: [PATCH 6/9] Add webos/agl waylandwindow/window tree host essential - parts - ---- - ui/aura/BUILD.gn | 7 ++ - ui/aura/agl/window_tree_host_agl.h | 42 +++++++++ - ui/aura/agl/window_tree_host_platform_agl.cc | 50 +++++++++++ - ui/aura/agl/window_tree_host_platform_agl.h | 51 +++++++++++ - ui/aura/window_tree_host.h | 5 +- - ui/aura/window_tree_host_platform.cc | 4 +- - ui/aura/window_tree_host_platform.h | 4 +- - ui/ozone/platform/wayland/BUILD.gn | 1 - - .../platform/wayland/extensions/agl/BUILD.gn | 2 + - .../agl/host/wayland_extensions_agl.h | 10 ++- - .../agl/host/wayland_extensions_agl_impl.cc | 11 ++- - .../agl/host/wayland_extensions_agl_impl.h | 9 ++ - .../extensions/agl/host/wayland_window_agl.cc | 86 +++++++++++++++++++ - .../extensions/agl/host/wayland_window_agl.h | 49 +++++++++++ - .../wayland/gpu/gl_surface_wayland.cc | 10 ++- - .../host/gtk_primary_selection_device.cc | 2 +- - .../gtk_primary_selection_device_manager.cc | 4 +- - .../wayland/host/proxy/wayland_proxy_impl.cc | 2 +- - .../wayland/host/wayland_connection.cc | 23 ++++- - .../wayland/host/wayland_connection.h | 9 +- - .../platform/wayland/host/wayland_cursor.cc | 4 +- - .../wayland/host/wayland_data_device.cc | 10 +-- - .../wayland/host/wayland_data_device_base.cc | 2 +- - .../host/wayland_data_drag_controller.cc | 2 +- - .../wayland/host/wayland_data_source.cc | 6 +- - ui/ozone/platform/wayland/host/wayland_drm.cc | 6 +- - .../wayland/host/wayland_extensions.h | 6 ++ - .../platform/wayland/host/wayland_keyboard.cc | 4 +- - .../platform/wayland/host/wayland_popup.cc | 4 +- - ui/ozone/platform/wayland/host/wayland_shm.cc | 2 +- - .../platform/wayland/host/wayland_surface.cc | 2 +- - .../wayland/host/wayland_toplevel_window.cc | 14 +-- - .../platform/wayland/host/wayland_window.cc | 14 +-- - .../platform/wayland/host/wayland_window.h | 2 + - .../host/wayland_window_drag_controller.cc | 2 +- - .../wayland/host/wayland_window_factory.cc | 15 ++++ - .../wayland/host/wayland_zwp_linux_dmabuf.cc | 4 +- - .../wayland/host/xdg_foreign_wrapper.cc | 4 +- - .../wayland/host/xdg_popup_wrapper_impl.cc | 2 +- - .../wayland/host/xdg_surface_wrapper_impl.cc | 2 +- - .../host/zwp_primary_selection_device.cc | 2 +- - .../zwp_primary_selection_device_manager.cc | 4 +- - .../host/zxdg_surface_v6_wrapper_impl.cc | 2 +- - ui/platform_window/agl/platform_window_agl.h | 36 ++++++++ - ui/platform_window/platform_window.h | 4 +- - 45 files changed, 471 insertions(+), 65 deletions(-) - create mode 100644 ui/aura/agl/window_tree_host_agl.h - create mode 100644 ui/aura/agl/window_tree_host_platform_agl.cc - create mode 100644 ui/aura/agl/window_tree_host_platform_agl.h - create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc - create mode 100644 ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h - create mode 100644 ui/platform_window/agl/platform_window_agl.h - -diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn -index 1beb9003b2fad..f3d3e359a9704 100644 ---- a/ui/aura/BUILD.gn -+++ b/ui/aura/BUILD.gn -@@ -99,6 +99,13 @@ component("aura") { - "window_tree_host_platform.cc", - ] - -+ public += [ -+ "agl/window_tree_host_agl.h", -+ "agl/window_tree_host_platform_agl.h" -+ ] -+ -+ sources += [ "agl/window_tree_host_platform_agl.cc" ] -+ - friend = [ ":*" ] - - defines = [ "AURA_IMPLEMENTATION" ] -diff --git a/ui/aura/agl/window_tree_host_agl.h b/ui/aura/agl/window_tree_host_agl.h -new file mode 100644 -index 0000000000000..858a078d939d0 ---- /dev/null -+++ b/ui/aura/agl/window_tree_host_agl.h -@@ -0,0 +1,42 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#ifndef UI_AURA_AGL_WINDOW_TREE_HOST_AGL_H_ -+#define UI_AURA_AGL_WINDOW_TREE_HOST_AGL_H_ -+ -+#include -+ -+#include "ui/aura/aura_export.h" -+ -+namespace aura { -+ -+class AURA_EXPORT WindowTreeHostAgl { -+ public: -+ WindowTreeHostAgl() = default; -+ WindowTreeHostAgl(const WindowTreeHostAgl&) = delete; -+ WindowTreeHostAgl& operator=(const WindowTreeHostAgl&) = delete; -+ ~WindowTreeHostAgl() = default; -+ -+ virtual void SetAglActivateApp(const std::string& app) {} -+ virtual void SetAglAppId(const std::string& title) {} -+ virtual void SetAglReady() {} -+ virtual void SetAglBackground() {} -+ virtual void SetAglPanel(uint32_t edge) {} -+}; -+ -+} // namespace aura -+ -+#endif // UI_AURA_AGL_WINDOW_TREE_HOST_AGL_H_ -diff --git a/ui/aura/agl/window_tree_host_platform_agl.cc b/ui/aura/agl/window_tree_host_platform_agl.cc -new file mode 100644 -index 0000000000000..e34595fe0ed9c ---- /dev/null -+++ b/ui/aura/agl/window_tree_host_platform_agl.cc -@@ -0,0 +1,50 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#include "ui/aura/agl/window_tree_host_platform_agl.h" -+ -+#include "ui/aura/window_tree_host_platform.h" -+#include "ui/platform_window/platform_window.h" -+ -+namespace aura { -+ -+WindowTreeHostPlatformAgl::WindowTreeHostPlatformAgl( -+ std::unique_ptr window, -+ aura::WindowTreeHostPlatform* window_tree_host_platform) -+ : aura::WindowTreeHost(std::move(window)), -+ window_tree_host_platform_(window_tree_host_platform) {} -+ -+void WindowTreeHostPlatformAgl::SetAglActivateApp(const std::string& app) { -+ window_tree_host_platform_->platform_window()->SetAglActivateApp(app); -+} -+ -+void WindowTreeHostPlatformAgl::SetAglAppId(const std::string& title) { -+ window_tree_host_platform_->platform_window()->SetAglAppId(title); -+} -+ -+void WindowTreeHostPlatformAgl::SetAglReady() { -+ window_tree_host_platform_->platform_window()->SetAglReady(); -+} -+ -+void WindowTreeHostPlatformAgl::SetAglBackground() { -+ window_tree_host_platform_->platform_window()->SetAglBackground(); -+} -+ -+void WindowTreeHostPlatformAgl::SetAglPanel(uint32_t edge) { -+ window_tree_host_platform_->platform_window()->SetAglPanel(edge); -+} -+ -+} // namespace aura -diff --git a/ui/aura/agl/window_tree_host_platform_agl.h b/ui/aura/agl/window_tree_host_platform_agl.h -new file mode 100644 -index 0000000000000..181eefae346f7 ---- /dev/null -+++ b/ui/aura/agl/window_tree_host_platform_agl.h -@@ -0,0 +1,51 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#ifndef UI_AURA_AGL_WINDOW_TREE_HOST_PLATFORM_AGL_H_ -+#define UI_AURA_AGL_WINDOW_TREE_HOST_PLATFORM_AGL_H_ -+ -+#include -+ -+#include "ui/aura/aura_export.h" -+#include "ui/aura/window_tree_host.h" -+ -+namespace aura { -+ -+class Window; -+class WindowTreeHostPlatform; -+ -+class AURA_EXPORT WindowTreeHostPlatformAgl : public aura::WindowTreeHost { -+ public: -+ explicit WindowTreeHostPlatformAgl( -+ std::unique_ptr window, -+ aura::WindowTreeHostPlatform* window_tree_host_platform); -+ WindowTreeHostPlatformAgl(const WindowTreeHostPlatformAgl&) = delete; -+ WindowTreeHostPlatformAgl& operator=(const WindowTreeHostPlatformAgl&) = delete; -+ ~WindowTreeHostPlatformAgl() override = default; -+ -+ void SetAglActivateApp(const std::string& app) override; -+ void SetAglAppId(const std::string& title) override; -+ void SetAglReady() override; -+ void SetAglBackground() override; -+ void SetAglPanel(uint32_t edge) override; -+ -+ private: -+ aura::WindowTreeHostPlatform* window_tree_host_platform_; -+}; -+ -+} // namespace aura -+ -+#endif // UI_AURA_AGL_WINDOW_TREE_HOST_PLATFORM_AGL_H_ -diff --git a/ui/aura/window_tree_host.h b/ui/aura/window_tree_host.h -index 0bdb86be66ba3..b7696e6373284 100644 ---- a/ui/aura/window_tree_host.h -+++ b/ui/aura/window_tree_host.h -@@ -30,6 +30,8 @@ - #include "ui/gfx/native_widget_types.h" - #include "ui/gfx/overlay_transform.h" - -+#include "ui/aura/agl/window_tree_host_agl.h" -+ - namespace gfx { - class Point; - class Rect; -@@ -66,7 +68,8 @@ class WindowTreeHostObserver; - class AURA_EXPORT WindowTreeHost : public ui::ImeKeyEventDispatcher, - public ui::EventSource, - public display::DisplayObserver, -- public ui::CompositorObserver { -+ public ui::CompositorObserver, -+ public WindowTreeHostAgl { - public: - // VideoCaptureLock ensures state necessary for capturing video remains in - // effect. For example, this may force keeping the compositor visible when -diff --git a/ui/aura/window_tree_host_platform.cc b/ui/aura/window_tree_host_platform.cc -index 4c31e785d7692..cecd1f4fc03fd 100644 ---- a/ui/aura/window_tree_host_platform.cc -+++ b/ui/aura/window_tree_host_platform.cc -@@ -51,7 +51,7 @@ std::unique_ptr WindowTreeHost::Create( - WindowTreeHostPlatform::WindowTreeHostPlatform( - ui::PlatformWindowInitProperties properties, - std::unique_ptr window) -- : WindowTreeHost(std::move(window)) { -+ : WindowTreeHostPlatformAgl(std::move(window), this) { - size_in_pixels_ = properties.bounds.size(); - CreateCompositor(false, false, properties.enable_compositing_based_throttling, - properties.compositor_memory_limit_mb); -@@ -59,7 +59,7 @@ WindowTreeHostPlatform::WindowTreeHostPlatform( - } - - WindowTreeHostPlatform::WindowTreeHostPlatform(std::unique_ptr window) -- : WindowTreeHost(std::move(window)), -+ : WindowTreeHostPlatformAgl(std::move(window), this), - widget_(gfx::kNullAcceleratedWidget), - current_cursor_(ui::mojom::CursorType::kNull) {} - -diff --git a/ui/aura/window_tree_host_platform.h b/ui/aura/window_tree_host_platform.h -index 3a9232743bda3..6c1e3a424afd4 100644 ---- a/ui/aura/window_tree_host_platform.h -+++ b/ui/aura/window_tree_host_platform.h -@@ -15,6 +15,8 @@ - #include "ui/gfx/native_widget_types.h" - #include "ui/platform_window/platform_window_delegate.h" - -+#include "ui/aura/agl/window_tree_host_platform_agl.h" -+ - namespace ui { - enum class DomCode; - class PlatformWindow; -@@ -26,7 +28,7 @@ namespace aura { - - // The unified WindowTreeHost implementation for platforms - // that implement PlatformWindow. --class AURA_EXPORT WindowTreeHostPlatform : public WindowTreeHost, -+class AURA_EXPORT WindowTreeHostPlatform : public WindowTreeHostPlatformAgl, - public ui::PlatformWindowDelegate { - public: - explicit WindowTreeHostPlatform(ui::PlatformWindowInitProperties properties, -diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn -index 1a2f889dc8947..86ff8269af9e0 100644 ---- a/ui/ozone/platform/wayland/BUILD.gn -+++ b/ui/ozone/platform/wayland/BUILD.gn -@@ -409,7 +409,6 @@ source_set("wayland") { - - sources += [ - "host/wayland_extensions.h", -- "host/wayland_extensions_stub.cc", - ] - - deps += [ "extensions/agl" ] -diff --git a/ui/ozone/platform/wayland/extensions/agl/BUILD.gn b/ui/ozone/platform/wayland/extensions/agl/BUILD.gn -index ce289bc5dbbca..01c590e53df58 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/BUILD.gn -+++ b/ui/ozone/platform/wayland/extensions/agl/BUILD.gn -@@ -31,6 +31,8 @@ source_set("agl") { - "host/wayland_extensions_agl.h", - "host/wayland_extensions_agl_impl.cc", - "host/wayland_extensions_agl_impl.h", -+ "host/wayland_window_agl.cc", -+ "host/wayland_window_agl.h", - ] - - deps = [ -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h -index df42fc00c84da..295154dfb437d 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h -@@ -20,6 +20,9 @@ - namespace ui { - - class AglShellWrapper; -+class PlatformWindowDelegate; -+class WaylandConnection; -+class WaylandWindow; - - // AGL extensions implementation for webOS/Lite - class WaylandExtensionsAgl { -@@ -29,9 +32,14 @@ class WaylandExtensionsAgl { - WaylandExtensionsAgl& operator=(const WaylandExtensionsAgl&) = delete; - virtual ~WaylandExtensionsAgl() = default; - -+ virtual std::unique_ptr CreateWaylandWindow( -+ PlatformWindowDelegate* delegate, -+ WaylandConnection* connection) = 0; -+ -+ - virtual AglShellWrapper* GetAglShell() = 0; - }; - - } // namespace ui - --#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ -\ No newline at end of file -+#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_H_ -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -index 26a5f0550c302..87376cbb8a9d3 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -@@ -22,6 +22,7 @@ - #include "base/logging.h" - #include "ui/base/ui_base_switches.h" - #include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" -+#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h" - #include "ui/ozone/platform/wayland/extensions/agl/common/wayland_object_agl.h" - #include "ui/ozone/platform/wayland/host/wayland_connection.h" - -@@ -68,8 +69,8 @@ bool WaylandExtensionsAglImpl::Bind(wl_registry* registry, - agl_shell_ = - std::make_unique(aglshell.release(), connection_); - -- LOG(INFO) << "Waiting until bound..."; -- return agl_shell_->WaitUntilBoundOk(); -+ //LOG(INFO) << "Waiting until bound..."; -+ //return agl_shell_->WaitUntilBoundOk(); - } else { - LOG(INFO) << "Cant bind."; - } -@@ -85,6 +86,12 @@ AglShellWrapper* WaylandExtensionsAglImpl::GetAglShell() { - return agl_shell_.get(); - } - -+std::unique_ptr WaylandExtensionsAglImpl::CreateWaylandWindow( -+ PlatformWindowDelegate* delegate, -+ WaylandConnection* connection) { -+ return std::make_unique(delegate, connection, this); -+} -+ - std::unique_ptr CreateWaylandExtensions( - WaylandConnection* connection) { - return std::make_unique(connection); -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h -index f6cbabe99ed0b..3218589f1a09a 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.h -@@ -17,12 +17,17 @@ - #ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ - #define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_EXTENSIONS_AGL_IMPL_H_ - -+#include -+ - #include "ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h" - #include "ui/ozone/platform/wayland/host/wayland_extensions.h" - - namespace ui { - - class AglShellWrapper; -+class PlatformWindowDelegate; -+class WaylandConnection; -+class WaylandWindow; - - // AGL extension implementation for webOS/Lite - class WaylandExtensionsAglImpl : public WaylandExtensions, -@@ -44,6 +49,10 @@ class WaylandExtensionsAglImpl : public WaylandExtensions, - // WaylandExtensionsAgl overrides - AglShellWrapper* GetAglShell() override; - -+ std::unique_ptr CreateWaylandWindow( -+ PlatformWindowDelegate* delegate, -+ WaylandConnection* connection) override; -+ - private: - std::unique_ptr agl_shell_; - WaylandConnection* connection_; -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc -new file mode 100644 -index 0000000000000..97b21ae537658 ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc -@@ -0,0 +1,86 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h" -+ -+#include "base/logging.h" -+#include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" -+#include "ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl.h" -+#include "ui/ozone/platform/wayland/host/shell_surface_wrapper.h" -+#include "ui/ozone/platform/wayland/host/shell_toplevel_wrapper.h" -+#include "ui/ozone/platform/wayland/host/wayland_connection.h" -+ -+namespace ui { -+ -+WaylandWindowAgl::WaylandWindowAgl(PlatformWindowDelegate* delegate, -+ WaylandConnection* connection, -+ WaylandExtensionsAgl* agl_extensions) -+ : WaylandToplevelWindow(delegate, connection), -+ agl_extensions_(agl_extensions) {} -+ -+WaylandWindowAgl::~WaylandWindowAgl() = default; -+ -+void WaylandWindowAgl::SetAglActivateApp(const std::string& app) { -+ if (!agl_extensions_->GetAglShell()) { -+ LOG(ERROR) << "Agl shell wrapper is not created"; -+ return; -+ } -+ -+ agl_extensions_->GetAglShell()->SetAglActivateApp(app); -+ connection()->ScheduleFlush(); -+} -+ -+void WaylandWindowAgl::SetAglAppId(const std::string& title) { -+ if (!shell_toplevel()) { -+ LOG(ERROR) << "Shell toplevel is not created"; -+ return; -+ } -+ -+ shell_toplevel()->SetAppId(title); -+ connection()->ScheduleFlush(); -+} -+ -+void WaylandWindowAgl::SetAglReady() { -+ if (!agl_extensions_->GetAglShell()) { -+ LOG(ERROR) << "Agl shell wrapper is not created"; -+ return; -+ } -+ -+ agl_extensions_->GetAglShell()->SetAglReady(); -+ connection()->ScheduleFlush(); -+} -+ -+void WaylandWindowAgl::SetAglBackground() { -+ if (!agl_extensions_->GetAglShell()) { -+ LOG(ERROR) << "Agl shell wrapper is not created"; -+ return; -+ } -+ -+ agl_extensions_->GetAglShell()->SetAglBackground(this); -+ connection()->ScheduleFlush(); -+} -+ -+void WaylandWindowAgl::SetAglPanel(uint32_t edge) { -+ if (!agl_extensions_->GetAglShell()) { -+ LOG(ERROR) << "Agl shell wrapper is not created"; -+ return; -+ } -+ -+ agl_extensions_->GetAglShell()->SetAglPanel(this, edge); -+ connection()->ScheduleFlush(); -+} -+ -+} // namespace ui -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h -new file mode 100644 -index 0000000000000..b2a922604c001 ---- /dev/null -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h -@@ -0,0 +1,49 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+// -+ -+#ifndef UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_WINDOW_AGL_H_ -+#define UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_WINDOW_AGL_H_ -+ -+#include "ui/ozone/platform/wayland/host/wayland_toplevel_window.h" -+ -+namespace ui { -+ -+class WaylandExtensionsAgl; -+ -+class WaylandWindowAgl : public WaylandToplevelWindow { -+ public: -+ explicit WaylandWindowAgl(PlatformWindowDelegate* delegate, -+ WaylandConnection* connection, -+ WaylandExtensionsAgl* agl_extensions); -+ WaylandWindowAgl(const WaylandWindowAgl&) = delete; -+ WaylandWindowAgl& operator=(const WaylandWindowAgl&) = delete; -+ ~WaylandWindowAgl() override; -+ -+ // Overrides PlatformWindowAgl -+ void SetAglActivateApp(const std::string& app) override; -+ void SetAglAppId(const std::string& title) override; -+ void SetAglReady() override; -+ void SetAglBackground() override; -+ void SetAglPanel(uint32_t edge) override; -+ -+ private: -+ WaylandExtensionsAgl* agl_extensions_; -+}; -+ -+} // namespace ui -+ -+#endif // UI_OZONE_PLATFORM_WAYLAND_EXTENSIONS_AGL_HOST_WAYLAND_WINDOW_AGL_H_ -diff --git a/ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc b/ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc -index 1cef91bb39912..26ad374718005 100644 ---- a/ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc -+++ b/ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc -@@ -89,8 +89,14 @@ gfx::SwapResult GLSurfaceWayland::SwapBuffers(PresentationCallback callback, - return scoped_swap_buffers.result(); - } - window_->root_surface()->set_surface_buffer_scale(scale_factor_); -- return gl::NativeViewGLSurfaceEGL::SwapBuffers(std::move(callback), -- std::move(data)); -+ gfx::SwapResult result = gl::NativeViewGLSurfaceEGL::SwapBuffers(std::move(callback), -+ std::move(data)); -+ -+ if (window_) { -+ window_->OnSurfaceContentChanged(); -+ } -+ -+ return result; - } - - gfx::SwapResult GLSurfaceWayland::PostSubBuffer(int x, -diff --git a/ui/ozone/platform/wayland/host/gtk_primary_selection_device.cc b/ui/ozone/platform/wayland/host/gtk_primary_selection_device.cc -index 43445ea2442b4..94f0739599142 100644 ---- a/ui/ozone/platform/wayland/host/gtk_primary_selection_device.cc -+++ b/ui/ozone/platform/wayland/host/gtk_primary_selection_device.cc -@@ -31,7 +31,7 @@ void GtkPrimarySelectionDevice::SetSelectionSource( - auto* data_source = source ? source->data_source() : nullptr; - gtk_primary_selection_device_set_selection(data_device_.get(), data_source, - serial); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - // static -diff --git a/ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.cc b/ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.cc -index 2c39409808128..1e07ae6009776 100644 ---- a/ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.cc -+++ b/ui/ozone/platform/wayland/host/gtk_primary_selection_device_manager.cc -@@ -66,7 +66,7 @@ GtkPrimarySelectionDevice* GtkPrimarySelectionDeviceManager::GetDevice() { - connection_, - gtk_primary_selection_device_manager_get_device( - device_manager_.get(), connection_->seat()->wl_object())); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - DCHECK(device_); - return device_.get(); -@@ -77,7 +77,7 @@ GtkPrimarySelectionDeviceManager::CreateSource( - GtkPrimarySelectionSource::Delegate* delegate) { - auto* data_source = - gtk_primary_selection_device_manager_create_source(device_manager_.get()); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - return std::make_unique(data_source, connection_, - delegate); - } -diff --git a/ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.cc b/ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.cc -index dee90b1aaaf72..caad70e0ab1cb 100644 ---- a/ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.cc -+++ b/ui/ozone/platform/wayland/host/proxy/wayland_proxy_impl.cc -@@ -75,7 +75,7 @@ void WaylandProxyImpl::DestroyShmForWlBuffer(wl_buffer* buffer) { - } - - void WaylandProxyImpl::FlushForTesting() { -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - ui::PlatformWindowType WaylandProxyImpl::GetWindowType( -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc -index 93427c52e1284..e2d45a6f5dc67 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.cc -+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc -@@ -285,6 +285,20 @@ bool WaylandConnection::Initialize() { - return true; - } - -+void WaylandConnection::ScheduleFlush() { -+ // When we are in tests, the message loop is set later when the -+ // initialization of the OzonePlatform complete. Thus, just -+ // flush directly. This doesn't happen in normal run. -+ if (!base::CurrentUIThread::IsSet()) { -+ Flush(); -+ } else if (!scheduled_flush_) { -+ base::ThreadTaskRunnerHandle::Get()->PostTask( -+ FROM_HERE, -+ base::BindOnce(&WaylandConnection::Flush, base::Unretained(this))); -+ scheduled_flush_ = true; -+ } -+} -+ - void WaylandConnection::RoundTripQueue() { - if (roundtrip_closure_for_testing_) { - roundtrip_closure_for_testing_.Run(); -@@ -354,6 +368,7 @@ void WaylandConnection::RegisterGlobalObjectFactory( - - void WaylandConnection::Flush() { - wl_display_flush(display_.get()); -+ scheduled_flush_ = false; - } - - void WaylandConnection::UpdateInputDevices() { -@@ -441,7 +456,7 @@ void WaylandConnection::Global(void* data, - - auto factory_it = connection->global_object_factories_.find(interface); - if (connection->extensions_->Bind(registry, name, interface, version)) { -- DVLOG(1) << "Successfully bound to " << interface; -+ LOG(INFO) << "Successfully bound to " << interface; - } else if (factory_it != connection->global_object_factories_.end()) { - (*factory_it->second)(connection, registry, name, interface, version); - } else if (!connection->compositor_ && -@@ -609,7 +624,7 @@ void WaylandConnection::Global(void* data, - - connection->available_globals_.emplace_back(interface, version); - -- connection->Flush(); -+ connection->ScheduleFlush(); - } - - base::TimeTicks WaylandConnection::ConvertPresentationTime(uint32_t tv_sec_hi, -@@ -674,14 +689,14 @@ void WaylandConnection::PingV6(void* data, - uint32_t serial) { - WaylandConnection* connection = static_cast(data); - zxdg_shell_v6_pong(shell_v6, serial); -- connection->Flush(); -+ connection->ScheduleFlush(); - } - - // static - void WaylandConnection::Ping(void* data, xdg_wm_base* shell, uint32_t serial) { - WaylandConnection* connection = static_cast(data); - xdg_wm_base_pong(shell, serial); -- connection->Flush(); -+ connection->ScheduleFlush(); - } - - // static -diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h -index dfd1d060c73f2..d2d7a866d3af8 100644 ---- a/ui/ozone/platform/wayland/host/wayland_connection.h -+++ b/ui/ozone/platform/wayland/host/wayland_connection.h -@@ -94,8 +94,8 @@ class WaylandConnection { - - bool Initialize(); - -- // Immediately flushes the Wayland display. -- void Flush(); -+ // Schedules a flush of the Wayland connection. -+ void ScheduleFlush(); - - // Calls wl_display_roundtrip_queue. Might be required during initialization - // of some objects that should block until they are initialized. -@@ -340,6 +340,9 @@ class WaylandConnection { - friend class ZwpIdleInhibitManager; - friend class ZwpPrimarySelectionDeviceManager; - -+ // Immediately flushes the Wayland display. -+ void Flush(); -+ - void RegisterGlobalObjectFactory(const char* interface_name, - wl::GlobalObjectFactory factory); - -@@ -467,6 +470,8 @@ class WaylandConnection { - // sizes. - bool surface_submission_in_pixel_coordinates_ = false; - -+ bool scheduled_flush_ = false; -+ - wl::SerialTracker serial_tracker_; - - // Global Wayland interfaces available in the current session, with their -diff --git a/ui/ozone/platform/wayland/host/wayland_cursor.cc b/ui/ozone/platform/wayland/host/wayland_cursor.cc -index 891ca2e5e1f3c..48ac8b8925ddd 100644 ---- a/ui/ozone/platform/wayland/host/wayland_cursor.cc -+++ b/ui/ozone/platform/wayland/host/wayland_cursor.cc -@@ -109,7 +109,7 @@ void WaylandCursor::HideCursor() { - wl_surface_attach(pointer_surface_.get(), nullptr, 0, 0); - wl_surface_commit(pointer_surface_.get()); - -- connection_->Flush(); -+ connection_->ScheduleFlush(); - - if (listener_) - listener_->OnCursorBufferAttached(nullptr); -@@ -160,7 +160,7 @@ void WaylandCursor::AttachAndCommit(wl_buffer* buffer, - wl_surface_attach(pointer_surface_.get(), buffer, 0, 0); - wl_surface_commit(pointer_surface_.get()); - -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - } // namespace ui -diff --git a/ui/ozone/platform/wayland/host/wayland_data_device.cc b/ui/ozone/platform/wayland/host/wayland_data_device.cc -index a1d691b6315ac..ccc7bfb0305a8 100644 ---- a/ui/ozone/platform/wayland/host/wayland_data_device.cc -+++ b/ui/ozone/platform/wayland/host/wayland_data_device.cc -@@ -46,7 +46,7 @@ void WaylandDataDevice::StartDrag(const WaylandDataSource& data_source, - origin_window.root_surface()->surface(), - icon_surface, serial); - drag_delegate_->DrawIcon(); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - void WaylandDataDevice::ResetDragDelegate() { -@@ -78,7 +78,7 @@ void WaylandDataDevice::SetSelectionSource(WaylandDataSource* source, - uint32_t serial) { - auto* data_source = source ? source->data_source() : nullptr; - wl_data_device_set_selection(data_device_.get(), data_source, serial); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - void WaylandDataDevice::ReadDragDataFromFD(base::ScopedFD fd, -@@ -140,7 +140,7 @@ void WaylandDataDevice::OnEnter(void* data, - gfx::PointF(wl_fixed_to_double(x), wl_fixed_to_double(y)), window); - self->drag_delegate_->OnDragEnter(window, point, serial); - -- self->connection()->Flush(); -+ self->connection()->ScheduleFlush(); - } - - void WaylandDataDevice::OnMotion(void* data, -@@ -161,7 +161,7 @@ void WaylandDataDevice::OnDrop(void* data, wl_data_device* data_device) { - auto* self = static_cast(data); - if (self->drag_delegate_) { - self->drag_delegate_->OnDragDrop(); -- self->connection()->Flush(); -+ self->connection()->ScheduleFlush(); - } - - // There are buggy Exo versions, which send 'drop' event (even for -@@ -178,7 +178,7 @@ void WaylandDataDevice::OnLeave(void* data, wl_data_device* data_device) { - auto* self = static_cast(data); - if (self->drag_delegate_) { - self->drag_delegate_->OnDragLeave(); -- self->connection()->Flush(); -+ self->connection()->ScheduleFlush(); - } - self->ResetDragDelegateIfNeeded(); - } -diff --git a/ui/ozone/platform/wayland/host/wayland_data_device_base.cc b/ui/ozone/platform/wayland/host/wayland_data_device_base.cc -index 4287f72617708..d0c077c2e69ea 100644 ---- a/ui/ozone/platform/wayland/host/wayland_data_device_base.cc -+++ b/ui/ozone/platform/wayland/host/wayland_data_device_base.cc -@@ -72,7 +72,7 @@ void WaylandDataDeviceBase::RegisterDeferredReadCallback() { - - wl_callback_add_listener(deferred_read_callback_.get(), &kListener, this); - -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - void WaylandDataDeviceBase::RegisterDeferredReadClosure( -diff --git a/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc -index f2123ec8bac3f..11750a3f55da2 100644 ---- a/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc -+++ b/ui/ozone/platform/wayland/host/wayland_data_drag_controller.cc -@@ -217,7 +217,7 @@ void WaylandDataDragController::OnDragSurfaceFrame(void* data, - DCHECK(self); - self->DrawIconInternal(); - self->icon_frame_callback_.reset(); -- self->connection_->Flush(); -+ self->connection_->ScheduleFlush(); - } - - void WaylandDataDragController::DrawIconInternal() { -diff --git a/ui/ozone/platform/wayland/host/wayland_data_source.cc b/ui/ozone/platform/wayland/host/wayland_data_source.cc -index de1e110f73b11..e24f31b1a8f52 100644 ---- a/ui/ozone/platform/wayland/host/wayland_data_source.cc -+++ b/ui/ozone/platform/wayland/host/wayland_data_source.cc -@@ -119,7 +119,7 @@ void DataSource::Offer( - const std::vector& mime_types) { - for (auto& mime_type : mime_types) - wl_data_source_offer(data_source_.get(), mime_type.c_str()); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - template -@@ -154,7 +154,7 @@ void DataSource::Offer( - const std::vector& mime_types) { - for (const auto& mime_type : mime_types) - gtk_primary_selection_source_offer(data_source_.get(), mime_type.c_str()); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - template <> -@@ -173,7 +173,7 @@ void DataSource::Offer( - for (const auto& mime_type : mime_types) - zwp_primary_selection_source_v1_offer(data_source_.get(), - mime_type.c_str()); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - template class DataSource; -diff --git a/ui/ozone/platform/wayland/host/wayland_drm.cc b/ui/ozone/platform/wayland/host/wayland_drm.cc -index 7edc0da798b9b..280350d9286c0 100644 ---- a/ui/ozone/platform/wayland/host/wayland_drm.cc -+++ b/ui/ozone/platform/wayland/host/wayland_drm.cc -@@ -57,7 +57,7 @@ WaylandDrm::WaylandDrm(wl_drm* drm, WaylandConnection* connection) - &Capabilities, - }; - wl_drm_add_listener(wl_drm_.get(), &kDrmListener, this); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - - // A roundtrip after binding guarantees that the client has received all - // supported formats and capabilities of the device. -@@ -91,7 +91,7 @@ void WaylandDrm::CreateBuffer(const base::ScopedFD& fd, - wl::Object buffer(wl_drm_create_prime_buffer( - wl_drm_.get(), fd.get(), size.width(), size.height(), format, offset[0], - stride[0], offset[1], stride[1], offset[2], stride[2])); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - - std::move(callback).Run(std::move(buffer)); - } -@@ -145,7 +145,7 @@ void WaylandDrm::Authenticate(const char* drm_device_path) { - } - - wl_drm_authenticate(wl_drm_.get(), magic); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - - // Do the roundtrip to make sure the server processes this request and - // authenticates us. -diff --git a/ui/ozone/platform/wayland/host/wayland_extensions.h b/ui/ozone/platform/wayland/host/wayland_extensions.h -index 3bd2fd7a211ae..f6ed47507d217 100644 ---- a/ui/ozone/platform/wayland/host/wayland_extensions.h -+++ b/ui/ozone/platform/wayland/host/wayland_extensions.h -@@ -25,7 +25,9 @@ namespace ui { - - class ShellToplevelWrapper; - class ShellPopupWrapper; -+class PlatformWindowDelegate; - class WaylandConnection; -+class WaylandWindow; - - // Wayland extensions abstract interface to support extending of the Wayland - // protocol. Inherit it to provide your own Wayland extensions implementation. -@@ -45,6 +47,10 @@ class WaylandExtensions { - - // Checks whether the extensions have bound shell object(s). - virtual bool HasShellObject() const = 0; -+ -+ virtual std::unique_ptr CreateWaylandWindow( -+ PlatformWindowDelegate* delegate, -+ WaylandConnection* connection) = 0; - }; - - // Creates Wayland extensions. -diff --git a/ui/ozone/platform/wayland/host/wayland_keyboard.cc b/ui/ozone/platform/wayland/host/wayland_keyboard.cc -index c6e64f1e55da3..473a702bf8987 100644 ---- a/ui/ozone/platform/wayland/host/wayland_keyboard.cc -+++ b/ui/ozone/platform/wayland/host/wayland_keyboard.cc -@@ -54,7 +54,7 @@ class WaylandKeyboard::ZCRExtendedKeyboard { - - void AckKey(uint32_t serial, bool handled) { - zcr_extended_keyboard_v1_ack_key(obj_.get(), serial, handled); -- keyboard_->connection_->Flush(); -+ keyboard_->connection_->ScheduleFlush(); - } - - // Returns true if connected object will send zcr_extended_keyboard::peek_key. -@@ -247,7 +247,7 @@ void WaylandKeyboard::FlushInput(base::OnceClosure closure) { - // get spurious repeats. - sync_callback_.reset(wl_display_sync(connection_->display_wrapper())); - wl_callback_add_listener(sync_callback_.get(), &callback_listener_, this); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - void WaylandKeyboard::DispatchKey(unsigned int key, -diff --git a/ui/ozone/platform/wayland/host/wayland_popup.cc b/ui/ozone/platform/wayland/host/wayland_popup.cc -index 84e429457462e..cb13557093dc2 100644 ---- a/ui/ozone/platform/wayland/host/wayland_popup.cc -+++ b/ui/ozone/platform/wayland/host/wayland_popup.cc -@@ -124,7 +124,7 @@ void WaylandPopup::Show(bool inactive) { - return; - } - -- connection()->Flush(); -+ connection()->ScheduleFlush(); - WaylandWindow::Show(inactive); - } - -@@ -147,7 +147,7 @@ void WaylandPopup::Hide() { - decorated_via_aura_popup_ = false; - } - -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - bool WaylandPopup::IsVisible() const { -diff --git a/ui/ozone/platform/wayland/host/wayland_shm.cc b/ui/ozone/platform/wayland/host/wayland_shm.cc -index 80d27227b9ab3..2b6c4f31ca0d8 100644 ---- a/ui/ozone/platform/wayland/host/wayland_shm.cc -+++ b/ui/ozone/platform/wayland/host/wayland_shm.cc -@@ -62,7 +62,7 @@ wl::Object WaylandShm::CreateBuffer(const base::ScopedFD& fd, - with_alpha_channel ? WL_SHM_FORMAT_ARGB8888 : WL_SHM_FORMAT_XRGB8888; - wl::Object shm_buffer(wl_shm_pool_create_buffer( - pool.get(), 0, size.width(), size.height(), size.width() * 4, format)); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - return shm_buffer; - } - -diff --git a/ui/ozone/platform/wayland/host/wayland_surface.cc b/ui/ozone/platform/wayland/host/wayland_surface.cc -index cd178f9aaee00..ffe5062402b33 100644 ---- a/ui/ozone/platform/wayland/host/wayland_surface.cc -+++ b/ui/ozone/platform/wayland/host/wayland_surface.cc -@@ -267,7 +267,7 @@ void WaylandSurface::UpdateBufferDamageRegion(const gfx::Rect& damage_px) { - void WaylandSurface::Commit(bool flush) { - wl_surface_commit(surface_.get()); - if (flush) -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - void WaylandSurface::set_surface_buffer_scale(float scale) { -diff --git a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -index e39daa898c9a5..68aebd357fdc2 100644 ---- a/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -+++ b/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc -@@ -131,7 +131,7 @@ void WaylandToplevelWindow::DispatchHostWindowDragMovement( - else - shell_toplevel_->SurfaceResize(connection(), hittest); - -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - void WaylandToplevelWindow::Show(bool inactive) { -@@ -166,7 +166,7 @@ void WaylandToplevelWindow::Hide() { - aura_surface_.reset(); - } - shell_toplevel_.reset(); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - bool WaylandToplevelWindow::IsVisible() const { -@@ -183,7 +183,7 @@ void WaylandToplevelWindow::SetTitle(const std::u16string& title) { - - if (shell_toplevel_) { - shell_toplevel_->SetTitle(title); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - } - -@@ -262,13 +262,13 @@ void WaylandToplevelWindow::Activate() { - // but nothing more happens (until the user moves the mouse over a Lacros - // window in which case events will start and the activation will come - // through). -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - void WaylandToplevelWindow::Deactivate() { - if (shell_toplevel_ && shell_toplevel_->SupportsActivation()) { - shell_toplevel_->Deactivate(); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - } - -@@ -877,7 +877,7 @@ void WaylandToplevelWindow::TriggerStateChanges() { - - delegate()->OnWindowStateChanged(previous_state_, state_); - -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - void WaylandToplevelWindow::SetWindowState(PlatformWindowState state) { -@@ -908,7 +908,7 @@ void WaylandToplevelWindow::SetSizeConstraints() { - if (max_size_dip.has_value()) - shell_toplevel_->SetMaxSize(max_size_dip->width(), max_size_dip->height()); - -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - void WaylandToplevelWindow::SetOrResetRestoredBounds() { -diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc -index f8b8c36a745e5..e415efde8ccd8 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window.cc -+++ b/ui/ozone/platform/wayland/host/wayland_window.cc -@@ -430,7 +430,7 @@ void WaylandWindow::SetDecorationInsets(const gfx::Insets* insets_px) { - else - frame_insets_px_ = absl::nullopt; - UpdateDecorations(); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - void WaylandWindow::SetWindowIcons(const gfx::ImageSkia& window_icon, -@@ -522,6 +522,10 @@ void WaylandWindow::HandleSurfaceConfigure(uint32_t serial) { - << "Only shell surfaces must receive HandleSurfaceConfigure calls."; - } - -+void WaylandWindow::OnSurfaceContentChanged() { -+ connection_->ScheduleFlush(); -+} -+ - void WaylandWindow::HandleToplevelConfigure(int32_t widht, - int32_t height, - const WindowStates& window_states) { -@@ -551,7 +555,7 @@ void WaylandWindow::UpdateVisualSize(const gfx::Size& size_px) { - - if (apply_pending_state_on_update_visual_size_for_testing_) { - root_surface_->ApplyPendingState(); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - } - -@@ -661,7 +665,7 @@ bool WaylandWindow::Initialize(PlatformWindowInitProperties properties) { - std::vector region{gfx::Rect{size_px_}}; - root_surface_->set_opaque_region(®ion); - root_surface_->ApplyPendingState(); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - - return true; - } -@@ -957,7 +961,7 @@ void WaylandWindow::ProcessPendingBoundsDip(uint32_t serial) { - // window has been applied. - SetWindowGeometry(pending_bounds_dip_); - AckConfigure(serial); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } else if (!pending_configures_.empty() && - pending_bounds_dip_.size() == - pending_configures_.back().bounds_dip.size()) { -@@ -1051,7 +1055,7 @@ bool WaylandWindow::ProcessVisualSizeUpdate(const gfx::Size& size_px) { - auto serial = result->serial; - SetWindowGeometry(result->bounds_dip); - AckConfigure(serial); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - pending_configures_.erase(pending_configures_.begin(), ++result); - return true; - } -diff --git a/ui/ozone/platform/wayland/host/wayland_window.h b/ui/ozone/platform/wayland/host/wayland_window.h -index f0f75d4481cd2..dae1ddcd2933f 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window.h -+++ b/ui/ozone/platform/wayland/host/wayland_window.h -@@ -218,6 +218,8 @@ class WaylandWindow : public PlatformWindow, - // currently bound to. - virtual void HandleSurfaceConfigure(uint32_t serial); - -+ void OnSurfaceContentChanged(); -+ - struct WindowStates { - bool is_maximized = false; - bool is_fullscreen = false; -diff --git a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -index 6f45f47a71c25..a269ec9b368a4 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -+++ b/ui/ozone/platform/wayland/host/wayland_window_drag_controller.cc -@@ -84,7 +84,7 @@ class WaylandWindowDragController::ExtendedDragSource { - auto* surface = window ? window->root_surface()->surface() : nullptr; - zcr_extended_drag_source_v1_drag(source_.get(), surface, offset.x(), - offset.y()); -- connection_.Flush(); -+ connection_.ScheduleFlush(); - } - - private: -diff --git a/ui/ozone/platform/wayland/host/wayland_window_factory.cc b/ui/ozone/platform/wayland/host/wayland_window_factory.cc -index 4857125bb5f34..b2f73218681b9 100644 ---- a/ui/ozone/platform/wayland/host/wayland_window_factory.cc -+++ b/ui/ozone/platform/wayland/host/wayland_window_factory.cc -@@ -13,6 +13,8 @@ - #include "ui/ozone/platform/wayland/host/wayland_window.h" - #include "ui/platform_window/platform_window_init_properties.h" - -+#include "ui/ozone/platform/wayland/host/wayland_extensions.h" -+ - namespace ui { - - namespace { -@@ -41,6 +43,13 @@ std::unique_ptr WaylandWindow::Create( - // toplevel window instead. - if (auto* parent = - GetParentWindow(connection, properties.parent_widget)) { -+ -+ if (connection->extensions()) { -+ window = connection->extensions()->CreateWaylandWindow(delegate, -+ connection); -+ if (window) -+ break; -+ } - window = std::make_unique(delegate, connection, parent); - } else { - DLOG(WARNING) << "Failed to determine for menu/popup window."; -@@ -52,6 +61,12 @@ std::unique_ptr WaylandWindow::Create( - case PlatformWindowType::kDrag: - // TODO(msisov): Figure out what kind of surface we need to create for - // bubble and drag windows. -+ if (connection->extensions()) { -+ window = -+ connection->extensions()->CreateWaylandWindow(delegate, connection); -+ if (window) -+ break; -+ } - window = std::make_unique(delegate, connection); - break; - default: -diff --git a/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc b/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc -index 3db8cb5e5dba9..5d6293e016842 100644 ---- a/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc -+++ b/ui/ozone/platform/wayland/host/wayland_zwp_linux_dmabuf.cc -@@ -104,7 +104,7 @@ void WaylandZwpLinuxDmabuf::CreateBuffer(const base::ScopedFD& fd, - // created buffer and notify the client about it via the |callback|. - pending_params_.emplace(std::move(params), std::move(callback)); - } -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - bool WaylandZwpLinuxDmabuf::CanCreateBufferImmed() const { -@@ -150,7 +150,7 @@ void WaylandZwpLinuxDmabuf::NotifyRequestCreateBufferDone( - - pending_params_.erase(it); - -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - // static -diff --git a/ui/ozone/platform/wayland/host/xdg_foreign_wrapper.cc b/ui/ozone/platform/wayland/host/xdg_foreign_wrapper.cc -index 8b8591fabe015..9b3c6e5136d5d 100644 ---- a/ui/ozone/platform/wayland/host/xdg_foreign_wrapper.cc -+++ b/ui/ozone/platform/wayland/host/xdg_foreign_wrapper.cc -@@ -162,7 +162,7 @@ void XdgForeignWrapperImpl:: - zxdg_exported_v1_add_listener(exported_surface.exported.get(), - &kExportedListener, this); - exported_surfaces_.emplace_back(std::move(exported_surface)); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - template <> -@@ -176,7 +176,7 @@ void XdgForeignWrapperImpl:: - zxdg_exported_v2_add_listener(exported_surface.exported.get(), - &kExportedListener, this); - exported_surfaces_.emplace_back(std::move(exported_surface)); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - - // static -diff --git a/ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.cc b/ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.cc -index 23b7ad8fbf3cc..2e1f8fc129bf7 100644 ---- a/ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.cc -+++ b/ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.cc -@@ -230,7 +230,7 @@ bool XDGPopupWrapperImpl::SetBounds(const gfx::Rect& new_bounds) { - xdg_popup_reposition(xdg_popup_.get(), positioner.get(), - ++next_reposition_token_); - -- connection_->Flush(); -+ connection_->ScheduleFlush(); - return true; - } - -diff --git a/ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.cc b/ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.cc -index 048071b4b7b76..692f562e203f0 100644 ---- a/ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.cc -+++ b/ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.cc -@@ -40,7 +40,7 @@ bool XDGSurfaceWrapperImpl::Initialize() { - } - - xdg_surface_add_listener(xdg_surface_.get(), &xdg_surface_listener, this); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - return true; - } - -diff --git a/ui/ozone/platform/wayland/host/zwp_primary_selection_device.cc b/ui/ozone/platform/wayland/host/zwp_primary_selection_device.cc -index d02c76db80aa2..9e7e0a916d66d 100644 ---- a/ui/ozone/platform/wayland/host/zwp_primary_selection_device.cc -+++ b/ui/ozone/platform/wayland/host/zwp_primary_selection_device.cc -@@ -31,7 +31,7 @@ void ZwpPrimarySelectionDevice::SetSelectionSource( - auto* data_source = source ? source->data_source() : nullptr; - zwp_primary_selection_device_v1_set_selection(data_device_.get(), data_source, - serial); -- connection()->Flush(); -+ connection()->ScheduleFlush(); - } - - // static -diff --git a/ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.cc b/ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.cc -index 9d5d79635b66d..2ca82ce6031ba 100644 ---- a/ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.cc -+++ b/ui/ozone/platform/wayland/host/zwp_primary_selection_device_manager.cc -@@ -66,7 +66,7 @@ ZwpPrimarySelectionDevice* ZwpPrimarySelectionDeviceManager::GetDevice() { - connection_, - zwp_primary_selection_device_manager_v1_get_device( - device_manager_.get(), connection_->seat()->wl_object())); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - } - DCHECK(device_); - return device_.get(); -@@ -77,7 +77,7 @@ ZwpPrimarySelectionDeviceManager::CreateSource( - ZwpPrimarySelectionSource::Delegate* delegate) { - auto* data_source = zwp_primary_selection_device_manager_v1_create_source( - device_manager_.get()); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - return std::make_unique(data_source, connection_, - delegate); - } -diff --git a/ui/ozone/platform/wayland/host/zxdg_surface_v6_wrapper_impl.cc b/ui/ozone/platform/wayland/host/zxdg_surface_v6_wrapper_impl.cc -index e900f9d37e8ad..5c4c538800f65 100644 ---- a/ui/ozone/platform/wayland/host/zxdg_surface_v6_wrapper_impl.cc -+++ b/ui/ozone/platform/wayland/host/zxdg_surface_v6_wrapper_impl.cc -@@ -43,7 +43,7 @@ bool ZXDGSurfaceV6WrapperImpl::Initialize() { - - zxdg_surface_v6_add_listener(zxdg_surface_v6_.get(), - &zxdg_surface_v6_listener, this); -- connection_->Flush(); -+ connection_->ScheduleFlush(); - return true; - } - -diff --git a/ui/platform_window/agl/platform_window_agl.h b/ui/platform_window/agl/platform_window_agl.h -new file mode 100644 -index 0000000000000..4bc915d663e72 ---- /dev/null -+++ b/ui/platform_window/agl/platform_window_agl.h -@@ -0,0 +1,36 @@ -+// Copyright 2021 LG Electronics, Inc. -+// -+// Licensed under the Apache License, Version 2.0 (the "License"); -+// you may not use this file except in compliance with the License. -+// You may obtain a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, -+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+// See the License for the specific language governing permissions and -+// limitations under the License. -+// -+// SPDX-License-Identifier: Apache-2.0 -+ -+#ifndef UI_PLATFORM_WINDOW_AGL_PLATFORM_WINDOW_AGL_H_ -+#define UI_PLATFORM_WINDOW_AGL_PLATFORM_WINDOW_AGL_H_ -+ -+#include -+ -+namespace ui { -+ -+// AGL additions for platform window. -+class PlatformWindowAgl { -+ public: -+ virtual void SetAglActivateApp(const std::string& app) {} -+ virtual void SetAglAppId(const std::string& title) {} -+ virtual void SetAglReady() {} -+ virtual void SetAglBackground() {} -+ virtual void SetAglPanel(uint32_t edge) {} -+}; -+ -+} // namespace ui -+ -+#endif // UI_PLATFORM_WINDOW_AGL_PLATFORM_WINDOW_AGL_H_ -diff --git a/ui/platform_window/platform_window.h b/ui/platform_window/platform_window.h -index a7bd3ef17a728..80f67671b88cf 100644 ---- a/ui/platform_window/platform_window.h -+++ b/ui/platform_window/platform_window.h -@@ -9,6 +9,7 @@ - #include - #include - -+#include "agl/platform_window_agl.h" - #include "base/component_export.h" - #include "ui/base/class_property.h" - #include "ui/base/ui_base_types.h" -@@ -32,7 +33,8 @@ class PlatformCursor; - - // Generic PlatformWindow interface. - class COMPONENT_EXPORT(PLATFORM_WINDOW) PlatformWindow -- : public PropertyHandler { -+ : public PropertyHandler, -+ public PlatformWindowAgl { - public: - PlatformWindow(); - ~PlatformWindow() override; --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0006-agl-Don-t-use-DRI-for-renesas.patch b/recipes-wam/cef/files/chromium/0006-agl-Don-t-use-DRI-for-renesas.patch new file mode 100644 index 00000000..1914661e --- /dev/null +++ b/recipes-wam/cef/files/chromium/0006-agl-Don-t-use-DRI-for-renesas.patch @@ -0,0 +1,72 @@ +From e7b779035f0d7ff1ba5bf59ea2f314f364493928 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Thu, 4 May 2023 10:42:06 +0200 +Subject: [PATCH 06/33] [agl] Don't use DRI for renesas + +This adds the use_dri flag that defauls to true and +can be disabled if we are building CEF using ozone + wayland + +Upstream-Status: Inappropriate, specific to the renesas boards supported +by AGL. +Signed-off-by: Roger Zanoni +--- + content/gpu/BUILD.gn | 4 ++-- + media/gpu/sandbox/BUILD.gn | 5 +++-- + media/media_options.gni | 3 +++ + 3 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn +index 93559f6092c7a..cef8415be7ab1 100644 +--- a/content/gpu/BUILD.gn ++++ b/content/gpu/BUILD.gn +@@ -139,8 +139,8 @@ target(link_target_type, "gpu_sources") { + } + + # Use DRI on desktop Linux builds. +- if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux && +- !is_castos) { ++ if (use_dri && current_cpu != "s390x" && current_cpu != "ppc64" && ++ is_linux && !is_castos) { + configs += [ "//build/config/linux/dri" ] + } + } +diff --git a/media/gpu/sandbox/BUILD.gn b/media/gpu/sandbox/BUILD.gn +index cfcb7fa80ef89..6ba37d06b29c8 100644 +--- a/media/gpu/sandbox/BUILD.gn ++++ b/media/gpu/sandbox/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chromeos/ui_mode.gni") + import("//media/gpu/args.gni") ++import("//media/media_options.gni") + + source_set("sandbox") { + sources = [] +@@ -30,8 +31,8 @@ source_set("sandbox") { + if (use_v4l2_codec) { + deps += [ "//media/gpu/v4l2" ] + } +- if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux && +- !is_castos) { ++ if (use_dri && (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux && ++ !is_castos)) { + # For DRI_DRIVER_DIR. + configs += [ "//build/config/linux/dri" ] + } +diff --git a/media/media_options.gni b/media/media_options.gni +index 61d5046d0cb0e..4898c9034d448 100644 +--- a/media/media_options.gni ++++ b/media/media_options.gni +@@ -117,6 +117,9 @@ declare_args() { + # Enable inclusion of VVC/H.266 parser/demuxer, and also enable VVC/H.266 decoding + # with hardware acceleration provided by platform. Disabled by default for all builds. + enable_platform_vvc = false ++ ++ # used to disable dri on renesas boards ++ use_dri = true + } + + # Use another declare_args() to allow dependence on args defined above. +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0007-Only-bind-to-agl_shell-if-it-s-the-browser-process.patch b/recipes-wam/cef/files/chromium/0007-Only-bind-to-agl_shell-if-it-s-the-browser-process.patch deleted file mode 100644 index 8961b464..00000000 --- a/recipes-wam/cef/files/chromium/0007-Only-bind-to-agl_shell-if-it-s-the-browser-process.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 1b60d7d98be14175b5175ee6ba4c19da03d8188e Mon Sep 17 00:00:00 2001 -From: Roger Zanoni -Date: Sat, 27 May 2023 15:55:17 +0200 -Subject: [PATCH 7/9] Only bind to agl_shell if it's the browser process - ---- - .../extensions/agl/host/wayland_extensions_agl_impl.cc | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -index 87376cbb8a9d3..075b3010ea8a1 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -@@ -20,6 +20,7 @@ - - #include "base/command_line.h" - #include "base/logging.h" -+#include "content/public/common/content_switches.h" - #include "ui/base/ui_base_switches.h" - #include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h" - #include "ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h" -@@ -45,8 +46,12 @@ bool WaylandExtensionsAglImpl::Bind(wl_registry* registry, - uint32_t name, - const char* interface, - uint32_t version) { -- bool should_use_agl_shell = base::CommandLine::ForCurrentProcess()->HasSwitch( -- switches::kAglShellAppId); -+ bool has_agl_shell_switch = base::CommandLine::ForCurrentProcess()->HasSwitch( -+ switches::kAglShellAppId); -+ bool is_browser_process = !base::CommandLine::ForCurrentProcess()->HasSwitch( -+ switches::kProcessType); -+ bool should_use_agl_shell = has_agl_shell_switch && is_browser_process; -+ - bool can_bind = wl::CanBind(interface, version, kMinAglShellExtensionVersion, - kMaxAglShellExtensionVersion); - bool is_agl_shell_interface = (strcmp(interface, "agl_shell") == 0); --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0007-meta-browser-Remove-the-GN-settings-done-for-clang-t.patch b/recipes-wam/cef/files/chromium/0007-meta-browser-Remove-the-GN-settings-done-for-clang-t.patch new file mode 100644 index 00000000..75d37ab1 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0007-meta-browser-Remove-the-GN-settings-done-for-clang-t.patch @@ -0,0 +1,117 @@ +From 89705cfc3a4e677dd97db36c3dc9b0aa97515760 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Thu, 27 Apr 2023 16:16:28 +0200 +Subject: [PATCH 07/33] [meta-browser] Remove the GN settings done for clang + that conflict with OE + +clang cross compiler that is build with meta-clang has lot of these +settings built-in and specifying them here confuses the compiler + +--target option and -no-canonical-prefixes options result in clang + +finding the headers in target sysroot + +Upstream-Status: Inappropriate [OE-Specific] + +Signed-off-by: Khem Raj +Rebased-by: Maksim Sisov +Rebased-by: Randy MacLeod +Rebased-by: Roger Zanoni +--- + build/config/compiler/BUILD.gn | 38 ---------------------------------- + 1 file changed, 38 deletions(-) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 06812fb9c2188..db763b998c4fb 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -1112,11 +1112,6 @@ config("compiler_cpu_abi") { + ] + } + } else if (current_cpu == "arm") { +- if (is_clang && !is_android && !is_nacl && +- !(is_chromeos_lacros && is_chromeos_device)) { +- cflags += [ "--target=arm-linux-gnueabihf" ] +- ldflags += [ "--target=arm-linux-gnueabihf" ] +- } + if (!is_nacl) { + cflags += [ + "-march=$arm_arch", +@@ -1126,12 +1121,6 @@ config("compiler_cpu_abi") { + if (arm_tune != "") { + cflags += [ "-mtune=$arm_tune" ] + } +- } else if (current_cpu == "arm64") { +- if (is_clang && !is_android && !is_nacl && !is_fuchsia && +- !(is_chromeos_lacros && is_chromeos_device)) { +- cflags += [ "--target=aarch64-linux-gnu" ] +- ldflags += [ "--target=aarch64-linux-gnu" ] +- } + } else if (current_cpu == "mipsel" && !is_nacl) { + ldflags += [ "-Wl,--hash-style=sysv" ] + if (custom_toolchain == "") { +@@ -1139,9 +1128,6 @@ config("compiler_cpu_abi") { + if (is_android) { + cflags += [ "--target=mipsel-linux-android" ] + ldflags += [ "--target=mipsel-linux-android" ] +- } else { +- cflags += [ "--target=mipsel-linux-gnu" ] +- ldflags += [ "--target=mipsel-linux-gnu" ] + } + } else { + cflags += [ "-EL" ] +@@ -1221,8 +1207,6 @@ config("compiler_cpu_abi") { + ldflags += [ "-Wl,--hash-style=sysv" ] + if (custom_toolchain == "") { + if (is_clang) { +- cflags += [ "--target=mips-linux-gnu" ] +- ldflags += [ "--target=mips-linux-gnu" ] + } else { + cflags += [ "-EB" ] + ldflags += [ "-EB" ] +@@ -1270,9 +1254,6 @@ config("compiler_cpu_abi") { + if (is_android) { + cflags += [ "--target=mips64el-linux-android" ] + ldflags += [ "--target=mips64el-linux-android" ] +- } else { +- cflags += [ "--target=mips64el-linux-gnuabi64" ] +- ldflags += [ "--target=mips64el-linux-gnuabi64" ] + } + } else { + cflags += [ +@@ -1330,8 +1311,6 @@ config("compiler_cpu_abi") { + ldflags += [ "-Wl,--hash-style=sysv" ] + if (custom_toolchain == "") { + if (is_clang) { +- cflags += [ "--target=mips64-linux-gnuabi64" ] +- ldflags += [ "--target=mips64-linux-gnuabi64" ] + } else { + cflags += [ + "-EB", +@@ -1494,23 +1473,6 @@ config("compiler_deterministic") { + } + } + } +- +- # Tells the compiler not to use absolute paths when passing the default +- # paths to the tools it invokes. We don't want this because we don't +- # really need it and it can mess up the goma cache entries. +- if (is_clang && (!is_nacl || is_nacl_saigo)) { +- cflags += [ "-no-canonical-prefixes" ] +- +- # Same for links: Let the compiler driver invoke the linker +- # with a relative path and pass relative paths to built-in +- # libraries. Not needed on Windows because we call the linker +- # directly there, not through the compiler driver. +- # We don't link on goma, so this change is just for cleaner +- # internal linker invocations, for people who work on the build. +- if (!is_win) { +- ldflags += [ "-no-canonical-prefixes" ] +- } +- } + } + + config("clang_revision") { +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0008-Add-a-method-to-check-if-the-agl-window-is-configure.patch b/recipes-wam/cef/files/chromium/0008-Add-a-method-to-check-if-the-agl-window-is-configure.patch deleted file mode 100644 index bae799d7..00000000 --- a/recipes-wam/cef/files/chromium/0008-Add-a-method-to-check-if-the-agl-window-is-configure.patch +++ /dev/null @@ -1,64 +0,0 @@ -From d76f1575fd5abd31d488f7456700af0ead9712f0 Mon Sep 17 00:00:00 2001 -From: Roger Zanoni -Date: Fri, 30 Jun 2023 10:25:10 +0200 -Subject: [PATCH 8/9] Add a method to check if the agl window is configured - ---- - ui/aura/agl/window_tree_host_agl.h | 1 + - ui/aura/agl/window_tree_host_platform_agl.cc | 4 ++++ - ui/aura/agl/window_tree_host_platform_agl.h | 1 + - ui/platform_window/agl/platform_window_agl.h | 1 + - 4 files changed, 7 insertions(+) - -diff --git a/ui/aura/agl/window_tree_host_agl.h b/ui/aura/agl/window_tree_host_agl.h -index 858a078d939d0..b9aa451c8332e 100644 ---- a/ui/aura/agl/window_tree_host_agl.h -+++ b/ui/aura/agl/window_tree_host_agl.h -@@ -35,6 +35,7 @@ class AURA_EXPORT WindowTreeHostAgl { - virtual void SetAglReady() {} - virtual void SetAglBackground() {} - virtual void SetAglPanel(uint32_t edge) {} -+ virtual bool IsSurfaceConfigured() const { return false; } - }; - - } // namespace aura -diff --git a/ui/aura/agl/window_tree_host_platform_agl.cc b/ui/aura/agl/window_tree_host_platform_agl.cc -index e34595fe0ed9c..67190e1da6973 100644 ---- a/ui/aura/agl/window_tree_host_platform_agl.cc -+++ b/ui/aura/agl/window_tree_host_platform_agl.cc -@@ -47,4 +47,8 @@ void WindowTreeHostPlatformAgl::SetAglPanel(uint32_t edge) { - window_tree_host_platform_->platform_window()->SetAglPanel(edge); - } - -+bool WindowTreeHostPlatformAgl::IsSurfaceConfigured() const { -+ return window_tree_host_platform_->platform_window()->IsSurfaceConfigured(); -+} -+ - } // namespace aura -diff --git a/ui/aura/agl/window_tree_host_platform_agl.h b/ui/aura/agl/window_tree_host_platform_agl.h -index 181eefae346f7..e5a29fa1bfca3 100644 ---- a/ui/aura/agl/window_tree_host_platform_agl.h -+++ b/ui/aura/agl/window_tree_host_platform_agl.h -@@ -41,6 +41,7 @@ class AURA_EXPORT WindowTreeHostPlatformAgl : public aura::WindowTreeHost { - void SetAglReady() override; - void SetAglBackground() override; - void SetAglPanel(uint32_t edge) override; -+ bool IsSurfaceConfigured() const override; - - private: - aura::WindowTreeHostPlatform* window_tree_host_platform_; -diff --git a/ui/platform_window/agl/platform_window_agl.h b/ui/platform_window/agl/platform_window_agl.h -index 4bc915d663e72..cab1f42272772 100644 ---- a/ui/platform_window/agl/platform_window_agl.h -+++ b/ui/platform_window/agl/platform_window_agl.h -@@ -29,6 +29,7 @@ class PlatformWindowAgl { - virtual void SetAglReady() {} - virtual void SetAglBackground() {} - virtual void SetAglPanel(uint32_t edge) {} -+ virtual bool IsSurfaceConfigured() { return false; } - }; - - } // namespace ui --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0008-meta-browser-Pass-no-static-libstdc-to-gen.py.patch b/recipes-wam/cef/files/chromium/0008-meta-browser-Pass-no-static-libstdc-to-gen.py.patch new file mode 100644 index 00000000..a31d4242 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0008-meta-browser-Pass-no-static-libstdc-to-gen.py.patch @@ -0,0 +1,31 @@ +From f4d754e203e4968f4c9f68f00321fa0f1c942139 Mon Sep 17 00:00:00 2001 +From: Maksim Sisov +Date: Thu, 19 Dec 2019 15:47:53 +0200 +Subject: [PATCH 08/33] [meta-browser] Pass no-static-libstdc++ to gen.py + +Upstream-Status: Inappropriate + +GN requires libstdc++.a to be installed on host systems by default, +which is often not very common, for no particular reason. + +Signed-off-by: Raphael Kubo da Costa +Signed-off-by: Maksim Sisov +--- + tools/gn/bootstrap/bootstrap.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py +index caf736b28946d..c5d7c428ed68a 100755 +--- a/tools/gn/bootstrap/bootstrap.py ++++ b/tools/gn/bootstrap/bootstrap.py +@@ -113,6 +113,7 @@ def main(argv): + cmd = [ + sys.executable, + os.path.join(GN_ROOT, 'build', 'gen.py'), ++ '--no-static-libstdc++', + '--no-last-commit-position', + '--out-path=' + gn_build_dir, + ] +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0009-Start-using-agl-shell-version-4.patch b/recipes-wam/cef/files/chromium/0009-Start-using-agl-shell-version-4.patch deleted file mode 100644 index 1cf91430..00000000 --- a/recipes-wam/cef/files/chromium/0009-Start-using-agl-shell-version-4.patch +++ /dev/null @@ -1,347 +0,0 @@ -From 87e8811a2fc95b57f958e2bdfe5f3e434ecbff1e Mon Sep 17 00:00:00 2001 -From: Roger Zanoni -Date: Sun, 2 Jul 2023 11:11:07 +0200 -Subject: [PATCH 9/9] Start using agl-shell version 4 - ---- - ui/aura/agl/window_tree_host_agl.h | 1 + - ui/aura/agl/window_tree_host_platform_agl.cc | 4 + - ui/aura/agl/window_tree_host_platform_agl.h | 1 + - .../extensions/agl/host/agl_shell_wrapper.cc | 9 + - .../extensions/agl/host/agl_shell_wrapper.h | 1 + - .../agl/host/wayland_extensions_agl_impl.cc | 2 +- - .../extensions/agl/host/wayland_window_agl.cc | 10 + - .../extensions/agl/host/wayland_window_agl.h | 1 + - .../extensions/agl/protocol/agl-shell.xml | 185 +++++++++++++++++- - ui/platform_window/agl/platform_window_agl.h | 1 + - 10 files changed, 213 insertions(+), 2 deletions(-) - -diff --git a/ui/aura/agl/window_tree_host_agl.h b/ui/aura/agl/window_tree_host_agl.h -index b9aa451c8332e..c5213f75e623e 100644 ---- a/ui/aura/agl/window_tree_host_agl.h -+++ b/ui/aura/agl/window_tree_host_agl.h -@@ -36,6 +36,7 @@ class AURA_EXPORT WindowTreeHostAgl { - virtual void SetAglBackground() {} - virtual void SetAglPanel(uint32_t edge) {} - virtual bool IsSurfaceConfigured() const { return false; } -+ virtual void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) {} - }; - - } // namespace aura -diff --git a/ui/aura/agl/window_tree_host_platform_agl.cc b/ui/aura/agl/window_tree_host_platform_agl.cc -index 67190e1da6973..b9bae3f3b9bdc 100644 ---- a/ui/aura/agl/window_tree_host_platform_agl.cc -+++ b/ui/aura/agl/window_tree_host_platform_agl.cc -@@ -51,4 +51,8 @@ bool WindowTreeHostPlatformAgl::IsSurfaceConfigured() const { - return window_tree_host_platform_->platform_window()->IsSurfaceConfigured(); - } - -+void WindowTreeHostPlatformAgl::SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { -+ window_tree_host_platform_->platform_window()->SetupActivationArea(x, y, width, height); -+} -+ - } // namespace aura -diff --git a/ui/aura/agl/window_tree_host_platform_agl.h b/ui/aura/agl/window_tree_host_platform_agl.h -index e5a29fa1bfca3..30e160736e327 100644 ---- a/ui/aura/agl/window_tree_host_platform_agl.h -+++ b/ui/aura/agl/window_tree_host_platform_agl.h -@@ -42,6 +42,7 @@ class AURA_EXPORT WindowTreeHostPlatformAgl : public aura::WindowTreeHost { - void SetAglBackground() override; - void SetAglPanel(uint32_t edge) override; - bool IsSurfaceConfigured() const override; -+ void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) override; - - private: - aura::WindowTreeHostPlatform* window_tree_host_platform_; -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc -index c74fa5d9cd221..0d5d79c4738df 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc -+++ b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.cc -@@ -110,4 +110,13 @@ bool AglShellWrapper::WaitUntilBoundOk() { - return bound_ok_; - } - -+void AglShellWrapper::SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { -+#ifdef AGL_SHELL_SET_ACTIVATE_REGION_SINCE_VERSION -+ wl_output* output = -+ connection_->wayland_output_manager()->GetPrimaryOutput()->get_output(); -+ agl_shell_set_activate_region(agl_shell_.get(), output, x, y, -+ width, height); -+#endif -+} -+ - } // namespace ui -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h -index 2ab765883057e..1c2074e1b4306 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h -+++ b/ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h -@@ -39,6 +39,7 @@ class AglShellWrapper { - void SetAglPanel(WaylandWindow* window, uint32_t edge); - void SetAglBackground(WaylandWindow* window); - void SetAglReady(); -+ void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height); - bool WaitUntilBoundOk(); - - static void AglShellBoundOk(void* data, struct agl_shell*); -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -index 075b3010ea8a1..8f9d938cdd1f6 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc -@@ -32,7 +32,7 @@ namespace ui { - namespace { - - constexpr uint32_t kMinAglShellExtensionVersion = 1; --constexpr uint32_t kMaxAglShellExtensionVersion = 3; -+constexpr uint32_t kMaxAglShellExtensionVersion = 4; - - } // namespace - -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc -index 97b21ae537658..f92406d455de1 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.cc -@@ -83,4 +83,14 @@ void WaylandWindowAgl::SetAglPanel(uint32_t edge) { - connection()->ScheduleFlush(); - } - -+void WaylandWindowAgl::SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) { -+ if (!agl_extensions_->GetAglShell()) { -+ LOG(ERROR) << "Agl shell wrapper is not created"; -+ return; -+ } -+ -+ agl_extensions_->GetAglShell()->SetupActivationArea(x, y, width, height); -+ connection()->ScheduleFlush(); -+} -+ - } // namespace ui -diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h -index b2a922604c001..d21d2d9387215 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h -+++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h -@@ -39,6 +39,7 @@ class WaylandWindowAgl : public WaylandToplevelWindow { - void SetAglReady() override; - void SetAglBackground() override; - void SetAglPanel(uint32_t edge) override; -+ void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) override; - - private: - WaylandExtensionsAgl* agl_extensions_; -diff --git a/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml b/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml -index ad5553d61f189..e010a80808c69 100644 ---- a/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml -+++ b/ui/ozone/platform/wayland/extensions/agl/protocol/agl-shell.xml -@@ -22,7 +22,7 @@ - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - -- -+ - - Starting with version 2 of the protocol, the client is required to wait - for the 'bound_ok' or 'bound_fail' events in order to proceed further. -@@ -174,6 +174,189 @@ - - - -+ -+ -+ A hint for the compositor to use a custom area, rather than -+ inferring the activation area. If any panels are used -+ the compositor computes the activation area by subtracting the -+ panels geometry area. If no panels are used then the entire output -+ is being used. This request changes that as to hint the compositor -+ to use the supplied rectangle and ignore any potential panels -+ that might been set-up previously. - -+ In order for this request to take effect it will need to happen -+ before the 'ready' request in order for the compositor to make use of it. -+ Note that any 'set_panel' request be will not be honored, if this request -+ has been called. -+ -+ The x and y coordinates use the top-left corner as the origin. The -+ rectangle area shouldn't exceed the output area, while an area smaller -+ than the output, would basically result in showing up the background -+ surface. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Ask the compositor to hide the toplevel window for window -+ management purposes. Depending on the window role, this request -+ will either display the previously active window (or the background -+ in case there's no previously active surface) or temporarily (or -+ until a 'activate_app' is called upon) hide the surface. -+ -+ All the surfaces are identifiable by using the app_id, and no actions -+ are taken in case the app_id is not/was not present. -+ -+ See xdg_toplevel.set_app_id from the xdg-shell protocol for a -+ description of app_id. -+ -+ -+ -+ -+ -+ -+ Makes the application identified by app_id as floating. If the -+ application's window is already mapped, in a maximized, normal state, -+ it would transition to the float state. -+ -+ For applications that want to modify their own state, this request -+ must be done before the initial surface commit in order to take effect. -+ -+ If the application is already in floating state, this request wouldn't -+ do anything. -+ -+ There's no persistence of this request, once the application terminated -+ you'll to issue this request again for that particular app_id. -+ -+ The x, and y values would be initial position of the window where the -+ window surface will be placed. -+ -+ See xdg_toplevel.set_app_id from the xdg-shell protocol for a -+ description of app_id. -+ -+ -+ -+ -+ -+ -+ -+ -+ Returns the application identified by app_id as it was in the normal state. -+ This is useful to come back from other states to the maximized state, the -+ normal state applications are started. -+ -+ -+ -+ -+ -+ -+ Makes the application identified by app_id as fullscreen. If the -+ application's window is already mapped, in a maximized, normal state, -+ it would transition to the fullscreen state. -+ -+ For applications that want to modify their own state, this request -+ must be done before the initial surface commit in order to take effect. -+ -+ If the application is already in fullscreen state, this request wouldn't -+ do anything. -+ -+ There's no persistence of this request, once the application terminated -+ you'll to issue this request again for that particular app_id. -+ -+ See xdg_toplevel.set_app_id from the xdg-shell protocol for a -+ description of app_id. -+ -+ -+ -+ -+ -+ -+ This would allow the compositor to place an application on a particular -+ output, if that output is indeed available. This can happen before -+ application is started which would make the application start on that -+ particular output. If the application is already started it would -+ move the application to that output. -+ -+ There's no persistence of this request, once the application terminated -+ you'll need to issue this request again for that particular app_id. -+ -+ See xdg_toplevel.set_app_id from the xdg-shell protocol for a -+ description of app_id. -+ -+ -+ -+ -+ -+ -+ -+ Clients can use this event to be notified when an application -+ wants to be displayed on a certain output. This event is sent in -+ response to the set_app_output request. -+ -+ See xdg_toplevel.set_app_id from the xdg-shell protocol for a -+ description of app_id. -+ -+ -+ -+ -+ -+ -+ -+ -+ This interface allows another client bind to the agl_shell interface, -+ while there's another shell client already present. -+ -+ The client should first bind to this interface and then inform the -+ compositor with the 'doas_shell_client' request and it wants to bind to -+ the agl_shell interface. The client is still expected, if using a new -+ version of the agl_shell interface, to wait for the 'bound_ok' and -+ 'bound_fail' events before issueing any other requests/events. -+ -+ Note that this interface has its limitations, and the compositor would -+ still refuse the act for 'set_panel' or 'set_background' requests -+ of the agl_shell interface if there's already a client that used them. -+ -+ Any other requests or events should be delievered and handled as it would -+ a client bound to the agl_shell interface. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Call the destructor once you're ready with agl_shell_ext interface. -+ This would reset the state and would make any requests made -+ on the agl_shell interface be terminated. The client would need -+ to bind again the agl_shell_ext and issue a 'doas_shell_client' -+ request. -+ -+ -+ -+ -+ -+ Prior to binding to agl_shell interface, this request would inform -+ the compositor that it wants to gain access the agl_shell interface. -+ The client is expected to wait for 'doas_shell_client_done' event and -+ check for a successful status before going further with binding to -+ the agl_shell interface. -+ -+ -+ -+ -+ -+ The client should check the status event to verify that the -+ compositor was able to handle the request. -+ -+ -+ - - -diff --git a/ui/platform_window/agl/platform_window_agl.h b/ui/platform_window/agl/platform_window_agl.h -index cab1f42272772..b1a6150fff950 100644 ---- a/ui/platform_window/agl/platform_window_agl.h -+++ b/ui/platform_window/agl/platform_window_agl.h -@@ -30,6 +30,7 @@ class PlatformWindowAgl { - virtual void SetAglBackground() {} - virtual void SetAglPanel(uint32_t edge) {} - virtual bool IsSurfaceConfigured() { return false; } -+ virtual void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) {} - }; - - } // namespace ui --- -2.39.2 - diff --git a/recipes-wam/cef/files/chromium/0009-meta-browser-IWYU-Add-includes-for-size_t-and-int64_.patch b/recipes-wam/cef/files/chromium/0009-meta-browser-IWYU-Add-includes-for-size_t-and-int64_.patch new file mode 100644 index 00000000..8e46c2c5 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0009-meta-browser-IWYU-Add-includes-for-size_t-and-int64_.patch @@ -0,0 +1,42 @@ +From 585854fa48a040fe31caa42e675f78c783be0098 Mon Sep 17 00:00:00 2001 +From: Ivan Murashov +Date: Wed, 6 Sep 2023 19:40:47 +0000 +Subject: [PATCH 09/33] [meta-browser] IWYU: Add includes for size_t and + int64_t usage into sensor_reading.h + +Otherwise build fails when building with use_custom_libcxx=false. +The errors example: +services/device/public/cpp/generic_sensor/sensor_reading.h:17:40: +error: use of undeclared identifier 'int64_t' +services/device/public/cpp/generic_sensor/sensor_reading.h:35:5: +error: unknown type name 'int64_t' +services/device/public/cpp/generic_sensor/sensor_reading.h:58:20: +error: unknown type name 'size_t'; did you mean 'std::size_t'? + +Bug: 957519 +Change-Id: Iec9bb821eb6284cf38d93c1cec90846e2f615fab +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4838935 +Reviewed-by: Reilly Grant +Commit-Queue: Ivan Murashov +Cr-Commit-Position: refs/heads/main@{#1193203} +--- + services/device/public/cpp/generic_sensor/sensor_reading.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/services/device/public/cpp/generic_sensor/sensor_reading.h b/services/device/public/cpp/generic_sensor/sensor_reading.h +index 7df8278649a23..c653bec632cc6 100644 +--- a/services/device/public/cpp/generic_sensor/sensor_reading.h ++++ b/services/device/public/cpp/generic_sensor/sensor_reading.h +@@ -5,6 +5,9 @@ + #ifndef SERVICES_DEVICE_PUBLIC_CPP_GENERIC_SENSOR_SENSOR_READING_H_ + #define SERVICES_DEVICE_PUBLIC_CPP_GENERIC_SENSOR_SENSOR_READING_H_ + ++#include ++#include ++ + #include + + namespace device { +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0010-meta-browser-BUILD-do-not-specify-march-on-arm.patch b/recipes-wam/cef/files/chromium/0010-meta-browser-BUILD-do-not-specify-march-on-arm.patch new file mode 100644 index 00000000..5936248e --- /dev/null +++ b/recipes-wam/cef/files/chromium/0010-meta-browser-BUILD-do-not-specify-march-on-arm.patch @@ -0,0 +1,43 @@ +From 5d216a0f4d6312531bc03ce8c878dc251b67c589 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 22 Jan 2019 00:17:41 -0800 +Subject: [PATCH 10/33] [meta-browser] BUILD: do not specify march on arm + +Do not try to set the guessed values for march/mtune/float-abi +OE config machinary has computed these values already and fed it +via compiler cmdline to chromium build + +I think upstream should check for the values on compiler cmdline +before overriding these + +Upstream-Status: Inappropriate [OE-Specific] + +Signed-off-by: Khem Raj +--- + build/config/compiler/BUILD.gn | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index db763b998c4fb..6d87a2b03fa04 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -1111,16 +1111,6 @@ config("compiler_cpu_abi") { + "-msse3", + ] + } +- } else if (current_cpu == "arm") { +- if (!is_nacl) { +- cflags += [ +- "-march=$arm_arch", +- "-mfloat-abi=$arm_float_abi", +- ] +- } +- if (arm_tune != "") { +- cflags += [ "-mtune=$arm_tune" ] +- } + } else if (current_cpu == "mipsel" && !is_nacl) { + ldflags += [ "-Wl,--hash-style=sysv" ] + if (custom_toolchain == "") { +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0011-meta-browser-Avoid-parenthesized-initialization-of-a.patch b/recipes-wam/cef/files/chromium/0011-meta-browser-Avoid-parenthesized-initialization-of-a.patch new file mode 100644 index 00000000..dbdda920 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0011-meta-browser-Avoid-parenthesized-initialization-of-a.patch @@ -0,0 +1,164 @@ +From 03e9492ef563af17682683b6db5761d1c2ece8cc Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Thu, 3 Aug 2023 13:31:15 +0000 +Subject: [PATCH 11/33] [meta-browser] Avoid parenthesized initialization of + aggregates + +clang < 16 doesn't support C++20's "Parenthesized initialization of +aggregates" [1]. To fix build errors with older clang versions, we need +to either explicitly define a constructor that does the initialization, +or initialize the aggregate using curly braces. + +[1] https://clang.llvm.org/cxx_status.html + +Upstream-Status: Inappropriate [specific to older versions of clang] +Signed-off-by: Max Ihlenfeldt +--- + .../browser/content_settings/one_time_permission_provider.h | 1 + + chrome/browser/ui/omnibox/chrome_omnibox_client.cc | 4 ++-- + chrome/test/chromedriver/chrome/client_hints.h | 1 + + .../display_embedder/skia_output_surface_impl_on_gpu.cc | 2 +- + net/dns/host_resolver_cache.cc | 2 +- + .../blink/renderer/modules/canvas/canvas2d/canvas_style.cc | 4 ++-- + .../blink/renderer/platform/fonts/palette_interpolation.cc | 2 +- + ui/base/wayland/color_manager_util.h | 5 +++++ + 8 files changed, 14 insertions(+), 7 deletions(-) + +diff --git a/chrome/browser/content_settings/one_time_permission_provider.h b/chrome/browser/content_settings/one_time_permission_provider.h +index 839bec7daff97..2a000003507cf 100644 +--- a/chrome/browser/content_settings/one_time_permission_provider.h ++++ b/chrome/browser/content_settings/one_time_permission_provider.h +@@ -92,6 +92,7 @@ class OneTimePermissionProvider + ContentSettingsType type; + ContentSettingsPattern primary_pattern; + ContentSettingsPattern secondary_pattern; ++ ContentSettingEntry(ContentSettingsType t, ContentSettingsPattern p, ContentSettingsPattern s) : type(t), primary_pattern(p), secondary_pattern(s) {} + }; + + void DeleteEntriesAndNotify( +diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc +index 7ee2e0645e6c8..e036eeea4a5f9 100644 +--- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc ++++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc +@@ -474,10 +474,10 @@ void ChromeOmniboxClient::OnAutocompleteAccept( + alternative_nav_match); + + // Store the details necessary to open the omnibox match via browser commands. +- location_bar_->set_navigation_params(LocationBar::NavigationParams( ++ location_bar_->set_navigation_params(LocationBar::NavigationParams { + destination_url, disposition, transition, match_selection_timestamp, + destination_url_entered_without_scheme, +- destination_url_entered_with_http_scheme)); ++ destination_url_entered_with_http_scheme}); + + if (browser_) { + auto navigation = chrome::OpenCurrentURL(browser_); +diff --git a/chrome/test/chromedriver/chrome/client_hints.h b/chrome/test/chromedriver/chrome/client_hints.h +index 8c13bd3321c5e..42dc1acf75ec5 100644 +--- a/chrome/test/chromedriver/chrome/client_hints.h ++++ b/chrome/test/chromedriver/chrome/client_hints.h +@@ -19,6 +19,7 @@ struct BrandVersion { + // * "major version" for "brands", + // * "full version" for "fullVersionList". + std::string version; ++ BrandVersion(std::string b, std::string v) : brand(b), version(v) {} + }; + + // User-Agent Client Hints +diff --git a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +index 9e04843c454e3..e4981a96bbb06 100644 +--- a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc ++++ b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +@@ -1521,7 +1521,7 @@ void SkiaOutputSurfaceImplOnGpu::CopyOutputNV12( + + // Issue readbacks from the surfaces: + for (size_t i = 0; i < CopyOutputResult::kNV12MaxPlanes; ++i) { +- SkISize size(plane_surfaces[i]->width(), plane_surfaces[i]->height()); ++ SkISize size {plane_surfaces[i]->width(), plane_surfaces[i]->height()}; + SkImageInfo dst_info = SkImageInfo::Make( + size, (i == 0) ? kAlpha_8_SkColorType : kR8G8_unorm_SkColorType, + kUnpremul_SkAlphaType); +diff --git a/net/dns/host_resolver_cache.cc b/net/dns/host_resolver_cache.cc +index e54ed00c913ba..7d1165e7fcacf 100644 +--- a/net/dns/host_resolver_cache.cc ++++ b/net/dns/host_resolver_cache.cc +@@ -161,7 +161,7 @@ void HostResolverCache::Set( + + std::string domain_name = result->domain_name(); + entries_.emplace( +- Key(std::move(domain_name), network_anonymization_key), ++ Key {std::move(domain_name), network_anonymization_key}, + Entry(std::move(result), source, secure, staleness_generation_)); + + if (entries_.size() > max_entries_) { +diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc +index 883d769ca4b24..3dcd0d73468fc 100644 +--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc ++++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc +@@ -83,12 +83,12 @@ void CanvasStyle::ApplyToFlags(cc::PaintFlags& flags, + case kGradient: + GetCanvasGradient()->GetGradient()->ApplyToFlags(flags, SkMatrix::I(), + ImageDrawOptions()); +- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha)); ++ flags.setColor(SkColor4f {0.0f, 0.0f, 0.0f, global_alpha}); + break; + case kImagePattern: + GetCanvasPattern()->GetPattern()->ApplyToFlags( + flags, AffineTransformToSkMatrix(GetCanvasPattern()->GetTransform())); +- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha)); ++ flags.setColor(SkColor4f {0.0f, 0.0f, 0.0f, global_alpha}); + break; + default: + NOTREACHED(); +diff --git a/third_party/blink/renderer/platform/fonts/palette_interpolation.cc b/third_party/blink/renderer/platform/fonts/palette_interpolation.cc +index 1ce08e956a7aa..d6521525a52f6 100644 +--- a/third_party/blink/renderer/platform/fonts/palette_interpolation.cc ++++ b/third_party/blink/renderer/platform/fonts/palette_interpolation.cc +@@ -31,7 +31,7 @@ Vector PaletteInterpolation::MixColorRecords( + color_interpolation_space, hue_interpolation_method, start_color, + end_color, percentage, alpha_multiplier); + +- FontPalette::FontPaletteOverride result_color_record(i, result_color); ++ FontPalette::FontPaletteOverride result_color_record {static_cast(i), result_color}; + result_color_records.push_back(result_color_record); + } + return result_color_records; +diff --git a/ui/base/wayland/color_manager_util.h b/ui/base/wayland/color_manager_util.h +index fa1dd422c0e60..c54ace574e52e 100644 +--- a/ui/base/wayland/color_manager_util.h ++++ b/ui/base/wayland/color_manager_util.h +@@ -23,26 +23,31 @@ constexpr uint32_t kDefaultSinceVersion = 1; + struct TransferFnVersion { + skcms_TransferFunction transfer_fn; + uint32_t version; ++ TransferFnVersion(skcms_TransferFunction t, uint32_t v) : transfer_fn(t), version(v) {} + }; + + struct TransferVersion { + gfx::ColorSpace::TransferID transfer; + uint32_t version; ++ TransferVersion(gfx::ColorSpace::TransferID t, uint32_t v) : transfer(t), version(v) {} + }; + + struct PrimaryVersion { + gfx::ColorSpace::PrimaryID primary; + uint32_t version; ++ PrimaryVersion(gfx::ColorSpace::PrimaryID p, uint32_t v) : primary(p), version(v) {} + }; + + struct MatrixVersion { + gfx::ColorSpace::MatrixID matrix; + uint32_t version; ++ MatrixVersion(gfx::ColorSpace::MatrixID m, uint32_t v) : matrix(m), version(v) {} + }; + + struct RangeVersion { + gfx::ColorSpace::RangeID range; + uint32_t version; ++ RangeVersion(gfx::ColorSpace::RangeID r, uint32_t v) : range(r), version(v) {} + }; + + // A map from the zcr_color_manager_v1 chromaticity_names enum values +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0012-meta-browser-Fix-constexpr-variable-cannot-have-non-.patch b/recipes-wam/cef/files/chromium/0012-meta-browser-Fix-constexpr-variable-cannot-have-non-.patch new file mode 100644 index 00000000..3a91c1dd --- /dev/null +++ b/recipes-wam/cef/files/chromium/0012-meta-browser-Fix-constexpr-variable-cannot-have-non-.patch @@ -0,0 +1,78 @@ +From dcc972ec3451eaf88c2289a6f4852b24e901f26d Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Thu, 31 Aug 2023 10:27:47 +0000 +Subject: [PATCH 12/33] [meta-browser] Fix "constexpr variable cannot have + non-literal type" errors + +Something about Chromium's `base::flat_map` / +`base::internal::flat_tree` isn't considered a literal type by older +clang versions, meaning they can't be used in constexpr expressions. We +need to change them to be const instead. + +Upstream-Status: Inappropriate [specific to older versions of clang] +Signed-off-by: Max Ihlenfeldt +--- + ui/base/wayland/color_manager_util.h | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/ui/base/wayland/color_manager_util.h b/ui/base/wayland/color_manager_util.h +index c54ace574e52e..e25abe8e5d722 100644 +--- a/ui/base/wayland/color_manager_util.h ++++ b/ui/base/wayland/color_manager_util.h +@@ -53,7 +53,7 @@ struct RangeVersion { + // A map from the zcr_color_manager_v1 chromaticity_names enum values + // representing well-known chromaticities, to their equivalent PrimaryIDs. + // See components/exo/wayland/protocol/chrome-color-management.xml +-constexpr auto kChromaticityMap = base::MakeFixedFlatMap< ++const auto kChromaticityMap = base::MakeFixedFlatMap< + zcr_color_manager_v1_chromaticity_names, + PrimaryVersion>( + {{ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_BT601_525_LINE, +@@ -108,7 +108,7 @@ constexpr auto kChromaticityMap = base::MakeFixedFlatMap< + // A map from the zcr_color_manager_v1 eotf_names enum values + // representing well-known EOTFs, to their equivalent TransferIDs. + // See components/exo/wayland/protocol/chrome-color-management.xml +-constexpr auto kEotfMap = base::MakeFixedFlatMap< ++const auto kEotfMap = base::MakeFixedFlatMap< + zcr_color_manager_v1_eotf_names, + TransferVersion>({ + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, +@@ -176,7 +176,7 @@ constexpr auto kEotfMap = base::MakeFixedFlatMap< + // A map from the SDR zcr_color_manager_v1 eotf_names enum values + // representing well-known EOTFs, to their equivalent transfer functions. + // See components/exo/wayland/protocol/chrome-color-management.xml +-constexpr auto kTransferMap = ++const auto kTransferMap = + base::MakeFixedFlatMap({ + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, + TransferFnVersion(SkNamedTransferFn::kLinear, kDefaultSinceVersion)}, +@@ -196,7 +196,7 @@ constexpr auto kTransferMap = + // A map from the HDR zcr_color_manager_v1 eotf_names enum values + // representing well-known EOTFs, to their equivalent transfer functions. + // See components/exo/wayland/protocol/chrome-color-management.xml +-constexpr auto kHDRTransferMap = ++const auto kHDRTransferMap = + base::MakeFixedFlatMap( + {{ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, + TransferFnVersion(SkNamedTransferFn::kLinear, kDefaultSinceVersion)}, +@@ -214,7 +214,7 @@ constexpr auto kHDRTransferMap = + + // A map from zcr_color_manager_v1 matrix_names enum values to + // gfx::ColorSpace::MatrixIDs. +-constexpr auto kMatrixMap = ++const auto kMatrixMap = + base::MakeFixedFlatMap( + {{ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_RGB, + MatrixVersion(gfx::ColorSpace::MatrixID::RGB, kDefaultSinceVersion)}, +@@ -251,7 +251,7 @@ constexpr auto kMatrixMap = + + // A map from zcr_color_manager_v1 range_names enum values to + // gfx::ColorSpace::RangeIDs. +-constexpr auto kRangeMap = ++const auto kRangeMap = + base::MakeFixedFlatMap( + {{ZCR_COLOR_MANAGER_V1_RANGE_NAMES_LIMITED, + RangeVersion(gfx::ColorSpace::RangeID::LIMITED, +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0013-meta-browser-Add-missing-typename-s.patch b/recipes-wam/cef/files/chromium/0013-meta-browser-Add-missing-typename-s.patch new file mode 100644 index 00000000..8740b81a --- /dev/null +++ b/recipes-wam/cef/files/chromium/0013-meta-browser-Add-missing-typename-s.patch @@ -0,0 +1,105 @@ +From 210019ce23ea273a13c77fedb3e674a47c67214a Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Mon, 12 Jun 2023 16:52:44 +0000 +Subject: [PATCH 13/33] [meta-browser] Add missing "typename"s + +This adds some `typename`s in locations where they are needed in older +versions of clang (probably < 16). + +Upstream-Status: Inappropriate [specific to older versions of clang] +Signed-off-by: Max Ihlenfeldt +--- + .../download/bubble/download_bubble_update_service.cc | 6 +++--- + components/optimization_guide/core/tflite_model_executor.h | 2 +- + .../browser/web_ui_browser_interface_broker_registry.h | 6 +++--- + .../core/html/parser/html_document_parser_fastpath.cc | 2 +- + .../renderer/core/paint/object_paint_properties_sparse.h | 4 ++-- + 5 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/chrome/browser/download/bubble/download_bubble_update_service.cc b/chrome/browser/download/bubble/download_bubble_update_service.cc +index 93ec91e38b9b3..acd25f25d1579 100644 +--- a/chrome/browser/download/bubble/download_bubble_update_service.cc ++++ b/chrome/browser/download/bubble/download_bubble_update_service.cc +@@ -91,7 +91,7 @@ ItemSortKey GetSortKey(const Item& item) { + // Helper to get an iterator to the last element in the cache. The cache + // must not be empty. + template +-SortedItems::const_iterator GetLastIter(const SortedItems& cache) { ++typename SortedItems::const_iterator GetLastIter(const SortedItems& cache) { + CHECK(!cache.empty()); + auto it = cache.end(); + return std::prev(it); +@@ -967,9 +967,9 @@ bool DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheImpl( + } + + template +-SortedItems::iterator ++typename SortedItems::iterator + DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheByIter( +- SortedItems::iterator iter, ++ typename SortedItems::iterator iter, + SortedItems& cache, + IterMap& iter_map) { + CHECK(iter != cache.end()); +diff --git a/components/optimization_guide/core/tflite_model_executor.h b/components/optimization_guide/core/tflite_model_executor.h +index bbb5208aae904..027ae8e101634 100644 +--- a/components/optimization_guide/core/tflite_model_executor.h ++++ b/components/optimization_guide/core/tflite_model_executor.h +@@ -240,7 +240,7 @@ class TFLiteModelExecutor : public ModelExecutor { + void SendForBatchExecution( + BatchExecutionCallback callback_on_complete, + base::TimeTicks start_time, +- ModelExecutor::ConstRefInputVector inputs) ++ typename ModelExecutor::ConstRefInputVector inputs) + override { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +diff --git a/content/public/browser/web_ui_browser_interface_broker_registry.h b/content/public/browser/web_ui_browser_interface_broker_registry.h +index 0a419be66b325..7253c9680f722 100644 +--- a/content/public/browser/web_ui_browser_interface_broker_registry.h ++++ b/content/public/browser/web_ui_browser_interface_broker_registry.h +@@ -127,10 +127,10 @@ class CONTENT_EXPORT WebUIBrowserInterfaceBrokerRegistry { + // + // TODO(crbug.com/1407936): Point to WebUIJsBridge documentation. + template +- JsBridgeTraits::BinderInitializer& ForWebUIWithJsBridge() { ++ typename JsBridgeTraits::BinderInitializer& ForWebUIWithJsBridge() { + using Traits = JsBridgeTraits; +- using Interface = Traits::Interface; +- using JsBridgeBinderInitializer = Traits::BinderInitializer; ++ using Interface = typename Traits::Interface; ++ using JsBridgeBinderInitializer = typename Traits::BinderInitializer; + + // WebUIController::GetType() requires an instantiated WebUIController + // (because it's a virtual method and can't be static). Here we only have +diff --git a/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc b/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc +index 4b5b6701a591b..59e1262a06e37 100644 +--- a/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc ++++ b/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc +@@ -169,7 +169,7 @@ class HTMLFastPathParser { + using Span = base::span; + using USpan = base::span; + // 32 matches that used by HTMLToken::Attribute. +- typedef std::conditional, ++ typedef typename std::conditional, + UCharLiteralBuffer<32>, + LCharLiteralBuffer<32>>::type LiteralBufferType; + typedef UCharLiteralBuffer<32> UCharLiteralBufferType; +diff --git a/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h b/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h +index 9adc6dfac54db..be94e55af7cf6 100644 +--- a/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h ++++ b/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h +@@ -272,8 +272,8 @@ class CORE_EXPORT ObjectPaintPropertiesSparse : public ObjectPaintProperties { + NodeList& nodes, + NodeId node_id, + const ParentType& parent, +- NodeType::State&& state, +- const NodeType::AnimationState& animation_state = ++ typename NodeType::State&& state, ++ const typename NodeType::AnimationState& animation_state = + NodeType::AnimationState()) { + // First, check if we need to add a new node. + if (!nodes.HasField(node_id)) { +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0014-meta-browser-Avoid-std-ranges-find_if.patch b/recipes-wam/cef/files/chromium/0014-meta-browser-Avoid-std-ranges-find_if.patch new file mode 100644 index 00000000..2bd12fae --- /dev/null +++ b/recipes-wam/cef/files/chromium/0014-meta-browser-Avoid-std-ranges-find_if.patch @@ -0,0 +1,70 @@ +From a577e7a76e6002e50b5ab27514b7f49d4070499c Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Wed, 30 Aug 2023 16:06:19 +0000 +Subject: [PATCH 14/33] [meta-browser] Avoid std::ranges::find_if() + +std::ranges::find_if() was introduced in C++20, and older versions of +clang don't support it. We can instead use Chromium's `base::ranges` +library, which is supported. + +Upstream-Status: Inappropriate [specific to older versions of clang] +Signed-off-by: Max Ihlenfeldt +--- + .../password_manager/core/browser/ui/passwords_grouper.cc | 3 ++- + components/webauthn/core/browser/passkey_sync_bridge.cc | 5 +++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/components/password_manager/core/browser/ui/passwords_grouper.cc b/components/password_manager/core/browser/ui/passwords_grouper.cc +index 1b016e0eb9561..d259c6accf246 100644 +--- a/components/password_manager/core/browser/ui/passwords_grouper.cc ++++ b/components/password_manager/core/browser/ui/passwords_grouper.cc +@@ -8,6 +8,7 @@ + #include "base/containers/flat_set.h" + #include "base/strings/escape.h" + #include "base/strings/string_util.h" ++#include "base/ranges/algorithm.h" + #include "components/password_manager/core/browser/affiliation/affiliation_service.h" + #include "components/password_manager/core/browser/affiliation/affiliation_utils.h" + #include "components/password_manager/core/browser/passkey_credential.h" +@@ -277,7 +278,7 @@ absl::optional PasswordsGrouper::GetPasskeyFor( + const std::vector& passkeys = + map_group_id_to_credentials_[group_id_iterator->second].passkeys; + const auto passkey_it = +- std::ranges::find_if(passkeys, [&credential](const auto& passkey) { ++ base::ranges::find_if(passkeys, [&credential](const auto& passkey) { + return credential.passkey_credential_id == passkey.credential_id(); + }); + if (passkey_it == passkeys.end()) { +diff --git a/components/webauthn/core/browser/passkey_sync_bridge.cc b/components/webauthn/core/browser/passkey_sync_bridge.cc +index 93129fed756aa..794c696fcff04 100644 +--- a/components/webauthn/core/browser/passkey_sync_bridge.cc ++++ b/components/webauthn/core/browser/passkey_sync_bridge.cc +@@ -16,6 +16,7 @@ + #include "base/containers/span.h" + #include "base/feature_list.h" + #include "base/functional/callback_helpers.h" ++#include "base/ranges/algorithm.h" + #include "base/strings/string_number_conversions.h" + #include "base/trace_event/trace_event.h" + #include "components/sync/base/features.h" +@@ -258,7 +259,7 @@ PasskeySyncBridge::GetPasskeysForRelyingPartyId( + bool PasskeySyncBridge::DeletePasskey(const std::string& credential_id) { + // Find the credential with the given |credential_id|. + const auto passkey_it = +- std::ranges::find_if(data_, [&credential_id](const auto& passkey) { ++ base::ranges::find_if(data_, [&credential_id](const auto& passkey) { + return passkey.second.credential_id() == credential_id; + }); + if (passkey_it == data_.end()) { +@@ -309,7 +310,7 @@ bool PasskeySyncBridge::UpdatePasskey(const std::string& credential_id, + PasskeyChange change) { + // Find the credential with the given |credential_id|. + const auto passkey_it = +- std::ranges::find_if(data_, [&credential_id](const auto& passkey) { ++ base::ranges::find_if(data_, [&credential_id](const auto& passkey) { + return passkey.second.credential_id() == credential_id; + }); + if (passkey_it == data_.end()) { +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0015-meta-browser-Avoid-capturing-structured-bindings.patch b/recipes-wam/cef/files/chromium/0015-meta-browser-Avoid-capturing-structured-bindings.patch new file mode 100644 index 00000000..7b612b84 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0015-meta-browser-Avoid-capturing-structured-bindings.patch @@ -0,0 +1,56 @@ +From a1c05a94dc5b999bf22f1beedf3e3a9468775775 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Tue, 13 Jun 2023 15:48:12 +0000 +Subject: [PATCH 15/33] [meta-browser] Avoid capturing structured bindings + +Similar to https://crrev.com/c/4526976, this patch removes some uses of +structured bindings that lead to compile errors when using older +versions of clang (observed with clang 15). + +Upstream-Status: Inappropriate [specific to older versions of clang] +Signed-off-by: Max Ihlenfeldt +--- + .../service_worker/service_worker_context_wrapper.cc | 3 ++- + media/base/cdm_promise_adapter.cc | 8 ++++---- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc +index 3267cdb340819..de88ef7e565cb 100644 +--- a/content/browser/service_worker/service_worker_context_wrapper.cc ++++ b/content/browser/service_worker/service_worker_context_wrapper.cc +@@ -1412,9 +1412,10 @@ void ServiceWorkerContextWrapper::MaybeProcessPendingWarmUpRequest() { + auto [document_url, key, callback] = std::move(*request); + + DCHECK(document_url.is_valid()); ++ auto document_url_spec = document_url.spec(); + TRACE_EVENT1("ServiceWorker", + "ServiceWorkerContextWrapper::MaybeProcessPendingWarmUpRequest", +- "document_url", document_url.spec()); ++ "document_url", document_url_spec); + + context_core_->registry()->FindRegistrationForClientUrl( + ServiceWorkerRegistry::Purpose::kNotForNavigation, +diff --git a/media/base/cdm_promise_adapter.cc b/media/base/cdm_promise_adapter.cc +index f013809a62e25..144809b9696c3 100644 +--- a/media/base/cdm_promise_adapter.cc ++++ b/media/base/cdm_promise_adapter.cc +@@ -94,12 +94,12 @@ void CdmPromiseAdapter::RejectPromise(uint32_t promise_id, + void CdmPromiseAdapter::Clear(ClearReason reason) { + // Reject all outstanding promises. + DCHECK(thread_checker_.CalledOnValidThread()); +- for (auto& [promise_id, promise] : promises_) { ++ for (auto& promise : promises_) { + TRACE_EVENT_NESTABLE_ASYNC_END1( +- "media", "CdmPromise", TRACE_ID_WITH_SCOPE("CdmPromise", promise_id), ++ "media", "CdmPromise", TRACE_ID_WITH_SCOPE("CdmPromise", promise.first), + "status", "cleared"); +- promise->reject(CdmPromise::Exception::INVALID_STATE_ERROR, +- ToSystemCode(reason), "Operation aborted."); ++ promise.second->reject(CdmPromise::Exception::INVALID_STATE_ERROR, ++ ToSystemCode(reason), "Operation aborted."); + } + promises_.clear(); + } +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0016-meta-browser-Delete-compiler-options-not-available-i.patch b/recipes-wam/cef/files/chromium/0016-meta-browser-Delete-compiler-options-not-available-i.patch new file mode 100644 index 00000000..0956f5f3 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0016-meta-browser-Delete-compiler-options-not-available-i.patch @@ -0,0 +1,32 @@ +From 267609878c7f7472990ee5b480a9ab1c54dad8b2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 4 Dec 2019 19:06:54 -0800 +Subject: [PATCH 16/33] [meta-browser] Delete compiler options not available in + release versions of clang _yet_ + +Upstream-Status: Inappropriate [ clang/master already supports them ] +Signed-off-by: Khem Raj +Signed-off-by: Randy MacLeod +--- + build/config/compiler/BUILD.gn | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 6d87a2b03fa04..5762f0b4e6b0a 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -1725,6 +1725,11 @@ config("default_warnings") { + cflags += [ + "-Wenum-compare-conditional", + ++ # Disable unknown warnings, since system clang may not have ++ # backported newer warning yet unlike internal clang that ++ # chromium uses. ++ "-Wno-unknown-warning-option", ++ + # Ignore warnings about MSVC optimization pragmas. + # TODO(thakis): Only for no_chromium_code? http://crbug.com/912662 + "-Wno-ignored-pragma-optimize", +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0017-meta-browser-Don-t-pass-disable-auto-upgrade-debug-i.patch b/recipes-wam/cef/files/chromium/0017-meta-browser-Don-t-pass-disable-auto-upgrade-debug-i.patch new file mode 100644 index 00000000..48f722e8 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0017-meta-browser-Don-t-pass-disable-auto-upgrade-debug-i.patch @@ -0,0 +1,39 @@ +From a8243956b0fd410bf16143b3e781144ad8964244 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Tue, 13 Jun 2023 14:36:23 +0000 +Subject: [PATCH 17/33] [meta-browser] Don't pass + disable-auto-upgrade-debug-info to linker + +The version of aarch64-oe-linux-ld.lld we use on dunfell, kirkstone, and +mickledore doesn't support this flag. Thus, we mustn't pass it if we +want to avoid an "Unknown command line argument" linker error that stops +the build. + +Upstream-Status: Inappropriate +Signed-off-by: Max Ihlenfeldt +--- + build/config/compiler/BUILD.gn | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 5762f0b4e6b0a..c73b7ca6325d8 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -767,14 +767,6 @@ config("compiler") { + } + + ldflags += [ "-Wl,-mllvm,-import-instr-limit=$import_instr_limit" ] +- +- if (!is_chromeos) { +- # TODO(https://crbug.com/972449): turn on for ChromeOS when that +- # toolchain has this flag. +- # We only use one version of LLVM within a build so there's no need to +- # upgrade debug info, which can be expensive since it runs the verifier. +- ldflags += [ "-Wl,-mllvm,-disable-auto-upgrade-debug-info" ] +- } + } + + # TODO(https://crbug.com/1211155): investigate why this isn't effective on +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0018-meta-browser-Fix-undefined-symbol-PaintOpWriter-Seri.patch b/recipes-wam/cef/files/chromium/0018-meta-browser-Fix-undefined-symbol-PaintOpWriter-Seri.patch new file mode 100644 index 00000000..2c953d3b --- /dev/null +++ b/recipes-wam/cef/files/chromium/0018-meta-browser-Fix-undefined-symbol-PaintOpWriter-Seri.patch @@ -0,0 +1,49 @@ +From 1b8ee706e8bb16a9b6c59c832d33b56915d1f410 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Tue, 5 Sep 2023 09:51:38 +0000 +Subject: [PATCH 18/33] [meta-browser] Fix "undefined symbol: + PaintOpWriter::SerializedSize()" + +For some reason, clang 14 (currently used on dunfell and kirkstone) +seems to fail to correctly generate a needed instantiation of +`cc::PaintOpWriter::SerializedSize()`, and thus the final linking +step fails with an "undefined symbol" error. + +We can fix this by explicitly providing a specialization, which does the +same thing as the generic implementation. + +Upstream-Status: Inappropriate [specific to older versions of clang] +Signed-off-by: Max Ihlenfeldt +--- + cc/paint/paint_op_writer.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/cc/paint/paint_op_writer.h b/cc/paint/paint_op_writer.h +index 70153c0aa64ac..f47eb934c1eb1 100644 +--- a/cc/paint/paint_op_writer.h ++++ b/cc/paint/paint_op_writer.h +@@ -122,6 +122,9 @@ class CC_PAINT_EXPORT PaintOpWriter { + static size_t SerializedSize(const PaintRecord& record); + static size_t SerializedSize(const SkHighContrastConfig& config); + ++ template<> ++ constexpr size_t SerializedSize(); ++ + // Serialization of raw/smart pointers is not supported by default. + template + static inline size_t SerializedSize(const T* p); +@@ -385,6 +388,11 @@ constexpr size_t PaintOpWriter::SerializedSize() { + SerializedSizeSimple(); // fBaseImageType + } + ++template<> ++constexpr size_t PaintOpWriter::SerializedSize() { ++ return SerializedSizeSimple(); ++} ++ + template + constexpr size_t PaintOpWriter::SerializedSize() { + static_assert(std::is_arithmetic_v || std::is_enum_v); +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0019-upstream-Initialize-ServerCvc-with-designated-initia.patch b/recipes-wam/cef/files/chromium/0019-upstream-Initialize-ServerCvc-with-designated-initia.patch new file mode 100644 index 00000000..aba25502 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0019-upstream-Initialize-ServerCvc-with-designated-initia.patch @@ -0,0 +1,45 @@ +From 41653aae0a0de782bcfb8396a01aa1d3c98d3149 Mon Sep 17 00:00:00 2001 +From: Chisoon Jeong +Date: Tue, 12 Sep 2023 08:35:43 +0000 +Subject: [PATCH 19/33] [upstream] Initialize ServerCvc with designated + initializers. + +Replace ServerCvc initialization using aggregates from a parenthesized +list of values, which is not a c++20 feature allowed for Chromium at +the moment, with designated initializers. + +Change-Id: Ifdeb78d0ebc804016c655683ad1369dd543d4204 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4855865 +Reviewed-by: Florian Leimgruber +Reviewed-by: Dominic Battre +Commit-Queue: Dominic Battre +Cr-Commit-Position: refs/heads/main@{#1195267} +--- + .../core/browser/webdata/autofill_sync_bridge_util.cc | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc +index 634443fb4fe22..f67b90114f762 100644 +--- a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc ++++ b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc +@@ -553,11 +553,13 @@ ServerCvc AutofillWalletCvcStructDataFromWalletCredentialSpecifics( + base::StringToInt64(wallet_credential_specifics.instrument_id(), + &instrument_id); + +- return ServerCvc( +- instrument_id, base::UTF8ToUTF16(wallet_credential_specifics.cvc()), +- base::Time::UnixEpoch() + ++ return ServerCvc{ ++ .instrument_id = instrument_id, ++ .cvc = base::UTF8ToUTF16(wallet_credential_specifics.cvc()), ++ .last_updated_timestamp = ++ base::Time::UnixEpoch() + + base::Milliseconds(wallet_credential_specifics +- .last_updated_time_unix_epoch_millis())); ++ .last_updated_time_unix_epoch_millis())}; + } + + VirtualCardUsageData VirtualCardUsageDataFromUsageSpecifics( +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0020-M118-fix-Don-t-look-for-depot_tools-in-chrommium-s-t.patch b/recipes-wam/cef/files/chromium/0020-M118-fix-Don-t-look-for-depot_tools-in-chrommium-s-t.patch new file mode 100644 index 00000000..a8c01ab0 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0020-M118-fix-Don-t-look-for-depot_tools-in-chrommium-s-t.patch @@ -0,0 +1,37 @@ +From 814421a53454a9d35cd9d0799f68eaae8b7cf440 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Fri, 7 Apr 2023 16:28:51 +0200 +Subject: [PATCH 20/33] [M118-fix] Don't look for depot_tools in chrommium's + third_party folder + +This caused an issue at the configure step before we starte using +tarballs, we need to check if it still needed. + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + build/find_depot_tools.py | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/build/find_depot_tools.py b/build/find_depot_tools.py +index f891a414837a5..592bba699c00d 100755 +--- a/build/find_depot_tools.py ++++ b/build/find_depot_tools.py +@@ -27,14 +27,6 @@ def IsRealDepotTools(path): + + def add_depot_tools_to_path(): + """Search for depot_tools and add it to sys.path.""" +- # First, check if we have a DEPS'd in "depot_tools". +- deps_depot_tools = os.path.join(SRC, 'third_party', 'depot_tools') +- if IsRealDepotTools(deps_depot_tools): +- # Put the pinned version at the start of the sys.path, in case there +- # are other non-pinned versions already on the sys.path. +- sys.path.insert(0, deps_depot_tools) +- return deps_depot_tools +- + # Then look if depot_tools is already in PYTHONPATH. + for i in sys.path: + if i.rstrip(os.sep).endswith('depot_tools') and IsRealDepotTools(i): +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0021-M118-fix-Add-multiple-missing-includes.patch b/recipes-wam/cef/files/chromium/0021-M118-fix-Add-multiple-missing-includes.patch new file mode 100644 index 00000000..df307082 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0021-M118-fix-Add-multiple-missing-includes.patch @@ -0,0 +1,69 @@ +From 99b897cb41f70222477ed55128b38ea78edc78ff Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Tue, 31 Oct 2023 10:29:32 -0300 +Subject: [PATCH 21/33] [M118-fix] Add multiple missing includes + +Fix build issues related to missing includes. + +Upstream-Status: Apparently the issue only happens on older versions of +clang, but it's worth checking if it's applicable. +Signed-off-by: Roger Zanoni +--- + chrome/browser/ui/views/dark_mode_manager_linux.h | 1 + + net/cert/pki/general_names.h | 1 + + net/filter/zstd_source_stream.cc | 1 + + ui/events/gesture_detection/motion_event_generic.h | 2 ++ + 4 files changed, 5 insertions(+) + +diff --git a/chrome/browser/ui/views/dark_mode_manager_linux.h b/chrome/browser/ui/views/dark_mode_manager_linux.h +index f9bcd034d141d..e98db21ef1767 100644 +--- a/chrome/browser/ui/views/dark_mode_manager_linux.h ++++ b/chrome/browser/ui/views/dark_mode_manager_linux.h +@@ -6,6 +6,7 @@ + #define CHROME_BROWSER_UI_VIEWS_DARK_MODE_MANAGER_LINUX_H_ + + #include ++#include + + #include "base/gtest_prod_util.h" + #include "base/memory/scoped_refptr.h" +diff --git a/net/cert/pki/general_names.h b/net/cert/pki/general_names.h +index e35e410a2fba7..7704837970178 100644 +--- a/net/cert/pki/general_names.h ++++ b/net/cert/pki/general_names.h +@@ -6,6 +6,7 @@ + #define NET_CERT_PKI_GENERAL_NAMES_H_ + + #include ++#include + #include + + #include "net/base/net_export.h" +diff --git a/net/filter/zstd_source_stream.cc b/net/filter/zstd_source_stream.cc +index bd337d14366bb..551729ac542b7 100644 +--- a/net/filter/zstd_source_stream.cc ++++ b/net/filter/zstd_source_stream.cc +@@ -5,6 +5,7 @@ + #include "net/filter/zstd_source_stream.h" + + #include ++#include + #include + + #define ZSTD_STATIC_LINKING_ONLY +diff --git a/ui/events/gesture_detection/motion_event_generic.h b/ui/events/gesture_detection/motion_event_generic.h +index 5460f7f8adf46..e508335d47ae9 100644 +--- a/ui/events/gesture_detection/motion_event_generic.h ++++ b/ui/events/gesture_detection/motion_event_generic.h +@@ -5,6 +5,8 @@ + #ifndef UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_GENERIC_H_ + #define UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_GENERIC_H_ + ++#include ++ + #include + #include + +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0022-M118-fix-Fix-aggregate-initialization-in-trace_log.patch b/recipes-wam/cef/files/chromium/0022-M118-fix-Fix-aggregate-initialization-in-trace_log.patch new file mode 100644 index 00000000..39e5c605 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0022-M118-fix-Fix-aggregate-initialization-in-trace_log.patch @@ -0,0 +1,34 @@ +From a46e381a9007ab552d4551711611cd9d231a9f17 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Wed, 25 Oct 2023 15:59:23 -0300 +Subject: [PATCH 22/33] [M118-fix] Fix aggregate initialization in trace_log + +clang 14 doesn't parenthesized initialization of aggregates, so we are +explicitly defining the needed constructor. + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + base/trace_event/trace_log.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/base/trace_event/trace_log.h b/base/trace_event/trace_log.h +index 2778526e87b78..3b7e0f0306cf5 100644 +--- a/base/trace_event/trace_log.h ++++ b/base/trace_event/trace_log.h +@@ -420,6 +420,12 @@ class BASE_EXPORT TraceLog : + + #if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) + struct TrackEventSession { ++ TrackEventSession(uint32_t internal_instance_index, ++ perfetto::DataSourceConfig config, ++ perfetto::BackendType backend_type = perfetto::kUnspecifiedBackend) ++ : internal_instance_index{internal_instance_index} ++ , config{config} ++ , backend_type{backend_type} {} + uint32_t internal_instance_index; + perfetto::DataSourceConfig config; + perfetto::BackendType backend_type = perfetto::kUnspecifiedBackend; +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0023-M118-fix-Add-missing-typename-keyword-in-multiple-st.patch b/recipes-wam/cef/files/chromium/0023-M118-fix-Add-missing-typename-keyword-in-multiple-st.patch new file mode 100644 index 00000000..ea0b2c59 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0023-M118-fix-Add-missing-typename-keyword-in-multiple-st.patch @@ -0,0 +1,140 @@ +From a1077aa6d029f729143727ab8d25f85121f871a3 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Thu, 26 Oct 2023 07:43:26 -0300 +Subject: [PATCH 23/33] [M118-fix] Add missing 'typename' keyword in multiple + statements + +Add the typename keywork where it's needed as this causes build issues +in clang 14. + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + .../optimization_guide/core/tflite_model_executor.h | 8 ++++---- + components/supervised_user/core/browser/proto_fetcher.cc | 6 +++--- + components/supervised_user/core/browser/proto_fetcher.h | 4 ++-- + ui/base/interaction/interactive_test_internal.h | 6 +++--- + 4 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/components/optimization_guide/core/tflite_model_executor.h b/components/optimization_guide/core/tflite_model_executor.h +index 027ae8e101634..a256a85322e54 100644 +--- a/components/optimization_guide/core/tflite_model_executor.h ++++ b/components/optimization_guide/core/tflite_model_executor.h +@@ -262,7 +262,7 @@ class TFLiteModelExecutor : public ModelExecutor { + // Starts the synchronous execution of the model. Returns model outputs. + // Model needs to be loaded. Synchronous calls do not load or unload model. + std::vector> SendForBatchExecutionSync( +- ModelExecutor::ConstRefInputVector inputs) ++ typename ModelExecutor::ConstRefInputVector inputs) + override { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +@@ -417,7 +417,7 @@ class TFLiteModelExecutor : public ModelExecutor { + // executes it on the model execution thread. + void LoadModelFileAndBatchExecute( + BatchExecutionCallback callback_on_complete, +- ModelExecutor::ConstRefInputVector inputs) { ++ typename ModelExecutor::ConstRefInputVector inputs) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + +@@ -434,7 +434,7 @@ class TFLiteModelExecutor : public ModelExecutor { + + // Batch executes the loaded model for inputs. + void BatchExecuteLoadedModel( +- ModelExecutor::ConstRefInputVector inputs, ++ typename ModelExecutor::ConstRefInputVector inputs, + std::vector>* outputs) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +@@ -494,7 +494,7 @@ class TFLiteModelExecutor : public ModelExecutor { + // Unloads the model if needed. + void BatchExecuteLoadedModelAndRunCallback( + BatchExecutionCallback callback_on_complete, +- ModelExecutor::ConstRefInputVector inputs, ++ typename ModelExecutor::ConstRefInputVector inputs, + ExecutionStatus execution_status) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +diff --git a/components/supervised_user/core/browser/proto_fetcher.cc b/components/supervised_user/core/browser/proto_fetcher.cc +index 9c8e7b5cb88f4..92a614d75b579 100644 +--- a/components/supervised_user/core/browser/proto_fetcher.cc ++++ b/components/supervised_user/core/browser/proto_fetcher.cc +@@ -399,7 +399,7 @@ class RetryingFetcherImpl final : public DeferredFetcherImpl { + RetryingFetcherImpl(const RetryingFetcherImpl&) = delete; + RetryingFetcherImpl& operator=(const RetryingFetcherImpl&) = delete; + +- void Start(ProtoFetcher::Callback callback) override { ++ void Start(typename ProtoFetcher::Callback callback) override { + callback_ = std::move(callback); + Retry(); + } +@@ -435,7 +435,7 @@ class RetryingFetcherImpl final : public DeferredFetcherImpl { + } + + // Client callback. +- ProtoFetcher::Callback callback_; ++ typename ProtoFetcher::Callback callback_; + + // Retry controls. + base::OneShotTimer timer_; +@@ -578,7 +578,7 @@ ParallelFetchManager::ParallelFetchManager( + template + void ParallelFetchManager::Fetch( + const Request& request, +- Fetcher::Callback callback) { ++ typename Fetcher::Callback callback) { + CHECK(callback) << "Use base::DoNothing() instead of empty callback."; + KeyType key = requests_in_flight_.Add(MakeFetcher(request)); + requests_in_flight_.Lookup(key)->Start( +diff --git a/components/supervised_user/core/browser/proto_fetcher.h b/components/supervised_user/core/browser/proto_fetcher.h +index 8266c99d78a7a..9c41978aea68e 100644 +--- a/components/supervised_user/core/browser/proto_fetcher.h ++++ b/components/supervised_user/core/browser/proto_fetcher.h +@@ -165,10 +165,10 @@ class ParallelFetchManager { + + // Starts the fetch. Underlying fetcher is stored internally, and will be + // cleaned up after finish or when this manager is destroyed. +- void Fetch(const Request& request, Fetcher::Callback callback); ++ void Fetch(const Request& request, typename Fetcher::Callback callback); + + private: +- using KeyType = base::IDMap>::KeyType; ++ using KeyType = typename base::IDMap>::KeyType; + + // Remove fetcher under key from requests_in_flight_. + void Remove(KeyType key); +diff --git a/ui/base/interaction/interactive_test_internal.h b/ui/base/interaction/interactive_test_internal.h +index 080152fa265cd..a3c9b22f79487 100644 +--- a/ui/base/interaction/interactive_test_internal.h ++++ b/ui/base/interaction/interactive_test_internal.h +@@ -108,7 +108,7 @@ class InteractiveTestPrivate { + + // Adds `state_observer` and associates it with an element with identifier + // `id` and context `context`. +- template ++ template + void AddStateObserver(ElementIdentifier id, + ElementContext context, + std::unique_ptr state_observer); +@@ -457,7 +457,7 @@ struct ArgsExtractor { + }; + + template +-using ReturnTypeOf = MaybeBindTypeHelper::ReturnType; ++using ReturnTypeOf = typename MaybeBindTypeHelper::ReturnType; + + template + using NthArgumentOf = std::tuple_element_t< +@@ -556,7 +556,7 @@ struct MatcherTypeHelper { + }; + + template +-using MatcherTypeFor = MatcherTypeHelper>::ActualType; ++using MatcherTypeFor = typename MatcherTypeHelper>::ActualType; + + template + class IsMatcherHelper { +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0024-M118-fix-Fix-comparison-in-HostResolverCache.patch b/recipes-wam/cef/files/chromium/0024-M118-fix-Fix-comparison-in-HostResolverCache.patch new file mode 100644 index 00000000..ab487339 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0024-M118-fix-Fix-comparison-in-HostResolverCache.patch @@ -0,0 +1,34 @@ +From 590fdfc0339a2d82f30927b7c4e35b5e24d2dcc8 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Mon, 30 Oct 2023 08:14:34 -0300 +Subject: [PATCH 24/33] [M118-fix] Fix comparison in HostResolverCache + +Fixes the string_view/basic_strinc comparison: + +error: invalid operands to binary expression +('tuple<...basic_string_view &, ...>' and 'tuple &, ...') + return std::tie(lhs.domain_name, *lhs.network_anonymization_key) < + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + net/dns/host_resolver_cache.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/dns/host_resolver_cache.h b/net/dns/host_resolver_cache.h +index 934e0682c9864..2bb147de0ff19 100644 +--- a/net/dns/host_resolver_cache.h ++++ b/net/dns/host_resolver_cache.h +@@ -120,7 +120,7 @@ class NET_EXPORT HostResolverCache final { + struct Key { + ~Key(); + +- std::string domain_name; ++ base::StringPiece domain_name; + NetworkAnonymizationKey network_anonymization_key; + }; + +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0025-M118-fix-Avoid-using-std-ranges-any_of-find_if-none_.patch b/recipes-wam/cef/files/chromium/0025-M118-fix-Avoid-using-std-ranges-any_of-find_if-none_.patch new file mode 100644 index 00000000..fff1423e --- /dev/null +++ b/recipes-wam/cef/files/chromium/0025-M118-fix-Avoid-using-std-ranges-any_of-find_if-none_.patch @@ -0,0 +1,92 @@ +From ded11a971e690a00075c4f337fa09469b69b69a5 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Mon, 30 Oct 2023 15:03:04 -0300 +Subject: [PATCH 25/33] [M118-fix] Avoid using + std::ranges::any_of/find_if/none_of/all_of + +Those functions are available only in newer c++ standards(C++20). +Chromium defines those functions in base::ranges. + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + chrome/browser/ui/webauthn/sheet_models.cc | 2 +- + .../browser/webauthn/authenticator_request_dialog_model.cc | 2 +- + .../webauthn/chrome_authenticator_request_delegate.cc | 4 ++-- + device/fido/get_assertion_request_handler.cc | 5 +++-- + 4 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/chrome/browser/ui/webauthn/sheet_models.cc b/chrome/browser/ui/webauthn/sheet_models.cc +index e72087c22dc84..1d1999fdc49c3 100644 +--- a/chrome/browser/ui/webauthn/sheet_models.cc ++++ b/chrome/browser/ui/webauthn/sheet_models.cc +@@ -1499,7 +1499,7 @@ AuthenticatorMultiSourcePickerSheetModel:: + using ICloudKeychainMech = + AuthenticatorRequestDialogModel::Mechanism::ICloudKeychain; + bool has_local_passkeys = +- std::ranges::any_of(dialog_model->mechanisms(), [](const auto& mech) { ++ base::ranges::any_of(dialog_model->mechanisms(), [](const auto& mech) { + return absl::holds_alternative(mech.type) && + absl::get(mech.type).value().source != + device::AuthenticatorType::kPhone; +diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model.cc b/chrome/browser/webauthn/authenticator_request_dialog_model.cc +index 7695aa00f44a8..fa983ddf1a166 100644 +--- a/chrome/browser/webauthn/authenticator_request_dialog_model.cc ++++ b/chrome/browser/webauthn/authenticator_request_dialog_model.cc +@@ -495,7 +495,7 @@ void AuthenticatorRequestDialogModel:: + // extra step. Jump to Windows instead. + if (base::FeatureList::IsEnabled(device::kWebAuthnNewPasskeyUI) && + transport_availability_.has_win_native_api_authenticator && +- std::ranges::all_of(mechanisms_, [](const auto& mech) { ++ base::ranges::all_of(mechanisms_, [](const auto& mech) { + return absl::holds_alternative(mech.type) || + (absl::holds_alternative(mech.type) && + absl::get(mech.type).value().source == +diff --git a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc +index 15773fad86902..6ddd5cba1d6f3 100644 +--- a/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc ++++ b/chrome/browser/webauthn/chrome_authenticator_request_delegate.cc +@@ -886,8 +886,8 @@ void ChromeAuthenticatorRequestDelegate::OnTransportAvailabilityEnumerated( + if (data.has_platform_authenticator_credential == + device::FidoRequestHandlerBase::RecognizedCredential:: + kHasRecognizedCredential && +- std::ranges::none_of(data.recognized_credentials, +- IsCredentialFromPlatformAuthenticator)) { ++ base::ranges::none_of(data.recognized_credentials, ++ IsCredentialFromPlatformAuthenticator)) { + data.has_platform_authenticator_credential = device:: + FidoRequestHandlerBase::RecognizedCredential::kNoRecognizedCredential; + } +diff --git a/device/fido/get_assertion_request_handler.cc b/device/fido/get_assertion_request_handler.cc +index 507cc2b46ddb6..80b6da1799c33 100644 +--- a/device/fido/get_assertion_request_handler.cc ++++ b/device/fido/get_assertion_request_handler.cc +@@ -15,6 +15,7 @@ + #include "base/functional/bind.h" + #include "base/json/json_writer.h" + #include "base/metrics/histogram_functions.h" ++#include "base/ranges/algorithm.h" + #include "base/stl_util.h" + #include "base/strings/string_number_conversions.h" + #include "base/timer/elapsed_timer.h" +@@ -370,7 +371,7 @@ bool AllowListOnlyHybridOrInternal(const CtapGetAssertionRequest& request) { + + bool AllowListIncludedTransport(const CtapGetAssertionRequest& request, + FidoTransportProtocol transport) { +- return std::ranges::any_of( ++ return base::ranges::any_of( + request.allow_list, + [transport](const PublicKeyCredentialDescriptor& cred) { + return cred.transports.empty() || +@@ -441,7 +442,7 @@ void GetAssertionRequestHandler::PreselectAccount( + PublicKeyCredentialDescriptor credential) { + DCHECK(!preselected_credential_); + DCHECK(request_.allow_list.empty() || +- std::ranges::any_of( ++ base::ranges::any_of( + request_.allow_list, + [&credential](const PublicKeyCredentialDescriptor& desc) { + return desc.id == credential.id; +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0026-M118-fix-Add-deleted-constructors-operators.patch b/recipes-wam/cef/files/chromium/0026-M118-fix-Add-deleted-constructors-operators.patch new file mode 100644 index 00000000..06106360 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0026-M118-fix-Add-deleted-constructors-operators.patch @@ -0,0 +1,339 @@ +From 19a3339965f79f8ae8ab650850461cbd0a782bff Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Mon, 30 Oct 2023 15:28:20 -0300 +Subject: [PATCH 26/33] [M118-fix] Add deleted constructors/operators + +Apparently the rules for deleting the implicitly-defined move +constructor/operators is different in clang 14 and this causes build +issues where the constructors or operators are needed. + +So we explicitly declare all the needed constructors defined as deleted +by the compiler. + +Upstream-Status: Inappropriate, only affects older versions of clang +Signed-off-by: Roger Zanoni +--- + .../profile_management_navigation_throttle.cc | 22 +++++++++++++ + .../core/browser/profile_token_quality.cc | 12 +++---- + .../core/browser/profile_token_quality.h | 15 +++++++++ + .../public/common/download_save_item_data.h | 5 +++ + .../fenced_frame/fenced_frame_reporter.h | 25 +++++++++++++++ + .../header_direct_from_seller_signals.cc | 4 ++- + .../webid/idp_network_request_manager.h | 31 +++++++++++++++++++ + .../renderer/platform/fonts/font_palette.h | 1 + + .../gesture_detection/motion_event_generic.cc | 27 ++++++++++++++++ + .../gesture_detection/motion_event_generic.h | 6 ++-- + 10 files changed, 139 insertions(+), 9 deletions(-) + +diff --git a/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc b/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc +index aecaaf76762ee..3b02142d3e722 100644 +--- a/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc ++++ b/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc +@@ -5,6 +5,7 @@ + #include "chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.h" + + #include ++#include + + #include "base/command_line.h" + #include "base/containers/contains.h" +@@ -47,6 +48,27 @@ constexpr char kGoogleServiceLoginUrl[] = + // Utility struct used to store SAML attributes related to third-party profile + // management. + struct SAMLProfileAttributes { ++ SAMLProfileAttributes() {} ++ SAMLProfileAttributes(std::string n, std::string d, std::string t) ++ : name{n}, domain{d}, token{t} {} ++ SAMLProfileAttributes(const SAMLProfileAttributes& o) ++ : SAMLProfileAttributes(o.name, ++ o.domain, ++ o.token) {} ++ SAMLProfileAttributes(SAMLProfileAttributes&& o) ++ : name{std::move(o.name)} ++ , domain{std::move(o.domain)} ++ , token{std::move(o.token)} {} ++ SAMLProfileAttributes& operator=(const SAMLProfileAttributes& o) { ++ return *this = SAMLProfileAttributes(o); ++ } ++ SAMLProfileAttributes& operator=(SAMLProfileAttributes&& o) { ++ name = std::move(o.name); ++ domain = std::move(o.domain); ++ token = std::move(o.token); ++ return *this; ++ } ++ + std::string name; + std::string domain; + std::string token; +diff --git a/components/autofill/core/browser/profile_token_quality.cc b/components/autofill/core/browser/profile_token_quality.cc +index ff5f175372f39..e1c18eccb84b3 100644 +--- a/components/autofill/core/browser/profile_token_quality.cc ++++ b/components/autofill/core/browser/profile_token_quality.cc +@@ -241,10 +241,10 @@ bool ProfileTokenQuality::AddObservationsForFilledForm( + } + possible_observations.emplace_back( + stored_type, +- Observation{.type = base::to_underlying(GetObservationTypeFromField( ++ Observation(base::to_underlying(GetObservationTypeFromField( + field, form_data.fields[i].value, other_profiles, + pdm.app_locale())), +- .form_hash = hash}); ++ hash)); + } + return AddSubsetOfObservations(std::move(possible_observations)) > 0; + } +@@ -387,10 +387,10 @@ void ProfileTokenQuality::LoadSerializedObservationsForStoredType( + for (size_t i = 0; i + 1 < serialized_data.size(); i += 2) { + AddObservation( + type, +- Observation{ +- .type = std::min(serialized_data[i], +- base::to_underlying(ObservationType::kMaxValue)), +- .form_hash = FormSignatureHash(serialized_data[i + 1])}); ++ Observation( ++ std::min(serialized_data[i], ++ base::to_underlying(ObservationType::kMaxValue)), ++ FormSignatureHash(serialized_data[i + 1]))); + } + } + +diff --git a/components/autofill/core/browser/profile_token_quality.h b/components/autofill/core/browser/profile_token_quality.h +index 9dc16a1f98a13..2f726f04ab8d3 100644 +--- a/components/autofill/core/browser/profile_token_quality.h ++++ b/components/autofill/core/browser/profile_token_quality.h +@@ -211,6 +211,21 @@ class ProfileTokenQuality { + // For this reason, it is preferred to store the `ObservationType`s as their + // underlying type in the data model as well. + // Getters expose unknown values as `kUnknown`. ++ Observation(std::underlying_type_t t, ++ FormSignatureHash h) : type{t}, form_hash{h} {} ++ Observation(const Observation &o) ++ : Observation(o.type, o.form_hash) {} ++ Observation(Observation &&o) : type{std::move(o.type)}, ++ form_hash{std::move(o.form_hash)} {} ++ Observation& operator=(const Observation& o) { ++ return *this = Observation(o); ++ } ++ Observation& operator=(Observation&& o) noexcept { ++ type = std::move(o.type); ++ form_hash = std::move(o.form_hash); ++ return *this; ++ } ++ + std::underlying_type_t type; + FormSignatureHash form_hash = FormSignatureHash(0); + }; +diff --git a/components/download/public/common/download_save_item_data.h b/components/download/public/common/download_save_item_data.h +index 754aec2f64f6d..d49c3cd545b06 100644 +--- a/components/download/public/common/download_save_item_data.h ++++ b/components/download/public/common/download_save_item_data.h +@@ -20,6 +20,11 @@ class COMPONENTS_DOWNLOAD_EXPORT DownloadSaveItemData + : public base::SupportsUserData::Data { + public: + struct ItemInfo { ++ ItemInfo(base::FilePath f, GURL u, GURL r) ++ : file_path{f} ++ , url{u} ++ , referrer_url{r} {} ++ + // The final path where this file of the package will be saved. + base::FilePath file_path; + // The url this file was downloaded from. +diff --git a/content/browser/fenced_frame/fenced_frame_reporter.h b/content/browser/fenced_frame/fenced_frame_reporter.h +index 19ebadf3e14f7..8d2ee62847ced 100644 +--- a/content/browser/fenced_frame/fenced_frame_reporter.h ++++ b/content/browser/fenced_frame/fenced_frame_reporter.h +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + + #include "base/containers/flat_map.h" +@@ -40,6 +41,21 @@ class RenderFrameHostImpl; + // `type` is the key for the `ReportingUrlMap`, and `data` is sent with the + // request as a POST. + struct DestinationEnumEvent { ++ DestinationEnumEvent(std::string t, std::string d) ++ : type{std::move(t)} ++ , data{std::move(d)} {} ++ DestinationEnumEvent(const DestinationEnumEvent& o) ++ : DestinationEnumEvent(o.type, o.data) {} ++ DestinationEnumEvent(DestinationEnumEvent&& o) ++ : type{std::move(o.type)} ++ , data{std::move(o.data)} {} ++ DestinationEnumEvent& operator=(const DestinationEnumEvent& o) { ++ return *this = DestinationEnumEvent(o); ++ } ++ DestinationEnumEvent& operator=(DestinationEnumEvent&& o) { ++ std::swap(type, o.type); ++ std::swap(data, o.data); ++ } + std::string type; + std::string data; + }; +@@ -48,6 +64,15 @@ struct DestinationEnumEvent { + // `url` is the custom destination url, and the request is sent as a GET. + // Macros are substituted using the `ReportingMacros`. + struct DestinationURLEvent { ++ DestinationURLEvent(const GURL& u) : url{u} {} ++ DestinationURLEvent(const DestinationURLEvent& u) : url{u.url} {} ++ DestinationURLEvent(DestinationURLEvent&& u) : url{std::move(u.url)} {} ++ DestinationURLEvent& operator=(const DestinationURLEvent& o) { ++ return *this =DestinationURLEvent(o); ++ } ++ DestinationURLEvent& operator=(DestinationURLEvent&& o) { ++ std::swap(url, o.url); ++ } + GURL url; + }; + +diff --git a/content/browser/interest_group/header_direct_from_seller_signals.cc b/content/browser/interest_group/header_direct_from_seller_signals.cc +index fe59d11edf449..facbec80a203a 100644 +--- a/content/browser/interest_group/header_direct_from_seller_signals.cc ++++ b/content/browser/interest_group/header_direct_from_seller_signals.cc +@@ -16,6 +16,7 @@ + #include "base/strings/stringprintf.h" + #include "base/values.h" + #include "services/data_decoder/public/cpp/data_decoder.h" ++#include "third_party/abseil-cpp/absl/types/optional.h" + #include "url/gurl.h" + #include "url/origin.h" + #include "url/url_constants.h" +@@ -187,7 +188,8 @@ void OnJsonDecoded(std::unique_ptr> responses, + + } // namespace + +-HeaderDirectFromSellerSignals::HeaderDirectFromSellerSignals() = default; ++HeaderDirectFromSellerSignals::HeaderDirectFromSellerSignals() : seller_signals_{absl::nullopt} ++ , auction_signals_{absl::nullopt} {} + + HeaderDirectFromSellerSignals::~HeaderDirectFromSellerSignals() = default; + +diff --git a/content/browser/webid/idp_network_request_manager.h b/content/browser/webid/idp_network_request_manager.h +index 6a652e0a22b44..307e0f4a68f48 100644 +--- a/content/browser/webid/idp_network_request_manager.h ++++ b/content/browser/webid/idp_network_request_manager.h +@@ -75,6 +75,24 @@ class CONTENT_EXPORT IdpNetworkRequestManager { + kInvalidContentTypeError, + }; + struct FetchStatus { ++ FetchStatus(ParseStatus p, int r) ++ : parse_status{p} ++ , response_code{r} {} ++ FetchStatus(const FetchStatus& o) ++ : FetchStatus(o.parse_status, ++ o.response_code) {} ++ FetchStatus(FetchStatus&& o) ++ : parse_status{std::move(o.parse_status)} ++ , response_code{std::move(o.response_code)} {} ++ FetchStatus& operator=(const FetchStatus& o) { ++ return *this = FetchStatus(o); ++ } ++ FetchStatus& operator=(FetchStatus&& o) { ++ std::swap(parse_status, o.parse_status); ++ std::swap(response_code, o.response_code); ++ return *this; ++ } ++ + ParseStatus parse_status; + // The HTTP response code, if one was received, otherwise the net error. It + // is possible to distinguish which it is since HTTP response codes are +@@ -117,6 +135,19 @@ class CONTENT_EXPORT IdpNetworkRequestManager { + }; + + struct IdentityCredentialTokenError { ++ IdentityCredentialTokenError(int c, GURL u) : code{c}, url{u} {} ++ IdentityCredentialTokenError(const IdentityCredentialTokenError &o) ++ : IdentityCredentialTokenError(o.code, o.url) {} ++ IdentityCredentialTokenError(IdentityCredentialTokenError &&o) ++ : code{std::move(o.code)}, url{std::move(o.url)} {} ++ IdentityCredentialTokenError& operator=(const IdentityCredentialTokenError& o) { ++ return *this = IdentityCredentialTokenError(o); ++ } ++ IdentityCredentialTokenError& operator=(IdentityCredentialTokenError&& o) { ++ std::swap(code, o.code); ++ std::swap(url, o.url); ++ return *this; ++ } + int code; + GURL url; + }; +diff --git a/third_party/blink/renderer/platform/fonts/font_palette.h b/third_party/blink/renderer/platform/fonts/font_palette.h +index 01dac9c908e9e..9a1a167acf213 100644 +--- a/third_party/blink/renderer/platform/fonts/font_palette.h ++++ b/third_party/blink/renderer/platform/fonts/font_palette.h +@@ -60,6 +60,7 @@ class PLATFORM_EXPORT FontPalette : public RefCounted { + }; + + struct NonNormalizedPercentages { ++ NonNormalizedPercentages(double s, double e) : start{s}, end{e} {} + double start; + double end; + bool operator==(const NonNormalizedPercentages& other) const { +diff --git a/ui/events/gesture_detection/motion_event_generic.cc b/ui/events/gesture_detection/motion_event_generic.cc +index 77c5edaa17ee4..a312c6d4de0cf 100644 +--- a/ui/events/gesture_detection/motion_event_generic.cc ++++ b/ui/events/gesture_detection/motion_event_generic.cc +@@ -348,6 +348,33 @@ MotionEventGeneric& MotionEventGeneric::operator=( + return *this; + } + ++MotionEventGeneric& MotionEventGeneric::operator=( ++ MotionEventGeneric&& other) { ++ action_ = std::move(other.action_); ++ event_time_ = std::move(other.event_time_); ++ unique_event_id_ = std::move(other.unique_event_id_); ++ action_index_ = std::move(other.action_index_); ++ button_state_ = std::move(other.button_state_); ++ flags_ = std::move(other.flags_); ++ pointers_ = std::move(other.pointers_); ++ const size_t history_size = std::move(other.GetHistorySize()); ++ for (size_t h = 0; h < history_size; ++h) ++ PushHistoricalEvent(other.historical_events_[h]->Clone()); ++} ++ ++MotionEventGeneric::MotionEventGeneric(MotionEventGeneric&& other) { ++ action_ = std::move(other.action_); ++ event_time_ = std::move(other.event_time_); ++ unique_event_id_ = std::move(other.unique_event_id_); ++ action_index_ = std::move(other.action_index_); ++ button_state_ = std::move(other.button_state_); ++ flags_ = std::move(other.flags_); ++ pointers_ = std::move(other.pointers_); ++ const size_t history_size = std::move(other.GetHistorySize()); ++ for (size_t h = 0; h < history_size; ++h) ++ PushHistoricalEvent(other.historical_events_[h]->Clone()); ++} ++ + void MotionEventGeneric::PopPointer() { + DCHECK_GT(pointers_.size(), 0U); + pointers_.pop_back(); +diff --git a/ui/events/gesture_detection/motion_event_generic.h b/ui/events/gesture_detection/motion_event_generic.h +index e508335d47ae9..ed87c6254412c 100644 +--- a/ui/events/gesture_detection/motion_event_generic.h ++++ b/ui/events/gesture_detection/motion_event_generic.h +@@ -55,6 +55,9 @@ class GESTURE_DETECTION_EXPORT MotionEventGeneric : public MotionEvent { + base::TimeTicks event_time, + const PointerProperties& pointer); + MotionEventGeneric(const MotionEventGeneric& other); ++ MotionEventGeneric(MotionEventGeneric&& other); ++ MotionEventGeneric& operator=(const MotionEventGeneric& other); ++ MotionEventGeneric& operator=(MotionEventGeneric&& other); + + ~MotionEventGeneric() override; + +@@ -124,8 +127,7 @@ class GESTURE_DETECTION_EXPORT MotionEventGeneric : public MotionEvent { + protected: + MotionEventGeneric(); + MotionEventGeneric(const MotionEvent& event, bool with_history); +- MotionEventGeneric& operator=(const MotionEventGeneric& other); +- ++ + void PopPointer(); + + private: +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0027-M118-fix-Initialize-percentages-member-on-blink-Font.patch b/recipes-wam/cef/files/chromium/0027-M118-fix-Initialize-percentages-member-on-blink-Font.patch new file mode 100644 index 00000000..9d7e30eb --- /dev/null +++ b/recipes-wam/cef/files/chromium/0027-M118-fix-Initialize-percentages-member-on-blink-Font.patch @@ -0,0 +1,52 @@ +From c206c886eabc8f03289802276f826baedf0e4e54 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Mon, 30 Oct 2023 21:20:48 -0300 +Subject: [PATCH 27/33] [M118-fix] Initialize percentages member on + blink::FontPalette + +Fixes the build issue: + +error: constructor for 'blink::FontPalette' must explicitly +initialize the member 'percentages_' + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + .../blink/renderer/platform/fonts/font_palette.h | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/third_party/blink/renderer/platform/fonts/font_palette.h b/third_party/blink/renderer/platform/fonts/font_palette.h +index 9a1a167acf213..8c9a9c02439b5 100644 +--- a/third_party/blink/renderer/platform/fonts/font_palette.h ++++ b/third_party/blink/renderer/platform/fonts/font_palette.h +@@ -202,11 +202,14 @@ class PLATFORM_EXPORT FontPalette : public RefCounted { + + private: + explicit FontPalette(KeywordPaletteName palette_name) +- : palette_keyword_(palette_name), base_palette_({kNoBasePalette, 0}) {} ++ : palette_keyword_(palette_name), ++ base_palette_({kNoBasePalette, 0}), ++ percentages_{0.0, 0.0} {} + explicit FontPalette(AtomicString palette_values_name) + : palette_keyword_(kCustomPalette), + palette_values_name_(palette_values_name), +- base_palette_({kNoBasePalette, 0}) {} ++ base_palette_({kNoBasePalette, 0}), ++ percentages_{0.0, 0.0} {} + FontPalette( + scoped_refptr start, + scoped_refptr end, +@@ -224,7 +227,9 @@ class PLATFORM_EXPORT FontPalette : public RefCounted { + color_interpolation_space_(color_interpoaltion_space), + hue_interpolation_method_(hue_interpolation_method) {} + FontPalette() +- : palette_keyword_(kNormalPalette), base_palette_({kNoBasePalette, 0}) {} ++ : palette_keyword_(kNormalPalette), ++ base_palette_({kNoBasePalette, 0}), ++ percentages_{0.0, 0.0} {} + + KeywordPaletteName palette_keyword_; + AtomicString palette_values_name_; +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0028-M118-fix-Don-t-delete-ZstdSourceStream-copy-move-cto.patch b/recipes-wam/cef/files/chromium/0028-M118-fix-Don-t-delete-ZstdSourceStream-copy-move-cto.patch new file mode 100644 index 00000000..d387b67c --- /dev/null +++ b/recipes-wam/cef/files/chromium/0028-M118-fix-Don-t-delete-ZstdSourceStream-copy-move-cto.patch @@ -0,0 +1,32 @@ +From f45fd7f3cd85c0d421c37202d0f4dff2f7925162 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Fri, 3 Nov 2023 15:53:09 -0300 +Subject: [PATCH 28/33] [M118-fix] Don't delete ZstdSourceStream copy/move + ctors + +std::unique_ptr requires the deleted ZstdSourceStream deleted +constructors and it causes a build issue. + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + net/filter/zstd_source_stream.cc | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/net/filter/zstd_source_stream.cc b/net/filter/zstd_source_stream.cc +index 551729ac542b7..81d4565608e7a 100644 +--- a/net/filter/zstd_source_stream.cc ++++ b/net/filter/zstd_source_stream.cc +@@ -64,9 +64,6 @@ class ZstdSourceStream : public FilterSourceStream { + } + } + +- ZstdSourceStream(const ZstdSourceStream&) = delete; +- ZstdSourceStream& operator=(const ZstdSourceStream&) = delete; +- + ~ZstdSourceStream() override { + if (ZSTD_isError(decoding_result_)) { + ZSTD_ErrorCode error_code = ZSTD_getErrorCode(decoding_result_); +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0029-M118-fix-Fix-issue-with-structured-bindinds-captured.patch b/recipes-wam/cef/files/chromium/0029-M118-fix-Fix-issue-with-structured-bindinds-captured.patch new file mode 100644 index 00000000..fec15dd8 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0029-M118-fix-Fix-issue-with-structured-bindinds-captured.patch @@ -0,0 +1,68 @@ +From f7581fa1a0c25d2b76407bb04fd77031f5108411 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Fri, 3 Nov 2023 21:08:22 -0300 +Subject: [PATCH 29/33] [M118-fix] Fix issue with structured bindinds captured + by nested lambdas + +In clang <=14 the build fails doesn't when lambdas capture +aliases created in structured bindinds, so we do a few init-captures to +fix that. + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + .../core/layout/ng/grid/ng_grid_layout_algorithm.cc | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc +index 64c7a7481dd15..71eb55954e253 100644 +--- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc ++++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc +@@ -3494,7 +3494,7 @@ void NGGridLayoutAlgorithm::PlaceGridItems( + To(result->PhysicalFragment()); + NGBoxFragment fragment(container_writing_direction, physical_fragment); + +- auto BaselineOffset = [&](GridTrackSizingDirection track_direction, ++ auto BaselineOffset = [&, &layout_data = layout_data](GridTrackSizingDirection track_direction, + LayoutUnit size) -> LayoutUnit { + if (!grid_item.IsBaselineAligned(track_direction)) { + return LayoutUnit(); +@@ -3700,7 +3700,7 @@ void NGGridLayoutAlgorithm::PlaceGridItemsForFragmentation( + if (BreakToken()) + child_break_tokens = BreakToken()->ChildBreakTokens(); + +- auto PlaceItems = [&]() { ++ auto PlaceItems = [&, &grid_items = grid_items, &layout_data = layout_data]() { + // Reset our state. + result_and_offsets.clear(); + out_of_fragmentainer_space_item_placement.clear(); +@@ -3933,7 +3933,7 @@ void NGGridLayoutAlgorithm::PlaceGridItemsForFragmentation( + + // Adjust by |delta| the pre-computed item-offset for all grid items with a + // row begin index greater or equal than |row_index|. +- auto AdjustItemOffsets = [&](wtf_size_t row_index, LayoutUnit delta) { ++ auto AdjustItemOffsets = [&, &grid_items = grid_items](wtf_size_t row_index, LayoutUnit delta) { + auto current_item = grid_items.begin(); + + for (auto& item_placement_data : *grid_items_placement_data) { +@@ -3944,7 +3944,7 @@ void NGGridLayoutAlgorithm::PlaceGridItemsForFragmentation( + + // Adjust our grid break-token data to accommodate the larger item in the row. + // Returns true if this function adjusted the break-token data in any way. +- auto ExpandRow = [&]() -> bool { ++ auto ExpandRow = [&, &layout_data = layout_data]() -> bool { + if (max_row_expansion == 0) + return false; + +@@ -3963,7 +3963,7 @@ void NGGridLayoutAlgorithm::PlaceGridItemsForFragmentation( + // Shifts the row where we wish to take a breakpoint (indicated by + // |breakpoint_row_set_index|) into the next fragmentainer. + // Returns true if this function adjusted the break-token data in any way. +- auto ShiftBreakpointIntoNextFragmentainer = [&]() -> bool { ++ auto ShiftBreakpointIntoNextFragmentainer = [&, &layout_data = layout_data]() -> bool { + if (breakpoint_row_set_index == kNotFound) + return false; + +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0030-M118-fix-Only-default-arm_use_neon-to-true-if-its-va.patch b/recipes-wam/cef/files/chromium/0030-M118-fix-Only-default-arm_use_neon-to-true-if-its-va.patch new file mode 100644 index 00000000..08a2db60 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0030-M118-fix-Only-default-arm_use_neon-to-true-if-its-va.patch @@ -0,0 +1,107 @@ +From 55fe851951b11c30e010b5f3df618addf606e3d4 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Wed, 8 Nov 2023 14:35:21 -0300 +Subject: [PATCH 30/33] [M118-fix] Only default arm_use_neon to true if its + value wasn't already set + +arm_use_neon was always being set causing the build to fail. + +Upstream-Status: Needs checking +Signed-off-by: Roger Zanoni +--- + build/config/arm.gni | 58 +++++++++++++++++++++----------------------- + 1 file changed, 27 insertions(+), 31 deletions(-) + +diff --git a/build/config/arm.gni b/build/config/arm.gni +index 5b404c1ca94f0..575871c287c80 100644 +--- a/build/config/arm.gni ++++ b/build/config/arm.gni +@@ -9,36 +9,39 @@ import("//build/config/v8_target_cpu.gni") + # ARM code is being compiled. But they can also be relevant in the + # other contexts when the code will change its behavior based on the + # cpu it wants to generate code for. +-if (current_cpu == "arm" || v8_current_cpu == "arm") { +- declare_args() { +- # Version of the ARM processor when compiling on ARM. Ignored on non-ARM +- # platforms. +- arm_version = 7 ++declare_args() { ++ # Version of the ARM processor when compiling on ARM. Ignored on non-ARM ++ # platforms. ++ arm_version = 7 + +- # The ARM architecture. This will be a string like "armv6" or "armv7-a". +- # An empty string means to use the default for the arm_version. +- arm_arch = "" ++ # The ARM architecture. This will be a string like "armv6" or "armv7-a". ++ # An empty string means to use the default for the arm_version. ++ arm_arch = "" + +- # The ARM floating point hardware. This will be a string like "neon" or +- # "vfpv3". An empty string means to use the default for the arm_version. +- arm_fpu = "" ++ # The ARM floating point hardware. This will be a string like "neon" or ++ # "vfpv3". An empty string means to use the default for the arm_version. ++ arm_fpu = "" + +- # The ARM variant-specific tuning mode. This will be a string like "armv6" +- # or "cortex-a15". An empty string means to use the default for the +- # arm_version. +- arm_tune = "" ++ # The ARM variant-specific tuning mode. This will be a string like "armv6" ++ # or "cortex-a15". An empty string means to use the default for the ++ # arm_version. ++ arm_tune = "" + +- # Whether to use the neon FPU instruction set or not. +- arm_use_neon = "" ++ # Whether to use the neon FPU instruction set or not. ++ arm_use_neon = "" + +- # Whether to enable optional NEON code paths. +- arm_optionally_use_neon = false ++ # Whether to enable optional NEON code paths. ++ arm_optionally_use_neon = false + +- # Thumb is a reduced instruction set available on some ARM processors that +- # has increased code density. +- arm_use_thumb = true +- } ++ # Thumb is a reduced instruction set available on some ARM processors that ++ # has increased code density. ++ arm_use_thumb = true + ++ arm_control_flow_integrity = "none" ++ arm_float_abi = "" ++} ++ ++if (current_cpu == "arm" || v8_current_cpu == "arm") { + # For lacros build, we use ARM v8 by default. + if (is_chromeos_lacros && arm_arch == "") { + # TODO(crbug.com/1467681) Enable i8mm and dotprod instructions for ffmpeg +@@ -49,13 +52,6 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { + + if (current_os == "android" || target_os == "android") { + arm_float_abi = "softfp" +- } else { +- declare_args() { +- # The ARM floating point mode. This is either the string "hard", "soft", +- # or "softfp". An empty string means to use the default one for the +- # arm_version. +- arm_float_abi = "" +- } + } + assert(arm_float_abi == "" || arm_float_abi == "hard" || + arm_float_abi == "soft" || arm_float_abi == "softfp") +@@ -126,7 +122,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { + } + } + } +-} else if (current_cpu == "arm64" || v8_current_cpu == "arm64") { ++} else if (arm_use_neon == "" && (current_cpu == "arm64" || v8_current_cpu == "arm64")) { + # arm64 supports only "hard". + arm_float_abi = "hard" + arm_use_neon = true +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0031-M118-fix-Add-a-way-to-set-different-lib-paths-host-a.patch b/recipes-wam/cef/files/chromium/0031-M118-fix-Add-a-way-to-set-different-lib-paths-host-a.patch new file mode 100644 index 00000000..fa4dfe60 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0031-M118-fix-Add-a-way-to-set-different-lib-paths-host-a.patch @@ -0,0 +1,135 @@ +From e1bc5ea870e17afee145009194e6f2092dd1d3ff Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Sun, 12 Nov 2023 19:41:07 -0300 +Subject: [PATCH 31/33] [M118-fix] Add a way to set different lib paths host + and target + +meta-clang on AGL defines a simplified path structure for clang's +runtime libraries and a different lib naming convention. + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + build/config/clang/BUILD.gn | 80 +++++++++++------------------------- + build/config/clang/clang.gni | 3 ++ + 2 files changed, 27 insertions(+), 56 deletions(-) + +diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn +index fe044e29e428b..33edce7aed9a2 100644 +--- a/build/config/clang/BUILD.gn ++++ b/build/config/clang/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/rust.gni") ++import("//v8/gni/snapshot_toolchain.gni") + import("clang.gni") + + if (is_ios) { +@@ -95,66 +96,33 @@ template("clang_lib") { + } + } else { + config(target_name) { +- _dir = "" ++ if (current_toolchain == host_toolchain || ++ current_toolchain == v8_snapshot_toolchain) { ++ _base_path = "$clang_base_path" ++ _cpu = host_cpu ++ } else { ++ _base_path = "$clang_base_path_target" ++ _cpu = target_cpu ++ } ++ ++ if (_cpu == "x64") { ++ _suffix = "-x86_64" ++ } else if (_cpu == "x86") { ++ _suffix = "-i386" ++ } else if (_cpu == "arm64") { ++ _suffix = "-aarch64" ++ } else if (_cpu == "arm") { ++ _suffix = "-arm" ++ } else { ++ assert(false) # Unhandled cpu type ++ } ++ ++ _dir = "linux" + _libname = invoker.libname + _prefix = "lib" +- _suffix = "" + _ext = "a" +- if (is_win) { +- _dir = "windows" +- _prefix = "" +- _ext = "lib" +- if (current_cpu == "x64") { +- _suffix = "-x86_64" +- } else if (current_cpu == "x86") { +- _suffix = "-i386" +- } else if (current_cpu == "arm64") { +- _suffix = "-aarch64" +- } else { +- assert(false) # Unhandled cpu type +- } +- } else if (is_apple) { +- _dir = "darwin" +- } else if (is_linux || is_chromeos) { +- if (current_cpu == "x64") { +- _dir = "x86_64-unknown-linux-gnu" +- } else if (current_cpu == "x86") { +- _dir = "i386-unknown-linux-gnu" +- } else if (current_cpu == "arm") { +- _dir = "armv7-unknown-linux-gnueabihf" +- } else if (current_cpu == "arm64") { +- _dir = "aarch64-unknown-linux-gnu" +- } else { +- assert(false) # Unhandled cpu type +- } +- } else if (is_fuchsia) { +- if (current_cpu == "x64") { +- _dir = "x86_64-unknown-fuchsia" +- } else if (current_cpu == "arm64") { +- _dir = "aarch64-unknown-fuchsia" +- } else { +- assert(false) # Unhandled cpu type +- } +- } else if (is_android) { +- _dir = "linux" +- if (current_cpu == "x64") { +- _suffix = "-x86_64-android" +- } else if (current_cpu == "x86") { +- _suffix = "-i686-android" +- } else if (current_cpu == "arm") { +- _suffix = "-arm-android" +- } else if (current_cpu == "arm64") { +- _suffix = "-aarch64-android" +- } else if (current_cpu == "riscv64") { +- _suffix = "-riscv64-android" +- } else { +- assert(false) # Unhandled cpu type +- } +- } else { +- assert(false) # Unhandled target platform +- } + +- _clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib" ++ _clang_lib_dir = "$_base_path/lib/clang/$clang_version/lib" + _lib_file = "${_prefix}clang_rt.${_libname}${_suffix}.${_ext}" + libs = [ "$_clang_lib_dir/$_dir/$_lib_file" ] + } +diff --git a/build/config/clang/clang.gni b/build/config/clang/clang.gni +index 1a065b5e348b0..46fb56693b494 100644 +--- a/build/config/clang/clang.gni ++++ b/build/config/clang/clang.gni +@@ -26,6 +26,9 @@ declare_args() { + build_with_chromium && !is_official_build && is_linux && !is_castos + + clang_base_path = default_clang_base_path ++ ++ # used only for linking ++ clang_base_path_target = default_clang_base_path + + # Specifies whether or not bitcode should be embedded during compilation. + # This is used for creating a MLGO corpus from Chromium in the non-ThinLTO case. +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0032-M118-fix-zlib-Fix-arm-build.patch b/recipes-wam/cef/files/chromium/0032-M118-fix-zlib-Fix-arm-build.patch new file mode 100644 index 00000000..3c2b3a77 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0032-M118-fix-zlib-Fix-arm-build.patch @@ -0,0 +1,48 @@ +From 9ae234968078366877a1f8027423644ae7bbfb89 Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Mon, 13 Nov 2023 11:07:15 -0300 +Subject: [PATCH 32/33] [M118-fix] zlib: Fix arm build + +Prevent inclusion of cpuid on arm builds. + +error: + +third_party/zlib/cpu_features.c:15: +cpuid.h:14:2: error: this header is for x86 only + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + third_party/zlib/adler32_simd.c | 2 +- + third_party/zlib/cpu_features.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/third_party/zlib/adler32_simd.c b/third_party/zlib/adler32_simd.c +index 58966eecf0b80..25867ace82bd2 100644 +--- a/third_party/zlib/adler32_simd.c ++++ b/third_party/zlib/adler32_simd.c +@@ -49,7 +49,7 @@ + /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + #define NMAX 5552 + +-#if defined(ADLER32_SIMD_SSSE3) ++#if (__x86_64__ || __i386__) && defined(ADLER32_SIMD_SSSE3) + + #include + +diff --git a/third_party/zlib/cpu_features.c b/third_party/zlib/cpu_features.c +index 64e0428cd2fc2..c26c619970c10 100644 +--- a/third_party/zlib/cpu_features.c ++++ b/third_party/zlib/cpu_features.c +@@ -11,7 +11,7 @@ + #include + #if defined(_MSC_VER) + #include +-#elif defined(ADLER32_SIMD_SSSE3) ++#elif (__x86_64__ || __i386__) && defined(ADLER32_SIMD_SSSE3) + #include + #endif + +-- +2.42.1 + diff --git a/recipes-wam/cef/files/chromium/0033-M118-fix-Fix-skia-linker-issues-for-arm-neon.patch b/recipes-wam/cef/files/chromium/0033-M118-fix-Fix-skia-linker-issues-for-arm-neon.patch new file mode 100644 index 00000000..57f713b2 --- /dev/null +++ b/recipes-wam/cef/files/chromium/0033-M118-fix-Fix-skia-linker-issues-for-arm-neon.patch @@ -0,0 +1,56 @@ +From 0c37732e8443882518b79ce50b9389d1218484ef Mon Sep 17 00:00:00 2001 +From: Roger Zanoni +Date: Mon, 13 Nov 2023 22:10:25 -0300 +Subject: [PATCH 33/33] [M118-fix] Fix skia linker issues for arm neon + +Fixes the following linker issue: + +error: undefined symbol: skia::ConvolveHorizontally_Neon(...) + +Upstream-Status: Inappropriate +Signed-off-by: Roger Zanoni +--- + build/config/arm.gni | 5 +++++ + skia/ext/convolver.cc | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/build/config/arm.gni b/build/config/arm.gni +index 575871c287c80..ebf56196c2605 100644 +--- a/build/config/arm.gni ++++ b/build/config/arm.gni +@@ -122,10 +122,14 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { + } + } + } ++ if (arm_use_neon) { ++ defines += [ "USE_NEON" ] ++ } + } else if (arm_use_neon == "" && (current_cpu == "arm64" || v8_current_cpu == "arm64")) { + # arm64 supports only "hard". + arm_float_abi = "hard" + arm_use_neon = true ++ defines += [ "USE_NEON" ] + declare_args() { + # Enables the new Armv8 branch protection features. Valid strings are: + # - "pac": Enables Pointer Authentication Code (PAC, featured in Armv8.3) +@@ -146,3 +150,4 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { + arm_control_flow_integrity == "pac", + "Invalid branch protection option") + } ++ +diff --git a/skia/ext/convolver.cc b/skia/ext/convolver.cc +index 8b3bd070d168a..a7d99de48d398 100644 +--- a/skia/ext/convolver.cc ++++ b/skia/ext/convolver.cc +@@ -371,7 +371,7 @@ void SetupSIMD(ConvolveProcs *procs) { + procs->extra_horizontal_reads = 3; + procs->convolve_vertically = &ConvolveVertically_mips_dspr2; + procs->convolve_horizontally = &ConvolveHorizontally_mips_dspr2; +-#elif defined SIMD_NEON ++#elif defined USE_NEON && defined SIMD_NEON + procs->extra_horizontal_reads = 3; + procs->convolve_vertically = &ConvolveVertically_Neon; + procs->convolve_4rows_horizontally = &Convolve4RowsHorizontally_Neon; +-- +2.42.1 + -- cgit 1.2.3-korg