diff --git a/meta-chromium/recipes-browser/chromium/chromium-gn.inc b/meta-chromium/recipes-browser/chromium/chromium-gn.inc index 7048dbcd0..8edbf55f4 100644 --- a/meta-chromium/recipes-browser/chromium/chromium-gn.inc +++ b/meta-chromium/recipes-browser/chromium/chromium-gn.inc @@ -18,13 +18,19 @@ SRC_URI += " \ file://0005-BUILD-do-not-specify-march-on-arm.patch \ file://0007-Delete-compiler-options-not-available-in-release-ver.patch \ file://0008-avoid-link-latomic-failure-on-CentOS-8-host.patch \ - file://0009-nomerge-attribute-on-declaration-is-only-available-s.patch \ file://0011-Revert-Use-ffile-compilation-dir-instead-of-fdebug-c.patch \ - file://0013-Fix-html_minifier-script-for-node-v12.patch \ file://0015-drop-gsimple-template-names.patch \ 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://0024-Backport-Fix-erroneous-SupportsOstreamOperator-int-i.patch \ + file://0025-Backport-Do-not-use-std-monospace-for-absl-variant.patch \ + file://0026-Backport-std-string-ends_with-is-C-20.-Use-base-Ends.patch \ " SRC_URI:append:libc-musl = "\ diff --git a/meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_112.0.5615.165.bb b/meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_113.0.5672.126.bb similarity index 100% rename from meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_112.0.5615.165.bb rename to meta-chromium/recipes-browser/chromium/chromium-ozone-wayland_113.0.5672.126.bb diff --git a/meta-chromium/recipes-browser/chromium/chromium-x11_112.0.5615.165.bb b/meta-chromium/recipes-browser/chromium/chromium-x11_113.0.5672.126.bb similarity index 100% rename from meta-chromium/recipes-browser/chromium/chromium-x11_112.0.5615.165.bb rename to meta-chromium/recipes-browser/chromium/chromium-x11_113.0.5672.126.bb diff --git a/meta-chromium/recipes-browser/chromium/chromium.inc b/meta-chromium/recipes-browser/chromium/chromium.inc index 187045f65..4ee2f7f36 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] = "168c62fea9f428f99fbf967f36a75ee5da160429e3a5b86bf02188c5fe7c79fd" +SRC_URI[sha256sum] = "0def7cd594304d7675821d42a4207377af98e321a78a91ee5200aea55adc2d93" S = "${WORKDIR}/chromium-${PV}" @@ -72,6 +72,7 @@ LIC_FILES_CHKSUM = "\ file://${S}/buildtools/third_party/libc++/trunk/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da3953 \ file://${S}/buildtools/third_party/libc++abi/trunk/LICENSE.TXT;md5=7b9334635b542c56868400a46b272b1e \ file://${S}/buildtools/third_party/libunwind/trunk/LICENSE.TXT;md5=f66970035d12f196030658b11725e1a1 \ + file://${S}/chrome/browser/resources/chromeos/accessibility/chromevox/third_party/tamachiyomi/LICENSE;md5=15772cfcf7016e701ce54554516c0688 \ file://${S}/chrome/installer/mac/third_party/bsdiff/LICENSE;md5=0dbe7a50f028269750631fcbded3846a \ file://${S}/chrome/installer/mac/third_party/xz/LICENSE;md5=8bbde65ae0523dc878ed1ac1252d2d14 \ file://${S}/chrome/third_party/mozilla_security_manager/LICENSE;md5=0c259b853bbf067b361100ce560adce7 \ @@ -200,7 +201,6 @@ LIC_FILES_CHKSUM = "\ file://${S}/third_party/android_media/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://${S}/third_party/android_opengl/LICENSE;md5=d10e92761a860d4113a7a525c78daf13 \ file://${S}/third_party/android_provider/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ - file://${S}/third_party/android_rust_toolchain/toolchain/share/doc/rust/LICENSE-APACHE;md5=22a53954e4e0ec258dfce4391e905dac \ file://${S}/third_party/android_sdk/LICENSE;md5=a9559ed17808a8b10eec6672f993ce75 \ file://${S}/third_party/android_swipe_refresh/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://${S}/third_party/android_system_sdk/LICENSE;md5=cbb64e76df0f98fc138b1918c089417e \ @@ -230,6 +230,7 @@ LIC_FILES_CHKSUM = "\ file://${S}/third_party/cpuinfo/src/LICENSE;md5=cabca80e8e4a4bbe90e9a4b4ad53f5f4 \ file://${S}/third_party/crashpad/crashpad/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://${S}/third_party/crc32c/src/LICENSE;md5=e9ed01b5e5ac9eae23fc2bb33701220c \ + file://${S}/third_party/cros-components/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://${S}/third_party/crubit/LICENSE;md5=e8237eb3ff53402dada6d65b7640b60b \ file://${S}/third_party/d3/src/LICENSE;md5=0679931d76eb2f1dd1915249da84a722 \ file://${S}/third_party/dav1d/LICENSE;md5=59cb7015cbeea4a8675b9bdb657d41b3 \ @@ -295,11 +296,12 @@ LIC_FILES_CHKSUM = "\ file://${S}/third_party/libaom/source/libaom/LICENSE;md5=6ea91368c1bbdf877159435572b931f5 \ file://${S}/third_party/libavif/LICENSE;md5=15744a27d810133340dc64ad411ec4cd \ file://${S}/third_party/libbrlapi/LICENSE;md5=fad9b3332be894bab9bc501572864b29 \ + file://${S}/third_party/libei/LICENSE;md5=a98fa76460f96f41696611d6f07e8d49 \ file://${S}/third_party/libevent/LICENSE;md5=a2b0302a710150293fb85d2bfabd3de6 \ file://${S}/third_party/libgav1/src/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://${S}/third_party/libipp/LICENSE;md5=af9e58383a1b2b17c75c6c9ff561ca9d \ file://${S}/third_party/libjingle_xmpp/LICENSE;md5=ad296492125bc71530d06234d9bfebe0 \ - file://${S}/third_party/libjpeg_turbo/LICENSE.md;md5=a75feaa2de6d8942f50d412241fca1f1 \ + file://${S}/third_party/libjpeg_turbo/LICENSE.md;md5=2a8e0d8226a102f07ab63ed7fd6ce155 \ file://${S}/third_party/liblouis/LICENSE;md5=8ab69863de0d3a0e00c4f97a4d78dd4a \ file://${S}/third_party/libphonenumber/LICENSE;md5=e23fadd6ceef8c618fc1c65191d846fa \ file://${S}/third_party/libpng/LICENSE;md5=b0085051bf265bac2bfc38bc89f50000 \ 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 60dcfd763..47e74903a 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 9afb4425840b9..6c38d4fa27855 100644 +index d3adf9735ca95..bbe807fdc7b04 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -685,7 +685,7 @@ config("compiler") { +@@ -680,7 +680,7 @@ config("compiler") { if (is_win) { ldflags += [ @@ -29,7 +29,7 @@ index 9afb4425840b9..6c38d4fa27855 100644 "-mllvm:-import-instr-limit=$import_instr_limit", "/lldltocache:" + rebase_path("$root_out_dir/thinlto-cache", root_build_dir), -@@ -698,11 +698,11 @@ config("compiler") { +@@ -693,11 +693,11 @@ config("compiler") { # usage in crbug.com/1038040. Note this will increase build time in # Chrome OS. @@ -44,8 +44,8 @@ index 9afb4425840b9..6c38d4fa27855 100644 + ldflags += [ "-Wl,--thinlto-jobs=" + max_jobs_per_link ] + if (is_apple) { - _object_path_suffix = "" - if (is_ios) { + ldflags += [ + "-Wl,-cache_path_lto," + diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni index 4738ee80d307c..7a43b1113a495 100644 --- a/build/config/compiler/compiler.gni 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 2845a481c..29c33bcf5 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 6c38d4fa27855..7bae0340ede9a 100644 +index bbe807fdc7b04..ca70a35b4d269 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1009,11 +1009,6 @@ config("compiler_cpu_abi") { +@@ -996,11 +996,6 @@ config("compiler_cpu_abi") { ] } } else if (current_cpu == "arm") { @@ -36,7 +36,7 @@ index 6c38d4fa27855..7bae0340ede9a 100644 if (!is_nacl) { cflags += [ "-march=$arm_arch", -@@ -1023,12 +1018,6 @@ config("compiler_cpu_abi") { +@@ -1010,12 +1005,6 @@ config("compiler_cpu_abi") { if (arm_tune != "") { cflags += [ "-mtune=$arm_tune" ] } @@ -49,7 +49,7 @@ index 6c38d4fa27855..7bae0340ede9a 100644 } else if (current_cpu == "mipsel" && !is_nacl) { ldflags += [ "-Wl,--hash-style=sysv" ] if (custom_toolchain == "") { -@@ -1036,9 +1025,6 @@ config("compiler_cpu_abi") { +@@ -1023,9 +1012,6 @@ config("compiler_cpu_abi") { if (is_android) { cflags += [ "--target=mipsel-linux-android" ] ldflags += [ "--target=mipsel-linux-android" ] @@ -59,7 +59,7 @@ index 6c38d4fa27855..7bae0340ede9a 100644 } } else { cflags += [ "-EL" ] -@@ -1118,8 +1104,6 @@ config("compiler_cpu_abi") { +@@ -1105,8 +1091,6 @@ config("compiler_cpu_abi") { ldflags += [ "-Wl,--hash-style=sysv" ] if (custom_toolchain == "") { if (is_clang) { @@ -68,7 +68,7 @@ index 6c38d4fa27855..7bae0340ede9a 100644 } else { cflags += [ "-EB" ] ldflags += [ "-EB" ] -@@ -1167,9 +1151,6 @@ config("compiler_cpu_abi") { +@@ -1154,9 +1138,6 @@ config("compiler_cpu_abi") { if (is_android) { cflags += [ "--target=mips64el-linux-android" ] ldflags += [ "--target=mips64el-linux-android" ] @@ -78,7 +78,7 @@ index 6c38d4fa27855..7bae0340ede9a 100644 } } else { cflags += [ -@@ -1227,8 +1208,6 @@ config("compiler_cpu_abi") { +@@ -1214,8 +1195,6 @@ config("compiler_cpu_abi") { ldflags += [ "-Wl,--hash-style=sysv" ] if (custom_toolchain == "") { if (is_clang) { @@ -87,7 +87,7 @@ index 6c38d4fa27855..7bae0340ede9a 100644 } else { cflags += [ "-EB", -@@ -1391,23 +1370,6 @@ config("compiler_deterministic") { +@@ -1378,23 +1357,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 b705423a9..8645476da 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 277f47717da..acdb09bf9ae 100644 +index 8f937794079..3f4071e0c88 100644 --- a/v8/BUILD.gn +++ b/v8/BUILD.gn -@@ -2007,6 +2007,7 @@ template("run_torque") { +@@ -2012,6 +2012,7 @@ template("run_torque") { } args = [ @@ -40,7 +40,7 @@ index 277f47717da..acdb09bf9ae 100644 "./" + rebase_path( get_label_info(":torque($toolchain)", "root_out_dir") + "/torque", root_build_dir), -@@ -2139,6 +2140,7 @@ action("generate_bytecode_builtins_list") { +@@ -2144,6 +2145,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 277f47717da..acdb09bf9ae 100644 "./" + rebase_path( get_label_info( ":bytecode_builtins_list_generator($v8_generator_toolchain)", -@@ -2178,6 +2180,7 @@ template("run_mksnapshot") { +@@ -2183,6 +2185,7 @@ template("run_mksnapshot") { data = [] args = [ @@ -56,7 +56,7 @@ index 277f47717da..acdb09bf9ae 100644 "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)", "root_out_dir") + "/mksnapshot", root_build_dir), -@@ -6484,6 +6487,7 @@ if (v8_enable_i18n_support) { +@@ -6546,6 +6549,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 38d9ce7c0..882977b3b 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 7bae0340ede9a..480f4d07a6e67 100644 +index ca70a35b4d269..a789a5aa0178c 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1008,16 +1008,6 @@ config("compiler_cpu_abi") { +@@ -995,16 +995,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 b80663f2c..0a28ff5aa 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 480f4d07a6e67..a0b5ad19e40ab 100644 +index a789a5aa0178c..fe0f989625879 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1596,6 +1596,11 @@ config("default_warnings") { +@@ -1583,6 +1583,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 491668192..cf1a834cb 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 422702cb196c5..59e1773326041 100644 +index 4d8087f0d747e..a3d75f04f6aff 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -1093,7 +1093,9 @@ component("base") { +@@ -1105,7 +1105,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/0009-nomerge-attribute-on-declaration-is-only-available-s.patch b/meta-chromium/recipes-browser/chromium/files/0009-nomerge-attribute-on-declaration-is-only-available-s.patch deleted file mode 100644 index e3e6b3a47..000000000 --- a/meta-chromium/recipes-browser/chromium/files/0009-nomerge-attribute-on-declaration-is-only-available-s.patch +++ /dev/null @@ -1,42 +0,0 @@ - - -Upstream suggests to use Chromium's hermetic clang -instead. - -Signed-off-by: Maksim Sisov ---- -From bde3186ccba169391fb428fcc296b2236ada0010 Mon Sep 17 00:00:00 2001 -From: Maksim Sisov -Date: Wed, 5 May 2021 15:20:43 +0300 -Subject: [PATCH] nomerge attribute on declaration is only available since - clang 12 - -This change fixes builds with older clangs that do not allow -nomerge attributes on declaration. Otherwise, the following error -is produced - - -build error: 'nomerge' attribute cannot be applied to a declaration - -See https://reviews.llvm.org/D92800 - -Change-Id: I32e1f7dc9049737d54d8a16de5308aa5aae1ced1 - -Upstream-Status: Inappropriate ---- - base/compiler_specific.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/base/compiler_specific.h b/base/compiler_specific.h -index 26f0471268264..204cefc061462 100644 ---- a/base/compiler_specific.h -+++ b/base/compiler_specific.h -@@ -346,7 +346,8 @@ inline constexpr bool AnalyzerAssumeTrue(bool arg) { - #endif // defined(__clang_analyzer__) - - // Use nomerge attribute to disable optimization of merging multiple same calls. --#if defined(__clang__) && HAS_ATTRIBUTE(nomerge) -+#if defined(__clang__) && (__clang_major__ >= 12) && \ -+ HAS_ATTRIBUTE(nomerge) && !defined(OS_CHROMEOS) - #define NOMERGE [[clang::nomerge]] - #else - #define NOMERGE 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 480643b92..b833fa7ad 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 a0b5ad19e40ab..ff2f5f4fcd482 100644 +index fe0f989625879..1259819238f17 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1299,7 +1299,6 @@ config("compiler_codegen") { +@@ -1286,7 +1286,6 @@ config("compiler_codegen") { config("compiler_deterministic") { cflags = [] ldflags = [] @@ -35,7 +35,7 @@ index a0b5ad19e40ab..ff2f5f4fcd482 100644 # Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for # deterministic build. See https://crbug.com/314403 -@@ -1328,20 +1327,12 @@ config("compiler_deterministic") { +@@ -1315,20 +1314,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/0013-Fix-html_minifier-script-for-node-v12.patch b/meta-chromium/recipes-browser/chromium/files/0013-Fix-html_minifier-script-for-node-v12.patch deleted file mode 100644 index 24cc8cb5f..000000000 --- a/meta-chromium/recipes-browser/chromium/files/0013-Fix-html_minifier-script-for-node-v12.patch +++ /dev/null @@ -1,34 +0,0 @@ -Upstream-Status: Inappropriate - -Signed-off-by: Maksim Sisov ---- -From c4117f44004faac54f94641a02afcc22199b79e4 Mon Sep 17 00:00:00 2001 -From: Maksim Sisov -Date: Mon, 12 Sep 2022 09:10:28 +0300 -Subject: [PATCH] Fix html_minifier script for node v12. - -fs/promises is not part of node v12 that dunfell uses according to -https://nodejs.org/api/fs.html#promises-api. - -https://stackoverflow.com/questions/70041947/import-filehandle-across-node-js-versions/70042193#70042193 -suggests "const fileHandle = require("fs").promises;" - -That fixes the problem with nodejs on dunfell, which uses older -version of nodejs than other branches. ---- - tools/polymer/html_minifier.js | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/polymer/html_minifier.js b/tools/polymer/html_minifier.js -index e86ef11a6620b..d2f9b1352dc0b 100644 ---- a/tools/polymer/html_minifier.js -+++ b/tools/polymer/html_minifier.js -@@ -14,7 +14,7 @@ const minify = - .minify; - - const path = require('path'); --const fs = require('fs/promises'); -+const fs = require('fs').promises; - - // Regex to extract the CSS contents out of the HTML string. It matches anything - // that is wrapped by a '' pair. 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 c5523c44a..525badfc4 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 ff2f5f4fcd482..2f99c80f51371 100644 +index 1259819238f17..4ae9a6e9e4df1 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -826,9 +826,11 @@ config("compiler") { +@@ -816,9 +816,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/0016-cast-to-bool-to-avoid-constexpr-error.patch b/meta-chromium/recipes-browser/chromium/files/0016-cast-to-bool-to-avoid-constexpr-error.patch index 1766a3d94..4eeac4bac 100644 --- a/meta-chromium/recipes-browser/chromium/files/0016-cast-to-bool-to-avoid-constexpr-error.patch +++ b/meta-chromium/recipes-browser/chromium/files/0016-cast-to-bool-to-avoid-constexpr-error.patch @@ -11,10 +11,10 @@ Signed-off-by: Randy MacLeod 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc b/third_party/blink/renderer/platform/media/web_media_player_impl.cc -index 1a82667678a16..6e9740f54876b 100644 +index e5e4b31d6b329..efabbb31d67af 100644 --- a/third_party/blink/renderer/platform/media/web_media_player_impl.cc +++ b/third_party/blink/renderer/platform/media/web_media_player_impl.cc -@@ -3699,15 +3699,15 @@ void WebMediaPlayerImpl::WriteSplitHistogram( +@@ -3734,15 +3734,15 @@ void WebMediaPlayerImpl::WriteSplitHistogram( const T&... values) { std::string strkey = std::string(key); 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 new file mode 100644 index 000000000..0c1a539d6 --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0019-Backport-constexpr-std-string-fixes.patch @@ -0,0 +1,1234 @@ +From fb756a13e798675772935f9d81771eca42676c41 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Thu, 25 May 2023 19:49:53 +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 and +https://crrev.com/c/4427593, 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. + +The first version that includes all three CLs will be 115, thus we can +drop this patch when updating to that version. + +Upstream-Status: Backport [https://crrev.com/c/4521911, https://crrev.com/c/4523268, https://crrev.com/c/4427593] +Signed-off-by: Max Ihlenfeldt +--- + base/strings/string_piece.h | 7 +++++++ + chrome/app/chrome_main_delegate.cc | 6 +++--- + .../app_service/webapk/webapk_install_task.cc | 6 ++++-- + .../client_app_metadata_provider_service.cc | 6 +++--- + .../gcm_device_info_provider_impl.cc | 4 ++-- + .../os_updates/os_updates_reporter.cc | 2 +- + .../device_status_collector.cc | 2 +- + .../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 +- + 55 files changed, 161 insertions(+), 143 deletions(-) + +diff --git a/base/strings/string_piece.h b/base/strings/string_piece.h +index 899b654cbe8e6..5d67b1fae21e3 100644 +--- a/base/strings/string_piece.h ++++ b/base/strings/string_piece.h +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + + #include "base/base_export.h" +@@ -153,6 +154,12 @@ class GSL_POINTER BasicStringPiece { + return std::basic_string(data(), size()); + } + ++ constexpr BasicStringPiece(std::basic_string_view str) ++ : ptr_(str.data()), length_(str.size()) {} ++ constexpr operator std::basic_string_view() const { ++ return std::basic_string_view(data(), size()); ++ } ++ + constexpr const_iterator begin() const noexcept { return ptr_; } + constexpr const_iterator cbegin() const noexcept { return ptr_; } + constexpr const_iterator end() const noexcept { return ptr_ + length_; } +diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc +index d4b31d11a51c4..76bd5198c1d45 100644 +--- a/chrome/app/chrome_main_delegate.cc ++++ b/chrome/app/chrome_main_delegate.cc +@@ -391,14 +391,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/apps/app_service/webapk/webapk_install_task.cc b/chrome/browser/apps/app_service/webapk/webapk_install_task.cc +index e7190d62d3cef..b46656bc1bab9 100644 +--- a/chrome/browser/apps/app_service/webapk/webapk_install_task.cc ++++ b/chrome/browser/apps/app_service/webapk/webapk_install_task.cc +@@ -290,7 +290,8 @@ void WebApkInstallTask::Start(ResultCallback callback) { + std::unique_ptr webapk = std::make_unique(); + webapk->set_manifest_url(registrar.GetAppManifestUrl(app_id_).spec()); + webapk->set_requester_application_package(kRequesterPackageName); +- webapk->set_requester_application_version(version_info::GetVersionNumber()); ++ webapk->set_requester_application_version( ++ std::string(version_info::GetVersionNumber())); + + LoadWebApkInfo(std::move(webapk)); + } +@@ -559,7 +560,8 @@ void WebApkInstallTask::OnWebApkInfoFetchedFromCrosapi( + } + + webapk->set_requester_application_package(kRequesterPackageName); +- webapk->set_requester_application_version(version_info::GetVersionNumber()); ++ webapk->set_requester_application_version( ++ std::string(version_info::GetVersionNumber())); + LoadWebApkInfo(std::move(webapk)); + } + +diff --git a/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.cc b/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.cc +index d63b7e1479cec..78efa5d4555ec 100644 +--- a/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.cc ++++ b/chrome/browser/ash/cryptauth/client_app_metadata_provider_service.cc +@@ -332,8 +332,8 @@ void ClientAppMetadataProviderService::OnInstanceIdTokenFetched( + metadata.set_locale(ChromeContentBrowserClient().GetApplicationLocale()); + metadata.set_device_os_version(base::GetLinuxDistro()); + metadata.set_device_os_version_code(SoftwareVersionCodeAsInt64()); +- metadata.set_device_os_release(version_info::GetVersionNumber()); +- metadata.set_device_os_codename(version_info::GetProductName()); ++ metadata.set_device_os_release(std::string(version_info::GetVersionNumber())); ++ metadata.set_device_os_codename(std::string(version_info::GetProductName())); + + // device_display_diagonal_mils is unused because it only applies to + // phones/tablets. +@@ -423,7 +423,7 @@ instance_id::InstanceID* ClientAppMetadataProviderService::GetInstanceId() { + + int64_t ClientAppMetadataProviderService::SoftwareVersionCodeAsInt64() { + static const int64_t version_code = +- ConvertVersionCodeToInt64(version_info::GetVersionNumber()); ++ ConvertVersionCodeToInt64(std::string(version_info::GetVersionNumber())); + return version_code; + } + +diff --git a/chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.cc b/chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.cc +index 06b7fd5cee626..abceb69754ba2 100644 +--- a/chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.cc ++++ b/chrome/browser/ash/cryptauth/gcm_device_info_provider_impl.cc +@@ -53,7 +53,7 @@ const cryptauth::GcmDeviceInfo& GcmDeviceInfoProviderImpl::GetGcmDeviceInfo() + const { + static const base::NoDestructor gcm_device_info([] { + static const google::protobuf::int64 kSoftwareVersionCode = +- HashStringToInt64(version_info::GetLastChange()); ++ HashStringToInt64(std::string(version_info::GetLastChange())); + + cryptauth::GcmDeviceInfo gcm_device_info; + +@@ -61,7 +61,7 @@ const cryptauth::GcmDeviceInfo& GcmDeviceInfoProviderImpl::GetGcmDeviceInfo() + CryptAuthDeviceIdProviderImpl::GetInstance()->GetDeviceId()); + gcm_device_info.set_device_type(cryptauth::CHROME); + gcm_device_info.set_device_software_version( +- version_info::GetVersionNumber()); ++ std::string(version_info::GetVersionNumber())); + gcm_device_info.set_device_software_version_code(kSoftwareVersionCode); + gcm_device_info.set_locale( + ChromeContentBrowserClient().GetApplicationLocale()); +diff --git a/chrome/browser/ash/policy/reporting/os_updates/os_updates_reporter.cc b/chrome/browser/ash/policy/reporting/os_updates/os_updates_reporter.cc +index 3c472d4b5523a..f0e9ff4b26c30 100644 +--- a/chrome/browser/ash/policy/reporting/os_updates/os_updates_reporter.cc ++++ b/chrome/browser/ash/policy/reporting/os_updates/os_updates_reporter.cc +@@ -87,7 +87,7 @@ void OsUpdatesReporter::MaybeReportEvent( + record.set_current_os_version(os_version.value_or("0.0.0.0")); + + record.set_current_channel( +- version_info::GetChannelString(chrome::GetChannel())); ++ std::string(version_info::GetChannelString(chrome::GetChannel()))); + + record.set_event_timestamp_sec(base::Time::Now().ToTimeT()); + +diff --git a/chrome/browser/ash/policy/status_collector/device_status_collector.cc b/chrome/browser/ash/policy/status_collector/device_status_collector.cc +index 79f54fa7b531e..ad388958e423e 100644 +--- a/chrome/browser/ash/policy/status_collector/device_status_collector.cc ++++ b/chrome/browser/ash/policy/status_collector/device_status_collector.cc +@@ -2260,7 +2260,7 @@ bool DeviceStatusCollector::GetActivityTimes( + bool DeviceStatusCollector::GetVersionInfo( + em::DeviceStatusReportRequest* status) { + status->set_os_version(os_version_); +- status->set_browser_version(version_info::GetVersionNumber()); ++ status->set_browser_version(std::string(version_info::GetVersionNumber())); + status->set_channel(ConvertToProtoChannel(chrome::GetChannel())); + + // TODO(b/144081278): Remove when resolved. +diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc +index cfbed0fd8183a..d64ec9853f601 100644 +--- a/chrome/browser/chrome_content_browser_client.cc ++++ b/chrome/browser/chrome_content_browser_client.cc +@@ -6732,7 +6732,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 2ceb97a802bc1..2bd33e135d996 100644 +--- a/chrome/browser/enterprise/connectors/reporting/crash_reporting_context.cc ++++ b/chrome/browser/enterprise/connectors/reporting/crash_reporting_context.cc +@@ -158,10 +158,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 878e942c0d0e1..dce78773e8d90 100644 +--- a/chrome/browser/extensions/chrome_extensions_browser_client.cc ++++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc +@@ -381,7 +381,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 897395dcb652f..708760849fd7f 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 1a2fe8936295a..6e0be649b9abe 100644 +--- a/chrome/browser/permissions/chrome_permissions_client.cc ++++ b/chrome/browser/permissions/chrome_permissions_client.cc +@@ -266,7 +266,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 d221283aeca39..26e1b63b28b7c 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 4e2316a49e9ff..89364e6d674a6 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 67545be033281..3b8d17cfa4a12 100644 +--- a/chrome/browser/ui/webui/version/version_ui.cc ++++ b/chrome/browser/ui/webui/version/version_ui.cc +@@ -201,7 +201,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()); + +@@ -217,7 +217,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 +@@ -229,7 +230,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) +@@ -275,7 +277,7 @@ void VersionUI::AddVersionDetailStrings(content::WebUIDataSource* html_source) { + #endif // BUILDFLAG(IS_WIN) + + 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 85fe22f08ef84..8fe0242658110 100644 +--- a/chrome/updater/configurator.cc ++++ b/chrome/updater/configurator.cc +@@ -121,7 +121,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 d1a4df0f2ec5e..5813684a4b1d4 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 9d9a0aac10a35..056e83de773ee 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()); + } + } + } +@@ -565,7 +564,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 416c7a32fdbab..cc4654e6472fb 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 50933f33ef2f9..d358053dc201e 100644 +--- a/components/security_interstitials/content/certificate_error_report.cc ++++ b/components/security_interstitials/content/certificate_error_report.cc +@@ -508,8 +508,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 cf1f08169af6a..0ef3efb07d4e5 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" +@@ -230,9 +231,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 c32877b83a730..843bd35279659 100644 +--- a/components/update_client/update_query_params.cc ++++ b/components/update_client/update_query_params.cc +@@ -149,7 +149,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/0020-Revert-__attribute__-and-alignas-changes.patch b/meta-chromium/recipes-browser/chromium/files/0020-Revert-__attribute__-and-alignas-changes.patch new file mode 100644 index 000000000..6fb80a323 --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0020-Revert-__attribute__-and-alignas-changes.patch @@ -0,0 +1,103 @@ +From 90b6f5b07d977c14bd600b7d03ffc08a1215633f Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Thu, 25 May 2023 20:41:55 +0000 +Subject: [PATCH] Revert `__attribute__` and `alignas` changes + +https://crrev.com/c/4322480 made some changes to Chromium's use of +attributes, which also included how they are used together with the +alignas syntax. Quoting a comment introduced in that CL: +> Historically, compilers had trouble mixing __attribute__((...)) syntax +> with alignas(...) syntax. However, at least Clang is very accepting +> nowadays. + +This isn't the case for the clang versions we use (<= 15), so we need to +revert that change. + +Other changes from the linked CL are also suboptimal, e.g. +[[clang::noinline]] and [[clang::always_inline]] are only available +since clang 15, and using them on older versions leads to warnings (and +in this case, they're used quite often, so the compile logs are quite +cluttered). However, the changes are not easily revertable, because they +require keyword order changes in lots of files. To avoid an increased +number of conflicts when rebasing this patch for newer version, we just +keep the warnings and ignore them. (The compiler should still generate +reasonably performant code even without the explicit inlining +annotations.) + +Upstream-Status: Inappropriate +Signed-off-by: Max Ihlenfeldt +--- + .../partition_alloc_base/compiler_specific.h | 23 +++++++++++++------ + base/compiler_specific.h | 23 +++++++++++++------ + 2 files changed, 32 insertions(+), 14 deletions(-) + +diff --git a/base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h b/base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h +index 77ec1fe9b64c9..d011f6e3678df 100644 +--- a/base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h ++++ b/base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h +@@ -66,14 +66,23 @@ + // + // In most places you can use the C++11 keyword "alignas", which is preferred. + // +-// Historically, compilers had trouble mixing __attribute__((...)) syntax with +-// alignas(...) syntax. However, at least Clang is very accepting nowadays. It +-// may be that this macro can be removed entirely. +-#if defined(__clang__) +-#define PA_ALIGNAS(byte_alignment) alignas(byte_alignment) +-#elif defined(COMPILER_MSVC) ++// But compilers have trouble mixing __attribute__((...)) syntax with ++// alignas(...) syntax. ++// ++// Doesn't work in clang or gcc: ++// struct alignas(16) __attribute__((packed)) S { char c; }; ++// Works in clang but not gcc: ++// struct __attribute__((packed)) alignas(16) S2 { char c; }; ++// Works in clang and gcc: ++// struct alignas(16) S3 { char c; } __attribute__((packed)); ++// ++// There are also some attributes that must be specified *before* a class ++// definition: visibility (used for exporting functions/classes) is one of ++// these attributes. This means that it is not possible to use alignas() with a ++// class that is marked as exported. ++#if defined(COMPILER_MSVC) + #define PA_ALIGNAS(byte_alignment) __declspec(align(byte_alignment)) +-#elif defined(COMPILER_GCC) && PA_HAS_ATTRIBUTE(aligned) ++#elif defined(COMPILER_GCC) + #define PA_ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) + #endif + +diff --git a/base/compiler_specific.h b/base/compiler_specific.h +index a961fe938cc5b..d8c4fcf7eddb3 100644 +--- a/base/compiler_specific.h ++++ b/base/compiler_specific.h +@@ -82,14 +82,23 @@ + // + // In most places you can use the C++11 keyword "alignas", which is preferred. + // +-// Historically, compilers had trouble mixing __attribute__((...)) syntax with +-// alignas(...) syntax. However, at least Clang is very accepting nowadays. It +-// may be that this macro can be removed entirely. +-#if defined(__clang__) +-#define ALIGNAS(byte_alignment) alignas(byte_alignment) +-#elif defined(COMPILER_MSVC) ++// But compilers have trouble mixing __attribute__((...)) syntax with ++// alignas(...) syntax. ++// ++// Doesn't work in clang or gcc: ++// struct alignas(16) __attribute__((packed)) S { char c; }; ++// Works in clang but not gcc: ++// struct __attribute__((packed)) alignas(16) S2 { char c; }; ++// Works in clang and gcc: ++// struct alignas(16) S3 { char c; } __attribute__((packed)); ++// ++// There are also some attributes that must be specified *before* a class ++// definition: visibility (used for exporting functions/classes) is one of ++// these attributes. This means that it is not possible to use alignas() with a ++// class that is marked as exported. ++#if defined(COMPILER_MSVC) + #define ALIGNAS(byte_alignment) __declspec(align(byte_alignment)) +-#elif defined(COMPILER_GCC) && HAS_ATTRIBUTE(aligned) ++#elif defined(COMPILER_GCC) + #define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) + #endif + 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 new file mode 100644 index 000000000..f533bc617 --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0021-Add-missing-typename-s.patch @@ -0,0 +1,56 @@ +From 473edb8e39c92d1a02b6af621247b039c23c11e5 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Mon, 5 Jun 2023 09:57:26 +0000 +Subject: [PATCH] Add missing "typename"s + +This is a backport of https://crrev.com/c/4520587 with some additions. +Together, they fix a dunfell compilation error. The backported part (the +changes to the header file) will be part of the 115 upstream release. + +Upstream-Status: Inappropriate +Signed-off-by: Max Ihlenfeldt +--- + .../download/bubble/download_bubble_update_service.cc | 6 +++--- + .../download/bubble/download_bubble_update_service.h | 4 ++-- + 2 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 +--- 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) { + // 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) { + CHECK(!cache.empty()); + auto it = cache.end(); + return std::prev(it); +@@ -789,9 +789,9 @@ bool DownloadBubbleUpdateService::RemoveItemFromCacheImpl( + } + + template +-SortedItems::iterator ++typename SortedItems::iterator + DownloadBubbleUpdateService::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/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 new file mode 100644 index 000000000..2c6e06bbc --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0022-Backport-Avoid-capturing-structured-bindings.patch @@ -0,0 +1,189 @@ +From 0d30966b0d9e64003b7e7d5b20ac167ef1060ba2 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Tue, 30 May 2023 15:56:51 +0000 +Subject: [PATCH] Backport "Avoid capturing structured bindings" + +This is a backport of https://crrev.com/c/4526976, which refactors some +code to avoid capturing structured bindings in lambdas. This is a C++20 +feature and leads to compile errors when using older versions of clang. + +Upstream-Status: Backport [https://crrev.com/c/4526976] +Signed-off-by: Max Ihlenfeldt +--- + .../ng/grid/ng_grid_layout_algorithm.cc | 64 +++++++++---------- + 1 file changed, 32 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 640c8638f4d0a..38034562eaa61 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 +@@ -516,13 +516,12 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( + row_auto_repetitions); + + bool has_nested_subgrid = false; +- auto& [grid_items, layout_data, subtree_size] = +- sizing_tree->CreateSizingData(); ++ auto& sizing_data = sizing_tree->CreateSizingData(); + + 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; +@@ -534,7 +533,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); + +@@ -544,7 +543,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)); +@@ -561,21 +560,21 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( + BuildSizingCollection(kForRows); + + if (!has_nested_subgrid) +- 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 (must_build_sizing_column_collection) { +- layout_data.SizingCollection(kForColumns).CacheDefiniteSetsGeometry(); ++ sizing_data.layout_data.SizingCollection(kForColumns).CacheDefiniteSetsGeometry(); + } + if (must_build_sizing_row_collection) { +- 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) { + if (!grid_item.IsSubgrid()) + continue; + +@@ -583,17 +582,17 @@ 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); + + NGConstraintSpace unused_space; + NGFragmentGeometry unused_fragment_geometry; + auto subgrid_algorithm = CreateSubgridLayoutAlgorithm( + subgrid_data, &unused_space, &unused_fragment_geometry); + +- subtree_size += subgrid_algorithm.BuildGridSizingSubtree( ++ sizing_data.subtree_size += subgrid_algorithm.BuildGridSizingSubtree( + sizing_tree, /* oof_children */ nullptr, subgrid_data, + &placement_data.line_resolver); + +@@ -603,7 +602,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, +@@ -614,7 +613,7 @@ wtf_size_t NGGridLayoutAlgorithm::BuildGridSizingSubtree( + if (must_build_sizing_row_collection) + BuildSizingCollection(kForRows); + +- return subtree_size; ++ return sizing_data.subtree_size; + } + + NGGridSizingTree NGGridLayoutAlgorithm::BuildGridSizingTree( +@@ -1540,22 +1539,23 @@ void NGGridLayoutAlgorithm::InitializeTrackSizes( + NGGridSizingTree* sizing_tree) const { + DCHECK(sizing_tree && current_grid_index < sizing_tree->Size()); + +- auto& [grid_items, layout_data, subtree_size] = +- sizing_tree->At(current_grid_index); ++ auto& sizing_data = sizing_tree->At(current_grid_index); + + 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 = +@@ -1587,20 +1587,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; + } + + wtf_size_t next_subgrid_index = current_grid_index + 1; +- for (const auto& grid_item : grid_items) { ++ for (const auto& grid_item : sizing_data.grid_items) { + if (!grid_item.IsSubgrid()) { + continue; + } + +- DCHECK_LT(next_subgrid_index, current_grid_index + subtree_size); +- NGSubgriddedItemData subgrid_data(grid_item, layout_data); ++ DCHECK_LT(next_subgrid_index, current_grid_index + sizing_data.subtree_size); ++ NGSubgriddedItemData subgrid_data(grid_item, sizing_data.layout_data); + + NGConstraintSpace unused_space; + NGFragmentGeometry unused_fragment_geometry; +@@ -1612,7 +1612,7 @@ void NGGridLayoutAlgorithm::InitializeTrackSizes( + + next_subgrid_index += sizing_tree->SubtreeSize(next_subgrid_index); + } +- DCHECK_EQ(next_subgrid_index, current_grid_index + subtree_size); ++ DCHECK_EQ(next_subgrid_index, current_grid_index + sizing_data.subtree_size); + } + + void NGGridLayoutAlgorithm::InitializeTrackSizes( diff --git a/meta-chromium/recipes-browser/chromium/files/0023-Backport-IWYU-for-translate-TranslateUILanguagesMana.patch b/meta-chromium/recipes-browser/chromium/files/0023-Backport-IWYU-for-translate-TranslateUILanguagesMana.patch new file mode 100644 index 000000000..6b910c97c --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0023-Backport-IWYU-for-translate-TranslateUILanguagesMana.patch @@ -0,0 +1,27 @@ +From d8ad13ef134f402c28778f975638c80d0191bb14 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Wed, 31 May 2023 09:36:06 +0000 +Subject: [PATCH] Backport "IWYU for translate::TranslateUILanguagesManager" + +This adds two missing includes, one of which can lead to compile errors +if omitted. This patch will be included in upstream's 116 release. + +Upstream-Status: Backport [https://crrev.com/c/4587962] +Signed-off-by: Max Ihlenfeldt +--- + .../translate/core/browser/translate_ui_languages_manager.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/components/translate/core/browser/translate_ui_languages_manager.h b/components/translate/core/browser/translate_ui_languages_manager.h +index a7e07edee31ee..650155569b74b 100644 +--- a/components/translate/core/browser/translate_ui_languages_manager.h ++++ b/components/translate/core/browser/translate_ui_languages_manager.h +@@ -8,6 +8,8 @@ + #include + + #include ++#include ++#include + + #include "base/memory/weak_ptr.h" + #include "third_party/icu/source/i18n/unicode/coll.h" diff --git a/meta-chromium/recipes-browser/chromium/files/0024-Backport-Fix-erroneous-SupportsOstreamOperator-int-i.patch b/meta-chromium/recipes-browser/chromium/files/0024-Backport-Fix-erroneous-SupportsOstreamOperator-int-i.patch new file mode 100644 index 000000000..0323b3dfb --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0024-Backport-Fix-erroneous-SupportsOstreamOperator-int-i.patch @@ -0,0 +1,954 @@ +From 77b8f73377ed0a1745e3a79b54d3161e134477fc Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Wed, 31 May 2023 09:47:40 +0000 +Subject: [PATCH] Backport "Fix erroneous SupportsOstreamOperator + instantiation." + +This backported patch fixes a compilation error on dunfell. It will be +included in the 114 release. + +Upstream-Status: Backport [https://crrev.com/c/4448868] +Signed-off-by: Max Ihlenfeldt +--- + base/BUILD.gn | 4 + + base/check_op.h | 1 + + base/strings/string_util.h | 90 -------------- + base/strings/string_util_unittest.cc | 74 ------------ + base/strings/to_string.h | 110 ++++++++++++++++++ + base/strings/to_string_test.cc | 106 +++++++++++++++++ + base/template_util.h | 9 -- + base/template_util_unittest.cc | 49 +------- + base/types/strong_alias.h | 4 +- + base/types/strong_alias_unittest.cc | 8 +- + base/types/supports_ostream_operator.h | 28 +++++ + base/types/supports_ostream_operator_test.cc | 68 +++++++++++ + .../externally_managed_install_command.cc | 2 +- + .../fetch_manifest_and_install_command.cc | 1 + + .../commands/install_from_info_command.cc | 1 + + .../commands/install_from_manifest_command.cc | 2 +- + .../commands/install_from_sync_command.cc | 2 +- + .../commands/install_placeholder_command.cc | 1 + + .../commands/manifest_update_check_command.cc | 1 + + .../manifest_update_finalize_command.cc | 2 +- + .../commands/sub_app_install_command.cc | 2 +- + ...pdate_protocol_handler_approval_command.cc | 2 +- + .../commands/web_app_uninstall_command.cc | 2 +- + chrome/browser/web_applications/web_app.cc | 2 +- + .../web_applications/web_app_registrar.cc | 2 +- + .../common/persisted_trial_token_unittest.cc | 2 +- + 26 files changed, 338 insertions(+), 237 deletions(-) + create mode 100644 base/strings/to_string.h + create mode 100644 base/strings/to_string_test.cc + create mode 100644 base/types/supports_ostream_operator.h + create mode 100644 base/types/supports_ostream_operator_test.cc + +diff --git a/base/BUILD.gn b/base/BUILD.gn +index a3d75f04f6aff..c118467eeb3f9 100644 +--- a/base/BUILD.gn ++++ b/base/BUILD.gn +@@ -665,6 +665,7 @@ component("base") { + "strings/stringprintf.cc", + "strings/stringprintf.h", + "strings/sys_string_conversions.h", ++ "strings/to_string.h", + "strings/utf_offset_string_conversions.cc", + "strings/utf_offset_string_conversions.h", + "strings/utf_string_conversion_utils.cc", +@@ -943,6 +944,7 @@ component("base") { + "types/optional_util.h", + "types/pass_key.h", + "types/strong_alias.h", ++ "types/supports_ostream_operator.h", + "types/token_type.h", + "types/variant_util.h", + "unguessable_token.cc", +@@ -3281,6 +3283,7 @@ test("base_unittests") { + "strings/stringize_macros_unittest.cc", + "strings/stringprintf_unittest.cc", + "strings/sys_string_conversions_unittest.cc", ++ "strings/to_string_test.cc", + "strings/utf_offset_string_conversions_unittest.cc", + "strings/utf_string_conversions_unittest.cc", + "substring_set_matcher/string_pattern_unittest.cc", +@@ -3415,6 +3418,7 @@ test("base_unittests") { + "types/optional_util_unittest.cc", + "types/pass_key_unittest.cc", + "types/strong_alias_unittest.cc", ++ "types/supports_ostream_operator_test.cc", + "types/token_type_unittest.cc", + "types/variant_util_unittest.cc", + "unguessable_token_unittest.cc", +diff --git a/base/check_op.h b/base/check_op.h +index 07ad07d1e0e3b..d323229fc5371 100644 +--- a/base/check_op.h ++++ b/base/check_op.h +@@ -15,6 +15,7 @@ + #include "base/debug/debugging_buildflags.h" + #include "base/memory/raw_ptr_exclusion.h" + #include "base/template_util.h" ++#include "base/types/supports_ostream_operator.h" + + // This header defines the (DP)CHECK_EQ etc. macros. + // +diff --git a/base/strings/string_util.h b/base/strings/string_util.h +index 120ffb20bef61..0367af552eadb 100644 +--- a/base/strings/string_util.h ++++ b/base/strings/string_util.h +@@ -13,8 +13,6 @@ + #include + + #include +-#include +-#include + #include + #include + #include +@@ -26,7 +24,6 @@ + #include "base/cxx20_to_address.h" + #include "base/strings/string_piece.h" // For implicit conversions. + #include "base/strings/string_util_internal.h" +-#include "base/template_util.h" + #include "build/build_config.h" + + namespace base { +@@ -116,93 +113,6 @@ constexpr WStringPiece MakeWStringPiece(Iter begin, Iter end) { + return MakeBasicStringPiece(begin, end); + } + +-// Convert a type with defined `operator<<` or `.ToString()` method into a +-// string. +- +-// I/O manipulators are function pointers, but should be sent directly to the +-// `ostream` instead of being cast to `const void*` like other function +-// pointers. +-template +-constexpr bool IsIomanip = false; +-template +-constexpr bool +- IsIomanip>> = +- true; +- +-// Function pointers implicitly convert to `bool`, so use this to avoid printing +-// function pointers as 1 or 0. +-template +-constexpr bool WillBeIncorrectlyStreamedAsBool = false; +-template +-constexpr bool WillBeIncorrectlyStreamedAsBool< +- T, +- std::enable_if_t> && +- !IsIomanip>>> = true; +- +-// Fallback case when there is no better representation. +-template +-struct ToStringHelper { +- static void Stringify(const T& v, std::ostringstream& ss) { +- ss << "[" << sizeof(v) << "-byte object at 0x" << std::addressof(v) << "]"; +- } +-}; +- +-// Most streamables. +-template +-struct ToStringHelper< +- T, +- std::enable_if_t::value && +- !WillBeIncorrectlyStreamedAsBool>> { +- static void Stringify(const T& v, std::ostringstream& ss) { ss << v; } +-}; +- +-// Functions and function pointers. +-template +-struct ToStringHelper< +- T, +- std::enable_if_t::value && +- WillBeIncorrectlyStreamedAsBool>> { +- static void Stringify(const T& v, std::ostringstream& ss) { +- ToStringHelper::Stringify(reinterpret_cast(v), +- ss); +- } +-}; +- +-// Non-streamables that have a `ToString` member. +-template +-struct ToStringHelper< +- T, +- std::enable_if_t< +- !base::internal::SupportsOstreamOperator::value && +- base::internal::SupportsToString::value>> { +- static void Stringify(const T& v, std::ostringstream& ss) { +- // .ToString() may not return a std::string, e.g. blink::WTF::String. +- ToStringHelper::Stringify(v.ToString(), ss); +- } +-}; +- +-// Non-streamable enums (i.e. scoped enums where no `operator<<` overload was +-// declared). +-template +-struct ToStringHelper::value && +- std::is_enum_v>> { +- static void Stringify(const T& v, std::ostringstream& ss) { +- using UT = typename std::underlying_type_t; +- ToStringHelper::Stringify(static_cast(v), ss); +- } +-}; +- +-template +-std::string ToString(const Ts&... values) { +- std::ostringstream ss; +- (ToStringHelper>::Stringify( +- values, ss), +- ...); +- return ss.str(); +-} +- + // ASCII-specific tolower. The standard library's tolower is locale sensitive, + // so we don't want to use it here. + template (nullptr))); +-} +- + TEST(StringUtilTest, RemoveChars) { + const char kRemoveChars[] = "-/+*"; + std::string input = "A-+bc/d!*"; +diff --git a/base/strings/to_string.h b/base/strings/to_string.h +new file mode 100644 +index 0000000000000..216963efee469 +--- /dev/null ++++ b/base/strings/to_string.h +@@ -0,0 +1,110 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef BASE_STRINGS_TO_STRING_H_ ++#define BASE_STRINGS_TO_STRING_H_ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "base/template_util.h" ++#include "base/types/supports_ostream_operator.h" ++ ++namespace base { ++ ++namespace internal { ++ ++// I/O manipulators are function pointers, but should be sent directly to the ++// `ostream` instead of being cast to `const void*` like other function ++// pointers. ++template ++constexpr bool IsIomanip = false; ++template ++constexpr bool ++ IsIomanip>> = ++ true; ++ ++// Function pointers implicitly convert to `bool`, so use this to avoid printing ++// function pointers as 1 or 0. ++template ++constexpr bool WillBeIncorrectlyStreamedAsBool = false; ++template ++constexpr bool WillBeIncorrectlyStreamedAsBool< ++ T, ++ std::enable_if_t> && ++ !IsIomanip>>> = true; ++ ++// Fallback case when there is no better representation. ++template ++struct ToStringHelper { ++ static void Stringify(const T& v, std::ostringstream& ss) { ++ ss << "[" << sizeof(v) << "-byte object at 0x" << std::addressof(v) << "]"; ++ } ++}; ++ ++// Most streamables. ++template ++struct ToStringHelper< ++ T, ++ std::enable_if_t::value && ++ !WillBeIncorrectlyStreamedAsBool>> { ++ static void Stringify(const T& v, std::ostringstream& ss) { ss << v; } ++}; ++ ++// Functions and function pointers. ++template ++struct ToStringHelper< ++ T, ++ std::enable_if_t::value && ++ WillBeIncorrectlyStreamedAsBool>> { ++ static void Stringify(const T& v, std::ostringstream& ss) { ++ ToStringHelper::Stringify(reinterpret_cast(v), ++ ss); ++ } ++}; ++ ++// Non-streamables that have a `ToString` member. ++template ++struct ToStringHelper< ++ T, ++ std::enable_if_t::value && ++ SupportsToString::value>> { ++ static void Stringify(const T& v, std::ostringstream& ss) { ++ // .ToString() may not return a std::string, e.g. blink::WTF::String. ++ ToStringHelper::Stringify(v.ToString(), ss); ++ } ++}; ++ ++// Non-streamable enums (i.e. scoped enums where no `operator<<` overload was ++// declared). ++template ++struct ToStringHelper< ++ T, ++ std::enable_if_t::value && ++ std::is_enum_v>> { ++ static void Stringify(const T& v, std::ostringstream& ss) { ++ using UT = typename std::underlying_type_t; ++ ToStringHelper::Stringify(static_cast(v), ss); ++ } ++}; ++ ++} // namespace internal ++ ++// Converts any type to a string, preferring defined operator<<() or ToString() ++// methods if they exist. ++template ++std::string ToString(const Ts&... values) { ++ std::ostringstream ss; ++ (internal::ToStringHelper>::Stringify(values, ++ ss), ++ ...); ++ return ss.str(); ++} ++ ++} // namespace base ++ ++#endif // BASE_STRINGS_TO_STRING_H_ +diff --git a/base/strings/to_string_test.cc b/base/strings/to_string_test.cc +new file mode 100644 +index 0000000000000..7938205214649 +--- /dev/null ++++ b/base/strings/to_string_test.cc +@@ -0,0 +1,106 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "base/strings/to_string.h" ++ ++#include ++#include ++#include ++ ++#include "testing/gtest/include/gtest/gtest.h" ++ ++namespace base { ++namespace { ++ ++TEST(ToStringTest, Streamable) { ++ // Types with built-in <<. ++ EXPECT_EQ(ToString("foo"), "foo"); ++ EXPECT_EQ(ToString(123), "123"); ++} ++ ++enum class StreamableTestEnum { kGreeting, kLocation }; ++ ++std::ostream& operator<<(std::ostream& os, const StreamableTestEnum& value) { ++ switch (value) { ++ case StreamableTestEnum::kGreeting: ++ return os << "hello"; ++ case StreamableTestEnum::kLocation: ++ return os << "world"; ++ } ++} ++ ++TEST(ToStringTest, UserDefinedStreamable) { ++ // Type with user-defined <<. ++ EXPECT_EQ(ToString(StreamableTestEnum::kGreeting), "hello"); ++ EXPECT_EQ(ToString(StreamableTestEnum::kGreeting, " ", ++ StreamableTestEnum::kLocation), ++ "hello world"); ++} ++ ++class HasToString { ++ public: ++ std::string ToString() const { return "yay!"; } ++}; ++ ++TEST(ToStringTest, UserDefinedToString) { ++ // Type with user-defined ToString(). ++ EXPECT_EQ(ToString(HasToString()), "yay!"); ++} ++ ++class UnusualToString { ++ public: ++ HasToString ToString() const { return HasToString(); } ++}; ++ ++TEST(ToStringTest, ToStringReturnsNonStdString) { ++ // Types with a ToString() that does not directly return a std::string should ++ // still work. ++ EXPECT_EQ(ToString(UnusualToString()), "yay!"); ++} ++ ++enum class NonStreamableTestEnum { kGreeting = 0, kLocation }; ++ ++TEST(ToStringTest, ScopedEnum) { ++ // Scoped enums without a defined << should print as their underlying type. ++ EXPECT_EQ(ToString(NonStreamableTestEnum::kLocation), "1"); ++} ++ ++TEST(ToStringTest, IoManip) { ++ // I/O manipulators should have their expected effect, not be printed as ++ // function pointers. ++ EXPECT_EQ(ToString("42 in hex is ", std::hex, 42), "42 in hex is 2a"); ++} ++ ++void Func() {} ++ ++TEST(ToStringTest, FunctionPointer) { ++ // We don't care about the actual address, but a function pointer should not ++ // be implicitly converted to bool. ++ EXPECT_NE(ToString(&Func), ToString(true)); ++ ++ // Functions should be treated like function pointers. ++ EXPECT_EQ(ToString(Func), ToString(&Func)); ++} ++ ++class NotStringifiable {}; ++ ++class OverloadsAddressOp { ++ public: ++ OverloadsAddressOp* operator&() { return nullptr; } ++ const OverloadsAddressOp* operator&() const { return nullptr; } ++}; ++ ++TEST(ToStringTest, NonStringifiable) { ++ // Non-stringifiable types should be printed using a fallback. ++ EXPECT_NE(ToString(NotStringifiable()).find("-byte object at 0x"), ++ std::string::npos); ++ ++ // Non-stringifiable types which overload operator& should print their real ++ // address. ++ EXPECT_NE(ToString(OverloadsAddressOp()), ++ ToString(static_cast(nullptr))); ++} ++ ++} // namespace ++} // namespace base +diff --git a/base/template_util.h b/base/template_util.h +index 415b3acf1c9a4..e192110d09534 100644 +--- a/base/template_util.h ++++ b/base/template_util.h +@@ -18,15 +18,6 @@ namespace base { + + namespace internal { + +-// Uses expression SFINAE to detect whether using operator<< would work. +-template +-struct SupportsOstreamOperator : std::false_type {}; +-template +-struct SupportsOstreamOperator() +- << std::declval()))> +- : std::true_type {}; +- + template + struct SupportsToString : std::false_type {}; + template +diff --git a/base/template_util_unittest.cc b/base/template_util_unittest.cc +index 2774b5cac204f..efcea3d6d9adb 100644 +--- a/base/template_util_unittest.cc ++++ b/base/template_util_unittest.cc +@@ -4,6 +4,8 @@ + + #include "base/template_util.h" + ++#include ++ + #include + #include + +@@ -17,58 +19,11 @@ namespace { + enum SimpleEnum { SIMPLE_ENUM }; + enum EnumWithExplicitType : uint64_t { ENUM_WITH_EXPLICIT_TYPE }; + enum class ScopedEnum { SCOPED_ENUM }; +-enum class ScopedEnumWithOperator { SCOPED_ENUM_WITH_OPERATOR }; +-std::ostream& operator<<(std::ostream& os, ScopedEnumWithOperator v) { +- return os; +-} + struct SimpleStruct {}; +-struct StructWithOperator {}; +-std::ostream& operator<<(std::ostream& os, const StructWithOperator& v) { +- return os; +-} + struct StructWithToString { + std::string ToString() const { return ""; } + }; + +-// A few standard types that definitely support printing. +-static_assert(internal::SupportsOstreamOperator::value, +- "ints should be printable"); +-static_assert(internal::SupportsOstreamOperator::value, +- "C strings should be printable"); +-static_assert(internal::SupportsOstreamOperator::value, +- "std::string should be printable"); +- +-// Various kinds of enums operator<< support. +-static_assert(internal::SupportsOstreamOperator::value, +- "simple enum should be printable by value"); +-static_assert(internal::SupportsOstreamOperator::value, +- "simple enum should be printable by const ref"); +-static_assert(internal::SupportsOstreamOperator::value, +- "enum with explicit type should be printable by value"); +-static_assert( +- internal::SupportsOstreamOperator::value, +- "enum with explicit type should be printable by const ref"); +-static_assert(!internal::SupportsOstreamOperator::value, +- "scoped enum should not be printable by value"); +-static_assert(!internal::SupportsOstreamOperator::value, +- "simple enum should not be printable by const ref"); +-static_assert(internal::SupportsOstreamOperator::value, +- "scoped enum with operator<< should be printable by value"); +-static_assert( +- internal::SupportsOstreamOperator::value, +- "scoped enum with operator<< should be printable by const ref"); +- +-// operator<< support on structs. +-static_assert(!internal::SupportsOstreamOperator::value, +- "simple struct should not be printable by value"); +-static_assert(!internal::SupportsOstreamOperator::value, +- "simple struct should not be printable by const ref"); +-static_assert(internal::SupportsOstreamOperator::value, +- "struct with operator<< should be printable by value"); +-static_assert( +- internal::SupportsOstreamOperator::value, +- "struct with operator<< should be printable by const ref"); +- + // .ToString() support on structs. + static_assert(!internal::SupportsToString::value, + "simple struct value doesn't support .ToString()"); +diff --git a/base/types/strong_alias.h b/base/types/strong_alias.h +index 8a757be57346c..7a4872a4a06ca 100644 +--- a/base/types/strong_alias.h ++++ b/base/types/strong_alias.h +@@ -9,8 +9,8 @@ + #include + #include + +-#include "base/template_util.h" + #include "base/trace_event/base_tracing_forward.h" ++#include "base/types/supports_ostream_operator.h" + + namespace base { + +@@ -154,7 +154,7 @@ class StrongAlias { + template ::value>> ++ internal::SupportsOstreamOperator::value>> + std::ostream& operator<<(std::ostream& stream, + const StrongAlias& alias) { + return stream << alias.value(); +diff --git a/base/types/strong_alias_unittest.cc b/base/types/strong_alias_unittest.cc +index 6cc211adc658e..7ab1444d1af57 100644 +--- a/base/types/strong_alias_unittest.cc ++++ b/base/types/strong_alias_unittest.cc +@@ -14,7 +14,7 @@ + #include + + #include "base/strings/string_piece.h" +-#include "base/template_util.h" ++#include "base/types/supports_ostream_operator.h" + #include "testing/gtest/include/gtest/gtest.h" + + #if BUILDFLAG(ENABLE_BASE_TRACING) +@@ -371,8 +371,7 @@ TEST(StrongAliasTest, EnsureConstexpr) { + void StreamOperatorExists() { + // Aliases of ints should be streamable because ints are streamable. + using StreamableAlias = StrongAlias; +- static_assert(base::internal::SupportsOstreamOperator::value, +- ""); ++ static_assert(internal::SupportsOstreamOperator::value); + + // Aliases of a class which does not expose a stream operator should + // themselves not be streamable. +@@ -381,8 +380,7 @@ void StreamOperatorExists() { + Scope() = default; + }; + using NonStreamableAlias = StrongAlias; +- static_assert( +- !base::internal::SupportsOstreamOperator::value, ""); ++ static_assert(!internal::SupportsOstreamOperator::value); + } + + #if BUILDFLAG(ENABLE_BASE_TRACING) +diff --git a/base/types/supports_ostream_operator.h b/base/types/supports_ostream_operator.h +new file mode 100644 +index 0000000000000..0803db4862be2 +--- /dev/null ++++ b/base/types/supports_ostream_operator.h +@@ -0,0 +1,28 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef BASE_TYPES_SUPPORTS_OSTREAM_OPERATOR_H_ ++#define BASE_TYPES_SUPPORTS_OSTREAM_OPERATOR_H_ ++ ++#include ++#include ++#include ++ ++namespace base::internal { ++ ++// Uses expression SFINAE to detect whether using operator<< would work. ++// ++// Note that the above #include of is necessary to guarantee ++// consistent results here for basic types. ++template ++struct SupportsOstreamOperator : std::false_type {}; ++template ++struct SupportsOstreamOperator() ++ << std::declval()))> ++ : std::true_type {}; ++ ++} // namespace base::internal ++ ++#endif // BASE_TYPES_SUPPORTS_OSTREAM_OPERATOR_H_ +diff --git a/base/types/supports_ostream_operator_test.cc b/base/types/supports_ostream_operator_test.cc +new file mode 100644 +index 0000000000000..0f8c3a09d9e6d +--- /dev/null ++++ b/base/types/supports_ostream_operator_test.cc +@@ -0,0 +1,68 @@ ++// Copyright 2023 The Chromium Authors ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "base/types/supports_ostream_operator.h" ++ ++#include ++ ++#include ++#include ++ ++namespace base { ++namespace { ++ ++enum SimpleEnum { SIMPLE_ENUM }; ++enum EnumWithExplicitType : uint64_t { ENUM_WITH_EXPLICIT_TYPE }; ++enum class ScopedEnum { SCOPED_ENUM }; ++enum class ScopedEnumWithOperator { SCOPED_ENUM_WITH_OPERATOR }; ++std::ostream& operator<<(std::ostream& os, ScopedEnumWithOperator v) { ++ return os; ++} ++struct SimpleStruct {}; ++struct StructWithOperator {}; ++std::ostream& operator<<(std::ostream& os, const StructWithOperator& v) { ++ return os; ++} ++ ++// A few standard types that definitely support printing. ++static_assert(internal::SupportsOstreamOperator::value, ++ "ints should be printable"); ++static_assert(internal::SupportsOstreamOperator::value, ++ "C strings should be printable"); ++static_assert(internal::SupportsOstreamOperator::value, ++ "std::string should be printable"); ++ ++// Various kinds of enums operator<< support. ++static_assert(internal::SupportsOstreamOperator::value, ++ "simple enum should be printable by value"); ++static_assert(internal::SupportsOstreamOperator::value, ++ "simple enum should be printable by const ref"); ++static_assert(internal::SupportsOstreamOperator::value, ++ "enum with explicit type should be printable by value"); ++static_assert( ++ internal::SupportsOstreamOperator::value, ++ "enum with explicit type should be printable by const ref"); ++static_assert(!internal::SupportsOstreamOperator::value, ++ "scoped enum should not be printable by value"); ++static_assert(!internal::SupportsOstreamOperator::value, ++ "simple enum should not be printable by const ref"); ++static_assert(internal::SupportsOstreamOperator::value, ++ "scoped enum with operator<< should be printable by value"); ++static_assert( ++ internal::SupportsOstreamOperator::value, ++ "scoped enum with operator<< should be printable by const ref"); ++ ++// operator<< support on structs. ++static_assert(!internal::SupportsOstreamOperator::value, ++ "simple struct should not be printable by value"); ++static_assert(!internal::SupportsOstreamOperator::value, ++ "simple struct should not be printable by const ref"); ++static_assert(internal::SupportsOstreamOperator::value, ++ "struct with operator<< should be printable by value"); ++static_assert( ++ internal::SupportsOstreamOperator::value, ++ "struct with operator<< should be printable by const ref"); ++ ++} // namespace ++} // namespace base +diff --git a/chrome/browser/web_applications/commands/externally_managed_install_command.cc b/chrome/browser/web_applications/commands/externally_managed_install_command.cc +index c9070bcef5a30..f7cf2599cdc61 100644 +--- a/chrome/browser/web_applications/commands/externally_managed_install_command.cc ++++ b/chrome/browser/web_applications/commands/externally_managed_install_command.cc +@@ -9,7 +9,7 @@ + + #include "base/feature_list.h" + #include "base/functional/bind.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "chrome/browser/profiles/profile.h" + #include "chrome/browser/web_applications/commands/web_app_command.h" + #include "chrome/browser/web_applications/external_install_options.h" +diff --git a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.cc b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.cc +index 5a644f592c9f2..10f8a088eeaa1 100644 +--- a/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.cc ++++ b/chrome/browser/web_applications/commands/fetch_manifest_and_install_command.cc +@@ -9,6 +9,7 @@ + + #include "base/feature_list.h" + #include "base/functional/bind.h" ++#include "base/strings/to_string.h" + #include "base/strings/utf_string_conversions.h" + #include "base/values.h" + #include "chrome/browser/profiles/profile.h" +diff --git a/chrome/browser/web_applications/commands/install_from_info_command.cc b/chrome/browser/web_applications/commands/install_from_info_command.cc +index 0bb088e86f57e..8c43b89793a99 100644 +--- a/chrome/browser/web_applications/commands/install_from_info_command.cc ++++ b/chrome/browser/web_applications/commands/install_from_info_command.cc +@@ -11,6 +11,7 @@ + #include "base/functional/bind.h" + #include "base/memory/weak_ptr.h" + #include "base/strings/stringprintf.h" ++#include "base/strings/to_string.h" + #include "chrome/browser/web_applications/locks/app_lock.h" + #include "chrome/browser/web_applications/os_integration/os_integration_manager.h" + #include "chrome/browser/web_applications/web_app.h" +diff --git a/chrome/browser/web_applications/commands/install_from_manifest_command.cc b/chrome/browser/web_applications/commands/install_from_manifest_command.cc +index 634d8566c352e..59e3721160f14 100644 +--- a/chrome/browser/web_applications/commands/install_from_manifest_command.cc ++++ b/chrome/browser/web_applications/commands/install_from_manifest_command.cc +@@ -11,7 +11,7 @@ + #include "base/containers/flat_set.h" + #include "base/containers/flat_tree.h" + #include "base/functional/bind.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "chrome/browser/web_applications/locks/shared_web_contents_lock.h" + #include "chrome/browser/web_applications/locks/shared_web_contents_with_app_lock.h" + #include "chrome/browser/web_applications/locks/web_app_lock_manager.h" +diff --git a/chrome/browser/web_applications/commands/install_from_sync_command.cc b/chrome/browser/web_applications/commands/install_from_sync_command.cc +index e8098f86b7f45..efea58bf47f73 100644 +--- a/chrome/browser/web_applications/commands/install_from_sync_command.cc ++++ b/chrome/browser/web_applications/commands/install_from_sync_command.cc +@@ -10,7 +10,7 @@ + #include "base/containers/flat_set.h" + #include "base/metrics/histogram_functions.h" + #include "base/metrics/histogram_macros.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "base/strings/utf_string_conversions.h" + #include "chrome/browser/profiles/profile.h" + #include "chrome/browser/web_applications/commands/web_app_command.h" +diff --git a/chrome/browser/web_applications/commands/install_placeholder_command.cc b/chrome/browser/web_applications/commands/install_placeholder_command.cc +index efa19a4ae36f0..6640a522be4e7 100644 +--- a/chrome/browser/web_applications/commands/install_placeholder_command.cc ++++ b/chrome/browser/web_applications/commands/install_placeholder_command.cc +@@ -7,6 +7,7 @@ + #include + #include + ++#include "base/strings/to_string.h" + #include "base/strings/utf_string_conversions.h" + #include "base/task/single_thread_task_runner.h" + #include "chrome/browser/profiles/profile.h" +diff --git a/chrome/browser/web_applications/commands/manifest_update_check_command.cc b/chrome/browser/web_applications/commands/manifest_update_check_command.cc +index 33e4c1eb3dfea..a0c793d99a619 100644 +--- a/chrome/browser/web_applications/commands/manifest_update_check_command.cc ++++ b/chrome/browser/web_applications/commands/manifest_update_check_command.cc +@@ -5,6 +5,7 @@ + #include "chrome/browser/web_applications/commands/manifest_update_check_command.h" + + #include "base/feature_list.h" ++#include "base/strings/to_string.h" + #include "base/strings/utf_string_conversions.h" + #include "base/values.h" + #include "chrome/browser/web_applications/callback_utils.h" +diff --git a/chrome/browser/web_applications/commands/manifest_update_finalize_command.cc b/chrome/browser/web_applications/commands/manifest_update_finalize_command.cc +index 28268698ba2ab..88eb54ad260ae 100644 +--- a/chrome/browser/web_applications/commands/manifest_update_finalize_command.cc ++++ b/chrome/browser/web_applications/commands/manifest_update_finalize_command.cc +@@ -8,7 +8,7 @@ + + #include "base/memory/raw_ptr.h" + #include "base/memory/weak_ptr.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "base/strings/utf_string_conversions.h" + #include "base/values.h" + #include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h" +diff --git a/chrome/browser/web_applications/commands/sub_app_install_command.cc b/chrome/browser/web_applications/commands/sub_app_install_command.cc +index 31749a8d97c78..0bf4c30a910fd 100644 +--- a/chrome/browser/web_applications/commands/sub_app_install_command.cc ++++ b/chrome/browser/web_applications/commands/sub_app_install_command.cc +@@ -12,7 +12,7 @@ + #include "base/containers/flat_map.h" + #include "base/functional/callback.h" + #include "base/ranges/algorithm.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "base/values.h" + #include "chrome/browser/profiles/profile.h" + #include "chrome/browser/web_applications/commands/web_app_command.h" +diff --git a/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.cc b/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.cc +index 79013ff6c0564..5fc5ab8799d5a 100644 +--- a/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.cc ++++ b/chrome/browser/web_applications/commands/update_protocol_handler_approval_command.cc +@@ -13,7 +13,7 @@ + #include "base/functional/callback_helpers.h" + #include "base/memory/ptr_util.h" + #include "base/memory/weak_ptr.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "chrome/browser/web_applications/locks/app_lock.h" + #include "chrome/browser/web_applications/os_integration/os_integration_manager.h" + #include "chrome/browser/web_applications/web_app_constants.h" +diff --git a/chrome/browser/web_applications/commands/web_app_uninstall_command.cc b/chrome/browser/web_applications/commands/web_app_uninstall_command.cc +index c321bc0e8e414..dbfb5ad2dcf72 100644 +--- a/chrome/browser/web_applications/commands/web_app_uninstall_command.cc ++++ b/chrome/browser/web_applications/commands/web_app_uninstall_command.cc +@@ -11,7 +11,7 @@ + #include "base/containers/contains.h" + #include "base/functional/bind.h" + #include "base/metrics/histogram_functions.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "chrome/browser/profiles/profile.h" + #include "chrome/browser/web_applications/locks/full_system_lock.h" + #include "chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.h" +diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc +index fb6fc8ea83365..ed3261fcc0c60 100644 +--- a/chrome/browser/web_applications/web_app.cc ++++ b/chrome/browser/web_applications/web_app.cc +@@ -16,7 +16,7 @@ + #include "base/strings/strcat.h" + #include "base/strings/string_number_conversions.h" + #include "base/strings/string_split.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "base/values.h" + #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" + #include "chrome/browser/web_applications/proto/web_app_os_integration_state.pb.h" +diff --git a/chrome/browser/web_applications/web_app_registrar.cc b/chrome/browser/web_applications/web_app_registrar.cc +index 44dfba1652b85..895eaf351653c 100644 +--- a/chrome/browser/web_applications/web_app_registrar.cc ++++ b/chrome/browser/web_applications/web_app_registrar.cc +@@ -16,7 +16,7 @@ + #include "base/functional/bind.h" + #include "base/functional/callback_helpers.h" + #include "base/observer_list.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "build/chromeos_buildflags.h" + #include "chrome/browser/browser_process.h" + #include "chrome/browser/profiles/profile_manager.h" +diff --git a/components/origin_trials/common/persisted_trial_token_unittest.cc b/components/origin_trials/common/persisted_trial_token_unittest.cc +index a41327c97ab93..bd9d301126cf8 100644 +--- a/components/origin_trials/common/persisted_trial_token_unittest.cc ++++ b/components/origin_trials/common/persisted_trial_token_unittest.cc +@@ -7,7 +7,7 @@ + #include + + #include "base/containers/flat_set.h" +-#include "base/strings/string_util.h" ++#include "base/strings/to_string.h" + #include "base/time/time.h" + #include "testing/gtest/include/gtest/gtest.h" + #include "third_party/blink/public/common/origin_trials/trial_token.h" diff --git a/meta-chromium/recipes-browser/chromium/files/0025-Backport-Do-not-use-std-monospace-for-absl-variant.patch b/meta-chromium/recipes-browser/chromium/files/0025-Backport-Do-not-use-std-monospace-for-absl-variant.patch new file mode 100644 index 000000000..777986754 --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0025-Backport-Do-not-use-std-monospace-for-absl-variant.patch @@ -0,0 +1,31 @@ +From 633cb6e0974a2d7a62db4a9ab4caa256f55f9bd7 Mon Sep 17 00:00:00 2001 +From: Max Ihlenfeldt +Date: Thu, 1 Jun 2023 21:20:16 +0000 +Subject: [PATCH] Backport "Do not use std::monospace for absl::variant" + +This backported patch fixes a dunfell compile error due to incorrect +usage of `std::monospace` instead of `absl::monospace`. The upstream +patch will be included in the 114 release. + +Upstream-Status: Backport [https://crrev.com/c/4372590] +Signed-off-by: Max Ihlenfeldt +--- + chrome/browser/webauthn/authenticator_request_dialog_model.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/chrome/browser/webauthn/authenticator_request_dialog_model.h b/chrome/browser/webauthn/authenticator_request_dialog_model.h +index f4992a74bd66b..6a4bcf68bcdf6 100644 +--- a/chrome/browser/webauthn/authenticator_request_dialog_model.h ++++ b/chrome/browser/webauthn/authenticator_request_dialog_model.h +@@ -181,9 +181,9 @@ class AuthenticatorRequestDialogModel { + // These types describe the type of Mechanism. + using Transport = + base::StrongAlias; +- using WindowsAPI = base::StrongAlias; ++ using WindowsAPI = base::StrongAlias; + using Phone = base::StrongAlias; +- using AddPhone = base::StrongAlias; ++ using AddPhone = base::StrongAlias; + using Type = absl::variant; + + Mechanism(Type type, 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 new file mode 100644 index 000000000..d5565c8f4 --- /dev/null +++ b/meta-chromium/recipes-browser/chromium/files/0026-Backport-std-string-ends_with-is-C-20.-Use-base-Ends.patch @@ -0,0 +1,28 @@ +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/gn-native_112.0.5615.165.bb b/meta-chromium/recipes-browser/chromium/gn-native_113.0.5672.126.bb similarity index 100% rename from meta-chromium/recipes-browser/chromium/gn-native_112.0.5615.165.bb rename to meta-chromium/recipes-browser/chromium/gn-native_113.0.5672.126.bb