diff --git a/meta-chromium/recipes-browser/chromium/chromium-gn.inc b/meta-chromium/recipes-browser/chromium/chromium-gn.inc index 17741d91..fa05705b 100644 --- a/meta-chromium/recipes-browser/chromium/chromium-gn.inc +++ b/meta-chromium/recipes-browser/chromium/chromium-gn.inc @@ -23,17 +23,16 @@ SRC_URI += " \ file://0016-cast-to-bool-to-avoid-constexpr-error.patch \ file://0017-Revert-Fix-std-span-autodetection-7805.patch \ file://0018-Only-default-operator-on-declaration.patch \ - file://0019-Backport-constexpr-std-string-fixes.patch \ file://0020-Revert-__attribute__-and-alignas-changes.patch \ file://0021-Add-missing-typename-s.patch \ - file://0022-Backport-Avoid-capturing-structured-bindings.patch \ file://0023-Backport-IWYU-for-translate-TranslateUILanguagesMana.patch \ - file://0026-Backport-std-string-ends_with-is-C-20.-Use-base-Ends.patch \ file://0027-Don-t-pass-disable-auto-upgrade-debug-info-to-linker.patch \ file://0028-Avoid-capturing-structured-bindings.patch \ file://0029-Backport-IWYU-for-translate-TranslateUiLanguagesMana.patch \ - file://0030-Backport-Avoid-operator-which-is-C-20-specific.patch \ - file://0031-Backport-ozone-wayland-Fix-nullptr-deref-in-WaylandW.patch \ + file://0032-Backport-ozone-wayland-Fix-nullptr-deref-in-WaylandW.patch \ + file://0033-Revert-Reland-Reland-mte-refactor-the-tagging-functi.patch \ + file://0034-Avoid-parenthesized-initialization-of-aggregates.patch \ + file://0035-Backport-IWYU-for-chromedriver-chrome-client_hints.h.patch \ " SRC_URI:append:libc-musl = "\ diff --git a/meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_114.0.5735.198.bb b/meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_115.0.5790.170.bb similarity index 100% rename from meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_114.0.5735.198.bb rename to meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_115.0.5790.170.bb diff --git a/meta-chromium/recipes-browser/chromium/chromium-x11_114.0.5735.198.bb b/meta-chromium/recipes-browser/chromium/chromium-x11_115.0.5790.170.bb similarity index 100% rename from meta-chromium/recipes-browser/chromium/chromium-x11_114.0.5735.198.bb rename to meta-chromium/recipes-browser/chromium/chromium-x11_115.0.5790.170.bb diff --git a/meta-chromium/recipes-browser/chromium/chromium.inc b/meta-chromium/recipes-browser/chromium/chromium.inc index 4666a214..df2d8597 100644 --- a/meta-chromium/recipes-browser/chromium/chromium.inc +++ b/meta-chromium/recipes-browser/chromium/chromium.inc @@ -4,7 +4,7 @@ HOMEPAGE = "https://www.chromium.org/Home" CVE_PRODUCT = "chromium:chromium google:chrome" SRC_URI = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${PV}.tar.xz" -SRC_URI[sha256sum] = "a9f3440feeab51f56b199797b83b458ca545bf67e114c62b21470fadd5a41dea" +SRC_URI[sha256sum] = "ff9862d2e748c56940ffc222c2e6b2066a19ea1de0bc3fd99ed81c0b231172c0" S = "${WORKDIR}/chromium-${PV}" @@ -212,6 +212,7 @@ LIC_FILES_CHKSUM = "\ file://${S}/third_party/arcore-android-sdk/LICENSE;md5=c1bc4f7fbdd7a5a3f2c0dfefd457665e \ file://${S}/third_party/ashmem/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://${S}/third_party/axe-core/LICENSE;md5=f27a50d2e878867827842f2c60e30bfc \ + file://${S}/third_party/beto-core/LICENSE;md5=2b42edef8fa55315f34f2370b4715ca9 \ file://${S}/third_party/bidimapper/LICENSE;md5=2b42edef8fa55315f34f2370b4715ca9 \ file://${S}/third_party/blink/LICENSE_FOR_ABOUT_CREDITS;md5=11e90d553b211de885f245900c4ccf89 \ file://${S}/third_party/boringssl/src/LICENSE;md5=2ca501bc96ce9ed0814e2c592c3f9593 \ @@ -246,6 +247,7 @@ LIC_FILES_CHKSUM = "\ file://${S}/third_party/devtools-frontend/src/front_end/third_party/lighthouse/LICENSE;md5=a873c5645c184d51e0f9b34e1d7cf559 \ file://${S}/third_party/devtools-frontend/src/front_end/third_party/lit/LICENSE;md5=4b390b7b932ca7872d1de2c834797cad \ file://${S}/third_party/devtools-frontend/src/front_end/third_party/marked/LICENSE;md5=449f8b1cf0bfef1e5ec7824a4179ac6f \ + file://${S}/third_party/devtools-frontend/src/front_end/third_party/puppeteer-replay/package/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://${S}/third_party/devtools-frontend/src/front_end/third_party/puppeteer/LICENSE;md5=b8f1fc4a170646d6f75d9572a3bd1339 \ file://${S}/third_party/devtools-frontend/src/front_end/third_party/wasmparser/package/LICENSE;md5=2ee41112a44fe7014dce33e26468ba93 \ file://${S}/third_party/distributed_point_functions/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ diff --git a/meta-chromium/recipes-browser/chromium/files/0001-limit-number-of-LTO-jobs.patch b/meta-chromium/recipes-browser/chromium/files/0001-limit-number-of-LTO-jobs.patch index 079ed651..5a62c070 100644 --- a/meta-chromium/recipes-browser/chromium/files/0001-limit-number-of-LTO-jobs.patch +++ b/meta-chromium/recipes-browser/chromium/files/0001-limit-number-of-LTO-jobs.patch @@ -17,10 +17,10 @@ Signed-off-by: Maksim Sisov 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 28c2255ba8090..d740c7caf9427 100644 +index 23a8da453c3d2..f7273a944ec68 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -680,7 +680,7 @@ config("compiler") { +@@ -710,7 +710,7 @@ config("compiler") { if (is_win) { ldflags += [ @@ -29,7 +29,7 @@ index 28c2255ba8090..d740c7caf9427 100644 "-mllvm:-import-instr-limit=$import_instr_limit", "/lldltocache:" + rebase_path("$root_out_dir/thinlto-cache", root_build_dir), -@@ -694,11 +694,11 @@ config("compiler") { +@@ -724,11 +724,11 @@ config("compiler") { # usage in crbug.com/1038040. Note this will increase build time in # Chrome OS. diff --git a/meta-chromium/recipes-browser/chromium/files/0002-Remove-the-GN-settings-done-for-clang-that-conflict-.patch b/meta-chromium/recipes-browser/chromium/files/0002-Remove-the-GN-settings-done-for-clang-that-conflict-.patch index 9f9a7a04..43937c21 100644 --- a/meta-chromium/recipes-browser/chromium/files/0002-Remove-the-GN-settings-done-for-clang-that-conflict-.patch +++ b/meta-chromium/recipes-browser/chromium/files/0002-Remove-the-GN-settings-done-for-clang-that-conflict-.patch @@ -21,10 +21,10 @@ Rebased-by: Randy MacLeod 1 file changed, 38 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index d740c7caf9427..8f13f37d347cc 100644 +index f7273a944ec68..3d5aa9a79b106 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1005,11 +1005,6 @@ config("compiler_cpu_abi") { +@@ -1095,11 +1095,6 @@ config("compiler_cpu_abi") { ] } } else if (current_cpu == "arm") { @@ -36,7 +36,7 @@ index d740c7caf9427..8f13f37d347cc 100644 if (!is_nacl) { cflags += [ "-march=$arm_arch", -@@ -1019,12 +1014,6 @@ config("compiler_cpu_abi") { +@@ -1109,12 +1104,6 @@ config("compiler_cpu_abi") { if (arm_tune != "") { cflags += [ "-mtune=$arm_tune" ] } @@ -49,7 +49,7 @@ index d740c7caf9427..8f13f37d347cc 100644 } else if (current_cpu == "mipsel" && !is_nacl) { ldflags += [ "-Wl,--hash-style=sysv" ] if (custom_toolchain == "") { -@@ -1032,9 +1021,6 @@ config("compiler_cpu_abi") { +@@ -1122,9 +1111,6 @@ config("compiler_cpu_abi") { if (is_android) { cflags += [ "--target=mipsel-linux-android" ] ldflags += [ "--target=mipsel-linux-android" ] @@ -59,7 +59,7 @@ index d740c7caf9427..8f13f37d347cc 100644 } } else { cflags += [ "-EL" ] -@@ -1114,8 +1100,6 @@ config("compiler_cpu_abi") { +@@ -1204,8 +1190,6 @@ config("compiler_cpu_abi") { ldflags += [ "-Wl,--hash-style=sysv" ] if (custom_toolchain == "") { if (is_clang) { @@ -68,7 +68,7 @@ index d740c7caf9427..8f13f37d347cc 100644 } else { cflags += [ "-EB" ] ldflags += [ "-EB" ] -@@ -1163,9 +1147,6 @@ config("compiler_cpu_abi") { +@@ -1253,9 +1237,6 @@ config("compiler_cpu_abi") { if (is_android) { cflags += [ "--target=mips64el-linux-android" ] ldflags += [ "--target=mips64el-linux-android" ] @@ -78,7 +78,7 @@ index d740c7caf9427..8f13f37d347cc 100644 } } else { cflags += [ -@@ -1223,8 +1204,6 @@ config("compiler_cpu_abi") { +@@ -1313,8 +1294,6 @@ config("compiler_cpu_abi") { ldflags += [ "-Wl,--hash-style=sysv" ] if (custom_toolchain == "") { if (is_clang) { @@ -87,7 +87,7 @@ index d740c7caf9427..8f13f37d347cc 100644 } else { cflags += [ "-EB", -@@ -1387,23 +1366,6 @@ config("compiler_deterministic") { +@@ -1477,23 +1456,6 @@ config("compiler_deterministic") { } } } diff --git a/meta-chromium/recipes-browser/chromium/files/0003-v8-qemu-wrapper.patch b/meta-chromium/recipes-browser/chromium/files/0003-v8-qemu-wrapper.patch index 71c41328..be6133d1 100644 --- a/meta-chromium/recipes-browser/chromium/files/0003-v8-qemu-wrapper.patch +++ b/meta-chromium/recipes-browser/chromium/files/0003-v8-qemu-wrapper.patch @@ -29,10 +29,10 @@ index 52504f4f6f009..40425d63454f3 100644 "root_out_dir") + "/v8_context_snapshot_generator", diff --git a/v8/BUILD.gn b/v8/BUILD.gn -index 5cda664fdde..1b6919e71ea 100644 +index a69e7b2edbc..2e2ae5865e6 100644 --- a/v8/BUILD.gn +++ b/v8/BUILD.gn -@@ -2055,6 +2055,7 @@ template("run_torque") { +@@ -2061,6 +2061,7 @@ template("run_torque") { } args = [ @@ -40,7 +40,7 @@ index 5cda664fdde..1b6919e71ea 100644 "./" + rebase_path( get_label_info(":torque($toolchain)", "root_out_dir") + "/torque", root_build_dir), -@@ -2187,6 +2188,7 @@ action("generate_bytecode_builtins_list") { +@@ -2193,6 +2194,7 @@ action("generate_bytecode_builtins_list") { outputs = [ "$target_gen_dir/builtins-generated/bytecodes-builtins-list.h" ] deps = [ ":bytecode_builtins_list_generator($v8_generator_toolchain)" ] args = [ @@ -48,7 +48,7 @@ index 5cda664fdde..1b6919e71ea 100644 "./" + rebase_path( get_label_info( ":bytecode_builtins_list_generator($v8_generator_toolchain)", -@@ -2226,6 +2228,7 @@ template("run_mksnapshot") { +@@ -2232,6 +2234,7 @@ template("run_mksnapshot") { data = [] args = [ @@ -56,7 +56,7 @@ index 5cda664fdde..1b6919e71ea 100644 "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)", "root_out_dir") + "/mksnapshot", root_build_dir), -@@ -6600,6 +6603,7 @@ if (v8_enable_i18n_support) { +@@ -6647,6 +6650,7 @@ if (v8_enable_i18n_support) { outputs = [ output_file ] args = [ diff --git a/meta-chromium/recipes-browser/chromium/files/0005-BUILD-do-not-specify-march-on-arm.patch b/meta-chromium/recipes-browser/chromium/files/0005-BUILD-do-not-specify-march-on-arm.patch index a95f33d6..44f9a6b6 100644 --- a/meta-chromium/recipes-browser/chromium/files/0005-BUILD-do-not-specify-march-on-arm.patch +++ b/meta-chromium/recipes-browser/chromium/files/0005-BUILD-do-not-specify-march-on-arm.patch @@ -19,10 +19,10 @@ Signed-off-by: Khem Raj 1 file changed, 10 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 8f13f37d347cc..e3f22ce0a471b 100644 +index 3d5aa9a79b106..6e67e80ea23c1 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1004,16 +1004,6 @@ config("compiler_cpu_abi") { +@@ -1094,16 +1094,6 @@ config("compiler_cpu_abi") { "-msse3", ] } diff --git a/meta-chromium/recipes-browser/chromium/files/0007-Delete-compiler-options-not-available-in-release-ver.patch b/meta-chromium/recipes-browser/chromium/files/0007-Delete-compiler-options-not-available-in-release-ver.patch index 87ce1416..f483b0c3 100644 --- a/meta-chromium/recipes-browser/chromium/files/0007-Delete-compiler-options-not-available-in-release-ver.patch +++ b/meta-chromium/recipes-browser/chromium/files/0007-Delete-compiler-options-not-available-in-release-ver.patch @@ -13,10 +13,10 @@ Signed-off-by: Randy MacLeod 1 file changed, 5 insertions(+) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index e3f22ce0a471b..19badda7d644b 100644 +index 6e67e80ea23c1..3f15e68205a6f 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1592,6 +1592,11 @@ config("default_warnings") { +@@ -1682,6 +1682,11 @@ config("default_warnings") { cflags += [ "-Wenum-compare-conditional", diff --git a/meta-chromium/recipes-browser/chromium/files/0008-avoid-link-latomic-failure-on-CentOS-8-host.patch b/meta-chromium/recipes-browser/chromium/files/0008-avoid-link-latomic-failure-on-CentOS-8-host.patch index 8146f1f6..16953165 100644 --- a/meta-chromium/recipes-browser/chromium/files/0008-avoid-link-latomic-failure-on-CentOS-8-host.patch +++ b/meta-chromium/recipes-browser/chromium/files/0008-avoid-link-latomic-failure-on-CentOS-8-host.patch @@ -18,10 +18,10 @@ Signed-off-by: Randy MacLeod 2 files changed, 4 insertions(+) diff --git a/base/BUILD.gn b/base/BUILD.gn -index 8417fcda40d49..678c1b736d86f 100644 +index 4925a756be531..c4146ef5a831f 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -1100,7 +1100,9 @@ component("base") { +@@ -1099,7 +1099,9 @@ component("base") { # Needed for if using newer C++ library than sysroot, except if # building inside the cros_sdk environment - use host_toolchain as a # more robust check for this. diff --git a/meta-chromium/recipes-browser/chromium/files/0011-Revert-Use-ffile-compilation-dir-instead-of-fdebug-c.patch b/meta-chromium/recipes-browser/chromium/files/0011-Revert-Use-ffile-compilation-dir-instead-of-fdebug-c.patch index b8c842f9..56598a3c 100644 --- a/meta-chromium/recipes-browser/chromium/files/0011-Revert-Use-ffile-compilation-dir-instead-of-fdebug-c.patch +++ b/meta-chromium/recipes-browser/chromium/files/0011-Revert-Use-ffile-compilation-dir-instead-of-fdebug-c.patch @@ -24,10 +24,10 @@ Signed-off-by: Max Ihlenfeldt 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 19badda7d644b..88e4bbfc4f8c5 100644 +index 3f15e68205a6f..e2e30cbc80557 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1295,7 +1295,6 @@ config("compiler_codegen") { +@@ -1385,7 +1385,6 @@ config("compiler_codegen") { config("compiler_deterministic") { cflags = [] ldflags = [] @@ -35,7 +35,7 @@ index 19badda7d644b..88e4bbfc4f8c5 100644 # Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for # deterministic build. See https://crbug.com/314403 -@@ -1324,20 +1323,12 @@ config("compiler_deterministic") { +@@ -1414,20 +1413,12 @@ config("compiler_deterministic") { # different build directory like "out/feature_a" and "out/feature_b" if # we build same files with same compile flag. # Other paths are already given in relative, no need to normalize them. diff --git a/meta-chromium/recipes-browser/chromium/files/0015-drop-gsimple-template-names.patch b/meta-chromium/recipes-browser/chromium/files/0015-drop-gsimple-template-names.patch index ca9315c2..c86daeb4 100644 --- a/meta-chromium/recipes-browser/chromium/files/0015-drop-gsimple-template-names.patch +++ b/meta-chromium/recipes-browser/chromium/files/0015-drop-gsimple-template-names.patch @@ -11,10 +11,10 @@ Signed-off-by: Randy MacLeod 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 88e4bbfc4f8c5..bbfe6cb53ca2a 100644 +index e2e30cbc80557..c274a92b3f93e 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -825,9 +825,11 @@ config("compiler") { +@@ -860,9 +860,11 @@ config("compiler") { # * Apple platforms (e.g. MacOS, iPhone, iPad) aren't supported because xcode # lldb doesn't have the needed changes yet. # TODO(crbug.com/1379070): Remove if the upstream default ever changes. diff --git a/meta-chromium/recipes-browser/chromium/files/0018-Only-default-operator-on-declaration.patch b/meta-chromium/recipes-browser/chromium/files/0018-Only-default-operator-on-declaration.patch index 680c4015..96dd6782 100644 --- a/meta-chromium/recipes-browser/chromium/files/0018-Only-default-operator-on-declaration.patch +++ b/meta-chromium/recipes-browser/chromium/files/0018-Only-default-operator-on-declaration.patch @@ -17,11 +17,9 @@ Signed-off-by: Max Ihlenfeldt .../core/browser/affiliation/affiliation_fetcher_interface.h | 2 +- .../password_manager/core/browser/passkey_credential.cc | 3 --- .../password_manager/core/browser/passkey_credential.h | 5 +---- - printing/page_setup.cc | 4 ---- - printing/page_setup.h | 4 ++-- - printing/print_settings.cc | 5 ----- - printing/print_settings.h | 4 ++-- - 9 files changed, 6 insertions(+), 27 deletions(-) + components/password_manager/core/browser/password_form.cc | 2 -- + components/password_manager/core/browser/password_form.h | 2 +- + 7 files changed, 3 insertions(+), 17 deletions(-) diff --git a/components/password_manager/core/browser/affiliation/affiliation_fetcher_base.cc b/components/password_manager/core/browser/affiliation/affiliation_fetcher_base.cc index 5d5b95e0d787a..3a499529885be 100644 @@ -63,10 +61,10 @@ index 5bf889f5d940d..946eabe8dce6e 100644 AffiliationFetcherInterface() = default; diff --git a/components/password_manager/core/browser/passkey_credential.cc b/components/password_manager/core/browser/passkey_credential.cc -index a775f1150d07c..6890826570f41 100644 +index f0e46598704f4..12cf07ba62711 100644 --- a/components/password_manager/core/browser/passkey_credential.cc +++ b/components/password_manager/core/browser/passkey_credential.cc -@@ -46,7 +46,4 @@ int PasskeyCredential::GetAuthenticatorLabel() const { +@@ -81,7 +81,4 @@ int PasskeyCredential::GetAuthenticatorLabel() const { } } @@ -75,10 +73,10 @@ index a775f1150d07c..6890826570f41 100644 - } // namespace password_manager diff --git a/components/password_manager/core/browser/passkey_credential.h b/components/password_manager/core/browser/passkey_credential.h -index 7bf384bd7ff40..2573132d0ee3c 100644 +index 71005a94024ee..66578b15e7c35 100644 --- a/components/password_manager/core/browser/passkey_credential.h +++ b/components/password_manager/core/browser/passkey_credential.h -@@ -48,8 +48,7 @@ class PasskeyCredential { +@@ -57,8 +57,7 @@ class PasskeyCredential { const std::string& display_name() const { return display_name_; } private: @@ -88,7 +86,7 @@ index 7bf384bd7ff40..2573132d0ee3c 100644 // Authenticator type this passkey belongs to. Source source_; -@@ -75,8 +74,6 @@ class PasskeyCredential { +@@ -84,8 +83,6 @@ class PasskeyCredential { std::string display_name_; }; @@ -97,92 +95,29 @@ index 7bf384bd7ff40..2573132d0ee3c 100644 } // namespace password_manager #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSKEY_CREDENTIAL_H_ -diff --git a/printing/page_setup.cc b/printing/page_setup.cc -index c104f44cdc6b0..93d3d60078aa0 100644 ---- a/printing/page_setup.cc -+++ b/printing/page_setup.cc -@@ -49,8 +49,6 @@ PageMargins::PageMargins(int header, - top(top), - bottom(bottom) {} - --bool PageMargins::operator==(const PageMargins& other) const = default; -- - void PageMargins::Clear() { - header = 0; - footer = 0; -@@ -77,8 +75,6 @@ PageSetup::PageSetup(const PageSetup& other) = default; - - PageSetup::~PageSetup() = default; - --bool PageSetup::operator==(const PageSetup& other) const = default; -- - // static - gfx::Rect PageSetup::GetSymmetricalPrintableArea( - const gfx::Size& page_size, -diff --git a/printing/page_setup.h b/printing/page_setup.h -index 0f227753c74c7..c324044aea9e3 100644 ---- a/printing/page_setup.h -+++ b/printing/page_setup.h -@@ -16,7 +16,7 @@ class COMPONENT_EXPORT(PRINTING) PageMargins { - PageMargins(); - PageMargins(int header, int footer, int left, int right, int top, int bottom); - -- bool operator==(const PageMargins& other) const; -+ bool operator==(const PageMargins& other) const = default; - - void Clear(); - -@@ -44,7 +44,7 @@ class COMPONENT_EXPORT(PRINTING) PageSetup { - PageSetup(const PageSetup& other); - ~PageSetup(); - -- bool operator==(const PageSetup& other) const; -+ bool operator==(const PageSetup& other) const = default; - - // Gets a symmetrical printable area. - static gfx::Rect GetSymmetricalPrintableArea(const gfx::Size& page_size, -diff --git a/printing/print_settings.cc b/printing/print_settings.cc -index 055185c30eb8f..4cb49433f70ea 100644 ---- a/printing/print_settings.cc -+++ b/printing/print_settings.cc -@@ -266,9 +266,6 @@ absl::optional IsColorModelSelected(mojom::ColorModel color_model) { - // all ColorModel values are determinantly handled. - } - --bool PrintSettings::RequestedMedia::operator==( -- const PrintSettings::RequestedMedia& other) const = default; -- - // Global SequenceNumber used for generating unique cookie values. - static base::AtomicSequenceNumber cookie_seq; - -@@ -325,8 +322,6 @@ PrintSettings& PrintSettings::operator=(const PrintSettings& settings) { +diff --git a/components/password_manager/core/browser/password_form.cc b/components/password_manager/core/browser/password_form.cc +index e11d5204e7527..c6c551aabc3de 100644 +--- a/components/password_manager/core/browser/password_form.cc ++++ b/components/password_manager/core/browser/password_form.cc +@@ -230,8 +230,6 @@ AlternativeElement& AlternativeElement::operator=(AlternativeElement&& rhs) = - PrintSettings::~PrintSettings() = default; + AlternativeElement::~AlternativeElement() = default; --bool PrintSettings::operator==(const PrintSettings& other) const = default; +-bool AlternativeElement::operator==(const AlternativeElement&) const = default; - - void PrintSettings::Clear() { - ranges_.clear(); - selection_only_ = false; -diff --git a/printing/print_settings.h b/printing/print_settings.h -index db3af5770efc8..caacf1c577b4b 100644 ---- a/printing/print_settings.h -+++ b/printing/print_settings.h -@@ -63,7 +63,7 @@ class COMPONENT_EXPORT(PRINTING) PrintSettings { - // Media properties requested by the user. Default instance represents - // default media selection. - struct RequestedMedia { -- bool operator==(const RequestedMedia& other) const; -+ bool operator==(const RequestedMedia& other) const = default; - bool IsDefault() const { - return size_microns.IsEmpty() && vendor_id.empty(); - } -@@ -83,7 +83,7 @@ class COMPONENT_EXPORT(PRINTING) PrintSettings { - PrintSettings& operator=(const PrintSettings&); - ~PrintSettings(); - -- bool operator==(const PrintSettings& other) const; -+ bool operator==(const PrintSettings& other) const = default; - - // Reinitialize the settings to the default values. - void Clear(); + bool AlternativeElement::operator<(const AlternativeElement& other) const { + return std::tie(value, field_renderer_id, name) < + std::tie(other.value, other.field_renderer_id, other.name); +diff --git a/components/password_manager/core/browser/password_form.h b/components/password_manager/core/browser/password_form.h +index a737d5382030f..7450bef2b0ca4 100644 +--- a/components/password_manager/core/browser/password_form.h ++++ b/components/password_manager/core/browser/password_form.h +@@ -44,7 +44,7 @@ struct AlternativeElement { + AlternativeElement& operator=(AlternativeElement&& rhs); + ~AlternativeElement(); + +- bool operator==(const AlternativeElement&) const; ++ bool operator==(const AlternativeElement&) const = default; + bool operator<(const AlternativeElement&) const; + + // The value of the field. diff --git a/meta-chromium/recipes-browser/chromium/files/0019-Backport-constexpr-std-string-fixes.patch b/meta-chromium/recipes-browser/chromium/files/0019-Backport-constexpr-std-string-fixes.patch deleted file mode 100644 index 971ad1ec..00000000 --- a/meta-chromium/recipes-browser/chromium/files/0019-Backport-constexpr-std-string-fixes.patch +++ /dev/null @@ -1,1106 +0,0 @@ -From 90fb78519d934c6c9f05f00ec75381dc6279452b Mon Sep 17 00:00:00 2001 -From: Max Ihlenfeldt -Date: Mon, 12 Jun 2023 16:40:44 +0000 -Subject: [PATCH] Backport `constexpr std::string` fixes - -This is a backport of https://crrev.com/c/4521911, which removes the -usage of `constexpr std::string`, because that is C++20 only and can -lead to compiler errors (e.g. on dunfell). Because that CL depends on -the changes from https://crrev.com/c/4523268, these are included as -well. - -This patch doesn't include changes from the CLs to files that are only -needed on non-Linux platforms or when compiling tests, both to reduce -the patch size and because there were non-trivial conflicts. - -Both backported patches will be part of upstream's 115 release. - -Upstream-Status: Backport [https://crrev.com/c/4521911, https://crrev.com/c/4523268] -Signed-off-by: Max Ihlenfeldt ---- - chrome/app/chrome_main_delegate.cc | 6 +++--- - .../browser/chrome_content_browser_client.cc | 2 +- - .../browser/diagnostics/recon_diagnostics.cc | 2 +- - .../connectors/connectors_service.cc | 3 ++- - .../reporting/crash_reporting_context.cc | 8 +++---- - .../identity_get_auth_token_function.cc | 4 ++-- - .../chrome_extensions_browser_client.cc | 2 +- - .../browser/extensions/preinstalled_apps.cc | 2 +- - .../discovery/dial/dial_service_impl.cc | 7 ++++--- - .../cast/chrome_cast_message_handler.cc | 3 ++- - .../media/webrtc/webrtc_event_log_uploader.cc | 7 ++++--- - .../media/webrtc/webrtc_log_uploader.cc | 6 +++--- - .../media/webrtc/webrtc_text_log_handler.cc | 6 +++--- - .../permissions/chrome_permissions_client.cc | 3 ++- - ...device_management_service_configuration.cc | 8 +++---- - .../resettable_settings_snapshot.cc | 2 +- - .../profiles/chrome_version_service.cc | 2 +- - .../ui_thread_search_terms_data.cc | 18 +++++++--------- - chrome/browser/ui/autofill/risk_util.cc | 3 ++- - .../browser/ui/views/chrome_views_delegate.cc | 2 +- - .../internals_ui_handler.cc | 6 ++++-- - chrome/browser/ui/webui/flags/flags_ui.cc | 3 ++- - chrome/browser/ui/webui/nacl_ui.cc | 12 ++++++----- - chrome/browser/ui/webui/version/version_ui.cc | 10 +++++---- - .../chrome_update_query_params_delegate.cc | 10 ++++----- - chrome/updater/configurator.cc | 2 +- - .../autofill/core/browser/form_structure.cc | 8 +++---- - .../component_updater/configurator_impl.cc | 2 +- - .../embedder_support/user_agent_utils.cc | 17 +++++++-------- - .../reporting/browser_report_generator.cc | 2 +- - components/gcm_driver/gcm_desktop_utils.cc | 2 +- - components/metrics/version_utils.cc | 2 +- - .../rewrite_minidumps_as_mimes.cc | 5 ++--- - .../core/browser/webui/json_generation.cc | 18 +++++++--------- - .../core/common/cloud/cloud_policy_util.cc | 2 +- - .../policy/core/common/policy_logger.cc | 2 +- - components/quirks/quirks_client.cc | 2 +- - .../browser/db/v4_protocol_manager_util.cc | 2 +- - .../core/browser/user_population.cc | 5 +++-- - .../content/certificate_error_report.cc | 5 +++-- - components/sync/base/sync_util.cc | 21 ++++++++----------- - components/sync/driver/sync_internals_util.cc | 8 ++++--- - .../update_client/update_query_params.cc | 2 +- - components/version_info/version_info.cc | 6 ++---- - components/version_info/version_info.h | 17 ++++++++------- - .../android/webapk/webapk_proto_builder.cc | 3 ++- - .../shell_extensions_browser_client.cc | 2 +- - .../sct_auditing/sct_auditing_cache.cc | 3 ++- - .../browser/content_browser_client_impl.cc | 2 +- - 49 files changed, 143 insertions(+), 134 deletions(-) - -diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc -index fb5093709a104..6dc223a12343b 100644 ---- a/chrome/app/chrome_main_delegate.cc -+++ b/chrome/app/chrome_main_delegate.cc -@@ -395,14 +395,14 @@ bool HandleCreditsSwitch(const base::CommandLine& command_line) { - bool HandleVersionSwitches(const base::CommandLine& command_line) { - #if !BUILDFLAG(IS_MAC) - if (command_line.HasSwitch(switches::kProductVersion)) { -- printf("%s\n", version_info::GetVersionNumber().c_str()); -+ printf("%s\n", version_info::GetVersionNumber().data()); - return true; - } - #endif - - if (command_line.HasSwitch(switches::kVersion)) { -- printf("%s %s %s\n", version_info::GetProductName().c_str(), -- version_info::GetVersionNumber().c_str(), -+ printf("%s %s %s\n", version_info::GetProductName().data(), -+ version_info::GetVersionNumber().data(), - chrome::GetChannelName(chrome::WithExtendedStable(true)).c_str()); - return true; - } -diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc -index bb3d32d4f4909..27fa9101bf907 100644 ---- a/chrome/browser/chrome_content_browser_client.cc -+++ b/chrome/browser/chrome_content_browser_client.cc -@@ -6878,7 +6878,7 @@ void ChromeContentBrowserClient::LogWebFeatureForCurrentPage( - } - - std::string ChromeContentBrowserClient::GetProduct() { -- return version_info::GetProductNameAndVersionForUserAgent(); -+ return std::string(version_info::GetProductNameAndVersionForUserAgent()); - } - - std::string ChromeContentBrowserClient::GetUserAgent() { -diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc -index 4a550b5bb359e..9645b12daa261 100644 ---- a/chrome/browser/diagnostics/recon_diagnostics.cc -+++ b/chrome/browser/diagnostics/recon_diagnostics.cc -@@ -297,7 +297,7 @@ class VersionTest : public DiagnosticsTest { - VersionTest& operator=(const VersionTest&) = delete; - - bool ExecuteImpl(DiagnosticsModel::Observer* observer) override { -- std::string current_version = version_info::GetVersionNumber(); -+ std::string current_version(version_info::GetVersionNumber()); - if (current_version.empty()) { - RecordFailure(DIAG_RECON_EMPTY_VERSION, "Empty Version"); - return true; -diff --git a/chrome/browser/enterprise/connectors/connectors_service.cc b/chrome/browser/enterprise/connectors/connectors_service.cc -index 500879b6bd86a..8dcb5bfb1f61e 100644 ---- a/chrome/browser/enterprise/connectors/connectors_service.cc -+++ b/chrome/browser/enterprise/connectors/connectors_service.cc -@@ -75,7 +75,8 @@ void PopulateBrowserMetadata(bool include_device_info, - base::FilePath browser_id; - if (base::PathService::Get(base::DIR_EXE, &browser_id)) - browser_proto->set_browser_id(browser_id.AsUTF8Unsafe()); -- browser_proto->set_chrome_version(version_info::GetVersionNumber()); -+ browser_proto->set_chrome_version( -+ std::string(version_info::GetVersionNumber())); - if (include_device_info) - browser_proto->set_machine_user(policy::GetOSUsername()); - } -diff --git a/chrome/browser/enterprise/connectors/reporting/crash_reporting_context.cc b/chrome/browser/enterprise/connectors/reporting/crash_reporting_context.cc -index 683956d9247c8..64a65354d0a82 100644 ---- a/chrome/browser/enterprise/connectors/reporting/crash_reporting_context.cc -+++ b/chrome/browser/enterprise/connectors/reporting/crash_reporting_context.cc -@@ -155,10 +155,10 @@ void UploadToReportingServer( - } - absl::optional settings = - reporting_client->GetReportingSettings(); -- const std::string version = version_info::GetVersionNumber(); -- const std::string channel = -- version_info::GetChannelString(chrome::GetChannel()); -- const std::string platform = version_info::GetOSType(); -+ const std::string version(version_info::GetVersionNumber()); -+ const std::string channel( -+ version_info::GetChannelString(chrome::GetChannel())); -+ const std::string platform(version_info::GetOSType()); - - int64_t latest_creation_time = -1; - -diff --git a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc -index bacad4d847ccb..c1daa5df9f49d 100644 ---- a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc -+++ b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc -@@ -60,11 +60,11 @@ bool IsBrowserSigninAllowed(Profile* profile) { - } - - std::string GetOAuth2MintTokenFlowVersion() { -- return version_info::GetVersionNumber(); -+ return std::string(version_info::GetVersionNumber()); - } - - std::string GetOAuth2MintTokenFlowChannel() { -- return version_info::GetChannelString(chrome::GetChannel()); -+ return std::string(version_info::GetChannelString(chrome::GetChannel())); - } - - void RecordFunctionResult(const IdentityGetAuthTokenError& error, -diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc -index 387ae0036c97d..dd9c9955e35a3 100644 ---- a/chrome/browser/extensions/chrome_extensions_browser_client.cc -+++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc -@@ -382,7 +382,7 @@ bool ChromeExtensionsBrowserClient::DidVersionUpdate( - last_version = base::Version(last_version_str); - } - -- std::string current_version_str = version_info::GetVersionNumber(); -+ std::string current_version_str(version_info::GetVersionNumber()); - const base::Version& current_version = version_info::GetVersion(); - pref_service->SetString(pref_names::kLastChromeVersion, current_version_str); - -diff --git a/chrome/browser/extensions/preinstalled_apps.cc b/chrome/browser/extensions/preinstalled_apps.cc -index a07c7336f1d9b..6dd87394aa15e 100644 ---- a/chrome/browser/extensions/preinstalled_apps.cc -+++ b/chrome/browser/extensions/preinstalled_apps.cc -@@ -89,7 +89,7 @@ void Provider::InitProfileState() { - // Pre-installed apps are only installed on profile creation or a new - // chrome download. - bool is_new_profile = profile_->WasCreatedByVersionOrLater( -- version_info::GetVersionNumber()); -+ std::string(version_info::GetVersionNumber())); - if (is_new_profile && preinstalled_apps_enabled_) { - new_install_state = kAlreadyInstalledPreinstalledApps; - perform_new_installation_ = true; -diff --git a/chrome/browser/media/router/discovery/dial/dial_service_impl.cc b/chrome/browser/media/router/discovery/dial/dial_service_impl.cc -index a66e96b91521d..b5da7be374c5a 100644 ---- a/chrome/browser/media/router/discovery/dial/dial_service_impl.cc -+++ b/chrome/browser/media/router/discovery/dial/dial_service_impl.cc -@@ -8,6 +8,7 @@ - - #include - #include -+#include - #include - #include - -@@ -125,9 +126,9 @@ std::string BuildRequest() { - "USER-AGENT: %s/%s %s\r\n" - "\r\n", - kDialRequestAddress, kDialRequestPort, kDialMaxResponseDelaySecs, -- kDialSearchType, version_info::GetProductName().c_str(), -- version_info::GetVersionNumber().c_str(), -- version_info::GetOSType().c_str())); -+ kDialSearchType, version_info::GetProductName().data(), -+ version_info::GetVersionNumber().data(), -+ version_info::GetOSType().data())); - // 1500 is a good MTU value for most Ethernet LANs. - DCHECK_LE(request.size(), 1500U); - return request; -diff --git a/chrome/browser/media/router/providers/cast/chrome_cast_message_handler.cc b/chrome/browser/media/router/providers/cast/chrome_cast_message_handler.cc -index b24dbb7587b7f..3d53090fe08f0 100644 ---- a/chrome/browser/media/router/providers/cast/chrome_cast_message_handler.cc -+++ b/chrome/browser/media/router/providers/cast/chrome_cast_message_handler.cc -@@ -36,7 +36,8 @@ cast_channel::CastMessageHandler* GetCastMessageHandler() { - new cast_channel::CastMessageHandler( - cast_channel::CastSocketService::GetInstance(), - base::BindRepeating(&ParseJsonFromIoThread), -- embedder_support::GetUserAgent(), version_info::GetVersionNumber(), -+ embedder_support::GetUserAgent(), -+ std::string(version_info::GetVersionNumber()), - g_browser_process->GetApplicationLocale()); - return instance; - } -diff --git a/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc -index 6cd0ba05d5e34..1c20dccce61e4 100644 ---- a/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc -+++ b/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc -@@ -7,6 +7,7 @@ - #include "base/files/file_util.h" - #include "base/functional/bind.h" - #include "base/logging.h" -+#include "base/strings/strcat.h" - #include "base/strings/stringprintf.h" - #include "base/task/sequenced_task_runner.h" - #include "build/build_config.h" -@@ -265,9 +266,9 @@ bool WebRtcEventLogUploaderImpl::PrepareUploadData(std::string* upload_data) { - - net::AddMultipartValueForUpload("prod", kProduct, kBoundary, std::string(), - upload_data); -- net::AddMultipartValueForUpload("ver", -- version_info::GetVersionNumber() + "-webrtc", -- kBoundary, std::string(), upload_data); -+ net::AddMultipartValueForUpload( -+ "ver", base::StrCat({version_info::GetVersionNumber(), "-webrtc"}), -+ kBoundary, std::string(), upload_data); - net::AddMultipartValueForUpload("guid", "0", kBoundary, std::string(), - upload_data); - net::AddMultipartValueForUpload("type", filename, kBoundary, std::string(), -diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc -index fb8757a444f46..9a90da36a9032 100644 ---- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc -+++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc -@@ -377,9 +377,9 @@ void WebRtcLogUploader::SetupMultipart( - #endif - net::AddMultipartValueForUpload("prod", product, kWebrtcLogMultipartBoundary, - "", post_data); -- net::AddMultipartValueForUpload("ver", -- version_info::GetVersionNumber() + "-webrtc", -- kWebrtcLogMultipartBoundary, "", post_data); -+ net::AddMultipartValueForUpload( -+ "ver", base::StrCat({version_info::GetVersionNumber(), "-webrtc"}), -+ kWebrtcLogMultipartBoundary, "", post_data); - net::AddMultipartValueForUpload("guid", "0", kWebrtcLogMultipartBoundary, "", - post_data); - net::AddMultipartValueForUpload("type", "webrtc_log", -diff --git a/chrome/browser/media/webrtc/webrtc_text_log_handler.cc b/chrome/browser/media/webrtc/webrtc_text_log_handler.cc -index 6518ff3718076..b058c94b95966 100644 ---- a/chrome/browser/media/webrtc/webrtc_text_log_handler.cc -+++ b/chrome/browser/media/webrtc/webrtc_text_log_handler.cc -@@ -460,9 +460,9 @@ void WebRtcTextLogHandler::OnGetNetworkInterfaceListFinish( - } - - // Chrome version -- LogToCircularBuffer("Chrome version: " + version_info::GetVersionNumber() + -- " " + -- chrome::GetChannelName(chrome::WithExtendedStable(true))); -+ LogToCircularBuffer( -+ base::StrCat({"Chrome version: ", version_info::GetVersionNumber(), " ", -+ chrome::GetChannelName(chrome::WithExtendedStable(true))})); - - // OS - LogToCircularBuffer(base::SysInfo::OperatingSystemName() + " " + -diff --git a/chrome/browser/permissions/chrome_permissions_client.cc b/chrome/browser/permissions/chrome_permissions_client.cc -index dfc443d307d52..dece5822d8899 100644 ---- a/chrome/browser/permissions/chrome_permissions_client.cc -+++ b/chrome/browser/permissions/chrome_permissions_client.cc -@@ -275,7 +275,8 @@ void ChromePermissionsClient::TriggerPromptHatsSurveyIfEnabled( - auto prompt_parameters = - permissions::PermissionHatsTriggerHelper::PromptParametersForHaTS( - request_type, action, prompt_disposition, prompt_disposition_reason, -- gesture_type, version_info::GetChannelString(chrome::GetChannel()), -+ gesture_type, -+ std::string(version_info::GetChannelString(chrome::GetChannel())), - is_post_prompt ? permissions::kOnPromptResolved - : permissions::kOnPromptAppearing, - prompt_display_duration, -diff --git a/chrome/browser/policy/device_management_service_configuration.cc b/chrome/browser/policy/device_management_service_configuration.cc -index 080471119008d..c231ed8728d2c 100644 ---- a/chrome/browser/policy/device_management_service_configuration.cc -+++ b/chrome/browser/policy/device_management_service_configuration.cc -@@ -7,6 +7,7 @@ - #include - - #include "base/logging.h" -+#include "base/strings/strcat.h" - #include "base/strings/stringprintf.h" - #include "base/system/sys_info.h" - #include "build/build_config.h" -@@ -44,10 +45,9 @@ std::string DeviceManagementServiceConfiguration::GetDMServerUrl() const { - } - - std::string DeviceManagementServiceConfiguration::GetAgentParameter() const { -- return base::StringPrintf("%s %s(%s)", -- version_info::GetProductName().c_str(), -- version_info::GetVersionNumber().c_str(), -- version_info::GetLastChange().c_str()); -+ return base::StrCat({version_info::GetProductName(), " ", -+ version_info::GetVersionNumber(), "(", -+ version_info::GetLastChange(), ")"}); - } - - std::string DeviceManagementServiceConfiguration::GetPlatformParameter() const { -diff --git a/chrome/browser/profile_resetter/resettable_settings_snapshot.cc b/chrome/browser/profile_resetter/resettable_settings_snapshot.cc -index 0a225309f715e..1a1974e828ab2 100644 ---- a/chrome/browser/profile_resetter/resettable_settings_snapshot.cc -+++ b/chrome/browser/profile_resetter/resettable_settings_snapshot.cc -@@ -244,7 +244,7 @@ base::Value::List GetReadableFeedbackForSnapshot( - g_browser_process->GetApplicationLocale()); - AddPair(list, l10n_util::GetStringUTF16(IDS_VERSION_UI_USER_AGENT), - embedder_support::GetUserAgent()); -- std::string version = version_info::GetVersionNumber(); -+ std::string version(version_info::GetVersionNumber()); - version += chrome::GetChannelName(chrome::WithExtendedStable(true)); - AddPair(list, - l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), -diff --git a/chrome/browser/profiles/chrome_version_service.cc b/chrome/browser/profiles/chrome_version_service.cc -index bf99f5497b9c1..8cd580696e377 100644 ---- a/chrome/browser/profiles/chrome_version_service.cc -+++ b/chrome/browser/profiles/chrome_version_service.cc -@@ -33,7 +33,7 @@ void ChromeVersionService::OnProfileLoaded(PrefService* prefs, - // If this is a new profile set version to current version, otherwise - // (pre-existing profile), leave pref at default value (1.0.0.0) to - // avoid any first-run behavior. -- std::string version = version_info::GetVersionNumber(); -+ std::string version(version_info::GetVersionNumber()); - if (prefs->FindPreference(prefs::kProfileCreatedByVersion)-> - IsDefaultValue() && is_new_profile) { - SetVersion(prefs, version); -diff --git a/chrome/browser/search_engines/ui_thread_search_terms_data.cc b/chrome/browser/search_engines/ui_thread_search_terms_data.cc -index 1344991617b24..70b25716d417f 100644 ---- a/chrome/browser/search_engines/ui_thread_search_terms_data.cc -+++ b/chrome/browser/search_engines/ui_thread_search_terms_data.cc -@@ -6,6 +6,7 @@ - - #include "base/check.h" - #include "base/metrics/field_trial.h" -+#include "base/strings/strcat.h" - #include "build/build_config.h" - #include "chrome/browser/browser_process.h" - #include "chrome/browser/google/google_brand.h" -@@ -122,17 +123,14 @@ std::string UIThreadSearchTermsData::GetSuggestRequestIdentifier( - // in UIThreadSearchTermsData since SearchTermsData cannot depend on src/chrome - // as it is shared with iOS. - std::string UIThreadSearchTermsData::GoogleImageSearchSource() const { -- std::string version(version_info::GetProductName() + " " + -- version_info::GetVersionNumber()); -- if (version_info::IsOfficialBuild()) -- version += " (Official)"; -- version += " " + version_info::GetOSType(); - // Do not distinguish extended from regular stable in image search queries. -- std::string modifier( -- chrome::GetChannelName(chrome::WithExtendedStable(false))); -- if (!modifier.empty()) -- version += " " + modifier; -- return version; -+ const std::string channel_name = -+ chrome::GetChannelName(chrome::WithExtendedStable(false)); -+ return base::StrCat({version_info::GetProductName(), " ", -+ version_info::GetVersionNumber(), -+ version_info::IsOfficialBuild() ? " (Official) " : " ", -+ version_info::GetOSType(), -+ channel_name.empty() ? "" : " ", channel_name}); - } - - size_t UIThreadSearchTermsData::EstimateMemoryUsage() const { -diff --git a/chrome/browser/ui/autofill/risk_util.cc b/chrome/browser/ui/autofill/risk_util.cc -index a772a22385df4..fdbc2fafc40e7 100644 ---- a/chrome/browser/ui/autofill/risk_util.cc -+++ b/chrome/browser/ui/autofill/risk_util.cc -@@ -5,6 +5,7 @@ - #include "chrome/browser/ui/autofill/risk_util.h" - - #include -+#include - - #include "base/base64.h" - #include "base/functional/bind.h" -@@ -101,7 +102,7 @@ void LoadRiskDataHelper(uint64_t obfuscated_gaia_id, - - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - risk::GetFingerprint(obfuscated_gaia_id, window_bounds, web_contents, -- version_info::GetVersionNumber(), charset, -+ std::string(version_info::GetVersionNumber()), charset, - accept_languages, install_time, - g_browser_process->GetApplicationLocale(), - embedder_support::GetUserAgent(), -diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc -index 5870c877f2e96..43274738f4f9c 100644 ---- a/chrome/browser/ui/views/chrome_views_delegate.cc -+++ b/chrome/browser/ui/views/chrome_views_delegate.cc -@@ -210,5 +210,5 @@ void ChromeViewsDelegate::OnBeforeWidgetInit( - } - - std::string ChromeViewsDelegate::GetApplicationName() { -- return version_info::GetProductName(); -+ return std::string(version_info::GetProductName()); - } -diff --git a/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.cc b/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.cc -index 8eba9396ffffc..bf676bc54ebc3 100644 ---- a/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.cc -+++ b/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.cc -@@ -37,13 +37,15 @@ void CreateAndAddInternalsHTMLSource(Profile* profile, - IDR_AUTOFILL_AND_PASSWORD_MANAGER_INTERNALS_JS); - source->SetDefaultResource(IDR_AUTOFILL_AND_PASSWORD_MANAGER_INTERNALS_HTML); - // Data strings: -- source->AddString(version_ui::kVersion, version_info::GetVersionNumber()); -+ source->AddString(version_ui::kVersion, -+ std::string(version_info::GetVersionNumber())); - source->AddString(version_ui::kOfficial, version_info::IsOfficialBuild() - ? "official" - : "Developer build"); - source->AddString(version_ui::kVersionModifier, - chrome::GetChannelName(chrome::WithExtendedStable(true))); -- source->AddString(version_ui::kCL, version_info::GetLastChange()); -+ source->AddString(version_ui::kCL, -+ std::string(version_info::GetLastChange())); - source->AddString(version_ui::kUserAgent, embedder_support::GetUserAgent()); - source->AddString("app_locale", g_browser_process->GetApplicationLocale()); - } -diff --git a/chrome/browser/ui/webui/flags/flags_ui.cc b/chrome/browser/ui/webui/flags/flags_ui.cc -index a273e235526b2..bc0318f76f45e 100644 ---- a/chrome/browser/ui/webui/flags/flags_ui.cc -+++ b/chrome/browser/ui/webui/flags/flags_ui.cc -@@ -70,7 +70,8 @@ content::WebUIDataSource* CreateAndAddFlagsUIHTMLSource(Profile* profile) { - source->OverrideContentSecurityPolicy( - network::mojom::CSPDirectiveName::TrustedTypes, - "trusted-types jstemplate;"); -- source->AddString(flags_ui::kVersion, version_info::GetVersionNumber()); -+ source->AddString(flags_ui::kVersion, -+ std::string(version_info::GetVersionNumber())); - - #if BUILDFLAG(IS_CHROMEOS_ASH) - if (!user_manager::UserManager::Get()->IsCurrentUserOwner() && -diff --git a/chrome/browser/ui/webui/nacl_ui.cc b/chrome/browser/ui/webui/nacl_ui.cc -index ea8b7cab2de20..8ead8dbf6fed5 100644 ---- a/chrome/browser/ui/webui/nacl_ui.cc -+++ b/chrome/browser/ui/webui/nacl_ui.cc -@@ -19,6 +19,7 @@ - #include "base/memory/weak_ptr.h" - #include "base/metrics/user_metrics.h" - #include "base/path_service.h" -+#include "base/strings/strcat.h" - #include "base/strings/string_number_conversions.h" - #include "base/strings/utf_string_conversions.h" - #include "base/task/thread_pool.h" -@@ -187,15 +188,16 @@ bool NaClDomHandler::isPluginEnabled(size_t plugin_index) { - - void NaClDomHandler::AddOperatingSystemInfo(base::Value::List* list) { - // Obtain the Chrome version info. -- AddPair(list, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), -- ASCIIToUTF16( -- version_info::GetVersionNumber() + " (" + -- chrome::GetChannelName(chrome::WithExtendedStable(true)) + ")")); -+ AddPair( -+ list, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), -+ ASCIIToUTF16(base::StrCat( -+ {version_info::GetVersionNumber(), " (", -+ chrome::GetChannelName(chrome::WithExtendedStable(true)), ")"}))); - - // OS version information. - // TODO(jvoung): refactor this to share the extra windows labeling - // with about:flash, or something. -- std::string os_label = version_info::GetOSType(); -+ std::string os_label(version_info::GetOSType()); - #if BUILDFLAG(IS_WIN) - base::win::OSInfo* os = base::win::OSInfo::GetInstance(); - switch (os->version()) { -diff --git a/chrome/browser/ui/webui/version/version_ui.cc b/chrome/browser/ui/webui/version/version_ui.cc -index 7ca8498bc5069..d61e2354ff0ca 100644 ---- a/chrome/browser/ui/webui/version/version_ui.cc -+++ b/chrome/browser/ui/webui/version/version_ui.cc -@@ -223,7 +223,7 @@ void VersionUI::AddVersionDetailStrings(content::WebUIDataSource* html_source) { - - // Data strings. - html_source->AddString(version_ui::kVersion, -- version_info::GetVersionNumber()); -+ std::string(version_info::GetVersionNumber())); - - html_source->AddString(version_ui::kVersionModifier, GetProductModifier()); - -@@ -239,7 +239,8 @@ void VersionUI::AddVersionDetailStrings(content::WebUIDataSource* html_source) { - base::i18n::MessageFormatter::FormatWithNumberedArgs( - l10n_util::GetStringUTF16(IDS_ABOUT_VERSION_COPYRIGHT), - base::Time::Now())); -- html_source->AddString(version_ui::kCL, version_info::GetLastChange()); -+ html_source->AddString(version_ui::kCL, -+ std::string(version_info::GetLastChange())); - html_source->AddString(version_ui::kUserAgent, - embedder_support::GetUserAgent()); - // Note that the executable path and profile path are retrieved asynchronously -@@ -251,7 +252,8 @@ void VersionUI::AddVersionDetailStrings(content::WebUIDataSource* html_source) { - #if BUILDFLAG(IS_MAC) - html_source->AddString(version_ui::kOSType, base::mac::GetOSDisplayName()); - #elif !BUILDFLAG(IS_CHROMEOS_ASH) -- html_source->AddString(version_ui::kOSType, version_info::GetOSType()); -+ html_source->AddString(version_ui::kOSType, -+ std::string(version_info::GetOSType())); - #endif // BUILDFLAG(IS_MAC) - - #if BUILDFLAG(IS_ANDROID) -@@ -307,7 +309,7 @@ void VersionUI::AddVersionDetailStrings(content::WebUIDataSource* html_source) { - : std::string()); - - html_source->AddString(version_ui::kSanitizer, -- version_info::GetSanitizerList()); -+ std::string(version_info::GetSanitizerList())); - } - - #if !BUILDFLAG(IS_ANDROID) -diff --git a/chrome/browser/update_client/chrome_update_query_params_delegate.cc b/chrome/browser/update_client/chrome_update_query_params_delegate.cc -index 4f48863a6753c..3947ede3ee028 100644 ---- a/chrome/browser/update_client/chrome_update_query_params_delegate.cc -+++ b/chrome/browser/update_client/chrome_update_query_params_delegate.cc -@@ -5,7 +5,7 @@ - #include "chrome/browser/update_client/chrome_update_query_params_delegate.h" - - #include "base/lazy_instance.h" --#include "base/strings/stringprintf.h" -+#include "base/strings/strcat.h" - #include "chrome/browser/browser_process.h" - #include "chrome/common/channel_info.h" - #include "components/version_info/version_info.h" -@@ -30,10 +30,10 @@ ChromeUpdateQueryParamsDelegate::GetInstance() { - } - - std::string ChromeUpdateQueryParamsDelegate::GetExtraParams() { -- return base::StringPrintf( -- "&prodchannel=%s&prodversion=%s&lang=%s", -- chrome::GetChannelName(chrome::WithExtendedStable(true)).c_str(), -- version_info::GetVersionNumber().c_str(), GetLang()); -+ return base::StrCat({"&prodchannel=", -+ chrome::GetChannelName(chrome::WithExtendedStable(true)), -+ "&prodversion=", version_info::GetVersionNumber(), -+ "&lang=", GetLang()}); - } - - // static -diff --git a/chrome/updater/configurator.cc b/chrome/updater/configurator.cc -index 69f1510b39dc3..4b0c45f6c8c3e 100644 ---- a/chrome/updater/configurator.cc -+++ b/chrome/updater/configurator.cc -@@ -129,7 +129,7 @@ std::string Configurator::GetLang() const { - } - - std::string Configurator::GetOSLongName() const { -- return version_info::GetOSType(); -+ return std::string(version_info::GetOSType()); - } - - base::flat_map Configurator::ExtraRequestParams() -diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc -index 6a7f5e9b8865e..407bff1e57eb3 100644 ---- a/components/autofill/core/browser/form_structure.cc -+++ b/components/autofill/core/browser/form_structure.cc -@@ -5,12 +5,12 @@ - #include "components/autofill/core/browser/form_structure.h" - - #include --#include - - #include - #include - #include - #include -+#include - #include - #include - #include -@@ -414,7 +414,7 @@ std::vector FormStructure::EncodeUploadRequest( - AutofillUploadContents upload; - upload.set_submission(observed_submission); - upload.set_client_version( -- version_info::GetProductNameAndVersionForUserAgent()); -+ std::string(version_info::GetProductNameAndVersionForUserAgent())); - upload.set_form_signature(form_signature().value()); - upload.set_autofill_used(form_was_autofilled); - upload.set_data_present(data_present); -@@ -500,7 +500,7 @@ std::vector FormStructure::EncodeUploadRequest( - base::flat_map(std::move(subforms))) { - uploads.emplace_back(); - uploads.back().set_client_version( -- version_info::GetProductNameAndVersionForUserAgent()); -+ std::string(version_info::GetProductNameAndVersionForUserAgent())); - uploads.back().set_form_signature(subform_signature.value()); - uploads.back().set_autofill_used(form_was_autofilled); - uploads.back().set_data_present(data_present); -@@ -521,7 +521,7 @@ bool FormStructure::EncodeQueryRequest( - queried_form_signatures->reserve(forms.size()); - - query->set_client_version( -- version_info::GetProductNameAndVersionForUserAgent()); -+ std::string(version_info::GetProductNameAndVersionForUserAgent())); - - // If a page contains repeated forms, detect that and encode only one form as - // the returned data would be the same for all the repeated forms. -diff --git a/components/component_updater/configurator_impl.cc b/components/component_updater/configurator_impl.cc -index 034d38bf42880..f3f29ea4e51d9 100644 ---- a/components/component_updater/configurator_impl.cc -+++ b/components/component_updater/configurator_impl.cc -@@ -89,7 +89,7 @@ const base::Version& ConfiguratorImpl::GetBrowserVersion() const { - } - - std::string ConfiguratorImpl::GetOSLongName() const { -- return version_info::GetOSType(); -+ return std::string(version_info::GetOSType()); - } - - base::flat_map ConfiguratorImpl::ExtraRequestParams() -diff --git a/components/embedder_support/user_agent_utils.cc b/components/embedder_support/user_agent_utils.cc -index 86e97af7108a5..bc80603199c57 100644 ---- a/components/embedder_support/user_agent_utils.cc -+++ b/components/embedder_support/user_agent_utils.cc -@@ -4,6 +4,7 @@ - - #include "components/embedder_support/user_agent_utils.h" - -+#include - #include - - #include "base/command_line.h" -@@ -230,11 +231,9 @@ const std::string& GetReducedMajorInMinorVersionNumber() { - - std::string GetVersionNumber(const UserAgentOptions& options) { - // Force major version to 99. -- if (ShouldForceMajorVersionToMinorPosition(options.force_major_to_minor)) -- return GetMajorInMinorVersionNumber(); -- -- const std::string& version_str = version_info::GetVersionNumber(); -- return version_str; -+ return ShouldForceMajorVersionToMinorPosition(options.force_major_to_minor) -+ ? GetMajorInMinorVersionNumber() -+ : std::string(version_info::GetVersionNumber()); - } - - const blink::UserAgentBrandList GetUserAgentBrandList( -@@ -275,7 +274,7 @@ const blink::UserAgentBrandList GetUserAgentBrandMajorVersionList( - bool enable_updated_grease_by_policy) { - return GetUserAgentBrandList(version_info::GetMajorVersionNumber(), - enable_updated_grease_by_policy, -- version_info::GetVersionNumber(), -+ std::string(version_info::GetVersionNumber()), - blink::UserAgentBrandVersionType::kMajorVersion); - } - -@@ -293,7 +292,7 @@ blink::UserAgentBrandList GetUserAgentBrandFullVersionList( - bool enable_updated_grease_by_policy) { - return GetUserAgentBrandList(version_info::GetMajorVersionNumber(), - enable_updated_grease_by_policy, -- version_info::GetVersionNumber(), -+ std::string(version_info::GetVersionNumber()), - blink::UserAgentBrandVersionType::kFullVersion); - } - -@@ -363,7 +362,7 @@ std::string GetProductAndVersion( - return version_info::GetProductNameAndVersionForReducedUserAgent( - blink::features::kUserAgentFrozenBuildVersion.Get().data()); - } else { -- return version_info::GetProductNameAndVersionForUserAgent(); -+ return std::string(version_info::GetProductNameAndVersionForUserAgent()); - } - } - } -@@ -584,7 +583,7 @@ std::string GetPlatformForUAMetadata() { - return "Chromium OS"; - # endif - #else -- return version_info::GetOSType(); -+ return std::string(version_info::GetOSType()); - #endif - } - -diff --git a/components/enterprise/browser/reporting/browser_report_generator.cc b/components/enterprise/browser/reporting/browser_report_generator.cc -index 5bcd4ff1cecac..e928f9250ed74 100644 ---- a/components/enterprise/browser/reporting/browser_report_generator.cc -+++ b/components/enterprise/browser/reporting/browser_report_generator.cc -@@ -57,7 +57,7 @@ void BrowserReportGenerator::GenerateBasicInfo(em::BrowserReport* report, - #endif // BUILDFLAG(IS_CHROMEOS_ASH) - - if (contains_version_and_channel) { -- report->set_browser_version(version_info::GetVersionNumber()); -+ report->set_browser_version(std::string(version_info::GetVersionNumber())); - report->set_channel(policy::ConvertToProtoChannel(delegate_->GetChannel())); - if (delegate_->IsExtendedStableChannel()) - report->set_is_extended_stable_channel(true); -diff --git a/components/gcm_driver/gcm_desktop_utils.cc b/components/gcm_driver/gcm_desktop_utils.cc -index 1ebdd54e980ea..be2b26c56c200 100644 ---- a/components/gcm_driver/gcm_desktop_utils.cc -+++ b/components/gcm_driver/gcm_desktop_utils.cc -@@ -57,7 +57,7 @@ GCMClient::ChromeChannel GetChannel(version_info::Channel channel) { - } - - std::string GetVersion() { -- return version_info::GetVersionNumber(); -+ return std::string(version_info::GetVersionNumber()); - } - - GCMClient::ChromeBuildInfo GetChromeBuildInfo( -diff --git a/components/metrics/version_utils.cc b/components/metrics/version_utils.cc -index bc4e987bc5b89..34e80a60024c6 100644 ---- a/components/metrics/version_utils.cc -+++ b/components/metrics/version_utils.cc -@@ -16,7 +16,7 @@ - namespace metrics { - - std::string GetVersionString() { -- std::string version = version_info::GetVersionNumber(); -+ std::string version(version_info::GetVersionNumber()); - #if defined(ARCH_CPU_64_BITS) - version += "-64"; - #endif // defined(ARCH_CPU_64_BITS) -diff --git a/components/minidump_uploader/rewrite_minidumps_as_mimes.cc b/components/minidump_uploader/rewrite_minidumps_as_mimes.cc -index d749d12592e67..2cb275e275705 100644 ---- a/components/minidump_uploader/rewrite_minidumps_as_mimes.cc -+++ b/components/minidump_uploader/rewrite_minidumps_as_mimes.cc -@@ -230,9 +230,8 @@ static void WriteAnrAsMime(crashpad::FileReader* anr_reader, - crashpad::HTTPMultipartBuilder builder; - builder.SetFormData("version", version_number); - builder.SetFormData("product", "Chrome_Android"); -- std::string channel = -- version_info::GetChannelString(version_info::android::GetChannel()); -- builder.SetFormData("channel", channel); -+ builder.SetFormData("channel", std::string(version_info::GetChannelString( -+ version_info::android::GetChannel()))); - if (!build_id.empty()) { - builder.SetFormData("elf_build_id", build_id); - } -diff --git a/components/policy/core/browser/webui/json_generation.cc b/components/policy/core/browser/webui/json_generation.cc -index 377052510eb02..2710214cb3cf3 100644 ---- a/components/policy/core/browser/webui/json_generation.cc -+++ b/components/policy/core/browser/webui/json_generation.cc -@@ -7,7 +7,7 @@ - #include - - #include "base/json/json_writer.h" --#include "base/strings/stringprintf.h" -+#include "base/strings/strcat.h" - #include "base/values.h" - #include "components/policy/core/browser/policy_conversions.h" - #include "components/policy/core/browser/policy_conversions_client.h" -@@ -44,15 +44,13 @@ base::Value::Dict GetChromeMetadataValue(const JsonGenerationParams& params) { - base::Value::Dict chrome_metadata; - chrome_metadata.Set("application", params.application_name); - -- std::string version = base::StringPrintf( -- "%s (%s)%s %s%s", version_info::GetVersionNumber().c_str(), -- l10n_util::GetStringUTF8(version_info::IsOfficialBuild() -- ? IDS_VERSION_UI_OFFICIAL -- : IDS_VERSION_UI_UNOFFICIAL) -- .c_str(), -- (params.channel_name.empty() ? "" : " " + params.channel_name).c_str(), -- params.processor_variation.c_str(), -- params.cohort_name ? params.cohort_name->c_str() : ""); -+ std::string version = base::StrCat( -+ {version_info::GetVersionNumber(), " (", -+ l10n_util::GetStringUTF8(version_info::IsOfficialBuild() -+ ? IDS_VERSION_UI_OFFICIAL -+ : IDS_VERSION_UI_UNOFFICIAL), -+ ") ", params.channel_name, params.channel_name.empty() ? "" : " ", -+ params.processor_variation, params.cohort_name.value_or(std::string())}); - - chrome_metadata.Set(kChromeMetadataVersionKey, version); - -diff --git a/components/policy/core/common/cloud/cloud_policy_util.cc b/components/policy/core/common/cloud/cloud_policy_util.cc -index ee21a43cdf496..cacdf1018858c 100644 ---- a/components/policy/core/common/cloud/cloud_policy_util.cc -+++ b/components/policy/core/common/cloud/cloud_policy_util.cc -@@ -155,7 +155,7 @@ std::string GetOSVersion() { - } - - std::string GetOSPlatform() { -- return version_info::GetOSType(); -+ return std::string(version_info::GetOSType()); - } - - std::string GetOSArchitecture() { -diff --git a/components/policy/core/common/policy_logger.cc b/components/policy/core/common/policy_logger.cc -index 1b45e8bea7206..db32aa3b77f14 100644 ---- a/components/policy/core/common/policy_logger.cc -+++ b/components/policy/core/common/policy_logger.cc -@@ -60,7 +60,7 @@ std::string GetLogSeverity(const PolicyLogger::Log::Severity log_severity) { - // Constructs the URL for Chromium Code Search that points to the line of code - // that generated the log and the Chromium git revision hash. - std::string GetLineURL(const base::Location location) { -- std::string last_change = version_info::GetLastChange(); -+ std::string last_change(version_info::GetLastChange()); - - // The substring separates the last change commit hash from the branch name on - // the '-'. -diff --git a/components/quirks/quirks_client.cc b/components/quirks/quirks_client.cc -index 9f9d04b63c178..afab6b6653646 100644 ---- a/components/quirks/quirks_client.cc -+++ b/components/quirks/quirks_client.cc -@@ -72,7 +72,7 @@ void QuirksClient::StartDownload() { - DCHECK(thread_checker_.CalledOnValidThread()); - - // URL of icc file on Quirks Server. -- int major_version = atoi(version_info::GetVersionNumber().c_str()); -+ int major_version = version_info::GetMajorVersionNumberAsInt(); - std::string url = base::StringPrintf( - kQuirksUrlFormat, IdToHexString(product_id_).c_str(), major_version); - -diff --git a/components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc b/components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc -index 090ec1fec4816..09c3f259e720f 100644 ---- a/components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc -+++ b/components/safe_browsing/core/browser/db/v4_protocol_manager_util.cc -@@ -81,7 +81,7 @@ V4ProtocolConfig GetV4ProtocolConfig(const std::string& client_name, - bool disable_auto_update) { - return V4ProtocolConfig(client_name, disable_auto_update, - google_apis::GetAPIKey(), -- version_info::GetVersionNumber()); -+ std::string(version_info::GetVersionNumber())); - } - - void SetSbV4UrlPrefixForTesting(const char* url_prefix) { -diff --git a/components/safe_browsing/core/browser/user_population.cc b/components/safe_browsing/core/browser/user_population.cc -index c6ad200c10d22..2cf3c8a0fc2e2 100644 ---- a/components/safe_browsing/core/browser/user_population.cc -+++ b/components/safe_browsing/core/browser/user_population.cc -@@ -5,6 +5,7 @@ - #include "components/safe_browsing/core/browser/user_population.h" - - #include "base/feature_list.h" -+#include "base/strings/strcat.h" - #include "components/prefs/pref_service.h" - #include "components/safe_browsing/core/common/features.h" - #include "components/safe_browsing/core/common/safe_browsing_prefs.h" -@@ -57,8 +58,8 @@ ChromeUserPopulation GetUserPopulation( - GetProfileManagementStatus(browser_policy_connector)); - - std::string user_agent = -- version_info::GetProductNameAndVersionForUserAgent() + "/" + -- version_info::GetOSType(); -+ base::StrCat({version_info::GetProductNameAndVersionForUserAgent(), "/", -+ version_info::GetOSType()}); - population.set_user_agent(user_agent); - - if (num_profiles) -diff --git a/components/security_interstitials/content/certificate_error_report.cc b/components/security_interstitials/content/certificate_error_report.cc -index 5afe25e6042e8..b09db9ffa8576 100644 ---- a/components/security_interstitials/content/certificate_error_report.cc -+++ b/components/security_interstitials/content/certificate_error_report.cc -@@ -486,8 +486,9 @@ CertificateErrorReport::CertificateErrorReport( - chrome_browser_ssl::CertLoggerFeaturesInfo::ANDROID_AIA_FETCHING_ENABLED); - #endif - -- cert_report_->set_chrome_version(version_info::GetVersionNumber()); -- cert_report_->set_os_type(version_info::GetOSType()); -+ cert_report_->set_chrome_version( -+ std::string(version_info::GetVersionNumber())); -+ cert_report_->set_os_type(std::string(version_info::GetOSType())); - cert_report_->set_os_version(base::SysInfo::OperatingSystemVersion()); - cert_report_->set_hardware_model_name(base::SysInfo::HardwareModelName()); - cert_report_->set_os_architecture( -diff --git a/components/sync/base/sync_util.cc b/components/sync/base/sync_util.cc -index d3ba4ce081994..e636023e3b19e 100644 ---- a/components/sync/base/sync_util.cc -+++ b/components/sync/base/sync_util.cc -@@ -6,6 +6,7 @@ - - #include "base/command_line.h" - #include "base/logging.h" -+#include "base/strings/strcat.h" - #include "base/strings/stringize_macros.h" - #include "build/build_config.h" - #include "build/chromeos_buildflags.h" -@@ -54,18 +55,14 @@ namespace internal { - - std::string FormatUserAgentForSync(const std::string& system, - version_info::Channel channel) { -- std::string product = STRINGIZE(SYNC_USER_AGENT_PRODUCT); -- std::string user_agent; -- user_agent = product + " "; -- user_agent += system; -- user_agent += version_info::GetVersionNumber(); -- user_agent += " (" + version_info::GetLastChange() + ")"; -- if (!version_info::IsOfficialBuild()) { -- user_agent += "-devel"; -- } else { -- user_agent += " channel(" + version_info::GetChannelString(channel) + ")"; -- } -- return user_agent; -+ constexpr base::StringPiece kProduct = STRINGIZE(SYNC_USER_AGENT_PRODUCT); -+ return base::StrCat( -+ {kProduct, " ", system, version_info::GetVersionNumber(), " (", -+ version_info::GetLastChange(), ")", -+ version_info::IsOfficialBuild() -+ ? base::StrCat( -+ {" channel(", version_info::GetChannelString(channel), ")"}) -+ : std::string("-devel")}); - } - - } // namespace internal -diff --git a/components/sync/driver/sync_internals_util.cc b/components/sync/driver/sync_internals_util.cc -index c361524feb764..7d4b0206c49b2 100644 ---- a/components/sync/driver/sync_internals_util.cc -+++ b/components/sync/driver/sync_internals_util.cc -@@ -10,6 +10,7 @@ - - #include "base/i18n/time_formatting.h" - #include "base/notreached.h" -+#include "base/strings/strcat.h" - #include "base/strings/string_util.h" - #include "base/strings/stringprintf.h" - #include "base/strings/utf_string_conversions.h" -@@ -225,9 +226,10 @@ std::string GetVersionString(const std::string& channel) { - } else { - version_modifier = " " + version_modifier; - } -- return version_info::GetProductName() + " " + version_info::GetOSType() + -- " " + version_info::GetVersionNumber() + " (" + -- version_info::GetLastChange() + ")" + version_modifier; -+ return base::StrCat({version_info::GetProductName(), " ", -+ version_info::GetOSType(), " ", -+ version_info::GetVersionNumber(), " (", -+ version_info::GetLastChange(), ")", version_modifier}); - } - - std::string GetTimeStr(base::Time time, -diff --git a/components/update_client/update_query_params.cc b/components/update_client/update_query_params.cc -index a427158fc5a06..e52d9e7736093 100644 ---- a/components/update_client/update_query_params.cc -+++ b/components/update_client/update_query_params.cc -@@ -158,7 +158,7 @@ const char* UpdateQueryParams::GetNaclArch() { - - // static - std::string UpdateQueryParams::GetProdVersion() { -- return version_info::GetVersionNumber(); -+ return std::string(version_info::GetVersionNumber()); - } - - // static -diff --git a/components/version_info/version_info.cc b/components/version_info/version_info.cc -index 9b1f5e4478f53..081f81fefef76 100644 ---- a/components/version_info/version_info.cc -+++ b/components/version_info/version_info.cc -@@ -15,10 +15,8 @@ namespace version_info { - - const std::string GetProductNameAndVersionForReducedUserAgent( - const std::string& build_version) { -- std::string product_and_version; -- base::StrAppend(&product_and_version, {"Chrome/", GetMajorVersionNumber(), -- ".0.", build_version, ".0"}); -- return product_and_version; -+ return base::StrCat( -+ {"Chrome/", GetMajorVersionNumber(), ".0.", build_version, ".0"}); - } - - int GetMajorVersionNumberAsInt() { -diff --git a/components/version_info/version_info.h b/components/version_info/version_info.h -index ffa554eed7598..d50aff41e993e 100644 ---- a/components/version_info/version_info.h -+++ b/components/version_info/version_info.h -@@ -9,6 +9,7 @@ - - #include "base/notreached.h" - #include "base/sanitizer_buildflags.h" -+#include "base/strings/string_piece.h" - #include "build/branding_buildflags.h" - #include "build/build_config.h" - #include "components/version_info/channel.h" -@@ -27,19 +28,19 @@ const std::string GetProductNameAndVersionForReducedUserAgent( - const std::string& build_version); - - // Returns the product name, e.g. "Chromium" or "Google Chrome". --constexpr std::string GetProductName() { -+constexpr base::StringPiece GetProductName() { - return PRODUCT_NAME; - } - - // Returns the version number, e.g. "6.0.490.1". --constexpr std::string GetVersionNumber() { -+constexpr base::StringPiece GetVersionNumber() { - return PRODUCT_VERSION; - } - - // Returns the product name and version information for the User-Agent header, - // in the format: Chrome/.... --constexpr std::string GetProductNameAndVersionForUserAgent() { -- return "Chrome/" + GetVersionNumber(); -+constexpr base::StringPiece GetProductNameAndVersionForUserAgent() { -+ return "Chrome/" PRODUCT_VERSION; - } - - // Returns the major component (aka the milestone) of the version as an int, -@@ -53,7 +54,7 @@ std::string GetMajorVersionNumber(); - const base::Version& GetVersion(); - - // Returns a version control specific identifier of this release. --constexpr std::string GetLastChange() { -+constexpr base::StringPiece GetLastChange() { - return LAST_CHANGE; - } - -@@ -65,7 +66,7 @@ constexpr bool IsOfficialBuild() { - } - - // Returns the OS type, e.g. "Windows", "Linux", "FreeBSD", ... --constexpr std::string GetOSType() { -+constexpr base::StringPiece GetOSType() { - #if BUILDFLAG(IS_WIN) - return "Windows"; - #elif BUILDFLAG(IS_IOS) -@@ -97,7 +98,7 @@ constexpr std::string GetOSType() { - - // Returns a string equivalent of |channel|, independent of whether the build - // is branded or not and without any additional modifiers. --constexpr std::string GetChannelString(Channel channel) { -+constexpr base::StringPiece GetChannelString(Channel channel) { - switch (channel) { - case Channel::STABLE: - return "stable"; -@@ -114,7 +115,7 @@ constexpr std::string GetChannelString(Channel channel) { - } - - // Returns a list of sanitizers enabled in this build. --constexpr std::string GetSanitizerList() { -+constexpr base::StringPiece GetSanitizerList() { - return "" - #if defined(ADDRESS_SANITIZER) - "address " -diff --git a/components/webapps/browser/android/webapk/webapk_proto_builder.cc b/components/webapps/browser/android/webapk/webapk_proto_builder.cc -index 85d4a703f4435..977a624e97640 100644 ---- a/components/webapps/browser/android/webapk/webapk_proto_builder.cc -+++ b/components/webapps/browser/android/webapk/webapk_proto_builder.cc -@@ -107,7 +107,8 @@ std::unique_ptr BuildProtoInBackground( - webapk->set_manifest_url(shortcut_info.manifest_url.spec()); - webapk->set_requester_application_package( - base::android::BuildInfo::GetInstance()->package_name()); -- webapk->set_requester_application_version(version_info::GetVersionNumber()); -+ webapk->set_requester_application_version( -+ std::string(version_info::GetVersionNumber())); - webapk->set_android_abi(getCurrentAbi()); - webapk->set_package_name(package_name); - webapk->set_version(version); -diff --git a/extensions/shell/browser/shell_extensions_browser_client.cc b/extensions/shell/browser/shell_extensions_browser_client.cc -index 7fcd1199efd8d..5583a00e864f5 100644 ---- a/extensions/shell/browser/shell_extensions_browser_client.cc -+++ b/extensions/shell/browser/shell_extensions_browser_client.cc -@@ -321,7 +321,7 @@ std::string ShellExtensionsBrowserClient::GetApplicationLocale() { - - std::string ShellExtensionsBrowserClient::GetUserAgent() const { - return content::BuildUserAgentFromProduct( -- version_info::GetProductNameAndVersionForUserAgent()); -+ std::string(version_info::GetProductNameAndVersionForUserAgent())); - } - - void ShellExtensionsBrowserClient::InitWithBrowserContext( -diff --git a/services/network/sct_auditing/sct_auditing_cache.cc b/services/network/sct_auditing/sct_auditing_cache.cc -index 519c24957a094..bb33a0b7a1468 100644 ---- a/services/network/sct_auditing/sct_auditing_cache.cc -+++ b/services/network/sct_auditing/sct_auditing_cache.cc -@@ -134,7 +134,8 @@ SCTAuditingCache::MaybeGenerateReportEntry( - } - RecordSCTAuditingReportDeduplicatedMetrics(false); - -- report->set_user_agent(version_info::GetProductNameAndVersionForUserAgent()); -+ report->set_user_agent( -+ std::string(version_info::GetProductNameAndVersionForUserAgent())); - - // Add `cache_key` to the dedupe cache. The cache value is not used. - dedupe_cache_.Put(cache_key, true); -diff --git a/weblayer/browser/content_browser_client_impl.cc b/weblayer/browser/content_browser_client_impl.cc -index eaba5a61b8bf2..2fb72909de656 100644 ---- a/weblayer/browser/content_browser_client_impl.cc -+++ b/weblayer/browser/content_browser_client_impl.cc -@@ -422,7 +422,7 @@ void ContentBrowserClientImpl::LogWebFeatureForCurrentPage( - } - - std::string ContentBrowserClientImpl::GetProduct() { -- return version_info::GetProductNameAndVersionForUserAgent(); -+ return std::string(version_info::GetProductNameAndVersionForUserAgent()); - } - - std::string ContentBrowserClientImpl::GetUserAgent() { diff --git a/meta-chromium/recipes-browser/chromium/files/0021-Add-missing-typename-s.patch b/meta-chromium/recipes-browser/chromium/files/0021-Add-missing-typename-s.patch index 35891d67..8bc9d419 100644 --- a/meta-chromium/recipes-browser/chromium/files/0021-Add-missing-typename-s.patch +++ b/meta-chromium/recipes-browser/chromium/files/0021-Add-missing-typename-s.patch @@ -6,82 +6,62 @@ Subject: [PATCH] Add missing "typename"s This adds some `typename`s in locations where they are needed in older versions of clang (probably < 16). -The changes to c/b/d/b/download_bubble_update_service.h are a backport -of https://crrev.com/c/4520587, which will be part of the 115 upstream -release. - Upstream-Status: Inappropriate [specific to older versions of clang] Signed-off-by: Max Ihlenfeldt --- .../download/bubble/download_bubble_update_service.cc | 6 +++--- - .../download/bubble/download_bubble_update_service.h | 4 ++-- - chrome/browser/printing/print_backend_service_manager.cc | 2 +- - chrome/browser/printing/print_backend_service_manager.h | 2 +- - 4 files changed, 7 insertions(+), 7 deletions(-) + components/optimization_guide/core/tflite_model_executor.h | 2 +- + .../core/html/parser/html_document_parser_fastpath.cc | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chrome/browser/download/bubble/download_bubble_update_service.cc b/chrome/browser/download/bubble/download_bubble_update_service.cc -index 0dbffd34222f1..70d43e37c8324 100644 +index 41b647f7b445d..8940c6bb7fcaa 100644 --- a/chrome/browser/download/bubble/download_bubble_update_service.cc +++ b/chrome/browser/download/bubble/download_bubble_update_service.cc -@@ -87,7 +87,7 @@ ItemSortKey GetSortKey(const Item& item) { +@@ -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::iterator GetLastIter(SortedItems& cache) { -+typename SortedItems::iterator GetLastIter(SortedItems& cache) { +-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); -@@ -789,9 +789,9 @@ bool DownloadBubbleUpdateService::RemoveItemFromCacheImpl( +@@ -967,9 +967,9 @@ bool DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheImpl( } template -SortedItems::iterator +typename SortedItems::iterator - DownloadBubbleUpdateService::RemoveItemFromCacheByIter( + DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheByIter( - SortedItems::iterator iter, + typename SortedItems::iterator iter, SortedItems& cache, IterMap& iter_map) { CHECK(iter != cache.end()); -diff --git a/chrome/browser/download/bubble/download_bubble_update_service.h b/chrome/browser/download/bubble/download_bubble_update_service.h -index de4e9e8a14b90..07ee16a3e8ad2 100644 ---- a/chrome/browser/download/bubble/download_bubble_update_service.h -+++ b/chrome/browser/download/bubble/download_bubble_update_service.h -@@ -208,8 +208,8 @@ class DownloadBubbleUpdateService - - // Removes item if we already have the iterator to it. Returns next iterator. - template -- SortedItems::iterator RemoveItemFromCacheByIter( -- SortedItems::iterator iter, -+ typename SortedItems::iterator RemoveItemFromCacheByIter( -+ typename SortedItems::iterator iter, - SortedItems& cache, - IterMap& iter_map); - -diff --git a/chrome/browser/printing/print_backend_service_manager.cc b/chrome/browser/printing/print_backend_service_manager.cc -index b5a4b525a2d68..224369cd58cfa 100644 ---- a/chrome/browser/printing/print_backend_service_manager.cc -+++ b/chrome/browser/printing/print_backend_service_manager.cc -@@ -1477,7 +1477,7 @@ template - void PrintBackendServiceManager::RunSavedCallbacks( - RemoteSavedCallbacks& saved_callbacks, - const RemoteId& remote_id, -- std::remove_reference::type... result) { -+ typename std::remove_reference::type... result) { - auto found_callbacks_map = saved_callbacks.find(remote_id); - if (found_callbacks_map == saved_callbacks.end()) - return; // No callbacks to run. -diff --git a/chrome/browser/printing/print_backend_service_manager.h b/chrome/browser/printing/print_backend_service_manager.h -index d812f3b26e9c8..3352148cbf985 100644 ---- a/chrome/browser/printing/print_backend_service_manager.h -+++ b/chrome/browser/printing/print_backend_service_manager.h -@@ -587,7 +587,7 @@ class PrintBackendServiceManager { - template - void RunSavedCallbacks(RemoteSavedCallbacks& saved_callbacks, - const RemoteId& remote_id, -- std::remove_reference::type... result); -+ typename std::remove_reference::type... result); - - // Test support for client ID management. - static void SetClientsForTesting( +diff --git a/components/optimization_guide/core/tflite_model_executor.h b/components/optimization_guide/core/tflite_model_executor.h +index c4f750f468493..b5635f4108bb4 100644 +--- a/components/optimization_guide/core/tflite_model_executor.h ++++ b/components/optimization_guide/core/tflite_model_executor.h +@@ -189,7 +189,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/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 2dc0b30409283..a82f255090b3c 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/meta-chromium/recipes-browser/chromium/files/0022-Backport-Avoid-capturing-structured-bindings.patch b/meta-chromium/recipes-browser/chromium/files/0022-Backport-Avoid-capturing-structured-bindings.patch deleted file mode 100644 index 20c81bc5..00000000 --- a/meta-chromium/recipes-browser/chromium/files/0022-Backport-Avoid-capturing-structured-bindings.patch +++ /dev/null @@ -1,189 +0,0 @@ -From 348bd4d340fc750eed3543c51b20f15d4506e414 Mon Sep 17 00:00:00 2001 -From: Max Ihlenfeldt -Date: Mon, 12 Jun 2023 17:14:17 +0000 -Subject: [PATCH] Backport "Avoid capturing structured bindings" - -This is the backport of a patch that removes usage of a C++20 feature to -fix compile errors with older versions of clang. - -The upstream 115 release will include this patch. - -Upstream-Status: Backport [https://crrev.com/c/4526976] -Signed-off-by: Max Ihlenfeldt ---- - .../ng/grid/ng_grid_layout_algorithm.cc | 62 +++++++++---------- - 1 file changed, 30 insertions(+), 32 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 af5ab8890e752..332fc32831f02 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 -@@ -520,13 +520,12 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( - row_auto_repetitions); - - bool has_nested_subgrid = false; -- auto& [grid_items, layout_data, subtree_size] = -- sizing_tree->CreateSizingData(opt_subgrid_data); -+ auto& sizing_data = sizing_tree->CreateSizingData(opt_subgrid_data); - - if (!must_ignore_children) { - // Construct grid items that are not subgridded. -- grid_items = node.ConstructGridItems(placement_data, oof_children, -- &has_nested_subgrid); -+ sizing_data.grid_items = node.ConstructGridItems( -+ placement_data, oof_children, &has_nested_subgrid); - - placement_data.column_start_offset = - node.CachedPlacementData().column_start_offset; -@@ -538,7 +537,7 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( - NGGridRangeBuilder range_builder(style, placement_data, track_direction); - - bool must_create_baselines = false; -- for (auto& grid_item : grid_items) { -+ for (auto& grid_item : sizing_data.grid_items) { - must_create_baselines |= - grid_item.IsBaselineSpecifiedForDirection(track_direction); - -@@ -548,7 +547,7 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( - &range_indices.begin, - &range_indices.end); - } -- layout_data.SetTrackCollection( -+ sizing_data.layout_data.SetTrackCollection( - std::make_unique( - range_builder.FinalizeRanges(), must_create_baselines, - track_direction)); -@@ -575,29 +574,29 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( - return; - } - sizing_tree->AddSubgriddedItemLookupData( -- NGSubgriddedItemData(grid_item, layout_data)); -+ NGSubgriddedItemData(grid_item, sizing_data.layout_data)); - }; - - if (!has_nested_subgrid) { -- for (const auto& grid_item : grid_items) { -+ for (const auto& grid_item : sizing_data.grid_items) { - AddSubgriddedItemLookupData(grid_item); - } -- return subtree_size; -+ return sizing_data.subtree_size; - } - -- InitializeTrackCollection(opt_subgrid_data, kForColumns, &layout_data); -- InitializeTrackCollection(opt_subgrid_data, kForRows, &layout_data); -+ InitializeTrackCollection(opt_subgrid_data, kForColumns, &sizing_data.layout_data); -+ InitializeTrackCollection(opt_subgrid_data, kForRows, &sizing_data.layout_data); - - if (has_standalone_columns) { -- layout_data.SizingCollection(kForColumns).CacheDefiniteSetsGeometry(); -+ sizing_data.layout_data.SizingCollection(kForColumns).CacheDefiniteSetsGeometry(); - } - if (has_standalone_rows) { -- layout_data.SizingCollection(kForRows).CacheDefiniteSetsGeometry(); -+ sizing_data.layout_data.SizingCollection(kForRows).CacheDefiniteSetsGeometry(); - } - - // |AppendSubgriddedItems| rely on the cached placement data of a subgrid to - // construct its grid items, so we need to build their subtrees beforehand. -- for (auto& grid_item : grid_items) { -+ for (auto& grid_item : sizing_data.grid_items) { - AddSubgriddedItemLookupData(grid_item); - - if (!grid_item.IsSubgrid()) -@@ -607,10 +606,10 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( - // the set indices of this grid item to determine its available space. This - // happens because subgridded items are not considered by the range builder - // since they can't be placed before we recurse into subgrids. -- grid_item.ComputeSetIndices(layout_data.Columns()); -- grid_item.ComputeSetIndices(layout_data.Rows()); -+ grid_item.ComputeSetIndices(sizing_data.layout_data.Columns()); -+ grid_item.ComputeSetIndices(sizing_data.layout_data.Rows()); - -- NGSubgriddedItemData subgrid_data(grid_item, layout_data); -+ NGSubgriddedItemData subgrid_data(grid_item, sizing_data.layout_data); - - const auto space = CreateConstraintSpaceForSubgridAlgorithm(subgrid_data); - const auto fragment_geometry = CalculateInitialFragmentGeometry( -@@ -620,7 +619,7 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( - const NGGridLayoutAlgorithm subgrid_algorithm( - {subgrid_data->node, fragment_geometry, space}); - -- subtree_size += subgrid_algorithm.BuildGridSizingSubtree( -+ sizing_data.subtree_size += subgrid_algorithm.BuildGridSizingSubtree( - sizing_tree, /* oof_children */ nullptr, subgrid_data, - &placement_data.line_resolver); - -@@ -630,7 +629,7 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( - grid_item.ResetPlacementIndices(); - } - -- node.AppendSubgriddedItems(&grid_items); -+ node.AppendSubgriddedItems(&sizing_data.grid_items); - - // We need to recreate the track builder collections to ensure track coverage - // for subgridded items; it would be ideal to have them accounted for already, -@@ -642,7 +641,7 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( - if (has_standalone_rows) { - BuildSizingCollection(kForRows); - } -- return subtree_size; -+ return sizing_data.subtree_size; - } - - NGGridSizingTree NGGridLayoutAlgorithm::BuildGridSizingTree( -@@ -1640,22 +1639,21 @@ void NGGridLayoutAlgorithm::InitializeTrackSizes( - const absl::optional& opt_track_direction) const { - DCHECK(sizing_subtree); - -- auto& [grid_items, layout_data, subtree_size] = -- sizing_subtree.SubtreeRootData(); -+ auto& sizing_data = sizing_subtree.SubtreeRootData(); - - auto InitAndCacheTrackSizes = [&](GridTrackSizingDirection track_direction) { -- InitializeTrackCollection(opt_subgrid_data, track_direction, &layout_data); -+ InitializeTrackCollection(opt_subgrid_data, track_direction, &sizing_data.layout_data); - -- if (layout_data.HasSubgriddedAxis(track_direction)) { -+ if (sizing_data.layout_data.HasSubgriddedAxis(track_direction)) { - const auto& track_collection = (track_direction == kForColumns) -- ? layout_data.Columns() -- : layout_data.Rows(); -- for (auto& grid_item : grid_items) { -+ ? sizing_data.layout_data.Columns() -+ : sizing_data.layout_data.Rows(); -+ for (auto& grid_item : sizing_data.grid_items) { - grid_item.ComputeSetIndices(track_collection); - } - } else { -- auto& track_collection = layout_data.SizingCollection(track_direction); -- CacheGridItemsProperties(track_collection, &grid_items); -+ auto& track_collection = sizing_data.layout_data.SizingCollection(track_direction); -+ CacheGridItemsProperties(track_collection, &sizing_data.grid_items); - - const bool is_for_columns = track_direction == kForColumns; - const auto start_border_scrollbar_padding = -@@ -1687,20 +1685,20 @@ void NGGridLayoutAlgorithm::InitializeTrackSizes( - InitAndCacheTrackSizes(kForRows); - } - -- if (subtree_size == 1) { -+ if (sizing_data.subtree_size == 1) { - // If we know this subtree doesn't have nested subgrids we can exit early - // instead of iterating over every grid item looking for them. - return; - } - - auto next_subgrid_subtree = sizing_subtree.FirstChild(); -- for (const auto& grid_item : grid_items) { -+ for (const auto& grid_item : sizing_data.grid_items) { - if (grid_item.is_subgridded_to_parent_grid || !grid_item.IsSubgrid()) { - continue; - } - - DCHECK(next_subgrid_subtree); -- NGSubgriddedItemData subgrid_data(grid_item, layout_data); -+ NGSubgriddedItemData subgrid_data(grid_item, sizing_data.layout_data); - - const auto space = CreateConstraintSpaceForSubgridAlgorithm(subgrid_data); - const auto fragment_geometry = CalculateInitialFragmentGeometry( diff --git a/meta-chromium/recipes-browser/chromium/files/0026-Backport-std-string-ends_with-is-C-20.-Use-base-Ends.patch b/meta-chromium/recipes-browser/chromium/files/0026-Backport-std-string-ends_with-is-C-20.-Use-base-Ends.patch deleted file mode 100644 index d5565c8f..00000000 --- a/meta-chromium/recipes-browser/chromium/files/0026-Backport-std-string-ends_with-is-C-20.-Use-base-Ends.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a9fee044f6317d350f1efe5afb6af88256ee1346 Mon Sep 17 00:00:00 2001 -From: Max Ihlenfeldt -Date: Fri, 2 Jun 2023 10:03:44 +0000 -Subject: [PATCH] Backport "std::string::ends_with() is C++20. Use - base::EndsWith() instead." - -This backported patch fixes a dunfell compilation error and will be -included upstream in the 115 release. - -Upstream-Status: Backport [https://crrev.com/c/4523078] -Signed-off-by: Max Ihlenfeldt ---- - net/cookies/cookie_util.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/cookies/cookie_util.cc b/net/cookies/cookie_util.cc -index 071c86710e640..797e89ba67780 100644 ---- a/net/cookies/cookie_util.cc -+++ b/net/cookies/cookie_util.cc -@@ -326,7 +326,7 @@ bool GetCookieDomainWithString(const GURL& url, - // a sequence of individual domain name labels"; a label can only be empty if - // it is the last label in the name, but a name ending in `..` would have an - // empty label in the penultimate position and is thus invalid. -- if (url_host.ends_with("..")) { -+ if (base::EndsWith(url_host, "..")) { - return false; - } - // If no domain was specified in the domain string, default to a host cookie. diff --git a/meta-chromium/recipes-browser/chromium/files/0027-Don-t-pass-disable-auto-upgrade-debug-info-to-linker.patch b/meta-chromium/recipes-browser/chromium/files/0027-Don-t-pass-disable-auto-upgrade-debug-info-to-linker.patch index bacdd464..8ae11442 100644 --- a/meta-chromium/recipes-browser/chromium/files/0027-Don-t-pass-disable-auto-upgrade-debug-info-to-linker.patch +++ b/meta-chromium/recipes-browser/chromium/files/0027-Don-t-pass-disable-auto-upgrade-debug-info-to-linker.patch @@ -15,10 +15,10 @@ Signed-off-by: Max Ihlenfeldt 1 file changed, 8 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index bbfe6cb53ca2a..6dfecad718686 100644 +index c274a92b3f93e..de19e2490edd3 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -726,14 +726,6 @@ config("compiler") { +@@ -756,14 +756,6 @@ config("compiler") { } ldflags += [ "-Wl,-mllvm,-import-instr-limit=$import_instr_limit" ] diff --git a/meta-chromium/recipes-browser/chromium/files/0028-Avoid-capturing-structured-bindings.patch b/meta-chromium/recipes-browser/chromium/files/0028-Avoid-capturing-structured-bindings.patch index 0597b34a..9a4019f2 100644 --- a/meta-chromium/recipes-browser/chromium/files/0028-Avoid-capturing-structured-bindings.patch +++ b/meta-chromium/recipes-browser/chromium/files/0028-Avoid-capturing-structured-bindings.patch @@ -10,9 +10,26 @@ versions of clang (observed with clang 15). Upstream-Status: Inappropriate [specific to older versions of clang] Signed-off-by: Max Ihlenfeldt --- - media/base/cdm_promise_adapter.cc | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) + .../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 36391a685ac6f..e3cb9f0634b0e 100644 +--- a/content/browser/service_worker/service_worker_context_wrapper.cc ++++ b/content/browser/service_worker/service_worker_context_wrapper.cc +@@ -1396,9 +1396,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 diff --git a/meta-chromium/recipes-browser/chromium/files/0030-Backport-Avoid-operator-which-is-C-20-specific.patch b/meta-chromium/recipes-browser/chromium/files/0030-Backport-Avoid-operator-which-is-C-20-specific.patch deleted file mode 100644 index 57d8930c..00000000 --- a/meta-chromium/recipes-browser/chromium/files/0030-Backport-Avoid-operator-which-is-C-20-specific.patch +++ /dev/null @@ -1,68 +0,0 @@ -From f311ec882d402c604747e80e89d2e257723b83dd Mon Sep 17 00:00:00 2001 -From: Max Ihlenfeldt -Date: Wed, 21 Jun 2023 14:30:36 +0000 -Subject: [PATCH] Backport "Avoid operator<=>(), which is C++20-specific." - -This is the backport of a patch that removes the usage of `operator<=>` -to fix a build error with the older versions of clang that we still use. -It also removes a defaulted `operator==` (similar to -0018-Only-default-operator-on-declaration.patch), which needs to be done -in the same patch to avoid a conflict. - -The `operator<=>` fix will be included upstream in 115. When updating to -that version, we can merge the defaulted `operator==` fix with the -others in 0018-Only-default-operator-on-declaration.patch and remove -this patch. - -Upstream-Status: Backport [https://crrev.com/c/4518991] -Signed-off-by: Max Ihlenfeldt ---- - .../password_manager/core/browser/password_form.cc | 9 +++++---- - components/password_manager/core/browser/password_form.h | 4 ++-- - 2 files changed, 7 insertions(+), 6 deletions(-) - -diff --git a/components/password_manager/core/browser/password_form.cc b/components/password_manager/core/browser/password_form.cc -index 380c5be98b7aa..de421a6a8b7dd 100644 ---- a/components/password_manager/core/browser/password_form.cc -+++ b/components/password_manager/core/browser/password_form.cc -@@ -4,10 +4,10 @@ - - #include "components/password_manager/core/browser/password_form.h" - --#include - #include - #include - #include -+#include - - #include "base/json/json_writer.h" - #include "base/json/values_util.h" -@@ -225,9 +225,10 @@ AlternativeElement& AlternativeElement::operator=( - AlternativeElement& AlternativeElement::operator=(AlternativeElement&& rhs) = - default; - AlternativeElement::~AlternativeElement() = default; --bool AlternativeElement::operator==(const AlternativeElement&) const = default; --std::strong_ordering AlternativeElement::operator<=>( -- const AlternativeElement&) const = default; -+bool AlternativeElement::operator<(const AlternativeElement& other) const { -+ return std::tie(value, field_renderer_id, name) < -+ std::tie(other.value, other.field_renderer_id, other.name); -+} - - std::ostream& operator<<(std::ostream& os, const AlternativeElement& element) { - base::Value::Dict element_json; -diff --git a/components/password_manager/core/browser/password_form.h b/components/password_manager/core/browser/password_form.h -index 52fa5ae1b4651..7450bef2b0ca4 100644 ---- a/components/password_manager/core/browser/password_form.h -+++ b/components/password_manager/core/browser/password_form.h -@@ -44,8 +44,8 @@ struct AlternativeElement { - AlternativeElement& operator=(AlternativeElement&& rhs); - ~AlternativeElement(); - -- bool operator==(const AlternativeElement&) const; -- std::strong_ordering operator<=>(const AlternativeElement&) const; -+ bool operator==(const AlternativeElement&) const = default; -+ bool operator<(const AlternativeElement&) const; - - // The value of the field. - std::u16string value; diff --git a/meta-chromium/recipes-browser/chromium/files/0031-Backport-ozone-wayland-Fix-nullptr-deref-in-WaylandW.patch b/meta-chromium/recipes-browser/chromium/files/0032-Backport-ozone-wayland-Fix-nullptr-deref-in-WaylandW.patch similarity index 100% rename from meta-chromium/recipes-browser/chromium/files/0031-Backport-ozone-wayland-Fix-nullptr-deref-in-WaylandW.patch rename to meta-chromium/recipes-browser/chromium/files/0032-Backport-ozone-wayland-Fix-nullptr-deref-in-WaylandW.patch diff --git a/meta-chromium/recipes-browser/chromium/files/0033-Revert-Reland-Reland-mte-refactor-the-tagging-functi.patch b/meta-chromium/recipes-browser/chromium/files/0033-Revert-Reland-Reland-mte-refactor-the-tagging-functi.patch new file mode 100644 index 00000000..d2922846 --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0033-Revert-Reland-Reland-mte-refactor-the-tagging-functi.patch @@ -0,0 +1,284 @@ +From 004592dcbd497b4852750aca0139d3ae12233abb Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Mon, 7 Aug 2023 10:37:59 +0000 +Subject: [PATCH] Revert "Reland "Reland "mte: refactor the tagging functions + to use ifuncs""" + +This reverts https://crrev.com/c/4517702. The code compiles fine with +clang 15 (if you backport https://crrev.com/c/4610745), but clang 14 +seems to contain a bug that leads to this build error: + +``` +IFunc resolver has incorrect type +i8* (i8*, i64)* @_ZN15partition_alloc8internal31TagMemoryRangeIncrementInternalEPvm +IFunc resolver has incorrect type +i8* (i8*, i64, i64)* @_ZN15partition_alloc8internal30TagMemoryRangeRandomlyInternalEPvmm +IFunc resolver has incorrect type +i8* (i8*)* @_ZN15partition_alloc8internal21RemaskPointerInternalEPv +LLVM ERROR: Broken module found, compilation aborted! +PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. +``` + +Upstream-Status: Inappropriate [specific to older versions of clang] +Signed-off-by: Max Ihlenfeldt +--- + .../partition_allocator/partition_root.cc | 4 ++ + base/allocator/partition_allocator/tagging.cc | 56 ++++++------------- + base/allocator/partition_allocator/tagging.h | 43 +++++++++----- + .../partition_allocator/tagging_unittest.cc | 8 +++ + 4 files changed, 60 insertions(+), 51 deletions(-) + +diff --git a/base/allocator/partition_allocator/partition_root.cc b/base/allocator/partition_allocator/partition_root.cc +index 27389db16946a..00a3fbb2984c8 100644 +--- a/base/allocator/partition_allocator/partition_root.cc ++++ b/base/allocator/partition_allocator/partition_root.cc +@@ -895,6 +895,10 @@ void PartitionRoot::Init(PartitionOptions opts) { + return; + } + ++ // Swaps out the active no-op tagging intrinsics with MTE-capable ones, if ++ // running on the right hardware. ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); ++ + #if BUILDFLAG(HAS_64_BIT_POINTERS) + // Reserve address space for partition alloc. + internal::PartitionAddressSpace::Init(); +diff --git a/base/allocator/partition_allocator/tagging.cc b/base/allocator/partition_allocator/tagging.cc +index 6f0d49dffc3c6..63368e870fe0c 100644 +--- a/base/allocator/partition_allocator/tagging.cc ++++ b/base/allocator/partition_allocator/tagging.cc +@@ -12,9 +12,7 @@ + + #if PA_CONFIG(HAS_MEMORY_TAGGING) + #include +-#include + #include +-#include + #include + #define PR_SET_TAGGED_ADDR_CTRL 55 + #define PR_GET_TAGGED_ADDR_CTRL 56 +@@ -121,6 +119,12 @@ namespace { + return ret; + } + ++#if PA_CONFIG(HAS_MEMORY_TAGGING) ++static bool HasCPUMemoryTaggingExtension() { ++ return base::CPU::GetInstanceNoAllocation().has_mte(); ++} ++#endif // PA_CONFIG(HAS_MEMORY_TAGGING) ++ + #if PA_CONFIG(HAS_MEMORY_TAGGING) + void* TagRegionRandomlyForMTE(void* ptr, size_t sz, uint64_t mask) { + // Randomly tag a region (MTE-enabled systems only). The first 16-byte +@@ -162,6 +166,7 @@ void* RemaskVoidPtrForMTE(void* ptr) { + } + return nullptr; + } ++#endif + + void* TagRegionIncrementNoOp(void* ptr, size_t sz) { + // Region parameters are checked even on non-MTE systems to check the +@@ -178,49 +183,24 @@ void* TagRegionRandomlyNoOp(void* ptr, size_t sz, uint64_t mask) { + void* RemaskVoidPtrNoOp(void* ptr) { + return ptr; + } +-#endif + + } // namespace + ++void InitializeMTESupportIfNeeded() { + #if PA_CONFIG(HAS_MEMORY_TAGGING) +-using RemaskPtrInternalFn = void*(void* ptr); +-using TagMemoryRangeIncrementInternalFn = void*(void* ptr, size_t size); +- +-using TagMemoryRangeRandomlyInternalFn = void*(void* ptr, +- size_t size, +- uint64_t mask); +- +-extern "C" TagMemoryRangeIncrementInternalFn( +- *ResolveTagMemoryRangeIncrement(uint64_t hwcap, struct __ifunc_arg_t* hw)) { +- if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) { +- return TagRegionIncrementForMTE; ++ if (HasCPUMemoryTaggingExtension()) { ++ global_remask_void_ptr_fn = RemaskVoidPtrForMTE; ++ global_tag_memory_range_increment_fn = TagRegionIncrementForMTE; ++ global_tag_memory_range_randomly_fn = TagRegionRandomlyForMTE; + } +- return TagRegionIncrementNoOp; +-} +- +-extern "C" TagMemoryRangeRandomlyInternalFn( +- *ResolveTagMemoryRandomly(uint64_t hwcap, struct __ifunc_arg_t* hw)) { +- if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) { +- return TagRegionRandomlyForMTE; +- } +- return TagRegionRandomlyNoOp; +-} +- +-extern "C" RemaskPtrInternalFn( +- *ResolveRemaskPointer(uint64_t hwcap, struct __ifunc_arg_t* hw)) { +- if ((hwcap & _IFUNC_ARG_HWCAP) && (hw->_hwcap2 & HWCAP2_MTE)) { +- return RemaskVoidPtrForMTE; +- } +- return RemaskVoidPtrNoOp; ++#endif + } + +-void* TagMemoryRangeIncrementInternal(void* ptr, size_t size) +- __attribute__((ifunc("ResolveTagMemoryRangeIncrement"))); +-void* TagMemoryRangeRandomlyInternal(void* ptr, size_t size, uint64_t mask) +- __attribute__((ifunc("ResolveTagMemoryRandomly"))); +-void* RemaskPointerInternal(void* ptr) +- __attribute__((ifunc("ResolveRemaskPointer"))); +-#endif // PA_CONFIG(HAS_MEMORY_TAGGING) ++RemaskPtrInternalFn* global_remask_void_ptr_fn = RemaskVoidPtrNoOp; ++TagMemoryRangeIncrementInternalFn* global_tag_memory_range_increment_fn = ++ TagRegionIncrementNoOp; ++TagMemoryRangeRandomlyInternalFn* global_tag_memory_range_randomly_fn = ++ TagRegionRandomlyNoOp; + + TagViolationReportingMode GetMemoryTaggingModeForCurrentThread() { + #if PA_CONFIG(HAS_MEMORY_TAGGING) +diff --git a/base/allocator/partition_allocator/tagging.h b/base/allocator/partition_allocator/tagging.h +index 858c5c3f69fc5..476e84e849c12 100644 +--- a/base/allocator/partition_allocator/tagging.h ++++ b/base/allocator/partition_allocator/tagging.h +@@ -56,16 +56,32 @@ void ChangeMemoryTaggingModeForAllThreadsPerProcess(TagViolationReportingMode); + PA_COMPONENT_EXPORT(PARTITION_ALLOC) + TagViolationReportingMode GetMemoryTaggingModeForCurrentThread(); + +-// These forward-defined functions do not really exist in tagging.cc, they're resolved +-// by the dynamic linker to MTE-capable versions on the right hardware. +-#if PA_CONFIG(HAS_MEMORY_TAGGING) +-PA_COMPONENT_EXPORT(PARTITION_ALLOC) +-void* TagMemoryRangeIncrementInternal(void* ptr, size_t size); +-PA_COMPONENT_EXPORT(PARTITION_ALLOC) +-void* TagMemoryRangeRandomlyInternal(void* ptr, size_t size, uint64_t mask); +-PA_COMPONENT_EXPORT(PARTITION_ALLOC) +-void* RemaskPointerInternal(void* ptr); +-#endif ++// Called by the partition allocator after initial startup, this detects MTE ++// support in the current CPU and replaces the active tagging intrinsics with ++// MTE versions if needed. ++PA_COMPONENT_EXPORT(PARTITION_ALLOC) void InitializeMTESupportIfNeeded(); ++ ++// These global function pointers hold the implementations of the tagging ++// intrinsics (TagMemoryRangeRandomly, TagMemoryRangeIncrement, RemaskPtr). ++// They are designed to be callable without taking a branch. They are initially ++// set to no-op functions in tagging.cc, but can be replaced with MTE-capable ++// ones through InitializeMTEIfNeeded(). This is conceptually similar to an ++// IFUNC, even though less secure. These function pointers were introduced to ++// support older Android releases. With the removal of support for Android M, ++// it became possible to use IFUNC instead. ++// TODO(bartekn): void* -> uintptr_t ++using RemaskPtrInternalFn = void*(void* ptr); ++using TagMemoryRangeIncrementInternalFn = void*(void* ptr, size_t size); ++ ++using TagMemoryRangeRandomlyInternalFn = void*(void* ptr, ++ size_t size, ++ uint64_t mask); ++extern PA_COMPONENT_EXPORT(PARTITION_ALLOC) ++ TagMemoryRangeRandomlyInternalFn* global_tag_memory_range_randomly_fn; ++extern PA_COMPONENT_EXPORT(PARTITION_ALLOC) ++ TagMemoryRangeIncrementInternalFn* global_tag_memory_range_increment_fn; ++extern PA_COMPONENT_EXPORT(PARTITION_ALLOC) ++ RemaskPtrInternalFn* global_remask_void_ptr_fn; + + // Increments the tag of the memory range ptr. Useful for provable revocations + // (e.g. free). Returns the pointer with the new tag. Ensures that the entire +@@ -75,7 +91,7 @@ void* RemaskPointerInternal(void* ptr); + template + PA_ALWAYS_INLINE T* TagMemoryRangeIncrement(T* ptr, size_t size) { + #if PA_CONFIG(HAS_MEMORY_TAGGING) +- return reinterpret_cast(TagMemoryRangeIncrementInternal(ptr, size)); ++ return reinterpret_cast(global_tag_memory_range_increment_fn(ptr, size)); + #else + return ptr; + #endif +@@ -93,7 +109,8 @@ PA_ALWAYS_INLINE T* TagMemoryRangeRandomly(T* ptr, + size_t size, + uint64_t mask = 0u) { + #if PA_CONFIG(HAS_MEMORY_TAGGING) +- return reinterpret_cast(TagMemoryRangeRandomlyInternal(ptr, size, mask)); ++ return reinterpret_cast( ++ global_tag_memory_range_randomly_fn(ptr, size, mask)); + #else + return ptr; + #endif +@@ -108,7 +125,7 @@ PA_ALWAYS_INLINE void* TagMemoryRangeRandomly(uintptr_t ptr, + template + PA_ALWAYS_INLINE T* TagPtr(T* ptr) { + #if PA_CONFIG(HAS_MEMORY_TAGGING) +- return reinterpret_cast(RemaskPointerInternal(ptr)); ++ return reinterpret_cast(global_remask_void_ptr_fn(ptr)); + #else + return ptr; + #endif +diff --git a/base/allocator/partition_allocator/tagging_unittest.cc b/base/allocator/partition_allocator/tagging_unittest.cc +index 5c25a46e62015..fab5db7212a34 100644 +--- a/base/allocator/partition_allocator/tagging_unittest.cc ++++ b/base/allocator/partition_allocator/tagging_unittest.cc +@@ -16,6 +16,7 @@ namespace partition_alloc::internal { + + // Check whether we can call the tagging intrinsics safely on all architectures. + TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlySafe) { ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); + uintptr_t buffer = + AllocPages(PageAllocationGranularity(), PageAllocationGranularity(), + PageAccessibilityConfiguration( +@@ -31,6 +32,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlySafe) { + } + + TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementSafe) { ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); + base::CPU cpu; + uintptr_t buffer = + AllocPages(PageAllocationGranularity(), PageAllocationGranularity(), +@@ -52,6 +54,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementSafe) { + #if defined(ARCH_CPU_64_BITS) + // Size / alignment constraints are only enforced on 64-bit architectures. + TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeBadSz) { ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); + base::CPU cpu; + uintptr_t buffer = + AllocPages(PageAllocationGranularity(), PageAllocationGranularity(), +@@ -68,6 +71,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeBadSz) { + } + + TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyNoSz) { ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); + base::CPU cpu; + uintptr_t buffer = + AllocPages(PageAllocationGranularity(), PageAllocationGranularity(), +@@ -83,6 +87,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyNoSz) { + } + + TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyBadAlign) { ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); + base::CPU cpu; + uintptr_t buffer = + AllocPages(PageAllocationGranularity(), PageAllocationGranularity(), +@@ -99,6 +104,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeRandomlyBadAlign) { + } + + TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadSz) { ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); + base::CPU cpu; + uintptr_t buffer = + AllocPages(PageAllocationGranularity(), PageAllocationGranularity(), +@@ -114,6 +120,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadSz) { + } + + TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementNoSz) { ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); + base::CPU cpu; + uintptr_t buffer = + AllocPages(PageAllocationGranularity(), PageAllocationGranularity(), +@@ -129,6 +136,7 @@ TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementNoSz) { + } + + TEST(PartitionAllocMemoryTaggingTest, TagMemoryRangeIncrementBadAlign) { ++ ::partition_alloc::internal::InitializeMTESupportIfNeeded(); + base::CPU cpu; + uintptr_t buffer = + AllocPages(PageAllocationGranularity(), PageAllocationGranularity(), diff --git a/meta-chromium/recipes-browser/chromium/files/0034-Avoid-parenthesized-initialization-of-aggregates.patch b/meta-chromium/recipes-browser/chromium/files/0034-Avoid-parenthesized-initialization-of-aggregates.patch new file mode 100644 index 00000000..e1cf1d59 --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0034-Avoid-parenthesized-initialization-of-aggregates.patch @@ -0,0 +1,64 @@ +From f5f260d9976c5ab01683938c9c209a5253c93b22 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Thu, 3 Aug 2023 13:31:15 +0000 +Subject: [PATCH] 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 +--- + .../bound_session_refresh_cookie_fetcher_impl.cc | 4 ++-- + chrome/test/chromedriver/chrome/client_hints.h | 1 + + .../blink/renderer/modules/canvas/canvas2d/canvas_style.cc | 4 ++-- + 3 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc +index 46be6f06b147a..dbb98f2648431 100644 +--- a/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc ++++ b/chrome/browser/signin/bound_session_credentials/bound_session_refresh_cookie_fetcher_impl.cc +@@ -103,6 +103,6 @@ void BoundSessionRefreshCookieFetcherImpl::OnURLLoaderComplete( + net::Error net_error = static_cast(url_loader_->NetError()); + + std::move(callback_).Run( +- Result(net_error, headers ? absl::optional(headers->response_code()) +- : absl::nullopt)); ++ Result {net_error, headers ? absl::optional(headers->response_code()) ++ : absl::nullopt}); + } +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/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc +index f0b4913914739..67c26acab818b 100644 +--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc ++++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc +@@ -91,12 +91,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/meta-chromium/recipes-browser/chromium/files/0035-Backport-IWYU-for-chromedriver-chrome-client_hints.h.patch b/meta-chromium/recipes-browser/chromium/files/0035-Backport-IWYU-for-chromedriver-chrome-client_hints.h.patch new file mode 100644 index 00000000..01e269ab --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0035-Backport-IWYU-for-chromedriver-chrome-client_hints.h.patch @@ -0,0 +1,26 @@ +From 3773f79162835a9b6fa7f7359ff6f4ed579bbf4a Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Mon, 7 Aug 2023 13:26:55 +0000 +Subject: [PATCH] Backport "IWYU for chromedriver/chrome/client_hints.h" + +This is a backport of a patch that fixes a build error due to a missing +import. It will be included in upstream's 118 release. + +Upstream-Status: Backport [https://crrev.conm/c/4767547] +Signed-off-by: Max Ihlenfeldt +--- + chrome/test/chromedriver/chrome/client_hints.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/chrome/test/chromedriver/chrome/client_hints.h b/chrome/test/chromedriver/chrome/client_hints.h +index 593bfe6e8a25e..8c13bd3321c5e 100644 +--- a/chrome/test/chromedriver/chrome/client_hints.h ++++ b/chrome/test/chromedriver/chrome/client_hints.h +@@ -7,6 +7,7 @@ + + #include + #include ++#include + + struct BrandVersion { + // Browser brand. diff --git a/meta-chromium/recipes-browser/chromium/gn-native_114.0.5735.198.bb b/meta-chromium/recipes-browser/chromium/gn-native_115.0.5790.170.bb similarity index 100% rename from meta-chromium/recipes-browser/chromium/gn-native_114.0.5735.198.bb rename to meta-chromium/recipes-browser/chromium/gn-native_115.0.5790.170.bb