diff --git a/.gitmodules b/.gitmodules index c91f91e..c02020f 100644 --- a/.gitmodules +++ b/.gitmodules
@@ -215,6 +215,9 @@ [submodule "third_party/dom_distiller_js/dist"] path = third_party/dom_distiller_js/dist url = https://chromium.googlesource.com/chromium/dom-distiller/dist +[submodule "third_party/dragonbox/src"] + path = third_party/dragonbox/src + url = https://chromium.googlesource.com/external/github.com/jk-jeon/dragonbox [submodule "third_party/eigen3/src"] path = third_party/eigen3/src url = https://chromium.googlesource.com/external/gitlab.com/libeigen/eigen
diff --git a/.gn b/.gn index b8756e5..09c0044 100644 --- a/.gn +++ b/.gn
@@ -159,11 +159,6 @@ "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", "//chrome/version.gni", - # TODO(dgn): Layer violation but breaks the build otherwise, see - # https://crbug.com/474506. - "//clank/java/BUILD.gn", - "//clank/native/BUILD.gn", - "//google_apis/BUILD.gn", "//printing/BUILD.gn",
diff --git a/.vpython3 b/.vpython3 index a836f84..1aa99307 100644 --- a/.vpython3 +++ b/.vpython3
@@ -43,7 +43,7 @@ # //tools/perf/crossbench wheel: < name: "infra/python/wheels/protobuf-py3" - version: "version:6.30.1" + version: "version:6.30.2" > # TODO(https://crbug.com/898348): Add in necessary wheels as Python3 versions
diff --git a/DEPS b/DEPS index f7fae61..85b8c81 100644 --- a/DEPS +++ b/DEPS
@@ -303,15 +303,15 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '02cd0561f4f756bf4f7b16641d8fc4c61577c765', + 'skia_revision': '7104f1487466dae855c0c3fb7ff53283dee6b443', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '2267845644deca2b35d41fd0ccb02a7ddf5263d2', + 'v8_revision': '63b423f435cb087182badeb9d4df1cf57f03af1d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '1e4ad682f1e283b0774f08e4da6c5d05381ddb3f', + 'angle_revision': '88710dc139338240b0efd7fdc691d2c69555ed32', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -375,11 +375,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '783d02a67a6832201b5869439feb6692637b86f4', + 'catapult_revision': 'f1f18d8a8d1547cf7441dc4e3e30c833fccf304b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. - 'crossbench_revision': 'ac59b4d0917aa8d3d8c49790978eeeabe7cb3f0c', + 'crossbench_revision': '0bab4408ebd27fde91551ac967c642bfcd9dd69a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -395,7 +395,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '10b25b3abb27b79cc9625170f453988d7e0368e6', + 'devtools_frontend_revision': '07ad609dd5c61cdd3eea197ce9253783da05432f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -419,7 +419,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '7ffa7f79728d68e24e61ed9b8a3c4ad6f37aec8b', + 'dawn_revision': '50b8c9bd99bf3ef47208b07bfe0b4663d9ef181b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -427,11 +427,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ink # and whatever else without interference from each other. - 'ink_revision': 'c542d619a8959415beda5a76fe89ffa2f83df886', + 'ink_revision': 'da9cb551ada1e55309b0ac89b9fbff2d29dbfe1e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ink_stroke_modeler # and whatever else without interference from each other. - 'ink_stroke_modeler_revision': 'f61f28792a00c9bdcb3489fec81d8fd0ca1cbaba', + 'ink_stroke_modeler_revision': '03db1ed37b8b10b47d62ed0fa142d198a3861689', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -443,7 +443,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling jetstream-main # and whatever else without interference from each other. - 'jetstream_main_revision': 'ed6dfc1d181e9003ad095d0fb914a8c961fc54da', + 'jetstream_main_revision': '0976ddeae0863ef5fb3f9ad09906224b0989f9ad', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling jetstream-v2.2 # and whatever else without interference from each other. @@ -515,7 +515,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ffmpeg # and whatever else without interference from each other. - 'ffmpeg_revision': '2a253f5db8a0acfb705b3a0fa387a1e225956e09', + 'ffmpeg_revision': '01f23648c6b84de6c0f717fa4e1816f53b9ee72e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling webpagereplay # and whatever else without interference from each other. @@ -523,7 +523,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling llvm-libc # and whatever else without interference from each other. - 'llvm_libc_revision': '1e5d08e2bb8cca9f544c8fbfae84f2dc1f4d3605', + 'llvm_libc_revision': '64a6b82928934c23e2d75ae78b7c3714907210f5', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling llvm-libc # and whatever else without interference from each other. @@ -841,143 +841,143 @@ 'objects': [ { # The Android libclang_rt.builtins libraries are currently only included in the Linux clang package. - 'object_name': 'Linux_x64/clang-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '17d9277d32a87f856c6d0a5ee3f662015d423d876315d7736ca7b05b2b6f047e', - 'size_bytes': 54610924, - 'generation': 1743178947242029, + 'object_name': 'Linux_x64/clang-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '2cccd3a5b04461f17a2e78d2f8bd18b448443a9dd4d6dfac50e8e84b4d5176f1', + 'size_bytes': 54914604, + 'generation': 1745271343199398, 'condition': '(host_os == "linux" or checkout_android) and non_git_source', }, { - 'object_name': 'Linux_x64/clang-tidy-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '426b5f0daf964c3e1a9b9e7626311e8544a3e4768c8ef80d31464894b0fead68', - 'size_bytes': 13573888, - 'generation': 1743178947383618, + 'object_name': 'Linux_x64/clang-tidy-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': 'f0e7dae567266055c9cfa2fba5b3dafa311dc86955f5a3f7a4047ce3096e7b27', + 'size_bytes': 13559360, + 'generation': 1745271343282399, 'condition': 'host_os == "linux" and checkout_clang_tidy and non_git_source', }, { - 'object_name': 'Linux_x64/clangd-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': 'e419c7db3d30a163fdd8692cfeef26a1fb22db039f2f6ab42b930edfc4e5fd43', - 'size_bytes': 13829552, - 'generation': 1743178947404834, + 'object_name': 'Linux_x64/clangd-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': 'd87ec8e9cd959cf5d12e0de2970f4a88a67f9884467dac5285813d02bbe50bcb', + 'size_bytes': 13767836, + 'generation': 1745271343386108, 'condition': 'host_os == "linux" and checkout_clangd and non_git_source', }, { - 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '935be59242458aa5849133c5a47b4ae11f6d8cae92401188e7db070dcae11326', - 'size_bytes': 2303256, - 'generation': 1743178947639495, + 'object_name': 'Linux_x64/llvm-code-coverage-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '08f9cdbdc1e3f78dfb11aa9815727e8af0cf8f2b9c9a0e3749ceb4d3584fc900', + 'size_bytes': 2293720, + 'generation': 1745271343569971, 'condition': 'host_os == "linux" and checkout_clang_coverage_tools and non_git_source', }, { - 'object_name': 'Linux_x64/llvmobjdump-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '3617952c541889b46806f66223bb4e8342e4c714938e7c83c7b9ca27b8e94cec', - 'size_bytes': 5699348, - 'generation': 1743178947497618, + 'object_name': 'Linux_x64/llvmobjdump-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '4b9c20478c015a03a44842d0bc24a9bd01a87890c76c4496577843ea31a21ed1', + 'size_bytes': 5702536, + 'generation': 1745271343407073, 'condition': '((checkout_linux or checkout_mac or checkout_android) and host_os == "linux") and non_git_source', }, { - 'object_name': 'Mac/clang-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '690ae86dbd1c3689713db944059e7249760bdc30d4e06fdee79851780d62b255', - 'size_bytes': 51731764, - 'generation': 1743178948995628, + 'object_name': 'Mac/clang-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '159cc811ee2882098086a426e83cb6744ff59d422d005a54630bc519e782d154', + 'size_bytes': 51986012, + 'generation': 1745271345031799, 'condition': 'host_os == "mac" and host_cpu == "x64"', }, { - 'object_name': 'Mac/clang-mac-runtime-library-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '6e5b19f3ef4f2a84b2137f64c66cf7dc559c399ee070b69c26791ad4530dc84a', - 'size_bytes': 980732, - 'generation': 1743178955913911, + 'object_name': 'Mac/clang-mac-runtime-library-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': 'ef380bc751dc8b137e294ac1aca295f3e49eb57b938ab011c38c70271d8582fc', + 'size_bytes': 988872, + 'generation': 1745271352425938, 'condition': 'checkout_mac and not host_os == "mac"', }, { - 'object_name': 'Mac/clang-tidy-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '05c89e445986aece87cf514b0e877c6cb1b847ac32c8fe24baf5386fa2874956', - 'size_bytes': 13595068, - 'generation': 1743178949025853, + 'object_name': 'Mac/clang-tidy-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '75907ac8d2ab310fd7272715c5d98cd4382dbd0b867872aa9216cede48c274d5', + 'size_bytes': 13609872, + 'generation': 1745271345094426, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_tidy', }, { - 'object_name': 'Mac/clangd-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '27945ba4a22b9e59b0c28dd299919a1da3a18a2d76e10f30a5e0e72242af6b55', - 'size_bytes': 15018860, - 'generation': 1743178949033402, + 'object_name': 'Mac/clangd-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': 'e2bcab0b3961fdc7a63286cf7a98397026ff1b5143d34c8a50844b26a7b023c6', + 'size_bytes': 14998604, + 'generation': 1745271345196743, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clangd', }, { - 'object_name': 'Mac/llvm-code-coverage-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '3eb87f93194f7fe3177d4796c8d6376421811538747d1e65c825654ec4ecceea', - 'size_bytes': 2257340, - 'generation': 1743178949227666, + 'object_name': 'Mac/llvm-code-coverage-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '6e4c8ed691948981d799f4af747288cdd5e90ae873dc36ada66726ad3e6caef1', + 'size_bytes': 2262400, + 'generation': 1745271345385127, 'condition': 'host_os == "mac" and host_cpu == "x64" and checkout_clang_coverage_tools', }, { - 'object_name': 'Mac_arm64/clang-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': 'd4478bb335f9555fe6b0c888a4c0f5d48695081b02ce662cfe7a125f3f501eca', - 'size_bytes': 43908296, - 'generation': 1743178957140254, + 'object_name': 'Mac_arm64/clang-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '3d437a643cc5838963254a39ab0528f49f2b65cd4dba2c80e628ad88eb419536', + 'size_bytes': 43999512, + 'generation': 1745271353863965, 'condition': 'host_os == "mac" and host_cpu == "arm64"', }, { - 'object_name': 'Mac_arm64/clang-tidy-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '06bd6ba46d4c0fc51e018d53c41f1ab81f7222f99dde95a10d57cb7f6c340eb7', - 'size_bytes': 11774556, - 'generation': 1743178957285392, + 'object_name': 'Mac_arm64/clang-tidy-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '0b4150c9e699e1e904495807aff48d2e5396527bf775d6597818dd4f73a9c38f', + 'size_bytes': 11776260, + 'generation': 1745271353927359, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_tidy', }, { - 'object_name': 'Mac_arm64/clangd-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '1cb1d20b1d9bcf5bfab05f333c1cd21ff723a463f8b3a84c3b1f79758fc8d834', - 'size_bytes': 12058388, - 'generation': 1743178957310593, + 'object_name': 'Mac_arm64/clangd-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '9fcd151cfffa01e6befe3760b9bc91d645135c79449dc378af4cb2fe0187150c', + 'size_bytes': 12041956, + 'generation': 1745271354010497, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clangd', }, { - 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '932bd7fb9dd4b8da2a59880f71f9f9fb4c66b071a4e481b19bbc340b9336dd11', - 'size_bytes': 1978748, - 'generation': 1743178957577801, + 'object_name': 'Mac_arm64/llvm-code-coverage-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '1e62752ef5fd9d425699ed44098d5a0eec3be3f827990470aa9f9199d34a2fb8', + 'size_bytes': 1975116, + 'generation': 1745271354276821, 'condition': 'host_os == "mac" and host_cpu == "arm64" and checkout_clang_coverage_tools', }, { - 'object_name': 'Win/clang-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '6f486adfb406b0fcb9d3b83485ed4fca3467a3565d67baf0d9fd822721b780a1', - 'size_bytes': 46895260, - 'generation': 1743178966458891, + 'object_name': 'Win/clang-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': 'd53230dbb7db57ddcda5a8377b5dd8388deee9ff2766617d54c6159c51e806be', + 'size_bytes': 47036964, + 'generation': 1745271363166454, 'condition': 'host_os == "win"', }, { - 'object_name': 'Win/clang-tidy-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '3fd9808e08070f84920d22ad537e1f2445bcf5773c134ddef28b14cfe46a67e1', - 'size_bytes': 13459292, - 'generation': 1743178966633313, + 'object_name': 'Win/clang-tidy-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': 'c6022f5923be5afc1685723a2383fcd8f9334cc6ee097ce3c71963de6ded0764', + 'size_bytes': 13415856, + 'generation': 1745271363272778, 'condition': 'host_os == "win" and checkout_clang_tidy', }, { - 'object_name': 'Win/clang-win-runtime-library-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': 'bcf2e1a93afb20f384dbbcc484815989cb0aa2e593f2235251498c97d7f22493', - 'size_bytes': 2477288, - 'generation': 1743178973852867, + 'object_name': 'Win/clang-win-runtime-library-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '555a34dd110a5fe3f7578745e9f0074cc341e550bed4ec5888accffb0200a7bb', + 'size_bytes': 2483656, + 'generation': 1745271370423782, 'condition': 'checkout_win and not host_os == "win"', }, { - 'object_name': 'Win/clangd-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '12978a7e84b777aa10857e13f1e5e999061091126891631bf29df486f4bb2770', - 'size_bytes': 13891176, - 'generation': 1743178966674825, + 'object_name': 'Win/clangd-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '66aafde760608c4c0de94a3947a179db8c8f93c8e474e3081b4401287abe4ee4', + 'size_bytes': 13838692, + 'generation': 1745271363368641, 'condition': 'host_os == "win" and checkout_clangd', }, { - 'object_name': 'Win/llvm-code-coverage-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '14842204c68030e276bb054bd5058a561be025d1ee1a0909943ea4f8c31cd715', - 'size_bytes': 2367868, - 'generation': 1743178966817841, + 'object_name': 'Win/llvm-code-coverage-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': '6944dc39b33dca3bb8f219ffb221e3f345fe56a5fa0447c60ea6a2894ae72687', + 'size_bytes': 2373032, + 'generation': 1745271363562596, 'condition': 'host_os == "win" and checkout_clang_coverage_tools', }, { - 'object_name': 'Win/llvmobjdump-llvmorg-21-init-6681-g5b36835d-1.tar.xz', - 'sha256sum': '6c505137fcc3879c3f0ad3562ec1f530a4b83f725d2a91363d1cfdcc3536252e', - 'size_bytes': 5673896, - 'generation': 1743178966726617, + 'object_name': 'Win/llvmobjdump-llvmorg-21-init-9266-g09006611-1.tar.xz', + 'sha256sum': 'e8b3e9f7cd7512edc7c05a12e818386cdb8d43bea9affbf0bf4db83a553092a5', + 'size_bytes': 5684140, + 'generation': 1745271363450942, 'condition': '(checkout_linux or checkout_mac or checkout_android) and host_os == "win"', }, ] @@ -988,31 +988,31 @@ 'bucket': 'chromium-browser-clang', 'objects': [ { - 'object_name': 'Linux_x64/rust-toolchain-3f690c2257b7080cd3a8cce64e082fc972148990-1-llvmorg-21-init-6681-g5b36835d.tar.xz', - 'sha256sum': 'f3132b0b1fa412c2fb35e068e47b3fade679a1446d9a08b67c403d143931f2ec', - 'size_bytes': 118335848, - 'generation': 1743178941814849, + 'object_name': 'Linux_x64/rust-toolchain-c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611.tar.xz', + 'sha256sum': '378c432f7739bb5da11aad7b3a2687f8252565eae5f0dcfc55c39a15382c519c', + 'size_bytes': 118598336, + 'generation': 1745271335898717, 'condition': 'host_os == "linux" and non_git_source', }, { - 'object_name': 'Mac/rust-toolchain-3f690c2257b7080cd3a8cce64e082fc972148990-1-llvmorg-21-init-6681-g5b36835d.tar.xz', - 'sha256sum': '093ad50477633cb98719ace92995ad0e11dfa491b97835997a30fc1078d63cbe', - 'size_bytes': 111607824, - 'generation': 1743178943094518, + 'object_name': 'Mac/rust-toolchain-c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611.tar.xz', + 'sha256sum': 'bf05c8b5e90d6904de02dca9b3e4cb5e45a1a56207e7af1fbb3a10707704a26a', + 'size_bytes': 111932536, + 'generation': 1745271337336068, 'condition': 'host_os == "mac" and host_cpu == "x64"', }, { - 'object_name': 'Mac_arm64/rust-toolchain-3f690c2257b7080cd3a8cce64e082fc972148990-1-llvmorg-21-init-6681-g5b36835d.tar.xz', - 'sha256sum': 'e5db937e64017390f52c1cb68445ed5101855e0b9318c7de71dfaea37649b4cb', - 'size_bytes': 101058976, - 'generation': 1743178944397528, + 'object_name': 'Mac_arm64/rust-toolchain-c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611.tar.xz', + 'sha256sum': '1aec99f479ff28cefe44ed739844833e016a1da255cf3c17d79e59a273246615', + 'size_bytes': 101605468, + 'generation': 1745271339727037, 'condition': 'host_os == "mac" and host_cpu == "arm64"', }, { - 'object_name': 'Win/rust-toolchain-3f690c2257b7080cd3a8cce64e082fc972148990-1-llvmorg-21-init-6681-g5b36835d.tar.xz', - 'sha256sum': '3f8d34895c880301e2805164b7b5e4e487769b65d5fcadb4384a10228f559c85', - 'size_bytes': 192615112, - 'generation': 1743178945657202, + 'object_name': 'Win/rust-toolchain-c8f94230282a8e8c1148f3e657f0199aad909228-1-llvmorg-21-init-9266-g09006611.tar.xz', + 'sha256sum': 'b291520613a3ebc415e4576a7fa31d840a5ebf4ab9be6e9dc5d90062dc001c1e', + 'size_bytes': 193280372, + 'generation': 1745271341223097, 'condition': 'host_os == "win"', }, ], @@ -1152,7 +1152,7 @@ }, 'src/chrome/release_scripts': { - 'url': Var('chrome_git') + '/chrome/tools/release/scripts' + '@' + '033a55d9116b98ac78baeadc19893db5a8044221', + 'url': Var('chrome_git') + '/chrome/tools/release/scripts' + '@' + '75c491444624e8261d92304572a43732a1a242a1', 'condition': 'checkout_chrome_release_scripts', }, @@ -1454,7 +1454,7 @@ }, 'src/chrome/test/data/autofill/captured_sites/artifacts': { - 'url': Var('chrome_git') + '/chrome/test/captured_sites/autofill.git' + '@' + 'a7d1f25f01c31216593ea9bd381da4cf65e16a47', + 'url': Var('chrome_git') + '/chrome/test/captured_sites/autofill.git' + '@' + 'ac0b158375110516ddcf9ac71d9f1ab0e98b6dd3', 'condition': 'checkout_chromium_autofill_test_dependencies', }, @@ -1484,7 +1484,7 @@ 'packages': [ { 'package': 'chromium/chrome/test/data/variations/cipd', - 'version': 'TwJsIE4ZK-laEYcmWaEhR29TvX3l6XGZ591WsctdN2QC', + 'version': 'VqPJTxpnpimtrWW7Jxb1gSASJoU1tC0k82foI4HbQJgC', }, ], 'dep_type': 'cipd', @@ -1495,7 +1495,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '83fc855bcf30939fa766142e5fffe7c243d36086', + '1ff668ed09b92245f1e82581c7e855d4ed95a134', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1987,7 +1987,7 @@ 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'aacf07dc8bc6336ef20873b93207fbf4482792ef', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'b128c9967e4067db21f244a185296f1f38107dd8', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1995,6 +1995,9 @@ 'src/third_party/dom_distiller_js/dist': Var('chromium_git') + '/chromium/dom-distiller/dist.git' + '@' + '199de96b345ada7c6e7e6ba3d2fa7a6911b8767d', + 'src/third_party/dragonbox/src': + Var('chromium_git') + '/external/github.com/jk-jeon/dragonbox.git' + '@' + '6c7c925b571d54486b9ffae8d9d18a822801cbda', + 'src/third_party/eigen3/src': Var('chromium_git') + '/external/gitlab.com/libeigen/eigen.git' + '@' + '464c1d097891a1462ab28bf8bb763c1683883892', @@ -2532,7 +2535,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('chromium_git') + '/external/github.com/google/perfetto.git' + '@' + '54d422c148f1c98bef74195086c70320960c9c6b', + Var('chromium_git') + '/external/github.com/google/perfetto.git' + '@' + '86ffe81a57cee5ebefffb8ebacc2d7125998627e', 'src/base/tracing/test/data': { 'bucket': 'perfetto', @@ -2846,7 +2849,7 @@ 'dep_type': 'cipd', }, - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@ac1b0b8709461338010b05b3308d7829445a06af', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@063fff22da82669345380796662d7ec134bbd1e9', 'src/third_party/glslang/src': '{chromium_git}/external/github.com/KhronosGroup/glslang@5fc62e82624375e137eb22cddd8ab4fef6e159b1', 'src/third_party/spirv-cross/src': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Cross@b8fcf307f1f347089e3c46eb4451d27f32ebc8d3', 'src/third_party/spirv-headers/src': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@bab63ff679c41eb75fc67dac76e1dc44426101e1', @@ -2855,7 +2858,7 @@ 'src/third_party/vulkan-loader/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Loader@fb78607414e154c7a5c01b23177ba719c8a44909', 'src/third_party/vulkan-tools/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Tools@0b8196724e4ad28cc7459b82a9b75f252c08cb3e', 'src/third_party/vulkan-utility-libraries/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-Utility-Libraries@4e246c56ec5afb5ad66b9b04374d39ac04675c8e', - 'src/third_party/vulkan-validation-layers/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-ValidationLayers@7a6329b34b1652acfd685941ed1f5735200cf522', + 'src/third_party/vulkan-validation-layers/src': '{chromium_git}/external/github.com/KhronosGroup/Vulkan-ValidationLayers@62aaa9fbaad7accfffa5928ac5dc5d1119a04596', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '56300b29fbfcc693ee6609ddad3fdd5b7a449a21', @@ -2900,7 +2903,7 @@ Var('chromium_git') + '/webpagereplay.git' + '@' + Var('webpagereplay_revision'), 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '70fb834e8c8c4617b00bdf42b3f8f9dd22d53a70', + Var('webrtc_git') + '/src.git' + '@' + 'de7866f6cab90d0dc7279cde6c2560fcae90c2d3', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -3022,7 +3025,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/boca_app/app', - 'version': 'yj-paVA1NAoU1ClZEVtbJexXYw__vAM6HcjIN9g700gC', + 'version': 'q8LgaV0oPsTiZSL2_SWBebeKbZMs7Mt0m9_9WHU5BuMC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -3033,7 +3036,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'YG9HivAmb88J9Xc6hNVqtCch1DIPcY7y9xPC1QvbQrwC', + 'version': 'Ak7-qaRgm-rXDCM8_wBZPxTLi0xiBZHrOUp7mXfz8h8C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4620,7 +4623,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - '39f00263ec7a5f29e755572cfd486765f2dc15dc', + 'b8f2f682ce8d5097597440ee2aaf93f21488da65', 'condition': 'checkout_src_internal', }, @@ -4686,7 +4689,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - 'eb657249ef39573d03dfd2f012057c2c69560e51', + '417fd8665cabc30f31cd42f4a8b21ce12cb42f9d', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/OWNERS b/OWNERS index 5047e10b..ee894b1 100644 --- a/OWNERS +++ b/OWNERS
@@ -21,6 +21,7 @@ per-file .vpython3=bpastene@chromium.org per-file .vpython3=dpranke@google.com per-file .vpython3=tikuta@chromium.org +per-file .vpython3=file://third_party/protobuf/OWNERS # For protobuf wheels changes per-file .yapfignore=* per-file AUTHORS=* per-file BUILD.gn=file://build/OWNERS
diff --git a/android_webview/browser/gfx/hardware_renderer.cc b/android_webview/browser/gfx/hardware_renderer.cc index a5f8b950..e748262 100644 --- a/android_webview/browser/gfx/hardware_renderer.cc +++ b/android_webview/browser/gfx/hardware_renderer.cc
@@ -267,17 +267,19 @@ [](HardwareRenderer::OnViz* self, viz::FrameIntervalDecider::Result result, viz::FrameIntervalMatcherType matcher_type) { - self->preferred_frame_interval_ = - std::visit(base::Overloaded( - [](viz::FrameIntervalDecider::FrameIntervalClass - frame_interval_class) { - // Zero currently is interpreted by WebView as no - // opinion, which allows system to use its - // default heuristics. - return base::Milliseconds(0); - }, - [](base::TimeDelta interval) { return interval; }), - result); + self->preferred_frame_interval_ = std::visit( + base::Overloaded( + [](viz::FrameIntervalDecider::FrameIntervalClass + frame_interval_class) { + // Zero currently is interpreted by WebView as no + // opinion, which allows system to use its + // default heuristics. + return base::Milliseconds(0); + }, + [](viz::FrameIntervalDecider::ResultInterval interval) { + return interval.interval; + }), + result); }, this); decider->UpdateSettings(std::move(settings), std::move(matchers));
diff --git a/android_webview/browser/page_load_metrics/OWNERS b/android_webview/browser/page_load_metrics/OWNERS new file mode 100644 index 0000000..46a8b0f9 --- /dev/null +++ b/android_webview/browser/page_load_metrics/OWNERS
@@ -0,0 +1 @@ +file://components/page_load_metrics/OWNERS \ No newline at end of file
diff --git a/android_webview/tools/run_cts.pydeps b/android_webview/tools/run_cts.pydeps index fb58bdc..b5f5592 100644 --- a/android_webview/tools/run_cts.pydeps +++ b/android_webview/tools/run_cts.pydeps
@@ -87,5 +87,4 @@ //third_party/catapult/devil/devil/utils/run_tests_helper.py //third_party/catapult/devil/devil/utils/timeout_retry.py //third_party/catapult/devil/devil/utils/watchdog_timer.py -//third_party/catapult/devil/devil/utils/zip_utils.py //third_party/catapult/third_party/six/six.py
diff --git a/base/BUILD.gn b/base/BUILD.gn index 2e12fdc3..b2c4562a 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -2566,6 +2566,24 @@ # TODO(collinbaker): determine how to handle these cxx bindings-induced # circular dependencies more robustly. "//base/allocator/partition_allocator:raw_ptr", + + # Needed because logging/rust_logger.rs contains: + # include!("base/logging/rust_log_integration.h"); + # rust_log_integration.h ends up transitively #including + # debug/debugging_buildflags.h, which is a generated header that needs to + # be written first. + # + # Technically it would be more correct to depend on :base, which is the + # target for rust_log_integration.h, but that's not possible due to circular + # dependencies. + # + # Note if this is removed the build may still work by accident because + # debug/debugging_buildflags.h still ends up being generated through a + # dependency chain via :logging_log_severity_bindgen. But we should not + # rely on that. + # + # See also https://crbug.com/406267472. + ":debugging_buildflags", ] visibility = [ ":base" ] sources = [ "logging/rust_logger.rs" ]
diff --git a/base/environment.cc b/base/environment.cc index 6ff58022..dcb7b92 100644 --- a/base/environment.cc +++ b/base/environment.cc
@@ -123,16 +123,6 @@ return std::make_unique<EnvironmentImpl>(); } -bool Environment::GetVar(std::string_view variable_name, std::string* result) { - std::optional<std::string> actual_result = GetVar(variable_name); - if (!actual_result.has_value()) { - return false; - } - - *result = std::move(actual_result.value()); - return true; -} - bool Environment::HasVar(std::string_view variable_name) { return GetVar(variable_name).has_value(); }
diff --git a/base/environment.h b/base/environment.h index d911b33..5f00ecb 100644 --- a/base/environment.h +++ b/base/environment.h
@@ -36,11 +36,6 @@ // Note that the variable may be set to an empty string. virtual std::optional<std::string> GetVar(std::string_view variable_name) = 0; - // DEPRECATED. Prefer GetVar() overload above. - // Gets an environment variable's value and stores it in |result|. - // Returns false if the key is unset. - bool GetVar(std::string_view variable_name, std::string* result); - // Syntactic sugar for GetVar(variable_name).has_value(); bool HasVar(std::string_view variable_name);
diff --git a/base/files/file_util_win.cc b/base/files/file_util_win.cc index 6ed96740..09da552 100644 --- a/base/files/file_util_win.cc +++ b/base/files/file_util_win.cc
@@ -384,6 +384,34 @@ std::move(bound_callback)); } +// This function checks if the user is an administrator and whether they have a +// default elevation type. This corresponds to a full administrator such as the +// SYSTEM user or built in administrator. It will return false for split-token +// administrators used in UAC and any non-administrator caller. It checks the +// effective token in case the caller is impersonating an administrator. +bool IsUserDefaultAdmin() { + base::win::Sid admin_sid(base::win::WellKnownSid::kBuiltinAdministrators); + BOOL is_member = FALSE; + if (!::CheckTokenMembership(nullptr, admin_sid.GetPSID(), &is_member)) { + DPLOG(WARNING) << "Error checking token membership"; + return false; + } + + if (!is_member) { + return false; + } + + TOKEN_ELEVATION_TYPE elevation_type; + DWORD ret_length; + if (!::GetTokenInformation(::GetCurrentThreadEffectiveToken(), + TokenElevationType, &elevation_type, + sizeof(elevation_type), &ret_length)) { + DPLOG(WARNING) << "Cannot get token elevation type"; + return false; + } + return elevation_type == TokenElevationTypeDefault; +} + // This function verifies that no code is attempting to set an ACL on a file // that is outside of 'safe' paths. A 'safe' path is defined as one that is // within the user data dir, or the temporary directory. This is explicitly to @@ -424,7 +452,7 @@ // Admin users create temporary files in SystemTemp; see // `CreateNewTempDirectory` below. FilePath secure_system_temp; - if (::IsUserAnAdmin() && + if (IsUserDefaultAdmin() && PathService::Get(DIR_SYSTEM_TEMP, &secure_system_temp)) { valid_paths.push_back(secure_system_temp); } @@ -721,7 +749,7 @@ DCHECK(new_temp_path); FilePath parent_dir; - if (::IsUserAnAdmin() && PathService::Get(DIR_SYSTEM_TEMP, &parent_dir) && + if (IsUserDefaultAdmin() && PathService::Get(DIR_SYSTEM_TEMP, &parent_dir) && CreateTemporaryDirInDir(parent_dir, prefix.empty() ? kDefaultTempDirPrefix : prefix, new_temp_path)) {
diff --git a/build/android/apk_operations.pydeps b/build/android/apk_operations.pydeps index 0b5aa2e3b..3c81673 100644 --- a/build/android/apk_operations.pydeps +++ b/build/android/apk_operations.pydeps
@@ -61,7 +61,6 @@ ../../third_party/catapult/devil/devil/utils/run_tests_helper.py ../../third_party/catapult/devil/devil/utils/timeout_retry.py ../../third_party/catapult/devil/devil/utils/watchdog_timer.py -../../third_party/catapult/devil/devil/utils/zip_utils.py ../../third_party/catapult/third_party/six/six.py ../../third_party/jinja2/__init__.py ../../third_party/jinja2/_identifier.py
diff --git a/build/android/gyp/check_for_missing_direct_deps.py b/build/android/gyp/check_for_missing_direct_deps.py index 53eecff..d82d2ee 100755 --- a/build/android/gyp/check_for_missing_direct_deps.py +++ b/build/android/gyp/check_for_missing_direct_deps.py
@@ -245,7 +245,7 @@ help='Always use the build server.') parser.add_argument('--gn-target', required=True) parser.add_argument('--input-jar', required=True) - parser.add_argument('--direct-classpath-jars') + parser.add_argument('--direct-classpath-jars', action='append') parser.add_argument('--sdk-classpath-jars') parser.add_argument('--full-classpath-jars') parser.add_argument('--full-classpath-gn-targets')
diff --git a/build/android/gyp/compile_java.py b/build/android/gyp/compile_java.py index 37a130bc5..94c2713 100755 --- a/build/android/gyp/compile_java.py +++ b/build/android/gyp/compile_java.py
@@ -68,25 +68,39 @@ classes_dir, services_map=None, additional_jar_files=None, - extra_classes_jar=None): + extra_classes_jar=None, + filter_func=None): """Zips files from compilation into a single jar.""" logging.info('Start creating jar file: %s', jar_path) with action_helpers.atomic_output(jar_path) as f: with zipfile.ZipFile(f.name, 'w') as z: - zip_helpers.zip_directory(z, classes_dir) + path_transform = None + if filter_func: + path_transform = lambda p: p if filter_func(p) else None + zip_helpers.zip_directory(z, classes_dir, path_transform=path_transform) if services_map: for service_class, impl_classes in sorted(services_map.items()): zip_path = 'META-INF/services/' + service_class data = ''.join(f'{x}\n' for x in sorted(impl_classes)) zip_helpers.add_to_zip_hermetic(z, zip_path, data=data) + # Used to merge in kotlinc results. + if extra_classes_jar: + + def path_transform2(zip_path): + if path_transform and not path_transform(zip_path): + return None + if zip_path.endswith('.class'): + return zip_path + return None + + zip_helpers.merge_zips(z, [extra_classes_jar], + path_transform=path_transform2) + if additional_jar_files: for src_path, zip_path in additional_jar_files: zip_helpers.add_to_zip_hermetic(z, zip_path, src_path=src_path) - if extra_classes_jar: - path_transform = lambda p: p if p.endswith('.class') else None - zip_helpers.merge_zips(z, [extra_classes_jar], - path_transform=path_transform) + logging.info('Completed jar file: %s', jar_path) @@ -153,12 +167,21 @@ return package_name, class_names +def _CreateGlobFilter(exclude_globs, include_globs): + + def func(zip_path): + if include_globs and not build_utils.MatchesGlob(zip_path, include_globs): + return False + return not build_utils.MatchesGlob(zip_path, exclude_globs) + + return func + + class _MetadataParser: - def __init__(self, chromium_code, exclude_globs, include_globs): + def __init__(self, chromium_code, filter_func): self._chromium_code = chromium_code - self._exclude_globs = exclude_globs - self._include_globs = include_globs + self._filter_func = filter_func # Map of .java path -> .srcjar/nested/path.java. self._srcjar_files = {} # Map of @ServiceImpl class -> impl class @@ -197,10 +220,7 @@ def _ShouldIncludeInJarInfo(self, fully_qualified_name): name_as_class_glob = fully_qualified_name.replace('.', '/') + '.class' - if self._include_globs and not build_utils.MatchesGlob( - name_as_class_glob, self._include_globs): - return False - return not build_utils.MatchesGlob(name_as_class_glob, self._exclude_globs) + return self._filter_func(name_as_class_glob) def ParseAndWriteInfoFile(self, output_path, java_files, kt_files=None): """Writes a .jar.info file. @@ -343,9 +363,9 @@ temp_dir = jar_path + '.staging' build_utils.DeleteDirectory(temp_dir) os.makedirs(temp_dir) - metadata_parser = _MetadataParser(options.chromium_code, - options.jar_info_exclude_globs, - options.jar_info_include_globs) + filter_func = _CreateGlobFilter(options.jar_exclude_globs, + options.jar_include_globs) + metadata_parser = _MetadataParser(options.chromium_code, filter_func) try: classes_dir = os.path.join(temp_dir, 'classes') @@ -446,9 +466,16 @@ # just the stamp file for that target. server_utils.MaybeTouch(jar_path) else: - CreateJarFile(jar_path, classes_dir, metadata_parser.services_map, - options.additional_jar_files, options.kotlin_jar_path) - + CreateJarFile(jar_path, + classes_dir, + metadata_parser.services_map, + options.additional_jar_files, + options.kotlin_jar_path, + filter_func=filter_func) + if options.filtered_jar: + CreateJarFile(options.filtered_jar, + classes_dir, + filter_func=lambda p: not filter_func(p)) # Remove input srcjars that confuse Android Studio: # https://crbug.com/353326240 @@ -497,11 +524,13 @@ 'files are packaged into the jar. Files should be specified in ' 'format <filename>:<path to be placed in jar>.') parser.add_argument( - '--jar-info-exclude-globs', - help='GN list of exclude globs to filter from generated .info files.') + '--jar-exclude-globs', + help='GN list of exclude globs to filter from the output .jar.') parser.add_argument( - '--jar-info-include-globs', - help='GN list of inlclude globs to filter from generated .info files.') + '--jar-include-globs', + help='GN list of inlclude globs to filter from the output .jar.') + parser.add_argument('--filtered-jar', + help='Output filtered .class files here') parser.add_argument( '--chromium-code', action='store_true', @@ -538,10 +567,10 @@ options.classpath = action_helpers.parse_gn_list(options.classpath) options.processorpath = action_helpers.parse_gn_list(options.processorpath) options.java_srcjars = action_helpers.parse_gn_list(options.java_srcjars) - options.jar_info_exclude_globs = action_helpers.parse_gn_list( - options.jar_info_exclude_globs) - options.jar_info_include_globs = action_helpers.parse_gn_list( - options.jar_info_include_globs) + options.jar_exclude_globs = action_helpers.parse_gn_list( + options.jar_exclude_globs) + options.jar_include_globs = action_helpers.parse_gn_list( + options.jar_include_globs) additional_jar_files = [] for arg in options.additional_jar_files or []: @@ -646,6 +675,8 @@ if not use_errorprone: jar_info_path = options.jar_path + '.info' output_paths.append(jar_info_path) + if options.filtered_jar: + output_paths.append(options.filtered_jar) # Incremental build optimization doesn't work for ErrorProne. Skip md5 check. if write_depfile_only: @@ -663,11 +694,11 @@ input_paths.append(options.header_jar) input_paths += [x[0] for x in options.additional_jar_files] - input_strings = ( - javac_cmd + javac_args + options.classpath + java_files + kt_files + [ - options.warnings_as_errors, options.jar_info_exclude_globs, - options.jar_info_include_globs - ]) + input_strings = (javac_cmd + javac_args + options.classpath + java_files + + kt_files + [ + options.warnings_as_errors, options.jar_exclude_globs, + options.jar_include_globs + ]) # Use md5_check for |pass_changes| feature. md5_check.CallAndWriteDepfileIfStale(do_it,
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py index b42e774..19223e8 100755 --- a/build/android/gyp/write_build_config.py +++ b/build/android/gyp/write_build_config.py
@@ -242,14 +242,10 @@ from sources, with a name like `$target_name.javac.jar`. However, when using a prebuilt jar, this will point to the source archive directly. -* `deps_info['device_jar_path']`: +* `deps_info['processed_jar_path']`: Path to a file that is the result of processing `deps_info['unprocessed_jar_path']` with various tools (ready to be dexed). -* `deps_info['host_jar_path']`: -Path to a file that is the result of processing -`deps_info['unprocessed_jar_path']` with various tools (use by java_binary). - * `deps_info['interface_jar_path']: Path to the interface jar generated for this library. This corresponds to a jar file that only contains declarations. Generated by running the `ijar` on @@ -257,7 +253,7 @@ * `deps_info['dex_path']`: Path to the `.dex` file generated for this target, from -`deps_info['device_jar_path']` unless this comes from a prebuilt `.aar` archive. +`deps_info['processed_jar_path']` unless this comes from a prebuilt `.aar` archive. * `deps_info['is_prebuilt']`: True to indicate that this target corresponds to a prebuilt `.jar` file. @@ -327,7 +323,7 @@ * `deps_info['device_classpath']`: The classpath used when running a Java or Android binary. Essentially the -collection of all `deps_info['device_jar_path']` entries for the target and all +collection of all `deps_info['processed_jar_path']` entries for the target and all its dependencies. * `deps_info['all_dex_files']`: @@ -1102,8 +1098,8 @@ help='GN list of config files of deps which are exposed as ' 'part of the target\'s public API.') parser.add_option('--aar-path', help='Path to containing .aar file.') - parser.add_option('--device-jar-path', help='Path to .jar for dexing.') - parser.add_option('--host-jar-path', help='Path to .jar for java_binary.') + parser.add_option('--processed-jar-path', + help='Path to .jar to use at runtime.') parser.add_option('--unprocessed-jar-path', help='Path to the .jar to use for javac classpath purposes.') parser.add_option( @@ -1290,7 +1286,7 @@ parser.error('\n'.join(action_helpers.parse_gn_list(options.fail))) lib_options = ['unprocessed_jar_path', 'interface_jar_path'] - device_lib_options = ['device_jar_path', 'dex_path'] + device_lib_options = ['processed_jar_path', 'dex_path'] required_options_map = { 'android_apk': ['build_config'] + lib_options + device_lib_options, 'android_app_bundle_module': @@ -1302,7 +1298,7 @@ 'group': ['build_config'], 'java_annotation_processor': ['build_config', 'main_class'], 'java_binary': ['build_config'], - 'java_library': ['build_config', 'host_jar_path'] + lib_options, + 'java_library': ['build_config', 'processed_jar_path'] + lib_options, 'robolectric_binary': ['build_config'], 'system_java_library': ['build_config', 'unprocessed_jar_path'], 'android_app_bundle': ['build_config', 'module_build_configs'], @@ -1336,8 +1332,6 @@ '--library-always-compress can only be used with --type=android_apk ' 'or --type=android_app_bundle_module') - if options.device_jar_path and not options.dex_path: - raise Exception('java_library that supports Android requires a dex path.') if any(getattr(options, x) for x in lib_options): for attr in lib_options: if not getattr(options, attr): @@ -1552,10 +1546,8 @@ if options.unprocessed_jar_path: deps_info['unprocessed_jar_path'] = options.unprocessed_jar_path deps_info['interface_jar_path'] = options.interface_jar_path - if options.device_jar_path: - deps_info['device_jar_path'] = options.device_jar_path - if options.host_jar_path: - deps_info['host_jar_path'] = options.host_jar_path + if options.processed_jar_path: + deps_info['processed_jar_path'] = options.processed_jar_path if options.dex_path: deps_info['dex_path'] = options.dex_path if is_apk_or_module_target: @@ -1758,12 +1750,12 @@ device_classpath = [] # dist_jar configs should not list their device jar in their own classpath # since the classpath is used to create the device jar itself. - if (is_java_target and options.device_jar_path + if (is_java_target and options.processed_jar_path and options.type != 'dist_jar'): - device_classpath.append(options.device_jar_path) + device_classpath.append(options.processed_jar_path) device_classpath.extend( - c.get('device_jar_path') for c in all_library_deps - if c.get('device_jar_path')) + c.get('processed_jar_path') for c in all_library_deps + if c.get('processed_jar_path')) if options.type == 'android_app_bundle': for d in deps.Direct('android_app_bundle_module'): device_classpath.extend(c for c in d.get('device_classpath', []) @@ -1980,12 +1972,13 @@ if options.type in ('dist_jar', 'java_binary', 'robolectric_binary'): # The classpath to use to run this target. host_classpath = [] - if options.host_jar_path: - host_classpath.append(options.host_jar_path) - host_classpath.extend(c['host_jar_path'] for c in all_library_deps) + if options.processed_jar_path: + host_classpath.append(options.processed_jar_path) + host_classpath.extend(c['processed_jar_path'] for c in all_library_deps) # Collect all the dist_jar host jars. dist_jar_host_jars = [ - c['host_jar_path'] for c in all_dist_jar_deps if 'host_jar_path' in c + c['processed_jar_path'] for c in all_dist_jar_deps + if 'processed_jar_path' in c ] # Collect all the jars that went into the dist_jar host jars. dist_jar_host_classpath = set() @@ -2020,7 +2013,7 @@ return [config[key_name] for config in deps if key_name in config] dist_jar_device_jars = _CollectSinglesFromDeps(all_dist_jar_deps, - 'device_jar_path') + 'processed_jar_path') dist_jar_combined_dex_files = _CollectSinglesFromDeps( all_dist_jar_deps, 'dex_path') dist_jar_interface_jars = _CollectSinglesFromDeps(all_dist_jar_deps, @@ -2060,13 +2053,13 @@ config['javac']['interface_classpath'] = sorted(javac_interface_classpath) # Direct() will be of type 'java_annotation_processor', and so not included # in All('java_library'). - # Annotation processors run as part of the build, so need host_jar_path. + # Annotation processors run as part of the build, so need processed_jar_path. config['javac']['processor_classpath'] = [ - c['host_jar_path'] for c in processor_deps.Direct() - if c.get('host_jar_path') + c['processed_jar_path'] for c in processor_deps.Direct() + if c.get('processed_jar_path') ] config['javac']['processor_classpath'] += [ - c['host_jar_path'] for c in processor_deps.All('java_library') + c['processed_jar_path'] for c in processor_deps.All('java_library') ] config['javac']['processor_classes'] = sorted( c['main_class'] for c in processor_deps.Direct()) @@ -2092,8 +2085,8 @@ deps_info['device_classpath'] = device_classpath if options.trace_events_jar_dir: trace_event_rewritten_device_classpath = [] - for jar_path in device_classpath: - file_path = jar_path.replace('../', '') + for processed_jar_path in device_classpath: + file_path = processed_jar_path.replace('../', '') file_path = file_path.replace('obj/', '') file_path = file_path.replace('gen/', '') file_path = file_path.replace('.jar', '.tracing_rewritten.jar') @@ -2112,7 +2105,7 @@ if options.use_interface_jars: dist_jars = config['javac']['interface_classpath'] else: - dist_jars = sorted(c['device_jar_path'] + dist_jars = sorted(c['processed_jar_path'] for c in classpath_direct_library_deps) else: if options.use_interface_jars:
diff --git a/build/android/java/templates/BuildConfig.template b/build/android/java/templates/BuildConfig.template index 187a2fbe0c..c1465a6 100644 --- a/build/android/java/templates/BuildConfig.template +++ b/build/android/java/templates/BuildConfig.template
@@ -77,6 +77,12 @@ public static boolean IS_CRONET_BUILD; #endif +#if defined(_CRONET_FOR_AOSP_BUILD) + public static boolean CRONET_FOR_AOSP_BUILD = true; +#else + public static boolean CRONET_FOR_AOSP_BUILD; +#endif + #if defined(_WRITE_CLANG_PROFILING_DATA) public static boolean WRITE_CLANG_PROFILING_DATA = true; #else
diff --git a/build/android/test_runner.pydeps b/build/android/test_runner.pydeps index 19e3c3d4..9199815db 100644 --- a/build/android/test_runner.pydeps +++ b/build/android/test_runner.pydeps
@@ -91,7 +91,6 @@ ../../third_party/catapult/devil/devil/utils/signal_handler.py ../../third_party/catapult/devil/devil/utils/timeout_retry.py ../../third_party/catapult/devil/devil/utils/watchdog_timer.py -../../third_party/catapult/devil/devil/utils/zip_utils.py ../../third_party/catapult/third_party/six/six.py ../../third_party/colorama/src/colorama/__init__.py ../../third_party/colorama/src/colorama/ansi.py
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index d36ac69..16093f75 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni
@@ -235,16 +235,10 @@ args += [ "--non-chromium-code" ] } - if (defined(invoker.device_jar_path)) { + if (defined(invoker.processed_jar_path)) { args += [ - "--device-jar-path", - rebase_path(invoker.device_jar_path, root_build_dir), - ] - } - if (defined(invoker.host_jar_path)) { - args += [ - "--host-jar-path", - rebase_path(invoker.host_jar_path, root_build_dir), + "--processed-jar-path", + rebase_path(invoker.processed_jar_path, root_build_dir), ] } if (defined(invoker.unprocessed_jar_path)) { @@ -1657,7 +1651,7 @@ } else { # !_proguard_enabled _is_library = defined(invoker.is_library) && invoker.is_library assert(!(defined(invoker.input_classes_filearg) && _is_library)) - assert(_is_library == defined(invoker.unprocessed_jar_path)) + assert(_is_library == defined(invoker.extra_classpath_jars)) _input_class_jars = [] if (defined(invoker.input_class_jars)) { _input_class_jars = invoker.input_class_jars @@ -1757,34 +1751,32 @@ args += [ "--show-desugar-default-interface-warnings" ] } - # Cannot use header jar for the active jar, because it does not - # contain anonymous classes. https://crbug.com/1342018#c5 - # Cannot use processed .jar here because it might have classes - # filtered out via jar_excluded_patterns. - # Must come first in classpath in order to take precedence over - # deps that defined the same classes (via jar_excluded_patterns). - if (defined(invoker.unprocessed_jar_path)) { - args += [ - "--classpath", - rebase_path(invoker.unprocessed_jar_path, root_build_dir), - ] - inputs += [ invoker.unprocessed_jar_path ] + if (defined(invoker.extra_classpath_jars)) { + _rebased_paths = + rebase_path(invoker.extra_classpath_jars, root_build_dir) + args += [ "--classpath=$_rebased_paths" ] + inputs += invoker.extra_classpath_jars } - if (_min_sdk_version < 24) { + + if (defined(invoker.build_config)) { _rebased_build_config = rebase_path(invoker.build_config, root_build_dir) - _desugar_dependencies_path = - "$target_gen_dir/$target_name.desugardeps" args += [ - "--desugar-dependencies", - rebase_path(_desugar_dependencies_path, root_build_dir), - # Pass the full classpath to find new dependencies that are not in # the .desugardeps file. "--classpath=@FileArg($_rebased_build_config:deps_info:javac_full_interface_classpath)", + ] + } + + if (_min_sdk_version < 24) { + _desugar_dependencies_path = + "$target_gen_dir/$target_name.desugardeps" + inputs += [ android_sdk_jar ] + args += [ + "--desugar-dependencies", + rebase_path(_desugar_dependencies_path, root_build_dir), "--bootclasspath=@FileArg($_rebased_build_config:android:sdk_jars)", ] - inputs += [ android_sdk_jar ] } } @@ -1881,53 +1873,6 @@ } } - template("process_java_library") { - forward_variables_from(invoker, TESTONLY_AND_VISIBILITY) - - _previous_output_jar = invoker.input_jar_path - - if (invoker.jacoco_instrument) { - _filter_jar_target_name = "${target_name}__filter_jar" - _filter_jar_output_jar = "$target_out_dir/$target_name.filter.jar" - } else { - _filter_jar_target_name = target_name - _filter_jar_output_jar = invoker.output_jar_path - } - - filter_jar(_filter_jar_target_name) { - forward_variables_from(invoker, - [ - "data", - "data_deps", - "jar_excluded_patterns", - "jar_included_patterns", - ]) - deps = invoker.deps - input_jar = _previous_output_jar - output_jar = _filter_jar_output_jar - } - - if (invoker.jacoco_instrument) { - # Jacoco must run after desugar (or else desugar sometimes fails). - # It must run after filtering to avoid the same (filtered) class mapping - # to multiple .jar files. - # We run offline code coverage processing here rather than with a - # javaagent as the desired coverage data was not being generated. - # See crbug.com/1097815. - jacoco_instr(target_name) { - deps = [ ":$_filter_jar_target_name" ] + invoker.deps - forward_variables_from(invoker, - [ - "source_files", - "target_sources_file", - ]) - - input_jar_path = _filter_jar_output_jar - output_jar_path = invoker.output_jar_path - } - } - } - template("check_for_missing_direct_deps") { action_with_pydeps(target_name) { forward_variables_from(invoker, @@ -1959,6 +1904,11 @@ "--full-classpath-jars=@FileArg($_rebased_build_config:deps_info:javac_full_interface_classpath)", "--full-classpath-gn-targets=@FileArg($_rebased_build_config:deps_info:javac_full_classpath_targets)", ] + if (defined(invoker.header_jar_path)) { + _rebased_header_jar_path = + rebase_path(invoker.header_jar_path, root_build_dir) + args += [ "--direct-classpath-jars=$_rebased_header_jar_path" ] + } if (auto_add_missing_java_deps) { args += [ "--auto-add-deps" ] } @@ -2763,6 +2713,7 @@ } else { inputs += [ invoker.res_size_info_path ] args += [ + # Look for .info files created by compile_java.py. "--jar-files=@FileArg($_rebased_build_config:deps_info:unprocessed_jar_path)", "--jar-files=@FileArg($_rebased_build_config:deps_info:javac_full_classpath)", "--in-res-info-path", @@ -3020,11 +2971,6 @@ # target_sources_file: Optional path to file containing list of source file # paths. This must always be provided if java_files is not empty and the # .java files in it must match the list of java_files exactly. - # build_config: Path to the .build_config.json file of the corresponding - # java_library_impl() target. The following entries will be used by this - # template: javac:srcjars, deps_info:javac_full_classpath, - # deps_info:javac_full_interface_classpath, javac:processor_classpath, - # javac:processor_classes # javac_jar_path: Path to the final output .jar file. # javac_args: Optional list of extra arguments to pass to javac. # chromium_code: Whether this corresponds to Chromium-specific sources. @@ -3219,11 +3165,17 @@ } if (defined(invoker.jar_excluded_patterns) && invoker.jar_excluded_patterns != []) { - args += [ "--jar-info-exclude-globs=${invoker.jar_excluded_patterns}" ] + args += [ "--jar-exclude-globs=${invoker.jar_excluded_patterns}" ] } if (defined(invoker.jar_included_patterns) && invoker.jar_included_patterns != []) { - args += [ "--jar-info-include-globs=${invoker.jar_included_patterns}" ] + args += [ "--jar-include-globs=${invoker.jar_included_patterns}" ] + } + if (defined(invoker.filtered_classes_jar_path)) { + _rebased_filtered_classes_jar = + rebase_path(invoker.filtered_classes_jar_path, root_build_dir) + args += [ "--filtered-jar=$_rebased_filtered_classes_jar" ] + outputs += [ invoker.filtered_classes_jar_path ] } if (invoker.enable_errorprone) { @@ -3655,38 +3607,58 @@ if (_jacoco_instrument) { _invoker_deps += [ _jacoco_dep ] } - - if (_build_host_jar) { - # Jar files can be needed at runtime (by Robolectric tests or java binaries), - # so do not put them under obj/. - # TODO(agrieve): I suspect it would be better to use dist_jar for java_binary - # rather than archiving unnecessary .jar files within lib.java. - _host_processed_jar_path = - "$root_out_dir/lib.java$_target_dir/$_output_name.jar" - } if (_has_sources) { - _javac_jar_path = "$target_out_dir/$_main_target_name.javac.jar" _generated_jar_path = "$target_gen_dir/$_main_target_name.generated.srcjar" } + _filter_jar = (defined(invoker.jar_excluded_patterns) && + invoker.jar_excluded_patterns != []) || + (defined(invoker.jar_included_patterns) && + invoker.jar_included_patterns != []) + _process_jar = _jacoco_instrument || (_is_prebuilt && _filter_jar) + + if (_has_sources) { + _javac_jar_path = "$target_out_dir/$_main_target_name.javac.jar" + } + + if (_process_jar) { + if (_build_host_jar) { + # Jar files can be needed at runtime (by Robolectric tests or java binaries), + # so do not put them under obj/. + # TODO(agrieve): I suspect it would be better to use dist_jar for java_binary + # rather than archiving unnecessary .jar files within lib.java. + _parent_dir = "$root_out_dir/lib.java$_target_dir" + } else { + _parent_dir = target_out_dir + } + + # _processed_jar_path is .jar used at runtime (for host). + if (_jacoco_instrument) { + _processed_jar_path = "$_parent_dir/$_main_target_name.jacoco.jar" + } else { + _processed_jar_path = "$_parent_dir/$_main_target_name.filtered.jar" + } + if (_filter_jar) { + if (_jacoco_instrument) { + # Do not use _parent_dir for this one. + _filter_jar_path = "$target_out_dir/$target_name.filtered.jar" + } else { + _filter_jar_path = _processed_jar_path + } + } + } else if (_is_prebuilt && _build_host_jar) { + # Skip "process device" step if the step would be just a copy. + _processed_jar_path = invoker.jar_path + } else if (_has_sources) { + # Filter directly in compile_java.py when no other processing is required. + _processed_jar_path = _javac_jar_path + } + if (_build_device_jar) { _dex_path = "$target_out_dir/$_main_target_name.dex.jar" - - # Build speed optimization: Skip "process device" step if the step - # would be just a copy and avoid the copy. - _process_device_jar = - defined(invoker.bytecode_rewriter_target) || _jacoco_instrument || - defined(invoker.jar_excluded_patterns) || - defined(invoker.jar_included_patterns) - if (!_process_device_jar && _is_prebuilt) { - _device_processed_jar_path = invoker.jar_path - } else if (!_process_device_jar && _has_sources) { - _device_processed_jar_path = _javac_jar_path - } else { - _device_processed_jar_path = - "$target_out_dir/$_output_name.processed.jar" - } + _enable_desugar = + !defined(invoker.enable_desugar) || invoker.enable_desugar } # For static libraries, the javac jar output is created at the intermediate @@ -3695,9 +3667,9 @@ # for the ijar as well, but this is only used for APK targets where # the ijar path isn't actually used. if (_has_sources) { - _final_ijar_path = "$target_out_dir/$_output_name.turbine.jar" + _header_jar_path = "$target_out_dir/$_output_name.turbine.jar" } else { - _final_ijar_path = "$target_out_dir/$_output_name.ijar.jar" + _header_jar_path = "$target_out_dir/$_output_name.ijar.jar" } if (_is_prebuilt) { @@ -3752,8 +3724,6 @@ _java_host_deps += [ "${invoker.base_module_target}__compile_java" ] } - not_needed([ "_non_java_deps" ]) - if (_is_prebuilt || _has_sources) { # Classpath deps are used for header and dex targets, they do not need # __assetres deps. @@ -3784,6 +3754,8 @@ not_needed([ "_header_classpath_deps", "_javac_classpath_deps", + "_non_java_deps", + "_supports_host", ]) if (_source_files != []) { @@ -3893,17 +3865,16 @@ # We are tricking everything that is looking for an ijar into looking # at the processed jar path, which is has the excluded classes # removed. - ijar_path = _device_processed_jar_path + ijar_path = _processed_jar_path } else { - ijar_path = _final_ijar_path + ijar_path = _header_jar_path } unprocessed_jar_path = _unprocessed_jar_path } - if (_build_host_jar) { - host_jar_path = _host_processed_jar_path + if (_build_host_jar || _build_device_jar) { + processed_jar_path = _processed_jar_path } if (_build_device_jar) { - device_jar_path = _device_processed_jar_path dex_path = _dex_path } if (_source_files != []) { @@ -3919,12 +3890,12 @@ bundled_srcjars += _srcjars if (defined(invoker.include_java_resources) && invoker.include_java_resources) { - java_resources_jar = _unprocessed_jar_path if (defined(invoker.jar_path)) { # Use original jar_path because _jar_path points to a library without # resources. + java_resources_jar = _unprocessed_jar_path } else { - java_resources_jar = _device_processed_jar_path + java_resources_jar = _processed_jar_path } } } @@ -4056,6 +4027,16 @@ "processor_args_javac", ] + if (_filter_jar) { + # Filtered out classes are needed by d8, and d8 does not accept header + # jars (complains of "Absent Code attribute in method that is not + # native or abstract"). For prebuilts, we can rely on the unprocessed + # path to not have a classes filtered out. For non-prebuilts, we store + # the filtered classes in a dedicated .jar. + _filtered_classes_jar_path = + "$target_out_dir/$target_name.compliment.jar" + } + if (!_skip_header_jar) { _annotation_processor_deps = [] if (defined(invoker.annotation_processor_deps)) { @@ -4065,7 +4046,7 @@ compile_java_helper(_header_target_name) { forward_variables_from(invoker, _compile_java_forward_variables) use_turbine = true - output_jar_path = _final_ijar_path + output_jar_path = _header_jar_path generated_jar_path = _generated_jar_path deps = _annotation_processor_deps if (_kt_files != []) { @@ -4084,9 +4065,12 @@ output_jar_path = _javac_jar_path if (!_skip_header_jar) { deps = [ ":$_header_target_name" ] - header_jar_path = _final_ijar_path + header_jar_path = _header_jar_path generated_jar_path = _generated_jar_path } + if (defined(_filtered_classes_jar_path)) { + filtered_classes_jar_path = _filtered_classes_jar_path + } if (_kt_files != []) { kotlin_jar_path = _kotlinc_jar_path } @@ -4109,7 +4093,7 @@ } if (!_skip_header_jar) { deps = [ ":$_header_target_name" ] - header_jar_path = _final_ijar_path + header_jar_path = _header_jar_path } } _java_validate_deps += [ ":$_compile_java_errorprone_target" ] @@ -4172,7 +4156,7 @@ # other targets will resolve filtered classes when depending on # BuildConfig, NativeLibraries, etc. input_jar = _unprocessed_jar_path - output_jar = _final_ijar_path + output_jar = _header_jar_path # ijar needs only _unprocessed_jar_deps, but this also needs to export # __header and __build_config targets from deps. @@ -4182,15 +4166,22 @@ } if (_build_host_jar || _build_device_jar) { + _enable_bytecode_checks = !defined(invoker.enable_bytecode_checks) || + invoker.enable_bytecode_checks _enable_bytecode_checks = - (!defined(invoker.enable_bytecode_checks) || - invoker.enable_bytecode_checks) && !_is_prebuilt && - android_static_analysis != "off" + _enable_bytecode_checks && !_is_prebuilt && + android_static_analysis != "off" && !_skip_header_jar if (_enable_bytecode_checks) { _validate_target_name = "${target_name}__validate" check_for_missing_direct_deps(_validate_target_name) { forward_variables_from(invoker, [ "missing_classes_allowlist" ]) - deps = _unprocessed_jar_deps + _header_classpath_deps + deps = _unprocessed_jar_deps + _header_classpath_deps + + [ ":$_build_config_target_name" ] + if (_filter_jar) { + # Ensures the filtered classes appear on the classpath. + deps += [ ":$_header_target_name" ] + header_jar_path = _header_jar_path + } data_deps = _java_validate_deps if (defined(_compile_java_errorprone_target)) { data_deps += [ ":$_compile_java_errorprone_target" ] @@ -4206,70 +4197,55 @@ not_needed(invoker, [ "missing_classes_allowlist" ]) } - if (_build_host_jar) { - _process_host_jar_target_name = "${target_name}__host" - process_java_library(_process_host_jar_target_name) { + if (_filter_jar && _is_prebuilt) { + _filter_jar_target_name = "${target_name}__filter_jar" + filter_jar(_filter_jar_target_name) { forward_variables_from(invoker, [ "jar_excluded_patterns", "jar_included_patterns", ]) + deps = _unprocessed_jar_deps + input_jar = _unprocessed_jar_path + output_jar = _filter_jar_path + } + _process_jar_target_name = _filter_jar_target_name + } - # Robolectric tests require these to be on swarming. - data = [ _host_processed_jar_path ] - input_jar_path = _unprocessed_jar_path - deps = _unprocessed_jar_deps + _javac_classpath_deps - output_jar_path = _host_processed_jar_path - jacoco_instrument = _jacoco_instrument - if (_jacoco_instrument) { - source_files = _source_files - target_sources_file = _target_sources_file + if (_jacoco_instrument) { + # We run offline code coverage processing here rather than with a + # javaagent as the desired coverage data was not being generated. + # See crbug.com/1097815. + _process_jar_target_name = "${target_name}__jacoco" + jacoco_instr(_process_jar_target_name) { + source_files = _source_files + target_sources_file = _target_sources_file + + # Needed for generated sources + deps = _non_java_deps + if (defined(_filter_jar_target_name)) { + deps += [ ":$_filter_jar_target_name" ] + input_jar_path = _filter_jar_path + } else { + deps += _unprocessed_jar_deps + input_jar_path = _unprocessed_jar_path } - # _java_host_deps isn't necessary for process_java_library(), but is - # necessary so that this target can be used to depend on transitive - # __device targets without the need to create a separate group() - # target. This trade-off works because process_java_library is fast. - deps += _java_host_deps - - # Add runtime_deps here since robolectric_binary does not depend on top-level group. - if (defined(invoker.data)) { - data += invoker.data - } - if (defined(invoker.data_deps)) { - data_deps = invoker.data_deps - } + output_jar_path = _processed_jar_path } } + if (defined(_process_jar_target_name)) { + _processed_jar_deps = [ ":$_process_jar_target_name" ] + } else { + assert(_unprocessed_jar_path == _processed_jar_path) + _processed_jar_deps = _unprocessed_jar_deps + } + if (_build_device_jar) { - if (_process_device_jar) { - _process_device_jar_target_name = "${target_name}__process_device" - process_java_library(_process_device_jar_target_name) { - forward_variables_from(invoker, - [ - "jar_excluded_patterns", - "jar_included_patterns", - ]) - input_jar_path = _unprocessed_jar_path - - deps = _unprocessed_jar_deps + _javac_classpath_deps - output_jar_path = _device_processed_jar_path - jacoco_instrument = _jacoco_instrument - if (_jacoco_instrument) { - source_files = _source_files - target_sources_file = _target_sources_file - } - } - _process_device_jar_deps = [ ":${_process_device_jar_target_name}" ] - } else { - assert(_unprocessed_jar_path == _device_processed_jar_path) - _process_device_jar_deps = _unprocessed_jar_deps - } - if (_skip_header_jar) { group(_header_target_name) { - public_deps = [ ":$_process_device_jar_target_name" ] + public_deps = _processed_jar_deps } } @@ -4280,17 +4256,22 @@ "proguard_enable_obfuscation", "repackage_classes", ]) - input_class_jars = [ _device_processed_jar_path ] + input_class_jars = [ _processed_jar_path ] + enable_desugar = _enable_desugar ignore_desugar_missing_deps = !_enable_bytecode_checks # There's no value in per-class dexing prebuilts since they never # change just one class at a time. disable_incremental = _is_prebuilt output = _dex_path - deps = _process_device_jar_deps + _unprocessed_jar_deps + deps = _processed_jar_deps + _unprocessed_jar_deps - unprocessed_jar_path = _unprocessed_jar_path - if (default_min_sdk_version < 24) { + extra_classpath_jars = [ _unprocessed_jar_path ] + if (defined(_filtered_classes_jar_path)) { + extra_classpath_jars += [ _filtered_classes_jar_path ] + } + + if (enable_desugar && default_min_sdk_version < 24) { # Desugaring with D8 requires classpath for default method desugaring (required until API 24). build_config = _build_config deps += _header_classpath_deps @@ -4357,9 +4338,23 @@ } } - if (_supports_host && !defined(_process_host_jar_target_name)) { - group("${target_name}__host") { - deps = _java_host_deps + group("${target_name}__host") { + deps = _java_host_deps + data = [] + + if (_build_host_jar) { + deps += _processed_jar_deps + + # Robolectric tests require these to be on swarming. + data += [ _processed_jar_path ] + } + + # Add runtime_deps here since robolectric_binary does not depend on top-level group. + if (defined(invoker.data)) { + data += invoker.data + } + if (defined(invoker.data_deps)) { + data_deps = invoker.data_deps } } @@ -4386,6 +4381,7 @@ "data_deps", "visibility", ]) + public_deps = [ ":${target_name}__host" ] if (_requires_android || (_supports_android && _is_library)) { # For non-robolectric targets, depend on other java target's top-level # groups so that the __dex step gets depended on. @@ -4393,7 +4389,7 @@ if (defined(invoker.deps)) { deps += invoker.deps } - public_deps = [ ":$_build_config_target_name" ] + public_deps += [ ":$_build_config_target_name" ] if (defined(invoker.public_deps)) { public_deps += invoker.public_deps } @@ -4440,7 +4436,6 @@ # For robolectric targets, depend only on non-java deps and the specific # subtargets below, which will not include __dex. deps = _non_java_deps - public_deps = [] if (defined(invoker.public_deps)) { public_deps += filter_exclude(invoker.public_deps, java_target_patterns) @@ -4452,8 +4447,8 @@ if (defined(invoker.apk_under_test)) { deps += [ invoker.apk_under_test ] } - if (defined(_process_device_jar_target_name)) { - public_deps += [ ":$_process_device_jar_target_name" ] + if (defined(_process_jar_target_name)) { + public_deps += [ ":$_process_jar_target_name" ] } if (defined(_dex_target_name)) { public_deps += [ ":$_dex_target_name" ] @@ -4463,11 +4458,6 @@ # by default. public_deps += [ ":${target_name}__assetres" ] } - if (_supports_host) { - # android_* targets define __host, but there's no need to build it by - # default. - public_deps += [ ":${target_name}__host" ] - } if (_is_java_binary) { public_deps += [ ":$_java_binary_script_target_name" ] }
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index f4dabbc..ea9ab152 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni
@@ -1992,6 +1992,9 @@ if (is_cronet_build) { defines += [ "_IS_CRONET_BUILD" ] defines += [ "_LOGTAG_PREFIX=cn_" ] + if (is_cronet_for_aosp_build) { + defines += [ "_CRONET_FOR_AOSP_BUILD" ] + } } else { defines += [ "_LOGTAG_PREFIX=cr_" ] }
diff --git a/build/rust/std/rules/BUILD.gn b/build/rust/std/rules/BUILD.gn index f77241d..a61269db 100644 --- a/build/rust/std/rules/BUILD.gn +++ b/build/rust/std/rules/BUILD.gn
@@ -288,232 +288,232 @@ } cargo_crate("compiler_builtins") { crate_type = "rlib" - crate_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/lib.rs" + crate_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/lib.rs" sources = [ - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/aarch64.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/aarch64_linux.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/arm.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/arm_linux.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/add.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/cmp.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/conv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/div.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/extend.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/mul.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/pow.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/sub.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/traits.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/float/trunc.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/hexagon.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/addsub.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/big.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/bswap.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/leading_zeros.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/mul.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/sdiv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/shift.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/specialized_div_rem/asymmetric.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/specialized_div_rem/binary_long.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/specialized_div_rem/delegate.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/specialized_div_rem/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/specialized_div_rem/norm_shift.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/specialized_div_rem/trifecta.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/trailing_zeros.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/traits.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/int/udiv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/lib.miri.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/lib.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/macros.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/math.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/mem/impls.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/mem/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/mem/x86_64.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/probestack.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/riscv.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/x86.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/x86_64.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/aarch64.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/aarch64_linux.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/arm.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/arm_linux.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/add.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/cmp.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/conv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/div.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/extend.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/mul.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/pow.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/sub.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/traits.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/float/trunc.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/hexagon.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/addsub.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/big.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/bswap.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/leading_zeros.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/mul.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/sdiv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/shift.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/specialized_div_rem/asymmetric.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/specialized_div_rem/binary_long.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/specialized_div_rem/delegate.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/specialized_div_rem/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/specialized_div_rem/norm_shift.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/specialized_div_rem/trifecta.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/trailing_zeros.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/traits.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/int/udiv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/lib.miri.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/lib.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/macros.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/math.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/mem/impls.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/mem/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/mem/x86_64.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/probestack.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/riscv.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/x86.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/x86_64.rs", ] inputs = [ - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/acos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/acosf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/acosh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/acoshf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/arch/aarch64.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/arch/i586.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/arch/i686.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/arch/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/arch/wasm32.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/asin.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/asinf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/asinh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/asinhf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/atan.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/atan2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/atan2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/atanf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/atanh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/atanhf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/cbrt.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/cbrtf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ceil.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ceilf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ceilf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ceilf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/copysign.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/copysignf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/copysignf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/copysignf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/cos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/cosf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/cosh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/coshf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/erf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/erff.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/exp.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/exp10.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/exp10f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/exp2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/exp2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/expf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/expm1.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/expm1f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/expo2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fabs.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fabsf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fabsf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fabsf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fdim.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fdimf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fdimf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fdimf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/floor.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/floorf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/floorf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/floorf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fma.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fma_wide.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fmin_fmax.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fminimum_fmaximum.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fminimum_fmaximum_num.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fmod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fmodf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fmodf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/fmodf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/frexp.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/frexpf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/ceil.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/copysign.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fabs.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fdim.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/floor.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fmax.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fmaximum.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fmaximum_num.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fmin.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fminimum.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fminimum_num.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/fmod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/rint.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/round.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/scalbn.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/sqrt.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/generic/trunc.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/hypot.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/hypotf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ilogb.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ilogbf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/j0.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/j0f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/j1.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/j1f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/jn.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/jnf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/k_cos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/k_cosf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/k_expo2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/k_expo2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/k_sin.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/k_sinf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/k_tan.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/k_tanf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ldexp.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ldexpf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ldexpf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/ldexpf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/lgamma.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/lgamma_r.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/lgammaf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/lgammaf_r.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/log.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/log10.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/log10f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/log1p.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/log1pf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/log2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/log2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/logf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/modf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/modff.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/nextafter.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/nextafterf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/pow.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/powf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/rem_pio2.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/rem_pio2_large.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/rem_pio2f.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/remainder.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/remainderf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/remquo.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/remquof.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/rint.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/round.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/roundeven.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/roundf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/roundf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/roundf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/scalbn.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/scalbnf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/scalbnf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/scalbnf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sin.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sincos.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sincosf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sinf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sinh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sinhf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sqrt.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sqrtf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sqrtf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/sqrtf16.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/support/big/tests.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/support/big.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/support/env.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/support/float_traits.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/support/hex_float.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/support/int_traits.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/support/macros.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/support/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/tan.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/tanf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/tanh.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/tanhf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/tgamma.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/tgammaf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/trunc.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/truncf.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/truncf128.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../libm/src/math/truncf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/acos.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/acosf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/acosh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/acoshf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/arch/aarch64.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/arch/i586.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/arch/i686.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/arch/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/arch/wasm32.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/asin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/asinf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/asinh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/asinhf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/atan.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/atan2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/atan2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/atanf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/atanh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/atanhf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/cbrt.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/cbrtf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ceil.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ceilf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ceilf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ceilf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/copysign.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/copysignf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/copysignf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/copysignf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/cos.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/cosf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/cosh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/coshf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/erf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/erff.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/exp.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/exp10.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/exp10f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/exp2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/exp2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/expf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/expm1.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/expm1f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/expo2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fabs.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fabsf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fabsf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fabsf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fdim.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fdimf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fdimf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fdimf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/floor.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/floorf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/floorf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/floorf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fma.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fma_wide.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fmin_fmax.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fminimum_fmaximum.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fminimum_fmaximum_num.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fmod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fmodf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fmodf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/fmodf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/frexp.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/frexpf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/ceil.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/copysign.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fabs.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fdim.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/floor.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fmax.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fmaximum.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fmaximum_num.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fmin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fminimum.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fminimum_num.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/fmod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/rint.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/round.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/scalbn.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/sqrt.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/generic/trunc.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/hypot.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/hypotf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ilogb.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ilogbf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/j0.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/j0f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/j1.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/j1f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/jn.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/jnf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/k_cos.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/k_cosf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/k_expo2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/k_expo2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/k_sin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/k_sinf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/k_tan.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/k_tanf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ldexp.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ldexpf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ldexpf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/ldexpf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/lgamma.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/lgamma_r.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/lgammaf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/lgammaf_r.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/log.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/log10.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/log10f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/log1p.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/log1pf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/log2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/log2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/logf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/modf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/modff.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/nextafter.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/nextafterf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/pow.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/powf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/rem_pio2.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/rem_pio2_large.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/rem_pio2f.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/remainder.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/remainderf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/remquo.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/remquof.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/rint.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/round.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/roundeven.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/roundf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/roundf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/roundf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/scalbn.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/scalbnf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/scalbnf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/scalbnf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sincos.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sincosf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sinf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sinh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sinhf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sqrt.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sqrtf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sqrtf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/sqrtf16.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/support/big/tests.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/support/big.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/support/env.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/support/float_traits.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/support/hex_float.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/support/int_traits.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/support/macros.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/support/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/tan.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/tanf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/tanh.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/tanhf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/tgamma.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/tgammaf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/trunc.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/truncf.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/truncf128.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../libm/src/math/truncf16.rs", ] no_std = true # Unit tests skipped. Generate with --with-tests to include them. build_native_rust_unit_tests = false edition = "2021" - cargo_pkg_version = "0.1.152" + cargo_pkg_version = "0.1.155" cargo_pkg_authors = "Jorge Aparicio <japaricious@gmail.com>" cargo_pkg_name = "compiler_builtins" cargo_pkg_description = "Compiler intrinsics used by the Rust compiler. Also available for other targets if necessary!" @@ -541,9 +541,9 @@ "default", "rustc-dep-of-std", ] - build_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/build.rs" - build_sources = [ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/build.rs" ] - build_script_inputs = [ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.152/src/../configure.rs" ] + build_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/build.rs" + build_sources = [ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/build.rs" ] + build_script_inputs = [ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/compiler_builtins-0.1.155/src/../configure.rs" ] rustenv = [ "CFG_DISABLE_UNSTABLE_FEATURES=0", "STD_ENV_ARCH=$rust_target_arch", @@ -573,6 +573,7 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/array/drain.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/array/equality.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/array/iter.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/array/iter/iter_inner.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/array/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/ascii.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/ascii/ascii_char.rs", @@ -582,7 +583,8 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/async_iter/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/bool.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/borrow.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/bstr.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/bstr/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/bstr/traits.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/cell.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/cell/lazy.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/cell/once.rs", @@ -756,6 +758,7 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/panicking.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/pat.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/pin.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/pin/unsafe_pinned.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/prelude/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/prelude/v1.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/core/src/primitive.rs", @@ -1651,20 +1654,22 @@ } cargo_crate("miniz_oxide") { crate_type = "rlib" - crate_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/lib.rs" + crate_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/lib.rs" sources = [ - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/deflate/buffer.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/deflate/core.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/deflate/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/deflate/stored.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/deflate/stream.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/deflate/zlib.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/inflate/core.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/inflate/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/inflate/output_buffer.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/inflate/stream.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/lib.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.3/src/shared.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/deflate/buffer.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/deflate/core.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/deflate/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/deflate/stored.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/deflate/stream.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/deflate/zlib.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/inflate/core.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/inflate/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/inflate/output_buffer.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/inflate/stream.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/lib.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/serde/big_array.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/serde/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/miniz_oxide-0.8.8/src/shared.rs", ] inputs = [] no_std = true @@ -1672,7 +1677,7 @@ # Unit tests skipped. Generate with --with-tests to include them. build_native_rust_unit_tests = false edition = "2021" - cargo_pkg_version = "0.8.3" + cargo_pkg_version = "0.8.8" cargo_pkg_authors = "Frommi <daniil.liferenko@gmail.com>, oyvindln <oyvindln@users.noreply.github.com>, Rich Geldreich richgel99@gmail.com" cargo_pkg_name = "miniz_oxide" cargo_pkg_description = "DEFLATE compression and decompression library rewritten in Rust based on miniz" @@ -2007,6 +2012,7 @@ executable_configs += [ "//build/config/compiler:no_chromium_code" ] deps = [ ":core", + ":rustc_literal_escaper", ":std", "//build/rust/std:profiler_builtins_group", "//build/rust/std:std_build_deps", @@ -2113,6 +2119,53 @@ output_dir = "$root_out_dir/local_rustc_sysroot/lib/rustlib/$rust_abi_target/lib/" } +cargo_crate("rustc_literal_escaper") { + crate_type = "rlib" + crate_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/rustc-literal-escaper-0.0.2/src/lib.rs" + sources = [ + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/rustc-literal-escaper-0.0.2/src/lib.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/vendor/rustc-literal-escaper-0.0.2/src/tests.rs", + ] + inputs = [] + no_std = true + + # Unit tests skipped. Generate with --with-tests to include them. + build_native_rust_unit_tests = false + edition = "2021" + cargo_pkg_version = "0.0.2" + cargo_pkg_name = "rustc-literal-escaper" + cargo_pkg_description = "Provides code to unescape string literals" + library_configs -= [ + "//build/config/compiler:chromium_code", + "//build/config/compiler:disallow_unstable_features", + ] + library_configs += [ "//build/config/compiler:no_chromium_code" ] + executable_configs -= [ + "//build/config/compiler:chromium_code", + "//build/config/compiler:disallow_unstable_features", + ] + executable_configs += [ "//build/config/compiler:no_chromium_code" ] + deps = [ + ":rustc_std_workspace_std", + "//build/rust/std:profiler_builtins_group", + "//build/rust/std:std_build_deps", + ] + aliased_deps = { + std = ":rustc_std_workspace_std" + } + features = [ "rustc-dep-of-std" ] + rustenv = [ + "CFG_DISABLE_UNSTABLE_FEATURES=0", + "STD_ENV_ARCH=$rust_target_arch", + ] + rustflags = [ + "--cfg=backtrace_in_libstd", + "-Zforce-unstable-if-unmarked", + "--cap-lints=allow", # Suppress all warnings in stdlib crates + ] + output_dir = + "$root_out_dir/local_rustc_sysroot/lib/rustlib/$rust_abi_target/lib/" +} cargo_crate("rustc_std_workspace_alloc") { crate_type = "rlib" crate_root = "//third_party/rust-toolchain/lib/rustlib/src/rust/library/rustc-std-workspace-alloc/lib.rs" @@ -2506,9 +2559,28 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/anonymous_pipe/unix.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/anonymous_pipe/unsupported.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/anonymous_pipe/windows.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/common.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/hermit.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/sgx.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/uefi.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/unix.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/unsupported.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/wasi.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/windows.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/windows/tests.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/xous.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/args/zkvm.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/cmath.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/env_consts.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/exit_guard.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fd/hermit.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fd/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fd/sgx.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fd/unix.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fd/unix/tests.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fd/wasi.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fs/common.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fs/hermit.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/fs/mod.rs", @@ -2554,9 +2626,6 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/common/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/common/small_c_string.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/common/tests.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/hermit/args.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/hermit/env.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/hermit/fd.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/hermit/futex.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/hermit/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/hermit/os.rs", @@ -2583,9 +2652,6 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/abi/usercalls/raw.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/abi/usercalls/tests.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/args.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/env.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/fd.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/libunwind_integration.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/sgx/os.rs", @@ -2601,7 +2667,6 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/solid/abi/fs.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/solid/abi/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/solid/abi/sockets.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/solid/env.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/solid/error.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/solid/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/solid/os.rs", @@ -2610,18 +2675,12 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/teeos/os.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/teeos/thread.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/trusty/mod.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/uefi/args.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/uefi/env.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/uefi/helpers.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/uefi/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/uefi/os.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/uefi/tests.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/uefi/thread.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/uefi/time.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/args.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/env.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fd.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fd/tests.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/fuchsia.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/futex.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/kernel_copy.rs", @@ -2641,17 +2700,12 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/thread_parking.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/time.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unix/weak.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/args.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/common.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/env.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/os.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/pipe.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/thread.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/time.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasi/args.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasi/env.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasi/fd.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasi/helpers.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasi/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasi/os.rs", @@ -2661,16 +2715,12 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasip2/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasm/atomics/futex.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasm/atomics/thread.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasm/env.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/wasm/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/api.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/api/tests.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/args.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/args/tests.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/c.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/c/windows_sys.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/compat.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/env.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/futex.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/handle.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/handle/tests.rs", @@ -2682,7 +2732,6 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/stack_overflow_uwp.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/thread.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/windows/time.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/xous/args.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/xous/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/xous/os.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/xous/os/params.rs", @@ -2690,7 +2739,6 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/xous/thread.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/xous/time.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/zkvm/abi.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/zkvm/args.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/zkvm/env.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/zkvm/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/pal/zkvm/os.rs", @@ -2809,8 +2857,8 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/native/eager.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/native/lazy.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/native/mod.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/no_threads.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/os.rs", - "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys/thread_local/statik.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/mod.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/process.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/std/src/sys_common/tests.rs", @@ -2996,6 +3044,7 @@ "//third_party/rust-toolchain/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/detect/os/linux/s390x.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/detect/os/openbsd/aarch64.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/detect/os/other.rs", + "//third_party/rust-toolchain/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/detect/os/riscv.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/detect/os/x86.rs", "//third_party/rust-toolchain/lib/rustlib/src/rust/library/stdarch/crates/std_detect/src/lib.rs",
diff --git a/build/zip_helpers.py b/build/zip_helpers.py index b8ab9dd..6d4bcba0 100644 --- a/build/zip_helpers.py +++ b/build/zip_helpers.py
@@ -116,6 +116,7 @@ output, *, base_dir=None, + path_transform=None, compress=None, zip_prefix_path=None, timestamp=None): @@ -125,6 +126,8 @@ inputs: A list of paths to zip, or a list of (zip_path, fs_path) tuples. output: Path, fileobj, or ZipFile instance to add files to. base_dir: Prefix to strip from inputs. + path_transform: Called for each entry path. Returns a new zip path, or None + to skip the file. compress: Whether to compress zip_prefix_path: Path prepended to file path in zip file. timestamp: Unix timestamp to use for files in the archive. @@ -153,6 +156,10 @@ for zip_path, fs_path in input_tuples: if zip_prefix_path: zip_path = posixpath.join(zip_prefix_path, zip_path) + if path_transform: + zip_path = path_transform(zip_path) + if zip_path is None: + continue add_to_zip_hermetic(out_zip, zip_path, src_path=fs_path, @@ -179,8 +186,8 @@ Args: output: Path, fileobj, or ZipFile instance to add files to. input_zips: Iterable of paths to zip files to merge. - path_transform: Called for each entry path. Returns a new path, or None to - skip the file. + path_transform: Called for each entry path. Returns a new zip path, or None + to skip the file. compress: Overrides compression setting from origin zip entries. """ assert not isinstance(input_zips, str) # Easy mistake to make.
diff --git a/cc/layers/tile_display_layer_impl.cc b/cc/layers/tile_display_layer_impl.cc index b6e96b2..85cca6e 100644 --- a/cc/layers/tile_display_layer_impl.cc +++ b/cc/layers/tile_display_layer_impl.cc
@@ -17,6 +17,7 @@ #include "cc/layers/append_quads_data.h" #include "cc/tiles/tiling_set_coverage_iterator.h" #include "cc/trees/layer_tree_impl.h" +#include "components/viz/client/client_resource_provider.h" #include "components/viz/common/quads/solid_color_draw_quad.h" #include "components/viz/common/quads/tile_draw_quad.h" @@ -47,19 +48,19 @@ TileDisplayLayerImpl::TileResource::~TileResource() = default; -TileDisplayLayerImpl::Tile::Tile() = default; - -TileDisplayLayerImpl::Tile::Tile(const TileContents& contents) - : contents_(contents) { +TileDisplayLayerImpl::Tile::Tile(TileDisplayLayerImpl& layer, + const TileContents& contents) + : layer_(layer), contents_(contents) { DCHECK(!std::holds_alternative<NoContents>(contents_)); } TileDisplayLayerImpl::Tile::Tile(Tile&&) = default; -TileDisplayLayerImpl::Tile& TileDisplayLayerImpl::Tile::operator=(Tile&&) = - default; - -TileDisplayLayerImpl::Tile::~Tile() = default; +TileDisplayLayerImpl::Tile::~Tile() { + if (auto* resource = std::get_if<TileResource>(&contents_)) { + layer_->DiscardResource(resource->resource.id); + } +} TileDisplayLayerImpl::Tiling::Tiling(TileDisplayLayerImpl& layer, float scale_key) @@ -126,16 +127,8 @@ if (auto* resource = std::get_if<TileResource>(&contents)) { layer_->ImportResource(resource->resource); } - old_tile = std::exchange(tiles_[key], std::make_unique<Tile>(contents)); - } - - if (old_tile) { - if (auto* resource = std::get_if<TileResource>(&old_tile->contents())) { - // As of now, this will mark only one resource discarded at a time. - // TODO(vikassoni): Optimize to discard resources in batch. This will - // eventually trigger less IPCs back to the Renderer. - layer_->DiscardResource(resource->resource.id); - } + old_tile = + std::exchange(tiles_[key], std::make_unique<Tile>(*layer_, contents)); } } @@ -145,10 +138,8 @@ return DisplayTilingCoverageIterator(this, coverage_scale, coverage_rect); } -TileDisplayLayerImpl::TileDisplayLayerImpl(Client& client, - LayerTreeImpl& tree, - int id) - : LayerImpl(&tree, id), client_(client) {} +TileDisplayLayerImpl::TileDisplayLayerImpl(LayerTreeImpl& tree, int id) + : LayerImpl(&tree, id) {} TileDisplayLayerImpl::~TileDisplayLayerImpl() = default; @@ -349,11 +340,26 @@ } void TileDisplayLayerImpl::DiscardResource(viz::ResourceId resource) { - client_->DiscardResource(std::move(resource)); + layer_tree_impl()->host_impl()->resource_provider()->RemoveImportedResource( + std::move(resource)); } void TileDisplayLayerImpl::ImportResource(viz::TransferableResource resource) { - client_->ImportResource(std::move(resource)); + // Note that using LayerTreeHostImpl* is safe since LayerTreeHostImpl owns + // ClientResourceProvider and hence oulives it. + auto release_callback = base::BindOnce( + [](LayerTreeHostImpl* host_impl, viz::ResourceId id, + const gpu::SyncToken& sync_token, bool is_lost) { + host_impl->ReturnResource({id, sync_token, + /*release_fence=*/gfx::GpuFenceHandle(), + /*count=*/1, is_lost}); + }, + layer_tree_impl()->host_impl(), resource.id); + + layer_tree_impl()->host_impl()->resource_provider()->ImportResource( + resource, /*impl_release_callback=*/std::move(release_callback), + /*main_thread_release_callback=*/base::NullCallback(), + /*evicted_callback=*/base::NullCallback()); } } // namespace cc
diff --git a/cc/layers/tile_display_layer_impl.h b/cc/layers/tile_display_layer_impl.h index 938eef8..00d2e13 100644 --- a/cc/layers/tile_display_layer_impl.h +++ b/cc/layers/tile_display_layer_impl.h
@@ -31,15 +31,6 @@ // layer down to Viz, and this layer uses that information to draw tile quads. class CC_EXPORT TileDisplayLayerImpl : public LayerImpl { public: - class CC_EXPORT Client { - public: - virtual ~Client() = default; - - // To notify client to Import or Discard a TransferableResource. - virtual void ImportResource(viz::TransferableResource resource) = 0; - virtual void DiscardResource(viz::ResourceId resource) = 0; - }; - struct NoContents {}; struct CC_EXPORT TileResource { @@ -57,11 +48,9 @@ class CC_EXPORT Tile { public: - Tile(); - explicit Tile(const TileContents& contents); - Tile(Tile&&); - Tile& operator=(Tile&&); + explicit Tile(TileDisplayLayerImpl& layer, const TileContents& contents); ~Tile(); + Tile(Tile&&); const TileContents& contents() const { return contents_; } @@ -83,6 +72,7 @@ bool IsReadyToDraw() const { return true; } private: + const raw_ref<TileDisplayLayerImpl> layer_; TileContents contents_; }; @@ -136,7 +126,7 @@ using TilingCoverageIterator<Tiling>::TilingCoverageIterator; }; - TileDisplayLayerImpl(Client& client, LayerTreeImpl& tree, int id); + TileDisplayLayerImpl(LayerTreeImpl& tree, int id); ~TileDisplayLayerImpl() override; Tiling& GetOrCreateTilingFromScaleKey(float scale_key); @@ -166,14 +156,13 @@ void DiscardResource(viz::ResourceId resource); private: - raw_ref<Client> client_; - std::vector<std::unique_ptr<Tiling>> tilings_; std::optional<SkColor4f> solid_color_; bool is_backdrop_filter_mask_ = false; // Denotes an area that is damaged and needs redraw. This is in the layer's // space. gfx::Rect damage_rect_; + std::vector<std::unique_ptr<Tiling>> tilings_; }; } // namespace cc
diff --git a/cc/paint/skia_paint_canvas.cc b/cc/paint/skia_paint_canvas.cc index 5bfa7ce..2b412ad 100644 --- a/cc/paint/skia_paint_canvas.cc +++ b/cc/paint/skia_paint_canvas.cc
@@ -56,7 +56,10 @@ const SkSurfaceProps& props) : canvas_(new SkCanvas(bitmap, props)), bitmap_(bitmap), owned_(canvas_) {} -SkiaPaintCanvas::~SkiaPaintCanvas() = default; +SkiaPaintCanvas::~SkiaPaintCanvas() { + canvas_ = nullptr; + image_provider_ = nullptr; +} SkImageInfo SkiaPaintCanvas::imageInfo() const { return canvas_->imageInfo();
diff --git a/cc/paint/skia_paint_canvas.h b/cc/paint/skia_paint_canvas.h index 6bf4d1a..12f2b13 100644 --- a/cc/paint/skia_paint_canvas.h +++ b/cc/paint/skia_paint_canvas.h
@@ -192,10 +192,10 @@ int GetMaxTextureSize() const; - raw_ptr<SkCanvas, DanglingUntriaged> canvas_; + raw_ptr<SkCanvas> canvas_; SkBitmap bitmap_; std::unique_ptr<SkCanvas> owned_; - raw_ptr<ImageProvider, DanglingUntriaged> image_provider_ = nullptr; + raw_ptr<ImageProvider> image_provider_ = nullptr; const ContextFlushes context_flushes_; int num_of_ops_ = 0;
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index a41103a..e3462d89 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -4907,6 +4907,11 @@ } } +void LayerTreeHostImpl::ReturnResource( + viz::ReturnedResource returned_resource) { + client_->ReturnResource(std::move(returned_resource)); +} + void LayerTreeHostImpl::CollectScrollbarUpdatesForCommit( CompositorCommitData* commit_data) const { commit_data->scrollbars.reserve(scrollbar_animation_controllers_.size());
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 02518e8..39d3a75 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -892,6 +892,8 @@ void UpdateChildLocalSurfaceId(); + void ReturnResource(viz::ReturnedResource returned_resource); + protected: LayerTreeHostImpl( const LayerTreeSettings& settings,
diff --git a/cc/trees/layer_tree_host_impl_client.h b/cc/trees/layer_tree_host_impl_client.h index ade4323..ade89a8a 100644 --- a/cc/trees/layer_tree_host_impl_client.h +++ b/cc/trees/layer_tree_host_impl_client.h
@@ -13,6 +13,7 @@ #include "cc/metrics/frame_sequence_tracker_collection.h" #include "cc/scheduler/scheduler.h" #include "cc/trees/presentation_time_callback_buffer.h" +#include "components/viz/common/resources/returned_resource.h" #include "components/viz/common/view_transition_element_resource_id.h" namespace viz { @@ -103,6 +104,8 @@ virtual void SetHasActiveThreadedScroll(bool is_scrolling) = 0; virtual void SetWaitingForScrollEvent(bool waiting_for_scroll_event) = 0; + virtual void ReturnResource(viz::ReturnedResource returned_resource) {} + virtual size_t CommitDurationSampleCountForTesting() const = 0; protected:
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index 1c9a812..93496c4 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h
@@ -820,6 +820,8 @@ float min_page_scale_factor, float max_page_scale_factor); + LayerTreeHostImpl* host_impl() { return host_impl_; } + class CC_EXPORT DiscardableImageMapUpdater { STACK_ALLOCATED();
diff --git a/chrome/VERSION b/chrome/VERSION index e329442..a446282 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=137 MINOR=0 -BUILD=7144 +BUILD=7145 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 24c16717..d69d725 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -1109,7 +1109,7 @@ "//chrome/browser/tab_ui/android:junit", "//chrome/browser/tabmodel:junit", "//chrome/browser/tabpersistence:junit", - "//chrome/browser/tabwindow:junit", + "//chrome/browser/tabwindow/internal:junit", "//chrome/browser/task_manager/internal/android:junit", "//chrome/browser/touch_to_fill/autofill/android/internal:junit", "//chrome/browser/touch_to_fill/common/android:junit",
diff --git a/chrome/android/features/keyboard_accessory/internal/java/src/org/chromium/chrome/browser/keyboard_accessory/ManualFillingComponentBridge.java b/chrome/android/features/keyboard_accessory/internal/java/src/org/chromium/chrome/browser/keyboard_accessory/ManualFillingComponentBridge.java index c122a60..4859a4c 100644 --- a/chrome/android/features/keyboard_accessory/internal/java/src/org/chromium/chrome/browser/keyboard_accessory/ManualFillingComponentBridge.java +++ b/chrome/android/features/keyboard_accessory/internal/java/src/org/chromium/chrome/browser/keyboard_accessory/ManualFillingComponentBridge.java
@@ -339,10 +339,18 @@ @CalledByNative private void addLoyaltyCardInfoToAccessorySheetData( AccessorySheetData accessorySheetData, + @AccessoryTabType int sheetType, @AccessorySuggestionType int suggestionType, @JniType("std::string") String merchantName, @JniType("std::u16string") String loyaltyCardNumber) { - // TODO: crbug.com/412619430 - Add filling callback for the loyalty card number chip. + Callback<UserInfoField> callback = + (field) -> { + assert mNativeView != 0 : "Controller was destroyed but the bridge wasn't!"; + ManualFillingMetricsRecorder.recordSuggestionSelected( + sheetType, suggestionType); + ManualFillingComponentBridgeJni.get() + .onFillingTriggered(mNativeView, this, sheetType, field); + }; accessorySheetData .getLoyaltyCardInfoList() .add( @@ -355,7 +363,7 @@ .setA11yDescription(loyaltyCardNumber) .setIsObfuscated(false) .setId("") - .setCallback((userInfoField) -> {}) + .setCallback(callback) .build())); }
diff --git a/chrome/android/features/tab_ui/java/res/values/styles.xml b/chrome/android/features/tab_ui/java/res/values/styles.xml index a1cbf74..00ca5ed 100644 --- a/chrome/android/features/tab_ui/java/res/values/styles.xml +++ b/chrome/android/features/tab_ui/java/res/values/styles.xml
@@ -25,7 +25,7 @@ <item name="android:focusable">true</item> <item name="android:clickable">true</item> <item name="buttonTextColor">@macro/default_text_color_accent1</item> - <item name="buttonColor">@color/color_primary_with_alpha_10</item> + <item name="buttonColor">?attr/colorPrimaryContainer</item> <item name="rippleColor">@android:color/transparent</item> <item name="verticalInset">0dp</item> <item name="rippleCornerRadiusTopStart">@dimen/share_button_corner_radius</item>
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/ArchivedTabsDialogCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/ArchivedTabsDialogCoordinator.java index 74e473a9..4228ba8 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/ArchivedTabsDialogCoordinator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/ArchivedTabsDialogCoordinator.java
@@ -83,6 +83,7 @@ import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; public class ArchivedTabsDialogCoordinator implements SnackbarManager.SnackbarManageable { @@ -750,7 +751,7 @@ private List<String> getTabGroupSyncIds() { if (!ChromeFeatureList.sAndroidTabDeclutterArchiveTabGroups.isEnabled() || mTabGroupSyncService == null) { - return null; + return Collections.emptyList(); } List<String> tabGroupSyncIds = new ArrayList<>();
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridContextMenuCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridContextMenuCoordinator.java index 3e4a956..159e23b 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridContextMenuCoordinator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridContextMenuCoordinator.java
@@ -174,7 +174,8 @@ recordUserActionWithPrefix("AddToNewGroup"); } else if (menuId == R.id.add_to_tab_group) { coordinator.showBottomSheet(List.of(tab)); - recordUserActionWithPrefix("AddToGroup"); + recordUserActionWithPrefix( + tab.getTabGroupId() == null ? "AddToGroup" : "MoveToGroup"); } else if (menuId == R.id.edit_bookmark) { tabBookmarker.addOrEditBookmark(tab); recordUserActionWithPrefix("EditBookmark"); @@ -206,7 +207,9 @@ } else { itemList.add( BrowserUiListMenuUtils.buildMenuListItem( - R.string.add_tab_to_group, + tab.getTabGroupId() == null + ? R.string.add_tab_to_group + : R.string.move_tab_to_group, R.id.add_to_tab_group, R.drawable.ic_widgets)); }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridContextMenuCoordinatorUnitTest.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridContextMenuCoordinatorUnitTest.java index 5ac7240..9ffe4da4 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridContextMenuCoordinatorUnitTest.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridContextMenuCoordinatorUnitTest.java
@@ -308,6 +308,21 @@ mCoordinator.buildMenuActionItems(mMenuItemList, TAB_ID); assertEquals(5, mMenuItemList.size()); + assertEquals(R.string.move_tab_to_group, getMenuItemTitleId(0)); + assertEquals(R.string.add_to_bookmarks, getMenuItemTitleId(1)); + assertEquals(R.string.share, getMenuItemTitleId(2)); + assertEquals(R.string.select_tab, getMenuItemTitleId(3)); + assertEquals(R.string.close_tab, getMenuItemTitleId(4)); + } + + @Test + public void testBuildMenuActionItems_notInGroup() { + mUrl = new GURL(LOCALHOST_URL); + when(mTab.getUrl()).thenReturn(mUrl); + when(mTab.getTabGroupId()).thenReturn(null); + mCoordinator.buildMenuActionItems(mMenuItemList, TAB_ID); + + assertEquals(5, mMenuItemList.size()); assertEquals(R.string.add_tab_to_group, getMenuItemTitleId(0)); assertEquals(R.string.add_to_bookmarks, getMenuItemTitleId(1)); assertEquals(R.string.share, getMenuItemTitleId(2)); @@ -350,6 +365,7 @@ @Test public void testBuildMenuActionItems_sharingDisabled() { mUrl = new GURL(CHROME_URL); + when(mTab.getTabGroupId()).thenReturn(null); when(mTab.getUrl()).thenReturn(mUrl); mCoordinator.buildMenuActionItems(mMenuItemList, TAB_ID);
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd index 657be9f15..bfc453e7 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd
@@ -981,6 +981,9 @@ =1 {Move to new window} other {Move to other window}} </message> + <message name="IDS_MOVE_TAB_TO_GROUP" desc="Content description for an action which moves a tab to another group."> + Move to group + </message> <!-- Tab Group List Bottom Sheet --> <message name="IDS_TAB_GROUP_LIST_BOTTOM_SHEET_TITLE" desc="Title text for a bottom sheet which is used to add a tab to a tab group.">
diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_MOVE_TAB_TO_GROUP.png.sha1 b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_MOVE_TAB_TO_GROUP.png.sha1 new file mode 100644 index 0000000..9006cee --- /dev/null +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings_grd/IDS_MOVE_TAB_TO_GROUP.png.sha1
@@ -0,0 +1 @@ +aa4f87231edd733e3d20fa2473403adc9bf38026 \ No newline at end of file
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupDialogPTTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupDialogPTTest.java index a09c854..b8d044a 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupDialogPTTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupDialogPTTest.java
@@ -63,7 +63,7 @@ @Rule public ChromeRenderTestRule mRenderTestRule = ChromeRenderTestRule.Builder.withPublicCorpus() - .setRevision(1) + .setRevision(2) .setBugComponent(ChromeRenderTestRule.Component.UI_BROWSER_MOBILE_TAB_GROUPS) .build();
diff --git a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/ArchivedTabsDialogCoordinatorUnitTest.java b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/ArchivedTabsDialogCoordinatorUnitTest.java index 14176b2..adcea9c3 100644 --- a/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/ArchivedTabsDialogCoordinatorUnitTest.java +++ b/chrome/android/features/tab_ui/junit/src/org/chromium/chrome/browser/tasks/tab_management/ArchivedTabsDialogCoordinatorUnitTest.java
@@ -73,6 +73,7 @@ import org.chromium.ui.modaldialog.ModalDialogManager; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** Tests for {@link TabListMediator}. */ @@ -193,7 +194,7 @@ public void testShow() { mCoordinator.show(mOnTabSelectingListener); verify(mRootView).addView(any()); - verify(mTabListEditorController).show(any(), eq(null), eq(null)); + verify(mTabListEditorController).show(any(), eq(Collections.emptyList()), eq(null)); verify(mTabListEditorController).setNavigationProvider(any()); verify(mTabListEditorController).setToolbarTitle("0 inactive tabs"); verify(mBackPressManager).addHandler(any(), eq(BackPressHandler.Type.ARCHIVED_TABS_DIALOG));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index 18489e93..6736a15 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -3199,11 +3199,14 @@ || id == R.id.add_tab_to_new_group_menu_id) { if (!mTabModelSelector.isTabStateInitialized()) return false; + Profile profile = mTabModelProfileSupplier.get(); TabGroupModelFilter filter = mTabModelSelector .getTabGroupModelFilterProvider() .getCurrentTabGroupModelFilter(); if (id == R.id.add_to_group_menu_id) { + TrackerFactory.getTrackerForProfile(profile) + .notifyEvent("menu_add_to_group_clicked"); if (filter.getTabGroupCount() == 0) { RecordUserAction.record("MobileMenuAddToNewGroup"); } else { @@ -3216,7 +3219,7 @@ filter, mRootUiCoordinator.getBottomSheetController(), getModalDialogManager(), - mTabModelProfileSupplier.get()) + profile) .handleAddToGroupAction(currentTab); } else if (id == R.id.all_bookmarks_menu_id) { getCompositorViewHolderSupplier()
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/tab_activity_glue/ActivityTabWebContentsDelegateAndroid.java b/chrome/android/java/src/org/chromium/chrome/browser/app/tab_activity_glue/ActivityTabWebContentsDelegateAndroid.java index b767e34..f531901d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/tab_activity_glue/ActivityTabWebContentsDelegateAndroid.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/tab_activity_glue/ActivityTabWebContentsDelegateAndroid.java
@@ -293,23 +293,42 @@ return; } - // Do nothing if the tab can currently be interacted with by the user. - if (mTab.isUserInteractable()) return; + // If the tab can currently be interacted with by the user and it's not in multi-window + // mode, then it is already focused so we can drop the call. + if (!mActivity.isInMultiWindowMode() && mTab.isUserInteractable()) { + return; + } TabModel model = mTabModelSelectorSupplier.get().getModel(mTab.isIncognito()); int index = model.indexOf(mTab); if (index == TabModel.INVALID_TAB_INDEX) return; TabModelUtils.setIndex(model, index); - // Do nothing if the mActivity is visible (STOPPED is the only valid invisible state as we - // explicitly check isActivityFinishingOrDestroyed above). - if (ApplicationStatus.getStateForActivity(mActivity) == ActivityState.STOPPED) { - bringActivityToForeground(); + WindowAndroid hostWindow = mTab.getWindowAndroid(); + + // If the activity is the top resumed activity, then it is already focused so we can drop + // the call. + if (hostWindow.isActivityTopResumedSupported() && hostWindow.isTopResumedActivity()) { + return; } + + // If the activity is visible in fullscreen windowing mode (STOPPED is the only valid + // invisible state in fullscreen windowing mode as we explicitly check + // isActivityFinishingOrDestroyed above), then it is already focused so we can drop the + // call. + if (!hostWindow.isActivityTopResumedSupported() + && !mActivity.isInMultiWindowMode() + && ApplicationStatus.getStateForActivity(mActivity) != ActivityState.STOPPED) { + return; + } + + bringActivityToForeground(); } /** Brings chrome's Activity to foreground, if it is not so. */ protected void bringActivityToForeground() { + // TODO(https://crbug.com/412888357): investigate updating the way of focusing activities. + // This intent is sent in order to get the activity back to the foreground if it was // not already. The previous call will activate the right tab in the context of the // TabModel but will only show the tab to the user if Chrome was already in the
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/tabmodel/HeadlessTabModelOrchestrator.java b/chrome/android/java/src/org/chromium/chrome/browser/app/tabmodel/HeadlessTabModelOrchestrator.java index ae46353a..20653b3420 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/tabmodel/HeadlessTabModelOrchestrator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/tabmodel/HeadlessTabModelOrchestrator.java
@@ -5,9 +5,12 @@ import org.chromium.base.ContextUtils; import org.chromium.base.lifetime.Destroyable; +import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.app.tabwindow.TabWindowManagerSingleton; import org.chromium.chrome.browser.crypto.CipherFactory; import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncControllerImpl; +import org.chromium.chrome.browser.tab_group_sync.TabGroupSyncServiceFactory; import org.chromium.chrome.browser.tab_ui.TabContentManager; import org.chromium.chrome.browser.tabmodel.HeadlessTabModelSelectorImpl; import org.chromium.chrome.browser.tabmodel.TabCreatorManager; @@ -19,6 +22,10 @@ import org.chromium.chrome.browser.tabmodel.TabbedModeTabPersistencePolicy; import org.chromium.chrome.browser.tabwindow.TabWindowManager; import org.chromium.chrome.browser.tabwindow.WindowId; +import org.chromium.components.prefs.PrefService; +import org.chromium.components.tab_group_sync.TabGroupSyncController; +import org.chromium.components.tab_group_sync.TabGroupSyncService; +import org.chromium.components.user_prefs.UserPrefs; /** * Performs the same purpose as the other orchestrators, but does not currently share any interface @@ -27,6 +34,7 @@ public class HeadlessTabModelOrchestrator implements Destroyable { private final TabPersistentStore mTabPersistentStore; private final TabModelSelectorImpl mTabModelSelector; + private final TabGroupSyncController mTabGroupSyncController; /** * @param windowId The id of the window to load tabs for. @@ -72,12 +80,20 @@ mTabPersistentStore.onNativeLibraryReady(); mTabPersistentStore.loadState(/* ignoreIncognitoFiles= */ false); mTabPersistentStore.restoreTabs(/* setActiveTab= */ false); + + TabGroupSyncService tabGroupSyncService = TabGroupSyncServiceFactory.getForProfile(profile); + PrefService prefs = UserPrefs.get(profile); + Supplier<Boolean> isActive = () -> false; + mTabGroupSyncController = + new TabGroupSyncControllerImpl( + mTabModelSelector, tabGroupSyncService, prefs, isActive); } @Override public void destroy() { mTabPersistentStore.destroy(); mTabModelSelector.destroy(); + mTabGroupSyncController.destroy(); } /** Returns the owned selector that this orchestrator is managing. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java index 47a5855a..de654a6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java
@@ -302,7 +302,7 @@ menu.findItem(R.id.reader_mode_prefs_id) .setVisible(isCurrentTabNotNull && shouldShowReaderModePrefs(currentTab)); menu.findItem(R.id.reader_mode_menu_id) - .setVisible(DomDistillerFeatures.sReaderModeDevEntryPoint.isEnabled()); + .setVisible(DomDistillerFeatures.showAlwaysOnEntryPoint()); updateManagedByMenuItem(menu, currentTab);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/DEPS b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/DEPS index 4eb809a5..87d47bb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/DEPS +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/DEPS
@@ -14,6 +14,7 @@ "+components/commerce/core/android/java", "+ui/android/java/src/org/chromium/ui", "+url/android", + "+components/feature_engagement", "+components/browser_ui/bottomsheet/android/java", "+components/browser_ui/desktop_windowing/android", "+content/public/android/java/src/org/chromium/content_public", @@ -29,9 +30,6 @@ "-chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java", "+components/omnibox/browser/android/java/src/org/chromium/components/omnibox/action/OmniboxActionDelegate.java", ], - 'ToolbarIphController.java': [ - "+components/feature_engagement", - ], 'ToolbarButtonInProductHelpController.java': [ "+chrome/android/java/src/org/chromium/chrome/browser", "+components/commerce/core/android/java/src/org/chromium/components/commerce/core/ShoppingService.java",
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java index d4cbb5a..88340cb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarButtonInProductHelpController.java
@@ -22,6 +22,7 @@ import org.chromium.chrome.browser.commerce.ShoppingServiceFactory; import org.chromium.chrome.browser.download.DownloadUtils; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.lifecycle.PauseResumeWithNativeObserver; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; @@ -241,6 +242,7 @@ /** Attempts to show an IPH text bubble for those that trigger on a cold start. */ public void showColdStartIph() { + showAddToGroupIph(); showDownloadHomeIph(); } @@ -294,8 +296,25 @@ .build()); } + private void showAddToGroupIph() { + if (ChromeFeatureList.sTabGroupParityBottomSheetAndroid.isEnabled()) { + mUserEducationHelper.requestShowIph( + new IphCommandBuilder( + mActivity.getResources(), + FeatureConstants.MENU_ADD_TO_GROUP, + R.string.tab_switcher_add_to_group_iph, + R.string.tab_switcher_add_to_group_iph) + .setAnchorView(mMenuButtonAnchorView) + .setOnShowCallback( + () -> turnOnHighlightForMenuItem(R.id.add_to_group_menu_id)) + .setOnDismissCallback(this::turnOffHighlightForMenuItem) + .build()); + } + } + /** * Show the download page in-product-help bubble. Also used by download page screenshot IPH. + * * @param tab The current tab. */ private void showDownloadPageTextBubble(final Tab tab, String featureName) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java index a91f870..99e5bbf0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
@@ -177,6 +177,8 @@ import org.chromium.components.browser_ui.widget.scrim.ScrimManager; import org.chromium.components.embedder_support.util.UrlConstants; import org.chromium.components.embedder_support.util.UrlUtilities; +import org.chromium.components.feature_engagement.EventConstants; +import org.chromium.components.feature_engagement.Tracker; import org.chromium.components.omnibox.action.OmniboxActionDelegate; import org.chromium.components.page_info.PageInfoController.OpenedFromSource; import org.chromium.components.search_engines.TemplateUrl; @@ -921,6 +923,37 @@ tab.getWindowAndroid().getActivity().get(), tab, tab.getProfile()); }; + View homeButton = controlContainer.findViewById(R.id.home_button); + if (homeButton != null) { + mHomeButtonCoordinator = + new HomeButtonCoordinator( + mActivity, + homeButton, + (view) -> { + if (ntpDelegate.isCurrentlyVisible()) { + // Record the clicking action on the home button. + BrowserUiUtils.recordModuleClickHistogram( + ModuleTypeOnStartAndNtp.HOME_BUTTON); + } + setUrlBarFocus(false, OmniboxFocusReason.UNFOCUS); + mToolbarTabController.openHomepage(); + Tracker tracker = + profileSupplier.hasValue() + ? TrackerFactory.getTrackerForProfile( + profileSupplier.get()) + : null; + boolean isPartnerHomepageEnabled = + PartnerBrowserCustomizations.getInstance() + .isHomepageProviderAvailableAndEnabled(); + if (tracker != null && isPartnerHomepageEnabled) { + tracker.notifyEvent( + EventConstants.PARTNER_HOME_PAGE_BUTTON_PRESSED); + } + }, + this::onHomeButtonMenuClick, + HomepagePolicyManager::isHomepageManagedByPolicy); + } + ImageButton backButton = mControlContainer.findViewById(R.id.back_button); if (backButton != null) { mBackButtonCoordinator = @@ -1637,8 +1670,6 @@ mHomepageEnabledSupplier, mCompositorViewHolder::getResourceManager, historyDelegate, - PartnerBrowserCustomizations.getInstance() - ::isHomepageProviderAvailableAndEnabled, initializeWithIncognitoColors, constraintsSupplier, mCompositorViewHolder.getInMotionSupplier(), @@ -1660,16 +1691,6 @@ HomepageManager.getInstance().addListener(mHomepageStateListener); mHomepageStateListener.onHomepageStateUpdated(); - View homeButton = controlContainer.findViewById(R.id.home_button); - if (homeButton != null) { - mHomeButtonCoordinator = - new HomeButtonCoordinator( - mActivity, - homeButton, - this::onHomeButtonMenuClick, - HomepagePolicyManager::isHomepageManagedByPolicy); - } - return toolbar; }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/HomeButtonTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/HomeButtonTest.java index e92fec85..c4bac0d9 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/HomeButtonTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/toolbar/HomeButtonTest.java
@@ -98,6 +98,7 @@ new HomeButtonCoordinator( sActivity, homeButton, + (view) -> {}, HomepageManager.getInstance()::onMenuClick, () -> false); SettingsNavigationFactory.setInstanceForTesting(mSettingsNavigation);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequestTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequestTest.java index dea959c..f63d381 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequestTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webauth/Fido2CredentialRequestTest.java
@@ -346,7 +346,7 @@ @Override public void invokeGetAssertionResponse( long nativeInternalAuthenticator, int status, ByteBuffer byteBuffer) { - mCallback.onSignResponse( + mCallback.onSignResponseWithStatus( status, byteBuffer == null ? null @@ -1372,14 +1372,16 @@ () -> { authenticator.getCredential( mRequestOptions, - (getCredentialResponse) -> - mCallback.onSignResponse( - getCredentialResponse.getGetAssertionResponse().status, - getCredentialResponse.getGetAssertionResponse() - .credential)); + (getCredentialResponse) -> { + Assert.assertEquals( + AuthenticatorStatus.SUCCESS, + getCredentialResponse.getGetAssertionResponse().status); + mCallback.onSignResponse( + getCredentialResponse.getGetAssertionResponse().credential, + /* passwordCredential= */ null); + }); }); mCallback.blockUntilCalled(); - Assert.assertEquals(mCallback.getStatus(), Integer.valueOf(AuthenticatorStatus.SUCCESS)); Fido2ApiTestHelper.validateGetAssertionResponse(mCallback.getGetAssertionResponse()); Fido2ApiTestHelper.verifyRespondedBeforeTimeout(mStartTimeMs); authenticator.close(); @@ -1410,11 +1412,14 @@ () -> { authenticator.getCredential( mRequestOptions, - (getCredentialResponse) -> - mCallback.onSignResponse( - getCredentialResponse.getGetAssertionResponse().status, - getCredentialResponse.getGetAssertionResponse() - .credential)); + (getCredentialResponse) -> { + Assert.assertEquals( + AuthenticatorStatus.SUCCESS, + getCredentialResponse.getGetAssertionResponse().status); + mCallback.onSignResponse( + getCredentialResponse.getGetAssertionResponse().credential, + /* passwordCredential= */ null); + }); }); mCallback.blockUntilCalled(); @@ -1441,15 +1446,16 @@ () -> { authenticator.getCredential( mRequestOptions, - (getCredentialResponse) -> - mCallback.onSignResponse( - getCredentialResponse.getGetAssertionResponse().status, - getCredentialResponse.getGetAssertionResponse() - .credential)); + (getCredentialResponse) -> { + Assert.assertEquals( + AuthenticatorStatus.NOT_ALLOWED_ERROR, + getCredentialResponse.getGetAssertionResponse().status); + mCallback.onSignResponse( + getCredentialResponse.getGetAssertionResponse().credential, + /* passwordCredential= */ null); + }); }); mCallback.blockUntilCalled(); - Assert.assertEquals( - mCallback.getStatus(), Integer.valueOf(AuthenticatorStatus.NOT_ALLOWED_ERROR)); Fido2ApiTestHelper.verifyRespondedBeforeTimeout(mStartTimeMs); authenticator.close(); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateUnitTest.java index b16dcf8..f04b8d2d 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateUnitTest.java
@@ -100,7 +100,7 @@ @LooperMode(LooperMode.Mode.LEGACY) @DisableFeatures({ ChromeFeatureList.ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_PAGE_SUMMARY, - DomDistillerFeatures.READER_MODE_DEV_ENTRY_POINT + DomDistillerFeatures.READER_MODE_IMPROVEMENTS }) public class AppMenuPropertiesDelegateUnitTest {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/autofill/AutofillImageFetcherTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/autofill/AutofillImageFetcherTest.java index 6f11ef5..805aac9 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/autofill/AutofillImageFetcherTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/autofill/AutofillImageFetcherTest.java
@@ -114,14 +114,14 @@ Bitmap treatedImageLarge = AutofillUiUtils.resizeAndAddRoundedCornersAndGreyBorder( TEST_IMAGE, cardIconSpecsLarge, true); - // Both generic and credit card art image fetcher histograms should log success twice (once - // for each size). + // Both generic and credit card art specific histograms should log success twice (once for + // each size). HistogramWatcher expectedHistogram = HistogramWatcher.newBuilder() .expectBooleanRecordTimes( "Autofill.ImageFetcher.Result", /* value= */ true, /* times= */ 2) .expectBooleanRecordTimes( - "Autofill.ImageFetcher.CreditCardArt.Result", + "Autofill.ImageFetcher.CreditCardArt.OverallResultOnBrowserStart", /* value= */ true, /* times= */ 2) .build(); @@ -182,14 +182,14 @@ }) .when(mMockImageFetcher) .fetchImage(any(Params.class), any(Callback.class)); - // Both generic and credit card art image fetcher histograms should log failure. Since - // fetching is attempted again, the generic histogram should log failure twice. + // Both generic and credit card art specific histograms should log failure. Since fetching + // is attempted again, the generic histogram should log failure twice. HistogramWatcher expectedHistogram = HistogramWatcher.newBuilder() .expectBooleanRecordTimes( "Autofill.ImageFetcher.Result", /* value= */ false, /* times= */ 2) .expectBooleanRecordTimes( - "Autofill.ImageFetcher.CreditCardArt.Result", + "Autofill.ImageFetcher.CreditCardArt.OverallResultOnBrowserStart", /* value= */ false, /* times= */ 1) .build(); @@ -237,8 +237,8 @@ Bitmap treatedImage = AutofillUiUtils.resizeAndAddRoundedCornersAndGreyBorder( TEST_IMAGE, cardIconSpecs, true); - // The credit card art image fetcher histogram should log success. Since image fetching - // succeeded after initially failing, the generic histogram should log both failure and + // The credit card art specific histogram should log success. Since image fetching succeeded + // after initially failing, the generic histogram should log both failure and // success. HistogramWatcher expectedHistogram = HistogramWatcher.newBuilder() @@ -247,7 +247,7 @@ .expectBooleanRecordTimes( "Autofill.ImageFetcher.Result", /* value= */ true, /* times= */ 1) .expectBooleanRecordTimes( - "Autofill.ImageFetcher.CreditCardArt.Result", + "Autofill.ImageFetcher.CreditCardArt.OverallResultOnBrowserStart", /* value= */ true, /* times= */ 1) .build(); @@ -321,11 +321,15 @@ GURL imageCacheKey = AutofillImageFetcherUtils.getPixAccountImageUrlWithParams(TEST_IMAGE_URL); Bitmap treatedImage = AutofillImageFetcherUtils.treatPixAccountImage(TEST_IMAGE); - // Success histograms should be logged for both images. + // Both generic and Pix account image specific histograms should log success. HistogramWatcher expectedHistogram = HistogramWatcher.newBuilder() .expectBooleanRecordTimes( "Autofill.ImageFetcher.Result", /* value= */ true, /* times= */ 1) + .expectBooleanRecordTimes( + "Autofill.ImageFetcher.PixAccountImage.OverallResultOnBrowserStart", + /* value= */ true, + /* times= */ 1) .build(); mAutofillImageFetcher.prefetchPixAccountImages(new GURL[] {TEST_IMAGE_URL}); @@ -377,17 +381,27 @@ }) .when(mMockImageFetcher) .fetchImage(any(Params.class), any(Callback.class)); - // Failure histogram should be logged since fetching was attempted but failed. + // Both generic and Pix account image specific histograms should log failure. Since fetching + // is attempted again, the generic histogram should log failure twice. HistogramWatcher expectedHistogram = HistogramWatcher.newBuilder() .expectBooleanRecordTimes( - "Autofill.ImageFetcher.Result", /* value= */ false, /* times= */ 1) + "Autofill.ImageFetcher.Result", /* value= */ false, /* times= */ 2) + .expectBooleanRecordTimes( + "Autofill.ImageFetcher.PixAccountImage.OverallResultOnBrowserStart", + /* value= */ false, + /* times= */ 1) .build(); mAutofillImageFetcher.prefetchPixAccountImages(new GURL[] {TEST_IMAGE_URL}); - // Verify that fetchImage was called once. - verify(mMockImageFetcher).fetchImage(any(Params.class), any(Callback.class)); + // Advance the clock to trigger the retry. + mShadowLooper.runOneTask(); + // Advance the task again to make sure image fetching is retried only once. + mShadowLooper.runOneTask(); + + // Verify that fetchImage was called twice. + verify(mMockImageFetcher, times(2)).fetchImage(any(Params.class), any(Callback.class)); // Verify that the cache is empty since image fetching failed. assertTrue(mAutofillImageFetcher.getCachedImagesForTesting().isEmpty()); @@ -397,6 +411,58 @@ @Test @SmallTest + public void testPrefetchPixAccountImages_validUrl_unsuccessfulImageFetch_successOnRetry() { + // Use AtomicInteger to track the number of calls. + AtomicInteger callCount = new AtomicInteger(0); + // Make the first fetch fail, and the second succeed. + doAnswer( + invocation -> { + Callback callback = invocation.getArgument(1); + if (callCount.getAndIncrement() == 0) { + callback.onResult(null); + return null; + } + callback.onResult(TEST_IMAGE); + return null; + }) + .when(mMockImageFetcher) + .fetchImage(any(Params.class), any(Callback.class)); + GURL imageCacheKey = + AutofillImageFetcherUtils.getPixAccountImageUrlWithParams(TEST_IMAGE_URL); + Bitmap treatedImage = AutofillImageFetcherUtils.treatPixAccountImage(TEST_IMAGE); + // The Pix account image specific histogram should log success. Since image fetching + // succeeded after initially failing, the generic histogram should log both failure and + // success. + HistogramWatcher expectedHistogram = + HistogramWatcher.newBuilder() + .expectBooleanRecordTimes( + "Autofill.ImageFetcher.Result", /* value= */ false, /* times= */ 1) + .expectBooleanRecordTimes( + "Autofill.ImageFetcher.Result", /* value= */ true, /* times= */ 1) + .expectBooleanRecordTimes( + "Autofill.ImageFetcher.PixAccountImage.OverallResultOnBrowserStart", + /* value= */ true, + /* times= */ 1) + .build(); + + mAutofillImageFetcher.prefetchPixAccountImages(new GURL[] {TEST_IMAGE_URL}); + Map<String, Bitmap> cachedImages = mAutofillImageFetcher.getCachedImagesForTesting(); + + // Advance the clock to trigger the retry. + mShadowLooper.runOneTask(); + + // Verify that fetchImage was called twice. + verify(mMockImageFetcher, times(2)).fetchImage(any(Params.class), any(Callback.class)); + + // Verify the image cache contains the fetched image. + assertEquals(1, cachedImages.size()); + assertTrue(treatedImage.sameAs(cachedImages.get(imageCacheKey.getSpec()))); + + expectedHistogram.assertExpected(); + } + + @Test + @SmallTest public void testPrefetchPixAccountImages_invalidOrEmptyUrl() { GURL invalidUrl = new GURL("invalid-image-url"); GURL emptyUrl = new GURL("");
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarUnitTest.java index 8c95918..7eea09c 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/customtabs/features/toolbar/CustomTabToolbarUnitTest.java
@@ -194,7 +194,6 @@ mMenuButtonCoordinator, mTabSwitcherButtonCoordinator, mHistoryDelegate, - mPartnerHomepageEnabledSupplier, mUserEducationHelper, trackerSupplier, mToolbarProgressBar,
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegateUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegateUnitTest.java index b0d86b7..0eb7b17a 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegateUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegateUnitTest.java
@@ -140,7 +140,7 @@ @RunWith(BaseRobolectricTestRunner.class) @DisableFeatures({ ChromeFeatureList.ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_PAGE_SUMMARY, - DomDistillerFeatures.READER_MODE_DEV_ENTRY_POINT + DomDistillerFeatures.READER_MODE_IMPROVEMENTS }) public class TabbedAppMenuPropertiesDelegateUnitTest { // Constants defining flags that determines multi-window menu items visibility. @@ -1099,6 +1099,34 @@ assertTrue(item.isEnabled()); } + @Test + @EnableFeatures(DomDistillerFeatures.READER_MODE_IMPROVEMENTS + ":always_on_entry_point/false") + public void readerModeEntryPointDisabled() { + setUpMocksForPageMenu(); + when(mTab.getUrl()).thenReturn(JUnitTestGURLs.EXAMPLE_URL); + doReturn(mTabModel).when(mTabModelSelector).getCurrentModel(); + + Menu menu = createTestMenu(); + mTabbedAppMenuPropertiesDelegate.prepareMenu(menu, null); + + MenuItem item = menu.findItem(R.id.reader_mode_menu_id); + assertFalse(item.isVisible()); + } + + @Test + @EnableFeatures(DomDistillerFeatures.READER_MODE_IMPROVEMENTS + ":always_on_entry_point/true") + public void readerModeEntryPointEnabled() { + setUpMocksForPageMenu(); + when(mTab.getUrl()).thenReturn(JUnitTestGURLs.EXAMPLE_URL); + doReturn(mTabModel).when(mTabModelSelector).getCurrentModel(); + + Menu menu = createTestMenu(); + mTabbedAppMenuPropertiesDelegate.prepareMenu(menu, null); + + MenuItem item = menu.findItem(R.id.reader_mode_menu_id); + assertTrue(item.isVisible()); + } + private Menu setUpMenuWithIncognitoReauthPage(boolean isShowing) { setUpMocksForOverviewMenu(); when(mTabModelSelector.getCurrentModel()).thenReturn(mIncognitoTabModel);
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index c47c4c9..3346f6d 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -8794,6 +8794,11 @@ Got extensions? <ph name="BEGIN_LINK"><a href="chrome://extensions"></ph>Manage your extensions<ph name="END_LINK"></a></ph> in one easy place. </message> + <!-- New Tab Footer --> + <message name="IDS_NEW_TAB_FOOTER_NAME" desc="The name of the New Tab Footer feature, a UI that may show at the bottom of the New Tab Page." translateable="false"> + New Tab Footer + </message> + <!-- Star View menu --> <if expr="use_titlecase"> <message name="IDS_STAR_VIEW_MENU_ADD_BOOKMARK" desc="The item label of the menu triggered from the star icon in the location bar for adding a bookmark."> @@ -10709,11 +10714,17 @@ <message name="IDS_PASSWORD_MANAGER_IPH_BODY_SAVE_TO_ACCOUNT" desc="Body of the in Product Help shown when the 'Save to account` is selected"> You can save this password in your Google Account or only on this device </message> - <message name="IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY" desc="Body of IPH prompting users to consider saving passwords"> - To save your password with Google Password Manager, sign in to Chrome + <message name="IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_TEMPLATE" is_accessibility_with_no_ui="true" desc="Placeholder for string to be shown for IPH prompting users to consider saving passwords"> + <ph name="message">$1<ex>Use Google Password Manager to sign in faster</ex></ph> + </message> + <message name="IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_SIGNED_IN" desc="Body of IPH prompting users to consider saving passwords"> + Use Google Password Manager to sign in faster to sites from any of your devices + </message> + <message name="IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_NOT_SIGNED_IN" desc="Body of IPH prompting users to consider saving passwords"> + To save strong passwords with Google Password Manager, sign in to Chrome </message> <message name="IDS_PASSWORDS_SAVE_PRIMING_PROMO_SCREENREADER" is_accessibility_with_no_ui="true" desc="Screenreader text for IPH prompting users to consider saving passwords"> - You can save passwords with Google Password Manager when you sign in to Chrome + You can save passwords with Google Password Manager when you are signed in to Chrome </message> <message name="IDS_PASSWORD_MANAGER_IPH_MANAGEMENT_BUBBLE_AFTER_SAVE" desc="Body of the in Product Help shown after saving a password informing the user about the password management bubble"> To view your password or add a note about it, click the key icon @@ -12394,6 +12405,9 @@ <message name ="IDS_DATA_SHARING_GET_GROUP_PREVIEW_ARIA_LABEL" desc="Aria label for the group preview card."> View more details about <ph name="GROUP_NAME">$1<ex>vacation group</ex></ph> </message> + <message name ="IDS_DATA_SHARING_PREVIEW_A11Y_NAME" desc="The accessibility name the data sharing preview dialog"> + Join tab group + </message> <!-- /Data Sharing Preview Dialog --> <!-- Data Sharing Leave Dialog -->
diff --git a/chrome/app/generated_resources_grd/IDS_DATA_SHARING_PREVIEW_A11Y_NAME.png.sha1 b/chrome/app/generated_resources_grd/IDS_DATA_SHARING_PREVIEW_A11Y_NAME.png.sha1 new file mode 100644 index 0000000..90389752 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_DATA_SHARING_PREVIEW_A11Y_NAME.png.sha1
@@ -0,0 +1 @@ +343f225086add714d89898484c1a39bfdf7bae3f \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY.png.sha1 b/chrome/app/generated_resources_grd/IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_NOT_SIGNED_IN.png.sha1 similarity index 100% rename from chrome/app/generated_resources_grd/IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY.png.sha1 rename to chrome/app/generated_resources_grd/IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_NOT_SIGNED_IN.png.sha1
diff --git a/chrome/app/generated_resources_grd/IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_SIGNED_IN.png.sha1 b/chrome/app/generated_resources_grd/IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_SIGNED_IN.png.sha1 new file mode 100644 index 0000000..b7a5bb6 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_SIGNED_IN.png.sha1
@@ -0,0 +1 @@ +d656fb2ecd458a55ec46e557934aec0156ed7c10 \ No newline at end of file
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index fd90937..4ebf0d7 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -626,7 +626,7 @@ Autofill can offer to save info when you submit forms, like your driver's license or passport number </message> <message name="IDS_SETTINGS_AUTOFILL_AI_TO_CONSIDER_DATA_USAGE" desc="Bullet 1 of 2 that appears beneath the 'Things to consider' title. The point of this bullet is to convey to the user the types of data that get shared with Google to support this feature. There are 2 data types: 1) 'sites you visit' can mean browsing history and the URL of the page the user is visiting, and 2) 'page content', by which we mean the words, visuals, and layout of the pages the user visits. This notion that Google is considering 'page content' is new. We want to lead with 'To offer suggestions' even though it might be a bit grammatically awkward, because we want to express the need / value before explaining the data that gets shared."> - To offer suggestions, sites you visit and page content are shared with Google + To offer suggestions and improve this feature, the page’s URL and content are shared with Google </message> <message name="IDS_SETTINGS_AUTOFILL_AI_TO_CONSIDER_STORAGE" desc="Bullet 2 of 2 that appears beneath the 'Things to consider' title. This statement isn't immediately relevant to how Autofill with AI works, but it's intended as a reassuring statement."> Your saved information is stored on your device
diff --git a/chrome/app/settings_strings_grdp/IDS_SETTINGS_AUTOFILL_AI_TO_CONSIDER_DATA_USAGE.png.sha1 b/chrome/app/settings_strings_grdp/IDS_SETTINGS_AUTOFILL_AI_TO_CONSIDER_DATA_USAGE.png.sha1 index 8bbeb6f..cc74904a 100644 --- a/chrome/app/settings_strings_grdp/IDS_SETTINGS_AUTOFILL_AI_TO_CONSIDER_DATA_USAGE.png.sha1 +++ b/chrome/app/settings_strings_grdp/IDS_SETTINGS_AUTOFILL_AI_TO_CONSIDER_DATA_USAGE.png.sha1
@@ -1 +1 @@ -af2dc5dbbb5029f6529bc14de8245926c4dfa66c \ No newline at end of file +633e1ff2c6488029b1bbcf136ef495d0486b112f \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 6a491418..ec04fd58 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -5305,10 +5305,6 @@ {"reader-mode-auto-distill", flag_descriptions::kReaderModeAutoDistillName, flag_descriptions::kReaderModeAutoDistillDescription, kOsAndroid, FEATURE_VALUE_TYPE(dom_distiller::kReaderModeAutoDistill)}, - {"reader-mode-dev-entry-point", - flag_descriptions::kReaderModeDevEntryPointName, - flag_descriptions::kReaderModeDevEntryPointDescription, kOsAndroid, - FEATURE_VALUE_TYPE(dom_distiller::kReaderModeDevEntryPoint)}, {"reader-mode-heuristics", flag_descriptions::kReaderModeHeuristicsName, flag_descriptions::kReaderModeHeuristicsDescription, kOsAndroid, MULTI_VALUE_TYPE(kReaderModeHeuristicsChoices)}, @@ -5988,6 +5984,9 @@ FEATURE_WITH_PARAMS_VALUE_TYPE(feed::kFeedHeaderRemoval, kFeedHeaderRemovalVariations, "FeedHeaderRemoval")}, + {"web-feed-deprecation", flag_descriptions::kWebFeedDeprecationName, + flag_descriptions::kWebFeedDeprecationDescription, kOsAndroid, + FEATURE_VALUE_TYPE(feed::kWebFeedKillSwitch)}, #endif // BUILDFLAG(IS_ANDROID) {"enable-force-dark", flag_descriptions::kAutoWebContentsDarkModeName, flag_descriptions::kAutoWebContentsDarkModeDescription, kOsAll,
diff --git a/chrome/browser/ai/ai_data_keyed_service_browsertest.cc b/chrome/browser/ai/ai_data_keyed_service_browsertest.cc index 2d0a58f..67682eb 100644 --- a/chrome/browser/ai/ai_data_keyed_service_browsertest.cc +++ b/chrome/browser/ai/ai_data_keyed_service_browsertest.cc
@@ -96,13 +96,14 @@ return browser()->tab_strip_model()->GetActiveWebContents(); } - void LoadSimplePage() { - content::NavigateToURLBlockUntilNavigationsComplete( - web_contents(), https_server_->GetURL("/simple.html"), 1); + void LoadPage(const GURL& url) { + content::NavigateToURLBlockUntilNavigationsComplete(web_contents(), url, 1); content::WaitForCopyableView( browser()->tab_strip_model()->GetActiveWebContents()); } + void LoadSimplePage() { LoadPage(https_server_->GetURL("/simple.html")); } + AiData QueryAiData() { base::test::TestFuture<AiData> ai_data; ai_data_service().GetAiData(1, web_contents(), "", ai_data.GetCallback(), @@ -127,6 +128,8 @@ return QueryAiDataWithSpecifier(std::move(specifier)); } + net::EmbeddedTestServer* https_server() { return https_server_.get(); } + private: autofill::test::AutofillBrowserTestEnvironment autofill_test_environment_; passage_embeddings::TestEnvironment passage_embeddings_test_env_; @@ -300,7 +303,9 @@ } IN_PROC_BROWSER_TEST_F(AiDataKeyedServiceBrowserTest, AIPageContent) { - AiData ai_data = LoadSimplePageAndData(); + LoadPage( + https_server()->GetURL("/optimization_guide/actionable_elements.html")); + AiData ai_data = QueryAiData(); ASSERT_TRUE(ai_data.has_value()); { @@ -312,6 +317,7 @@ EXPECT_EQ(content_attributes.attribute_type(), optimization_guide::proto::CONTENT_ATTRIBUTE_ROOT); EXPECT_FALSE(content_attributes.has_interaction_info()); + EXPECT_EQ(page_content.root_node().children_nodes().size(), 0); } { @@ -323,7 +329,11 @@ page_content.root_node().content_attributes(); EXPECT_EQ(content_attributes.attribute_type(), optimization_guide::proto::CONTENT_ATTRIBUTE_ROOT); - EXPECT_TRUE(content_attributes.has_interaction_info()); + EXPECT_FALSE(content_attributes.has_interaction_info()); + + ASSERT_EQ(page_content.root_node().children_nodes().size(), 1); + const auto& child = page_content.root_node().children_nodes().at(0); + EXPECT_TRUE(child.content_attributes().has_interaction_info()); } }
diff --git a/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.cc b/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.cc index a8ccc36..ffc8530 100644 --- a/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.cc +++ b/chrome/browser/apps/app_service/metrics/app_platform_input_metrics.cc
@@ -4,7 +4,10 @@ #include "chrome/browser/apps/app_service/metrics/app_platform_input_metrics.h" +#include <string_view> + #include "ash/shell.h" +#include "base/containers/fixed_flat_map.h" #include "base/metrics/histogram_macros.h" #include "chrome/browser/apps/app_service/metrics/app_platform_metrics.h" #include "chrome/browser/apps/app_service/metrics/app_platform_metrics_utils.h" @@ -36,19 +39,13 @@ constexpr char kInputEventTouchKey[] = "touch"; constexpr char kInputEventKeyboardKey[] = "keyboard"; -base::flat_map<std::string, InputEventSource>& GetInputEventSourceMap() { - static base::NoDestructor<base::flat_map<std::string, InputEventSource>> - input_event_source_map; - if (input_event_source_map->empty()) { - *input_event_source_map = { +constexpr auto kInputEventSourceMap = + base::MakeFixedFlatMap<std::string_view, InputEventSource>({ {kInputEventMouseKey, InputEventSource::kMouse}, {kInputEventStylusKey, InputEventSource::kStylus}, {kInputEventTouchKey, InputEventSource::kTouch}, {kInputEventKeyboardKey, InputEventSource::kKeyboard}, - }; - } - return *input_event_source_map; -} + }); InputEventSource GetInputEventSource(ui::EventPointerType type) { switch (type) { @@ -68,10 +65,9 @@ // Returns the input event source for the given `event_source` string. InputEventSource GetInputEventSourceFromString( const std::string& event_source) { - const auto& input_event_source_map = GetInputEventSourceMap(); - auto it = input_event_source_map.find(event_source); - return (it != input_event_source_map.end()) ? it->second - : InputEventSource::kUnknown; + auto it = kInputEventSourceMap.find(event_source); + return (it != kInputEventSourceMap.end()) ? it->second + : InputEventSource::kUnknown; } // Returns the string key for `event_source` to save input events in the user
diff --git a/chrome/browser/ash/boca/on_task/on_task_locked_session_navigation_throttle_interactive_ui_test.cc b/chrome/browser/ash/boca/on_task/on_task_locked_session_navigation_throttle_interactive_ui_test.cc index 7f043e2e..9df6395 100644 --- a/chrome/browser/ash/boca/on_task/on_task_locked_session_navigation_throttle_interactive_ui_test.cc +++ b/chrome/browser/ash/boca/on_task/on_task_locked_session_navigation_throttle_interactive_ui_test.cc
@@ -1245,7 +1245,7 @@ // Navigate to URLs that should be blocked. const GURL google_search_url = - embedded_test_server()->GetURL(kTabGoogleHost, "/?q=test"); + embedded_test_server()->GetURL(kTabGoogleHost, "/search?q=test"); ASSERT_TRUE( ui_test_utils::NavigateToURL(boca_app_browser, google_search_url)); EXPECT_NE(tab_strip_model->GetActiveWebContents()->GetLastCommittedURL(),
diff --git a/chrome/browser/ash/boca/on_task/on_task_locked_session_window_tracker_browsertest.cc b/chrome/browser/ash/boca/on_task/on_task_locked_session_window_tracker_browsertest.cc index 8521444f..fd957dc5 100644 --- a/chrome/browser/ash/boca/on_task/on_task_locked_session_window_tracker_browsertest.cc +++ b/chrome/browser/ash/boca/on_task/on_task_locked_session_window_tracker_browsertest.cc
@@ -775,9 +775,13 @@ EXPECT_EQ(on_task_blocklist->GetURLBlocklistState(random_google_url), policy::URLBlocklist::URLBlocklistState::URL_IN_ALLOWLIST); const GURL google_search_url = - embedded_test_server()->GetURL(kTabGoogleHost, "/?q=test"); + embedded_test_server()->GetURL(kTabGoogleHost, "/search?q=test"); EXPECT_EQ(on_task_blocklist->GetURLBlocklistState(google_search_url), policy::URLBlocklist::URLBlocklistState::URL_IN_BLOCKLIST); + const GURL google_redirect_url = embedded_test_server()->GetURL( + kTabGoogleHost, "/url?q=https://classroom.google.com"); + EXPECT_EQ(on_task_blocklist->GetURLBlocklistState(google_redirect_url), + policy::URLBlocklist::URLBlocklistState::URL_IN_ALLOWLIST); const GURL url_1_subdomain = embedded_test_server()->GetURL(kTabUrl1SubDomainHost, "/"); EXPECT_EQ(on_task_blocklist->GetURLBlocklistState(url_1_subdomain),
diff --git a/chrome/browser/ash/extensions/device_local_account_management_policy_provider.cc b/chrome/browser/ash/extensions/device_local_account_management_policy_provider.cc index f9ef98dd..8b26aa94 100644 --- a/chrome/browser/ash/extensions/device_local_account_management_policy_provider.cc +++ b/chrome/browser/ash/extensions/device_local_account_management_policy_provider.cc
@@ -68,7 +68,7 @@ } break; case policy::DeviceLocalAccountType::kArcvmKioskApp: - // Unexpected case. + // No companion extensions in ARC VM kiosk. break; }
diff --git a/chrome/browser/ash/extensions/users_private/users_private_apitest.cc b/chrome/browser/ash/extensions/users_private/users_private_apitest.cc index c8fcbf640..a02ceea 100644 --- a/chrome/browser/ash/extensions/users_private/users_private_apitest.cc +++ b/chrome/browser/ash/extensions/users_private/users_private_apitest.cc
@@ -224,7 +224,13 @@ } // namespace -IN_PROC_BROWSER_TEST_F(UsersPrivateApiTest, AddUser) { +// TODO(crbug.com/413060105): Re-enable this test +#if BUILDFLAG(IS_CHROMEOS) +#define MAYBE_AddUser DISABLED_AddUser +#else +#define MAYBE_AddUser AddUser +#endif +IN_PROC_BROWSER_TEST_F(UsersPrivateApiTest, MAYBE_AddUser) { EXPECT_TRUE(RunSubtest("addUser")) << message_; }
diff --git a/chrome/browser/ash/input_method/input_method_settings.cc b/chrome/browser/ash/input_method/input_method_settings.cc index c854e766..b283c2c 100644 --- a/chrome/browser/ash/input_method/input_method_settings.cc +++ b/chrome/browser/ash/input_method/input_method_settings.cc
@@ -11,7 +11,6 @@ #include "base/containers/fixed_flat_set.h" #include "base/feature_list.h" #include "base/metrics/histogram_functions.h" -#include "base/no_destructor.h" #include "base/strings/strcat.h" #include "chrome/browser/ash/input_method/assistive_prefs.h" #include "chrome/browser/ash/input_method/autocorrect_enums.h" @@ -451,8 +450,8 @@ } bool IsAutocorrectSupported(const std::string& engine_id) { - static const base::NoDestructor<base::flat_set<std::string>> - enabledInputMethods({ + static constexpr auto kEnabledInputMethods = + base::MakeFixedFlatSet<std::string_view>({ "xkb:be::fra", "xkb:be::ger", "xkb:be::nld", "xkb:br::por", "xkb:ca::fra", "xkb:ca:eng:eng", @@ -475,7 +474,7 @@ "xkb:us:workman:eng", }); - return enabledInputMethods->find(engine_id) != enabledInputMethods->end(); + return kEnabledInputMethods.contains(engine_id); } bool IsPhysicalKeyboardAutocorrectAllowed(const PrefService& prefs) {
diff --git a/chrome/browser/ash/login/session/user_session_manager.cc b/chrome/browser/ash/login/session/user_session_manager.cc index dec11f4..c4077dc 100644 --- a/chrome/browser/ash/login/session/user_session_manager.cc +++ b/chrome/browser/ash/login/session/user_session_manager.cc
@@ -132,6 +132,7 @@ #include "chromeos/ash/components/account_manager/account_manager_factory.h" #include "chromeos/ash/components/assistant/buildflags.h" #include "chromeos/ash/components/browser_context_helper/browser_context_flusher.h" +#include "chromeos/ash/components/browser_context_helper/browser_context_helper.h" #include "chromeos/ash/components/cryptohome/cryptohome_parameters.h" #include "chromeos/ash/components/dbus/dbus_thread_manager.h" #include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" @@ -370,7 +371,24 @@ prefs->SetBoolean(::prefs::kLanguageShouldMergeInputMethods, true); } -bool CanPerformEarlyRestart() { +bool IsKioskProfile(Profile* profile) { + const user_manager::User* user = + ash::BrowserContextHelper::Get()->GetUserByBrowserContext(profile); + return user && user->IsKioskType(); +} + +bool AreKioskTroubleshootingToolsEnabled(Profile* profile) { + return profile->GetPrefs()->GetBoolean( + ::prefs::kKioskTroubleshootingToolsEnabled); +} + +bool CanPerformEarlyRestart(Profile* profile) { + // Allow early restart in kiosk mode to apply flags for experimentation when + // the troubleshooting tools policy is set. + if (IsKioskProfile(profile) && AreKioskTroubleshootingToolsEnabled(profile)) { + return true; + } + const ExistingUserController* controller = ExistingUserController::current_controller(); if (!controller) @@ -985,15 +1003,10 @@ MaybeSaveSessionStartedTimeBeforeRestart(profile); - // Kiosk sessions keeps the startup flags. - if (user_manager::UserManager::Get() && - user_manager::UserManager::Get()->IsLoggedInAsKioskApp()) { + if (early_restart && !CanPerformEarlyRestart(profile)) { return false; } - if (early_restart && !CanPerformEarlyRestart()) - return false; - // We can't really restart if we've already restarted as a part of // user session restore after crash of in case when flags were changed inside // user session.
diff --git a/chrome/browser/ash/login/wizard_controller_unittest.cc b/chrome/browser/ash/login/wizard_controller_unittest.cc index 860991d..8af1c811 100644 --- a/chrome/browser/ash/login/wizard_controller_unittest.cc +++ b/chrome/browser/ash/login/wizard_controller_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include <utility> +#include "ash/constants/ash_switches.h" #include "ash/shell.h" #include "ash/test/ash_test_helper.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" @@ -24,6 +25,7 @@ #include "chrome/browser/ash/net/network_portal_detector_test_impl.h" #include "chrome/browser/ash/net/rollback_network_config/fake_rollback_network_config.h" #include "chrome/browser/ash/net/rollback_network_config/rollback_network_config_service.h" +#include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ash/profiles/signin_profile_handler.h" #include "chrome/browser/ash/settings/device_settings_cache.h" #include "chrome/browser/ash/settings/device_settings_test_helper.h" @@ -177,7 +179,12 @@ // be done to run unit tests, but is not directly related to the tests. class WizardControllerTestBase : public ::testing::Test { public: - WizardControllerTestBase() = default; + WizardControllerTestBase() { + // Stabilizes the behavior on branded build. + command_line_.GetProcessCommandLine()->AppendSwitchASCII( + ash::switches::kEnterpriseEnableUnifiedStateDetermination, + policy::AutoEnrollmentTypeChecker::kUnifiedStateDeterminationNever); + } void SetUp() override { profile_manager_ = std::make_unique<TestingProfileManager>( @@ -263,6 +270,8 @@ testing::NiceMock<MockEnrollmentLauncher> mock_enrollment_launcher_; private: + base::test::ScopedCommandLine command_line_; + std::unique_ptr<base::test::TaskEnvironment> task_environment_ = std::make_unique<content::BrowserTaskEnvironment>( base::test::TaskEnvironment::ThreadingMode::MULTIPLE_THREADS,
diff --git a/chrome/browser/ash/policy/core/device_local_account.cc b/chrome/browser/ash/policy/core/device_local_account.cc index 104fd41..24796aa 100644 --- a/chrome/browser/ash/policy/core/device_local_account.cc +++ b/chrome/browser/ash/policy/core/device_local_account.cc
@@ -80,6 +80,9 @@ ArcvmKioskAppBasicInfo::ArcvmKioskAppBasicInfo( const ArcvmKioskAppBasicInfo& other) = default; +ArcvmKioskAppBasicInfo& ArcvmKioskAppBasicInfo::operator=( + const ArcvmKioskAppBasicInfo&) = default; + ArcvmKioskAppBasicInfo::ArcvmKioskAppBasicInfo() = default; ArcvmKioskAppBasicInfo::~ArcvmKioskAppBasicInfo() = default;
diff --git a/chrome/browser/ash/policy/core/device_local_account.h b/chrome/browser/ash/policy/core/device_local_account.h index 5315d5b..d68edd2 100644 --- a/chrome/browser/ash/policy/core/device_local_account.h +++ b/chrome/browser/ash/policy/core/device_local_account.h
@@ -59,14 +59,19 @@ const std::string& class_name, const std::string& action, const std::string& display_name); - ArcvmKioskAppBasicInfo(const ArcvmKioskAppBasicInfo& other); ArcvmKioskAppBasicInfo(); ~ArcvmKioskAppBasicInfo(); + ArcvmKioskAppBasicInfo(const ArcvmKioskAppBasicInfo& other); + ArcvmKioskAppBasicInfo& operator=(const ArcvmKioskAppBasicInfo&); - const std::string& package_name() const { return package_name_; } - const std::string& class_name() const { return class_name_; } - const std::string& action() const { return action_; } - const std::string& display_name() const { return display_name_; } + [[nodiscard]] const std::string& package_name() const { + return package_name_; + } + [[nodiscard]] const std::string& class_name() const { return class_name_; } + [[nodiscard]] const std::string& action() const { return action_; } + [[nodiscard]] const std::string& display_name() const { + return display_name_; + } private: std::string package_name_;
diff --git a/chrome/browser/ash/scalable_iph/scalable_iph_delegate_impl.cc b/chrome/browser/ash/scalable_iph/scalable_iph_delegate_impl.cc index 4a4bd91..26377da 100644 --- a/chrome/browser/ash/scalable_iph/scalable_iph_delegate_impl.cc +++ b/chrome/browser/ash/scalable_iph/scalable_iph_delegate_impl.cc
@@ -29,6 +29,7 @@ #include "ash/system/notification_center/message_view_factory.h" #include "ash/webui/grit/ash_print_management_resources.h" #include "ash/webui/settings/public/constants/routes.mojom.h" +#include "base/containers/fixed_flat_map.h" #include "base/notreached.h" #include "base/strings/utf_string_conversions.h" #include "build/buildflag.h" @@ -122,24 +123,21 @@ kChromebookPerksUrlQueryNameId, it->second); } -const base::flat_map<ActionType, std::string>& GetActionTypeURLs() { - static const base::NoDestructor<base::flat_map<ActionType, std::string>> - action_type_urls( - {{ActionType::kOpenChrome, "chrome://new-tab-page/"}, - {ActionType::kOpenPlayStore, - "https://play.google.com/store/games?device=chromebook"}, - {ActionType::kOpenGoogleDocs, - "https://docs.google.com/document/?usp=installed_webapp/"}, - {ActionType::kOpenGooglePhotos, "https://photos.google.com/"}, - {ActionType::kOpenYouTube, "https://www.youtube.com/"}, - {ActionType::kOpenChromebookPerksWeb, - "https://www.google.com/chromebook/perks/"}, - {ActionType::kOpenChromebookPerksGfnPriority2022, - "https://www.google.com/chromebook/perks/?id=gfn.priority.2022"}, - {ActionType::kOpenChromebookPerksMinecraft2023, - "https://www.google.com/chromebook/perks/?id=minecraft.2023"}}); - return *action_type_urls; -} +constexpr auto kActionTypeUrls = + base::MakeFixedFlatMap<ActionType, std::string_view>( + {{ActionType::kOpenChrome, "chrome://new-tab-page/"}, + {ActionType::kOpenPlayStore, + "https://play.google.com/store/games?device=chromebook"}, + {ActionType::kOpenGoogleDocs, + "https://docs.google.com/document/?usp=installed_webapp/"}, + {ActionType::kOpenGooglePhotos, "https://photos.google.com/"}, + {ActionType::kOpenYouTube, "https://www.youtube.com/"}, + {ActionType::kOpenChromebookPerksWeb, + "https://www.google.com/chromebook/perks/"}, + {ActionType::kOpenChromebookPerksGfnPriority2022, + "https://www.google.com/chromebook/perks/?id=gfn.priority.2022"}, + {ActionType::kOpenChromebookPerksMinecraft2023, + "https://www.google.com/chromebook/perks/?id=minecraft.2023"}}); std::string ToString(ConnectionStateType connection_state_type) { switch (connection_state_type) { @@ -560,7 +558,7 @@ switch (action_type) { case ActionType::kOpenChrome: { OpenUrlForProfile(profile_, - GURL(GetActionTypeURLs().at(ActionType::kOpenChrome)), + GURL(kActionTypeUrls.at(ActionType::kOpenChrome)), GetLogger()); break; } @@ -582,16 +580,16 @@ << "Opening Play Store Android app. App launched: " << app_launched; } if (!app_launched) { - OpenUrlForProfile( - profile_, GURL(GetActionTypeURLs().at(ActionType::kOpenPlayStore)), - GetLogger()); + OpenUrlForProfile(profile_, + GURL(kActionTypeUrls.at(ActionType::kOpenPlayStore)), + GetLogger()); } break; } case ActionType::kOpenGoogleDocs: { - OpenUrlForProfile( - profile_, GURL(GetActionTypeURLs().at(ActionType::kOpenGoogleDocs)), - GetLogger()); + OpenUrlForProfile(profile_, + GURL(kActionTypeUrls.at(ActionType::kOpenGoogleDocs)), + GetLogger()); break; } case ActionType::kOpenGooglePhotos: { @@ -606,8 +604,7 @@ } if (!app_launched) { OpenUrlForProfile( - profile_, - GURL(GetActionTypeURLs().at(ActionType::kOpenGooglePhotos)), + profile_, GURL(kActionTypeUrls.at(ActionType::kOpenGooglePhotos)), GetLogger()); } break; @@ -635,14 +632,14 @@ extension_misc::kYoutubePwaAppId, apps::GetEventFlags(WindowOpenDisposition::NEW_WINDOW, /*prefer_container=*/true), - GURL(GetActionTypeURLs().at(ActionType::kOpenYouTube)), + GURL(kActionTypeUrls.at(ActionType::kOpenYouTube)), apps::LaunchSource::kFromOtherApp, std::make_unique<apps::WindowInfo>(display::kDefaultDisplayId)); SCALABLE_IPH_LOG(GetLogger()) << "Opening YouTube app via AppService."; } else { - OpenUrlForProfile( - profile_, GURL(GetActionTypeURLs().at(ActionType::kOpenYouTube)), - GetLogger()); + OpenUrlForProfile(profile_, + GURL(kActionTypeUrls.at(ActionType::kOpenYouTube)), + GetLogger()); } break; } @@ -666,20 +663,20 @@ case ActionType::kOpenChromebookPerksWeb: { OpenUrlForProfile( profile_, - GURL(GetActionTypeURLs().at(ActionType::kOpenChromebookPerksWeb)), + GURL(kActionTypeUrls.at(ActionType::kOpenChromebookPerksWeb)), GetLogger()); break; } case ActionType::kOpenChromebookPerksGfnPriority2022: { OpenUrlForProfile(profile_, - GURL(GetActionTypeURLs().at( + GURL(kActionTypeUrls.at( ActionType::kOpenChromebookPerksGfnPriority2022)), GetLogger()); break; } case ActionType::kOpenChromebookPerksMinecraft2023: { OpenUrlForProfile(profile_, - GURL(GetActionTypeURLs().at( + GURL(kActionTypeUrls.at( ActionType::kOpenChromebookPerksMinecraft2023)), GetLogger()); break;
diff --git a/chrome/browser/ash/system_web_apps/apps/terminal_source.cc b/chrome/browser/ash/system_web_apps/apps/terminal_source.cc index f6458f09..ca82166 100644 --- a/chrome/browser/ash/system_web_apps/apps/terminal_source.cc +++ b/chrome/browser/ash/system_web_apps/apps/terminal_source.cc
@@ -5,15 +5,15 @@ #include "chrome/browser/ash/system_web_apps/apps/terminal_source.h" #include <optional> +#include <string_view> #include "ash/constants/ash_features.h" -#include "base/containers/flat_map.h" +#include "base/containers/fixed_flat_map.h" #include "base/feature_list.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted_memory.h" -#include "base/no_destructor.h" #include "base/strings/escape.h" #include "base/strings/string_util.h" #include "base/task/task_traits.h" @@ -109,15 +109,15 @@ // Terminal gets files from /usr/share/chromeos-assets/crosh-builtin. // In chromium tests, these files don't exist, so we serve dummy values. if (!result) { - static const base::NoDestructor<base::flat_map<std::string, std::string>> - kTestFiles({ + static constexpr auto kTestFiles = + base::MakeFixedFlatMap<std::string_view, std::string_view>({ {"html/crosh.html", ""}, {"html/terminal.html", "<script src='/js/terminal.js'></script>"}, {"js/terminal.js", "chrome.terminalPrivate.openVmshellProcess([], () => {})"}, }); - auto it = kTestFiles->find(relative_path); - if (it != kTestFiles->end()) { + auto it = kTestFiles.find(relative_path); + if (it != kTestFiles.end()) { content = it->second; result = true; }
diff --git a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/AutofillImageFetcher.java b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/AutofillImageFetcher.java index 75d84ca..729a661 100644 --- a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/AutofillImageFetcher.java +++ b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/AutofillImageFetcher.java
@@ -10,7 +10,6 @@ import android.graphics.drawable.Drawable; import android.os.Handler; -import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.appcompat.content.res.AppCompatResources; @@ -20,6 +19,8 @@ import org.chromium.base.Callback; import org.chromium.base.ContextUtils; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; import org.chromium.chrome.browser.autofill.AutofillUiUtils.CardIconSpecs; import org.chromium.components.autofill.ImageSize; import org.chromium.components.embedder_support.simple_factory_key.SimpleFactoryKeyHandle; @@ -31,8 +32,10 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; +import java.util.function.Function; /** Fetches, and caches credit card art images. */ +@NullMarked public class AutofillImageFetcher { private static final long REFETCH_DELAY_MS = 5000; private static final int MAX_FETCH_ATTEMPTS = 2; @@ -40,7 +43,12 @@ // URL, logs "true" if image was fetched, "false" if the image was not fetched after {@link // #MAX_FETCH_ATTEMPTS} attempts. private static final String CREDIT_CARD_ART_OVERALL_SUCCESS_HISTOGRAM = - "Autofill.ImageFetcher.CreditCardArt.Result"; + "Autofill.ImageFetcher.CreditCardArt.OverallResultOnBrowserStart"; + // Logs the overall success rate of fetching Pix account images. For a given Pix account image + // URL, logs "true" if image was fetched, "false" if the image was not fetched after {@link + // #MAX_FETCH_ATTEMPTS} attempts. + private static final String PIX_ACCOUNT_IMAGE_OVERALL_SUCCESS_HISTOGRAM = + "Autofill.ImageFetcher.PixAccountImage.OverallResultOnBrowserStart"; private final Map<String, Integer> mFetchAttemptCounter = new HashMap<>(); private final Map<String, Bitmap> mImagesCache = new HashMap<>(); @@ -70,13 +78,30 @@ for (GURL url : urls) { // Capital One card art image is stored in Chrome binary. - if (url == null || url.getSpec().equals(AutofillUiUtils.CAPITAL_ONE_ICON_URL)) { + if (url == null + || !url.isValid() + || url.getSpec().equals(AutofillUiUtils.CAPITAL_ONE_ICON_URL)) { continue; } for (@ImageSize int size : imageSizes) { CardIconSpecs cardIconSpecs = CardIconSpecs.create(context, size); - fetchImage(url, cardIconSpecs); + String resolvedUrl = + AutofillUiUtils.getFifeIconUrlWithParams( + url, cardIconSpecs.getWidth(), cardIconSpecs.getHeight()) + .getSpec(); + Function<Bitmap, Bitmap> treatImageFunction = + bitmap -> + AutofillUiUtils.resizeAndAddRoundedCornersAndGreyBorder( + bitmap, cardIconSpecs, true); + Callback<@Nullable Bitmap> onImageFetched = + bitmap -> + treatAndCacheImage( + bitmap, + resolvedUrl, + treatImageFunction, + CREDIT_CARD_ART_OVERALL_SUCCESS_HISTOGRAM); + fetchImage(resolvedUrl, onImageFetched); } } } @@ -94,9 +119,18 @@ continue; } - GURL urlWithParams = AutofillImageFetcherUtils.getPixAccountImageUrlWithParams(url); - fetchImage( - urlWithParams, bitmap -> treatAndCachePixAccountImage(bitmap, urlWithParams)); + String resolvedUrl = + AutofillImageFetcherUtils.getPixAccountImageUrlWithParams(url).getSpec(); + Function<Bitmap, Bitmap> treatImageFunction = + bitmap -> AutofillImageFetcherUtils.treatPixAccountImage(bitmap); + Callback<@Nullable Bitmap> onImageFetched = + bitmap -> + treatAndCacheImage( + bitmap, + resolvedUrl, + treatImageFunction, + PIX_ACCOUNT_IMAGE_OVERALL_SUCCESS_HISTOGRAM); + fetchImage(resolvedUrl, onImageFetched); } } @@ -109,12 +143,12 @@ * @return {@link Drawable} to be displayed for the Pix account. */ public Drawable getPixAccountIcon(Context context, @Nullable GURL url) { - GURL cachedUrl = new GURL(""); + GURL resolvedUrl = new GURL(""); if (url != null && url.isValid()) { - cachedUrl = AutofillImageFetcherUtils.getPixAccountImageUrlWithParams(url); + resolvedUrl = AutofillImageFetcherUtils.getPixAccountImageUrlWithParams(url); } - return getIcon(context, cachedUrl, R.drawable.ic_account_balance); + return getIcon(context, resolvedUrl, R.drawable.ic_account_balance); } /** @@ -126,116 +160,81 @@ */ @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public Optional<Bitmap> getImageIfAvailable(GURL url, CardIconSpecs cardIconSpecs) { - GURL urlToCache = + GURL resolvedUrl = AutofillUiUtils.getFifeIconUrlWithParams( url, cardIconSpecs.getWidth(), cardIconSpecs.getHeight()); // If the card art image exists in the cache, return it. - if (mImagesCache.containsKey(urlToCache.getSpec())) { - return Optional.of(mImagesCache.get(urlToCache.getSpec())); + if (mImagesCache.containsKey(resolvedUrl.getSpec())) { + return Optional.of(mImagesCache.get(resolvedUrl.getSpec())); } return Optional.empty(); } /** - * Fetches image for the given URL. + * Fetches image for the given URL and passes it to the callback. * - * @param url The URL to fetch the image. + * @param resolvedUrl The final URL including any params to fetch the image. + * @param onImageFetched The callback to be called with the fetched image. */ - private void fetchImage(GURL url, CardIconSpecs cardIconSpecs) { - if (!url.isValid()) { - return; - } - - GURL urlToFetch = - AutofillUiUtils.getFifeIconUrlWithParams( - url, cardIconSpecs.getWidth(), cardIconSpecs.getHeight()); - if (mImagesCache.containsKey(urlToFetch.getSpec())) { + private void fetchImage(String resolvedUrl, Callback<@Nullable Bitmap> onImageFetched) { + if (mImagesCache.containsKey(resolvedUrl)) { return; } // Update the attempt count for fetching the image. - int fetchAttemptCount = mFetchAttemptCounter.getOrDefault(urlToFetch.getSpec(), 0); - mFetchAttemptCounter.put(urlToFetch.getSpec(), fetchAttemptCount + 1); + int fetchAttemptCount = mFetchAttemptCounter.getOrDefault(resolvedUrl, 0); + mFetchAttemptCounter.put(resolvedUrl, fetchAttemptCount + 1); ImageFetcher.Params params = ImageFetcher.Params.create( - urlToFetch.getSpec(), ImageFetcher.AUTOFILL_CARD_ART_UMA_CLIENT_NAME); - mImageFetcher.fetchImage(params, bitmap -> treatAndCacheImage(bitmap, url, cardIconSpecs)); - } - - /** - * Treats and caches the fetched image. If image fetching fails, retries fetching {@code - * MAX_FETCH_ATTEMPTS - 1} times with a delay of {@code REFETCH_DELAY_MS} between each attempt. - * - * @param bitmap Fetched image. - * @param url URL for the stored image in the server. - * @param cardIconSpecs The sizing specifications for the image. - */ - private void treatAndCacheImage(Bitmap bitmap, GURL url, CardIconSpecs cardIconSpecs) { - RecordHistogram.recordBooleanHistogram("Autofill.ImageFetcher.Result", bitmap != null); - - GURL urlToCache = - AutofillUiUtils.getFifeIconUrlWithParams( - url, cardIconSpecs.getWidth(), cardIconSpecs.getHeight()); - - if (bitmap != null) { - RecordHistogram.recordBooleanHistogram( - CREDIT_CARD_ART_OVERALL_SUCCESS_HISTOGRAM, /* sample= */ true); - - // When adding new sizes for card icons, check if the corner radius needs to be added as - // a suffix for caching (crbug.com/1431283). - mImagesCache.put( - urlToCache.getSpec(), - AutofillUiUtils.resizeAndAddRoundedCornersAndGreyBorder( - bitmap, cardIconSpecs, true)); - return; - } - - // Image fetching failed, and max retry attempts reached. - if (mFetchAttemptCounter.getOrDefault(urlToCache.getSpec(), 0) >= MAX_FETCH_ATTEMPTS) { - RecordHistogram.recordBooleanHistogram( - CREDIT_CARD_ART_OVERALL_SUCCESS_HISTOGRAM, /* sample= */ false); - return; - } - - // Image fetching failed, and max retry attempts not reached -> retry fetch after a delay. - Handler handler = new Handler(); - handler.postDelayed(() -> fetchImage(url, cardIconSpecs), REFETCH_DELAY_MS); - } - - /** - * Fetches image for the given URL and passes it to the callback. - * - * @param customUrl The final URL including any params to fetch the image. - * @param onImageFetched The callback to be called with the fetched image. - */ - private void fetchImage(GURL customUrl, Callback<Bitmap> onImageFetched) { - if (mImagesCache.containsKey(customUrl.getSpec())) { - return; - } - - ImageFetcher.Params params = - ImageFetcher.Params.create( - customUrl.getSpec(), ImageFetcher.AUTOFILL_CARD_ART_UMA_CLIENT_NAME); + resolvedUrl, ImageFetcher.AUTOFILL_CARD_ART_UMA_CLIENT_NAME); mImageFetcher.fetchImage(params, onImageFetched); } /** - * Adds enhancements to Pix account image, and caches it. + * Adds enhancements to {@code bitmap} by applying {@code treatImageFunction}, and caches it. If + * image fetching fails, retries fetching {@code MAX_FETCH_ATTEMPTS - 1} times with a delay of + * {@code REFETCH_DELAY_MS} between each attempt. * * @param bitmap The Bitmap fetched from server. - * @param urlToCache The key against which the treated Bitmap is cached. + * @param resolvedUrl The key against which the treated Bitmap is cached. + * @param treatImageFunction Imagetreatment function. + * @param overallSuccessHistogramName Histogram name to measure the success rate of a specific + * image type. Logs whether or not the image was fetched after a maximum of {@code + * MAX_FETCH_ATTEMPTS} attempts. */ - private void treatAndCachePixAccountImage(Bitmap bitmap, GURL urlToCache) { + private void treatAndCacheImage( + @Nullable Bitmap bitmap, + String resolvedUrl, + Function<Bitmap, Bitmap> treatImageFunction, + String overallSuccessHistogramName) { RecordHistogram.recordBooleanHistogram("Autofill.ImageFetcher.Result", bitmap != null); - if (bitmap == null) { + if (bitmap != null) { + RecordHistogram.recordBooleanHistogram(overallSuccessHistogramName, /* sample= */ true); + + mImagesCache.put(resolvedUrl, treatImageFunction.apply(bitmap)); return; } - mImagesCache.put( - urlToCache.getSpec(), AutofillImageFetcherUtils.treatPixAccountImage(bitmap)); + // Image fetching failed, and max retry attempts reached. + if (mFetchAttemptCounter.getOrDefault(resolvedUrl, 0) >= MAX_FETCH_ATTEMPTS) { + RecordHistogram.recordBooleanHistogram( + overallSuccessHistogramName, /* sample= */ false); + return; + } + + // Image fetching failed, and max retry attempts not reached -> retry fetch after a delay. + Callback<@Nullable Bitmap> onImageFetched = + fetchedBitmap -> + treatAndCacheImage( + fetchedBitmap, + resolvedUrl, + treatImageFunction, + overallSuccessHistogramName); + Handler handler = new Handler(); + handler.postDelayed(() -> fetchImage(resolvedUrl, onImageFetched), REFETCH_DELAY_MS); } /** @@ -243,16 +242,16 @@ * corresponding to `defaultIconId`. * * @param context {@link Context} to get the resources. - * @param cachedUrl The key for the cached custom image. + * @param resolvedUrl The key for the cached custom image. * @param defaultIconId Resource id of the default fallback icon. * @return {@link Drawable} which is either the custom icon corresponding to `cachedUrl` from * cache or the fallback icon corresponding to `defaultIconId` from resources. Prefers * former over latter. */ - private Drawable getIcon(Context context, GURL cachedUrl, int defaultIconId) { - if (cachedUrl.isValid() && mImagesCache.containsKey(cachedUrl.getSpec())) { + private Drawable getIcon(Context context, GURL resolvedUrl, int defaultIconId) { + if (resolvedUrl.isValid() && mImagesCache.containsKey(resolvedUrl.getSpec())) { return new BitmapDrawable( - context.getResources(), mImagesCache.get(cachedUrl.getSpec())); + context.getResources(), mImagesCache.get(resolvedUrl.getSpec())); } return AppCompatResources.getDrawable(context, defaultIconId);
diff --git a/chrome/browser/auxiliary_search/auxiliary_search_provider.cc b/chrome/browser/auxiliary_search/auxiliary_search_provider.cc index 803fcd8..b99cc61ae 100644 --- a/chrome/browser/auxiliary_search/auxiliary_search_provider.cc +++ b/chrome/browser/auxiliary_search/auxiliary_search_provider.cc
@@ -52,8 +52,10 @@ namespace { // Must match Java Tab.INVALID_TAB_ID. static constexpr int kInvalidTabId = -1; +// The next id to assign. +static int kIdCounter = 0; -const int kMaxNumMostVisitedSites = 4; +constexpr int kMaxNumMostVisitedSites = 4; using BackToJavaCallback = base::OnceCallback<void( std::unique_ptr<std::vector<base::WeakPtr<TabAndroid>>>)>; @@ -159,10 +161,12 @@ void AuxiliarySearchProvider::Shutdown() { if (most_visited_sites_) { - most_visited_sites_->RemoveMostVisitedURLsObserver(this); + if (!observers_map_.empty()) { + most_visited_sites_->RemoveMostVisitedURLsObserver(this); + } most_visited_sites_.reset(); } - is_observing_ = false; + observers_map_.clear(); } void AuxiliarySearchProvider::GetNonSensitiveTabs( @@ -194,21 +198,32 @@ helper->StartFetching(); } -void AuxiliarySearchProvider::SetObserverAndTrigger( +int AuxiliarySearchProvider::SetObserverAndTrigger( JNIEnv* env, const base::android::JavaRef<jobject>& j_ref_obj) { + auto j_ref = jni_zero::ScopedJavaGlobalRef<jobject>(j_ref_obj); + int id = kIdCounter++; + observers_map_[id] = j_ref; + // AuxiliarySearchProvider registers itself as an observer of the // |most_visited_sites_|. Don't register again if it has registered before. - if (is_observing_) { - return; + if (observers_map_.size() > 1) { + return id; } - is_observing_ = true; - j_ref_ = base::android::ScopedJavaGlobalRef<jobject>(j_ref_obj); - CHECK(most_visited_sites_); most_visited_sites_->AddMostVisitedURLsObserver(this, kMaxNumMostVisitedSites); + return id; +} + +void AuxiliarySearchProvider::RemoveObserver(JNIEnv* env, jint id) { + CHECK(observers_map_.contains(id)); + observers_map_.erase(id); + + if (observers_map_.size() == 0) { + most_visited_sites_->RemoveMostVisitedURLsObserver(this); + } } void AuxiliarySearchProvider::GetMostVisitedSites(JNIEnv* env) const { @@ -221,6 +236,9 @@ const std::map<ntp_tiles::SectionType, ntp_tiles::NTPTilesVector>& sections) { CHECK(most_visited_sites_); + if (observers_map_.empty()) { + return; + } JNIEnv* env = base::android::AttachCurrentThread(); std::vector<jni_zero::ScopedJavaLocalRef<jobject>> entries; @@ -248,13 +266,21 @@ convertSiteSuggestionScore(tile.score))); } - Java_AuxiliarySearchBridge_onMostVisitedSitesURLsAvailable(env, j_ref_, - entries); + for (auto const& [id, observer] : observers_map_) { + Java_AuxiliarySearchBridge_onMostVisitedSitesURLsAvailable(env, observer, + entries); + } } void AuxiliarySearchProvider::OnIconMadeAvailable(const GURL& site_url) { + if (observers_map_.empty()) { + return; + } + JNIEnv* env = base::android::AttachCurrentThread(); - Java_AuxiliarySearchBridge_onIconMadeAvailable(env, j_ref_, site_url); + for (auto const& [id, observer] : observers_map_) { + Java_AuxiliarySearchBridge_onIconMadeAvailable(env, observer, site_url); + } } // static
diff --git a/chrome/browser/auxiliary_search/auxiliary_search_provider.h b/chrome/browser/auxiliary_search/auxiliary_search_provider.h index 15a58452..de74a86 100644 --- a/chrome/browser/auxiliary_search/auxiliary_search_provider.h +++ b/chrome/browser/auxiliary_search/auxiliary_search_provider.h
@@ -54,9 +54,13 @@ const base::android::JavaParamRef<jobject>& j_callback_obj) const; // Sets an observer and immediately fetches the current most visited sites - // suggestions. - void SetObserverAndTrigger(JNIEnv* env, - const base::android::JavaRef<jobject>& j_ref_obj); + // suggestions. Returns the ID of the observer. + int SetObserverAndTrigger(JNIEnv* env, + const base::android::JavaRef<jobject>& j_ref_obj); + + // Removes the observer with the given ID from the observers list, and stops + // observing the most visited sites if all observers are removed. + void RemoveObserver(JNIEnv* env, jint observerId); // Starts a fetch of the current most visited sites suggestions. void GetMostVisitedSites(JNIEnv* env) const; @@ -74,6 +78,7 @@ QueryEmptyTabList); FRIEND_TEST_ALL_PREFIXES(AuxiliarySearchProviderBrowserTest, NativeTabTest); FRIEND_TEST_ALL_PREFIXES(AuxiliarySearchProviderBrowserTest, FilterTabsTest); + FRIEND_TEST_ALL_PREFIXES(AuxiliarySearchProviderTest, AddAndRemoveObservers); using NonSensitiveTabsCallback = base::OnceCallback<void(std::vector<base::WeakPtr<TabAndroid>>)>; @@ -94,8 +99,7 @@ std::vector<raw_ptr<TabAndroid, VectorExperimental>> all_tabs, NonSensitiveTabsCallback callback) const; - bool is_observing_ = false; - base::android::ScopedJavaGlobalRef<jobject> j_ref_; + std::map<int, jni_zero::ScopedJavaGlobalRef<jobject>> observers_map_; const raw_ptr<visited_url_ranking::VisitedURLRankingService> ranking_service_; std::unique_ptr<ntp_tiles::MostVisitedSites> most_visited_sites_;
diff --git a/chrome/browser/auxiliary_search/auxiliary_search_provider_unittest.cc b/chrome/browser/auxiliary_search/auxiliary_search_provider_unittest.cc new file mode 100644 index 0000000..cd07761a --- /dev/null +++ b/chrome/browser/auxiliary_search/auxiliary_search_provider_unittest.cc
@@ -0,0 +1,104 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/auxiliary_search/auxiliary_search_provider.h" + +#include <memory> + +#include "components/ntp_tiles/icon_cacher.h" +#include "components/ntp_tiles/most_visited_sites.h" +#include "components/prefs/testing_pref_service.h" +#include "components/visited_url_ranking/public/testing/mock_visited_url_ranking_service.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { +constexpr size_t kMaxNumMostVisitedSites = 4; +} // namespace + +class MockMostVisitedSites : public ntp_tiles::MostVisitedSites { + public: + explicit MockMostVisitedSites(PrefService* prefs) + : ntp_tiles::MostVisitedSites(prefs, + /*identity_manager*/ nullptr, + /*supervised_user_service*/ nullptr, + /*top_sites*/ nullptr, + /*popular_sites*/ nullptr, + /*custom_links*/ nullptr, + /*icon_cacher*/ nullptr, + /*is_default_chrome_app_migrated*/ true, + /*is_custom_links_mixable*/ false) {} + + MockMostVisitedSites(const MockMostVisitedSites&) = delete; + MockMostVisitedSites& operator=(const MockMostVisitedSites&) = delete; + + ~MockMostVisitedSites() override = default; + + MOCK_METHOD2(AddMostVisitedURLsObserver, + void(Observer* observer, size_t max_num_sites)); + MOCK_METHOD1(RemoveMostVisitedURLsObserver, void(Observer* observer)); +}; + +// Unit tests for AuxiliarySearchProvider. +class AuxiliarySearchProviderTest : public ::testing::Test { + public: + AuxiliarySearchProviderTest() { + auto mock_most_visited_sites = + std::make_unique<MockMostVisitedSites>(&testing_prefs_); + auxiliary_search_provider_ = std::make_unique<AuxiliarySearchProvider>( + &mock_visited_url_ranking_service_, std::move(mock_most_visited_sites)); + } + + AuxiliarySearchProviderTest(const AuxiliarySearchProviderTest&) = delete; + AuxiliarySearchProviderTest& operator=(const AuxiliarySearchProviderTest&) = + delete; + + protected: + TestingPrefServiceSimple testing_prefs_; + visited_url_ranking::MockVisitedURLRankingService + mock_visited_url_ranking_service_; + std::unique_ptr<AuxiliarySearchProvider> auxiliary_search_provider_; +}; + +TEST_F(AuxiliarySearchProviderTest, AddAndRemoveObservers) { + auto j_ref = base::android::JavaRef<jobject>(); + MockMostVisitedSites* mock_most_visited_sites = + static_cast<MockMostVisitedSites*>( + auxiliary_search_provider_->most_visited_sites_.get()); + + // Verifies to start observing most visited sites when the first observer is + // added. + EXPECT_CALL(*mock_most_visited_sites, + AddMostVisitedURLsObserver(testing::_, kMaxNumMostVisitedSites)) + .Times(1); + int id1 = auxiliary_search_provider_->SetObserverAndTrigger(nullptr, j_ref); + EXPECT_EQ(0, id1); + EXPECT_EQ(1u, auxiliary_search_provider_->observers_map_.size()); + + // Verifies not to call AddMostVisitedURLsObserver() again when more observer + // is added. + EXPECT_CALL(*mock_most_visited_sites, + AddMostVisitedURLsObserver(testing::_, kMaxNumMostVisitedSites)) + .Times(0); + auto j_ref_1 = base::android::JavaRef<jobject>(); + int id2 = auxiliary_search_provider_->SetObserverAndTrigger(nullptr, j_ref_1); + EXPECT_EQ(1, id2); + EXPECT_EQ(2u, auxiliary_search_provider_->observers_map_.size()); + + // Verifies still observing the most visited sites when an observer is + // removed. + EXPECT_CALL(*mock_most_visited_sites, + RemoveMostVisitedURLsObserver(testing::_)) + .Times(0); + auxiliary_search_provider_->RemoveObserver(nullptr, id2); + EXPECT_EQ(1u, auxiliary_search_provider_->observers_map_.size()); + + // Verifies not to observe most visited sites after the last observer is + // removed. + EXPECT_CALL(*mock_most_visited_sites, + RemoveMostVisitedURLsObserver(testing::_)) + .Times(1); + auxiliary_search_provider_->RemoveObserver(nullptr, id1); + EXPECT_TRUE(auxiliary_search_provider_->observers_map_.empty()); +}
diff --git a/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridge.java b/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridge.java index 1c059aa4..e2462ac 100644 --- a/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridge.java +++ b/chrome/browser/auxiliary_search/java/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridge.java
@@ -28,6 +28,7 @@ public class AuxiliarySearchBridge { private long mNativeBridge; private AuxiliarySearchProvider.Observer mObserver; + private int mObserverId; /** * Constructs a bridge for the auxiliary search provider. @@ -98,15 +99,15 @@ * * @param observer The observer to receive suggestions when they are ready. */ - public void setObserver(Observer observer) { + public void setObserver(@Nullable Observer observer) { if (observer == null) { mObserver = null; + AuxiliarySearchBridgeJni.get().removeObserver(mNativeBridge, mObserverId); return; } - assert mObserver == null; mObserver = observer; - AuxiliarySearchBridgeJni.get().setObserverAndTrigger(mNativeBridge, this); + mObserverId = AuxiliarySearchBridgeJni.get().setObserverAndTrigger(mNativeBridge, this); } /** Starts a fetch of the current most visited sites suggestions. */ @@ -164,6 +165,10 @@ return mObserver; } + int getObserverIdForTesting() { + return mObserverId; + } + @NativeMethods @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public interface Natives { @@ -176,7 +181,9 @@ long nativeAuxiliarySearchProvider, Callback<List<AuxiliarySearchDataEntry>> callback); - void setObserverAndTrigger(long nativeAuxiliarySearchProvider, AuxiliarySearchBridge self); + int setObserverAndTrigger(long nativeAuxiliarySearchProvider, AuxiliarySearchBridge self); + + void removeObserver(long nativeAuxiliarySearchProvider, int id); void getMostVisitedSites(long nativeAuxiliarySearchProvider); }
diff --git a/chrome/browser/auxiliary_search/junit/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridgeUnitTest.java b/chrome/browser/auxiliary_search/junit/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridgeUnitTest.java index 073fa54..27db9ee9 100644 --- a/chrome/browser/auxiliary_search/junit/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridgeUnitTest.java +++ b/chrome/browser/auxiliary_search/junit/src/org/chromium/chrome/browser/auxiliary_search/AuxiliarySearchBridgeUnitTest.java
@@ -9,7 +9,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; @@ -153,14 +152,17 @@ public void testSetObserver() { AuxiliarySearchProvider.Observer observer = mock(AuxiliarySearchProvider.Observer.class); + int id = 100; + when(mMockAuxiliarySearchBridgeJni.setObserverAndTrigger(eq(NATIVE_BRIDGE), eq(mBridge))) + .thenReturn(id); mBridge.setObserver(observer); assertEquals(observer, mBridge.getObserverForTesting()); + assertEquals(id, mBridge.getObserverIdForTesting()); verify(mMockAuxiliarySearchBridgeJni).setObserverAndTrigger(eq(NATIVE_BRIDGE), eq(mBridge)); Mockito.reset(mMockAuxiliarySearchBridgeJni); mBridge.setObserver(null); - verify(mMockAuxiliarySearchBridgeJni, never()) - .setObserverAndTrigger(anyLong(), any(AuxiliarySearchBridge.class)); + verify(mMockAuxiliarySearchBridgeJni).removeObserver(eq(NATIVE_BRIDGE), eq(id)); assertNull(mBridge.getObserverForTesting()); }
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 901e3c5..5e78d85 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -18,6 +18,7 @@ "//chrome/browser/chromeos/app_mode:unit_tests", "//chrome/browser/chromeos/arc:unit_tests", "//chrome/browser/chromeos/drivefs:unit_tests", + "//chrome/browser/chromeos/extensions/component_extension_content_settings:unit_tests", "//chrome/browser/chromeos/extensions/contact_center_insights:unit_tests", "//chrome/browser/chromeos/extensions/desk_api:unit_tests", "//chrome/browser/chromeos/extensions/file_system_provider:unit_tests",
diff --git a/chrome/browser/chromeos/extensions/component_extension_content_settings/BUILD.gn b/chrome/browser/chromeos/extensions/component_extension_content_settings/BUILD.gn index f63ad29..16dc494 100644 --- a/chrome/browser/chromeos/extensions/component_extension_content_settings/BUILD.gn +++ b/chrome/browser/chromeos/extensions/component_extension_content_settings/BUILD.gn
@@ -10,6 +10,8 @@ "component_extension_content_settings_allowlist.h", "component_extension_content_settings_allowlist_factory.cc", "component_extension_content_settings_allowlist_factory.h", + "component_extension_content_settings_provider.cc", + "component_extension_content_settings_provider.h", ] public_deps = [ "//chrome/browser:browser_public_dependencies" ] @@ -24,3 +26,17 @@ "//url:url", ] } + +source_set("unit_tests") { + testonly = true + + sources = [ "component_extension_content_settings_provider_unittest.cc" ] + + deps = [ + ":component_extension_content_settings", + "//base", + "//chrome/browser/content_settings:content_settings_factory", + "//chrome/test:test_support", + "//testing/gmock", + ] +}
diff --git a/chrome/browser/chromeos/extensions/component_extension_content_settings/DEPS b/chrome/browser/chromeos/extensions/component_extension_content_settings/DEPS index cb766b611..1676c11 100644 --- a/chrome/browser/chromeos/extensions/component_extension_content_settings/DEPS +++ b/chrome/browser/chromeos/extensions/component_extension_content_settings/DEPS
@@ -11,6 +11,9 @@ # refactor chromeos codes in //chrome to break these dependencies; see # crbug.com/332804822. Whenever possible, avoid adding new //chrome # dependencies to this list. - "+chrome/browser/profiles", + "+chrome/browser/content_settings/host_content_settings_map_factory.h", "+chrome/browser/extensions/component_extensions_allowlist/allowlist.h", + "+chrome/browser/profiles", + "+chrome/common/extensions/extension_constants.h", + "+chrome/test", ]
diff --git a/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.cc b/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.cc new file mode 100644 index 0000000..f0616b0 --- /dev/null +++ b/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.cc
@@ -0,0 +1,87 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.h" + +#include "base/functional/bind.h" +#include "base/values.h" +#include "chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_allowlist.h" + +namespace extensions { + +ComponentExtensionContentSettingsProvider:: + ComponentExtensionContentSettingsProvider( + ComponentExtensionContentSettingsAllowlist* allowlist) + : allowlist_(allowlist) { + // The ComponentExtensionContentSettingsProvider is owned by the + // HostContentSettingsMap which DependsOn the + // ComponentExtensionContentSettingsAllowlist (through their factory). This + // means this will get destroyed before the + // ComponentExtensionContentSettingsAllowlist and will be unsubscribed from + // it. + allowlist_subscription_ = + allowlist_->SubscribeForContentSettingsChange(base::BindRepeating( + &ComponentExtensionContentSettingsProvider::OnContentSettingsChange, + base::Unretained(this))); +} + +ComponentExtensionContentSettingsProvider:: + ~ComponentExtensionContentSettingsProvider() = default; + +std::unique_ptr<content_settings::RuleIterator> +ComponentExtensionContentSettingsProvider::GetRuleIterator( + ContentSettingsType content_type, + bool off_the_record, + const content_settings::PartitionKey& partition_key) const { + return allowlist_ ? allowlist_->GetRuleIterator(content_type) : nullptr; +} + +std::unique_ptr<content_settings::Rule> +ComponentExtensionContentSettingsProvider::GetRule( + const GURL& primary_url, + const GURL& secondary_url, + ContentSettingsType content_type, + bool off_the_record, + const content_settings::PartitionKey& partition_key) const { + return allowlist_ + ? allowlist_->GetRule(primary_url, secondary_url, content_type) + : nullptr; +} + +bool ComponentExtensionContentSettingsProvider::SetWebsiteSetting( + const ContentSettingsPattern& primary_pattern, + const ContentSettingsPattern& secondary_pattern, + ContentSettingsType content_type, + base::Value&& value, + const content_settings::ContentSettingConstraints& constraints, + const content_settings::PartitionKey& partition_key) { + // ComponentExtensionContentSettingsProvider doesn't support settings Website + // settings. + return false; +} + +void ComponentExtensionContentSettingsProvider::ClearAllContentSettingsRules( + ContentSettingsType content_type, + const content_settings::PartitionKey& partition_key) { + // ComponentExtensionContentSettingsProvider doesn't support changing content + // settings directly. +} + +void ComponentExtensionContentSettingsProvider::ShutdownOnUIThread() { + DCHECK(CalledOnValidThread()); + + RemoveAllObservers(); + allowlist_subscription_ = {}; + allowlist_ = nullptr; +} + +void ComponentExtensionContentSettingsProvider::OnContentSettingsChange( + const ContentSettingsPattern& primary_pattern, + const ContentSettingsPattern& secondary_pattern, + ContentSettingsType content_type) { + NotifyObservers(primary_pattern, secondary_pattern, content_type, + /*partition_key=*/nullptr); +} + +} // namespace extensions
diff --git a/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.h b/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.h new file mode 100644 index 0000000..9f8dcec0 --- /dev/null +++ b/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.h
@@ -0,0 +1,73 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_COMPONENT_EXTENSION_CONTENT_SETTINGS_COMPONENT_EXTENSION_CONTENT_SETTINGS_PROVIDER_H_ +#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_COMPONENT_EXTENSION_CONTENT_SETTINGS_COMPONENT_EXTENSION_CONTENT_SETTINGS_PROVIDER_H_ + +#include "base/callback_list.h" +#include "base/memory/raw_ptr.h" +#include "components/content_settings/core/browser/content_settings_observable_provider.h" +#include "components/content_settings/core/common/content_settings_constraints.h" +#include "components/content_settings/core/common/content_settings_partition_key.h" +#include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/content_settings/core/common/content_settings_types.h" + +namespace extensions { + +class ComponentExtensionContentSettingsAllowlist; + +// A provider that supplies HostContentSettingsMap with a list of auto-granted +// permissions from the underlying +// ComponentExtensionContentSettingsAllowList. +// +// PartitionKey is ignored by this provider because the content settings should +// apply across partitions. +class ComponentExtensionContentSettingsProvider final + : public content_settings::ObservableProvider { + public: + explicit ComponentExtensionContentSettingsProvider( + ComponentExtensionContentSettingsAllowlist* allowlist); + + ComponentExtensionContentSettingsProvider( + const ComponentExtensionContentSettingsProvider&) = delete; + ComponentExtensionContentSettingsProvider& operator=( + const ComponentExtensionContentSettingsProvider&) = delete; + + ~ComponentExtensionContentSettingsProvider() override; + + // content_settings::ObservableProvider implementation + std::unique_ptr<content_settings::RuleIterator> GetRuleIterator( + ContentSettingsType content_type, + bool off_the_record, + const content_settings::PartitionKey& partition_key) const override; + std::unique_ptr<content_settings::Rule> GetRule( + const GURL& primary_url, + const GURL& secondary_url, + ContentSettingsType content_type, + bool off_the_record, + const content_settings::PartitionKey& partition_key) const override; + bool SetWebsiteSetting( + const ContentSettingsPattern& primary_pattern, + const ContentSettingsPattern& secondary_pattern, + ContentSettingsType content_type, + base::Value&& value, + const content_settings::ContentSettingConstraints& constraints, + const content_settings::PartitionKey& partition_key) override; + void ClearAllContentSettingsRules( + ContentSettingsType content_type, + const content_settings::PartitionKey& partition_key) override; + void ShutdownOnUIThread() override; + + private: + void OnContentSettingsChange(const ContentSettingsPattern& primary_pattern, + const ContentSettingsPattern& secondary_pattern, + ContentSettingsType content_type); + + raw_ptr<ComponentExtensionContentSettingsAllowlist> allowlist_; + base::CallbackListSubscription allowlist_subscription_; +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_COMPONENT_EXTENSION_CONTENT_SETTINGS_COMPONENT_EXTENSION_CONTENT_SETTINGS_PROVIDER_H_
diff --git a/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider_unittest.cc b/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider_unittest.cc new file mode 100644 index 0000000..e2ed4a5 --- /dev/null +++ b/chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider_unittest.cc
@@ -0,0 +1,255 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.h" + +#include <utility> +#include <vector> + +#include "base/strings/strcat.h" +#include "base/test/gtest_util.h" +#include "chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_allowlist.h" +#include "chrome/browser/content_settings/host_content_settings_map_factory.h" +#include "chrome/common/extensions/extension_constants.h" +#include "chrome/test/base/chrome_render_view_host_test_harness.h" +#include "chrome/test/base/testing_browser_process.h" +#include "chrome/test/base/testing_profile_manager.h" +#include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/content_settings/core/common/content_settings.h" +#include "extensions/common/constants.h" +#include "extensions/common/extension_id.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "url/gurl.h" +#include "url/origin.h" +#include "url/url_constants.h" + +namespace extensions { + +namespace { +inline constexpr char kNonExtensionScheme[] = "non-extension"; +inline constexpr char kNotAllowlistedId[] = "not-allowlisted-extension"; + +GURL CreateURL(const std::string& scheme, const std::string& origin) { + return GURL(base::StrCat({scheme, url::kStandardSchemeSeparator, origin})); +} +GURL CreateExtensionURL(const std::string& extension_id) { + return CreateURL(kExtensionScheme, extension_id); +} +} // namespace + +class ComponentExtensionContentSettingsProviderTest + : public ChromeRenderViewHostTestHarness { + public: + HostContentSettingsMap* GetHostContentSettingsMap(Profile* profile) { + return HostContentSettingsMapFactory::GetForProfile(profile); + } + HostContentSettingsMap* GetHostContentSettingsMap() { + return GetHostContentSettingsMap(profile()); + } + + ComponentExtensionContentSettingsAllowlist* GetAllowlist(Profile* profile) { + return ComponentExtensionContentSettingsAllowlist::Get(profile); + } + ComponentExtensionContentSettingsAllowlist* GetAllowlist() { + return GetAllowlist(profile()); + } +}; + +TEST_F(ComponentExtensionContentSettingsProviderTest, + RegisterPermissionForAllowlistedExtension) { + auto* map = GetHostContentSettingsMap(); + + // Set default CONTENT_SETTING_BLOCK for FILE_SYSTEM_READ_GUARD. + map->SetDefaultContentSetting(ContentSettingsType::FILE_SYSTEM_READ_GUARD, + ContentSetting::CONTENT_SETTING_BLOCK); + + const auto pdf_component_extension_url = + CreateExtensionURL(extension_misc::kPdfExtensionId); + const auto app_payment_component_extension_url = + CreateExtensionURL(extension_misc::kInAppPaymentsSupportAppId); + + // Check that pdf_component_extension_url and + // app_payment_component_extension_url are not affected by + // allowlisted_schemes. This mechanism take precedence over provider. + ASSERT_EQ(ContentSetting::CONTENT_SETTING_BLOCK, + map->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); + ASSERT_EQ( + ContentSetting::CONTENT_SETTING_BLOCK, + map->GetContentSetting(app_payment_component_extension_url, + app_payment_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); + + // Grant CONTENT_SETTING_ALLOW to pdf_component_extension_url for + // FILE_SYSTEM_READ_GUARD + GetAllowlist()->RegisterAutoGrantedPermission( + url::Origin::Create(pdf_component_extension_url), + ContentSettingsType::FILE_SYSTEM_READ_GUARD); + + // Check that pdf_component_extension_url has CONTENT_SETTING_ALLOW for + // FILE_SYSTEM_READ_GUARD + EXPECT_EQ(ContentSetting::CONTENT_SETTING_ALLOW, + map->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); + // Check that nothing has changed for app_payment_component_extension_url + EXPECT_EQ( + ContentSetting::CONTENT_SETTING_BLOCK, + map->GetContentSetting(app_payment_component_extension_url, + app_payment_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); +} + +TEST_F(ComponentExtensionContentSettingsProviderTest, + RegisterPermissionsForAllowlistedExtension) { + auto* map = GetHostContentSettingsMap(); + + // Set default CONTENT_SETTING_BLOCK for FILE_SYSTEM_READ_GUARD and + // FILE_SYSTEM_WRITE_GUARD + map->SetDefaultContentSetting(ContentSettingsType::FILE_SYSTEM_READ_GUARD, + ContentSetting::CONTENT_SETTING_BLOCK); + map->SetDefaultContentSetting(ContentSettingsType::FILE_SYSTEM_WRITE_GUARD, + ContentSetting::CONTENT_SETTING_BLOCK); + + const auto pdf_component_extension_url = + CreateExtensionURL(extension_misc::kPdfExtensionId); + + // Check that pdf_component_extension_url are not affected by + // allowlisted_schemes. This mechanism take precedence over provider. + ASSERT_EQ(ContentSetting::CONTENT_SETTING_BLOCK, + map->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); + ASSERT_EQ(ContentSetting::CONTENT_SETTING_BLOCK, + map->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_WRITE_GUARD)); + + // Grant CONTENT_SETTING_ALLOW to pdf_component_extension_url for + // FILE_SYSTEM_READ_GUARD and FILE_SYSTEM_WRITE_GUARD + GetAllowlist()->RegisterAutoGrantedPermissions( + url::Origin::Create(pdf_component_extension_url), + {ContentSettingsType::FILE_SYSTEM_READ_GUARD, + ContentSettingsType::FILE_SYSTEM_WRITE_GUARD}); + + // Check that pdf_component_extension_url has CONTENT_SETTING_ALLOW for + // FILE_SYSTEM_READ_GUARD and FILE_SYSTEM_WRITE_GUARD + EXPECT_EQ(ContentSetting::CONTENT_SETTING_ALLOW, + map->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); + EXPECT_EQ(ContentSetting::CONTENT_SETTING_ALLOW, + map->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_WRITE_GUARD)); +} + +TEST_F(ComponentExtensionContentSettingsProviderTest, PermissionIsPerProfile) { + TestingProfileManager profile_manager(TestingBrowserProcess::GetGlobal()); + ASSERT_TRUE(profile_manager.SetUp()); + + // Create two profiles. + Profile* profile_1 = profile_manager.CreateTestingProfile("profile_1"); + Profile* profile_2 = profile_manager.CreateTestingProfile("profile_2"); + + // Set default CONTENT_SETTING_BLOCK for FILE_SYSTEM_READ_GUARD for both + // profiles + auto* map_1 = GetHostContentSettingsMap(profile_1); + map_1->SetDefaultContentSetting(ContentSettingsType::FILE_SYSTEM_READ_GUARD, + CONTENT_SETTING_BLOCK); + auto* map_2 = GetHostContentSettingsMap(profile_2); + map_2->SetDefaultContentSetting(ContentSettingsType::FILE_SYSTEM_READ_GUARD, + CONTENT_SETTING_BLOCK); + + const auto pdf_component_extension_url = + CreateExtensionURL(extension_misc::kPdfExtensionId); + + // Grant CONTENT_SETTING_ALLOW for FILE_SYSTEM_READ_GUARD to + // pdf_component_extension_url for profile_1 + GetAllowlist(profile_1)->RegisterAutoGrantedPermission( + url::Origin::Create(pdf_component_extension_url), + ContentSettingsType::FILE_SYSTEM_READ_GUARD); + + // Check that pdf_component_extension_url has CONTENT_SETTING_ALLOW for + // FILE_SYSTEM_READ_GUARD in profile_1 + EXPECT_EQ(CONTENT_SETTING_ALLOW, + map_1->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); + // Check that nothing has changed for profile_2 + EXPECT_EQ(CONTENT_SETTING_BLOCK, + map_2->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); +} + +TEST_F(ComponentExtensionContentSettingsProviderTest, + RegisterPermissionsForSpecialProfiles) { + TestingProfileManager profile_manager(TestingBrowserProcess::GetGlobal()); + ASSERT_TRUE(profile_manager.SetUp()); + + // Create special profiles. + TestingProfile* guest_profile = + profile_manager.CreateTestingProfile("guest_profile"); + guest_profile->SetGuestSession(true); + TestingProfile* original_profile = + profile_manager.CreateTestingProfile("original_profile"); + TestingProfile* off_the_record_profile = + TestingProfile::Builder().BuildOffTheRecord( + original_profile, Profile::OTRProfileID::CreateUniqueForTesting()); + + // Set default CONTENT_SETTING_BLOCK for FILE_SYSTEM_READ_GUARD for both + // profiles + auto* guest_map = GetHostContentSettingsMap(guest_profile); + guest_map->SetDefaultContentSetting( + ContentSettingsType::FILE_SYSTEM_READ_GUARD, CONTENT_SETTING_BLOCK); + auto* off_the_record_map = GetHostContentSettingsMap(off_the_record_profile); + off_the_record_map->SetDefaultContentSetting( + ContentSettingsType::FILE_SYSTEM_READ_GUARD, CONTENT_SETTING_BLOCK); + + const auto pdf_component_extension_url = + CreateExtensionURL(extension_misc::kPdfExtensionId); + + // Grant CONTENT_SETTING_ALLOW for FILE_SYSTEM_READ_GUARD to + // pdf_component_extension_url for guest_profile and off_the_record_profile + GetAllowlist(guest_profile) + ->RegisterAutoGrantedPermission( + url::Origin::Create(pdf_component_extension_url), + ContentSettingsType::FILE_SYSTEM_READ_GUARD); + GetAllowlist(off_the_record_profile) + ->RegisterAutoGrantedPermission( + url::Origin::Create(pdf_component_extension_url), + ContentSettingsType::FILE_SYSTEM_READ_GUARD); + + // Check that pdf_component_extension_url has CONTENT_SETTING_ALLOW for + // FILE_SYSTEM_READ_GUARD in guest_profile and off_the_record_profile + EXPECT_EQ(CONTENT_SETTING_ALLOW, + guest_map->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); + EXPECT_EQ(CONTENT_SETTING_ALLOW, + off_the_record_map->GetContentSetting( + pdf_component_extension_url, pdf_component_extension_url, + ContentSettingsType::FILE_SYSTEM_READ_GUARD)); +} + +TEST_F(ComponentExtensionContentSettingsProviderTest, + RegisterPermissionForNotAllowlistedExtension) { + const std::vector<GURL> bad_examples = { + // The scheme and ExtensionId are both incorrect + CreateURL(kNonExtensionScheme, kNotAllowlistedId), + // The ExtensionId is incorrect + CreateExtensionURL(kNotAllowlistedId), + // The scheme is incorrect + CreateURL(kNonExtensionScheme, extension_misc::kPdfExtensionId)}; + + for (const auto& gurl : bad_examples) { + EXPECT_DEATH_IF_SUPPORTED(GetAllowlist()->RegisterAutoGrantedPermission( + url::Origin::Create(gurl), + ContentSettingsType::FILE_SYSTEM_READ_GUARD), + std::string()); + } +} +} // namespace extensions
diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.cc b/chrome/browser/content_settings/host_content_settings_map_factory.cc index 7cab26e1..7a9d0dd7 100644 --- a/chrome/browser/content_settings/host_content_settings_map_factory.cc +++ b/chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -30,7 +30,7 @@ #include "base/trace_event/trace_event.h" #include "extensions/browser/api/content_settings/content_settings_custom_extension_provider.h" // nogncheck #include "extensions/browser/api/content_settings/content_settings_service.h" // nogncheck -#endif +#endif // BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(IS_ANDROID) #include "chrome/browser/content_settings/javascript_optimizer_provider_android.h" @@ -40,6 +40,11 @@ #include "chrome/browser/webapps/installable/installed_webapp_provider.h" #endif // BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_CHROMEOS) +#include "chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_allowlist_factory.h" +#include "chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_provider.h" +#endif // BUILDFLAG(IS_CHROMEOS) + #if BUILDFLAG(ENABLE_SESSION_SERVICE) #include "chrome/browser/sessions/exit_type_service_factory.h" #endif @@ -68,6 +73,10 @@ #if BUILDFLAG(ENABLE_EXTENSIONS) DependsOn(extensions::ContentSettingsService::GetFactoryInstance()); #endif +#if BUILDFLAG(IS_CHROMEOS) + DependsOn(extensions::ComponentExtensionContentSettingsAllowlistFactory:: + GetInstance()); +#endif // BUILDFLAG(IS_CHROMEOS) // Used by way of ShouldRestoreOldSessionCookies(). #if BUILDFLAG(ENABLE_SESSION_SERVICE) DependsOn(ExitTypeServiceFactory::GetInstance()); @@ -119,6 +128,15 @@ settings_map->RegisterProvider(ProviderType::kWebuiAllowlistProvider, std::move(allowlist_provider)); +#if BUILDFLAG(IS_CHROMEOS) + auto component_extension_provider = + std::make_unique<extensions::ComponentExtensionContentSettingsProvider>( + extensions::ComponentExtensionContentSettingsAllowlistFactory:: + GetForBrowserContext(profile)); + settings_map->RegisterProvider(ProviderType::kComponentExtensionProvider, + std::move(component_extension_provider)); +#endif // BUILDFLAG(IS_CHROMEOS) + #if BUILDFLAG(ENABLE_EXTENSIONS) // These must be registered before before the HostSettings are passed over to // the IOThread. Simplest to do this on construction. @@ -133,6 +151,7 @@ // interaction with profile->IsGuestSession()? false)); #endif // BUILDFLAG(ENABLE_EXTENSIONS) + supervised_user::SupervisedUserSettingsService* supervised_service = SupervisedUserSettingsServiceFactory::GetForKey(profile->GetProfileKey()); // This may be null in testing.
diff --git a/chrome/browser/devtools/protocol/target_handler.h b/chrome/browser/devtools/protocol/target_handler.h index 014d1fa..dc404bd 100644 --- a/chrome/browser/devtools/protocol/target_handler.h +++ b/chrome/browser/devtools/protocol/target_handler.h
@@ -8,7 +8,6 @@ #include <set> #include "chrome/browser/devtools/protocol/target.h" -#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list_observer.h" #include "net/base/host_port_pair.h"
diff --git a/chrome/browser/enterprise/connectors/device_trust/device_trust_features.cc b/chrome/browser/enterprise/connectors/device_trust/device_trust_features.cc index c6b1789..a7aa868 100644 --- a/chrome/browser/enterprise/connectors/device_trust/device_trust_features.cc +++ b/chrome/browser/enterprise/connectors/device_trust/device_trust_features.cc
@@ -33,7 +33,7 @@ BASE_FEATURE(kDTCAntivirusSignalEnabled, "DTCAntivirusSignalEnabled", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); bool IsDTCAntivirusSignalEnabled() { return base::FeatureList::IsEnabled(kDTCAntivirusSignalEnabled);
diff --git a/chrome/browser/enterprise/connectors/reporting/crash_reporting_context_unittest.cc b/chrome/browser/enterprise/connectors/reporting/crash_reporting_context_unittest.cc index 361f39d..8865cfb 100644 --- a/chrome/browser/enterprise/connectors/reporting/crash_reporting_context_unittest.cc +++ b/chrome/browser/enterprise/connectors/reporting/crash_reporting_context_unittest.cc
@@ -5,6 +5,7 @@ #include "base/command_line.h" #include "base/files/scoped_temp_dir.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.h" #include "chrome/browser/enterprise/connectors/reporting/realtime_reporting_client_factory.h" #include "chrome/browser/enterprise/connectors/test/mock_realtime_reporting_client.h" @@ -15,8 +16,6 @@ #include "components/enterprise/connectors/core/connectors_prefs.h" #include "components/enterprise/connectors/core/reporting_service_settings.h" #include "components/enterprise/connectors/core/reporting_test_utils.h" -#include "components/prefs/pref_registry_simple.h" -#include "components/prefs/testing_pref_service.h" #include "components/version_info/version_info.h" #include "content/public/test/browser_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -88,18 +87,16 @@ } TEST_F(CrashReportingContextTest, GetAndSetLatestCrashReportingTime) { - TestingPrefServiceSimple pref_service; - pref_service.registry()->RegisterInt64Pref(kLatestCrashReportCreationTime, 0); time_t timestamp = base::Time::Now().ToTimeT(); - SetLatestCrashReportTime(&pref_service, timestamp); - ASSERT_EQ(timestamp, GetLatestCrashReportTime(&pref_service)); + SetLatestCrashReportTime(g_browser_process->local_state(), timestamp); + ASSERT_EQ(timestamp, + GetLatestCrashReportTime(g_browser_process->local_state())); } TEST_F(CrashReportingContextTest, UploadToReportingServer) { - TestingPrefServiceSimple pref_service; - pref_service.registry()->RegisterInt64Pref(kLatestCrashReportCreationTime, 0); - EXPECT_EQ(static_cast<long>(0u), GetLatestCrashReportTime(&pref_service)); + EXPECT_EQ(static_cast<long>(0u), + GetLatestCrashReportTime(g_browser_process->local_state())); time_t timestamp = base::Time::Now().ToTimeT(); std::vector<crashpad::CrashReportDatabase::Report> reports; @@ -128,9 +125,10 @@ ReportPastEvent(kBrowserCrashEvent, _, _, base::Time::FromTimeT(timestamp))) .Times(1); - UploadToReportingServer(reporting_client->AsWeakPtrImpl(), &pref_service, - reports); - EXPECT_EQ(timestamp, GetLatestCrashReportTime(&pref_service)); + UploadToReportingServer(reporting_client->AsWeakPtrImpl(), + g_browser_process->local_state(), reports); + EXPECT_EQ(timestamp, + GetLatestCrashReportTime(g_browser_process->local_state())); } #if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/enterprise/data_protection/data_protection_clipboard_utils_browsertest.cc b/chrome/browser/enterprise/data_protection/data_protection_clipboard_utils_browsertest.cc index 43b9338..4e543491 100644 --- a/chrome/browser/enterprise/data_protection/data_protection_clipboard_utils_browsertest.cc +++ b/chrome/browser/enterprise/data_protection/data_protection_clipboard_utils_browsertest.cc
@@ -10,6 +10,7 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind.h" +#include "base/test/scoped_feature_list.h" #include "base/test/test_future.h" #include "base/threading/thread_restrictions.h" #include "build/build_config.h" @@ -21,6 +22,7 @@ #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" #include "components/enterprise/data_controls/core/browser/test_utils.h" +#include "components/safe_browsing/core/common/features.h" #include "content/public/test/browser_test.h" #include "ui/views/widget/widget_delegate.h" @@ -50,7 +52,11 @@ : public InProcessBrowserTest, public testing::WithParamInterface<bool> { public: - DataControlsClipboardUtilsBrowserTest() = default; + DataControlsClipboardUtilsBrowserTest() { + scoped_feature_list_.InitAndEnableFeature( + safe_browsing::kLocalIpAddressInEvents); + } + ~DataControlsClipboardUtilsBrowserTest() override = default; bool machine_scope() const { return GetParam(); } @@ -72,6 +78,7 @@ protected: std::unique_ptr<enterprise_connectors::test::EventReportValidatorHelper> event_report_validator_helper_; + base::test::ScopedFeatureList scoped_feature_list_; }; INSTANTIATE_TEST_SUITE_P(All, @@ -110,7 +117,9 @@ IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, PasteAllowed_SameSource) { + base::RunLoop run_loop; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -165,11 +174,14 @@ helper.WaitForDialogToInitialize(); helper.CloseDialogWithoutBypass(); helper.WaitForDialogToClose(); + run_loop.Run(); } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, PasteBlockedByDataControls_DestinationRule) { + base::RunLoop run_loop; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -224,11 +236,14 @@ helper.WaitForDialogToInitialize(); helper.CloseDialogWithoutBypass(); helper.WaitForDialogToClose(); + run_loop.Run(); } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, PasteWarnedByDataControls_BypassedDestinationRule) { + base::RunLoop run_loop_warn; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop_warn.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -278,11 +293,14 @@ MakeClipboardPasteData("text", "image", {}), future.GetCallback()); helper.WaitForDialogToInitialize(); + run_loop_warn.Run(); // The first warn event should already be reported before the dialog has been // initialized, so it can be reassigned so that the bypass event can be // validated. + base::RunLoop run_loop_bypass; event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop_bypass.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -313,11 +331,14 @@ EXPECT_EQ(paste_data->text, u"text"); EXPECT_EQ(std::string(paste_data->png.begin(), paste_data->png.end()), "image"); + run_loop_bypass.Run(); } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, PasteWarnedByDataControls_CanceledDestinationRule) { + base::RunLoop run_loop; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -377,6 +398,7 @@ auto paste_data = future.Get(); EXPECT_FALSE(paste_data); + run_loop.Run(); } // ChromeOS requires extra boilerplate to run this test, and since copy-pasting @@ -564,7 +586,9 @@ IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, PasteReportedByDataControls_DestinationRule) { + base::RunLoop run_loop; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -619,6 +643,7 @@ EXPECT_EQ(paste_data->text, u"text"); EXPECT_EQ(std::string(paste_data->png.begin(), paste_data->png.end()), "image"); + run_loop.Run(); } // ChromeOS requires extra boilerplate to run this test, and since copy-pasting @@ -708,7 +733,9 @@ } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, CopyReported) { + base::RunLoop run_loop; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -761,10 +788,13 @@ auto replacement = future.Get<std::optional<std::u16string>>(); EXPECT_FALSE(replacement); + run_loop.Run(); } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, CopyBlocked) { + base::RunLoop run_loop; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -819,11 +849,14 @@ helper.WaitForDialogToClose(); EXPECT_FALSE(future.IsReady()); + run_loop.Run(); } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, CopyWarnedThenCanceled) { + base::RunLoop run_loop; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -887,11 +920,14 @@ auto replacement = future.Get<std::optional<std::u16string>>(); EXPECT_FALSE(replacement); + run_loop.Run(); } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, CopyWarnedThenCanceled_OsClipboardDestination) { + base::RunLoop run_loop; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -958,11 +994,14 @@ auto replacement = future.Get<std::optional<std::u16string>>(); EXPECT_FALSE(replacement); + run_loop.Run(); } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, CopyWarnedThenBypassed) { + base::RunLoop run_loop_warn; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop_warn.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -1014,6 +1053,8 @@ helper.WaitForDialogToInitialize(); + run_loop_warn.Run(); + // The dialog will stay up until a user action dismisses it, so `future` // shouldn't be ready yet. EXPECT_FALSE(future.IsReady()); @@ -1021,7 +1062,9 @@ // The first warn event should already be reported before the dialog has been // initialized, so it can be reassigned so that the bypass event can be // validated. + base::RunLoop run_loop_bypass; event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop_bypass.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -1048,11 +1091,14 @@ auto replacement = future.Get<std::optional<std::u16string>>(); EXPECT_FALSE(replacement); + run_loop_bypass.Run(); } IN_PROC_BROWSER_TEST_P(DataControlsClipboardUtilsBrowserTest, CopyWarnedThenBypassed_OsClipboardDestination) { + base::RunLoop run_loop_warn; auto event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop_warn.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -1110,11 +1156,14 @@ // The dialog will stay up until a user action dismisses it, so `future` // shouldn't be ready yet. EXPECT_FALSE(future.IsReady()); + run_loop_warn.Run(); // The first warn event should already be reported before the dialog has been // initialized, so it can be reassigned so that the bypass event can be // validated. + base::RunLoop run_loop_bypass; event_validator = event_report_validator_helper_->CreateValidator(); + event_validator.SetDoneClosure(run_loop_bypass.QuitClosure()); event_validator.ExpectDataControlsSensitiveDataEvent( /*expected_url=*/ kGoogleUrl, @@ -1141,6 +1190,7 @@ auto replacement = future.Get<std::optional<std::u16string>>(); EXPECT_FALSE(replacement); + run_loop_bypass.Run(); } } // namespace enterprise_data_protection
diff --git a/chrome/browser/extensions/api/terminal/terminal_private_api.cc b/chrome/browser/extensions/api/terminal/terminal_private_api.cc index f04bec9..66b2163 100644 --- a/chrome/browser/extensions/api/terminal/terminal_private_api.cc +++ b/chrome/browser/extensions/api/terminal/terminal_private_api.cc
@@ -7,6 +7,7 @@ #include <cstdlib> #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -14,6 +15,7 @@ #include "ash/webui/settings/public/constants/routes.mojom.h" #include "base/command_line.h" #include "base/containers/contains.h" +#include "base/containers/fixed_flat_set.h" #include "base/containers/flat_set.h" #include "base/containers/span.h" #include "base/functional/bind.h" @@ -790,15 +792,15 @@ PrefService* service = Profile::FromBrowserContext(browser_context())->GetPrefs(); - static const base::NoDestructor< - base::flat_map<std::string, base::Value::Type>> - kAllowList{{{guest_os::prefs::kGuestOsTerminalSettings, - base::Value::Type::DICT}}}; + static constexpr auto kAllowList = + base::MakeFixedFlatMap<std::string_view, base::Value::Type>( + {{guest_os::prefs::kGuestOsTerminalSettings, + base::Value::Type::DICT}}); for (const auto item : params->prefs.additional_properties) { // Write prefs if they are allowed, and match expected type, else ignore. - auto allow_it = kAllowList->find(item.first); - if (allow_it == kAllowList->end() || + auto allow_it = kAllowList.find(item.first); + if (allow_it == kAllowList.end() || allow_it->second != item.second.type()) { LOG(WARNING) << "Ignoring non-allowed SetPrefs path=" << item.first << ", type=" << item.second.type();
diff --git a/chrome/browser/extensions/keyed_services/chrome_browser_context_keyed_service_factories.cc b/chrome/browser/extensions/keyed_services/chrome_browser_context_keyed_service_factories.cc index 7e3da1e..1de80f9b 100644 --- a/chrome/browser/extensions/keyed_services/chrome_browser_context_keyed_service_factories.cc +++ b/chrome/browser/extensions/keyed_services/chrome_browser_context_keyed_service_factories.cc
@@ -29,9 +29,6 @@ #include "chrome/browser/extensions/activity_log/activity_log.h" #include "chrome/browser/extensions/chrome_app_icon_service_factory.h" #include "chrome/browser/extensions/chrome_extension_system_factory.h" -#if BUILDFLAG(IS_CHROMEOS) -#include "chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_allowlist_factory.h" -#endif // BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/extensions/extension_action_dispatcher.h" #include "chrome/browser/extensions/extension_error_controller_factory.h" #include "chrome/browser/extensions/extension_garbage_collector_factory.h" @@ -47,6 +44,7 @@ #endif // BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(IS_CHROMEOS) +#include "chrome/browser/chromeos/extensions/component_extension_content_settings/component_extension_content_settings_allowlist_factory.h" #include "chrome/browser/extensions/forced_extensions/assessment_assistant_tracker.h" #endif // BUILDFLAG(IS_CHROMEOS) @@ -79,9 +77,6 @@ extensions::AccountExtensionTracker::GetFactory(); extensions::ActivityLog::GetFactoryInstance(); extensions::ChromeAppIconServiceFactory::GetInstance(); -#if BUILDFLAG(IS_CHROMEOS) - extensions::ComponentExtensionContentSettingsAllowlistFactory::GetInstance(); -#endif // BUILDFLAG(IS_CHROMEOS) extensions::ExtensionActionDispatcher::GetFactoryInstance(); extensions::ExtensionErrorControllerFactory::GetInstance(); extensions::ExtensionGarbageCollectorFactory::GetInstance(); @@ -96,6 +91,7 @@ #endif // BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(IS_CHROMEOS) extensions::AssessmentAssistantTrackerFactory::GetInstance(); + extensions::ComponentExtensionContentSettingsAllowlistFactory::GetInstance(); #endif // BUILDFLAG(IS_CHROMEOS) }
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 7aac05c..3572124 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -7969,11 +7969,6 @@ "expiry_milestone": 145 }, { - "name": "reader-mode-dev-entry-point", - "owners": ["wylieb@google.com", "chrome-reader-mode-team@google.com"], - "expiry_milestone": 145 - }, - { "name": "reader-mode-distiller-enabled", "owners": ["fernandex@google.com", "qpubert@google.com", "bling-flags@google.com"], "expiry_milestone": 145 @@ -9835,6 +9830,11 @@ "expiry_milestone": 140 }, { + "name": "web-feed-deprecation", + "owners": [ "//chrome/android/feed/OWNERS", "jianli@chromium.org" ], + "expiry_milestone": 145 + }, + { "name": "web-feed-feedback-reroute", "owners": ["zekunjiang@chromium.org", "tinazwang@chromium.org", "chrome-with-friends@google.com"], "expiry_milestone": 122
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 498ea31..070b7c98 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -4809,6 +4809,9 @@ const char kFeedHeaderRemovalName[] = "Removing feed header"; const char kFeedHeaderRemovalDescription[] = "Stops showing the feed header."; +const char kWebFeedDeprecationName[] = "Web feed deprecation"; +const char kWebFeedDeprecationDescription[] = "Deprecate the web feed."; + const char kFloatingSnackbarName[] = "FloatingSnackbar"; const char kFloatingSnackbarDescription[] = "Enables the snackbar to float on top of the web content."; @@ -4978,9 +4981,6 @@ const char kReaderModeAutoDistillName[] = "Reader Mode auto distillation"; const char kReaderModeAutoDistillDescription[] = "Automatically distills web contents on every page."; -const char kReaderModeDevEntryPointName[] = "Reader Mode developer entry point"; -const char kReaderModeDevEntryPointDescription[] = - "Shows a button in the app overflow menu to force reader mode."; const char kReaderModeHeuristicsName[] = "Reader Mode triggering"; const char kReaderModeHeuristicsDescription[] = "Determines what pages the Reader Mode infobar is shown on.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index df78127..50c6a21 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -2821,6 +2821,9 @@ extern const char kFeedHeaderRemovalName[]; extern const char kFeedHeaderRemovalDescription[]; +extern const char kWebFeedDeprecationName[]; +extern const char kWebFeedDeprecationDescription[]; + extern const char kFloatingSnackbarName[]; extern const char kFloatingSnackbarDescription[]; @@ -2925,8 +2928,6 @@ extern const char kReadAloudTapToSeekDescription[]; extern const char kReaderModeAutoDistillName[]; extern const char kReaderModeAutoDistillDescription[]; -extern const char kReaderModeDevEntryPointName[]; -extern const char kReaderModeDevEntryPointDescription[]; extern const char kReaderModeHeuristicsName[]; extern const char kReaderModeHeuristicsDescription[]; extern const char kReaderModeHeuristicsMarkup[];
diff --git a/chrome/browser/glic/browser_ui/glic_border_view_interactive_uitest.cc b/chrome/browser/glic/browser_ui/glic_border_view_interactive_uitest.cc index 0ee33f0..a6b06263 100644 --- a/chrome/browser/glic/browser_ui/glic_border_view_interactive_uitest.cc +++ b/chrome/browser/glic/browser_ui/glic_border_view_interactive_uitest.cc
@@ -497,7 +497,13 @@ EXPECT_FALSE(border->IsShowing()); } -IN_PROC_BROWSER_TEST_F(GlicBorderViewUiTest, FocusedWindowChange) { +// TODO(crbug.com/411139307): Re-enable this test on Windows. +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +#define MAYBE_FocusedWindowChange FocusedWindowChange +#else +#define MAYBE_FocusedWindowChange DISABLED_FocusedWindowChange +#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) +IN_PROC_BROWSER_TEST_F(GlicBorderViewUiTest, MAYBE_FocusedWindowChange) { auto* border = browser()->window()->AsBrowserView()->glic_border(); ASSERT_TRUE(border); TesterImpl* tester = static_cast<TesterImpl*>(border->tester());
diff --git a/chrome/browser/glic/glic_keyed_service.cc b/chrome/browser/glic/glic_keyed_service.cc index a213ca7b..e00a496 100644 --- a/chrome/browser/glic/glic_keyed_service.cc +++ b/chrome/browser/glic/glic_keyed_service.cc
@@ -14,6 +14,7 @@ #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/task/sequenced_task_runner.h" +#include "base/time/time.h" #include "chrome/browser/contextual_cueing/contextual_cueing_service.h" #include "chrome/browser/contextual_cueing/contextual_cueing_service_factory.h" #include "chrome/browser/glic/fre/glic_fre_controller.h" @@ -31,6 +32,7 @@ #include "chrome/browser/glic/host/glic_actor_controller.h" #include "chrome/browser/glic/host/host.h" #include "chrome/browser/glic/host/webui_contents_container.h" +#include "chrome/browser/glic/widget/glic_widget.h" #include "chrome/browser/glic/widget/glic_window_controller.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_attributes_storage.h" @@ -55,6 +57,21 @@ namespace glic { +namespace { + +base::TimeDelta GetWarmingDelay() { + base::TimeDelta delay_start = + base::Milliseconds(features::kGlicWarmingDelayMs.Get()); + base::TimeDelta delay_limit = + delay_start + base::Milliseconds(features::kGlicWarmingJitterMs.Get()); + if (delay_limit > delay_start) { + return RandTimeDelta(delay_start, delay_limit); + } + return delay_start; +} + +} // namespace + GlicKeyedService::GlicKeyedService( Profile* profile, signin::IdentityManager* identity_manager, @@ -382,9 +399,24 @@ void GlicKeyedService::TryPreload() { CHECK(glic_profile_manager_); + base::TimeDelta delay = GetWarmingDelay(); - glic_profile_manager_->ShouldPreloadForProfile( - profile_, base::BindOnce(&GlicKeyedService::FinishPreload, GetWeakPtr())); + // TODO(b/411100559): Ideally we'd use post delayed task in all cases, + // but this requires a refactor of tests that are currently brittle. For now, + // just synchronously call ShouldPreloadForProfile if there is no delay. + if (delay.is_zero()) { + glic_profile_manager_->ShouldPreloadForProfile( + profile_, + base::BindOnce(&GlicKeyedService::FinishPreload, GetWeakPtr())); + } else { + base::SequencedTaskRunner::GetCurrentDefault()->PostDelayedTask( + FROM_HERE, + base::BindOnce( + &GlicProfileManager::ShouldPreloadForProfile, + glic_profile_manager_->GetWeakPtr(), profile_, + base::BindOnce(&GlicKeyedService::FinishPreload, GetWeakPtr())), + delay); + } } void GlicKeyedService::TryPreloadFre() {
diff --git a/chrome/browser/glic/glic_profile_manager.cc b/chrome/browser/glic/glic_profile_manager.cc index 8445bdd..8878639 100644 --- a/chrome/browser/glic/glic_profile_manager.cc +++ b/chrome/browser/glic/glic_profile_manager.cc
@@ -305,4 +305,8 @@ } } +base::WeakPtr<GlicProfileManager> GlicProfileManager::GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); +} + } // namespace glic
diff --git a/chrome/browser/glic/glic_profile_manager.h b/chrome/browser/glic/glic_profile_manager.h index f1d051a..7323500b 100644 --- a/chrome/browser/glic/glic_profile_manager.h +++ b/chrome/browser/glic/glic_profile_manager.h
@@ -87,6 +87,8 @@ static void ForceConnectionTypeForTesting( std::optional<network::mojom::ConnectionType> type); + base::WeakPtr<GlicProfileManager> GetWeakPtr(); + private: // Callback from ProfilePicker::Show(). void DidSelectProfile(Profile* profile);
diff --git a/chrome/browser/glic/glic_profile_manager_browsertest.cc b/chrome/browser/glic/glic_profile_manager_browsertest.cc index 40bc192..38c670a 100644 --- a/chrome/browser/glic/glic_profile_manager_browsertest.cc +++ b/chrome/browser/glic/glic_profile_manager_browsertest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/glic/glic_profile_manager.h" #include <memory> +#include <string> #include <type_traits> #include "base/memory/memory_pressure_monitor.h" @@ -199,11 +200,16 @@ : public InProcessBrowserTest, public testing::WithParamInterface<bool> { public: - GlicProfileManagerPreloadingTest() { + explicit GlicProfileManagerPreloadingTest(const std::string& delay_ms) { if (IsPreloadingEnabled()) { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kGlic, features::kTabstripComboButton, - features::kGlicRollout, features::kGlicWarming}, + scoped_feature_list_.InitWithFeaturesAndParameters( + /*enabled_features=*/{{features::kGlic, {}}, + {features::kTabstripComboButton, {}}, + {features::kGlicRollout, {}}, + {features::kGlicWarming, + {{features::kGlicWarmingDelayMs.name, + delay_ms}, + {features::kGlicWarmingJitterMs.name, "0"}}}}, /*disabled_features=*/{}); } else { scoped_feature_list_.InitWithFeatures( @@ -211,6 +217,7 @@ features::kGlicRollout}, /*disabled_features=*/{features::kGlicWarming}); } + // We initialize memory pressure to moderate to prevent any premature // preloading. GlicProfileManager::ForceMemoryPressureForTesting( @@ -220,6 +227,8 @@ network::mojom::ConnectionType::CONNECTION_WIFI); } + GlicProfileManagerPreloadingTest() : GlicProfileManagerPreloadingTest("0") {} + void SetUpOnMainThread() override { InProcessBrowserTest::SetUpOnMainThread(); GlicProfileManager::ForceProfileForLaunchForTesting(browser()->profile()); @@ -304,9 +313,57 @@ EXPECT_FALSE(WaitForShouldPreload()); } +// See *Deferred* below. Checks that we don't defer preloading when there's no +// delay. +IN_PROC_BROWSER_TEST_P(GlicProfileManagerPreloadingTest, + ShouldPreloadForProfile_DoNotDefer) { + ResetMemoryPressure(); + auto* service = + GlicKeyedServiceFactory::GetGlicKeyedService(browser()->profile()); + service->TryPreload(); + base::RunLoop run_loop; + // Since we have no delay, running until idle should mean that we do warm + // (provided warming is enabled). + run_loop.RunUntilIdle(); + const bool should_preload = IsPreloadingEnabled(); + EXPECT_EQ(should_preload, service->window_controller().IsWarmed()); +} + INSTANTIATE_TEST_SUITE_P(All, GlicProfileManagerPreloadingTest, ::testing::Bool()); +class GlicProfileManagerDeferredPreloadingTest + : public GlicProfileManagerPreloadingTest { + public: + // This sets the delay to 10 seconds (60 * 10 * 1000). + GlicProfileManagerDeferredPreloadingTest() + : GlicProfileManagerPreloadingTest(/*delay_ms=*/"600000") {} + ~GlicProfileManagerDeferredPreloadingTest() override = default; + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +// This is really a keyed service test, but it is convenient to locate it here +// for now. It just checks that if we have a preload delay, that we won't +// preload immediately. +IN_PROC_BROWSER_TEST_P(GlicProfileManagerDeferredPreloadingTest, + ShouldPreloadForProfile_Defer) { + ResetMemoryPressure(); + auto* service = + GlicKeyedServiceFactory::GetGlicKeyedService(browser()->profile()); + service->TryPreload(); + base::RunLoop run_loop; + // Since we shouldn't preload until after the delay, we shouldn't be warmed + // after running until idle. + run_loop.RunUntilIdle(); + EXPECT_FALSE(service->window_controller().IsWarmed()); +} + +INSTANTIATE_TEST_SUITE_P(All, + GlicProfileManagerDeferredPreloadingTest, + ::testing::Bool()); + } // namespace } // namespace glic
diff --git a/chrome/browser/glic/glic_profile_manager_interactive_uitest.cc b/chrome/browser/glic/glic_profile_manager_interactive_uitest.cc index 9aa64364..f7c60a6 100644 --- a/chrome/browser/glic/glic_profile_manager_interactive_uitest.cc +++ b/chrome/browser/glic/glic_profile_manager_interactive_uitest.cc
@@ -55,15 +55,21 @@ public: GlicProfileManagerUiTest() { if (ShouldWarmMultiple()) { - feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kGlicWarming, - features::kGlicFreWarming, - features::kGlicWarmMultiple}, + feature_list_.InitWithFeaturesAndParameters( + /*enabled_features=*/{{features::kGlicWarmMultiple, {}}, + {features::kGlicFreWarming, {}}, + {features::kGlicWarming, + {{features::kGlicWarmingDelayMs.name, "0"}, + {features::kGlicWarmingJitterMs.name, "0"}}}}, /*disabled_features=*/{}); } else { - feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kGlicWarming, - features::kGlicFreWarming}, + feature_list_.InitWithFeaturesAndParameters( + /*enabled_features=*/{{features::kGlicFreWarming, {}}, + {features::kGlicWarming, + { + {features::kGlicWarmingDelayMs.name, "0"}, + {features::kGlicWarmingJitterMs.name, "0"}, + }}}, /*disabled_features=*/{features::kGlicWarmMultiple}); } }
diff --git a/chrome/browser/glic/host/context/glic_focused_tab_manager.cc b/chrome/browser/glic/host/context/glic_focused_tab_manager.cc index 5ffc8a6..67feca00 100644 --- a/chrome/browser/glic/host/context/glic_focused_tab_manager.cc +++ b/chrome/browser/glic/host/context/glic_focused_tab_manager.cc
@@ -145,6 +145,11 @@ MaybeUpdateFocusedTab(); } +void GlicFocusedTabManager::OnWidgetVisibilityChanged(views::Widget* widget, + bool visible) { + MaybeUpdateFocusedTab(); +} + void GlicFocusedTabManager::OnWidgetDestroyed(views::Widget* widget) { widget_observation_.Reset(); } @@ -355,6 +360,10 @@ return false; } + if (!browser_interface->IsVisible()) { + return false; + } + return true; }
diff --git a/chrome/browser/glic/host/context/glic_focused_tab_manager.h b/chrome/browser/glic/host/context/glic_focused_tab_manager.h index 05065b6..d10a442 100644 --- a/chrome/browser/glic/host/context/glic_focused_tab_manager.h +++ b/chrome/browser/glic/host/context/glic_focused_tab_manager.h
@@ -197,6 +197,9 @@ // because of animation. void OnWidgetShowStateChanged(views::Widget* widget) override; + // Callback for browser window visibility changes (e.g. cmd+h on Mac). + void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override; + // Callback for browser window widget being destroyed. void OnWidgetDestroyed(views::Widget* widget) override;
diff --git a/chrome/browser/glic/host/glic_actor_controller_interactive_uitest.cc b/chrome/browser/glic/host/glic_actor_controller_interactive_uitest.cc index 557b94f..ae04682 100644 --- a/chrome/browser/glic/host/glic_actor_controller_interactive_uitest.cc +++ b/chrome/browser/glic/host/glic_actor_controller_interactive_uitest.cc
@@ -3,18 +3,24 @@ // found in the LICENSE file. #include <memory> +#include <optional> #include <string_view> #include "base/base64.h" +#include "base/functional/callback.h" +#include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/actor/actor_test_util.h" +#include "chrome/browser/glic/host/context/glic_page_context_fetcher.h" #include "chrome/browser/glic/host/glic.mojom-shared.h" #include "chrome/browser/glic/test_support/interactive_glic_test.h" #include "chrome/browser/glic/test_support/interactive_test_util.h" #include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/common/chrome_features.h" #include "chrome/test/interaction/interactive_browser_test.h" +#include "components/optimization_guide/core/optimization_guide_features.h" #include "components/optimization_guide/proto/features/actions_data.pb.h" +#include "components/optimization_guide/proto/features/common_quality_data.pb.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "ui/base/interaction/element_identifier.h" @@ -23,20 +29,28 @@ namespace { -using optimization_guide::proto::BrowserAction; -using optimization_guide::proto::ClickAction; - -// TODO(https://crbug.com/402086021): Get the actual target details for the -// button in the test page. -constexpr int32_t kContentNodeId = 123; +using ::optimization_guide::proto::AnnotatedPageContent; +using ::optimization_guide::proto::BrowserAction; +using ::optimization_guide::proto::ClickAction; +using ::optimization_guide::proto::ContentAttributes; +using ::optimization_guide::proto::ContentNode; DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(kActiveTabId); DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(kNewActorTabId); +std::string EncodeActionProto(const BrowserAction& action) { + return base::Base64Encode(action.SerializeAsString()); +} + class GlicActorControllerUiTest : public test::InteractiveGlicTest { public: + using ActionProtoProvider = base::OnceCallback<std::string()>; + GlicActorControllerUiTest() { - scoped_feature_list_.InitAndEnableFeature(features::kGlicActor); + scoped_feature_list_.InitWithFeatures( + {features::kGlicActor, optimization_guide::features:: + kAnnotatedPageContentWithActionableElements}, + {}); } ~GlicActorControllerUiTest() override = default; @@ -48,16 +62,25 @@ actor::OverrideActionObservationDelay(base::Milliseconds(10)); } - // Calls actInFocusedTab() and waits until the promise resolves and succeeds. - // TODO(https://crbug.com/402086021): Change script to just return the promise - // instead of waiting. This needs to be done when changing ActionSucceeds test - // to explicitly check that the action worked in the page. - auto ExecuteAction(std::string_view encodedActionProto, - base::Value::Dict contextOptions) { - return Steps(CheckJsResult( - kGlicContentsElementId, - content::JsReplace(R"js( - async () => { + // This (and the below ExpectingError) step takes a proto "provider" which is + // a callback that returns a string which is the base-64 representation of the + // BrowserAction proto to invoke. This is a callback rather than a string + // parameter since, in some cases, the parameters in the proto may depend on + // test steps (such as extracting the AnnotatedPageContent, so that the + // provider can then find the content node id from the APC). See the Provider + // methods below (e.g. ClickActionProvider). + InteractiveTestApi::MultiStep ExecuteAction( + ActionProtoProvider proto_provider, + base::Value::Dict context_options) { + return Steps(InAnyContext(WithElement( + kGlicContentsElementId, [&, proto_provider = std::move(proto_provider), + context_options = std::move(context_options)]( + ui::TrackedElement* el) mutable { + content::WebContents* glic_contents = + AsInstrumentedWebContents(el)->web_contents(); + std::string script = content::JsReplace( + R"js( + (() => { const base64ToArrayBuffer = (base64) => { const bytes = window.atob(base64); const len = bytes.length; @@ -67,28 +90,35 @@ } return ret.buffer; } - // As in TODO above, remove the async from the - // function and return the promise directly - // return client.browser.actInFocusedTab({ - await client.browser.actInFocusedTab({ + return client.browser.actInFocusedTab({ actionProto: base64ToArrayBuffer($1), tabContextOptions: $2 }); - return true; - } + })(); )js", - encodedActionProto, std::move(contextOptions)))); + std::move(proto_provider).Run(), std::move(context_options)); + ASSERT_TRUE(content::ExecJs(glic_contents, std::move(script))); + }))); + } + + // Helper to allow passing in a BrowserAction if it doesn't depend on prior + // test steps. + InteractiveTestApi::MultiStep ExecuteAction( + const BrowserAction& action, + base::Value::Dict context_options) { + return ExecuteAction(PassthroughProvider(action), + std::move(context_options)); } // Calls actInFocusedTab() and waits until the promise rejects with an error. // Note: This will fail the test if the promise succeeds. - auto ExecuteActionExpectingError( - std::string_view encodedActionProto, - base::Value::Dict contextOptions, + InteractiveTestApi::MultiStep ExecuteActionExpectingError( + ActionProtoProvider proto_provider, + base::Value::Dict context_options, glic::mojom::ActInFocusedTabErrorReason error_reason) { - return Steps(CheckJsResult( - kGlicContentsElementId, - content::JsReplace(R"js( + return Steps( + CheckJsResult(kGlicContentsElementId, + content::JsReplace(R"js( async () => { const base64ToArrayBuffer = (base64) => { const bytes = window.atob(base64); @@ -109,13 +139,41 @@ } } )js", - encodedActionProto, std::move(contextOptions)), - ::testing::Eq(static_cast<int>(error_reason)))); + std::move(proto_provider).Run(), + std::move(context_options)), + ::testing::Eq(static_cast<int>(error_reason)))); } - std::string EncodeActionProto(const BrowserAction& action) { - std::string serialized_message = action.SerializeAsString(); - return base::Base64Encode(serialized_message); + // Helper to allow passing in a BrowserAction if it doesn't depend on prior + // test steps. Calls actInFocusedTab() and waits until the promise rejects + // with an error. Note: This will fail the test if the promise succeeds. + InteractiveTestApi::MultiStep ExecuteActionExpectingError( + const BrowserAction& action, + base::Value::Dict context_options, + glic::mojom::ActInFocusedTabErrorReason error_reason) { + return ExecuteActionExpectingError( + PassthroughProvider(action), std::move(context_options), error_reason); + } + + // Returns a callback that builds an encoded proto for a click action on a + // ContentNode that matches the passed in predicate. + ActionProtoProvider ClickActionProvider(std::string_view label) { + return base::BindLambdaForTesting([this, label]() { + int32_t node_id = this->SearchAnnotatedPageContent(label); + return EncodeActionProto(actor::MakeClick(node_id)); + }); + } + + // Returns a callback that simply encodes the given action. + ActionProtoProvider PassthroughProvider(const BrowserAction& action) { + return base::BindLambdaForTesting( + [action]() { return EncodeActionProto(action); }); + } + + // Returns a callback that returns the given string as the action proto. Meant + // for testing error handling since this allows providing an invalid proto. + ActionProtoProvider ArbitraryStringProvider(std::string_view str) { + return base::BindLambdaForTesting([str]() { return std::string(str); }); } // Gets the context options to capture a new observation after completing an @@ -124,7 +182,13 @@ base::Value::Dict UpdatedContextOptions() { return base::Value::Dict() .Set("annotatedPageContent", true) +#if BUILDFLAG(IS_LINUX) + // TODO(https://crbug.com/40191775): Tests on Linux aren't producing + // graphical output so requesting a screenshot hangs forever. + .Set("viewportScreenshot", false); +#else .Set("viewportScreenshot", true); +#endif } // Gets the context options to capture a new observation that only has the @@ -142,20 +206,75 @@ auto StartTaskInNewTab(const GURL& task_url) { const GURL start_url = embedded_test_server()->GetURL("/actor/blank.html?start"); - std::string startNavigateProto = - EncodeActionProto(actor::MakeNavigate(task_url.spec())); + BrowserAction start_navigate = actor::MakeNavigate(task_url.spec()); - return Steps( - InstrumentTab(kActiveTabId), - NavigateWebContents(kActiveTabId, start_url), - OpenGlicWindow(GlicWindowMode::kAttached), - InstrumentNextTab(kNewActorTabId), - ExecuteAction(startNavigateProto, AnnotationsOnlyContextOptions()), - WaitForWebContentsReady(kNewActorTabId, task_url)); + return Steps(InstrumentTab(kActiveTabId), + NavigateWebContents(kActiveTabId, start_url), + OpenGlicWindow(GlicWindowMode::kAttached), + InstrumentNextTab(kNewActorTabId), + ExecuteAction(start_navigate, AnnotationsOnlyContextOptions()), + WaitForWebContentsReady(kNewActorTabId, task_url)); + } + + // Retrieves AnnotatedPageContent for the currently focused tab (and caches + // it in `annotated_page_content_`). + auto GetPageContextFromFocusedTab() { + return Steps(Do([&]() { + GlicKeyedService* glic_service = + GlicKeyedServiceFactory::GetGlicKeyedService(browser()->GetProfile()); + ASSERT_TRUE(glic_service); + + base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); + auto fetcher = std::make_unique<GlicPageContextFetcher>(); + + auto options = mojom::GetTabContextOptions::New(); + options->include_annotated_page_content = true; + + fetcher->Fetch( + glic_service->GetFocusedTabData(), *options, + base::BindLambdaForTesting([&](mojom::GetContextResultPtr result) { + mojo_base::ProtoWrapper& serialized_apc = + *result->get_tab_context() + ->annotated_page_data->annotated_page_content; + annotated_page_content_ = std::make_unique<AnnotatedPageContent>( + serialized_apc.As<AnnotatedPageContent>().value()); + run_loop.Quit(); + })); + + run_loop.Run(); + })); } private: + int32_t SearchAnnotatedPageContent(std::string_view label) { + CHECK(annotated_page_content_) + << "An observation must be made with GetPageContextFromFocusedTab " + "before searching annotated page content."; + + // Traverse the APC in depth-first preorder, returning the first node that + // matches the given label. + std::stack<const ContentNode*> nodes; + nodes.push(&annotated_page_content_->root_node()); + + while (!nodes.empty()) { + const ContentNode* current = nodes.top(); + nodes.pop(); + + if (current->content_attributes().label() == label) { + return current->content_attributes().common_ancestor_dom_node_id(); + } + + for (const auto& child : current->children_nodes()) { + nodes.push(&child); + } + } + + // Tests must pass a label that matches one of the content nodes. + NOTREACHED(); + } + base::test::ScopedFeatureList scoped_feature_list_; + std::unique_ptr<AnnotatedPageContent> annotated_page_content_; }; IN_PROC_BROWSER_TEST_F(GlicActorControllerUiTest, OpensNewTabOnFirstNavigate) { @@ -163,14 +282,13 @@ embedded_test_server()->GetURL("/actor/blank.html?start"); const GURL task_url = embedded_test_server()->GetURL("/actor/page_with_clickable_element.html"); - std::string navigateProto = - EncodeActionProto(actor::MakeNavigate(task_url.spec())); + BrowserAction navigate = actor::MakeNavigate(task_url.spec()); RunTestSequence(InstrumentTab(kActiveTabId), NavigateWebContents(kActiveTabId, start_url), OpenGlicWindow(GlicWindowMode::kAttached), InstrumentNextTab(kNewActorTabId), - ExecuteAction(navigateProto, UpdatedContextOptions()), + ExecuteAction(navigate, UpdatedContextOptions()), WaitForWebContentsReady(kNewActorTabId, task_url)); } @@ -180,29 +298,26 @@ embedded_test_server()->GetURL("/actor/page_with_clickable_element.html"); const GURL second_navigate_url = embedded_test_server()->GetURL("/actor/blank.html?second"); - std::string secondNavigateProto = - EncodeActionProto(actor::MakeNavigate(second_navigate_url.spec())); + BrowserAction second_navigate = + actor::MakeNavigate(second_navigate_url.spec()); RunTestSequence(StartTaskInNewTab(task_url), // Now that the task is started in a new tab, do the // second navigation. - ExecuteAction(secondNavigateProto, UpdatedContextOptions()), + ExecuteAction(second_navigate, UpdatedContextOptions()), WaitForWebContentsReady(kNewActorTabId, second_navigate_url)); } -// TODO(https://crbug.com/402086021): Enable test after using real nodeId in -// proto. -IN_PROC_BROWSER_TEST_F(GlicActorControllerUiTest, DISABLED_ActionSucceeds) { +IN_PROC_BROWSER_TEST_F(GlicActorControllerUiTest, ActionSucceeds) { + constexpr std::string_view kClickableButtonLabel = "clickable"; + const GURL task_url = embedded_test_server()->GetURL("/actor/page_with_clickable_element.html"); - std::string encodedProto = - EncodeActionProto(actor::MakeClick(kContentNodeId)); - RunTestSequence(StartTaskInNewTab(task_url), - ExecuteAction(encodedProto, UpdatedContextOptions())); - // TODO(https://crbug.com/402086021): Check result after implementing tool - // calling to do the action. - // WaitForJsResult(kActiveTabId, "() => button_clicked")); + RunTestSequence(StartTaskInNewTab(task_url), GetPageContextFromFocusedTab(), + ExecuteAction(ClickActionProvider(kClickableButtonLabel), + UpdatedContextOptions()), + WaitForJsResult(kNewActorTabId, "() => button_clicked")); } IN_PROC_BROWSER_TEST_F(GlicActorControllerUiTest, ActionProtoInvalid) { @@ -214,41 +329,37 @@ "/actor/page_with_clickable_element.html")), OpenGlicWindow(GlicWindowMode::kAttached), ExecuteActionExpectingError( - encodedProto, UpdatedContextOptions(), + ArbitraryStringProvider(encodedProto), UpdatedContextOptions(), glic::mojom::ActInFocusedTabErrorReason::kInvalidActionProto)); } IN_PROC_BROWSER_TEST_F(GlicActorControllerUiTest, ActionTargetNotFound) { + constexpr int32_t kNonExistentContentNodeId = + std::numeric_limits<int32_t>::max(); const GURL task_url = embedded_test_server()->GetURL("/actor/page_with_clickable_element.html"); - std::string encodedProto = - EncodeActionProto(actor::MakeClick(kContentNodeId)); + BrowserAction click = actor::MakeClick(kNonExistentContentNodeId); RunTestSequence( StartTaskInNewTab(task_url), ExecuteActionExpectingError( - encodedProto, UpdatedContextOptions(), + click, UpdatedContextOptions(), glic::mojom::ActInFocusedTabErrorReason::kTargetNotFound)); } IN_PROC_BROWSER_TEST_F(GlicActorControllerUiTest, HistoryTool) { const GURL url_1 = embedded_test_server()->GetURL("/actor/blank.html?1"); const GURL url_2 = embedded_test_server()->GetURL("/actor/blank.html?2"); - std::string navigateUrl2Proto = - EncodeActionProto(actor::MakeNavigate(url_2.spec())); - std::string backProto = EncodeActionProto(actor::MakeHistoryBack()); - std::string forwardProto = EncodeActionProto(actor::MakeHistoryForward()); + BrowserAction navigate_url_2 = actor::MakeNavigate(url_2.spec()); + BrowserAction back = actor::MakeHistoryBack(); + BrowserAction forward = actor::MakeHistoryForward(); - RunTestSequence( - StartTaskInNewTab(url_1), - ExecuteAction(navigateUrl2Proto, AnnotationsOnlyContextOptions()), - ExecuteAction(backProto, AnnotationsOnlyContextOptions()), - WaitForWebContentsReady(kNewActorTabId, url_1), - // TODO(crbug.com/402086021): Test hangs flakily in a CopyOutputRequest - // for the observation, unrelated to the HistoryTool code. Use - // UpdatedContextOptions() once that's resolved. - ExecuteAction(forwardProto, AnnotationsOnlyContextOptions()), - WaitForWebContentsReady(kNewActorTabId, url_2)); + RunTestSequence(StartTaskInNewTab(url_1), + ExecuteAction(navigate_url_2, UpdatedContextOptions()), + ExecuteAction(back, UpdatedContextOptions()), + WaitForWebContentsReady(kNewActorTabId, url_1), + ExecuteAction(forward, UpdatedContextOptions()), + WaitForWebContentsReady(kNewActorTabId, url_2)); } class GlicActorControllerWithActorDisabledUiTest
diff --git a/chrome/browser/glic/widget/glic_widget.cc b/chrome/browser/glic/widget/glic_widget.cc index f560ba3..9c6ce5b2 100644 --- a/chrome/browser/glic/widget/glic_widget.cc +++ b/chrome/browser/glic/widget/glic_widget.cc
@@ -14,6 +14,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/color/color_provider_key.h" #include "ui/display/screen.h" +#include "ui/gfx/geometry/insets.h" +#include "ui/gfx/geometry/outsets.h" #include "ui/views/widget/native_widget.h" #include "ui/views/widget/widget_delegate.h" @@ -22,7 +24,9 @@ #include "chrome/installer/util/shell_util.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" +#include "ui/base/win/hwnd_metrics.h" #include "ui/base/win/shell.h" +#include "ui/views/win/hwnd_util.h" #endif namespace glic { @@ -34,6 +38,25 @@ return base::FeatureList::IsEnabled(features::kGlicUserResize); } +// For resizeable windows, there may be an invisible border which affects the +// widget size. Given a target rect, this method provides the outsets which +// should be applied in order to calculate the correct widget bounds. +gfx::Outsets GetTargetOutsets(const gfx::Rect& bounds) { + gfx::Outsets outsets; +#if BUILDFLAG(IS_WIN) + RECT bounds_rect = bounds.ToRECT(); + int frame_thickness = ui::GetResizeFrameOnlyThickness( + MonitorFromRect(&bounds_rect, MONITOR_DEFAULTTONEAREST)); + // On Windows, the presence of a frame means that we need to adjust both the + // width and height of the widget by 2*frame thickness, and center the content + // horizontally. + outsets.set_left(frame_thickness); + outsets.set_right(frame_thickness); + outsets.set_bottom(2 * frame_thickness); +#endif + return outsets; +} + } // namespace class GlicWidgetDelegate : public views::WidgetDelegate { @@ -81,6 +104,10 @@ views::Widget::InitParams params( views::Widget::InitParams::CLIENT_OWNS_WIDGET, views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); + params.bounds = initial_bounds; + if (UserResizeEnabled() && user_resizable) { + params.bounds.Outset(GetTargetOutsets(initial_bounds)); + } #if BUILDFLAG(IS_WIN) // If floaty won't be always on top, it should appear in the taskbar and // alt tab list. @@ -89,7 +116,6 @@ } params.force_system_menu_for_frameless = true; #endif - params.bounds = initial_bounds; params.sublevel = ChromeWidgetSublevel::kSublevelGlic; // Don't change this name. This is used by other code to identify the glic // window. See b/404947780. @@ -151,6 +177,20 @@ return UserResizeEnabled() ? minimum_widget_size_ : gfx::Size(); } +gfx::Rect GlicWidget::VisibleToWidgetBounds(gfx::Rect visible_bounds) { + if (UserResizeEnabled() && widget_delegate()->CanResize()) { + visible_bounds.Outset(GetTargetOutsets(visible_bounds)); + } + return visible_bounds; +} + +gfx::Rect GlicWidget::WidgetToVisibleBounds(gfx::Rect widget_bounds) { + if (UserResizeEnabled() && widget_delegate()->CanResize()) { + widget_bounds.Inset(-GetTargetOutsets(widget_bounds).ToInsets()); + } + return widget_bounds; +} + ui::ColorProviderKey GlicWidget::GetColorProviderKey() const { ui::ColorProviderKey key = Widget::GetColorProviderKey();
diff --git a/chrome/browser/glic/widget/glic_widget.h b/chrome/browser/glic/widget/glic_widget.h index b4be0a3..a118be60 100644 --- a/chrome/browser/glic/widget/glic_widget.h +++ b/chrome/browser/glic/widget/glic_widget.h
@@ -47,6 +47,12 @@ // Gets the minimum size a user can resize to for the widget. gfx::Size GetMinimumSize() const override; + // Convert bounds rects between the visible on-screen bounds, and the actual + // widget bounds, which may require additional space for an invisible border + // on Windows, when the widget is resizable. + gfx::Rect VisibleToWidgetBounds(gfx::Rect visible_bounds); + gfx::Rect WidgetToVisibleBounds(gfx::Rect widget_bounds); + private: GlicWidget(ThemeService* theme_service, InitParams params);
diff --git a/chrome/browser/glic/widget/glic_window_animator.cc b/chrome/browser/glic/widget/glic_window_animator.cc index aecd2b4..f0eadd7 100644 --- a/chrome/browser/glic/widget/glic_window_animator.cc +++ b/chrome/browser/glic/widget/glic_window_animator.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/glic/widget/glic_window_animator.h" #include "chrome/browser/glic/widget/glic_view.h" +#include "chrome/browser/glic/widget/glic_widget.h" #include "chrome/browser/glic/widget/glic_window_controller.h" #include "chrome/browser/glic/widget/glic_window_resize_animation.h" #include "ui/compositor/layer.h" @@ -176,15 +177,20 @@ duration = base::Seconds(60); } + auto* glic_widget = window_controller_->GetGlicWidget(); + gfx::Rect widget_target_bounds = + glic_widget->VisibleToWidgetBounds(target_bounds); + if (window_resize_animation_) { // Update the ongoing animation with the new bounds and new duration. - window_resize_animation_->UpdateTargetBounds(target_bounds, + window_resize_animation_->UpdateTargetBounds(widget_target_bounds, std::move(callback)); window_resize_animation_->SetDuration( std::max(window_resize_animation_->duration_left(), duration)); } else { window_resize_animation_ = std::make_unique<GlicWindowResizeAnimation>( - window_controller_, this, target_bounds, duration, std::move(callback)); + window_controller_, this, widget_target_bounds, duration, + std::move(callback)); } } @@ -207,11 +213,14 @@ } gfx::Rect GlicWindowAnimator::GetCurrentTargetBounds() { + auto* glic_widget = window_controller_->GetGlicWidget(); if (window_resize_animation_) { // Get the ongoing animation's target bounds if they exist. - return window_resize_animation_->target_bounds(); + return glic_widget->WidgetToVisibleBounds( + window_resize_animation_->target_bounds()); } else { - return window_controller_->GetGlicWidget()->GetWindowBoundsInScreen(); + return glic_widget->WidgetToVisibleBounds( + glic_widget->GetWindowBoundsInScreen()); } }
diff --git a/chrome/browser/glic/widget/glic_window_controller.cc b/chrome/browser/glic/widget/glic_window_controller.cc index c5291a13..8d42e227 100644 --- a/chrome/browser/glic/widget/glic_window_controller.cc +++ b/chrome/browser/glic/widget/glic_window_controller.cc
@@ -971,7 +971,7 @@ return static_cast<GlicView*>(GetGlicWidget()->GetContentsView()); } -views::Widget* GlicWindowController::GetGlicWidget() { +GlicWidget* GlicWindowController::GetGlicWidget() { return glic_widget_.get(); }
diff --git a/chrome/browser/glic/widget/glic_window_controller.h b/chrome/browser/glic/widget/glic_window_controller.h index a5f6160b..0f8835b 100644 --- a/chrome/browser/glic/widget/glic_window_controller.h +++ b/chrome/browser/glic/widget/glic_window_controller.h
@@ -230,7 +230,7 @@ void ResizeFinished(); // Returns the widget that backs the glic window. - views::Widget* GetGlicWidget(); + GlicWidget* GetGlicWidget(); // Returns the WebContents used for the first-run experience, or nullptr if // none.
diff --git a/chrome/browser/glic/widget/glic_window_controller_interactive_uitest.cc b/chrome/browser/glic/widget/glic_window_controller_interactive_uitest.cc index c3e1188..a1bebb9 100644 --- a/chrome/browser/glic/widget/glic_window_controller_interactive_uitest.cc +++ b/chrome/browser/glic/widget/glic_window_controller_interactive_uitest.cc
@@ -576,9 +576,11 @@ : public GlicWindowControllerUiTest { public: GlicWindowControllerWithMemoryPressureUiTest() { - features_.InitWithFeatures( + features_.InitWithFeaturesAndParameters( /*enabled_features=*/ - {features::kGlicWarming}, + {{features::kGlicWarming, + {{features::kGlicWarmingDelayMs.name, "0"}, + {features::kGlicWarmingJitterMs.name, "0"}}}}, /*disabled_features=*/{}); } ~GlicWindowControllerWithMemoryPressureUiTest() override = default;
diff --git a/chrome/browser/glic/widget/glic_window_resize_animation.cc b/chrome/browser/glic/widget/glic_window_resize_animation.cc index 0fd98c56..fee8f7b 100644 --- a/chrome/browser/glic/widget/glic_window_resize_animation.cc +++ b/chrome/browser/glic/widget/glic_window_resize_animation.cc
@@ -5,12 +5,21 @@ #include "chrome/browser/glic/widget/glic_window_resize_animation.h" #include "base/task/sequenced_task_runner.h" +#include "build/buildflag.h" #include "chrome/browser/glic/widget/glic_view.h" +#include "chrome/browser/glic/widget/glic_widget.h" #include "chrome/browser/glic/widget/glic_window_animator.h" #include "chrome/browser/glic/widget/glic_window_controller.h" #include "ui/gfx/animation/tween.h" #include "ui/views/background.h" #include "ui/views/widget/widget.h" +#include "ui/views/widget/widget_delegate.h" + +#if BUILDFLAG(IS_WIN) +#include "chrome/common/chrome_features.h" +#include "ui/base/win/hwnd_metrics.h" +#include "ui/views/win/hwnd_util.h" +#endif #if BUILDFLAG(IS_MAC) #include "ui/accelerated_widget_mac/ca_transaction_observer.h" @@ -68,7 +77,7 @@ gfx::Rect bounds_to_animate = gfx::Tween::RectValueBetween( gfx::Tween::CalculateValue(gfx::Tween::FAST_OUT_SLOW_IN_3, state), initial_bounds_, new_bounds_); - views::Widget* glic_widget = window_controller_->GetGlicWidget(); + GlicWidget* glic_widget = window_controller_->GetGlicWidget(); if (window_controller_->IsAttached()) { // If the widget is attached, resize normally.
diff --git a/chrome/browser/glic/widget/glic_window_resize_animation.h b/chrome/browser/glic/widget/glic_window_resize_animation.h index 60dd81da..b1ea16e 100644 --- a/chrome/browser/glic/widget/glic_window_resize_animation.h +++ b/chrome/browser/glic/widget/glic_window_resize_animation.h
@@ -24,6 +24,8 @@ // * Callbacks are posted when this object is destroyed and must remain valid // until they run. This class will generally override any other changes to // window size. +// This class deals exclusively with the widget bounds, which may be different +// than the content bounds on Windows. class GlicWindowResizeAnimation : public gfx::LinearAnimation, public gfx::AnimationDelegate { public:
diff --git a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc index 1149a018..e5799672 100644 --- a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc +++ b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.cc
@@ -398,8 +398,11 @@ web_contents->GetBrowserContext())) { paydm_observation_.Observe(&pdm->payments_data_manager()); } - valuables_data_manager_ = ValuablesDataManagerFactory::GetForProfile( - Profile::FromBrowserContext(web_contents->GetBrowserContext())); + if (ValuablesDataManager* valuables_data_manager = + ValuablesDataManagerFactory::GetForProfile( + Profile::FromBrowserContext(web_contents->GetBrowserContext()))) { + valuables_data_manager_observation_.Observe(valuables_data_manager); + } } PaymentMethodAccessoryControllerImpl::PaymentMethodAccessoryControllerImpl( @@ -413,11 +416,13 @@ *web_contents), mf_controller_(mf_controller), af_manager_for_testing_(af_manager), - af_driver_for_testing_(af_driver), - valuables_data_manager_(valuables_data_manager) { + af_driver_for_testing_(af_driver) { if (payments_data_manager) { paydm_observation_.Observe(payments_data_manager); } + if (valuables_data_manager) { + valuables_data_manager_observation_.Observe(valuables_data_manager); + } } std::vector<PaymentMethodAccessoryControllerImpl::CardOrVirtualCard> @@ -486,11 +491,11 @@ base::span<const LoyaltyCard> PaymentMethodAccessoryControllerImpl::GetLoyaltyCards() const { - if (!valuables_data_manager_) { + if (!valuables_data_manager()) { return {}; } - return valuables_data_manager_->GetLoyaltyCards(); + return valuables_data_manager()->GetLoyaltyCards(); } base::WeakPtr<ManualFillingController> @@ -584,6 +589,10 @@ return true; } +void PaymentMethodAccessoryControllerImpl::OnValuablesDataChanged() { + RefreshSuggestions(); +} + WEB_CONTENTS_USER_DATA_KEY_IMPL(PaymentMethodAccessoryControllerImpl); } // namespace autofill
diff --git a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.h b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.h index 38e646e..f587665e 100644 --- a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.h +++ b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl.h
@@ -31,6 +31,7 @@ class PaymentMethodAccessoryControllerImpl : public PaymentMethodAccessoryController, public PaymentsDataManager::Observer, + public ValuablesDataManager::Observer, public content::WebContentsUserData< PaymentMethodAccessoryControllerImpl> { public: @@ -121,10 +122,17 @@ // method also tries to fetch IBAN and fill the form field. bool FetchIfIban(const std::string& selection_id); + // ValuablesDataManager::Observer: + void OnValuablesDataChanged() override; + const PaymentsDataManager* paydm() const { return paydm_observation_.GetSource(); } + const ValuablesDataManager* valuables_data_manager() const { + return valuables_data_manager_observation_.GetSource(); + } + base::WeakPtr<ManualFillingController> mf_controller_; raw_ptr<BrowserAutofillManager> af_manager_for_testing_ = nullptr; raw_ptr<AutofillDriver> af_driver_for_testing_ = nullptr; @@ -139,9 +147,10 @@ // Observes the `PaymentsDataManager` of the profile to react to updates. base::ScopedObservation<PaymentsDataManager, PaymentsDataManager::Observer> paydm_observation_{this}; - // Used to retrieve user's Google Wallet loyalty cards. It's owned by the - // profile and guaranteed to outlive this instance. - raw_ptr<ValuablesDataManager> valuables_data_manager_; + + // Observes the `ValuablesDataManager` of the profile to react to updates. + base::ScopedObservation<ValuablesDataManager, ValuablesDataManager::Observer> + valuables_data_manager_observation_{this}; WEB_CONTENTS_USER_DATA_KEY_DECL();
diff --git a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl_unittest.cc b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl_unittest.cc index b0b3b8e7..75606ebf 100644 --- a/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl_unittest.cc +++ b/chrome/browser/keyboard_accessory/android/payment_method_accessory_controller_impl_unittest.cc
@@ -7,6 +7,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/test/mock_callback.h" #include "chrome/browser/keyboard_accessory/android/accessory_controller.h" +#include "chrome/browser/keyboard_accessory/android/accessory_sheet_data.h" #include "chrome/browser/keyboard_accessory/test_utils/android/mock_manual_filling_controller.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h" @@ -44,6 +45,7 @@ #include "ui/base/l10n/l10n_util.h" using testing::_; +using testing::InSequence; using testing::SaveArg; using IsFillingSourceAvailable = AccessoryController::IsFillingSourceAvailable; @@ -712,4 +714,71 @@ .Build()); } +TEST_F(PaymentMethodAccessoryControllerTest, LoyaltyCardDataIsChangedBySync) { + { + InSequence seq; + // First, there're no loyalty cards, so the filling source is not available. + EXPECT_CALL(filling_source_observer_, + Run(controller(), IsFillingSourceAvailable(false))); + // The filling source should become available after a loyalty card is added. + EXPECT_CALL(filling_source_observer_, + Run(controller(), IsFillingSourceAvailable(true))); + } + + ASSERT_TRUE(controller()); + controller()->RefreshSuggestions(); + EXPECT_EQ( + controller()->GetSheetData(), + AccessorySheetData::Builder( + AccessoryTabType::CREDIT_CARDS, + /*user_info_title=*/ + l10n_util::GetStringUTF16( + IDS_MANUAL_FILLING_CREDIT_CARD_SHEET_EMPTY_MESSAGE), + /*plus_address_title=*/std::u16string()) + .AppendFooterCommand( + l10n_util::GetStringUTF16( + IDS_MANUAL_FILLING_CREDIT_CARD_SHEET_ALL_ADDRESSES_LINK), + AccessoryAction::MANAGE_CREDIT_CARDS) + .Build()); + + LoyaltyCard loyalty_card = test::CreateLoyaltyCard(); + test_api(valuables_data_manager()).AddLoyaltyCard(loyalty_card); + test_api(valuables_data_manager()).NotifyObservers(); + + EXPECT_EQ( + controller()->GetSheetData(), + AccessorySheetData::Builder( + AccessoryTabType::CREDIT_CARDS, + /*user_info_title=*/ + l10n_util::GetStringUTF16( + IDS_MANUAL_FILLING_CREDIT_CARD_SHEET_EMPTY_MESSAGE), + /*plus_address_title=*/std::u16string()) + .AddLoyaltyCardInfo( + loyalty_card.merchant_name(), + base::UTF8ToUTF16(loyalty_card.loyalty_card_number())) + .AppendFooterCommand( + l10n_util::GetStringUTF16( + IDS_MANUAL_FILLING_CREDIT_CARD_SHEET_ALL_ADDRESSES_LINK), + AccessoryAction::MANAGE_CREDIT_CARDS) + .Build()); +} + +TEST_F(PaymentMethodAccessoryControllerTest, FillLoyaltyCardNumber) { + content::RenderFrameHost* rfh = web_contents()->GetFocusedFrame(); + ASSERT_TRUE(rfh); + FieldGlobalId field_id{.frame_token = LocalFrameToken(*rfh->GetFrameToken()), + .renderer_id = FieldRendererId(123)}; + + LoyaltyCard loyalty_card = test::CreateLoyaltyCard(); + LoyaltyCardInfo loyalty_card_info( + loyalty_card.merchant_name(), + base::UTF8ToUTF16(loyalty_card.loyalty_card_number())); + EXPECT_CALL(autofill_driver(), + ApplyFieldAction(mojom::FieldActionType::kReplaceAll, + mojom::ActionPersistence::kFill, field_id, + loyalty_card_info.value().text_to_fill())); + + controller()->OnFillingTriggered(field_id, loyalty_card_info.value()); +} + } // namespace autofill
diff --git a/chrome/browser/net/device_bound_sessions_browsertest.cc b/chrome/browser/net/device_bound_sessions_browsertest.cc index 68b9960c..fda677b9 100644 --- a/chrome/browser/net/device_bound_sessions_browsertest.cc +++ b/chrome/browser/net/device_bound_sessions_browsertest.cc
@@ -209,4 +209,75 @@ 1); } +IN_PROC_BROWSER_TEST_F(DeviceBoundSessionBrowserTest, + UseCounterForMultipleRequestsOnePage) { + WebFeatureHistogramTester histograms; + + content::WebContents* web_contents = + chrome_test_utils::GetActiveWebContents(this); + { + base::test::TestFuture<SessionAccess> future; + DeviceBoundSessionAccessObserver observer( + web_contents, future.GetRepeatingCallback<const SessionAccess&>()); + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), embedded_test_server()->GetURL( + "/resource_triggered_dbsc_registration"))); + ASSERT_TRUE(future.Wait()); + } + + // Make several requests with JS + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + + // Navigate away in order to flush use counters. + ASSERT_TRUE( + ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL))); + + // Expect only one use counter + EXPECT_EQ(histograms.GetCount( + blink::mojom::WebFeature::kDeviceBoundSessionRequestInScope), + 1); +} + +IN_PROC_BROWSER_TEST_F(DeviceBoundSessionBrowserTest, + UseCounterForMultipleRequestsTwoPages) { + WebFeatureHistogramTester histograms; + + content::WebContents* web_contents = + chrome_test_utils::GetActiveWebContents(this); + { + base::test::TestFuture<SessionAccess> future; + DeviceBoundSessionAccessObserver observer( + web_contents, future.GetRepeatingCallback<const SessionAccess&>()); + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), embedded_test_server()->GetURL( + "/resource_triggered_dbsc_registration"))); + ASSERT_TRUE(future.Wait()); + } + + // Make several requests with JS + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + + // Navigate again + ASSERT_TRUE(ui_test_utils::NavigateToURL( + browser(), embedded_test_server()->GetURL("/ensure_authenticated"))); + + // Make several more in-scope requests + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + ASSERT_TRUE(content::ExecJs(web_contents, "fetch('/ensure_authenticated')")); + + // Navigate away in order to flush use counters. + ASSERT_TRUE( + ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL))); + + // Expect two use counters, one for each page load + EXPECT_EQ(histograms.GetCount( + blink::mojom::WebFeature::kDeviceBoundSessionRequestInScope), + 2); +} + } // namespace
diff --git a/chrome/browser/new_tab_page/feature_promo_helper/new_tab_page_feature_promo_helper.h b/chrome/browser/new_tab_page/feature_promo_helper/new_tab_page_feature_promo_helper.h index 0945079..25590fc6 100644 --- a/chrome/browser/new_tab_page/feature_promo_helper/new_tab_page_feature_promo_helper.h +++ b/chrome/browser/new_tab_page/feature_promo_helper/new_tab_page_feature_promo_helper.h
@@ -6,7 +6,6 @@ #define CHROME_BROWSER_NEW_TAB_PAGE_FEATURE_PROMO_HELPER_NEW_TAB_PAGE_FEATURE_PROMO_HELPER_H_ #include "base/feature_list.h" -#include "chrome/browser/ui/browser.h" #include "content/public/browser/web_contents_observer.h" class NewTabPageFeaturePromoHelper {
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index 23685737..16ae6b54 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -53,6 +53,7 @@ #include "chrome/browser/ui/webauthn/authenticator_request_window.h" #include "chrome/common/channel_info.h" #include "chrome/common/webui_url_constants.h" +#include "chrome/grit/generated_resources.h" #include "components/autofill/content/browser/content_autofill_client.h" #include "components/autofill/content/browser/renderer_forms_from_browser_form.h" #include "components/autofill/content/browser/scoped_autofill_managers_observation.h" @@ -122,6 +123,7 @@ #include "services/metrics/public/cpp/metrics_utils.h" #include "services/metrics/public/cpp/ukm_recorder.h" #include "services/network/public/cpp/is_potentially_trustworthy.h" +#include "ui/base/l10n/l10n_util.h" #if BUILDFLAG(SAFE_BROWSING_AVAILABLE) #include "chrome/browser/safe_browsing/advanced_protection_status_manager.h" @@ -2101,8 +2103,17 @@ if (auto* const user_ed = BrowserUserEducationInterface::MaybeGetForWebContentsInTab( web_contents())) { - user_ed->MaybeShowFeaturePromo( - feature_engagement::kIPHPasswordsSavePrimingPromoFeature); + if (signin::IdentityManager* const identity_manager = + IdentityManagerFactory::GetForProfile(profile_)) { + const bool signed_in = + identity_manager->HasPrimaryAccount(signin::ConsentLevel::kSignin); + user_education::FeaturePromoParams params( + feature_engagement::kIPHPasswordsSavePrimingPromoFeature); + params.body_params = l10n_util::GetStringUTF16( + signed_in ? IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_SIGNED_IN + : IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_NOT_SIGNED_IN); + user_ed->MaybeShowFeaturePromo(std::move(params)); + } } }
diff --git a/chrome/browser/privacy_sandbox/notice/BUILD.gn b/chrome/browser/privacy_sandbox/notice/BUILD.gn index 3d2178d..90e33ec1 100644 --- a/chrome/browser/privacy_sandbox/notice/BUILD.gn +++ b/chrome/browser/privacy_sandbox/notice/BUILD.gn
@@ -76,6 +76,7 @@ "//base", "//chrome/browser/profiles:profile", "//chrome/browser/ui/browser_window:browser_window", + "//components/tabs:public", "//content/public/browser", ] } @@ -115,6 +116,8 @@ # (Desktop Only) if (!is_android) { sources += [ + "mocks/mock_desktop_view_manager.cc", + "mocks/mock_desktop_view_manager.h", "mocks/mock_desktop_view_manager_observer.cc", "mocks/mock_desktop_view_manager_observer.h", ] @@ -149,10 +152,7 @@ # (Desktop Only) if (!is_android) { - sources += [ - "desktop_entrypoint_handlers_unittest.cc", - "desktop_view_manager_unittest.cc", - ] + sources += [ "desktop_view_manager_unittest.cc" ] deps += [ ":desktop_view_manager" ] } } @@ -165,6 +165,7 @@ ":core", ":interfaces", ":notice", + ":test_support", "//chrome/browser", "//chrome/browser/profiles:profile", "//chrome/test:test_support", @@ -178,6 +179,10 @@ } if (!is_android) { - deps += [ "//chrome/test:test_support_ui" ] + sources += [ "desktop_entrypoint_handlers_browsertest.cc" ] + deps += [ + ":desktop_view_manager", + "//chrome/test:test_support_ui", + ] } }
diff --git a/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.cc b/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.cc index bbf1a45..5bca7bb 100644 --- a/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.cc +++ b/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.cc
@@ -6,6 +6,8 @@ #include "chrome/browser/privacy_sandbox/notice/desktop_view_manager.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" +#include "components/tabs/public/tab_interface.h" #include "content/public/browser/navigation_handle.h" namespace privacy_sandbox { @@ -13,27 +15,38 @@ // EntryPointHandler //----------------------------------------------------------------------------- EntryPointHandler::EntryPointHandler( - base::RepeatingCallback<void()> entry_point_callback) + base::RepeatingCallback<void(BrowserWindowInterface*)> entry_point_callback) : entry_point_callback_(std::move(entry_point_callback)) {} EntryPointHandler::~EntryPointHandler() = default; -void EntryPointHandler::HandleEntryPoint() { - entry_point_callback_.Run(); +void EntryPointHandler::HandleEntryPoint( + BrowserWindowInterface* browser_interface) { + entry_point_callback_.Run(browser_interface); } //----------------------------------------------------------------------------- // NavigationHandler //----------------------------------------------------------------------------- NavigationHandler::NavigationHandler( - base::RepeatingCallback<void()> entry_point_callback) + base::RepeatingCallback<void(BrowserWindowInterface*)> entry_point_callback) : EntryPointHandler(std::move(entry_point_callback)) {} void NavigationHandler::HandleNewNavigation( content::NavigationHandle* navigation_handle, Profile* profile) { + auto* tab_interface = + tabs::TabInterface::GetFromContents(navigation_handle->GetWebContents()); + if (!tab_interface) { + return; + } + + auto* browser_window_interface = tab_interface->GetBrowserWindowInterface(); + if (!browser_window_interface) { + return; + } // TODO(crbug.com/408016824): Implement to perform checks needed before // showing notice. - HandleEntryPoint(); + HandleEntryPoint(browser_window_interface); } } // namespace privacy_sandbox
diff --git a/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.h b/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.h index fedcca7..06605e89 100644 --- a/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.h +++ b/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.h
@@ -7,6 +7,7 @@ #include "content/public/browser/navigation_handle.h" class Profile; +class BrowserWindowInterface; namespace privacy_sandbox { @@ -14,17 +15,18 @@ class EntryPointHandler { public: explicit EntryPointHandler( - base::RepeatingCallback<void()> entry_point_callback); + base::RepeatingCallback<void(BrowserWindowInterface*)> + entry_point_callback); virtual ~EntryPointHandler(); // Alerts callback location that entrypoint checks have passed and that a view // may show. - void HandleEntryPoint(); + void HandleEntryPoint(BrowserWindowInterface* browser_interface); protected: // Called when we want to inform the callback location a valid entrypoint has // been encountered. - base::RepeatingCallback<void()> entry_point_callback_; + base::RepeatingCallback<void(BrowserWindowInterface*)> entry_point_callback_; }; // This class handles view manager entrypoints triggered by new navigation @@ -32,7 +34,8 @@ class NavigationHandler : public EntryPointHandler { public: explicit NavigationHandler( - base::RepeatingCallback<void()> entry_point_callback); + base::RepeatingCallback<void(BrowserWindowInterface*)> + entry_point_callback); // Performs checks required to determine whether a view can be shown on a // navigation.
diff --git a/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers_browsertest.cc b/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers_browsertest.cc new file mode 100644 index 0000000..876da34 --- /dev/null +++ b/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers_browsertest.cc
@@ -0,0 +1,63 @@ +// Copyright 2025 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/test/mock_callback.h" +#include "chrome/browser/privacy_sandbox/notice/mocks/mock_desktop_view_manager.h" +#include "chrome/browser/privacy_sandbox/notice/mocks/mock_notice_service.h" +#include "chrome/browser/privacy_sandbox/notice/notice_service_factory.h" +#include "chrome/browser/privacy_sandbox/notice/notice_service_interface.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/test/base/platform_browser_test.h" +#include "chrome/test/base/testing_profile.h" +#include "chrome/test/base/ui_test_utils.h" +#include "content/public/test/browser_test.h" + +namespace privacy_sandbox { +namespace { + +using ::testing::Mock; +using ::testing::NiceMock; + +class PrivacySandboxNoticeEntryPointHandlersTest : public InProcessBrowserTest { + public: + void SetUpOnMainThread() override { + mock_notice_service_ = static_cast<MockPrivacySandboxNoticeService*>( + PrivacySandboxNoticeServiceFactory::GetInstance() + ->SetTestingFactoryAndUse( + browser()->profile(), + base::BindRepeating([](content::BrowserContext*) + -> std::unique_ptr<KeyedService> { + return std::make_unique< + NiceMock<MockPrivacySandboxNoticeService>>(); + }))); + + mock_view_manager_ = std::make_unique<MockDesktopViewManager>(); + + ON_CALL(*mock_notice_service_, GetDesktopViewManager()) + .WillByDefault(testing::Return(mock_view_manager_.get())); + } + + void TearDownOnMainThread() override { + mock_notice_service_ = nullptr; + mock_view_manager_.reset(); + } + + protected: + raw_ptr<MockPrivacySandboxNoticeService> mock_notice_service_; + std::unique_ptr<MockDesktopViewManager> mock_view_manager_; +}; + +// Test that navigation alerts view manager. +IN_PROC_BROWSER_TEST_F(PrivacySandboxNoticeEntryPointHandlersTest, + TestNavigationCallsEntryPointCallback) { + EXPECT_CALL(*mock_view_manager_.get(), HandleChromeOwnedPageNavigation) + .Times(1); + // Navigate + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), + GURL(chrome::kChromeUINewTabURL))); + Mock::VerifyAndClearExpectations(mock_view_manager_.get()); +} + +} // namespace +} // namespace privacy_sandbox
diff --git a/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers_unittest.cc b/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers_unittest.cc deleted file mode 100644 index 3fcc1b0..0000000 --- a/chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers_unittest.cc +++ /dev/null
@@ -1,33 +0,0 @@ -// Copyright 2025 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.h" - -#include "base/test/mock_callback.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace privacy_sandbox { -namespace { - -using testing::Mock; - -class PrivacySandboxNoticeEntryPointHandlersTest : public testing::Test { - protected: - base::MockCallback<base::RepeatingCallback<void()>> - mock_entry_point_callback_; - std::unique_ptr<NavigationHandler> handler_ = - std::make_unique<NavigationHandler>(mock_entry_point_callback_.Get()); -}; - -// Test that navigation alerts view manager. -TEST_F(PrivacySandboxNoticeEntryPointHandlersTest, - TestNavigationCallsEntryPointCallback) { - EXPECT_CALL(mock_entry_point_callback_, Run()).Times(1); - handler_->HandleNewNavigation(nullptr, nullptr); - Mock::VerifyAndClearExpectations(&mock_entry_point_callback_); -} - -} // namespace -} // namespace privacy_sandbox
diff --git a/chrome/browser/privacy_sandbox/notice/desktop_view_manager.cc b/chrome/browser/privacy_sandbox/notice/desktop_view_manager.cc index a079d73..1cb7e52 100644 --- a/chrome/browser/privacy_sandbox/notice/desktop_view_manager.cc +++ b/chrome/browser/privacy_sandbox/notice/desktop_view_manager.cc
@@ -8,6 +8,7 @@ #include "chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.h" #include "chrome/browser/privacy_sandbox/notice/notice_model.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" namespace privacy_sandbox { @@ -15,6 +16,8 @@ using notice::mojom::PrivacySandboxNoticeEvent; using enum notice::mojom::PrivacySandboxNoticeEvent; +DesktopViewManagerInterface::~DesktopViewManagerInterface() = default; + DesktopViewManager::DesktopViewManager( PrivacySandboxNoticeServiceInterface* notice_service) : notice_service_(notice_service) { @@ -107,7 +110,8 @@ return navigation_handler_.get(); } -void DesktopViewManager::HandleChromeOwnedPageNavigation() { +void DesktopViewManager::HandleChromeOwnedPageNavigation( + BrowserWindowInterface* browser_interface) { // TODO(crbug.com/408016824): Call MaybeShowView. }
diff --git a/chrome/browser/privacy_sandbox/notice/desktop_view_manager.h b/chrome/browser/privacy_sandbox/notice/desktop_view_manager.h index 1c865a7..f005fc9 100644 --- a/chrome/browser/privacy_sandbox/notice/desktop_view_manager.h +++ b/chrome/browser/privacy_sandbox/notice/desktop_view_manager.h
@@ -12,7 +12,8 @@ #include "chrome/browser/privacy_sandbox/notice/desktop_entrypoint_handlers.h" #include "chrome/browser/privacy_sandbox/notice/notice.mojom-forward.h" #include "chrome/browser/privacy_sandbox/notice/notice_service_interface.h" -#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" + +class BrowserWindowInterface; namespace privacy_sandbox { @@ -23,7 +24,19 @@ // the desktop side. // 2. Advance multi-step notices // 3. Manage sticky behavior of notices across tabs -class DesktopViewManager { +class DesktopViewManagerInterface { + public: + virtual ~DesktopViewManagerInterface(); + + // Returns handler responsible for tracking navigations. + virtual NavigationHandler* GetNavigationHandler() = 0; + // Called by navigation handler when a suitable URL has + // been found. All suitable URLs are chrome-owned. + virtual void HandleChromeOwnedPageNavigation( + BrowserWindowInterface* browser_interface) = 0; +}; + +class DesktopViewManager : public DesktopViewManagerInterface { public: using ShowViewCallback = base::OnceCallback<void(BrowserWindowInterface*, @@ -31,7 +44,7 @@ explicit DesktopViewManager( PrivacySandboxNoticeServiceInterface* notice_service); - virtual ~DesktopViewManager(); + ~DesktopViewManager() override; class Observer { public: @@ -46,13 +59,13 @@ // Accessors std::vector<notice::mojom::PrivacySandboxNotice> GetPendingNoticesToShow(); - NavigationHandler* GetNavigationHandler(); + // DesktopViewManagerInterface + NavigationHandler* GetNavigationHandler() override; + void HandleChromeOwnedPageNavigation( + BrowserWindowInterface* browser_interface) override; void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); - // Called by an the new navigation entrypoint handler when a suitable URL has - // been found. All suitable URLs are chrome-owned. - void HandleChromeOwnedPageNavigation(); private: friend class DesktopViewManagerTestPeer;
diff --git a/chrome/browser/privacy_sandbox/notice/mocks/mock_desktop_view_manager.cc b/chrome/browser/privacy_sandbox/notice/mocks/mock_desktop_view_manager.cc new file mode 100644 index 0000000..85d258e --- /dev/null +++ b/chrome/browser/privacy_sandbox/notice/mocks/mock_desktop_view_manager.cc
@@ -0,0 +1,22 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/privacy_sandbox/notice/mocks/mock_desktop_view_manager.h" + +using ::testing::Return; + +namespace privacy_sandbox { + +MockDesktopViewManager::MockDesktopViewManager() { + test_navigation_handler_ = + std::make_unique<NavigationHandler>(base::BindRepeating( + &MockDesktopViewManager::HandleChromeOwnedPageNavigation, + base::Unretained(this))); + ON_CALL(*this, GetNavigationHandler()) + .WillByDefault(Return(test_navigation_handler_.get())); +} + +MockDesktopViewManager::~MockDesktopViewManager() = default; + +} // namespace privacy_sandbox
diff --git a/chrome/browser/privacy_sandbox/notice/mocks/mock_desktop_view_manager.h b/chrome/browser/privacy_sandbox/notice/mocks/mock_desktop_view_manager.h new file mode 100644 index 0000000..bfd7862 --- /dev/null +++ b/chrome/browser/privacy_sandbox/notice/mocks/mock_desktop_view_manager.h
@@ -0,0 +1,32 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +#ifndef CHROME_BROWSER_PRIVACY_SANDBOX_NOTICE_MOCKS_MOCK_DESKTOP_VIEW_MANAGER_H_ +#define CHROME_BROWSER_PRIVACY_SANDBOX_NOTICE_MOCKS_MOCK_DESKTOP_VIEW_MANAGER_H_ + +#include <optional> + +#include "chrome/browser/privacy_sandbox/notice/desktop_view_manager.h" +#include "chrome/browser/privacy_sandbox/notice/notice.mojom-forward.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace privacy_sandbox { + +class MockDesktopViewManager : public DesktopViewManagerInterface { + public: + MockDesktopViewManager(); + ~MockDesktopViewManager() override; + + MOCK_METHOD(NavigationHandler*, GetNavigationHandler, (), (override)); + MOCK_METHOD(void, + HandleChromeOwnedPageNavigation, + (BrowserWindowInterface* browser_interface), + (override)); + + private: + std::unique_ptr<NavigationHandler> test_navigation_handler_; +}; + +} // namespace privacy_sandbox + +#endif // CHROME_BROWSER_PRIVACY_SANDBOX_NOTICE_MOCKS_MOCK_DESKTOP_VIEW_MANAGER_H_
diff --git a/chrome/browser/privacy_sandbox/notice/mocks/mock_notice_service.h b/chrome/browser/privacy_sandbox/notice/mocks/mock_notice_service.h index 49edfede..609723d7 100644 --- a/chrome/browser/privacy_sandbox/notice/mocks/mock_notice_service.h +++ b/chrome/browser/privacy_sandbox/notice/mocks/mock_notice_service.h
@@ -39,7 +39,10 @@ (override)); #if !BUILDFLAG(IS_ANDROID) - MOCK_METHOD(DesktopViewManager*, GetDesktopViewManager, (), (override)); + MOCK_METHOD(DesktopViewManagerInterface*, + GetDesktopViewManager, + (), + (override)); #endif // !BUILDFLAG(IS_ANDROID) };
diff --git a/chrome/browser/privacy_sandbox/notice/notice_service.cc b/chrome/browser/privacy_sandbox/notice/notice_service.cc index 00c0f41..5342642 100644 --- a/chrome/browser/privacy_sandbox/notice/notice_service.cc +++ b/chrome/browser/privacy_sandbox/notice/notice_service.cc
@@ -77,7 +77,8 @@ } #if !BUILDFLAG(IS_ANDROID) -DesktopViewManager* PrivacySandboxNoticeService::GetDesktopViewManager() { +DesktopViewManagerInterface* +PrivacySandboxNoticeService::GetDesktopViewManager() { return desktop_view_manager_.get(); } #endif // !BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/privacy_sandbox/notice/notice_service.h b/chrome/browser/privacy_sandbox/notice/notice_service.h index 4d692b5..08cb5627 100644 --- a/chrome/browser/privacy_sandbox/notice/notice_service.h +++ b/chrome/browser/privacy_sandbox/notice/notice_service.h
@@ -50,7 +50,7 @@ NoticeCatalog* GetCatalog(); #if !BUILDFLAG(IS_ANDROID) - DesktopViewManager* GetDesktopViewManager() override; + DesktopViewManagerInterface* GetDesktopViewManager() override; #endif // !BUILDFLAG(IS_ANDROID) // KeyedService: @@ -63,7 +63,7 @@ std::unique_ptr<NoticeCatalog> catalog_; std::unique_ptr<NoticeStorage> notice_storage_; #if !BUILDFLAG(IS_ANDROID) - std::unique_ptr<DesktopViewManager> desktop_view_manager_; + std::unique_ptr<DesktopViewManagerInterface> desktop_view_manager_; #endif // !BUILDFLAG(IS_ANDROID) };
diff --git a/chrome/browser/privacy_sandbox/notice/notice_service_interface.h b/chrome/browser/privacy_sandbox/notice/notice_service_interface.h index 88db199..8c810123 100644 --- a/chrome/browser/privacy_sandbox/notice/notice_service_interface.h +++ b/chrome/browser/privacy_sandbox/notice/notice_service_interface.h
@@ -14,7 +14,7 @@ namespace privacy_sandbox { -class DesktopViewManager; +class DesktopViewManagerInterface; enum class SurfaceType; @@ -31,7 +31,7 @@ notice::mojom::PrivacySandboxNoticeEvent event) = 0; #if !BUILDFLAG(IS_ANDROID) - virtual DesktopViewManager* GetDesktopViewManager() = 0; + virtual DesktopViewManagerInterface* GetDesktopViewManager() = 0; #endif // !BUILDFLAG(IS_ANDROID) };
diff --git a/chrome/browser/privacy_sandbox/notice/notice_storage.h b/chrome/browser/privacy_sandbox/notice/notice_storage.h index e52301f..63c221f 100644 --- a/chrome/browser/privacy_sandbox/notice/notice_storage.h +++ b/chrome/browser/privacy_sandbox/notice/notice_storage.h
@@ -133,14 +133,6 @@ std::optional<NoticeEventTimestampPair> GetNoticeActionTakenForFirstShownFromEvents() const; - // TODO(crbug.com/392088228): Remove other actions once the new event fields - // are written to. Stores information about profile interactions on a notice. - NoticeActionTaken notice_action_taken_ = NoticeActionTaken::kNotSet; - base::Time notice_action_taken_time_; - base::Time notice_first_shown_; - base::Time notice_last_shown_; - base::TimeDelta notice_shown_duration_; - static void RegisterJSONConverter( base::JSONValueConverter<PrivacySandboxNoticeData>* converter);
diff --git a/chrome/browser/profiles/profile_keyed_service_browsertest.cc b/chrome/browser/profiles/profile_keyed_service_browsertest.cc index 98e14128..04a1c36 100644 --- a/chrome/browser/profiles/profile_keyed_service_browsertest.cc +++ b/chrome/browser/profiles/profile_keyed_service_browsertest.cc
@@ -386,6 +386,9 @@ "ExtensionInstallEventRouter", #endif // BUILDFLAG(ENTERPRISE_CONTENT_ANALYSIS) "ChromeEnterpriseRealTimeUrlLookupService", +#if BUILDFLAG(IS_CHROMEOS) + "ComponentExtensionContentSettingsAllowlist", +#endif "EnterpriseReportingPrivateEventRouter", "ExtensionNavigationRegistry", "ExtensionSystem", @@ -597,6 +600,9 @@ "ChildAccountService", "ChromeSigninClient", "CommandService", +#if BUILDFLAG(IS_CHROMEOS) + "ComponentExtensionContentSettingsAllowlist", +#endif #if BUILDFLAG(ENABLE_EXTENSIONS_CORE) "ComponentLoader", #endif
diff --git a/chrome/browser/recent_tabs/internal/android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDevicePaneImpl.java b/chrome/browser/recent_tabs/internal/android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDevicePaneImpl.java index 91ab804..e60d750 100644 --- a/chrome/browser/recent_tabs/internal/android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDevicePaneImpl.java +++ b/chrome/browser/recent_tabs/internal/android/java/src/org/chromium/chrome/browser/recent_tabs/CrossDevicePaneImpl.java
@@ -13,6 +13,7 @@ import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.build.annotations.Nullable; +import org.chromium.build.annotations.NullMarked; import org.chromium.chrome.browser.hub.DisplayButtonData; import org.chromium.chrome.browser.hub.FadeHubLayoutAnimationFactory; import org.chromium.chrome.browser.hub.FullButtonData; @@ -34,6 +35,7 @@ * A {@link Pane} representing tabs from other devices. This feature is being migrated here from the * Recent Tabs page and used to exist under the foreign session tabs section. */ +@NullMarked public class CrossDevicePaneImpl implements CrossDevicePane { private final Context mContext; private final DoubleConsumer mOnToolbarAlphaChange; @@ -48,7 +50,7 @@ private final ObservableSupplierImpl<Boolean> mHubSearchEnabledStateSupplier = new ObservableSupplierImpl<>(); - private CrossDeviceListCoordinator mCrossDeviceListCoordinator; + private @Nullable CrossDeviceListCoordinator mCrossDeviceListCoordinator; /** * @param context Used to inflate UI.
diff --git a/chrome/browser/recent_tabs/internal/android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsPromoSheetContent.java b/chrome/browser/recent_tabs/internal/android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsPromoSheetContent.java index dea82f9..2ffdaf1a 100644 --- a/chrome/browser/recent_tabs/internal/android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsPromoSheetContent.java +++ b/chrome/browser/recent_tabs/internal/android/java/src/org/chromium/chrome/browser/recent_tabs/RestoreTabsPromoSheetContent.java
@@ -18,6 +18,7 @@ import org.chromium.base.supplier.ObservableSupplierImpl; import org.chromium.build.annotations.Nullable; +import org.chromium.build.annotations.NullMarked; import org.chromium.chrome.browser.recent_tabs.RestoreTabsMetricsHelper.RestoreTabsOnFREBackPressType; import org.chromium.chrome.browser.recent_tabs.RestoreTabsMetricsHelper.RestoreTabsOnFRERestoredTabsResult; import org.chromium.chrome.browser.recent_tabs.RestoreTabsMetricsHelper.RestoreTabsOnFREResultAction; @@ -28,6 +29,7 @@ import org.chromium.ui.modelutil.PropertyModel; /** The bottom sheet content for the Restore Tabs promo. */ +@NullMarked public class RestoreTabsPromoSheetContent implements BottomSheetContent { private final View mContentView; private final PropertyModel mModel;
diff --git a/chrome/browser/resources/data_sharing/data_sharing_app.ts b/chrome/browser/resources/data_sharing/data_sharing_app.ts index c1415b2..868106c 100644 --- a/chrome/browser/resources/data_sharing/data_sharing_app.ts +++ b/chrome/browser/resources/data_sharing/data_sharing_app.ts
@@ -479,6 +479,20 @@ switch (flow) { case FlowValues.SHARE: + document.title = + loadTimeData.getStringF('shareGroupTitle', getTabGroupName()); + break; + case FlowValues.MANAGE: + document.title = + loadTimeData.getStringF('manageGroupTitle', getTabGroupName()); + break; + case FlowValues.JOIN: + document.title = loadTimeData.getStringF('previewA11yName'); + break; + } + + switch (flow) { + case FlowValues.SHARE: this.dataSharingSdk_ .runInviteFlow({ parent,
diff --git a/chrome/browser/resources/new_tab_page/untrusted/one_google_bar.ts b/chrome/browser/resources/new_tab_page/untrusted/one_google_bar.ts index 49b9880..0209be7 100644 --- a/chrome/browser/resources/new_tab_page/untrusted/one_google_bar.ts +++ b/chrome/browser/resources/new_tab_page/untrusted/one_google_bar.ts
@@ -99,43 +99,34 @@ return bar; }, {} as Bar); - - let foregroundLight: boolean; - if (!abp) { - foregroundLight = false; - } - async function updateDarkMode(): Promise<void> { - const isDarkTheme: boolean = - window.matchMedia('(prefers-color-scheme: dark)').matches; - if (foregroundLight !== isDarkTheme) { - foregroundLight = isDarkTheme; - if (abp) { - await asyncBar.setDarkMode(isDarkTheme); - } else { - await api.bar.setDarkMode(isDarkTheme); - // |setDarkMode(toggle)| updates the background color and foreground - // style. The background color should always be 'transparent'. - api.bar.setBackgroundColor('transparent'); - // The foreground style is set based on NTP theme and not dark mode. - api.bar.setForegroundStyle(foregroundLight ? 1 : 0); - } + if (abp) { + await asyncBar.setDarkMode( + window.matchMedia('(prefers-color-scheme: dark)').matches); + } else { + await api.bar.setDarkMode( + window.matchMedia('(prefers-color-scheme: dark)').matches); + // |setDarkMode(toggle)| updates the background color and foreground + // style. The background color should always be 'transparent'. + api.bar.setBackgroundColor('transparent'); + // The foreground style is set based on NTP theme and not dark mode. + api.bar.setForegroundStyle(foregroundLight ? 1 : 0); } } + let foregroundLight: boolean = false; + return { /** * Updates the foreground on the OneGoogleBar to provide contrast against * the background. */ setForegroundLight: (enabled: boolean) => { - if (foregroundLight !== enabled) { + if (abp) { + asyncBar.setDarkMode(enabled); + } else if (foregroundLight !== enabled) { foregroundLight = enabled; - if (abp) { - asyncBar.setDarkMode(foregroundLight); - } else { - api.bar.setForegroundStyle(foregroundLight ? 1 : 0); - } + api.bar.setForegroundStyle(foregroundLight ? 1 : 0); } },
diff --git a/chrome/browser/resources/privacy_sandbox/DIR_METADATA b/chrome/browser/resources/privacy_sandbox/DIR_METADATA index cb1e73c9..aff2c86 100644 --- a/chrome/browser/resources/privacy_sandbox/DIR_METADATA +++ b/chrome/browser/resources/privacy_sandbox/DIR_METADATA
@@ -3,5 +3,5 @@ } team_email: "koilos@google.com" buganizer_public: { - component_id: 1697287 + component_id: 1706459 }
diff --git a/chrome/browser/resources/settings/privacy_sandbox/DIR_METADATA b/chrome/browser/resources/settings/privacy_sandbox/DIR_METADATA index 5440eed..721e578 100644 --- a/chrome/browser/resources/settings/privacy_sandbox/DIR_METADATA +++ b/chrome/browser/resources/settings/privacy_sandbox/DIR_METADATA
@@ -3,5 +3,5 @@ } team_email: "koilos@google.com" buganizer_public: { - component_id: 1697287 + component_id: 1706459 } \ No newline at end of file
diff --git a/chrome/browser/safe_browsing/download_protection/deep_scanning_browsertest.cc b/chrome/browser/safe_browsing/download_protection/deep_scanning_browsertest.cc index c8a5af1d..301189bf 100644 --- a/chrome/browser/safe_browsing/download_protection/deep_scanning_browsertest.cc +++ b/chrome/browser/safe_browsing/download_protection/deep_scanning_browsertest.cc
@@ -9,6 +9,7 @@ #include "base/files/file_util.h" #include "base/memory/raw_ptr.h" #include "base/path_service.h" +#include "base/run_loop.h" #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" @@ -161,6 +162,7 @@ enterprise_obfuscation::kEnterpriseFileObfuscation) : disabled_features.push_back( enterprise_obfuscation::kEnterpriseFileObfuscation); + enabled_features.push_back(safe_browsing::kLocalIpAddressInEvents); scoped_feature_list_.InitWithFeatures(std::move(enabled_features), std::move(disabled_features)); @@ -531,8 +533,8 @@ } if (request.url == connector_url_) { - ASSERT_TRUE(GetResumableUploadMetadata(network::GetUploadData(request), - &last_request_)); + ASSERT_TRUE(GetResumableUploadMetadata(network::GetUploadData(request), + &last_request_)); } } @@ -1263,7 +1265,9 @@ enterprise_connectors::ContentAnalysisRequest::SAVE_AS_DOWNLOAD); // The blocking response should trigger a security event. + base::RunLoop validator_run_loop; enterprise_connectors::test::EventReportValidator validator(client()); + validator.SetDoneClosure(validator_run_loop.QuitClosure()); std::set<std::string> mimetypes = {"text/plain"}; validator.ExpectSensitiveDataEvent( /*url*/ url.spec(), @@ -1299,6 +1303,7 @@ base::ScopedAllowBlockingForTesting allow_blocking; EXPECT_FALSE(base::PathExists(main_file)); EXPECT_FALSE(base::PathExists(extra_files_dir)); + validator_run_loop.Run(); } IN_PROC_BROWSER_TEST_F(SavePackageDeepScanningBrowserTest, KeepAfterWarning) {
diff --git a/chrome/browser/search_engines/template_url_service_unittest.cc b/chrome/browser/search_engines/template_url_service_unittest.cc index 4b34785..da63010 100644 --- a/chrome/browser/search_engines/template_url_service_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_unittest.cc
@@ -53,7 +53,6 @@ using base::ASCIIToUTF16; using base::Time; using SearchPolicyConflictType = TemplateURLService::SearchPolicyConflictType; -using KeywordType = TemplateURLService::KeywordType; using testing::NotNull; namespace { @@ -175,44 +174,14 @@ : "SearchEngineChoiceDisabled"; } -std::string KeywordTypeToString(KeywordType keyword) { - switch (keyword) { - case KeywordType::kNone: - return ".None"; - case KeywordType::kStarterPack: - return ".StarterPack"; - case KeywordType::kPrepopulated: - return ".Prepopulated"; - case KeywordType::kSearchEngineSetByExtension: - return ".SearchEngineSetByExtension"; - case KeywordType::kNonFeaturedSiteSearchSetByPolicy: - return ".NonFeaturedSiteSearchSetByPolicy"; - case KeywordType::kFeaturedSiteSearchSetByPolicy: - return ".FeaturedSiteSearchSetByPolicy"; - case KeywordType::kSearchAggregatorSetByPolicy: - return ".SearchAggregatorSetByPolicy"; - case KeywordType::kDefaultSearchEngineSetByPolicy: - return ".DefaultSearchEngineSetByPolicy"; - case KeywordType::kDefaultSearchEngineSetByUser: - return ".DefaultSearchEngineSetByUser"; - case KeywordType::kSubstitutingSiteSearchSetByUser: - return ".SubstitutingSiteSearchSetByUser"; - case KeywordType::kNonSubstitutingSiteSearchSetByUser: - return ".NonSubstitutingSiteSearchSetByUser"; - } - return ""; -} - void VerifyTemplateUrlCountsHistograms( const base::HistogramTester& histogram_tester, - const base::flat_map<KeywordType, int>& expected_counts) { + const base::flat_map<std::string, int>& expected_counts) { int total = 0; for (auto [type, count] : expected_counts) { total += count; histogram_tester.ExpectBucketCount( - TemplateURLService::kKeywordCountHistogramName + - KeywordTypeToString(type), - count, 1); + TemplateURLService::kKeywordCountHistogramName + type, count, 1); } // Verify total number of template_urls upon load time. histogram_tester.ExpectBucketCount( @@ -2733,17 +2702,16 @@ base::HistogramTester histogram_tester; test_util()->ResetModel(true); VerifyTemplateUrlCountsHistograms( - histogram_tester, - {{KeywordType::kStarterPack, 5}, - {KeywordType::kPrepopulated, 5}, - {KeywordType::kSearchEngineSetByExtension, 0}, - {KeywordType::kNonFeaturedSiteSearchSetByPolicy, 1}, - {KeywordType::kFeaturedSiteSearchSetByPolicy, 1}, - {KeywordType::kSearchAggregatorSetByPolicy, 1}, - {KeywordType::kDefaultSearchEngineSetByPolicy, 1}, - {KeywordType::kDefaultSearchEngineSetByUser, 1}, - {KeywordType::kSubstitutingSiteSearchSetByUser, 1}, - {KeywordType::kNonSubstitutingSiteSearchSetByUser, 1}}); + histogram_tester, {{".StarterPack", 5}, + {".Prepopulated", 5}, + {".SearchEngineSetByExtension", 0}, + {".NonFeaturedSiteSearchSetByPolicy", 1}, + {".FeaturedSiteSearchSetByPolicy", 1}, + {".SearchAggregatorSetByPolicy", 1}, + {".DefaultSearchEngineSetByPolicy", 1}, + {".DefaultSearchEngineSetByUser", 1}, + {".SubstitutingSiteSearchSetByUser", 1}, + {".NonSubstitutingSiteSearchSetByUser", 1}}); } #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
diff --git a/chrome/browser/security_events/security_event_sync_bridge_impl.cc b/chrome/browser/security_events/security_event_sync_bridge_impl.cc index 661bc08e5..3d3f3ba 100644 --- a/chrome/browser/security_events/security_event_sync_bridge_impl.cc +++ b/chrome/browser/security_events/security_event_sync_bridge_impl.cc
@@ -108,7 +108,7 @@ syncer::EntityChangeList entity_data) { DCHECK(entity_data.empty()); DCHECK(change_processor()->IsTrackingMetadata()); - DCHECK(!change_processor()->TrackedAccountId().empty()); + DCHECK(!change_processor()->TrackedGaiaId().empty()); return ApplyIncrementalSyncChanges(std::move(metadata_change_list), std::move(entity_data)); }
diff --git a/chrome/browser/tabwindow/BUILD.gn b/chrome/browser/tabwindow/BUILD.gn index 8d8efa29..ce99163 100644 --- a/chrome/browser/tabwindow/BUILD.gn +++ b/chrome/browser/tabwindow/BUILD.gn
@@ -30,25 +30,3 @@ sources = [ "internal/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerFactory.java" ] } - -robolectric_library("junit") { - sources = [ "android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImplUnitTest.java" ] - - deps = [ - ":factory_java", - ":java", - "//base:base_java", - "//base:base_java_test_support", - "//base:base_junit_test_support", - "//base/test:test_support_java", - "//chrome/browser/flags:java", - "//chrome/browser/profiles/android:java", - "//chrome/browser/tab:java", - "//chrome/browser/tabmodel:factory_java", - "//chrome/browser/tabmodel:java", - "//chrome/test/android:chrome_java_unit_test_support", - "//third_party/junit", - "//third_party/mockito:mockito_java", - "//ui/android:ui_java", - ] -}
diff --git a/chrome/browser/tabwindow/internal/BUILD.gn b/chrome/browser/tabwindow/internal/BUILD.gn index 51b1606..524cbd2 100644 --- a/chrome/browser/tabwindow/internal/BUILD.gn +++ b/chrome/browser/tabwindow/internal/BUILD.gn
@@ -35,3 +35,26 @@ "//ui/android:ui_java", ] } + +robolectric_library("junit") { + sources = [ "android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImplUnitTest.java" ] + + deps = [ + ":java", + "//base:base_java", + "//base:base_java_test_support", + "//base:base_junit_test_support", + "//base/test:test_support_java", + "//chrome/browser/flags:java", + "//chrome/browser/profiles/android:java", + "//chrome/browser/tab:java", + "//chrome/browser/tabmodel:factory_java", + "//chrome/browser/tabmodel:java", + "//chrome/browser/tabwindow:factory_java", + "//chrome/browser/tabwindow:java", + "//chrome/test/android:chrome_java_unit_test_support", + "//third_party/junit", + "//third_party/mockito:mockito_java", + "//ui/android:ui_java", + ] +}
diff --git a/chrome/browser/tabwindow/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImplUnitTest.java b/chrome/browser/tabwindow/internal/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImplUnitTest.java similarity index 100% rename from chrome/browser/tabwindow/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImplUnitTest.java rename to chrome/browser/tabwindow/internal/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImplUnitTest.java
diff --git a/chrome/browser/ui/android/autofill/manual_filling_view_android.cc b/chrome/browser/ui/android/autofill/manual_filling_view_android.cc index 4388c999..5f7dfb8 100644 --- a/chrome/browser/ui/android/autofill/manual_filling_view_android.cc +++ b/chrome/browser/ui/android/autofill/manual_filling_view_android.cc
@@ -165,6 +165,7 @@ tab_data.loyalty_card_info_list()) { Java_ManualFillingComponentBridge_addLoyaltyCardInfoToAccessorySheetData( env, java_object, j_tab_data, + static_cast<int>(tab_data.get_sheet_type()), static_cast<int>(loyalty_card_info.value().suggestion_type()), loyalty_card_info.merchant_name(), loyalty_card_info.value().display_text());
diff --git a/chrome/browser/ui/android/signin/java/res/layout/account_picker_state_confirm_management.xml b/chrome/browser/ui/android/signin/java/res/layout/account_picker_state_confirm_management.xml index 61e1263..ca5ac79 100644 --- a/chrome/browser/ui/android/signin/java/res/layout/account_picker_state_confirm_management.xml +++ b/chrome/browser/ui/android/signin/java/res/layout/account_picker_state_confirm_management.xml
@@ -37,7 +37,6 @@ android:layout_marginStart="24dp" android:layout_marginEnd="24dp" android:layout_marginBottom="16dp" - android:focusable="true" android:gravity="center_horizontal" android:textAppearance="@style/TextAppearance.TextMedium.Secondary" app:leading="@dimen/text_size_medium_leading" />
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/home_button/HomeButtonCoordinator.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/home_button/HomeButtonCoordinator.java index e953fbb0..2f388d6 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/home_button/HomeButtonCoordinator.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/home_button/HomeButtonCoordinator.java
@@ -8,6 +8,7 @@ import android.content.Context; import android.view.View; +import android.view.View.OnClickListener; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -43,12 +44,14 @@ /** * @param context The Android context used for various view operations. * @param homeButton The concrete {@link View} class for this MVC component. + * @param onClickListener Listener invoked when button is clicked. * @param onMenuClickCallback Callback when home button menu item is clicked. * @param isHomepageMenuDisabledSupplier Supplier for whether the home button menu is enabled. */ public HomeButtonCoordinator( @NonNull Context context, @NonNull View homeButton, + OnClickListener onClickListener, @NonNull Callback<Context> onMenuClickCallback, @NonNull Supplier<Boolean> isHomepageMenuDisabledSupplier) { mContext = context; @@ -56,6 +59,7 @@ mOnMenuClickCallback = onMenuClickCallback; mIsHomeButtonMenuDisabled = isHomepageMenuDisabledSupplier; mHomeButton.setOnLongClickListener(this::onLongClickHomeButton); + mHomeButton.setOnClickListener(onClickListener); } @VisibleForTesting
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/home_button/HomeButtonCoordinatorTest.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/home_button/HomeButtonCoordinatorTest.java index 0241850..fde4f73 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/home_button/HomeButtonCoordinatorTest.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/home_button/HomeButtonCoordinatorTest.java
@@ -49,6 +49,7 @@ new HomeButtonCoordinator( mContext, mHomeButton, + (view) -> {}, (context) -> {}, () -> mIsHomeButtonMenuDisabled); }
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java index af8547bb..c7f1ee48 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java
@@ -67,8 +67,6 @@ import org.chromium.ui.util.TokenHolder; import org.chromium.url.GURL; -import java.util.function.BooleanSupplier; - /** * Layout class that contains the base shared logic for manipulating the toolbar component. For * interaction that are not from Views inside Toolbar hierarchy all interactions should be done @@ -88,7 +86,6 @@ private ToolbarTabController mToolbarTabController; @Nullable protected ToolbarProgressBar mProgressBar; - @Nullable protected BooleanSupplier mPartnerHomepageEnabledSupplier; private boolean mNativeLibraryReady; private boolean mUrlHasFocus; @@ -132,8 +129,6 @@ * @param tabController The controller that handles interactions with the tab. * @param menuButtonCoordinator Coordinator for interacting with the MenuButton. * @param historyDelegate Delegate used to display navigation history. - * @param partnerHomepageEnabledSupplier A supplier of a boolean indicating that partner - * homepage is enabled. * @param userEducationHelper Helper for user education flows. * @param trackerSupplier Provides a {@link Tracker} when available. */ @@ -144,7 +139,6 @@ MenuButtonCoordinator menuButtonCoordinator, ToggleTabStackButtonCoordinator tabSwitcherButtonCoordinator, HistoryDelegate historyDelegate, - BooleanSupplier partnerHomepageEnabledSupplier, UserEducationHelper userEducationHelper, ObservableSupplier<Tracker> trackerSupplier, ToolbarProgressBar progressBar, @@ -154,7 +148,6 @@ mToolbarTabController = tabController; mMenuButtonCoordinator = menuButtonCoordinator; mTabSwitcherButtonCoordinator = tabSwitcherButtonCoordinator; - mPartnerHomepageEnabledSupplier = partnerHomepageEnabledSupplier; mProgressBar = progressBar; } @@ -725,12 +718,6 @@ return mToolbarTabController != null ? mToolbarTabController.forward() : false; } - /** Opens hompage in the current tab. */ - void openHomepage() { - maybeUnfocusUrlBar(); - if (mToolbarTabController != null) mToolbarTabController.openHomepage(); - } - private void maybeUnfocusUrlBar() { if (getLocationBar() != null && getLocationBar().getOmniboxStub() != null) { getLocationBar()
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java index 88faeee..01c091a 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java
@@ -28,7 +28,6 @@ import android.view.Gravity; import android.view.MotionEvent; import android.view.View; -import android.view.View.OnClickListener; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.ViewStub; @@ -73,6 +72,7 @@ import org.chromium.chrome.browser.toolbar.optional_button.OptionalButtonCoordinator.TransitionType; import org.chromium.chrome.browser.toolbar.reload_button.ReloadButtonCoordinator; import org.chromium.chrome.browser.toolbar.top.CaptureReadinessResult.TopToolbarBlockCaptureReason; +import org.chromium.chrome.browser.toolbar.top.NavigationPopup.HistoryDelegate; import org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator.ToolbarColorObserver; import org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator.UrlExpansionObserver; import org.chromium.chrome.browser.ui.theme.BrandedColorScheme; @@ -81,7 +81,6 @@ import org.chromium.components.browser_ui.styles.SemanticColorUtils; import org.chromium.components.browser_ui.widget.animation.CancelAwareAnimatorListener; import org.chromium.components.embedder_support.util.UrlUtilities; -import org.chromium.components.feature_engagement.EventConstants; import org.chromium.components.feature_engagement.Tracker; import org.chromium.components.omnibox.OmniboxFeatures; import org.chromium.ui.base.LocalizationUtils; @@ -98,9 +97,7 @@ /** Phone specific toolbar implementation. */ public class ToolbarPhone extends ToolbarLayout - implements OnClickListener, - OmniboxSuggestionsDropdownScrollListener, - ToolbarDataProvider.Observer { + implements OmniboxSuggestionsDropdownScrollListener, ToolbarDataProvider.Observer { /** The amount of time transitioning from one theme color to another should take in ms. */ public static final long THEME_COLOR_TRANSITION_DURATION = 250; @@ -348,8 +345,7 @@ ToolbarTabController tabController, MenuButtonCoordinator menuButtonCoordinator, ToggleTabStackButtonCoordinator tabSwitcherButtonCoordinator, - NavigationPopup.HistoryDelegate historyDelegate, - BooleanSupplier partnerHomepageEnabledSupplier, + HistoryDelegate historyDelegate, UserEducationHelper userEducationHelper, ObservableSupplier<Tracker> trackerSupplier, ToolbarProgressBar progressBar, @@ -361,7 +357,6 @@ menuButtonCoordinator, tabSwitcherButtonCoordinator, historyDelegate, - partnerHomepageEnabledSupplier, userEducationHelper, trackerSupplier, progressBar, @@ -516,7 +511,6 @@ @Override protected void onNativeLibraryReady() { super.onNativeLibraryReady(); - mHomeButton.setOnClickListener(this); updateVisualsForLocationBarState(); } @@ -547,21 +541,6 @@ } @Override - public void onClick(View v) { - // Don't allow clicks while the omnibox is being focused. - if (mLocationBar != null && urlHasFocus()) { - return; - } - if (mHomeButton == v) { - recordHomeModuleClickedIfNTPVisible(); - openHomepage(); - if (mTrackerSupplier.hasValue() && mPartnerHomepageEnabledSupplier.getAsBoolean()) { - mTrackerSupplier.get().notifyEvent(EventConstants.PARTNER_HOME_PAGE_BUTTON_PRESSED); - } - } - } - - @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { // In case the call came from the handler after we destroyed the dependencies, skip the work // that could touch the already destroyed objects. @@ -1976,6 +1955,7 @@ updateBackground(hasFocus); updateLocationBarForNtp(mVisualState, urlHasFocus()); getTabSwitcherButtonCoordinator().getContainerView().setClickable(!hasFocus); + mHomeButton.setClickable(!hasFocus); triggerUrlFocusAnimation(hasFocus); }
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java index 5b30dae..ba7e15d8 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java
@@ -63,7 +63,6 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.function.BooleanSupplier; /** The Toolbar object for Tablet screens. */ @SuppressLint("Instantiatable") @@ -146,8 +145,6 @@ @Override public void onNativeLibraryReady() { super.onNativeLibraryReady(); - mHomeButton.setOnClickListener(this); - mForwardButton.setOnClickListener(this); mForwardButton.setLongClickable(true); } @@ -188,10 +185,7 @@ @Override public void onClick(View v) { - if (mHomeButton == v) { - recordHomeModuleClickedIfNTPVisible(); - openHomepage(); - } else if (mForwardButton == v) { + if (mForwardButton == v) { forward(); RecordUserAction.record("MobileToolbarForward"); } @@ -408,7 +402,6 @@ MenuButtonCoordinator menuButtonCoordinator, ToggleTabStackButtonCoordinator tabSwitcherButtonCoordinator, HistoryDelegate historyDelegate, - BooleanSupplier partnerHomepageEnabledSupplier, UserEducationHelper userEducationHelper, ObservableSupplier<Tracker> trackerSupplier, ToolbarProgressBar progressBar, @@ -420,7 +413,6 @@ menuButtonCoordinator, tabSwitcherButtonCoordinator, historyDelegate, - partnerHomepageEnabledSupplier, userEducationHelper, trackerSupplier, progressBar,
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTabletUnitTest.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTabletUnitTest.java index 6f3f4b18..02e07b1 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTabletUnitTest.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTabletUnitTest.java
@@ -178,7 +178,6 @@ mMenuButtonCoordinator, mTabSwitcherButtonCoordinator, null, - () -> false, null, null, mProgressBar, @@ -271,7 +270,6 @@ mMenuButtonCoordinator, mTabSwitcherButtonCoordinator, null, - () -> false, null, null, mProgressBar,
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarCoordinator.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarCoordinator.java index af92d6e..a7ee0ec 100644 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarCoordinator.java +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/TopToolbarCoordinator.java
@@ -62,7 +62,6 @@ import org.chromium.ui.util.TokenHolder; import java.util.List; -import java.util.function.BooleanSupplier; /** A coordinator for the top toolbar component. */ public class TopToolbarCoordinator implements Toolbar { @@ -122,6 +121,8 @@ /** * Creates a new {@link TopToolbarCoordinator}. * + * @param reloadButtonCoordinator Component that encapsulates interactions with a reload button. + * It only presents on tablet. * @param controlContainer The {@link ToolbarControlContainer} for the containing activity. * @param toolbarLayout The {@link ToolbarLayout}. * @param toolbarDataProvider The provider for toolbar data. @@ -137,8 +138,6 @@ * @param homepageEnabledSupplier Supplier of whether Home button is enabled. * @param resourceManagerSupplier A supplier of a resource manager for native textures. * @param historyDelegate Delegate used to display navigation history. - * @param partnerHomepageEnabledSupplier A supplier of a boolean indicating that partner - * homepage is enabled. * @param initializeWithIncognitoColors Whether the toolbar should be initialized with incognito * colors. * @param constraintsSupplier Supplier for browser controls constraints. @@ -151,8 +150,6 @@ * @param tabStripTransitionDelegateSupplier Supplier for the {@link * TabStripTransitionDelegate}. * @param onLongClickListener OnLongClickListener for the toolbar. - * @param reloadButtonCoordinator Component that encapsulates interactions with a reload button. - * It only presents on tablet. */ public TopToolbarCoordinator( ToolbarControlContainer controlContainer, @@ -170,7 +167,6 @@ ObservableSupplier<Boolean> homepageEnabledSupplier, Supplier<ResourceManager> resourceManagerSupplier, HistoryDelegate historyDelegate, - BooleanSupplier partnerHomepageEnabledSupplier, boolean initializeWithIncognitoColors, ObservableSupplier<Integer> constraintsSupplier, ObservableSupplier<Boolean> compositorInMotionSupplier, @@ -243,7 +239,6 @@ mMenuButtonCoordinator, tabSwitcerButtonCoordinator, historyDelegate, - partnerHomepageEnabledSupplier, userEducationHelper, mTrackerSupplier, progressBar,
diff --git a/chrome/browser/ui/ash/assistant/assistant_test_mixin.h b/chrome/browser/ui/ash/assistant/assistant_test_mixin.h index d01fc47..47a3337c 100644 --- a/chrome/browser/ui/ash/assistant/assistant_test_mixin.h +++ b/chrome/browser/ui/ash/assistant/assistant_test_mixin.h
@@ -12,7 +12,6 @@ #include "base/test/test_timeouts.h" #include "base/time/time.h" #include "chrome/browser/ui/ash/assistant/test_support/fake_s3_server.h" -#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "ui/events/keycodes/keyboard_codes_posix.h"
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc index 0c7b5c2..357bf12 100644 --- a/chrome/browser/ui/autofill/chrome_autofill_client.cc +++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -80,7 +80,7 @@ #include "components/autofill/core/browser/form_import/form_data_importer.h" #include "components/autofill/core/browser/foundations/autofill_client.h" #include "components/autofill/core/browser/foundations/browser_autofill_manager.h" -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" #include "components/autofill/core/browser/integrators/optimization_guide/autofill_optimization_guide.h" #include "components/autofill/core/browser/integrators/plus_addresses/autofill_plus_address_delegate.h" #include "components/autofill/core/browser/logging/log_router.h"
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.h b/chrome/browser/ui/autofill/chrome_autofill_client.h index 619bd1c..d9cad67 100644 --- a/chrome/browser/ui/autofill/chrome_autofill_client.h +++ b/chrome/browser/ui/autofill/chrome_autofill_client.h
@@ -28,7 +28,7 @@ #include "components/autofill/core/browser/crowdsourcing/autofill_crowdsourcing_manager.h" #include "components/autofill/core/browser/crowdsourcing/votes_uploader.h" #include "components/autofill/core/browser/filling/filling_product.h" -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" #include "components/autofill/core/browser/integrators/password_form_classification.h" #include "components/autofill/core/browser/integrators/plus_addresses/autofill_plus_address_delegate.h" #include "components/autofill/core/browser/logging/log_manager.h"
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 9d0ed49..acb3a3a 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc
@@ -1213,6 +1213,10 @@ return window_->IsVisibleOnScreen(); } +bool Browser::IsVisible() const { + return window_->IsVisible(); +} + base::WeakPtr<BrowserWindowInterface> Browser::GetWeakPtr() { return AsWeakPtr(); }
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 23e920f..c4cea0b6e 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h
@@ -873,6 +873,7 @@ views::View* TopContainer() override; bool IsMinimized() const override; bool IsVisibleOnScreen() const override; + bool IsVisible() const override; base::WeakPtr<BrowserWindowInterface> GetWeakPtr() override; views::View* LensOverlayView() override; base::CallbackListSubscription RegisterActiveTabDidChange(
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc index 7e64e98..ae152891 100644 --- a/chrome/browser/ui/browser_ui_prefs.cc +++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -60,6 +60,10 @@ registry->RegisterIntegerPref(prefs::kDefaultBrowserDeclinedCount, 0); registry->RegisterTimePref(prefs::kDefaultBrowserFirstShownTime, base::Time()); +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) + registry->RegisterTimePref(prefs::kPdfInfoBarLastShown, base::Time()); + registry->RegisterIntegerPref(prefs::kPdfInfoBarTimesShown, 0); +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) registry->RegisterStringPref(prefs::kEnterpriseCustomLabelForBrowser, std::string());
diff --git a/chrome/browser/ui/browser_window/public/browser_window_interface.h b/chrome/browser/ui/browser_window/public/browser_window_interface.h index 21f39619..d1862cd 100644 --- a/chrome/browser/ui/browser_window/public/browser_window_interface.h +++ b/chrome/browser/ui/browser_window/public/browser_window_interface.h
@@ -105,6 +105,9 @@ // Returns true if the browser window is visible on the screen. virtual bool IsVisibleOnScreen() const = 0; + // Returns true if the window is visible. + virtual bool IsVisible() const = 0; + virtual base::WeakPtr<BrowserWindowInterface> GetWeakPtr() = 0; // Returns the view that houses the Lens overlay.
diff --git a/chrome/browser/ui/browser_window/test/mock_browser_window_interface.h b/chrome/browser/ui/browser_window/test/mock_browser_window_interface.h index 20cac85..6e69e1ff 100644 --- a/chrome/browser/ui/browser_window/test/mock_browser_window_interface.h +++ b/chrome/browser/ui/browser_window/test/mock_browser_window_interface.h
@@ -31,6 +31,7 @@ MOCK_METHOD(views::View*, TopContainer, (), (override)); MOCK_METHOD(bool, IsMinimized, (), (const, override)); MOCK_METHOD(bool, IsVisibleOnScreen, (), (const, override)); + MOCK_METHOD(bool, IsVisible, (), (const, override)); MOCK_METHOD(base::WeakPtr<BrowserWindowInterface>, GetWeakPtr, (),
diff --git a/chrome/browser/ui/hats/survey_config.cc b/chrome/browser/ui/hats/survey_config.cc index 36b3c210..6e30da50 100644 --- a/chrome/browser/ui/hats/survey_config.cc +++ b/chrome/browser/ui/hats/survey_config.cc
@@ -811,7 +811,7 @@ /*presupplied_trigger_id=*/"DzFWc1ACp0ugnJ3q1cK0RPxBRdLT", /*product_specific_bits_data_fields=*/std::vector<std::string>{}, /*product_specific_string_data_fields=*/ - std::vector<std::string>{"page classification"}); + std::vector<std::string>{"page classification", "channel"}); survey_configs.emplace_back( &omnibox_feature_configs::HappinessTrackingSurveyForOmniboxOnFocusZps:: @@ -820,7 +820,7 @@ /*presupplied_trigger_id=*/"7USxn1X280ugnJ3q1cK0P67JEQ7Y", /*product_specific_bits_data_fields=*/std::vector<std::string>{}, /*product_specific_string_data_fields=*/ - std::vector<std::string>{"page classification"}); + std::vector<std::string>{"page classification", "channel"}); return survey_configs; }
diff --git a/chrome/browser/ui/lens/BUILD.gn b/chrome/browser/ui/lens/BUILD.gn index ade7c130..df718f8c 100644 --- a/chrome/browser/ui/lens/BUILD.gn +++ b/chrome/browser/ui/lens/BUILD.gn
@@ -52,7 +52,7 @@ "//chrome/browser/companion/text_finder", "//chrome/browser/content_extraction", "//chrome/browser/lens/core/mojom:mojo_bindings", - "//chrome/browser/search_engines:search_engines", + "//chrome/browser/search_engines", "//chrome/browser/themes", "//chrome/browser/ui/exclusive_access", "//chrome/browser/ui/omnibox", @@ -76,7 +76,6 @@ } source_set("impl") { - public = [] sources = [ "lens_overlay_blur_layer_delegate.cc", "lens_overlay_controller.cc", @@ -101,7 +100,6 @@ "page_content_type_conversions.cc", ] - public_deps = [] deps = [ ":lens", "//build:branding_buildflags", @@ -124,6 +122,7 @@ "//chrome/browser/ui/browser_window", "//chrome/browser/ui/color:color_headers", "//chrome/browser/ui/hats", + "//chrome/browser/ui/user_education", "//chrome/browser/ui/views/bubble", "//chrome/browser/ui/views/page_action", "//chrome/browser/ui/views/toolbar", @@ -155,7 +154,7 @@ "//components/web_modal:web_modal", "//components/zoom", "//google_apis", - "//google_apis/common:common", + "//google_apis/common", "//google_apis/common:request_util", "//mojo/public/cpp/bindings", "//net", @@ -169,9 +168,9 @@ "//third_party/zlib/google:compression_utils", "//third_party/zstd:compress", "//ui/base:types", - "//ui/gfx:gfx", - "//ui/gfx/codec:codec", - "//ui/gfx/geometry:geometry", + "//ui/gfx", + "//ui/gfx/codec", + "//ui/gfx/geometry", "//ui/menus", "//ui/webui", "//url",
diff --git a/chrome/browser/ui/lens/lens_overlay_controller.cc b/chrome/browser/ui/lens/lens_overlay_controller.cc index a1462d5..3993299 100644 --- a/chrome/browser/ui/lens/lens_overlay_controller.cc +++ b/chrome/browser/ui/lens/lens_overlay_controller.cc
@@ -54,6 +54,7 @@ #include "chrome/browser/ui/search/omnibox_utils.h" #include "chrome/browser/ui/tabs/public/tab_features.h" #include "chrome/browser/ui/ui_features.h" +#include "chrome/browser/ui/user_education/browser_user_education_interface.h" #include "chrome/browser/ui/views/side_panel/side_panel.h" #include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h" #include "chrome/browser/ui/views/side_panel/side_panel_enums.h" @@ -90,8 +91,6 @@ #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents_user_data.h" #include "content/public/browser/web_ui.h" -#include "lens_overlay_query_controller.h" -#include "lens_overlay_url_builder.h" #include "net/base/network_change_notifier.h" #include "net/base/url_util.h" #include "pdf/buildflags.h"
diff --git a/chrome/browser/ui/lens/lens_overlay_controller.h b/chrome/browser/ui/lens/lens_overlay_controller.h index 3d9a358..fc3da6e9 100644 --- a/chrome/browser/ui/lens/lens_overlay_controller.h +++ b/chrome/browser/ui/lens/lens_overlay_controller.h
@@ -74,6 +74,10 @@ #include "pdf/mojom/pdf.mojom.h" #endif // BUILDFLAG(ENABLE_PDF) +namespace content { +class WebUI; +} // namespace content + namespace lens { class LensOverlayQueryController; class LensOverlaySidePanelCoordinator; @@ -86,15 +90,6 @@ struct AIPageContentResult; } // namespace optimization_guide -namespace views { -class View; -class WebView; -} // namespace views - -namespace content { -class WebUI; -} // namespace content - namespace signin { class IdentityManager; } // namespace signin @@ -103,14 +98,22 @@ class SyncService; } // namespace syncer +namespace ui { +class TrackedElement; +} // namespace ui + namespace variations { class VariationsClient; } // namespace variations -enum class SidePanelEntryHideReason; +namespace views { +class View; +class WebView; +} // namespace views class PrefService; class Profile; +enum class SidePanelEntryHideReason; extern void* kLensOverlayPreselectionWidgetIdentifier;
diff --git a/chrome/browser/ui/lens/lens_overlay_side_panel_web_view.cc b/chrome/browser/ui/lens/lens_overlay_side_panel_web_view.cc index 0ca7e07..7954f201 100644 --- a/chrome/browser/ui/lens/lens_overlay_side_panel_web_view.cc +++ b/chrome/browser/ui/lens/lens_overlay_side_panel_web_view.cc
@@ -6,6 +6,7 @@ #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/lens/lens_overlay_controller.h" #include "chrome/browser/ui/lens/lens_overlay_event_handler.h" #include "chrome/browser/ui/lens/lens_overlay_side_panel_coordinator.h"
diff --git a/chrome/browser/ui/lens/lens_preselection_bubble.cc b/chrome/browser/ui/lens/lens_preselection_bubble.cc index 024b0154..d0c99135 100644 --- a/chrome/browser/ui/lens/lens_preselection_bubble.cc +++ b/chrome/browser/ui/lens/lens_preselection_bubble.cc
@@ -11,13 +11,13 @@ #include "build/branding_buildflags.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/ui/browser_element_identifiers.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/color/chrome_color_id.h" #include "chrome/browser/ui/lens/lens_overlay_controller.h" #include "chrome/grit/branded_strings.h" #include "chrome/grit/generated_resources.h" #include "components/lens/lens_features.h" #include "components/vector_icons/vector_icons.h" -#include "lens_preselection_bubble.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/base/models/image_model.h"
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc index 6294770..b2aba90 100644 --- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc +++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
@@ -62,6 +62,7 @@ #include "chrome/browser/ui/location_bar/location_bar.h" #include "chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h" #include "chrome/browser/ui/omnibox/omnibox_tab_helper.h" +#include "chrome/common/channel_info.h" #include "chrome/common/pref_names.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/favicon/content/content_favicon_driver.h" @@ -433,6 +434,24 @@ // Roll the dice as we want to show one of two surveys to the treatment // group but only one survey to the control group. bool show_happiness_survey = base::RandInt(0, 1) == 0; + // Get channel string to return as PSD. + std::string channel; + switch (chrome::GetChannel()) { + case version_info::Channel::STABLE: + channel = "stable"; + break; + case version_info::Channel::BETA: + channel = "beta"; + break; + case version_info::Channel::DEV: + channel = "dev"; + break; + case version_info::Channel::CANARY: + channel = "canary"; + break; + default: + channel = "unknown"; + } if (omnibox_feature_configs::OmniboxUrlSuggestionsOnFocus::Get().enabled) { if (show_happiness_survey) { hats_service->LaunchDelayedSurvey( @@ -440,14 +459,16 @@ survey_delay_time_ms, {}, {{"page classification", metrics::OmniboxEventProto::PageClassification_Name( - classification)}}); + classification)}, + {"channel", channel}}); } else { hats_service->LaunchDelayedSurvey( kHatsSurveyTriggerOnFocusZpsSuggestionsUtility, survey_delay_time_ms, {}, {{"page classification", metrics::OmniboxEventProto::PageClassification_Name( - classification)}}); + classification)}, + {"channel", channel}}); } } else { // Control @@ -457,7 +478,8 @@ survey_delay_time_ms, {}, {{"page classification", metrics::OmniboxEventProto::PageClassification_Name( - classification)}}); + classification)}, + {"channel", channel}}); } } }
diff --git a/chrome/browser/ui/page_action/page_action_icon_type.cc b/chrome/browser/ui/page_action/page_action_icon_type.cc index e8057382..94cc6fc76 100644 --- a/chrome/browser/ui/page_action/page_action_icon_type.cc +++ b/chrome/browser/ui/page_action/page_action_icon_type.cc
@@ -5,45 +5,49 @@ #include "chrome/browser/ui/page_action/page_action_icon_type.h" #include "base/feature_list.h" -#include "base/version_info/channel.h" #include "chrome/browser/ui/ui_features.h" -#include "chrome/common/channel_info.h" + +namespace { + +const base::FeatureParam<bool>* GetPageActionMigrationParam( + PageActionIconType page_action) { + switch (page_action) { + case PageActionIconType::kLensOverlay: + return &features::kPageActionsMigrationLensOverlay; + case PageActionIconType::kMemorySaver: + return &features::kPageActionsMigrationMemorySaver; + case PageActionIconType::kTranslate: + return &features::kPageActionsMigrationTranslate; + case PageActionIconType::kIntentPicker: + return &features::kPageActionsMigrationIntentPicker; + case PageActionIconType::kZoom: + return &features::kPageActionsMigrationZoom; + case PageActionIconType::kPaymentsOfferNotification: + return &features::kPageActionsMigrationOfferNotification; + case PageActionIconType::kFileSystemAccess: + return &features::kPageActionsMigrationFileSystemAccess; + case PageActionIconType::kPwaInstall: + return &features::kPageActionsMigrationPwaInstall; + case PageActionIconType::kPriceInsights: + return &features::kPageActionsMigrationPriceInsights; + default: + return nullptr; + } +} + +} // namespace bool IsPageActionMigrated(PageActionIconType page_action) { - if (!base::FeatureList::IsEnabled(features::kPageActionsMigration)) { + const auto* feature_param = GetPageActionMigrationParam(page_action); + if (feature_param == nullptr) { return false; } - // For developer manual testing only, allow all migrations to be enabled - // through a single param. + // For developer manual testing only, allow all migrated page actions to be + // enabled through a single switch. if (features::kPageActionsMigrationEnableAll.Get()) { - const auto channel = chrome::GetChannel(); - if (channel == version_info::Channel::CANARY || - channel == version_info::Channel::UNKNOWN) { - return true; - } + return true; } - switch (page_action) { - case PageActionIconType::kLensOverlay: - return features::kPageActionsMigrationLensOverlay.Get(); - case PageActionIconType::kMemorySaver: - return features::kPageActionsMigrationMemorySaver.Get(); - case PageActionIconType::kTranslate: - return features::kPageActionsMigrationTranslate.Get(); - case PageActionIconType::kIntentPicker: - return features::kPageActionsMigrationIntentPicker.Get(); - case PageActionIconType::kZoom: - return features::kPageActionsMigrationZoom.Get(); - case PageActionIconType::kPaymentsOfferNotification: - return features::kPageActionsMigrationOfferNotification.Get(); - case PageActionIconType::kFileSystemAccess: - return features::kPageActionsMigrationFileSystemAccess.Get(); - case PageActionIconType::kPwaInstall: - return features::kPageActionsMigrationPwaInstall.Get(); - case PageActionIconType::kPriceInsights: - return features::kPageActionsMigrationPriceInsights.Get(); - default: - return false; - } + return feature_param->Get(); }
diff --git a/chrome/browser/ui/pdf/infobar/BUILD.gn b/chrome/browser/ui/pdf/infobar/BUILD.gn index e5677cac..35c2c1d 100644 --- a/chrome/browser/ui/pdf/infobar/BUILD.gn +++ b/chrome/browser/ui/pdf/infobar/BUILD.gn
@@ -8,6 +8,7 @@ sources = [ "pdf_infobar_controller.h", "pdf_infobar_delegate.h", + "pdf_infobar_prefs.h", ] public_deps = [ "//base", @@ -27,6 +28,7 @@ sources = [ "pdf_infobar_controller.cc", "pdf_infobar_delegate.cc", + "pdf_infobar_prefs.cc", ] deps = [ ":infobar", @@ -55,6 +57,7 @@ sources = [ "pdf_infobar_controller_unittest.cc", "pdf_infobar_delegate_unittest.cc", + "pdf_infobar_prefs_unittest.cc", ] deps = [ ":infobar",
diff --git a/chrome/browser/ui/pdf/infobar/pdf_infobar_controller.cc b/chrome/browser/ui/pdf/infobar/pdf_infobar_controller.cc index 979bd0ed..eaf2067 100644 --- a/chrome/browser/ui/pdf/infobar/pdf_infobar_controller.cc +++ b/chrome/browser/ui/pdf/infobar/pdf_infobar_controller.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/shell_integration.h" #include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/pdf/infobar/pdf_infobar_delegate.h" +#include "chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/common/buildflags.h" @@ -62,21 +63,6 @@ return true; } -// Returns true if the setting at `chrome://settings/content/pdfDocuments` is -// set to "Download PDFs", which effectively disables the PDF viewer by making -// Chrome download opened PDFs. Returns false if it's set to "Open in Chrome". -bool IsPdfViewerDisabled(Profile* profile) { - PrefService* prefs = profile->GetPrefs(); - return prefs->HasPrefPath(prefs::kPluginsAlwaysOpenPdfExternally) && - prefs->GetBoolean(prefs::kPluginsAlwaysOpenPdfExternally); -} - -// Returns true if the system's default browser is controlled by a policy. -bool IsDefaultBrowserPolicyControlled() { - return g_browser_process->local_state()->IsManagedPreference( - prefs::kDefaultBrowserSettingEnabled); -} - } // namespace PdfInfoBarController::PdfInfoBarController(BrowserWindowInterface* browser) @@ -181,16 +167,20 @@ return; } - // Show the PDF infobar. - // TODO(crbug.com/396202897): don't show the PDF infobar if we already showed - // it recently. + // Don't show the infobar if it's already showing or was recently shown. if (infobar_) { return; } + if (InfoBarShownRecentlyOrMaxTimes()) { + return; + } + + // Show the PDF infobar. content::WebContents* web_contents = browser_->GetTabStripModel()->GetActiveWebContents(); infobar_manager_ = infobars::ContentInfoBarManager::FromWebContents(web_contents); infobar_manager_->AddObserver(this); infobar_ = PdfInfoBarDelegate::Create(infobar_manager_); + SetInfoBarShownRecently(); }
diff --git a/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.cc b/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.cc new file mode 100644 index 0000000..40ff151 --- /dev/null +++ b/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.cc
@@ -0,0 +1,49 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.h" + +#include <cmath> + +#include "chrome/browser/browser_process.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/common/pref_names.h" +#include "components/prefs/pref_service.h" + +void SetInfoBarShownRecently() { + PrefService* local_state = g_browser_process->local_state(); + local_state->SetInteger( + prefs::kPdfInfoBarTimesShown, + local_state->GetInteger(prefs::kPdfInfoBarTimesShown) + 1); + local_state->SetTime(prefs::kPdfInfoBarLastShown, base::Time::Now()); +} + +bool InfoBarShownRecentlyOrMaxTimes() { + PrefService* local_state = g_browser_process->local_state(); + const int times_shown = local_state->GetInteger(prefs::kPdfInfoBarTimesShown); + if (times_shown == 0) { + return false; + } + if (times_shown >= kPdfInfoBarMaxTimesToShow) { + return true; + } + const double interval_days = + kPdfInfoBarShowIntervalDays * pow(2, times_shown - 1); + const base::Time last_shown = + local_state->GetTime(prefs::kPdfInfoBarLastShown); + return last_shown + base::Days(interval_days) > base::Time::Now(); +} + +bool IsPdfViewerDisabled(Profile* profile) { + auto* prefs = profile->GetPrefs(); + return prefs->HasPrefPath(prefs::kPluginsAlwaysOpenPdfExternally) && + prefs->GetBoolean(prefs::kPluginsAlwaysOpenPdfExternally); +} + +bool IsDefaultBrowserPolicyControlled() { + auto* local_state = g_browser_process->local_state(); + return local_state->IsManagedPreference( + prefs::kDefaultBrowserSettingEnabled) && + local_state->GetBoolean(prefs::kDefaultBrowserSettingEnabled); +}
diff --git a/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.h b/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.h new file mode 100644 index 0000000..00910fe --- /dev/null +++ b/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.h
@@ -0,0 +1,39 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_PDF_INFOBAR_PDF_INFOBAR_PREFS_H_ +#define CHROME_BROWSER_UI_PDF_INFOBAR_PDF_INFOBAR_PREFS_H_ + +class Profile; + +// The number of days after which to show the infobar again after it's shown +// once. Multiplied exponentially every subsequent time it's shown. +// Exposed for testing. +inline constexpr int kPdfInfoBarShowIntervalDays = 10; + +// The maximum number of times the PDF infobar should be shown. +// Exposed for testing. +inline constexpr int kPdfInfoBarMaxTimesToShow = 5; + +// Records now as the last time the PDF infobar was shown, and increments the +// total number of times shown. +void SetInfoBarShownRecently(); + +// Returns true if the PDF infobar has been shown recently or the maximum total +// number of times allowed. "Recently" means: +// * within the past 10 days if it's been shown once +// * within the past 20 days if it's been shown twice +// * within the past 40 days if it's been shown three times +// * ...and so on, exponentially increasing. +bool InfoBarShownRecentlyOrMaxTimes(); + +// Returns true if the setting at `chrome://settings/content/pdfDocuments` is +// set to "Download PDFs", which effectively disables the PDF viewer by making +// Chrome download opened PDFs. Returns false if it's set to "Open in Chrome". +bool IsPdfViewerDisabled(Profile* profile); + +// Returns true if the system's default browser is controlled by a policy. +bool IsDefaultBrowserPolicyControlled(); + +#endif // CHROME_BROWSER_UI_PDF_INFOBAR_PDF_INFOBAR_PREFS_H_
diff --git a/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs_unittest.cc b/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs_unittest.cc new file mode 100644 index 0000000..8939900e --- /dev/null +++ b/chrome/browser/ui/pdf/infobar/pdf_infobar_prefs_unittest.cc
@@ -0,0 +1,115 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/pdf/infobar/pdf_infobar_prefs.h" + +#include "base/time/time.h" +#include "chrome/common/pref_names.h" +#include "chrome/test/base/scoped_testing_local_state.h" +#include "chrome/test/base/testing_browser_process.h" +#include "chrome/test/base/testing_profile.h" +#include "components/prefs/testing_pref_service.h" +#include "content/public/test/browser_task_environment.h" +#include "testing/gtest/include/gtest/gtest.h" + +class PdfInfoBarPrefsTest : public testing::Test { + protected: + PdfInfoBarPrefsTest() : profile_(std::make_unique<TestingProfile>()) {} + + TestingPrefServiceSimple* local_state() { return local_state_.Get(); } + TestingProfile* profile() { return profile_.get(); } + + void FastForwardBy(base::TimeDelta time) { + task_environment_.FastForwardBy(time); + } + + private: + // Must be the first member. + content::BrowserTaskEnvironment task_environment_{ + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; + + // Must be before `profile_`. + ScopedTestingLocalState local_state_{TestingBrowserProcess::GetGlobal()}; + + const std::unique_ptr<TestingProfile> profile_; +}; + +TEST_F(PdfInfoBarPrefsTest, SetInfoBarShownRecently) { + SetInfoBarShownRecently(); + EXPECT_EQ(1, local_state()->GetInteger(prefs::kPdfInfoBarTimesShown)); + EXPECT_EQ(base::Time::Now(), + local_state()->GetTime(prefs::kPdfInfoBarLastShown)); + + FastForwardBy(base::Hours(1)); + SetInfoBarShownRecently(); + EXPECT_EQ(2, local_state()->GetInteger(prefs::kPdfInfoBarTimesShown)); + EXPECT_EQ(base::Time::Now(), + local_state()->GetTime(prefs::kPdfInfoBarLastShown)); +} + +TEST_F(PdfInfoBarPrefsTest, InfoBarShownRecentlyOrMaxTimes) { + EXPECT_FALSE(InfoBarShownRecentlyOrMaxTimes()); + local_state()->SetInteger(prefs::kPdfInfoBarTimesShown, 1); + local_state()->SetTime(prefs::kPdfInfoBarLastShown, base::Time::Now()); + EXPECT_TRUE(InfoBarShownRecentlyOrMaxTimes()); +} + +TEST_F(PdfInfoBarPrefsTest, InfoBarShownRecentlyOrMaxTimesExponential) { + EXPECT_FALSE(InfoBarShownRecentlyOrMaxTimes()); + SetInfoBarShownRecently(); + EXPECT_TRUE(InfoBarShownRecentlyOrMaxTimes()); + + // The infobar was shown once, so it shouldn't be shown again for + // `kPdfInfoBarShowIntervalDays` days. + FastForwardBy(base::Days(kPdfInfoBarShowIntervalDays - 1)); + EXPECT_TRUE(InfoBarShownRecentlyOrMaxTimes()); + FastForwardBy(base::Days(1)); + EXPECT_FALSE(InfoBarShownRecentlyOrMaxTimes()); + SetInfoBarShownRecently(); + + // The infobar was shown twice, so it shouldn't be shown again for + // `kPdfInfoBarShowIntervalDays * 2` days. + FastForwardBy(base::Days((kPdfInfoBarShowIntervalDays * 2) - 1)); + EXPECT_TRUE(InfoBarShownRecentlyOrMaxTimes()); + FastForwardBy(base::Days(1)); + EXPECT_FALSE(InfoBarShownRecentlyOrMaxTimes()); + SetInfoBarShownRecently(); + + // The infobar was shown three times, so it shouldn't be shown again for + // `kPdfInfoBarShowIntervalDays * 4` days. + FastForwardBy(base::Days((kPdfInfoBarShowIntervalDays * 4) - 1)); + EXPECT_TRUE(InfoBarShownRecentlyOrMaxTimes()); + FastForwardBy(base::Days(1)); + EXPECT_FALSE(InfoBarShownRecentlyOrMaxTimes()); +} + +TEST_F(PdfInfoBarPrefsTest, InfoBarShownRecentlyOrMaxTimesMaxReached) { + local_state()->SetInteger(prefs::kPdfInfoBarTimesShown, + kPdfInfoBarMaxTimesToShow); + local_state()->SetTime(prefs::kPdfInfoBarLastShown, + base::Time::Now() - base::Days(3650)); + // The infobar has been shown the max number of times, so it shouldn't be + // shown again regardless of how much time has passed. + EXPECT_TRUE(InfoBarShownRecentlyOrMaxTimes()); +} + +TEST_F(PdfInfoBarPrefsTest, IsPdfViewerDisabled) { + EXPECT_FALSE(IsPdfViewerDisabled(profile())); + profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysOpenPdfExternally, + false); + EXPECT_FALSE(IsPdfViewerDisabled(profile())); + profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysOpenPdfExternally, + true); + EXPECT_TRUE(IsPdfViewerDisabled(profile())); +} + +TEST_F(PdfInfoBarPrefsTest, IsDefaultBrowserPolicyControlled) { + EXPECT_FALSE(IsDefaultBrowserPolicyControlled()); + local_state()->SetManagedPref(prefs::kDefaultBrowserSettingEnabled, + base::Value(false)); + EXPECT_FALSE(IsDefaultBrowserPolicyControlled()); + local_state()->SetManagedPref(prefs::kDefaultBrowserSettingEnabled, + base::Value(true)); + EXPECT_TRUE(IsDefaultBrowserPolicyControlled()); +}
diff --git a/chrome/browser/ui/privacy_sandbox/DIR_METADATA b/chrome/browser/ui/privacy_sandbox/DIR_METADATA index cb1e73c9..aff2c86 100644 --- a/chrome/browser/ui/privacy_sandbox/DIR_METADATA +++ b/chrome/browser/ui/privacy_sandbox/DIR_METADATA
@@ -3,5 +3,5 @@ } team_email: "koilos@google.com" buganizer_public: { - component_id: 1697287 + component_id: 1706459 }
diff --git a/chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate.cc b/chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate.cc index c0c4fa6..054c780 100644 --- a/chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate.cc +++ b/chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate.cc
@@ -29,6 +29,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/common/content_features.h" +#include "media/capture/capture_switches.h" #include "net/base/url_util.h" #include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h" #include "ui/base/l10n/l10n_util.h" @@ -378,7 +379,9 @@ } const gfx::VectorIcon& TabSharingInfoBarDelegate::GetVectorIcon() const { - return vector_icons::kScreenShareIcon; + return base::FeatureList::IsEnabled(features::kTabCaptureInfobarLinks) + ? vector_icons::kScreenShareIcon + : vector_icons::kScreenShareOldIcon; } const TabSharingInfoBarDelegateButton& TabSharingInfoBarDelegate::GetButton(
diff --git a/chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate_unittest.cc b/chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate_unittest.cc index bbaba9a..10405242 100644 --- a/chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate_unittest.cc +++ b/chrome/browser/ui/tab_sharing/tab_sharing_infobar_delegate_unittest.cc
@@ -183,7 +183,7 @@ .focus_target = FocusTarget{GetGlobalId(0), favicon}}); EXPECT_STREQ(delegate->GetVectorIcon().name, - vector_icons::kScreenShareIcon.name); + vector_icons::kScreenShareOldIcon.name); const int expected_buttons = TabSharingInfoBarDelegate::kStop | TabSharingInfoBarDelegate::kQuickNav | @@ -231,7 +231,7 @@ .focus_target = FocusTarget{GetGlobalId(1), favicon}}); EXPECT_STREQ(delegate->GetVectorIcon().name, - vector_icons::kScreenShareIcon.name); + vector_icons::kScreenShareOldIcon.name); EXPECT_EQ(delegate->GetButtons(), TabSharingInfoBarDelegate::kStop | TabSharingInfoBarDelegate::kQuickNav); EXPECT_EQ(delegate->GetButtonLabel(TabSharingInfoBarDelegate::kStop), @@ -253,7 +253,7 @@ .role = TabRole::kOtherTab, .can_share_instead = true}); EXPECT_STREQ(delegate->GetVectorIcon().name, - vector_icons::kScreenShareIcon.name); + vector_icons::kScreenShareOldIcon.name); EXPECT_EQ(delegate->GetButtons(), TabSharingInfoBarDelegate::kStop | TabSharingInfoBarDelegate::kShareThisTabInstead); @@ -319,7 +319,7 @@ .focus_target = FocusTarget{GetGlobalId(1), favicon}}); EXPECT_STREQ(delegate->GetVectorIcon().name, - vector_icons::kScreenShareIcon.name); + vector_icons::kScreenShareOldIcon.name); // Correct number of buttons. EXPECT_EQ(delegate->GetButtons(), @@ -392,7 +392,7 @@ .capture_type = TabSharingInfoBarDelegate::TabShareType::CAST}; TabSharingInfoBarDelegate* const delegate = CreateDelegate(preferences); EXPECT_STREQ(delegate->GetVectorIcon().name, - vector_icons::kScreenShareIcon.name); + vector_icons::kScreenShareOldIcon.name); EXPECT_EQ(delegate->GetButtons(), TabSharingInfoBarDelegate::kStop | TabSharingInfoBarDelegate::kShareThisTabInstead); @@ -416,7 +416,7 @@ .capture_type = TabSharingInfoBarDelegate::TabShareType::CAST}; TabSharingInfoBarDelegate* const delegate = CreateDelegate(preferences); EXPECT_STREQ(delegate->GetVectorIcon().name, - vector_icons::kScreenShareIcon.name); + vector_icons::kScreenShareOldIcon.name); EXPECT_EQ(delegate->GetButtons(), TabSharingInfoBarDelegate::kStop); EXPECT_EQ(delegate->GetButtonLabel(TabSharingInfoBarDelegate::kStop), l10n_util::GetStringUTF16(IDS_TAB_CASTING_INFOBAR_STOP_BUTTON));
diff --git a/chrome/browser/ui/tabs/tab_features.cc b/chrome/browser/ui/tabs/tab_features.cc index 5b9bee5..442f8035 100644 --- a/chrome/browser/ui/tabs/tab_features.cc +++ b/chrome/browser/ui/tabs/tab_features.cc
@@ -31,6 +31,7 @@ #include "chrome/browser/task_manager/web_contents_tags.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/browser_actions.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/commerce/commerce_ui_tab_helper.h" #include "chrome/browser/ui/lens/lens_overlay_controller.h" #include "chrome/browser/ui/lens/lens_search_controller.h"
diff --git a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h index c74e9ee4..b1eb497 100644 --- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h +++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h
@@ -8,7 +8,6 @@ #include <string> #include "base/observer_list.h" -#include "chrome/browser/ui/browser.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model_browsertest.cc b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model_browsertest.cc index 95cee02..b6f32de 100644 --- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model_browsertest.cc +++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model_browsertest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "chrome/browser/ui/actions/chrome_action_id.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model_factory.h" #include "chrome/browser/ui/toolbar/toolbar_pref_names.h" #include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ui/views/autofill/payments/bnpl_issuer_view.cc b/chrome/browser/ui/views/autofill/payments/bnpl_issuer_view.cc index 635443f4..96a6ec2 100644 --- a/chrome/browser/ui/views/autofill/payments/bnpl_issuer_view.cc +++ b/chrome/browser/ui/views/autofill/payments/bnpl_issuer_view.cc
@@ -125,9 +125,7 @@ views::DISTANCE_UNRELATED_CONTROL_VERTICAL), layout_provider->GetDistanceMetric( views::DISTANCE_RELATED_LABEL_HORIZONTAL)))); - issuer_button->SetFocusRingCornerRadius(corner_radius); issuer_button->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); - issuer_button->SetInstallFocusRingOnFocus(true); // Make the highlight with rounded corners per the mocks. if (auto* ink_drop = views::InkDrop::Get(issuer_button.get())) { ink_drop->SetCreateHighlightCallback(base::BindRepeating(
diff --git a/chrome/browser/ui/views/autofill/payments/select_bnpl_issuer_dialog.cc b/chrome/browser/ui/views/autofill/payments/select_bnpl_issuer_dialog.cc index a96ee3744..f85bd74 100644 --- a/chrome/browser/ui/views/autofill/payments/select_bnpl_issuer_dialog.cc +++ b/chrome/browser/ui/views/autofill/payments/select_bnpl_issuer_dialog.cc
@@ -112,6 +112,9 @@ std::make_unique<BnplIssuerView>(controller_, this)); bnpl_issuer_view_->SetProperty(views::kElementIdentifierKey, SelectBnplIssuerDialog::kBnplIssuerView); + if (!bnpl_issuer_view_->children().empty()) { + SetInitiallyFocusedView(bnpl_issuer_view_->children()[0]); + } TextWithLink link_text = controller_.get()->GetLinkText(); TextLinkInfo link_info;
diff --git a/chrome/browser/ui/views/autofill/popup/custom_cursor_suppressor_browsertest.cc b/chrome/browser/ui/views/autofill/popup/custom_cursor_suppressor_browsertest.cc index dd8284d..de05f8ac 100644 --- a/chrome/browser/ui/views/autofill/popup/custom_cursor_suppressor_browsertest.cc +++ b/chrome/browser/ui/views/autofill/popup/custom_cursor_suppressor_browsertest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/autofill/popup/custom_cursor_suppressor.h" #include "chrome/browser/extensions/extension_browsertest.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window/public/browser_window_features.h" #include "chrome/browser/ui/views/side_panel/extensions/extension_side_panel_coordinator.h" #include "chrome/browser/ui/views/side_panel/extensions/extension_side_panel_manager.h"
diff --git a/chrome/browser/ui/views/autofill/popup/popup_base_view.cc b/chrome/browser/ui/views/autofill/popup/popup_base_view.cc index 059c4d9..7f40c18 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_base_view.cc +++ b/chrome/browser/ui/views/autofill/popup/popup_base_view.cc
@@ -16,6 +16,7 @@ #include "base/location.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/themes/theme_service.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/views/autofill/popup/custom_cursor_suppressor.h" #include "chrome/browser/ui/views/autofill/popup/popup_view_utils.h"
diff --git a/chrome/browser/ui/views/autofill/popup/popup_base_view.h b/chrome/browser/ui/views/autofill/popup/popup_base_view.h index 0a2f8f67..a8449d1 100644 --- a/chrome/browser/ui/views/autofill/popup/popup_base_view.h +++ b/chrome/browser/ui/views/autofill/popup/popup_base_view.h
@@ -15,7 +15,6 @@ #include "base/scoped_observation.h" #include "build/build_config.h" #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" -#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/views/autofill/popup/custom_cursor_suppressor.h" #include "chrome/browser/ui/views/autofill/popup/popup_row_view.h" #include "content/public/browser/web_contents.h" @@ -26,6 +25,8 @@ #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_observer.h" +class Browser; + namespace autofill { // Class that deals with the event handling for Autofill-style popups. This
diff --git a/chrome/browser/ui/views/autofill/update_address_profile_view.cc b/chrome/browser/ui/views/autofill/update_address_profile_view.cc index c3ad394..3958179f 100644 --- a/chrome/browser/ui/views/autofill/update_address_profile_view.cc +++ b/chrome/browser/ui/views/autofill/update_address_profile_view.cc
@@ -36,8 +36,10 @@ constexpr int kIconSize = 16; constexpr int kValuesLabelWidth = 190; -const gfx::VectorIcon& GetVectorIconForType(FieldType type) { +base::optional_ref<const gfx::VectorIcon> GetVectorIconForType(FieldType type) { switch (GetAddressUIComponentIconTypeForFieldType(type)) { + case AddressUIComponentIconType::kNoIcon: + return std::nullopt; case AddressUIComponentIconType::kName: return kAccountCircleIcon; case AddressUIComponentIconType::kAddress: @@ -46,8 +48,6 @@ return vector_icons::kEmailIcon; case AddressUIComponentIconType::kPhone: return vector_icons::kCallIcon; - case AddressUIComponentIconType::kNoIcon: - NOTREACHED(); } } @@ -95,8 +95,13 @@ label_view->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); auto icon_view = std::make_unique<views::ImageView>(); - icon_view->SetImage(ui::ImageModel::FromVectorIcon( - GetVectorIconForType(diff_entry.type), icon_color, kIconSize)); + base::optional_ref<const gfx::VectorIcon> icon_ref = + GetVectorIconForType(diff_entry.type); + + if (icon_ref.has_value()) { + icon_view->SetImage( + ui::ImageModel::FromVectorIcon(*icon_ref, icon_color, kIconSize)); + } // The container aligns the icon vertically in the middle of the first label // line, the icon size is expected to be smaller than the label height.
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_account_storage_move_dialog.cc b/chrome/browser/ui/views/bookmarks/bookmark_account_storage_move_dialog.cc index 1f56b0a..9188223 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_account_storage_move_dialog.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_account_storage_move_dialog.cc
@@ -63,12 +63,12 @@ CHECK_NE(is_local_node, bookmark_model->IsLocalOnlyNode(*target_folder)); int title_id = IDS_UPLOAD_MOVE_TO_ACCOUNT_DIALOG_TITLE; - std::u16string subtitle; + std::u16string body_text; switch (dialog_type) { case BookmarkAccountStorageMoveDialogType::kDownloadOrUpload: { title_id = is_local_node ? IDS_BOOKMARKS_MOVE_TO_ACCOUNT_DIALOG_TITLE : IDS_BOOKMARKS_MOVE_TO_DEVICE_DIALOG_TITLE; - subtitle = l10n_util::GetStringFUTF16( + body_text = l10n_util::GetStringFUTF16( is_local_node ? (node->is_folder() ? IDS_BOOKMARKS_MOVE_TO_ACCOUNT_DIALOG_FOLDER_SUBTITLE @@ -80,7 +80,7 @@ break; } case BookmarkAccountStorageMoveDialogType::kUpload: { - subtitle = l10n_util::GetStringFUTF16( + body_text = l10n_util::GetStringFUTF16( IDS_BOOKMARK_UPLOAD_MOVE_TO_ACCOUNT_DIALOG_SUBTITLE, node->GetTitle()); } @@ -96,7 +96,7 @@ ui::DialogModel::Builder builder; builder.SetInternalName("BookmarkAccountStorageMoveDialog") .SetTitle(l10n_util::GetStringUTF16(title_id)) - .SetSubtitle(subtitle) + .AddParagraph(ui::DialogModelLabel(body_text)) .AddOkButton(base::BindOnce(&bookmarks::BookmarkModel::Move, bookmark_model->AsWeakPtr(), node, target_folder, index)
diff --git a/chrome/browser/ui/views/commerce/price_insights_page_action_view_controller.cc b/chrome/browser/ui/views/commerce/price_insights_page_action_view_controller.cc index 526e474..f7c3276 100644 --- a/chrome/browser/ui/views/commerce/price_insights_page_action_view_controller.cc +++ b/chrome/browser/ui/views/commerce/price_insights_page_action_view_controller.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/commerce/price_insights_page_action_view_controller.h" #include "chrome/browser/ui/actions/chrome_action_id.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/commerce/commerce_ui_tab_helper.h" #include "chrome/browser/ui/tabs/public/tab_features.h" #include "chrome/browser/ui/views/commerce/price_insights_icon_view.h"
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 9bf889a..1581303 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -354,6 +354,7 @@ #include "chrome/browser/glic/glic_keyed_service.h" #include "chrome/browser/glic/glic_keyed_service_factory.h" #include "chrome/browser/glic/resources/grit/glic_browser_resources.h" +#include "chrome/browser/glic/widget/glic_widget.h" #include "chrome/browser/glic/widget/glic_window_controller.h" #include "ui/views/layout/box_layout_view.h" #endif
diff --git a/chrome/browser/ui/views/frame/browser_view_layout_unittest.cc b/chrome/browser/ui/views/frame/browser_view_layout_unittest.cc index 98eab73f..5a8bec0a 100644 --- a/chrome/browser/ui/views/frame/browser_view_layout_unittest.cc +++ b/chrome/browser/ui/views/frame/browser_view_layout_unittest.cc
@@ -6,10 +6,8 @@ #include <memory> -#include "base/containers/contains.h" -#include "base/containers/flat_set.h" +#include "base/containers/fixed_flat_set.h" #include "base/memory/raw_ptr.h" -#include "base/no_destructor.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" #include "chrome/browser/ui/views/frame/contents_layout_manager.h" @@ -85,14 +83,14 @@ } bool SupportsWindowFeature( const Browser::WindowFeature feature) const override { - static const base::NoDestructor<base::flat_set<Browser::WindowFeature>> - supported_features{{ + static constexpr auto kSupportedFeatures = + base::MakeFixedFlatSet<Browser::WindowFeature>({ Browser::FEATURE_TABSTRIP, Browser::FEATURE_TOOLBAR, Browser::FEATURE_LOCATIONBAR, Browser::FEATURE_BOOKMARKBAR, - }}; - return base::Contains(*supported_features, feature); + }); + return kSupportedFeatures.contains(feature); } gfx::NativeView GetHostViewForAnchoring() const override { return gfx::NativeView();
diff --git a/chrome/browser/ui/views/frame/contents_web_view.cc b/chrome/browser/ui/views/frame/contents_web_view.cc index 03827c4d..d80ac44 100644 --- a/chrome/browser/ui/views/frame/contents_web_view.cc +++ b/chrome/browser/ui/views/frame/contents_web_view.cc
@@ -34,12 +34,6 @@ SetProperty(views::kElementIdentifierKey, kContentsWebViewElementId); status_bubble_ = std::make_unique<StatusBubbleViews>(this); status_bubble_->Reposition(); - if (base::FeatureList::IsEnabled(ntp_features::kNtpFooter)) { - new_tab_footer_ = std::make_unique<new_tab_footer::NewTabFooterWebView>( - browser_context, this); - new_tab_footer_->Reposition(); - } - web_contents_close_handler_ = std::make_unique<WebContentsCloseHandler>(this); } @@ -106,10 +100,34 @@ views::WebView::SetWebContents(web_contents); if (web_contents == nullptr) { status_bubble_ = nullptr; - } else if (status_bubble_ == nullptr) { + if (new_tab_footer_) { + new_tab_footer_->CloseUI(); + new_tab_footer_ = nullptr; + } + // Early exit: Without web contents, views dependent on ContentsWebView's + // bounds cannot be properly created or positioned. These views will + // initialize later when valid web contents exist. + return; + } + + if (status_bubble_ == nullptr) { status_bubble_ = std::make_unique<StatusBubbleViews>(this); status_bubble_->Reposition(); } + + if (new_tab_footer_ == nullptr && + base::FeatureList::IsEnabled(ntp_features::kNtpFooter)) { + // TODO(crbug.com/409058788): Make this a sibling of ContentsWebView, rather + // than a child. That way the footer can be laid out underneath the + // ContentsWebView without having to remove ContentsWebView's assumption + // that it occupies 100% of whatever space has been allocated to it. + new_tab_footer_ = + AddChildView(std::make_unique<new_tab_footer::NewTabFooterWebView>( + GetBrowserContext(), this)); + // TODO(crbug.com/409056427): Only show the footer if the web contents being + // set is for a new tab page, close it otherwise. + new_tab_footer_->ShowUI(); + } } void ContentsWebView::UpdateBackgroundColor() {
diff --git a/chrome/browser/ui/views/frame/contents_web_view.h b/chrome/browser/ui/views/frame/contents_web_view.h index 70a2531..7667e69 100644 --- a/chrome/browser/ui/views/frame/contents_web_view.h +++ b/chrome/browser/ui/views/frame/contents_web_view.h
@@ -66,8 +66,7 @@ private: void UpdateBackgroundColor(); std::unique_ptr<StatusBubbleViews> status_bubble_ = nullptr; - std::unique_ptr<new_tab_footer::NewTabFooterWebView> new_tab_footer_ = - nullptr; + raw_ptr<new_tab_footer::NewTabFooterWebView> new_tab_footer_ = nullptr; std::unique_ptr<WebContentsCloseHandler> web_contents_close_handler_ = nullptr;
diff --git a/chrome/browser/ui/views/intent_picker/BUILD.gn b/chrome/browser/ui/views/intent_picker/BUILD.gn index f93ce0e..40e088e 100644 --- a/chrome/browser/ui/views/intent_picker/BUILD.gn +++ b/chrome/browser/ui/views/intent_picker/BUILD.gn
@@ -16,6 +16,7 @@ "//chrome/browser:browser_public_dependencies", "//chrome/browser/profiles:profile", "//chrome/browser/ui:ui_features", + "//chrome/browser/ui/browser_window", "//chrome/browser/ui/page_action:icon_type", "//chrome/browser/ui/views/page_action", "//chrome/browser/web_applications:features",
diff --git a/chrome/browser/ui/views/intent_picker/intent_picker_view_page_action_controller.cc b/chrome/browser/ui/views/intent_picker/intent_picker_view_page_action_controller.cc index ee0a7462..860728d 100644 --- a/chrome/browser/ui/views/intent_picker/intent_picker_view_page_action_controller.cc +++ b/chrome/browser/ui/views/intent_picker/intent_picker_view_page_action_controller.cc
@@ -7,6 +7,7 @@ #include "base/check_op.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/actions/chrome_action_id.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/page_action/page_action_icon_type.h" #include "chrome/browser/ui/tabs/public/tab_features.h" #include "chrome/browser/ui/ui_features.h" @@ -45,7 +46,9 @@ kActionShowIntentPicker, l10n_util::GetStringUTF16(IDS_INTENT_CHIP_OPEN_IN_APP)); page_action_controller->Show(kActionShowIntentPicker); - page_action_controller->ShowSuggestionChip(kActionShowIntentPicker); + page_action_controller->ShowSuggestionChip(kActionShowIntentPicker, { + .should_animate = false, + }); } else { page_action_controller->Show(kActionShowIntentPicker); }
diff --git a/chrome/browser/ui/views/location_bar/intent_chip_button_test_base.h b/chrome/browser/ui/views/location_bar/intent_chip_button_test_base.h index 6020f7fd..03e4ddb 100644 --- a/chrome/browser/ui/views/location_bar/intent_chip_button_test_base.h +++ b/chrome/browser/ui/views/location_bar/intent_chip_button_test_base.h
@@ -10,7 +10,6 @@ #include "base/feature_list.h" #include "chrome/browser/apps/link_capturing/link_capturing_feature_test_support.h" #include "chrome/browser/ui/actions/chrome_action_id.h" -#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/location_bar/intent_chip_button.h" #include "chrome/browser/ui/views/page_action/page_action_view.h" #include "ui/views/controls/button/button.h"
diff --git a/chrome/browser/ui/views/media_router/cast_dialog_view.h b/chrome/browser/ui/views/media_router/cast_dialog_view.h index 9cf19ee0..7c80f248 100644 --- a/chrome/browser/ui/views/media_router/cast_dialog_view.h +++ b/chrome/browser/ui/views/media_router/cast_dialog_view.h
@@ -12,7 +12,6 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/media_router/cast_dialog_controller.h" #include "chrome/browser/ui/views/controls/hover_button.h" #include "chrome/browser/ui/views/media_router/cast_dialog_access_code_cast_button.h"
diff --git a/chrome/browser/ui/views/new_tab_footer/BUILD.gn b/chrome/browser/ui/views/new_tab_footer/BUILD.gn index c6a7d0a..864c3de1 100644 --- a/chrome/browser/ui/views/new_tab_footer/BUILD.gn +++ b/chrome/browser/ui/views/new_tab_footer/BUILD.gn
@@ -11,7 +11,13 @@ ] deps = [ - "//skia", + "//base:base", + "//chrome/browser/profiles:profile", + "//chrome/browser/resources/new_tab_footer:resources_grit", + "//chrome/browser/ui/webui/new_tab_footer", + "//chrome/browser/ui/webui/top_chrome", + "//chrome/common", + "//content/public/browser", "//ui/base", "//ui/views", "//ui/views/controls/webview",
diff --git a/chrome/browser/ui/views/new_tab_footer/footer_web_view.cc b/chrome/browser/ui/views/new_tab_footer/footer_web_view.cc index 800766e6..27a42f7 100644 --- a/chrome/browser/ui/views/new_tab_footer/footer_web_view.cc +++ b/chrome/browser/ui/views/new_tab_footer/footer_web_view.cc
@@ -4,9 +4,12 @@ #include "chrome/browser/ui/views/new_tab_footer/footer_web_view.h" -#include "third_party/skia/include/core/SkColor.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.h" +#include "chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h" +#include "chrome/common/webui_url_constants.h" +#include "chrome/grit/generated_resources.h" #include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/views/background.h" namespace { constexpr int kFooterHeight = 56; @@ -18,25 +21,39 @@ content::BrowserContext* browser_context, views::View* base_view) : views::WebView(browser_context), base_view_(base_view) { - base_view_->AddChildView(this); - SetPaintToLayer(); - // TODO(crbug.com/409056427): Add conditions for visibility. - SetVisible(true); - // TODO(crbug.com/409054648): Set background color in the hosted WebUI - // instead. - SetBackground(views::CreateSolidBackground(SK_ColorBLACK)); + contents_wrapper_ = std::make_unique<WebUIContentsWrapperT<NewTabFooterUI>>( + GURL(chrome::kChromeUINewTabFooterURL), + Profile::FromBrowserContext(browser_context), IDS_NEW_TAB_FOOTER_NAME, + /*esc_closes_ui=*/false); + contents_wrapper_->SetHost(weak_factory_.GetWeakPtr()); + SetWebContents(contents_wrapper_->web_contents()); +} + +NewTabFooterWebView::~NewTabFooterWebView() { + if (!contents_wrapper_) { + return; + } + contents_wrapper_->web_contents()->WasHidden(); + contents_wrapper_->SetHost(nullptr); + contents_wrapper_ = nullptr; } void NewTabFooterWebView::Reposition() { - gfx::Rect base_view_bounds = base_view_->GetLocalBounds(); - // TODO(crbug.com/409058788): Resize the base_view_ so that the footer view - // can show inside the base view, then set y equal to kFooterHeight - - // base_view_bounds.height(). - SetBounds(base_view_bounds.x(), base_view_bounds.height(), - base_view_bounds.width(), kFooterHeight); + gfx::Rect available_rect = base_view_->GetContentsBounds(); + SetBounds(available_rect.x(), available_rect.height() - kFooterHeight, + available_rect.width(), kFooterHeight); } -NewTabFooterWebView::~NewTabFooterWebView() = default; +void NewTabFooterWebView::ShowUI() { + Reposition(); + SetVisible(true); + contents_wrapper_->web_contents()->WasShown(); +} + +void NewTabFooterWebView::CloseUI() { + SetVisible(false); + contents_wrapper_->web_contents()->WasHidden(); +} BEGIN_METADATA(NewTabFooterWebView) END_METADATA
diff --git a/chrome/browser/ui/views/new_tab_footer/footer_web_view.h b/chrome/browser/ui/views/new_tab_footer/footer_web_view.h index 6b25f11..c12a6bb6 100644 --- a/chrome/browser/ui/views/new_tab_footer/footer_web_view.h +++ b/chrome/browser/ui/views/new_tab_footer/footer_web_view.h
@@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_NEW_TAB_FOOTER_FOOTER_WEB_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_NEW_TAB_FOOTER_FOOTER_WEB_VIEW_H_ +#include "base/memory/weak_ptr.h" +#include "chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/webview/webview.h" @@ -12,11 +14,13 @@ class View; } // namespace views +class WebUIContentsWrapper; + namespace new_tab_footer { // NewTabFooterWebView is used to present the WebContents of the New Tab Footer. -// TODO(crbug.com/409054648): Embed footer WebContents. -class NewTabFooterWebView : public views::WebView { +class NewTabFooterWebView : public views::WebView, + public WebUIContentsWrapper::Host { METADATA_HEADER(NewTabFooterWebView, views::WebView) public: @@ -28,8 +32,15 @@ void Reposition(); + // WebUIContentsWrapper::Host: + void ShowUI() override; + void CloseUI() override; + private: + std::unique_ptr<WebUIContentsWrapper> contents_wrapper_ = nullptr; raw_ptr<views::View> base_view_; + + base::WeakPtrFactory<NewTabFooterWebView> weak_factory_{this}; }; } // namespace new_tab_footer
diff --git a/chrome/browser/ui/views/page_action/BUILD.gn b/chrome/browser/ui/views/page_action/BUILD.gn index 0dc7df0..50ff517 100644 --- a/chrome/browser/ui/views/page_action/BUILD.gn +++ b/chrome/browser/ui/views/page_action/BUILD.gn
@@ -24,6 +24,7 @@ sources = [ "page_action_container_view.cc", "page_action_controller.cc", + "page_action_enums.h", "page_action_metrics_recorder.cc", "page_action_metrics_recorder.h", "page_action_model.cc",
diff --git a/chrome/browser/ui/views/page_action/page_action_controller.cc b/chrome/browser/ui/views/page_action/page_action_controller.cc index 30519821..ba263bb 100644 --- a/chrome/browser/ui/views/page_action/page_action_controller.cc +++ b/chrome/browser/ui/views/page_action/page_action_controller.cc
@@ -48,7 +48,7 @@ CreateMetricsRecorder(tab_interface, properties_provider.GetProperties(id), FindPageActionModel(id)); - metrics_recorders_.push_back(std::move(metrics_recorder)); + metrics_recorders_.emplace(id, std::move(metrics_recorder)); } if (pinned_actions_observation_.GetSource()) { PinnedActionsModelChanged(); @@ -219,6 +219,20 @@ } } +base::RepeatingCallback<void(PageActionTrigger)> +PageActionController::GetClickCallback(actions::ActionId action_id) { + return base::BindRepeating(&PageActionController::RecordClickMetric, + weak_factory_.GetWeakPtr(), action_id); +} + +void PageActionController::RecordClickMetric(actions::ActionId action_id, + PageActionTrigger trigger_source) { + auto id_and_recorder = metrics_recorders_.find(action_id); + CHECK(id_and_recorder != metrics_recorders_.end()); + CHECK(id_and_recorder->second.get()); + id_and_recorder->second->RecordClick(trigger_source); +} + std::ostream& operator<<(std::ostream& os, const SuggestionChipConfig& config) { os << "{ should_animate: " << config.should_animate << ", should_announce_chip: " << config.should_announce_chip << " }";
diff --git a/chrome/browser/ui/views/page_action/page_action_controller.h b/chrome/browser/ui/views/page_action/page_action_controller.h index d8c5ff4..d711f72 100644 --- a/chrome/browser/ui/views/page_action/page_action_controller.h +++ b/chrome/browser/ui/views/page_action/page_action_controller.h
@@ -11,11 +11,13 @@ #include <string> #include <vector> +#include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h" #include "chrome/browser/ui/views/page_action/page_action_metrics_recorder.h" #include "chrome/browser/ui/views/page_action/page_action_properties_provider.h" +#include "chrome/browser/ui/views/page_action/page_action_triggers.h" #include "components/tabs/public/tab_interface.h" #include "ui/actions/action_id.h" @@ -139,9 +141,17 @@ return base::PassKey<PageActionController>(); } + // Provides a metric recording callback to the caller. The callback won't run + // if the page action controller is destroyed. + base::RepeatingCallback<void(PageActionTrigger)> GetClickCallback( + actions::ActionId action_id); + private: using PageActionModelsMap = std::map<actions::ActionId, std::unique_ptr<PageActionModelInterface>>; + using PageActionMetricsRecordersMap = + std::map<actions::ActionId, + std::unique_ptr<PageActionMetricsRecorderInterface>>; // Creates a page action model for the given id, and initializes it's values. void Register(actions::ActionId action_id, bool is_tab_active); @@ -163,6 +173,10 @@ const PageActionProperties& properties, PageActionModelInterface& model); + // Issues internally a metric recording for the provided `action_id`. + void RecordClickMetric(actions::ActionId action_id, + PageActionTrigger trigger_source); + const raw_ptr<PageActionModelFactory> page_action_model_factory_ = nullptr; const raw_ptr<PageActionMetricsRecorderFactory> page_action_metrics_recorder_factory_ = nullptr; @@ -171,8 +185,7 @@ // Metrics recorders associated with ephemeral page actions. // Each recorder handles logging UMA metrics for one specific action id. - std::vector<std::unique_ptr<PageActionMetricsRecorderInterface>> - metrics_recorders_; + PageActionMetricsRecordersMap metrics_recorders_; base::ScopedObservation<PinnedToolbarActionsModel, PinnedToolbarActionsModel::Observer> @@ -180,6 +193,8 @@ base::CallbackListSubscription tab_activated_callback_subscription_; base::CallbackListSubscription tab_deactivated_callback_subscription_; + + base::WeakPtrFactory<PageActionController> weak_factory_{this}; }; } // namespace page_actions
diff --git a/chrome/browser/ui/views/page_action/page_action_controller_unittest.cc b/chrome/browser/ui/views/page_action/page_action_controller_unittest.cc index 37cb2b4..28fa9b7b 100644 --- a/chrome/browser/ui/views/page_action/page_action_controller_unittest.cc +++ b/chrome/browser/ui/views/page_action/page_action_controller_unittest.cc
@@ -9,10 +9,13 @@ #include <string> #include "base/callback_list.h" +#include "base/metrics/histogram_base.h" #include "base/scoped_observation.h" +#include "base/test/metrics/histogram_tester.h" #include "chrome/browser/ui/tabs/test/mock_tab_interface.h" #include "chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h" #include "chrome/browser/ui/toolbar/toolbar_pref_names.h" +#include "chrome/browser/ui/views/page_action/page_action_enums.h" #include "chrome/browser/ui/views/page_action/page_action_model.h" #include "chrome/browser/ui/views/page_action/page_action_model_observer.h" #include "chrome/browser/ui/views/page_action/test_support/fake_tab_interface.h" @@ -386,6 +389,44 @@ EXPECT_EQ(kText, observer.text()); } +TEST_F(PageActionControllerTest, NotifyActionClickedLogsHistogram) { + base::HistogramTester histogram_tester; + + controller()->Initialize(*tab_interface(), {kFirstActionItemId}, + properties_provider_); + + const std::string general_histogram = "PageActionController.Icon.CTR2"; + const std::string specific_histogram = base::StrCat( + {"PageActionController.", + properties_provider_.GetProperties(kFirstActionItemId).histogram_name, + ".Icon.CTR2"}); + + histogram_tester.ExpectTotalCount(general_histogram, 0); + histogram_tester.ExpectTotalCount(specific_histogram, 0); + + controller() + ->GetClickCallback(kFirstActionItemId) + .Run(PageActionTrigger::kMouse); + + histogram_tester.ExpectTotalCount(general_histogram, 1); + histogram_tester.ExpectUniqueSample(general_histogram, + PageActionCTREvent::kClicked, 1); + histogram_tester.ExpectTotalCount(specific_histogram, 1); + histogram_tester.ExpectUniqueSample(specific_histogram, + PageActionCTREvent::kClicked, 1); + + controller() + ->GetClickCallback(kFirstActionItemId) + .Run(PageActionTrigger::kKeyboard); + + histogram_tester.ExpectTotalCount(general_histogram, 2); + histogram_tester.ExpectBucketCount(general_histogram, + PageActionCTREvent::kClicked, 2); + histogram_tester.ExpectTotalCount(specific_histogram, 2); + histogram_tester.ExpectBucketCount(specific_histogram, + PageActionCTREvent::kClicked, 2); +} + class PageActionControllerMockModelTest : public ::testing::Test { public: PageActionControllerMockModelTest()
diff --git a/chrome/browser/ui/views/page_action/page_action_enums.h b/chrome/browser/ui/views/page_action/page_action_enums.h new file mode 100644 index 0000000..a41cb9e --- /dev/null +++ b/chrome/browser/ui/views/page_action/page_action_enums.h
@@ -0,0 +1,20 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_ACTION_PAGE_ACTION_ENUMS_H_ +#define CHROME_BROWSER_UI_VIEWS_PAGE_ACTION_PAGE_ACTION_ENUMS_H_ + +namespace page_actions { + +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class PageActionCTREvent { + kShown = 0, + kClicked, + kMaxValue = kClicked, +}; + +} // namespace page_actions + +#endif // CHROME_BROWSER_UI_VIEWS_PAGE_ACTION_PAGE_ACTION_ENUMS_H_
diff --git a/chrome/browser/ui/views/page_action/page_action_interactive_uitest.cc b/chrome/browser/ui/views/page_action/page_action_interactive_uitest.cc index 5c2d214..23db3fde 100644 --- a/chrome/browser/ui/views/page_action/page_action_interactive_uitest.cc +++ b/chrome/browser/ui/views/page_action/page_action_interactive_uitest.cc
@@ -8,6 +8,7 @@ #include "chrome/browser/ui/actions/chrome_action_id.h" #include "chrome/browser/ui/browser_actions.h" #include "chrome/browser/ui/browser_commands.h" +#include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/tabs/public/tab_features.h" #include "chrome/browser/ui/test/test_browser_ui.h" #include "chrome/browser/ui/ui_features.h" @@ -554,6 +555,138 @@ histogram_tester.ExpectTotalCount("PageActionController.ActionTypeShown2", 4); } +// Verifies that "…Icon.CTR2" histograms emit kShown once-per-context. +// The test mirrors EphemeralPageActionUmaLoggedOncePerContext. +IN_PROC_BROWSER_TEST_F(PageActionInteractiveUiTest, + CTR2HistogramsLoggedOncePerContext) { + base::HistogramTester histogram_tester; + + constexpr char kGeneralHistogram[] = "PageActionController.Icon.CTR2"; + constexpr char kTranslateHistogram[] = + "PageActionController.Translate.Icon.CTR2"; + + // 1. Initial page-context (tab[0], first navigation). + ShowPageAction(kActionShowTranslate); + histogram_tester.ExpectUniqueSample(kGeneralHistogram, + PageActionCTREvent::kShown, 1); + histogram_tester.ExpectUniqueSample(kTranslateHistogram, + PageActionCTREvent::kShown, 1); + + // 2. Hide + re-show in the SAME context → no additional logging. + HidePageAction(kActionShowTranslate); + ShowPageAction(kActionShowTranslate); + histogram_tester.ExpectTotalCount(kGeneralHistogram, 1); + histogram_tester.ExpectTotalCount(kTranslateHistogram, 1); + + // 3. New navigation in the SAME tab → new context, logs again. + ASSERT_TRUE( + ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings"))); + ShowPageAction(kActionShowTranslate); + histogram_tester.ExpectTotalCount(kGeneralHistogram, 2); + histogram_tester.ExpectBucketCount(kTranslateHistogram, + PageActionCTREvent::kShown, 2); + + // 4. Open a new tab → brand-new context. + ASSERT_TRUE( + AddTabAtIndex(1, GURL("chrome://version"), ui::PAGE_TRANSITION_LINK)); + browser()->tab_strip_model()->ActivateTabAt(1); + + // 4-a) First show of Translate in tab[1] logs again. + ShowPageAction(kActionShowTranslate); + histogram_tester.ExpectTotalCount(kGeneralHistogram, 3); + histogram_tester.ExpectBucketCount(kTranslateHistogram, + PageActionCTREvent::kShown, 3); + + browser()->tab_strip_model()->ActivateTabAt(0); + ShowPageAction(kActionShowTranslate); + histogram_tester.ExpectTotalCount(kGeneralHistogram, 3); + histogram_tester.ExpectBucketCount(kTranslateHistogram, + PageActionCTREvent::kShown, 3); +} + +class PageActionMetricsInteractiveUiTest : public InteractiveBrowserTest, + public PageActionUiTestBase { + public: + PageActionMetricsInteractiveUiTest() { + scoped_feature_list_.InitAndEnableFeatureWithParameters( + features::kPageActionsMigration, + { + {features::kPageActionsMigrationZoom.name, "true"}, + }); + } + + PageActionMetricsInteractiveUiTest( + const PageActionMetricsInteractiveUiTest&) = delete; + PageActionMetricsInteractiveUiTest& operator=( + const PageActionInteractiveUiTest&) = delete; + ~PageActionMetricsInteractiveUiTest() override = default; + + // PageActionUiTestBase: + Browser* GetBrowser() const override { return browser(); } + + protected: + void SetZoomLevel(content::PageZoom zoom_level) { + chrome::Zoom(GetBrowser(), zoom_level); + } + + auto DoZoomIn() { + return Do([&]() { SetZoomLevel(content::PAGE_ZOOM_IN); }); + } + + auto DoZoomOut() { + return Do([&]() { SetZoomLevel(content::PAGE_ZOOM_OUT); }); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(PageActionMetricsInteractiveUiTest, ClickHistogramLogs) { + base::HistogramTester histogram_tester; + const char* general_histogram = "PageActionController.Icon.CTR2"; + const std::string specific_histogram = "PageActionController.Zoom.Icon.CTR2"; + + RunTestSequence( + DoZoomIn(), WaitForShow(kActionItemZoomElementId), + + CheckResult( + [&]() { return histogram_tester.GetTotalSum(general_histogram); }, + testing::Eq(0)), + CheckResult( + [&]() { return histogram_tester.GetTotalSum(specific_histogram); }, + testing::Eq(0)), + + PressButton(kActionItemZoomElementId), + + CheckResult( + [&]() { + return histogram_tester.GetBucketCount( + general_histogram, PageActionCTREvent::kClicked); + }, + testing::Eq(1)), + CheckResult( + [&]() { + return histogram_tester.GetBucketCount( + specific_histogram, PageActionCTREvent::kClicked); + }, + testing::Eq(1)), + + PressButton(kActionItemZoomElementId), + + CheckResult( + [&]() { + return histogram_tester.GetBucketCount( + general_histogram, PageActionCTREvent::kClicked); + }, + testing::Eq(2)), + CheckResult( + [&]() { + return histogram_tester.GetBucketCount( + specific_histogram, PageActionCTREvent::kClicked); + }, + testing::Eq(2))); +} + // TODO(crbug.com/411078148): Re-enable on Mac. #if BUILDFLAG(IS_MAC) #define MAYBE_SuggestionChipWithAnnouncement \
diff --git a/chrome/browser/ui/views/page_action/page_action_metric_recorder_unittest.cc b/chrome/browser/ui/views/page_action/page_action_metric_recorder_unittest.cc index 1293d58f..9ded5ef 100644 --- a/chrome/browser/ui/views/page_action/page_action_metric_recorder_unittest.cc +++ b/chrome/browser/ui/views/page_action/page_action_metric_recorder_unittest.cc
@@ -5,6 +5,7 @@ #include <memory> #include "base/test/metrics/histogram_tester.h" +#include "chrome/browser/ui/views/page_action/page_action_enums.h" #include "chrome/browser/ui/views/page_action/page_action_metrics_recorder.h" #include "chrome/browser/ui/views/page_action/page_action_model.h" #include "chrome/browser/ui/views/page_action/page_action_model_observer.h" @@ -29,6 +30,10 @@ protected: PageActionMetricsRecorderTest() : tab_(&profile_) {} + ~PageActionMetricsRecorderTest() override { + task_environment_.RunUntilIdle(); + } + void SetUp() override { // By default, let the page action be "not visible." Tests can override. ON_CALL(mock_model_, GetVisible()).WillByDefault(Return(false)); @@ -37,12 +42,17 @@ void CreateRecorder(bool is_ephemeral) { properties_.type = PageActionIconType::kLensOverlay; properties_.is_ephemeral = is_ephemeral; + properties_.histogram_name = "LensOverlay"; recorder_ = std::make_unique<PageActionMetricsRecorder>(tab_, properties_, mock_model_); } void FireModelChanged() { recorder_->OnPageActionModelChanged(mock_model_); } + void SimulateClick(PageActionTrigger trigger) { + recorder_->RecordClick(trigger); + } + protected: content::BrowserTaskEnvironment task_environment_; TestingProfile profile_; @@ -110,5 +120,108 @@ histogram_tester.ExpectTotalCount("PageActionController.ActionTypeShown2", 0); } +TEST_F(PageActionMetricsRecorderTest, RecordShownMetricsGeneralAndSpecific) { + base::HistogramTester histogram_tester; + CreateRecorder(/*is_ephemeral=*/true); + + const std::string general_histogram = "PageActionController.Icon.CTR2"; + const std::string specific_histogram = base::StrCat( + {"PageActionController.", properties_.histogram_name, ".Icon.CTR2"}); + + // First navigation. + GURL url1("https://www.example.com/"); + content::WebContentsTester::For(tab_.GetContents())->NavigateAndCommit(url1); + ON_CALL(mock_model_, GetVisible()).WillByDefault(Return(true)); + + // First visibility → record once for each histogram with kShown. + FireModelChanged(); + histogram_tester.ExpectTotalCount(general_histogram, 1); + histogram_tester.ExpectUniqueSample(general_histogram, + PageActionCTREvent::kShown, 1); + histogram_tester.ExpectTotalCount(specific_histogram, 1); + histogram_tester.ExpectUniqueSample(specific_histogram, + PageActionCTREvent::kShown, 1); + + // Same URL, second visibility → no additional records. + FireModelChanged(); + histogram_tester.ExpectTotalCount(general_histogram, 1); + histogram_tester.ExpectTotalCount(specific_histogram, 1); + + // New navigation. + GURL url2("https://www.another-site.org/"); + content::WebContentsTester::For(tab_.GetContents())->NavigateAndCommit(url2); + FireModelChanged(); + + // Should now have two kShown samples (one per distinct URL) in both + // histograms. + histogram_tester.ExpectTotalCount(general_histogram, 2); + histogram_tester.ExpectBucketCount(general_histogram, + PageActionCTREvent::kShown, 2); + histogram_tester.ExpectTotalCount(specific_histogram, 2); + histogram_tester.ExpectBucketCount(specific_histogram, + PageActionCTREvent::kShown, 2); +} + +TEST_F(PageActionMetricsRecorderTest, NoShownMetricsWhenNotEphemeral) { + base::HistogramTester histogram_tester; + CreateRecorder(/*is_ephemeral=*/false); + + const std::string general_histogram = "PageActionController.Icon.CTR2"; + const std::string specific_histogram = base::StrCat( + {"PageActionController.", properties_.histogram_name, ".Icon.CTR2"}); + + GURL url("https://www.example.com/"); + content::WebContentsTester::For(tab_.GetContents())->NavigateAndCommit(url); + ON_CALL(mock_model_, GetVisible()).WillByDefault(Return(true)); + + FireModelChanged(); + + // Because the page action is *not* ephemeral, no kShown samples are recorded. + histogram_tester.ExpectTotalCount(general_histogram, 0); + histogram_tester.ExpectTotalCount(specific_histogram, 0); +} + +TEST_F(PageActionMetricsRecorderTest, RecordClickMetric) { + base::HistogramTester histogram_tester; + CreateRecorder(/*is_ephemeral=*/true); + + const std::string general_histogram = "PageActionController.Icon.CTR2"; + const std::string specific_histogram = base::StrCat( + {"PageActionController.", properties_.histogram_name, ".Icon.CTR2"}); + + histogram_tester.ExpectTotalCount(general_histogram, 0); + histogram_tester.ExpectTotalCount(specific_histogram, 0); + + SimulateClick(PageActionTrigger::kMouse); + + // Verify both histograms logged once with kClicked value. + histogram_tester.ExpectTotalCount(general_histogram, 1); + histogram_tester.ExpectUniqueSample(general_histogram, + PageActionCTREvent::kClicked, 1); + histogram_tester.ExpectTotalCount(specific_histogram, 1); + histogram_tester.ExpectUniqueSample(specific_histogram, + PageActionCTREvent::kClicked, 1); + + SimulateClick(PageActionTrigger::kKeyboard); + + // Verify both histograms logged again (total 2), check bucket count. + histogram_tester.ExpectTotalCount(general_histogram, 2); + histogram_tester.ExpectBucketCount(general_histogram, + PageActionCTREvent::kClicked, 2); + histogram_tester.ExpectTotalCount(specific_histogram, 2); + histogram_tester.ExpectBucketCount(specific_histogram, + PageActionCTREvent::kClicked, 2); + + SimulateClick(PageActionTrigger::kGesture); + + // Verify both histograms logged again (total 3), check bucket count. + histogram_tester.ExpectTotalCount(general_histogram, 3); + histogram_tester.ExpectBucketCount(general_histogram, + PageActionCTREvent::kClicked, 3); + histogram_tester.ExpectTotalCount(specific_histogram, 3); + histogram_tester.ExpectBucketCount(specific_histogram, + PageActionCTREvent::kClicked, 3); +} + } // namespace } // namespace page_actions
diff --git a/chrome/browser/ui/views/page_action/page_action_metrics_recorder.cc b/chrome/browser/ui/views/page_action/page_action_metrics_recorder.cc index 2109545..015a4fa3 100644 --- a/chrome/browser/ui/views/page_action/page_action_metrics_recorder.cc +++ b/chrome/browser/ui/views/page_action/page_action_metrics_recorder.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/page_action/page_action_metrics_recorder.h" #include "base/metrics/histogram_functions.h" +#include "chrome/browser/ui/views/page_action/page_action_enums.h" #include "chrome/browser/ui/views/page_action/page_action_model.h" #include "chrome/browser/ui/views/page_action/page_action_properties_provider.h" #include "components/tabs/public/tab_interface.h" @@ -19,6 +20,7 @@ PageActionModelInterface& model) : is_ephemeral_(properties.is_ephemeral), page_action_type_(properties.type), + histogram_name_(properties.histogram_name), tab_interface_(tab_interface) { scoped_observation_.Observe(&model); } @@ -57,8 +59,23 @@ } page_action_recorded_urls_.insert(current_url); + + base::UmaHistogramEnumeration("PageActionController.Icon.CTR2", + PageActionCTREvent::kShown); + base::UmaHistogramEnumeration( + base::StrCat({"PageActionController.", histogram_name_, ".Icon.CTR2"}), + PageActionCTREvent::kShown); base::UmaHistogramEnumeration("PageActionController.ActionTypeShown2", page_action_type_); } +void PageActionMetricsRecorder::RecordClick( + PageActionTrigger /*trigger_source*/) { + base::UmaHistogramEnumeration("PageActionController.Icon.CTR2", + PageActionCTREvent::kClicked); + base::UmaHistogramEnumeration( + base::StrCat({"PageActionController.", histogram_name_, ".Icon.CTR2"}), + PageActionCTREvent::kClicked); +} + } // namespace page_actions
diff --git a/chrome/browser/ui/views/page_action/page_action_metrics_recorder.h b/chrome/browser/ui/views/page_action/page_action_metrics_recorder.h index 6f5b247..47e672b 100644 --- a/chrome/browser/ui/views/page_action/page_action_metrics_recorder.h +++ b/chrome/browser/ui/views/page_action/page_action_metrics_recorder.h
@@ -11,6 +11,7 @@ #include "base/scoped_observation.h" #include "chrome/browser/ui/page_action/page_action_icon_type.h" #include "chrome/browser/ui/views/page_action/page_action_model_observer.h" +#include "chrome/browser/ui/views/page_action/page_action_triggers.h" #include "url/gurl.h" namespace tabs { @@ -27,6 +28,9 @@ public: PageActionMetricsRecorderInterface() = default; virtual ~PageActionMetricsRecorderInterface() = default; + + // Records a click event for the page action. + virtual void RecordClick(PageActionTrigger trigger_source) {} }; class PageActionMetricsRecorderFactory { @@ -54,6 +58,9 @@ ~PageActionMetricsRecorder() override; + // PageActionMetricsRecorderInterface: + void RecordClick(PageActionTrigger trigger_source) override; + // PageActionModelObserver void OnPageActionModelChanged(const PageActionModelInterface& model) override; void OnPageActionModelWillBeDeleted( @@ -69,6 +76,7 @@ // Properties associated with the specific page action being observed. bool is_ephemeral_; PageActionIconType page_action_type_; + std::string histogram_name_; // The TabInterface is guaranteed valid for this object’s lifetime. const raw_ref<tabs::TabInterface> tab_interface_;
diff --git a/chrome/browser/ui/views/page_action/page_action_view.cc b/chrome/browser/ui/views/page_action/page_action_view.cc index 3be7544..3d49e2a9 100644 --- a/chrome/browser/ui/views/page_action/page_action_view.cc +++ b/chrome/browser/ui/views/page_action/page_action_view.cc
@@ -71,6 +71,8 @@ observation_.Reset(); action_item_controller_subscription_ = {}; if (controller) { + click_callback_ = + controller->GetClickCallback(action_item_->GetActionId().value()); controller->AddObserver(action_item_->GetActionId().value(), observation_); // TODO(crbug.com/388524315): Have the controller manage its own ActionItem // observation. See bug for more explanation. @@ -171,6 +173,9 @@ static_cast<std::underlying_type_t<PageActionTrigger>>( trigger_source)) .Build()); + + CHECK(click_callback_); + click_callback_.Run(trigger_source); } void PageActionView::UpdateIconImage() {
diff --git a/chrome/browser/ui/views/page_action/page_action_view.h b/chrome/browser/ui/views/page_action/page_action_view.h index d21f43e1..6e1ec60 100644 --- a/chrome/browser/ui/views/page_action/page_action_view.h +++ b/chrome/browser/ui/views/page_action/page_action_view.h
@@ -7,10 +7,13 @@ #include "base/callback_list.h" #include "base/functional/callback.h" +#include "base/functional/callback_forward.h" +#include "base/functional/callback_helpers.h" #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" #include "chrome/browser/ui/views/page_action/page_action_model_observer.h" +#include "chrome/browser/ui/views/page_action/page_action_triggers.h" #include "ui/actions/actions.h" #include "ui/base/interaction/element_identifier.h" #include "ui/events/event.h" @@ -105,6 +108,11 @@ // Client-provided callbacks for changes to chip state. base::RepeatingCallbackList<void(PageActionView*)> chip_visibility_changed_callbacks_; + + // Used to record click event histogram. It's initialized to base::DoNothing() + // for testing purpose. + base::RepeatingCallback<void(PageActionTrigger)> click_callback_ = + base::DoNothing(); }; } // namespace page_actions
diff --git a/chrome/browser/ui/views/privacy_sandbox/DIR_METADATA b/chrome/browser/ui/views/privacy_sandbox/DIR_METADATA index cb1e73c9..aff2c86 100644 --- a/chrome/browser/ui/views/privacy_sandbox/DIR_METADATA +++ b/chrome/browser/ui/views/privacy_sandbox/DIR_METADATA
@@ -3,5 +3,5 @@ } team_email: "koilos@google.com" buganizer_public: { - component_id: 1697287 + component_id: 1706459 }
diff --git a/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc b/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc index 5842039..eb085c0 100644 --- a/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc +++ b/chrome/browser/ui/views/profiles/avatar_toolbar_button.cc
@@ -439,6 +439,15 @@ return; } +#if !BUILDFLAG(IS_CHROMEOS) + if (browser_->window()->IsFeaturePromoActive( + feature_engagement::kIPHPasswordsSavePrimingPromoFeature)) { + browser_->window()->NotifyFeaturePromoFeatureUsed( + feature_engagement::kIPHPasswordsSavePrimingPromoFeature, + FeaturePromoFeatureUsedAction::kClosePromoIfPresent); + } +#endif + if (!explicit_button_pressed_action_.is_null()) { explicit_button_pressed_action_.Run(); return;
diff --git a/chrome/browser/ui/views/side_panel/customize_chrome/side_panel_controller_views.cc b/chrome/browser/ui/views/side_panel/customize_chrome/side_panel_controller_views.cc index 3d35370..5254f69b 100644 --- a/chrome/browser/ui/views/side_panel/customize_chrome/side_panel_controller_views.cc +++ b/chrome/browser/ui/views/side_panel/customize_chrome/side_panel_controller_views.cc
@@ -12,6 +12,7 @@ #include "chrome/browser/search/background/ntp_custom_background_service_factory.h" #include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/browser_window/public/browser_window_features.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/tabs/public/tab_features.h" #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/side_panel/side_panel_coordinator.h"
diff --git a/chrome/browser/ui/views/tabs/dragging/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/dragging/tab_drag_controller_interactive_uitest.cc index 485a8fb..e7d43ee 100644 --- a/chrome/browser/ui/views/tabs/dragging/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/dragging/tab_drag_controller_interactive_uitest.cc
@@ -5488,7 +5488,7 @@ }; // Flaky. https://crbug.com/40748225 -#if BUILDFLAG(IS_MAC) +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) #define MAYBE_DragBetweenSplitTab DISABLED_DragBetweenSplitTab #else #define MAYBE_DragBetweenSplitTab DragBetweenSplitTab
diff --git a/chrome/browser/ui/views/tabs/groups/manage_sharing_row.cc b/chrome/browser/ui/views/tabs/groups/manage_sharing_row.cc index 8aed89e..0dbf40bf 100644 --- a/chrome/browser/ui/views/tabs/groups/manage_sharing_row.cc +++ b/chrome/browser/ui/views/tabs/groups/manage_sharing_row.cc
@@ -59,6 +59,7 @@ views::InkDrop::Get(this)->SetBaseColorId(kColorHoverButtonBackgroundHovered); views::InkDrop::Get(this)->SetVisibleOpacity(1.0f); views::InkDrop::Get(this)->SetHighlightOpacity(1.0f); + SetFocusBehavior(views::View::FocusBehavior::ALWAYS); RebuildChildren(); }
diff --git a/chrome/browser/ui/views/tabs/new_tab_button.h b/chrome/browser/ui/views/tabs/new_tab_button.h index 75b1cf0f..ff90446 100644 --- a/chrome/browser/ui/views/tabs/new_tab_button.h +++ b/chrome/browser/ui/views/tabs/new_tab_button.h
@@ -9,7 +9,6 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "build/build_config.h" -#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/tabs/tab_strip.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/views/controls/button/image_button.h"
diff --git a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc index 227f5de..a5c48f4 100644 --- a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc +++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
@@ -270,6 +270,15 @@ } void BrowserAppMenuButton::ButtonPressed(const ui::Event& event) { +#if BUILDFLAG(IS_CHROMEOS) + if (toolbar_view_->browser()->window()->IsFeaturePromoActive( + feature_engagement::kIPHPasswordsSavePrimingPromoFeature)) { + toolbar_view_->browser()->window()->NotifyFeaturePromoFeatureUsed( + feature_engagement::kIPHPasswordsSavePrimingPromoFeature, + FeaturePromoFeatureUsedAction::kClosePromoIfPresent); + } +#endif // BUILDFLAG(IS_CHROMEOS) + ShowMenu(event.IsKeyEvent() ? (views::MenuRunner::SHOULD_SHOW_MNEMONICS | views::MenuRunner::INVOKED_FROM_KEYBOARD) : views::MenuRunner::NO_FLAGS);
diff --git a/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button_menu_model.cc b/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button_menu_model.cc index 9ef5d54..615fe45 100644 --- a/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button_menu_model.cc +++ b/chrome/browser/ui/views/toolbar/pinned_action_toolbar_button_menu_model.cc
@@ -14,7 +14,9 @@ #include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/customize_chrome/side_panel_controller.h" #include "chrome/browser/ui/tabs/public/tab_features.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h" +#include "components/tabs/public/tab_interface.h" #include "ui/actions/action_utils.h" #include "ui/actions/actions.h" #include "ui/menus/simple_menu_model.h"
diff --git a/chrome/browser/ui/views/toolbar/split_tabs_button.cc b/chrome/browser/ui/views/toolbar/split_tabs_button.cc index d283a42f..b879e6b 100644 --- a/chrome/browser/ui/views/toolbar/split_tabs_button.cc +++ b/chrome/browser/ui/views/toolbar/split_tabs_button.cc
@@ -8,11 +8,13 @@ #include "base/containers/fixed_flat_map.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_element_identifiers.h" #include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/tabs/split_tab_data.h" #include "chrome/browser/ui/tabs/split_tab_visual_data.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h"
diff --git a/chrome/browser/ui/views/toolbar/split_tabs_button.h b/chrome/browser/ui/views/toolbar/split_tabs_button.h index 89e79b3d..622cef2 100644 --- a/chrome/browser/ui/views/toolbar/split_tabs_button.h +++ b/chrome/browser/ui/views/toolbar/split_tabs_button.h
@@ -5,9 +5,14 @@ #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_SPLIT_TABS_BUTTON_H_ #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_SPLIT_TABS_BUTTON_H_ +#include <optional> + +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" -#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" +#include "components/prefs/pref_member.h" + +class Browser; namespace split_tabs { class SplitTabVisualData;
diff --git a/chrome/browser/ui/views/user_education/browser_user_education_service.cc b/chrome/browser/ui/views/user_education/browser_user_education_service.cc index caf28e2..0504d40 100644 --- a/chrome/browser/ui/views/user_education/browser_user_education_service.cc +++ b/chrome/browser/ui/views/user_education/browser_user_education_service.cc
@@ -10,6 +10,7 @@ #include "base/functional/bind.h" #include "base/metrics/user_metrics.h" +#include "base/notreached.h" #include "base/time/time.h" #include "build/build_config.h" #include "chrome/browser/feature_engagement/tracker_factory.h" @@ -271,7 +272,31 @@ FeaturePromoSpecification::CreateForCustomAction( feature_engagement::kIPHAutofillAiOptInFeature, autofill::PopupViewViews::kAutofillAiOptInIphElementId, - IDS_AUTOFILL_AI_OPT_IN_IPH_BODY, IDS_AUTOFILL_AI_OPT_IN_IPH_SEE_HOW, + IDS_AUTOFILL_AI_OPT_IN_IPH_BODY, + [&]() { + int index = + feature_engagement::kAutofillIphCTAVariationsStringValue.Get(); + if (index < 0 || + index > base::to_underlying( + autofill::features:: + AutofillIphCTAVariationsStringVarations:: + kMaxValue)) { + return IDS_AUTOFILL_AI_OPT_IN_IPH_SEE_HOW; + } + switch (static_cast<autofill::features:: + AutofillIphCTAVariationsStringVarations>( + index)) { + case autofill::features::AutofillIphCTAVariationsStringVarations:: + kSeeHow: + return IDS_AUTOFILL_AI_OPT_IN_IPH_SEE_HOW; + case autofill::features::AutofillIphCTAVariationsStringVarations:: + kTryIt: + return IDS_AUTOFILL_AI_OPT_IN_IPH_TRY_IT; + case autofill::features::AutofillIphCTAVariationsStringVarations:: + kTurnOn: + return IDS_AUTOFILL_AI_OPT_IN_IPH_TURN_ON; + } + }(), base::BindRepeating( [](ui::ElementContext ctx, user_education::FeaturePromoHandle promo_handle) { @@ -637,7 +662,7 @@ #else kToolbarAvatarButtonElementId, #endif - IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY, + IDS_PASSWORDS_SAVE_PRIMING_PROMO_BODY_TEMPLATE, IDS_PASSWORDS_SAVE_PRIMING_PROMO_SCREENREADER, FeaturePromoSpecification::AcceleratorInfo()) .SetMetadata(
diff --git a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h index 1bf2f7f..ed0d5e5 100644 --- a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h +++ b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.h
@@ -19,7 +19,6 @@ #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/ui/browser_dialogs.h" -#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/location_bar/intent_chip_button.h" #include "chrome/browser/web_applications/os_integration/os_integration_manager.h" #include "chrome/browser/web_applications/test/os_integration_test_override_impl.h"
diff --git a/chrome/browser/ui/views/webid/account_selection_view_base.h b/chrome/browser/ui/views/webid/account_selection_view_base.h index a895aa0..c653ded8 100644 --- a/chrome/browser/ui/views/webid/account_selection_view_base.h +++ b/chrome/browser/ui/views/webid/account_selection_view_base.h
@@ -13,7 +13,6 @@ #include "base/i18n/case_conversion.h" #include "chrome/browser/ui/monogram_utils.h" #include "chrome/browser/ui/views/controls/hover_button.h" -#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/webid/account_selection_view.h" #include "ui/events/event.h" #include "ui/gfx/canvas.h" @@ -22,6 +21,10 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/styled_label.h" +namespace network { +class SharedURLLoaderFactory; +} // namespace network + namespace webid { class FedCmAccountSelectionView;
diff --git a/chrome/browser/ui/web_applications/pwa_install_page_action.cc b/chrome/browser/ui/web_applications/pwa_install_page_action.cc index 8ad9510..a79c9b0 100644 --- a/chrome/browser/ui/web_applications/pwa_install_page_action.cc +++ b/chrome/browser/ui/web_applications/pwa_install_page_action.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/ui/views/page_action/page_action_controller.h" #include "chrome/grit/generated_resources.h" #include "components/webapps/browser/banners/app_banner_manager.h" +#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/webid/identity_dialog_controller.cc b/chrome/browser/ui/webid/identity_dialog_controller.cc index 16e0c1c4..3289a610 100644 --- a/chrome/browser/ui/webid/identity_dialog_controller.cc +++ b/chrome/browser/ui/webid/identity_dialog_controller.cc
@@ -23,6 +23,7 @@ // We add nognchecks on these includes so that Android bots do not fail // dependency checks. #if !BUILDFLAG(IS_ANDROID) +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.h" // nogncheck #include "components/tabs/public/tab_interface.h" // nogncheck #endif
diff --git a/chrome/browser/ui/webui/ash/settings/pages/main/os_settings_hats_handler.h b/chrome/browser/ui/webui/ash/settings/pages/main/os_settings_hats_handler.h index 2bf0bb14..e0c19b1 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/main/os_settings_hats_handler.h +++ b/chrome/browser/ui/webui/ash/settings/pages/main/os_settings_hats_handler.h
@@ -5,9 +5,11 @@ #ifndef CHROME_BROWSER_UI_WEBUI_ASH_SETTINGS_PAGES_MAIN_OS_SETTINGS_HATS_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_ASH_SETTINGS_PAGES_MAIN_OS_SETTINGS_HATS_HANDLER_H_ -#include "chrome/browser/ui/browser.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" +class Profile; + namespace ash::settings { // WebUI message handler for os settings HaTS.
diff --git a/chrome/browser/ui/webui/ash/settings/pages/main/send_search_feedback_handler.h b/chrome/browser/ui/webui/ash/settings/pages/main/send_search_feedback_handler.h index 3f2f4f5..b1737ba 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/main/send_search_feedback_handler.h +++ b/chrome/browser/ui/webui/ash/settings/pages/main/send_search_feedback_handler.h
@@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_UI_WEBUI_ASH_SETTINGS_PAGES_MAIN_SEND_SEARCH_FEEDBACK_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_ASH_SETTINGS_PAGES_MAIN_SEND_SEARCH_FEEDBACK_HANDLER_H_ -#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" namespace ash::settings {
diff --git a/chrome/browser/ui/webui/data_sharing/data_sharing_ui.cc b/chrome/browser/ui/webui/data_sharing/data_sharing_ui.cc index 96a11ac..371e067 100644 --- a/chrome/browser/ui/webui/data_sharing/data_sharing_ui.cc +++ b/chrome/browser/ui/webui/data_sharing/data_sharing_ui.cc
@@ -141,6 +141,7 @@ {"deleteGroup", IDS_DATA_SHARING_DELETE_GROUP}, {"deleteFlowHeader", IDS_DATA_SHARING_OWNER_DELETE_DIALOG_TITLE}, {"delete", IDS_DATA_SHARING_OWNER_DELETE_DIALOG_CONFIRM}, + {"previewA11yName", IDS_DATA_SHARING_PREVIEW_A11Y_NAME}, // dynamic messages: {"shareGroupShareAs", IDS_DATA_SHARING_SHARE_GROUP_SHARE_AS},
diff --git a/chrome/browser/ui/webui/new_tab_footer/BUILD.gn b/chrome/browser/ui/webui/new_tab_footer/BUILD.gn index c2f83a13..56478d82 100644 --- a/chrome/browser/ui/webui/new_tab_footer/BUILD.gn +++ b/chrome/browser/ui/webui/new_tab_footer/BUILD.gn
@@ -13,6 +13,7 @@ ] public_deps = [ ":mojo_bindings", + "//chrome/browser/ui/webui/top_chrome", "//chrome/common", "//content/public/browser", "//ui/webui",
diff --git a/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.cc b/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.cc index 2aea664f..252b82e 100644 --- a/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.cc +++ b/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.cc
@@ -20,17 +20,13 @@ #include "content/public/browser/web_ui_data_source.h" #include "ui/webui/webui_util.h" -NewTabFooterUIConfig::NewTabFooterUIConfig() - : DefaultWebUIConfig(content::kChromeUIScheme, - chrome::kChromeUINewTabFooterHost) {} - bool NewTabFooterUIConfig::IsWebUIEnabled( content::BrowserContext* browser_context) { return base::FeatureList::IsEnabled(ntp_features::kNtpFooter); } NewTabFooterUI::NewTabFooterUI(content::WebUI* web_ui) - : ui::MojoWebUIController(web_ui, /*enable_chrome_send=*/true), + : TopChromeWebUIController(web_ui, /*enable_chrome_send=*/true), profile_(Profile::FromWebUI(web_ui)) { // Set up the chrome://newtab-footer source. content::WebUIDataSource* source = content::WebUIDataSource::CreateAndAdd(
diff --git a/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.h b/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.h index 7749ffc..bc42f22 100644 --- a/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.h +++ b/chrome/browser/ui/webui/new_tab_footer/new_tab_footer_ui.h
@@ -9,28 +9,36 @@ #include "base/memory/raw_ptr.h" #include "chrome/browser/ui/webui/new_tab_footer/new_tab_footer.mojom.h" +#include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" +#include "chrome/browser/ui/webui/top_chrome/top_chrome_webui_config.h" +#include "chrome/common/webui_url_constants.h" #include "content/public/browser/webui_config.h" -#include "ui/webui/mojo_web_ui_controller.h" class NewTabFooterHandler; class NewTabFooterUI; class Profile; class NewTabFooterUIConfig - : public content::DefaultWebUIConfig<NewTabFooterUI> { + : public DefaultTopChromeWebUIConfig<NewTabFooterUI> { public: - NewTabFooterUIConfig(); + NewTabFooterUIConfig() + : DefaultTopChromeWebUIConfig(content::kChromeUIScheme, + chrome::kChromeUINewTabFooterHost) {} + + // DefaultTopChromeWebUIConfig: bool IsWebUIEnabled(content::BrowserContext* browser_context) override; }; // The WebUI for chrome://newtab-footer class NewTabFooterUI - : public ui::MojoWebUIController, + : public TopChromeWebUIController, public new_tab_footer::mojom::NewTabFooterHandlerFactory { public: explicit NewTabFooterUI(content::WebUI* web_ui); ~NewTabFooterUI() override; + static constexpr std::string GetWebUIName() { return "NewTabFooter"; } + // Instantiates the implementor of the mojom::NewTabFooterHandlerFactory mojo // interface passing the pending receiver that will be internally bound. void BindInterface( @@ -48,6 +56,7 @@ document_factory_receiver_{this}; raw_ptr<Profile> profile_; + private: WEB_UI_CONTROLLER_TYPE_DECL(); };
diff --git a/chrome/browser/ui/webui/privacy_sandbox/DIR_METADATA b/chrome/browser/ui/webui/privacy_sandbox/DIR_METADATA index cb1e73c9..aff2c86 100644 --- a/chrome/browser/ui/webui/privacy_sandbox/DIR_METADATA +++ b/chrome/browser/ui/webui/privacy_sandbox/DIR_METADATA
@@ -3,5 +3,5 @@ } team_email: "koilos@google.com" buganizer_public: { - component_id: 1697287 + component_id: 1706459 }
diff --git a/chrome/browser/ui/webui/settings/about_handler.h b/chrome/browser/ui/webui/settings/about_handler.h index 1e4809a..5cc5142 100644 --- a/chrome/browser/ui/webui/settings/about_handler.h +++ b/chrome/browser/ui/webui/settings/about_handler.h
@@ -12,7 +12,6 @@ #include "base/memory/weak_ptr.h" #include "base/values.h" #include "build/build_config.h" -#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/webui/help/version_updater.h" #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" #include "chrome/browser/upgrade_detector/upgrade_observer.h" @@ -20,13 +19,14 @@ #include "content/public/browser/web_ui_message_handler.h" #if BUILDFLAG(IS_CHROMEOS) +#include "base/callback_list.h" #include "base/task/cancelable_task_tracker.h" #include "chrome/browser/ash/tpm/tpm_firmware_update.h" #endif // BUILDFLAG(IS_CHROMEOS) namespace base { -class FilePath; class Clock; +class FilePath; } // namespace base class Profile;
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc index 39fa380..ba213dd5 100644 --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -83,6 +83,7 @@ #include "chrome/browser/ui/webui/settings/settings_startup_pages_handler.h" #include "chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.h" #include "chrome/browser/ui/webui/settings/site_settings_handler.h" +#include "chrome/common/channel_info.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" @@ -517,9 +518,11 @@ base::FeatureList::IsEnabled(privacy_sandbox::kAlwaysBlock3pcsIncognito)); // ACT UX - bool ipp_ux = base::FeatureList::IsEnabled(privacy_sandbox::kIpProtectionUx); - bool fpp_ux = base::FeatureList::IsEnabled( - privacy_sandbox::kFingerprintingProtectionUx); + bool is_canary = chrome::GetChannel() == version_info::Channel::CANARY; + bool ipp_ux = is_canary && + base::FeatureList::IsEnabled(privacy_sandbox::kIpProtectionUx); + bool fpp_ux = is_canary && base::FeatureList::IsEnabled( + privacy_sandbox::kFingerprintingProtectionUx); html_source->AddBoolean("isIpProtectionUxEnabled", ipp_ux); html_source->AddBoolean("isFingerprintingProtectionUxEnabled", fpp_ux); html_source->AddBoolean("enableIncognitoTrackingProtections",
diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc index 8bfd620..2b48ad944 100644 --- a/chrome/browser/ui/webui/settings/site_settings_helper.cc +++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc
@@ -724,6 +724,7 @@ const ProviderType provider_type) { switch (provider_type) { case ProviderType::kWebuiAllowlistProvider: + case ProviderType::kComponentExtensionProvider: return SiteSettingSource::kAllowlist; case ProviderType::kPolicyProvider: case ProviderType::kSupervisedProvider: @@ -760,6 +761,7 @@ return "preference"; case ProviderType::kInstalledWebappProvider: case ProviderType::kWebuiAllowlistProvider: + case ProviderType::kComponentExtensionProvider: case ProviderType::kDefaultProvider: return "default"; case ProviderType::kJavascriptOptimizerAndroidProvider:
diff --git a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h index 20215abb..1e9abfa 100644 --- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h +++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
@@ -5,6 +5,11 @@ #ifndef CHROME_BROWSER_UI_WEBUI_SIDE_PANEL_CUSTOMIZE_CHROME_CUSTOMIZE_TOOLBAR_CUSTOMIZE_TOOLBAR_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_SIDE_PANEL_CUSTOMIZE_CHROME_CUSTOMIZE_TOOLBAR_CUSTOMIZE_TOOLBAR_HANDLER_H_ +#include <unordered_map> + +#include "base/callback_list.h" +#include "base/memory/raw_ptr.h" +#include "base/scoped_observation.h" #include "chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.h" #include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom.h" #include "components/prefs/pref_change_registrar.h" @@ -13,6 +18,10 @@ #include "mojo/public/cpp/bindings/remote.h" #include "ui/actions/action_id.h" +namespace content { +class WebContents; +} // namespace content + class CustomizeToolbarHandler : public side_panel::customize_chrome::mojom::CustomizeToolbarHandler, public PinnedToolbarActionsModel::Observer {
diff --git a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc index c6143f0..3afa777 100644 --- a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc +++ b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.cc
@@ -45,6 +45,7 @@ #include "content/public/browser/scoped_accessibility_mode.h" #include "content/public/browser/web_contents_user_data.h" #include "content/public/browser/web_ui.h" +#include "extensions/browser/extension_registry.h" #include "net/http/http_status_code.h" #include "pdf/buildflags.h" #include "services/network/public/cpp/header_util.h"
diff --git a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.h b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.h index 3581e96..b1096ab 100644 --- a/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.h +++ b/chrome/browser/ui/webui/side_panel/read_anything/read_anything_untrusted_page_handler.h
@@ -11,12 +11,13 @@ #include "base/memory/raw_ptr.h" #include "base/memory/safe_ref.h" #include "base/memory/weak_ptr.h" +#include "base/scoped_observation.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" -#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/side_panel/read_anything/read_anything_side_panel_controller.h" #include "chrome/browser/ui/webui/side_panel/read_anything/read_anything_screenshotter.h" #include "chrome/common/read_anything/read_anything.mojom.h" #include "components/translate/core/browser/translate_client.h" +#include "components/translate/core/browser/translate_driver.h" #include "content/public/browser/tts_controller.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h"
diff --git a/chrome/browser/vr/elements/indicator_spec.cc b/chrome/browser/vr/elements/indicator_spec.cc index 69e299a..383d111 100644 --- a/chrome/browser/vr/elements/indicator_spec.cc +++ b/chrome/browser/vr/elements/indicator_spec.cc
@@ -75,7 +75,8 @@ &CapturingStateModel::bluetooth_connected}, {kScreenCaptureIndicator, kWebVrScreenCaptureIndicator, - vector_icons::kScreenShareIcon, + // TODO(crbug.com/413285138): Update to kScreenShareIcon + vector_icons::kScreenShareOldIcon, IDS_VR_SHELL_SITE_IS_SHARING_SCREEN, IDS_VR_SHELL_BG_IS_SHARING_SCREEN, IDS_VR_SHELL_SITE_CAN_SHARE_SCREEN,
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 24c833cc..f61a2bb 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1745474353-ee58f8084a0794bb3e8afce5cabd91f2f5b7b49c-e68a86f982590a065e3fcc642d622a6682d96f6a.profdata +chrome-android32-main-1745494919-7a2c50780494f7be85133d88edd70560e7a17cf0-264568472d39e26fe705ea0f6cf6e10535883deb.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index e7a07d32..72249c5 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1745484649-1874acf84fdea02345b9065b72995c80cb23a4bf-3f8df3840f2b82151fa677806909e21324982aea.profdata +chrome-android64-main-1745507190-2d44d4ef2b9ed837608abbfa8ebc49a9b92e97d2-ff59d159ac7ba8f23b33553bc3d0e880a0e34942.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 65f8790..4e45e868 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1745474353-da6aa1f7f8c01ffd2a10d7693cdda8cf295a2505-e68a86f982590a065e3fcc642d622a6682d96f6a.profdata +chrome-linux-main-1745494919-46a392a5d33ed59f7c0eab8b9e15095f7d5344fd-264568472d39e26fe705ea0f6cf6e10535883deb.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index fc66e23..65f7c75 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1745474353-e2efa43d6917630ce33d0370f3ef451aa94dd04d-e68a86f982590a065e3fcc642d622a6682d96f6a.profdata +chrome-win-arm64-main-1745494919-76d64cb1b8242f0ba0c5f371378b3747f5bd3d2d-264568472d39e26fe705ea0f6cf6e10535883deb.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 33c12f4..7f60b158 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1745474353-f0ccc7233507f230754c8f04e75f011583e81711-e68a86f982590a065e3fcc642d622a6682d96f6a.profdata +chrome-win64-main-1745485152-e1504ab9e2262dccb664bf514fe6e71a7262f2c3-ce55b3b206430e9f7dfdb61a2c31f639d77332bc.profdata
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index f0a90888..a71b042 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -432,6 +432,16 @@ BASE_FEATURE(kGlicWarming, "GlicWarming", base::FEATURE_ENABLED_BY_DEFAULT); +// Controls the amount of time from the GlicButtonController scheduling +// preload to the start of preloading (if preloading is possible). +const base::FeatureParam<int> kGlicWarmingDelayMs{ + &kGlicWarming, "glic-warming-delay-ms", 30 * 1000}; + +// Adds noise to the warming delay. The effective delay is increased by a +// random positive number of milliseconds between 0 and kGlicWarmingJitterMs. +const base::FeatureParam<int> kGlicWarmingJitterMs{ + &kGlicWarming, "glic-warming-jitter-ms", 10 * 1000}; + BASE_FEATURE(kGlicFreWarming, "GlicFreWarming", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index b27cf09..e3031e46 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -254,6 +254,11 @@ COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kGlicWarming); +COMPONENT_EXPORT(CHROME_FEATURES) +extern const base::FeatureParam<int> kGlicWarmingDelayMs; +COMPONENT_EXPORT(CHROME_FEATURES) +extern const base::FeatureParam<int> kGlicWarmingJitterMs; + COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kGlicFreWarming); COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kGlicWarmMultiple);
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 43e15414..28a4c29 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -2108,6 +2108,15 @@ inline constexpr char kDefaultBrowserPromptRefreshStudyGroup[] = "browser.default_browser_prompt_refresh_study_group"; +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) +// The time at which the default-PDF-viewer infobar was last shown. +inline constexpr char kPdfInfoBarLastShown[] = "browser.pdf_infobar_last_shown"; + +// How many times the default-PDF-viewer infobar has been shown. +inline constexpr char kPdfInfoBarTimesShown[] = + "browser.pdf_infobar_times_shown"; +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) + // A collection of position, size, and other data relating to the browser // window to restore on startup. inline constexpr char kBrowserWindowPlacement[] = "browser.window_placement";
diff --git a/chrome/release_scripts b/chrome/release_scripts index 033a55d..75c4914 160000 --- a/chrome/release_scripts +++ b/chrome/release_scripts
@@ -1 +1 @@ -Subproject commit 033a55d9116b98ac78baeadc19893db5a8044221 +Subproject commit 75c491444624e8261d92304572a43732a1a242a1
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 36c9881..78c5e6b 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -7440,6 +7440,7 @@ "../browser/autofill/android/save_update_address_profile_message_controller_unittest.cc", "../browser/autofill/android/save_update_address_profile_prompt_controller_unittest.cc", "../browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc", + "../browser/auxiliary_search/auxiliary_search_provider_unittest.cc", "../browser/bookmarks//android/bookmark_bridge_unittest.cc", "../browser/commerce/merchant_viewer/merchant_viewer_data_manager_unittest.cc", "../browser/device_reauth/android/device_authenticator_android_unittest.cc",
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py index 78aa2a7..efb3d89 100755 --- a/chrome/test/chromedriver/test/run_py_tests.py +++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -802,9 +802,6 @@ def testBrowserWithUsedUserDataDir(self): """Verify that it is impossible to create a parallel Chrome session using the same user data directory. - Verify that it is possible to create a parallel chrome-headless-shell - session using the same user data directory. - See go/headless:user-data-directory """ temp_dir = self.CreateTempDir() driver = self.CreateDriver(chrome_switches=[ @@ -812,11 +809,17 @@ ]) self.assertEqual(len(driver.GetWindowHandles()), 1) - if (_BROWSER_NAME == 'chrome-headless-shell'): - driver2 = self.CreateDriver( - chrome_switches=['--user-data-dir=%s' % temp_dir,]) - self.assertEqual(len(driver2.GetWindowHandles()), 1) - else: + # TODO(crbug.com/40708010): Re-enable when chrome-headless-shell + # is compatible with crbug.com/411407649. + # if (_BROWSER_NAME == 'chrome-headless-shell'): + # Verify that it is possible to create a parallel chrome-headless-shell + # session using the same user data directory. + # See go/headless:user-data-directory + # driver2 = self.CreateDriver( + # chrome_switches=['--user-data-dir=%s' % temp_dir,]) + # self.assertEqual(len(driver2.GetWindowHandles()), 1) + # + if (_BROWSER_NAME != 'chrome-headless-shell'): with self.assertRaises(chromedriver.SessionNotCreated): self.CreateDriver(chrome_switches=['--user-data-dir=%s' % temp_dir,])
diff --git a/chrome/test/chromedriver/test/run_py_tests.pydeps b/chrome/test/chromedriver/test/run_py_tests.pydeps index cbc787df..6655e7b 100644 --- a/chrome/test/chromedriver/test/run_py_tests.pydeps +++ b/chrome/test/chromedriver/test/run_py_tests.pydeps
@@ -65,7 +65,6 @@ ../../../../third_party/catapult/devil/devil/utils/run_tests_helper.py ../../../../third_party/catapult/devil/devil/utils/timeout_retry.py ../../../../third_party/catapult/devil/devil/utils/watchdog_timer.py -../../../../third_party/catapult/devil/devil/utils/zip_utils.py ../../../../third_party/catapult/telemetry/third_party/websocket-client/websocket/__init__.py ../../../../third_party/catapult/telemetry/third_party/websocket-client/websocket/_abnf.py ../../../../third_party/catapult/telemetry/third_party/websocket-client/websocket/_app.py
diff --git a/chrome/test/data/actor/page_with_clickable_element.html b/chrome/test/data/actor/page_with_clickable_element.html index 9ddb3a3..0a590a2a 100644 --- a/chrome/test/data/actor/page_with_clickable_element.html +++ b/chrome/test/data/actor/page_with_clickable_element.html
@@ -4,7 +4,7 @@ <meta name="viewport" content="width=device-width, minimum-scale=1.0"> </head> <body> - <button id="clickable">Clickable</button> + <button id="clickable" aria-label="clickable">Clickable</button> <button disabled id="disabled">Disabled</button> <button style="position: absolute;top:150vh" id="offscreen">Offscreen</button> <p id="text">Some text</p>
diff --git a/chrome/test/data/autofill/captured_sites/artifacts b/chrome/test/data/autofill/captured_sites/artifacts index a7d1f25..ac0b158 160000 --- a/chrome/test/data/autofill/captured_sites/artifacts +++ b/chrome/test/data/autofill/captured_sites/artifacts
@@ -1 +1 @@ -Subproject commit a7d1f25f01c31216593ea9bd381da4cf65e16a47 +Subproject commit ac0b158375110516ddcf9ac71d9f1ab0e98b6dd3
diff --git a/chrome/test/data/optimization_guide/actionable_elements.html b/chrome/test/data/optimization_guide/actionable_elements.html new file mode 100644 index 0000000..61e2b2bb --- /dev/null +++ b/chrome/test/data/optimization_guide/actionable_elements.html
@@ -0,0 +1,3 @@ +<body> + <div style='cursor: pointer;'></div> +</body>
diff --git a/chrome/test/data/webui/settings/incognito_tracking_protections_page_test.ts b/chrome/test/data/webui/settings/incognito_tracking_protections_page_test.ts index 470378d..25786d9 100644 --- a/chrome/test/data/webui/settings/incognito_tracking_protections_page_test.ts +++ b/chrome/test/data/webui/settings/incognito_tracking_protections_page_test.ts
@@ -28,6 +28,9 @@ } suiteSetup(function() { + loadTimeData.overrideValues({ + isFingerprintingProtectionUxEnabled: true, + }); settingsPrefs = document.createElement('settings-prefs'); return CrSettingsPrefs.initialized; });
diff --git a/chrome/test/data/webui/settings/privacy_page_test.ts b/chrome/test/data/webui/settings/privacy_page_test.ts index e5304abf..fc9e4c8 100644 --- a/chrome/test/data/webui/settings/privacy_page_test.ts +++ b/chrome/test/data/webui/settings/privacy_page_test.ts
@@ -524,6 +524,9 @@ let settingsPrefs: SettingsPrefsElement; suiteSetup(function() { + loadTimeData.overrideValues({ + enableIncognitoTrackingProtections: true, + }); resetRouterForTesting(); settingsPrefs = document.createElement('settings-prefs');
diff --git a/chrome/test/enterprise/e2e/connector/local_content_analysis_connector/local_content_analysis_ui_test.py b/chrome/test/enterprise/e2e/connector/local_content_analysis_connector/local_content_analysis_ui_test.py index e39d635..b4494fcf 100644 --- a/chrome/test/enterprise/e2e/connector/local_content_analysis_connector/local_content_analysis_ui_test.py +++ b/chrome/test/enterprise/e2e/connector/local_content_analysis_connector/local_content_analysis_ui_test.py
@@ -21,7 +21,7 @@ flags.DEFINE_string('action', None, 'The action to trigger a DLP scan') flags.mark_flag_as_required('action') -SafeBrowsingReportingUrl = "chrome://safe-browsing/#tab-reporting" +_SAFE_BROWSING_REPORTING_URL = "chrome://safe-browsing/#tab-reporting" def main(argv): @@ -30,66 +30,69 @@ chrome_options.add_experimental_option("localState", {"internal_only_uis_enabled": True}) driver = create_chrome_webdriver(chrome_options=chrome_options) - time.sleep(10) - driver.get(SafeBrowsingReportingUrl) + driver.implicitly_wait(10) - if FLAGS.action == 'paste': - #use pyperclip to paste things in textbox - # paste content from clipboard to the form - driver.execute_script("window.open('%s');" % FLAGS.url) - driver.switch_to.window(driver.window_handles[1]) + try: + # Wait for the initialization with the local system agent to complete. + time.sleep(10) + # Open the safe browsing URL first to start collecting events, which aren't + # stored persistently. + driver.get(_SAFE_BROWSING_REPORTING_URL) - form = driver.find_element(By.NAME, 'sensitive_data_scan') - pyperclip.copy('block') - form.send_keys(Keys.CONTROL, "v") - time.sleep(5) + report_window_handle = driver.current_window_handle + driver.switch_to.new_window('tab') + driver.get(FLAGS.url) - elif FLAGS.action == 'upload': - #Upload file into the website - driver.execute_script("window.open('%s');" % FLAGS.url) - driver.switch_to.window(driver.window_handles[1]) + if FLAGS.action == 'paste': + #use pyperclip to paste things in textbox + # paste content from clipboard to the form + form = driver.find_element(By.NAME, 'sensitive_data_scan') + pyperclip.copy('block') + form.send_keys(Keys.CONTROL, "v") + time.sleep(5) - # Create a text file with block keyword - file_path = r'C:\temp\block.txt' - with open(file_path, 'w') as f: - f.write('block') + elif FLAGS.action == 'upload': + #Upload file into the website + # Create a text file with block keyword + file_path = r'C:\temp\block.txt' + with open(file_path, 'w') as f: + f.write('block') - form = driver.find_element(By.ID, 'fileToUpload') - form.send_keys(r'C:\temp\block.txt') - time.sleep(5) + form = driver.find_element(By.ID, 'fileToUpload') + form.send_keys(r'C:\temp\block.txt') + time.sleep(5) - # TODO: b/309044872 - trigger system dialogue for file upload - print("EVENT_RESULT_BLOCKED") - print("FILE_UPLOAD") + # TODO(crbug.com/309044872) - trigger system dialogue for file upload + print("EVENT_RESULT_BLOCKED") + print("FILE_UPLOAD") - elif FLAGS.action == 'print': - #Print a webpage which url has block - driver.execute_script("window.open('%s');" % FLAGS.url) - driver.switch_to.window(driver.window_handles[1]) - # TODO: b/308885357 - upgrade to selenium 4 to support print - print("EVENT_RESULT_BLOCKED") - print("PAGE_PRINT") - # driver.execute_script('window.print();') - # time.sleep(5) + elif FLAGS.action == 'print': + #Print a webpage which url has block + # TODO(crbug.com/308885357) - upgrade to selenium 4 to support print + print("EVENT_RESULT_BLOCKED") + print("PAGE_PRINT") + # driver.execute_script('window.print();') + # time.sleep(5) - # Click Print button on the chrome://print page - # driver.switch_to.window(driver.window_handles[-1]) - # print_app = driver.find_element(By.CSS_SELECTOR, 'print-preview-app') - # preview_sidebar = getElementFromShadowRoot(driver, print_app, - # 'print-preview-sidebar') - # button_strip = getElementFromShadowRoot(driver, preview_sidebar, - # 'print-preview-button-strip') - # print_button = getElementFromShadowRoot(driver, button_strip, - # 'div > cr-button.action-button') - # print_button.click() + # Click Print button on the chrome://print page + # driver.switch_to.window(driver.window_handles[-1]) + # print_app = driver.find_element(By.CSS_SELECTOR, 'print-preview-app') + # preview_sidebar = getElementFromShadowRoot(driver, print_app, + # 'print-preview-sidebar') + # button_strip = getElementFromShadowRoot(driver, preview_sidebar, + # 'print-preview-button-strip') + # print_button = getElementFromShadowRoot(driver, button_strip, + # 'div > cr-button.action-button') + # print_button.click() - # print reporting content - driver.switch_to.window(driver.window_handles[0]) - tabbox = driver.find_element(By.ID, 'tabbox') - events = tabbox.find_element(By.ID, 'reporting-events') - print(events.text) + # print reporting content + driver.switch_to.window(report_window_handle) + tabbox = driver.find_element(By.ID, 'tabbox') + events = tabbox.find_element(By.ID, 'reporting-events') + print(events.text) - driver.quit() + finally: + driver.quit() if __name__ == '__main__':
diff --git a/chromeos/ash/components/boca/boca_session_manager.cc b/chromeos/ash/components/boca/boca_session_manager.cc index 226ec76..9c5ee44 100644 --- a/chromeos/ash/components/boca/boca_session_manager.cc +++ b/chromeos/ash/components/boca/boca_session_manager.cc
@@ -118,6 +118,8 @@ void BocaSessionManager::Observer::OnLocalCaptionConfigUpdated( const ::boca::CaptionsConfig& config) {} +void BocaSessionManager::Observer::OnSodaStatusUpdate(SodaStatus status) {} + void BocaSessionManager::Observer::OnLocalCaptionClosed() {} void BocaSessionManager::Observer::OnSessionRosterUpdated( @@ -297,7 +299,9 @@ void BocaSessionManager::OnAppWindowOpened() { if (soda_installer_ != nullptr) { // TODO(378702821) Notify observers of SODA status change. - soda_installer_->InstallSoda(base::DoNothing()); + soda_installer_->InstallSoda( + base::BindOnce(&BocaSessionManager::NotifySodaStatusListeners, + weak_factory_.GetWeakPtr())); } } @@ -759,4 +763,10 @@ } } +void BocaSessionManager::NotifySodaStatusListeners(SodaStatus status) { + for (auto& observer : observers_) { + observer.OnSodaStatusUpdate(status); + } +} + } // namespace ash::boca
diff --git a/chromeos/ash/components/boca/boca_session_manager.h b/chromeos/ash/components/boca/boca_session_manager.h index abebe88..712a20e3 100644 --- a/chromeos/ash/components/boca/boca_session_manager.h +++ b/chromeos/ash/components/boca/boca_session_manager.h
@@ -136,6 +136,9 @@ // app. virtual void OnLocalCaptionClosed(); + // Notifies when the status of SODA changes. + virtual void OnSodaStatusUpdate(SodaStatus status); + // Notifies when session roster updated. Will emit when only elements order // changed in the vector too. Deferred to events consumer to decide on // the actual action. @@ -247,6 +250,7 @@ void HandleCaptionNotification(); void UpdateNetworkRestriction( chromeos::network_config::mojom::NetworkStatePropertiesPtr network_state); + void NotifySodaStatusListeners(SodaStatus status); const bool is_producer_; base::TimeDelta in_session_polling_interval_;
diff --git a/chromeos/ash/components/boca/boca_session_manager_unittest.cc b/chromeos/ash/components/boca/boca_session_manager_unittest.cc index c3c0c5c..9f0d053f 100644 --- a/chromeos/ash/components/boca/boca_session_manager_unittest.cc +++ b/chromeos/ash/components/boca/boca_session_manager_unittest.cc
@@ -107,6 +107,11 @@ (const ::boca::CaptionsConfig& config), (override)); MOCK_METHOD(void, + OnSodaStatusUpdate, + (BocaSessionManager::SodaStatus status), + (override)); + + MOCK_METHOD(void, OnSessionRosterUpdated, (const ::boca::Roster& roster), (override)); @@ -1659,6 +1664,52 @@ boca_session_manager_->GetSodaStatus()); } +TEST_F(BocaSessionManagerSodaTest, ListenForSuccess) { + babelorca::SodaInstaller installer = babelorca::SodaInstaller( + &local_state(), &local_state(), kDefaultLanguage); + boca_session_manager_->SetSodaInstaller(&installer); + EXPECT_EQ(BocaSessionManager::SodaStatus::kUninstalled, + boca_session_manager_->GetSodaStatus()); + + // On any status that's not installing immediately return the status. + boca_session_manager_->AddObserver(observer()); + EXPECT_CALL(*observer(), OnSodaStatusUpdate).Times(1); + + boca_session_manager_->OnAppWindowOpened(); + EXPECT_EQ(BocaSessionManager::SodaStatus::kInstalling, + boca_session_manager_->GetSodaStatus()); + + // This first call fakes the binary installation, which is necessary for the + // installer to report the installed language correctly. + speech::SodaInstaller::GetInstance()->NotifySodaInstalledForTesting(); + speech::SodaInstaller::GetInstance()->NotifySodaInstalledForTesting( + speech::GetLanguageCode(kDefaultLanguage)); + ASSERT_EQ(BocaSessionManager::SodaStatus::kReady, + boca_session_manager_->GetSodaStatus()); +} + +TEST_F(BocaSessionManagerSodaTest, ListenForFailure) { + babelorca::SodaInstaller installer = babelorca::SodaInstaller( + &local_state(), &local_state(), kDefaultLanguage); + boca_session_manager_->SetSodaInstaller(&installer); + EXPECT_EQ(BocaSessionManager::SodaStatus::kUninstalled, + boca_session_manager_->GetSodaStatus()); + boca_session_manager_->AddObserver(observer()); + EXPECT_CALL(*observer(), OnSodaStatusUpdate).Times(1); + + boca_session_manager_->OnAppWindowOpened(); + EXPECT_EQ(BocaSessionManager::SodaStatus::kInstalling, + boca_session_manager_->GetSodaStatus()); + + // This first call fakes the binary installation, which is necessary for the + // installer to report the installed language correctly. + speech::SodaInstaller::GetInstance()->NotifySodaInstalledForTesting(); + speech::SodaInstaller::GetInstance()->NotifySodaErrorForTesting( + speech::GetLanguageCode(kDefaultLanguage)); + ASSERT_EQ(BocaSessionManager::SodaStatus::kInstallationFailure, + boca_session_manager_->GetSodaStatus()); +} + class BocaSessionManagerManagedNetworkTest : public BocaSessionManagerTestBase { protected: void SetUp() override {
diff --git a/chromeos/ash/components/boca/on_task/on_task_blocklist.cc b/chromeos/ash/components/boca/on_task/on_task_blocklist.cc index c8c0494..e7867184 100644 --- a/chromeos/ash/components/boca/on_task/on_task_blocklist.cc +++ b/chromeos/ash/components/boca/on_task/on_task_blocklist.cc
@@ -59,6 +59,26 @@ allowed_traffic.Append("." + url.spec()); return allowed_traffic; } + +// Forked version of `google_util::IsGoogleSearchUrl` with loosened checks to +// allow for all subdomains of Google domain URLs. +bool IsGoogleSearchUrl(const GURL& url) { + if (!url.is_valid()) { + return false; + } + + const std::string_view url_path = url.path_piece(); + bool is_home_page_path = (url_path == "/") || (url_path == "/webhp"); + if (!is_home_page_path && url_path != "/search" && url_path != "/imgres") { + return false; + } + + // Check for query parameter in URL parameter and hash fragment, depending on + // the path type. + return google_util::HasGoogleSearchQueryParam(url.ref_piece()) || + (!is_home_page_path && + google_util::HasGoogleSearchQueryParam(url.query_piece())); +} } // namespace OnTaskBlocklist::OnTaskBlocklist( @@ -82,7 +102,7 @@ LockedNavigationOptions::WORKSPACE_NAVIGATION) { if (google_util::IsGoogleDomainUrl(url, google_util::ALLOW_SUBDOMAIN, google_util::ALLOW_NON_STANDARD_PORTS) && - !google_util::HasGoogleSearchQueryParam(url.query_piece())) { + !IsGoogleSearchUrl(url)) { return policy::URLBlocklist::URLBlocklistState::URL_IN_ALLOWLIST; } return policy::URLBlocklist::URLBlocklistState::URL_IN_BLOCKLIST;
diff --git a/clank b/clank index 83fc855b..1ff668e 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit 83fc855bcf30939fa766142e5fffe7c243d36086 +Subproject commit 1ff668ed09b92245f1e82581c7e855d4ed95a134
diff --git a/components/autofill/content/browser/content_identity_credential_delegate.h b/components/autofill/content/browser/content_identity_credential_delegate.h index 3d0131d5..08ad8e0 100644 --- a/components/autofill/content/browser/content_identity_credential_delegate.h +++ b/components/autofill/content/browser/content_identity_credential_delegate.h
@@ -6,7 +6,7 @@ #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_CONTENT_IDENTITY_CREDENTIAL_DELEGATE_H_ #include "components/autofill/core/browser/autofill_field.h" -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" #include "content/public/browser/web_contents.h" namespace autofill {
diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn index bd70289..bbf9ed21 100644 --- a/components/autofill/core/browser/BUILD.gn +++ b/components/autofill/core/browser/BUILD.gn
@@ -335,7 +335,7 @@ "integrators/fast_checkout/fast_checkout_client.h", "integrators/fast_checkout/fast_checkout_delegate.h", "integrators/fast_checkout/fast_checkout_enums.h", - "integrators/identity_credential_delegate.h", + "integrators/identity_credential/identity_credential_delegate.h", "integrators/optimization_guide/autofill_optimization_guide.cc", "integrators/optimization_guide/autofill_optimization_guide.h", "integrators/password_form_classification.h", @@ -1026,8 +1026,8 @@ "integrators/compose/mock_autofill_compose_delegate.h", "integrators/fast_checkout/mock_fast_checkout_client.cc", "integrators/fast_checkout/mock_fast_checkout_client.h", - "integrators/mock_identity_credential_delegate.cc", - "integrators/mock_identity_credential_delegate.h", + "integrators/identity_credential/mock_identity_credential_delegate.cc", + "integrators/identity_credential/mock_identity_credential_delegate.h", "integrators/optimization_guide/mock_autofill_optimization_guide.cc", "integrators/optimization_guide/mock_autofill_optimization_guide.h", "integrators/plus_addresses/mock_autofill_plus_address_delegate.cc",
diff --git a/components/autofill/core/browser/data_manager/valuables/valuables_data_manager.cc b/components/autofill/core/browser/data_manager/valuables/valuables_data_manager.cc index d7488ba..866fb86 100644 --- a/components/autofill/core/browser/data_manager/valuables/valuables_data_manager.cc +++ b/components/autofill/core/browser/data_manager/valuables/valuables_data_manager.cc
@@ -63,6 +63,7 @@ [](const LoyaltyCard& a, const LoyaltyCard& b) { return a.merchant_name() < b.merchant_name(); }); + NotifyObservers(); } void ValuablesDataManager::OnAutofillChangedBySync(syncer::DataType data_type) { @@ -71,4 +72,10 @@ } } +void ValuablesDataManager::NotifyObservers() { + for (Observer& observer : observers_) { + observer.OnValuablesDataChanged(); + } +} + } // namespace autofill
diff --git a/components/autofill/core/browser/data_manager/valuables/valuables_data_manager.h b/components/autofill/core/browser/data_manager/valuables/valuables_data_manager.h index 1f96aee..df5a4ca 100644 --- a/components/autofill/core/browser/data_manager/valuables/valuables_data_manager.h +++ b/components/autofill/core/browser/data_manager/valuables/valuables_data_manager.h
@@ -10,6 +10,8 @@ #include "base/containers/span.h" #include "base/memory/scoped_refptr.h" +#include "base/observer_list.h" +#include "base/observer_list_types.h" #include "base/scoped_observation.h" #include "components/autofill/core/browser/data_model/valuables/loyalty_card.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" @@ -29,12 +31,21 @@ class ValuablesDataManager : public KeyedService, public AutofillWebDataServiceObserverOnUISequence { public: + class Observer : public base::CheckedObserver { + public: + // Triggered after all pending read operations have finished. + virtual void OnValuablesDataChanged() = 0; + }; + explicit ValuablesDataManager( scoped_refptr<AutofillWebDataService> webdata_service); ValuablesDataManager(const ValuablesDataManager&) = delete; ValuablesDataManager& operator=(const ValuablesDataManager&) = delete; ~ValuablesDataManager() override; + void AddObserver(Observer* obs) { observers_.AddObserver(obs); } + void RemoveObserver(Observer* obs) { observers_.RemoveObserver(obs); } + // Returns the cached loyalty cards from the database. // // The cache is populated asynchronously after the construction of this @@ -60,6 +71,9 @@ // Handler method called with newly received loyalty cards. void OnLoyaltyCardsLoaded(const std::vector<LoyaltyCard>& loyalty_cards); + // Notify all observers that a change has occurred. + void NotifyObservers(); + const scoped_refptr<AutofillWebDataService> webdata_service_; base::ScopedObservation<AutofillWebDataService, @@ -69,6 +83,8 @@ // The ongoing `LoadLoyaltyCards()` query. WebDataServiceBase::Handle pending_query_{}; + base::ObserverList<Observer> observers_; + // The result of the last successful `LoadLoyaltyCards()` query. // Stored loyalty cards are sorted by merchant name. std::vector<LoyaltyCard> loyalty_cards_;
diff --git a/components/autofill/core/browser/data_manager/valuables/valuables_data_manager_test_api.h b/components/autofill/core/browser/data_manager/valuables/valuables_data_manager_test_api.h index 4507bf35..0538d0c 100644 --- a/components/autofill/core/browser/data_manager/valuables/valuables_data_manager_test_api.h +++ b/components/autofill/core/browser/data_manager/valuables/valuables_data_manager_test_api.h
@@ -25,6 +25,8 @@ std::move(loyalty_card)); } + void NotifyObservers() { valuables_data_manager_->NotifyObservers(); } + private: const raw_ref<ValuablesDataManager> valuables_data_manager_; };
diff --git a/components/autofill/core/browser/data_manager/valuables/valuables_data_manager_unittest.cc b/components/autofill/core/browser/data_manager/valuables/valuables_data_manager_unittest.cc index f750760..01a8962 100644 --- a/components/autofill/core/browser/data_manager/valuables/valuables_data_manager_unittest.cc +++ b/components/autofill/core/browser/data_manager/valuables/valuables_data_manager_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "base/functional/callback_helpers.h" +#include "base/scoped_observation.h" #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "components/autofill/core/browser/data_model/valuables/loyalty_card.h" @@ -28,6 +29,18 @@ using ::testing::IsEmpty; using ::testing::UnorderedElementsAre; +class MockValuablesDataManagerObserver : public ValuablesDataManager::Observer { + public: + MockValuablesDataManagerObserver() = default; + MockValuablesDataManagerObserver(const MockValuablesDataManagerObserver&) = + delete; + MockValuablesDataManagerObserver& operator=( + const MockValuablesDataManagerObserver&) = delete; + ~MockValuablesDataManagerObserver() override = default; + + MOCK_METHOD(void, OnValuablesDataChanged, (), (override)); +}; + class ValuablesDataManagerTest : public testing::Test { public: ValuablesDataManagerTest() { @@ -47,10 +60,10 @@ private: base::test::TaskEnvironment task_environment_; - raw_ptr<ValuablesTable> valuables_table_; - std::unique_ptr<AutofillWebDataServiceTestHelper> helper_; base::test::ScopedFeatureList scoped_feature_list{ syncer::kSyncAutofillLoyaltyCard}; + raw_ptr<ValuablesTable> valuables_table_; + std::unique_ptr<AutofillWebDataServiceTestHelper> helper_; }; // Tests that the `ValuablesDataManager` correctly loads loyalty cards from the @@ -80,6 +93,13 @@ EXPECT_THAT(valuables_data_manager.GetLoyaltyCards(), UnorderedElementsAre(card1)); + MockValuablesDataManagerObserver observer; + base::ScopedObservation<ValuablesDataManager, + MockValuablesDataManagerObserver> + observation{&observer}; + observation.Observe(&valuables_data_manager); + EXPECT_CALL(observer, OnValuablesDataChanged); + const LoyaltyCard card2 = test::CreateLoyaltyCard2(); // Loyalty cards are passed unsorted by sync. valuables_table().SetLoyaltyCards({card2, card1});
diff --git a/components/autofill/core/browser/foundations/autofill_client.cc b/components/autofill/core/browser/foundations/autofill_client.cc index 7b13eb32..e3f49a7 100644 --- a/components/autofill/core/browser/foundations/autofill_client.cc +++ b/components/autofill/core/browser/foundations/autofill_client.cc
@@ -14,7 +14,7 @@ #include "components/autofill/core/browser/filling/filling_product.h" #include "components/autofill/core/browser/integrators/autofill_ai/autofill_ai_delegate.h" #include "components/autofill/core/browser/integrators/compose/autofill_compose_delegate.h" -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" #include "components/autofill/core/browser/integrators/plus_addresses/autofill_plus_address_delegate.h" #include "components/autofill/core/browser/payments/credit_card_access_manager.h" #include "components/autofill/core/browser/studies/autofill_ablation_study.h"
diff --git a/components/autofill/core/browser/foundations/autofill_client.h b/components/autofill/core/browser/foundations/autofill_client.h index c0f164d..ee512b8 100644 --- a/components/autofill/core/browser/foundations/autofill_client.h +++ b/components/autofill/core/browser/foundations/autofill_client.h
@@ -25,7 +25,7 @@ #include "components/autofill/core/browser/data_manager/valuables/valuables_data_manager.h" #include "components/autofill/core/browser/filling/filling_product.h" #include "components/autofill/core/browser/integrators/fast_checkout/fast_checkout_client.h" -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" #include "components/autofill/core/browser/integrators/password_form_classification.h" #include "components/autofill/core/browser/suggestions/suggestion.h" #include "components/autofill/core/browser/suggestions/suggestion_hiding_reason.h"
diff --git a/components/autofill/core/browser/foundations/browser_autofill_manager_unittest.cc b/components/autofill/core/browser/foundations/browser_autofill_manager_unittest.cc index da85da9..ae35ceb3 100644 --- a/components/autofill/core/browser/foundations/browser_autofill_manager_unittest.cc +++ b/components/autofill/core/browser/foundations/browser_autofill_manager_unittest.cc
@@ -74,8 +74,8 @@ #include "components/autofill/core/browser/integrators/autofill_ai/mock_autofill_ai_delegate.h" #include "components/autofill/core/browser/integrators/compose/autofill_compose_delegate.h" #include "components/autofill/core/browser/integrators/compose/mock_autofill_compose_delegate.h" -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" -#include "components/autofill/core/browser/integrators/mock_identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.h" #include "components/autofill/core/browser/integrators/optimization_guide/mock_autofill_optimization_guide.h" #include "components/autofill/core/browser/integrators/password_form_classification.h" #include "components/autofill/core/browser/integrators/plus_addresses/autofill_plus_address_delegate.h" @@ -8159,6 +8159,10 @@ {.fields = {{.role = EMAIL_ADDRESS, .autocomplete_attribute = "email"}}}); FormsSeen({form}); OnAskForValuesToFill(form, form.fields()[0]); + EXPECT_TRUE(external_delegate()->on_suggestions_returned_seen()); + EXPECT_THAT( + external_delegate()->suggestions(), + Not(Contains(EqualsSuggestion(SuggestionType::kIdentityCredential)))); } // Tests that plus address suggestions are queried and shown for email fields
diff --git a/components/autofill/core/browser/foundations/test_autofill_client.h b/components/autofill/core/browser/foundations/test_autofill_client.h index ddf202b3..e7a14518 100644 --- a/components/autofill/core/browser/foundations/test_autofill_client.h +++ b/components/autofill/core/browser/foundations/test_autofill_client.h
@@ -34,7 +34,7 @@ #include "components/autofill/core/browser/foundations/autofill_driver_factory.h" #include "components/autofill/core/browser/integrators/autofill_ai/mock_autofill_ai_delegate.h" #include "components/autofill/core/browser/integrators/fast_checkout/mock_fast_checkout_client.h" -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" #include "components/autofill/core/browser/integrators/optimization_guide/mock_autofill_optimization_guide.h" #include "components/autofill/core/browser/integrators/plus_addresses/autofill_plus_address_delegate.h" #include "components/autofill/core/browser/logging/log_manager.h"
diff --git a/components/autofill/core/browser/integrators/identity_credential_delegate.h b/components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h similarity index 95% rename from components/autofill/core/browser/integrators/identity_credential_delegate.h rename to components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h index 0eb738b9..2627f02 100644 --- a/components/autofill/core/browser/integrators/identity_credential_delegate.h +++ b/components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_DELEGATE_H_ -#define COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_DELEGATE_H_ +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_IDENTITY_CREDENTIAL_DELEGATE_H_ +#define COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_IDENTITY_CREDENTIAL_DELEGATE_H_ #include <vector> @@ -58,4 +58,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_DELEGATE_H_ +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_IDENTITY_CREDENTIAL_DELEGATE_H_
diff --git a/components/autofill/core/browser/integrators/mock_identity_credential_delegate.cc b/components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.cc similarity index 75% rename from components/autofill/core/browser/integrators/mock_identity_credential_delegate.cc rename to components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.cc index 0f03bd62..bcc6a21 100644 --- a/components/autofill/core/browser/integrators/mock_identity_credential_delegate.cc +++ b/components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/autofill/core/browser/integrators/mock_identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.h" namespace autofill {
diff --git a/components/autofill/core/browser/integrators/mock_identity_credential_delegate.h b/components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.h similarity index 71% rename from components/autofill/core/browser/integrators/mock_identity_credential_delegate.h rename to components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.h index edb37ee..b0191d8 100644 --- a/components/autofill/core/browser/integrators/mock_identity_credential_delegate.h +++ b/components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.h
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_MOCK_IDENTITY_CREDENTIAL_DELEGATE_H_ -#define COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_MOCK_IDENTITY_CREDENTIAL_DELEGATE_H_ +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_MOCK_IDENTITY_CREDENTIAL_DELEGATE_H_ +#define COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_MOCK_IDENTITY_CREDENTIAL_DELEGATE_H_ -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" #include "components/autofill/core/browser/suggestions/suggestion.h" #include "components/autofill/core/common/form_field_data.h" #include "testing/gmock/include/gmock/gmock.h" @@ -30,4 +30,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_MOCK_IDENTITY_CREDENTIAL_DELEGATE_H_ +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_INTEGRATORS_IDENTITY_CREDENTIAL_MOCK_IDENTITY_CREDENTIAL_DELEGATE_H_
diff --git a/components/autofill/core/browser/ui/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/ui/autofill_external_delegate_unittest.cc index cb562b6e..1f3b03f3 100644 --- a/components/autofill/core/browser/ui/autofill_external_delegate_unittest.cc +++ b/components/autofill/core/browser/ui/autofill_external_delegate_unittest.cc
@@ -43,7 +43,7 @@ #include "components/autofill/core/browser/integrators/autofill_ai/mock_autofill_ai_delegate.h" #include "components/autofill/core/browser/integrators/compose/autofill_compose_delegate.h" #include "components/autofill/core/browser/integrators/compose/mock_autofill_compose_delegate.h" -#include "components/autofill/core/browser/integrators/mock_identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.h" #include "components/autofill/core/browser/integrators/plus_addresses/autofill_plus_address_delegate.h" #include "components/autofill/core/browser/integrators/plus_addresses/mock_autofill_plus_address_delegate.h" #include "components/autofill/core/browser/metrics/autofill_in_devtools_metrics.h"
diff --git a/components/autofill/core/common/autofill_features.h b/components/autofill/core/common/autofill_features.h index 8e30687b..507d2ad 100644 --- a/components/autofill/core/common/autofill_features.h +++ b/components/autofill/core/common/autofill_features.h
@@ -286,6 +286,15 @@ COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kUseSettingsAddressEditorInPaymentsRequest); +// Identifies different strings that can be used in the CTA button for the +// Autofill Iph. +enum class AutofillIphCTAVariationsStringVarations { + kSeeHow = 0, + kTurnOn = 1, + kTryIt = 2, + kMaxValue = kTryIt +}; + #if BUILDFLAG(IS_ANDROID) COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillDeepLinkAutofillOptions);
diff --git a/components/autofill_prediction_improvements_strings.grdp b/components/autofill_prediction_improvements_strings.grdp index 9efd2f6..a631c12b 100644 --- a/components/autofill_prediction_improvements_strings.grdp +++ b/components/autofill_prediction_improvements_strings.grdp
@@ -130,6 +130,12 @@ <message name="IDS_AUTOFILL_AI_OPT_IN_IPH_SEE_HOW" desc="The right of two buttons that’s the user’s path learning more and turning on Autofill with AI. This button label should pair with the title (in other words, assume the user doesn’t read the body text. Does the title and primary button label make sense together)?"> See how </message> + <message name="IDS_AUTOFILL_AI_OPT_IN_IPH_TURN_ON" desc="The right of two buttons that’s the user’s path learning more and turning on Autofill with AI. This button label should pair with the title (in other words, assume the user doesn’t read the body text. Does the title and primary button label make sense together)?"> + Turn on + </message> + <message name="IDS_AUTOFILL_AI_OPT_IN_IPH_TRY_IT" desc="The right of two buttons that’s the user’s path learning more and turning on Autofill with AI. This button label should pair with the title (in other words, assume the user doesn’t read the body text. Does the title and primary button label make sense together)?"> + Try it + </message> <message name="IDS_AUTOFILL_AI_OPT_IN_IPH_MAYBE_LATER" desc="The left of two buttons that’s essentially the user’s path to not learning more or turning on Autofill with AI. “Maybe later” conveys that the user won’t do it now but that they’ll have the choice to do it later. Localizer has existing translations of this button label."> Maybe later </message> @@ -168,10 +174,10 @@ Fill more fields faster </message> <message name="IDS_AUTOFILL_AI_FFR_WHEN_ON_DESCRIPTION" desc="Body text beneath the “Fill more fields faster” sub title. This conveys the value of using ‘Autofill with AI’."> - Autofill with AI understands forms better and can autofill them faster for you. + Autofill with AI understands forms better and can autofill them faster for you </message> <message name="IDS_AUTOFILL_AI_FFR_CONSIDER_DESCRIPTION" desc="Body text beneath the “Things to consider” sub title. This describes to users things they might want to weigh before using this feature. Ideally, we lead with ‘To offer suggestions’, because it redefines the value of ‘Autofill with AI’ and offers a rationale for the data use that immediately follows. The data used includes 1) the URL of a page visited and 2) the content of that page. Both are shared from Chrome to a Google service that generates autofill suggestions. Inludes a placeholder for a learn more link, $1 = IDS_AUTOFILL_AI_FFR_CONSIDER_LEARN_MORE"> - To offer suggestions, sites you visit and page content are shared with Google. Change your mind anytime and <ph name="LEARN_MORE">$1<ex>learn more about autofill with AI in settings</ex></ph>. + To offer suggestions and improve this feature, the page’s URL and content are shared with Google. Change your mind anytime and <ph name="LEARN_MORE">$1<ex>learn more about autofill with AI in settings</ex></ph>. </message> <message name="IDS_AUTOFILL_AI_FFR_CONSIDER_LEARN_MORE" desc="Link for the Autofill AI settings page to learn more about this feature."> learn more about autofill with AI in settings
diff --git a/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_FFR_CONSIDER_DESCRIPTION.png.sha1 b/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_FFR_CONSIDER_DESCRIPTION.png.sha1 index 2d48b60..877b072 100644 --- a/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_FFR_CONSIDER_DESCRIPTION.png.sha1 +++ b/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_FFR_CONSIDER_DESCRIPTION.png.sha1
@@ -1 +1 @@ -a97738bda7032f86545355aa2eef416556321481 \ No newline at end of file +6b83b9b51fd09d4ff12510de3fd3ae8c21387b51 \ No newline at end of file
diff --git a/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_FFR_WHEN_ON_DESCRIPTION.png.sha1 b/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_FFR_WHEN_ON_DESCRIPTION.png.sha1 index 2d48b60..877b072 100644 --- a/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_FFR_WHEN_ON_DESCRIPTION.png.sha1 +++ b/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_FFR_WHEN_ON_DESCRIPTION.png.sha1
@@ -1 +1 @@ -a97738bda7032f86545355aa2eef416556321481 \ No newline at end of file +6b83b9b51fd09d4ff12510de3fd3ae8c21387b51 \ No newline at end of file
diff --git a/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_OPT_IN_IPH_TRY_IT.png.sha1 b/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_OPT_IN_IPH_TRY_IT.png.sha1 new file mode 100644 index 0000000..7a8e4de --- /dev/null +++ b/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_OPT_IN_IPH_TRY_IT.png.sha1
@@ -0,0 +1 @@ +4d4cf0d65e09427feccba337d576ba5c4385cb1c \ No newline at end of file
diff --git a/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_OPT_IN_IPH_TURN_ON.png.sha1 b/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_OPT_IN_IPH_TURN_ON.png.sha1 new file mode 100644 index 0000000..8335f03e --- /dev/null +++ b/components/autofill_prediction_improvements_strings_grdp/IDS_AUTOFILL_AI_OPT_IN_IPH_TURN_ON.png.sha1
@@ -0,0 +1 @@ +430dd9c669889a2a91f75b24a7e2cf7d20884247 \ No newline at end of file
diff --git a/components/certificate_transparency/data/log_list.json b/components/certificate_transparency/data/log_list.json index db4e983b..d8b8b1b2 100644 --- a/components/certificate_transparency/data/log_list.json +++ b/components/certificate_transparency/data/log_list.json
@@ -1,6 +1,6 @@ { - "version": "53.20", - "log_list_timestamp": "2025-04-22T12:54:41Z", + "version": "53.23", + "log_list_timestamp": "2025-04-24T12:54:26Z", "operators": [ { "name": "Google",
diff --git a/components/collaboration/internal/messaging/tab_group_change_notifier_impl.cc b/components/collaboration/internal/messaging/tab_group_change_notifier_impl.cc index cbd604e..ab190a1d 100644 --- a/components/collaboration/internal/messaging/tab_group_change_notifier_impl.cc +++ b/components/collaboration/internal/messaging/tab_group_change_notifier_impl.cc
@@ -131,7 +131,9 @@ tab_groups::TabGroupSyncService* tab_group_sync_service, signin::IdentityManager* identity_manager) : tab_group_sync_service_(tab_group_sync_service), - identity_manager_(identity_manager) {} + identity_manager_(identity_manager) { + CHECK(tab_group_sync_service_); +} TabGroupChangeNotifierImpl::~TabGroupChangeNotifierImpl() = default;
diff --git a/components/consent_auditor/consent_sync_bridge_impl.cc b/components/consent_auditor/consent_sync_bridge_impl.cc index 69aa6045..5b92c49 100644 --- a/components/consent_auditor/consent_sync_bridge_impl.cc +++ b/components/consent_auditor/consent_sync_bridge_impl.cc
@@ -89,7 +89,7 @@ EntityChangeList entity_data) { DCHECK(entity_data.empty()); DCHECK(change_processor()->IsTrackingMetadata()); - DCHECK(!change_processor()->TrackedAccountId().empty()); + DCHECK(!change_processor()->TrackedGaiaId().empty()); ResubmitAllData(); return ApplyIncrementalSyncChanges(std::move(metadata_change_list), std::move(entity_data)); @@ -174,7 +174,7 @@ } void ConsentSyncBridgeImpl::ResubmitAllData() { - DCHECK(!change_processor()->TrackedAccountId().empty()); + DCHECK(!change_processor()->TrackedGaiaId().empty()); DCHECK(change_processor()->IsTrackingMetadata()); CHECK(store_); @@ -182,7 +182,9 @@ store_->CreateWriteBatch(); for (const auto& [storage_key, specifics] : store_->in_memory_data()) { - if (specifics.account_id() == change_processor()->TrackedAccountId()) { + // TODO(crbug.com/383089506): rename account_id to obfuscated_gaia_id. + if (specifics.account_id() == + change_processor()->TrackedGaiaId().ToString()) { auto specifics_copy = std::make_unique<UserConsentSpecifics>(specifics); change_processor()->Put(storage_key, MoveToEntityData(std::move(specifics_copy)), @@ -226,7 +228,8 @@ store_->CreateWriteBatch(); batch->WriteData(storage_key, *specifics); - if (specifics->account_id() == change_processor()->TrackedAccountId()) { + if (specifics->account_id() == + change_processor()->TrackedGaiaId().ToString()) { change_processor()->Put(storage_key, MoveToEntityData(std::move(specifics)), batch->GetMetadataChangeList()); } @@ -262,7 +265,7 @@ store_ = std::move(store); change_processor()->ModelReadyToSync(std::move(metadata_batch)); - if (!change_processor()->TrackedAccountId().empty()) { + if (!change_processor()->TrackedGaiaId().empty()) { // Resubmit all data in case the client crashed immediately after // MergeFullSyncData(), where submissions are supposed to happen and // metadata populated.
diff --git a/components/consent_auditor/consent_sync_bridge_impl_unittest.cc b/components/consent_auditor/consent_sync_bridge_impl_unittest.cc index 3115e4d..36401ce 100644 --- a/components/consent_auditor/consent_sync_bridge_impl_unittest.cc +++ b/components/consent_auditor/consent_sync_bridge_impl_unittest.cc
@@ -17,6 +17,7 @@ #include "components/sync/protocol/user_consent_specifics.pb.h" #include "components/sync/test/data_type_store_test_util.h" #include "components/sync/test/mock_data_type_local_change_processor.h" +#include "google_apis/gaia/gaia_id.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -51,6 +52,8 @@ using testing::WithArg; using WriteBatch = DataTypeStore::WriteBatch; +constexpr GaiaId::Literal kDefaultGaiaId("gaia_id"); + MATCHER_P(MatchesUserConsent, expected, "") { if (!arg.has_user_consent()) { *result_listener << "which is not a user consent"; @@ -67,7 +70,7 @@ UserConsentSpecifics CreateSpecifics(int64_t client_consent_time_usec) { UserConsentSpecifics specifics; specifics.set_client_consent_time_usec(client_consent_time_usec); - specifics.set_account_id("account_id"); + specifics.set_account_id(kDefaultGaiaId.ToString()); return specifics; } @@ -97,7 +100,7 @@ std::move(store_factory), mock_processor_.CreateForwardingProcessor()); } - void WaitUntilModelReadyToSync(const std::string& account_id) { + void WaitUntilModelReadyToSync(const GaiaId& account_id) { base::RunLoop loop; base::RepeatingClosure quit_closure = loop.QuitClosure(); // Let the bridge initialize fully, which should run ModelReadyToSync(). @@ -105,7 +108,7 @@ .WillByDefault(InvokeWithoutArgs([=]() { quit_closure.Run(); })); loop.Run(); ON_CALL(*processor(), IsTrackingMetadata()).WillByDefault(Return(true)); - ON_CALL(*processor(), TrackedAccountId()).WillByDefault(Return(account_id)); + ON_CALL(*processor(), TrackedGaiaId()).WillByDefault(Return(account_id)); } static std::string GetStorageKey(const UserConsentSpecifics& specifics) { @@ -152,11 +155,11 @@ TEST_F(ConsentSyncBridgeImplTest, ShouldCallModelReadyToSyncOnStartup) { EXPECT_CALL(*processor(), ModelReadyToSync(NotNull())); - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); } TEST_F(ConsentSyncBridgeImplTest, ShouldGetDataForCommit) { - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); const UserConsentSpecifics specifics( CreateSpecifics(/*client_consent_time_usec=*/1u)); std::string storage_key; @@ -172,7 +175,7 @@ } TEST_F(ConsentSyncBridgeImplTest, ShouldRecordSingleConsent) { - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); const UserConsentSpecifics specifics( CreateSpecifics(/*client_consent_time_usec=*/1u)); std::string storage_key; @@ -187,7 +190,7 @@ } TEST_F(ConsentSyncBridgeImplTest, ShouldNotDeleteConsentsWhenSyncIsDisabled) { - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); UserConsentSpecifics user_consent_specifics( CreateSpecifics(/*client_consent_time_usec=*/2u)); bridge()->RecordConsent( @@ -205,7 +208,7 @@ TEST_F(ConsentSyncBridgeImplTest, ShouldRecordMultipleConsentsAndDeduplicateByTime) { - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); std::set<std::string> unique_storage_keys; EXPECT_CALL(*processor(), Put(_, _, _)) .Times(4) @@ -227,7 +230,7 @@ TEST_F(ConsentSyncBridgeImplTest, ShouldDeleteCommitedConsentsAfterApplyIncrementalSyncChanges) { - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); std::string first_storage_key; std::string second_storage_key; EXPECT_CALL(*processor(), Put(_, _, _)) @@ -250,14 +253,14 @@ } TEST_F(ConsentSyncBridgeImplTest, ShouldRecordConsentsBeforeSyncEnabled) { - WaitUntilModelReadyToSync(/*account_id=*/""); + WaitUntilModelReadyToSync(GaiaId()); // The consent must be recorded, but not propagated anywhere while the // initialization is in progress and sync is still disabled. EXPECT_CALL(*processor(), Put(_, _, _)).Times(0); bridge()->RecordConsent(SpecificsUniquePtr(/*client_consent_time_usec=*/1u)); // When sync is enabled, the consent should be reported to the processor. ON_CALL(*processor(), IsTrackingMetadata()).WillByDefault(Return(true)); - ON_CALL(*processor(), TrackedAccountId()).WillByDefault(Return("account_id")); + ON_CALL(*processor(), TrackedGaiaId()).WillByDefault(Return(kDefaultGaiaId)); EXPECT_CALL(*processor(), Put(_, _, _)); bridge()->MergeFullSyncData(WriteBatch::CreateMetadataChangeList(), EntityChangeList()); @@ -272,10 +275,10 @@ UserConsentSpecifics first_consent = CreateSpecifics(/*client_consent_time_usec=*/1u); - first_consent.set_account_id("account_id"); + first_consent.set_account_id(kDefaultGaiaId.ToString()); UserConsentSpecifics second_consent = CreateSpecifics(/*client_consent_time_usec=*/2u); - second_consent.set_account_id("account_id"); + second_consent.set_account_id(kDefaultGaiaId.ToString()); // Record consent before the store is initialized (ModelReadyToSync() not // called yet). @@ -284,7 +287,7 @@ // Wait until the store is initialized. EXPECT_CALL(*processor(), ModelReadyToSync(NotNull())); - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); // Record consent after initializaiton is done. bridge()->RecordConsent( @@ -301,11 +304,11 @@ TEST_F(ConsentSyncBridgeImplTest, ShouldReportPreviouslyPersistedConsentsWhenSyncIsReenabled) { - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); UserConsentSpecifics consent = CreateSpecifics(/*client_consent_time_usec=*/1u); - consent.set_account_id("account_id"); + consent.set_account_id(kDefaultGaiaId.ToString()); bridge()->RecordConsent(std::make_unique<UserConsentSpecifics>(consent)); @@ -319,7 +322,7 @@ // Reenable sync. EXPECT_CALL(*processor(), Put(GetStorageKey(consent), _, _)); - ON_CALL(*processor(), TrackedAccountId()).WillByDefault(Return("account_id")); + ON_CALL(*processor(), TrackedGaiaId()).WillByDefault(Return(kDefaultGaiaId)); bridge()->MergeFullSyncData(WriteBatch::CreateMetadataChangeList(), EntityChangeList()); @@ -330,10 +333,10 @@ TEST_F(ConsentSyncBridgeImplTest, ShouldReportPersistedConsentsOnStartupWithSyncAlreadyEnabled) { // Persist a consent while sync is enabled. - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(kDefaultGaiaId); UserConsentSpecifics consent = CreateSpecifics(/*client_consent_time_usec=*/1u); - consent.set_account_id("account_id"); + consent.set_account_id(kDefaultGaiaId.ToString()); bridge()->RecordConsent(std::make_unique<UserConsentSpecifics>(consent)); base::RunLoop().RunUntilIdle(); ASSERT_THAT(GetAllDataForDebugging(), SizeIs(1)); @@ -348,10 +351,10 @@ TEST_F(ConsentSyncBridgeImplTest, ShouldReportPersistedConsentsOnSyncEnabled) { // Persist a consent before sync is enabled. - WaitUntilModelReadyToSync(/*account=id=*/""); + WaitUntilModelReadyToSync(GaiaId()); UserConsentSpecifics consent = CreateSpecifics(/*client_consent_time_usec=*/1u); - consent.set_account_id("account_id"); + consent.set_account_id(kDefaultGaiaId.ToString()); bridge()->RecordConsent(std::make_unique<UserConsentSpecifics>(consent)); base::RunLoop().RunUntilIdle(); ASSERT_THAT(GetAllDataForDebugging(), SizeIs(1)); @@ -360,11 +363,11 @@ // until sync is enabled. EXPECT_CALL(*processor(), Put(_, _, _)).Times(0); ResetBridge(); - WaitUntilModelReadyToSync(/*account_id=*/""); + WaitUntilModelReadyToSync(GaiaId()); // Enable sync. EXPECT_CALL(*processor(), Put(GetStorageKey(consent), _, _)); - ON_CALL(*processor(), TrackedAccountId()).WillByDefault(Return("account_id")); + ON_CALL(*processor(), TrackedGaiaId()).WillByDefault(Return(kDefaultGaiaId)); bridge()->MergeFullSyncData(WriteBatch::CreateMetadataChangeList(), EntityChangeList()); base::RunLoop().RunUntilIdle(); @@ -372,10 +375,13 @@ TEST_F(ConsentSyncBridgeImplTest, ShouldResubmitPersistedConsentOnlyIfSameAccount) { - WaitUntilModelReadyToSync("first_account"); + const GaiaId kFirstGaiaId("first_gaia_id"); + const GaiaId kSecondGaiaId("second_gaia_id"); + + WaitUntilModelReadyToSync(kFirstGaiaId); UserConsentSpecifics user_consent_specifics( CreateSpecifics(/*client_consent_time_usec=*/2u)); - user_consent_specifics.set_account_id("first_account"); + user_consent_specifics.set_account_id(kFirstGaiaId.ToString()); bridge()->RecordConsent( std::make_unique<UserConsentSpecifics>(user_consent_specifics)); ASSERT_THAT(GetAllDataForDebugging(), SizeIs(1)); @@ -391,8 +397,7 @@ // The previous account consent should not be resubmited, because the new sync // account is different. EXPECT_CALL(*processor(), Put(_, _, _)).Times(0); - ON_CALL(*processor(), TrackedAccountId()) - .WillByDefault(Return("second_account")); + ON_CALL(*processor(), TrackedGaiaId()).WillByDefault(Return(kSecondGaiaId)); bridge()->MergeFullSyncData(WriteBatch::CreateMetadataChangeList(), EntityChangeList()); base::RunLoop().RunUntilIdle(); @@ -403,8 +408,7 @@ // This time their consent should be resubmitted, because it is for the same // account. EXPECT_CALL(*processor(), Put(GetStorageKey(user_consent_specifics), _, _)); - ON_CALL(*processor(), TrackedAccountId()) - .WillByDefault(Return("first_account")); + ON_CALL(*processor(), TrackedGaiaId()).WillByDefault(Return(kFirstGaiaId)); bridge()->MergeFullSyncData(WriteBatch::CreateMetadataChangeList(), EntityChangeList()); // The bridge may asynchronously query the store to choose what to resubmit.
diff --git a/components/content_settings/core/browser/content_settings_uma_util.cc b/components/content_settings/core/browser/content_settings_uma_util.cc index 5add5914..f3cb3ed 100644 --- a/components/content_settings/core/browser/content_settings_uma_util.cc +++ b/components/content_settings/core/browser/content_settings_uma_util.cc
@@ -177,6 +177,8 @@ // when new providers are added. case ProviderType::kWebuiAllowlistProvider: return "WebuiAllowlistProvider"; + case ProviderType::kComponentExtensionProvider: + return "ComponentExtensionProvider"; case ProviderType::kPolicyProvider: return "PolicyProvider"; case ProviderType::kSupervisedProvider:
diff --git a/components/content_settings/core/common/content_settings.h b/components/content_settings/core/common/content_settings.h index cbca4ca..d75de97d 100644 --- a/components/content_settings/core/common/content_settings.h +++ b/components/content_settings/core/common/content_settings.h
@@ -157,6 +157,7 @@ ProviderType provider_type) { switch (provider_type) { case ProviderType::kWebuiAllowlistProvider: + case ProviderType::kComponentExtensionProvider: return SettingSource::kAllowList; case ProviderType::kPolicyProvider: return SettingSource::kPolicy;
diff --git a/components/content_settings/core/common/content_settings_enums.mojom b/components/content_settings/core/common/content_settings_enums.mojom index ca16479..6edb5f5 100644 --- a/components/content_settings/core/common/content_settings_enums.mojom +++ b/components/content_settings/core/common/content_settings_enums.mojom
@@ -68,6 +68,7 @@ // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ProviderType enum ProviderType { kWebuiAllowlistProvider = 0, + kComponentExtensionProvider, kPolicyProvider, kSupervisedProvider, kCustomExtensionProvider,
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn index cbf079e..c0b2819 100644 --- a/components/cronet/android/BUILD.gn +++ b/components/cronet/android/BUILD.gn
@@ -1157,7 +1157,6 @@ # TODO(crbug.com/40283951): Modify quicroot.pem to become a build time copy of # net/data/ssl/certificates/cronet-quic-chain.pem. "test/res/raw/quicroot.pem", - "test/res/values/cronet-test-rule-configuration.xml", "test/res/values/strings.xml", "test/res/xml/network_security_config.xml", ]
diff --git a/components/cronet/android/java/src/org/chromium/net/impl/NativeCronetEngineBuilderImpl.java b/components/cronet/android/java/src/org/chromium/net/impl/NativeCronetEngineBuilderImpl.java index 391794d3..b120e21 100644 --- a/components/cronet/android/java/src/org/chromium/net/impl/NativeCronetEngineBuilderImpl.java +++ b/components/cronet/android/java/src/org/chromium/net/impl/NativeCronetEngineBuilderImpl.java
@@ -7,6 +7,7 @@ import android.content.Context; import android.os.SystemClock; +import org.chromium.build.BuildConfig; import org.chromium.net.ExperimentalCronetEngine; import org.chromium.net.ICronetEngineBuilder; import org.chromium.net.impl.CronetLogger.CronetSource; @@ -31,7 +32,7 @@ private static CronetSource computeCronetSource() { ClassLoader implClassLoader = CronetEngineBuilderImpl.class.getClassLoader(); - if (implClassLoader.toString().startsWith("java.lang.BootClassLoader")) { + if (BuildConfig.CRONET_FOR_AOSP_BUILD) { return CronetSource.CRONET_SOURCE_PLATFORM; }
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/BidirectionalStreamTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/BidirectionalStreamTest.java index d32fdb9..88d683d 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/BidirectionalStreamTest.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/BidirectionalStreamTest.java
@@ -29,6 +29,7 @@ import org.chromium.base.Log; import org.chromium.base.test.util.DoNotBatch; import org.chromium.base.test.util.RequiresRestart; +import org.chromium.build.BuildConfig; import org.chromium.net.CronetTestRule.BoolFlag; import org.chromium.net.CronetTestRule.CronetImplementation; import org.chromium.net.CronetTestRule.Flags; @@ -1009,7 +1010,7 @@ var oldMessage = "Invalid header header:name=headervalue"; var newMessage = "Invalid header with headername: header:name"; if (mTestRule.implementationUnderTest() == CronetImplementation.AOSP_PLATFORM - && !mTestRule.isRunningInAOSP()) { + && !BuildConfig.CRONET_FOR_AOSP_BUILD) { // We may be running against an HttpEngine backed by an old version of Cronet, so accept // both the old and new variants of the message. assertThat(e).hasMessageThat().isAnyOf(oldMessage, newMessage); @@ -1031,7 +1032,7 @@ var oldMessage = "Invalid header headername=bad header\r\nvalue"; var newMessage = "Invalid header with headername: headername"; if (mTestRule.implementationUnderTest() == CronetImplementation.AOSP_PLATFORM - && !mTestRule.isRunningInAOSP()) { + && !BuildConfig.CRONET_FOR_AOSP_BUILD) { // We may be running against an HttpEngine backed by an old version of Cronet, so accept // both the old and new variants of the message. assertThat(e).hasMessageThat().isAnyOf(oldMessage, newMessage);
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/CronetTestRule.java b/components/cronet/android/test/javatests/src/org/chromium/net/CronetTestRule.java index d1575b02..47aec4e8 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/CronetTestRule.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/CronetTestRule.java
@@ -30,6 +30,7 @@ import org.chromium.base.Log; import org.chromium.base.PathUtils; import org.chromium.base.test.util.DoNotBatch; +import org.chromium.build.BuildConfig; import org.chromium.net.httpflags.FlagValue; import org.chromium.net.httpflags.HttpFlagsInterceptor; import org.chromium.net.impl.CronetLibraryLoader; @@ -236,7 +237,8 @@ if (packageName.startsWith("org.chromium.net")) { for (CronetImplementation implementation : implementationsUnderTest) { - if (isRunningInAOSP() && implementation.equals(CronetImplementation.FALLBACK)) { + if (BuildConfig.CRONET_FOR_AOSP_BUILD + && implementation.equals(CronetImplementation.FALLBACK)) { // Skip executing tests for JavaCronetEngine. continue; } @@ -309,33 +311,6 @@ return flagsBuilder.build(); } - /** - * This method only returns the value of the `is_running_in_aosp` flag which for Chromium can be - * found inside components/cronet/android/test/res/values/cronet-test-rule-configuration.xml for - * which it should be equal to false. However, on AOSP, we ship a different value which is equal - * to true. - * - * <p>This distinction between where the tests are being executed is crucial because we don't - * want to run JavaCronetEngine tests in AOSP. - * - * @return True if the tests are being executed in AOSP. - */ - @SuppressWarnings("DiscouragedApi") - public boolean isRunningInAOSP() { - int resId = - ApplicationProvider.getApplicationContext() - .getResources() - .getIdentifier( - "is_running_in_aosp", - "bool", - ApplicationProvider.getApplicationContext().getPackageName()); - if (resId == 0) { - throw new IllegalStateException( - "Could not find any value for `is_running_in_aosp` boolean entry."); - } - return ApplicationProvider.getApplicationContext().getResources().getBoolean(resId); - } - private void evaluateWithFramework( Statement statement, String testName, boolean netLogEnabled, Description desc) throws Throwable {
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java index 2298b5c..1d89c7d 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java
@@ -34,6 +34,7 @@ import org.chromium.base.DeviceInfo; import org.chromium.base.Log; import org.chromium.base.test.util.DoNotBatch; +import org.chromium.build.BuildConfig; import org.chromium.net.CronetTestRule.BoolFlag; import org.chromium.net.CronetTestRule.CronetImplementation; import org.chromium.net.CronetTestRule.Flags; @@ -645,7 +646,7 @@ var oldMessage = "Invalid header header:name=headervalue"; var newMessage = "Invalid header with headername: header:name"; if (mTestRule.implementationUnderTest() == CronetImplementation.AOSP_PLATFORM - && !mTestRule.isRunningInAOSP()) { + && !BuildConfig.CRONET_FOR_AOSP_BUILD) { // We may be running against an HttpEngine backed by an old version of Cronet, so accept // both the old and new variants of the message. assertThat(e).hasMessageThat().isAnyOf(oldMessage, newMessage); @@ -688,7 +689,7 @@ var oldMessage = "Invalid header headername=bad header\r\nvalue"; var newMessage = "Invalid header with headername: headername"; if (mTestRule.implementationUnderTest() == CronetImplementation.AOSP_PLATFORM - && !mTestRule.isRunningInAOSP()) { + && !BuildConfig.CRONET_FOR_AOSP_BUILD) { // We may be running against an HttpEngine backed by an old version of Cronet, so accept // both the old and new variants of the message. assertThat(e).hasMessageThat().isAnyOf(oldMessage, newMessage);
diff --git a/components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedInfoTest.java b/components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedInfoTest.java index 18fb2489..11b8217 100644 --- a/components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedInfoTest.java +++ b/components/cronet/android/test/javatests/src/org/chromium/net/RequestFinishedInfoTest.java
@@ -21,6 +21,7 @@ import org.junit.runner.RunWith; import org.chromium.base.test.util.DoNotBatch; +import org.chromium.build.BuildConfig; import org.chromium.net.CronetTestRule.CronetImplementation; import org.chromium.net.CronetTestRule.IgnoreFor; import org.chromium.net.CronetTestRule.RequiresMinApi; @@ -459,7 +460,7 @@ var oldMessage = "Invalid header ="; var newMessage = "Invalid header with headername: "; if (mTestRule.implementationUnderTest() == CronetImplementation.AOSP_PLATFORM - && !mTestRule.isRunningInAOSP()) { + && !BuildConfig.CRONET_FOR_AOSP_BUILD) { // We may be running against an HttpEngine backed by an old version of Cronet, so accept // both the old and new variants of the message. assertThat(e).hasMessageThat().isAnyOf(oldMessage, newMessage);
diff --git a/components/cronet/android/test/res/values/cronet-test-rule-configuration.xml b/components/cronet/android/test/res/values/cronet-test-rule-configuration.xml deleted file mode 100644 index 68bde84..0000000 --- a/components/cronet/android/test/res/values/cronet-test-rule-configuration.xml +++ /dev/null
@@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <bool name="is_running_in_aosp">false</bool> -</resources> \ No newline at end of file
diff --git a/components/cronet/gn2bp/gen_android_bp.py b/components/cronet/gn2bp/gen_android_bp.py index b25974e..782fd355 100755 --- a/components/cronet/gn2bp/gen_android_bp.py +++ b/components/cronet/gn2bp/gen_android_bp.py
@@ -2764,7 +2764,7 @@ module_target.generated_headers.update(dep_module.generated_headers) module_target.shared_libs.update(dep_module.shared_libs) module_target.header_libs.update(dep_module.header_libs) - elif module.type == 'rust_ffi_static': + elif module.type in ('rust_ffi_static', 'rust_bindgen'): module_target.shared_libs.update(dep_module.shared_libs) else: raise Exception(
diff --git a/components/device_signals/core/common/signals_features.cc b/components/device_signals/core/common/signals_features.cc index 62b71ee..ff617f8 100644 --- a/components/device_signals/core/common/signals_features.cc +++ b/components/device_signals/core/common/signals_features.cc
@@ -22,6 +22,18 @@ "BrowserSignalsReportingEnabled", base::FEATURE_DISABLED_BY_DEFAULT); +// Controls whether a signals-only profile report will be triggered when a valid +// cookie change is observed. +constexpr base::FeatureParam<bool> kTriggerOnCookieChange{ + &kProfileSignalsReportingEnabled, "trigger_on_cookie_change", true}; + +// Controls the minimum interval that signals should be reported via profile +// reports. +// Example: "ProfileSignalsReportingEnabled:report_interval/3600" for 3600 +// seconds. +constexpr base::FeatureParam<base::TimeDelta> kProfileSignalsReportingInterval{ + &kProfileSignalsReportingEnabled, "report_interval", base::Hours(4)}; + bool IsProfileSignalsReportingEnabled() { return base::FeatureList::IsEnabled(kProfileSignalsReportingEnabled); }
diff --git a/components/device_signals/core/common/signals_features.h b/components/device_signals/core/common/signals_features.h index aa9022d..2182ce1 100644 --- a/components/device_signals/core/common/signals_features.h +++ b/components/device_signals/core/common/signals_features.h
@@ -16,6 +16,11 @@ BASE_DECLARE_FEATURE(kProfileSignalsReportingEnabled); BASE_DECLARE_FEATURE(kBrowserSignalsReportingEnabled); +// Signals reporting related feature parameters. +extern const base::FeatureParam<bool> kTriggerOnCookieChange; +extern const base::FeatureParam<base::TimeDelta> + kProfileSignalsReportingInterval; + // Returns true if additional device signals reporting for profile-level Chrome // reports has been enabled. bool IsProfileSignalsReportingEnabled();
diff --git a/components/dom_distiller/core/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerFeatures.java b/components/dom_distiller/core/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerFeatures.java index be85616..e9fbfc0 100644 --- a/components/dom_distiller/core/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerFeatures.java +++ b/components/dom_distiller/core/android/java/src/org/chromium/components/dom_distiller/core/DomDistillerFeatures.java
@@ -17,16 +17,19 @@ && sReaderModeImprovementsTriggerOnMobileFriendlyPages.getValue(); } + /** Returns whether reader mode should trigger on mobile friendly pages if it's distillable. */ + public static boolean showAlwaysOnEntryPoint() { + return sReaderModeImprovements.isEnabled() + && sReaderModeImprovementsAlwaysOnEntryPoint.getValue(); + } + // Feature names -- alphabetical ordering. public static final String READER_MODE_AUTO_DISTILL = "ReaderModeAutoDistill"; - public static final String READER_MODE_DEV_ENTRY_POINT = "ReaderModeDevEntryPoint"; public static final String READER_MODE_IMPROVEMENTS = "ReaderModeImprovements"; // Feature flags -- alphabetical ordering. public static final MutableFlagWithSafeDefault sReaderModeAutoDistill = newMutableFlagWithSafeDefault(READER_MODE_AUTO_DISTILL, /* defaultValue= */ false); - public static final MutableFlagWithSafeDefault sReaderModeDevEntryPoint = - newMutableFlagWithSafeDefault(READER_MODE_DEV_ENTRY_POINT, /* defaultValue= */ false); public static final MutableFlagWithSafeDefault sReaderModeImprovements = newMutableFlagWithSafeDefault(READER_MODE_IMPROVEMENTS, /* defaultValue= */ false);
diff --git a/components/dom_distiller/core/dom_distiller_features.cc b/components/dom_distiller/core/dom_distiller_features.cc index ca06041..1ff7f22 100644 --- a/components/dom_distiller/core/dom_distiller_features.cc +++ b/components/dom_distiller/core/dom_distiller_features.cc
@@ -35,10 +35,6 @@ "ReaderModeAutoDistill", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kReaderModeDevEntryPoint, - "ReaderModeDevEntryPoint", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kReaderModeImprovements, "ReaderModeImprovements", base::FEATURE_DISABLED_BY_DEFAULT); @@ -46,8 +42,7 @@ namespace android { static jlong JNI_DomDistillerFeatureMap_GetNativeMap(JNIEnv* env) { static const base::Feature* const kFeaturesExposedToJava[] = { - &kReaderModeAutoDistill, &kReaderModeDevEntryPoint, - &kReaderModeImprovements}; + &kReaderModeAutoDistill, &kReaderModeImprovements}; static base::NoDestructor<base::android::FeatureMap> kFeatureMap( kFeaturesExposedToJava); return reinterpret_cast<jlong>(kFeatureMap.get());
diff --git a/components/dom_distiller/core/dom_distiller_features.h b/components/dom_distiller/core/dom_distiller_features.h index 2b34e404..eb6ed2ba 100644 --- a/components/dom_distiller/core/dom_distiller_features.h +++ b/components/dom_distiller/core/dom_distiller_features.h
@@ -17,7 +17,6 @@ #if BUILDFLAG(IS_ANDROID) BASE_DECLARE_FEATURE(kReaderModeAutoDistill); -BASE_DECLARE_FEATURE(kReaderModeDevEntryPoint); BASE_DECLARE_FEATURE(kReaderModeImprovements); #endif
diff --git a/components/download/internal/background_service/ios/background_download_task_helper_unittest.mm b/components/download/internal/background_service/ios/background_download_task_helper_unittest.mm index 32a499a..1414ae76 100644 --- a/components/download/internal/background_service/ios/background_download_task_helper_unittest.mm +++ b/components/download/internal/background_service/ios/background_download_task_helper_unittest.mm
@@ -13,6 +13,7 @@ #import "base/sequence_checker.h" #import "base/test/bind.h" #import "base/test/gmock_callback_support.h" +#import "base/test/task_environment.h" #import "base/uuid.h" #import "components/download/internal/background_service/test/background_download_test_base.h" #import "components/download/public/background_service/download_params.h" @@ -56,6 +57,7 @@ BackgroundDownloadTaskHelper* helper() { return helper_.get(); } private: + base::test::TaskEnvironment task_environment_; std::unique_ptr<BackgroundDownloadTaskHelper> helper_; };
diff --git a/components/download/internal/background_service/test/background_download_test_base.h b/components/download/internal/background_service/test/background_download_test_base.h index bec779ee..bbcabe6 100644 --- a/components/download/internal/background_service/test/background_download_test_base.h +++ b/components/download/internal/background_service/test/background_download_test_base.h
@@ -9,7 +9,6 @@ #include "base/files/scoped_temp_dir.h" #include "base/sequence_checker.h" -#include "base/test/task_environment.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" @@ -46,7 +45,6 @@ std::unique_ptr<net::test_server::HttpResponse> NotFoundResponse( const net::test_server::HttpRequest& request); - base::test::TaskEnvironment task_environment_; net::EmbeddedTestServer server_; net::test_server::EmbeddedTestServerHandle server_handle_; std::unique_ptr<net::test_server::HttpRequest> request_sent_;
diff --git a/components/enterprise/BUILD.gn b/components/enterprise/BUILD.gn index b5a767d5..bbaad51 100644 --- a/components/enterprise/BUILD.gn +++ b/components/enterprise/BUILD.gn
@@ -83,6 +83,7 @@ deps = [ "//base", "//components/device_signals/core/browser:browser", + "//components/device_signals/core/common:features", "//components/policy/core/browser", "//components/policy/core/common", "//components/policy/proto",
diff --git a/components/enterprise/DEPS b/components/enterprise/DEPS index d0d985a..d32c280 100644 --- a/components/enterprise/DEPS +++ b/components/enterprise/DEPS
@@ -1,6 +1,7 @@ include_rules = [ "+components/download/public/common", "+components/device_signals/core/browser", + "+components/device_signals/core/common", "+components/policy", "+components/prefs", "+components/reporting/client",
diff --git a/components/enterprise/browser/reporting/chrome_profile_request_generator.cc b/components/enterprise/browser/reporting/chrome_profile_request_generator.cc index b0b28ff..bed2bc5e 100644 --- a/components/enterprise/browser/reporting/chrome_profile_request_generator.cc +++ b/components/enterprise/browser/reporting/chrome_profile_request_generator.cc
@@ -29,9 +29,10 @@ case SecuritySignalsMode::kNoSignals: return em::ChromeProfileReportRequest::PROFILE_REPORT; case SecuritySignalsMode::kSignalsAttached: - return em::ChromeProfileReportRequest::PROFILE_REPORT_WITH_SIGNALS; + return em::ChromeProfileReportRequest:: + PROFILE_REPORT_WITH_SECURITY_SIGNALS; case SecuritySignalsMode::kSignalsOnly: - return em::ChromeProfileReportRequest::PROFILE_SIGNALS; + return em::ChromeProfileReportRequest::PROFILE_SECURITY_SIGNALS; } }
diff --git a/components/enterprise/browser/reporting/chrome_profile_request_generator_unittest.cc b/components/enterprise/browser/reporting/chrome_profile_request_generator_unittest.cc index 6c755b19..1287b08d 100644 --- a/components/enterprise/browser/reporting/chrome_profile_request_generator_unittest.cc +++ b/components/enterprise/browser/reporting/chrome_profile_request_generator_unittest.cc
@@ -56,7 +56,8 @@ // True if a status report-exclusive field is expected to be filled correctly, // status reports with signals also count. bool expect_status_report_only_value = - expected_report_type != em::ChromeProfileReportRequest::PROFILE_SIGNALS; + expected_report_type != + em::ChromeProfileReportRequest::PROFILE_SECURITY_SIGNALS; bool expect_signals_override_value = expected_report_type != em::ChromeProfileReportRequest::PROFILE_REPORT; @@ -273,7 +274,7 @@ VerifyReportContent( test_future.Get(), - em::ChromeProfileReportRequest::PROFILE_REPORT_WITH_SIGNALS); + em::ChromeProfileReportRequest::PROFILE_REPORT_WITH_SECURITY_SIGNALS); } TEST_F(ChromeProfileRequestGeneratorTest, GenerateSecuritySignalsOnlyReport) { @@ -290,7 +291,7 @@ /*use_cookies=*/false), test_future.GetCallback()); VerifyReportContent(test_future.Get(), - em::ChromeProfileReportRequest::PROFILE_SIGNALS); + em::ChromeProfileReportRequest::PROFILE_SECURITY_SIGNALS); } TEST_F(ChromeProfileRequestGeneratorTest, IncorrectReportType) {
diff --git a/components/enterprise/browser/reporting/user_security_signals_service.cc b/components/enterprise/browser/reporting/user_security_signals_service.cc index 6e1288c..0611910 100644 --- a/components/enterprise/browser/reporting/user_security_signals_service.cc +++ b/components/enterprise/browser/reporting/user_security_signals_service.cc
@@ -5,6 +5,7 @@ #include "components/enterprise/browser/reporting/user_security_signals_service.h" #include "base/check.h" +#include "components/device_signals/core/common/signals_features.h" #include "components/enterprise/browser/reporting/common_pref_names.h" #include "components/enterprise/browser/reporting/report_scheduler.h" #include "components/enterprise/browser/reporting/report_util.h" @@ -13,12 +14,6 @@ #include "google_apis/gaia/gaia_urls.h" #include "net/cookies/cookie_change_dispatcher.h" -namespace { - -constexpr base::TimeDelta kSecurityUploadsInterval = base::Hours(4); - -} - namespace enterprise_reporting { UserSecuritySignalsService::UserSecuritySignalsService( @@ -32,7 +27,7 @@ UserSecuritySignalsService::~UserSecuritySignalsService() = default; base::TimeDelta UserSecuritySignalsService::GetSecurityUploadCadence() { - return kSecurityUploadsInterval; + return enterprise_signals::features::kProfileSignalsReportingInterval.Get(); } void UserSecuritySignalsService::Start() { @@ -76,6 +71,9 @@ void UserSecuritySignalsService::OnCookieChange( const net::CookieChangeInfo& change) { + if (!enterprise_signals::features::kTriggerOnCookieChange.Get()) { + return; + } // Only trigger a new upload if the cookie change could result in a new or // updated session. if (change.cause == net::CookieChangeCause::INSERTED) {
diff --git a/components/enterprise/connectors/core/BUILD.gn b/components/enterprise/connectors/core/BUILD.gn index 99a2eadc..3084f82 100644 --- a/components/enterprise/connectors/core/BUILD.gn +++ b/components/enterprise/connectors/core/BUILD.gn
@@ -91,6 +91,8 @@ testonly = true sources = [ + "realtime_reporting_test_server.cc", + "realtime_reporting_test_server.h", "reporting_test_utils.cc", "reporting_test_utils.h", ] @@ -98,10 +100,16 @@ deps = [ ":core", "//components/enterprise/common/proto:browser_events_proto", + "//components/enterprise/common/proto:upload_request_response", "//components/policy/core/common:common_constants", "//components/policy/core/common:test_support", + "//components/policy/proto", + "//components/policy/test_support", "//components/prefs", + "//net", + "//net:test_support", "//testing/gmock:gmock", + "//url", ] }
diff --git a/components/enterprise/connectors/core/realtime_reporting_test_server.cc b/components/enterprise/connectors/core/realtime_reporting_test_server.cc new file mode 100644 index 0000000..b5c6d47 --- /dev/null +++ b/components/enterprise/connectors/core/realtime_reporting_test_server.cc
@@ -0,0 +1,131 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/enterprise/connectors/core/realtime_reporting_test_server.h" + +#include <optional> + +#include "base/functional/bind.h" +#include "base/json/json_reader.h" +#include "base/values.h" +#include "net/http/http_status_code.h" + +namespace enterprise_connectors::test { + +namespace { + +using ::chrome::cros::reporting::proto::Event; +using ::chrome::cros::reporting::proto::LoginEvent; +using ::chrome::cros::reporting::proto::UploadEventsRequest; + +constexpr char kRealtimeReportingUrl[] = "/v1/events"; + +std::optional<Event> ParseEvent(const base::Value::Dict* event_json) { + if (!event_json) { + return std::nullopt; + } + Event event; + const base::Value::Dict* event_details_json; + // TODO(crbug.com/412683254): Add branches for other event types. + if ((event_details_json = event_json->FindDict("loginEvent"))) { + LoginEvent* login_event = event.mutable_login_event(); + const std::string* url = event_details_json->FindString("url"); + if (url) { + login_event->set_url(*url); + } + const std::string* login_user_name = + event_details_json->FindString("loginUserName"); + if (login_user_name) { + login_event->set_login_user_name(*login_user_name); + } + } else { + return std::nullopt; + } + return event; +} + +std::optional<UploadEventsRequest> ParseUploadEventsRequest( + const net::test_server::HttpRequest& request) { + UploadEventsRequest request_message; + if (request_message.ParseFromString(request.content)) { + return request_message; + } + + // Fall back to parsing the legacy JSON event format. For simplicity, ignore + // fields that aren't asserted by any test. + std::optional<base::Value::Dict> request_json = + base::JSONReader::ReadDict(request.content); + if (!request_json) { + return std::nullopt; + } + + ::chrome::cros::reporting::proto::Device* device = + request_message.mutable_device(); + const std::string* os_platform = + request_json->FindStringByDottedPath("device.osPlatform"); + if (os_platform) { + device->set_os_platform(*os_platform); + } + + const base::Value::List* events_json = request_json->FindList("events"); + if (events_json) { + for (const base::Value& event_json : *events_json) { + std::optional<Event> event = ParseEvent(event_json.GetIfDict()); + if (event) { + *request_message.add_events() = std::move(*event); + } + } + } + + return request_message; +} + +} // namespace + +RealtimeReportingTestServer::RealtimeReportingTestServer() + : http_server_(net::test_server::EmbeddedTestServer::TYPE_HTTP) { + http_server_.RegisterDefaultHandler(base::BindRepeating( + &RealtimeReportingTestServer::HandleRequest, base::Unretained(this))); +} + +RealtimeReportingTestServer::~RealtimeReportingTestServer() = default; + +GURL RealtimeReportingTestServer::GetServiceURL() const { + return http_server_.GetURL(kRealtimeReportingUrl); +} + +bool RealtimeReportingTestServer::Start() { + return !!(http_server_handle_ = http_server_.StartAndReturnHandle()); +} + +std::vector<UploadEventsRequest> +RealtimeReportingTestServer::GetUploadedReports() { + base::AutoLock guard(reports_lock_); + std::vector<UploadEventsRequest> reports(reports_); + return reports; +} + +std::unique_ptr<net::test_server::HttpResponse> +RealtimeReportingTestServer::HandleRequest( + const net::test_server::HttpRequest& request) { + if (!request.relative_url.starts_with(kRealtimeReportingUrl)) { + return nullptr; + } + + auto response = std::make_unique<net::test_server::BasicHttpResponse>(); + std::optional<UploadEventsRequest> request_message = + ParseUploadEventsRequest(request); + if (!request_message) { + response->set_code(net::HttpStatusCode::HTTP_BAD_REQUEST); + return response; + } + + base::AutoLock guard(reports_lock_); + reports_.push_back(std::move(*request_message)); + // The client doesn't look at the response payload, so omit the + // `UploadEventsResponse` payload for simplicity. + return response; +} + +} // namespace enterprise_connectors::test
diff --git a/components/enterprise/connectors/core/realtime_reporting_test_server.h b/components/enterprise/connectors/core/realtime_reporting_test_server.h new file mode 100644 index 0000000..80d2fa4 --- /dev/null +++ b/components/enterprise/connectors/core/realtime_reporting_test_server.h
@@ -0,0 +1,56 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_ENTERPRISE_CONNECTORS_CORE_REALTIME_REPORTING_TEST_SERVER_H_ +#define COMPONENTS_ENTERPRISE_CONNECTORS_CORE_REALTIME_REPORTING_TEST_SERVER_H_ + +#include <vector> + +#include "base/synchronization/lock.h" +#include "components/enterprise/common/proto/upload_request_response.pb.h" +#include "net/test/embedded_test_server/embedded_test_server.h" + +class GURL; + +namespace net::test_server { +class HttpResponse; +struct HttpRequest; +} // namespace net::test_server + +namespace enterprise_connectors::test { + +// Fake realtime reporting server that integration tests can embed. +class RealtimeReportingTestServer { + public: + RealtimeReportingTestServer(); + ~RealtimeReportingTestServer(); + + // Get a suitable URL to pass to `--realtime-reporting-url`. + GURL GetServiceURL() const; + + // Bind the server to a port and start listening for requests. Returns true + // iff the server successfully started. + bool Start(); + + // Get the reports uploaded so far. + std::vector<::chrome::cros::reporting::proto::UploadEventsRequest> + GetUploadedReports(); + + private: + std::unique_ptr<net::test_server::HttpResponse> HandleRequest( + const net::test_server::HttpRequest& request); + + // `reports_lock_` guards accesses to `reports_`, which is written on the + // `http_server_` I/O thread and read on the test thread. + base::Lock reports_lock_; + std::vector<::chrome::cros::reporting::proto::UploadEventsRequest> reports_ + GUARDED_BY(reports_lock_); + + net::test_server::EmbeddedTestServer http_server_; + net::test_server::EmbeddedTestServerHandle http_server_handle_; +}; + +} // namespace enterprise_connectors::test + +#endif // COMPONENTS_ENTERPRISE_CONNECTORS_CORE_REALTIME_REPORTING_TEST_SERVER_H_
diff --git a/components/enterprise/connectors/core/reporting_test_utils.cc b/components/enterprise/connectors/core/reporting_test_utils.cc index b300241..bdf7dd2 100644 --- a/components/enterprise/connectors/core/reporting_test_utils.cc +++ b/components/enterprise/connectors/core/reporting_test_utils.cc
@@ -4,15 +4,20 @@ #include "components/enterprise/connectors/core/reporting_test_utils.h" +#include "base/json/json_writer.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "components/enterprise/common/proto/synced/browser_events.pb.h" #include "components/enterprise/connectors/core/common.h" #include "components/enterprise/connectors/core/connectors_prefs.h" #include "components/enterprise/connectors/core/realtime_reporting_client_base.h" #include "components/enterprise/connectors/core/reporting_constants.h" +#include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" #include "components/policy/core/common/cloud/realtime_reporting_job_configuration.h" #include "components/policy/core/common/policy_types.h" +#include "components/policy/proto/cloud_policy.pb.h" +#include "components/policy/test_support/policy_storage.h" #include "components/prefs/scoped_user_pref_update.h" #include "testing/gmock/include/gmock/gmock.h" @@ -39,6 +44,29 @@ return enabled_opt_in_events_list; } +base::Value::Dict CreateSecurityEventReportingSettings( + const std::set<std::string>& enabled_event_names, + const std::map<std::string, std::vector<std::string>>& + enabled_opt_in_events) { + base::Value::Dict settings; + + settings.Set(kKeyServiceProvider, base::Value("google")); + if (!enabled_event_names.empty()) { + base::Value::List enabled_event_name_list; + for (const auto& enabled_event_name : enabled_event_names) { + enabled_event_name_list.Append(enabled_event_name); + } + settings.Set(kKeyEnabledEventNames, std::move(enabled_event_name_list)); + } + + if (!enabled_opt_in_events.empty()) { + settings.Set(kKeyEnabledOptInEvents, + CreateOptInEventsList(enabled_opt_in_events)); + } + + return settings; +} + constexpr char kKeyURL[] = "url"; constexpr char kKeyEventResult[] = "eventResult"; constexpr char kKeyTriggeredRuleInfo[] = "triggeredRuleInfo"; @@ -72,29 +100,48 @@ return; } - base::Value::Dict settings; - - settings.Set(kKeyServiceProvider, base::Value("google")); - if (!enabled_event_names.empty()) { - base::Value::List enabled_event_name_list; - for (const auto& enabled_event_name : enabled_event_names) { - enabled_event_name_list.Append(enabled_event_name); - } - settings.Set(kKeyEnabledEventNames, std::move(enabled_event_name_list)); - } - - if (!enabled_opt_in_events.empty()) { - settings.Set(kKeyEnabledOptInEvents, - CreateOptInEventsList(enabled_opt_in_events)); - } - - settings_list->Append(std::move(settings)); + settings_list->Append(CreateSecurityEventReportingSettings( + enabled_event_names, enabled_opt_in_events)); prefs->SetInteger( kOnSecurityEventScopePref, machine_scope ? policy::POLICY_SCOPE_MACHINE : policy::POLICY_SCOPE_USER); } +std::unique_ptr<policy::EmbeddedPolicyTestServer> +CreatePolicyTestServerForSecurityEvents( + const std::set<std::string>& enabled_event_names, + const std::map<std::string, std::vector<std::string>>& + enabled_opt_in_events) { +#if BUILDFLAG(IS_FUCHSIA) + // Policy is not supported for Fuchsia yet. + return nullptr; +#else + base::Value::List reporting_settings = + base::Value::List().Append(CreateSecurityEventReportingSettings( + enabled_event_names, enabled_opt_in_events)); + std::optional<std::string> reporting_settings_payload = + base::WriteJson(reporting_settings); + if (!reporting_settings_payload) { + return nullptr; + } + + enterprise_management::CloudPolicySettings settings; + settings.mutable_onsecurityevententerpriseconnector() + ->mutable_policy_options() + ->set_mode(enterprise_management::PolicyOptions::MANDATORY); + settings.mutable_onsecurityevententerpriseconnector()->set_value( + std::move(*reporting_settings_payload)); + + auto policy_server = std::make_unique<policy::EmbeddedPolicyTestServer>(); + policy::PolicyStorage* policy_storage = policy_server->policy_storage(); + policy_storage->SetPolicyPayload( + policy::dm_protocol::kChromeMachineLevelUserCloudPolicyType, + settings.SerializeAsString()); + return policy_server; +#endif +} + EventReportValidatorBase::EventReportValidatorBase( policy::MockCloudPolicyClient* client) : client_(client) {}
diff --git a/components/enterprise/connectors/core/reporting_test_utils.h b/components/enterprise/connectors/core/reporting_test_utils.h index 918f775..6a41a0bb 100644 --- a/components/enterprise/connectors/core/reporting_test_utils.h +++ b/components/enterprise/connectors/core/reporting_test_utils.h
@@ -6,6 +6,7 @@ #define COMPONENTS_ENTERPRISE_CONNECTORS_CORE_REPORTING_TEST_UTILS_H_ #include <map> +#include <memory> #include <set> #include <string> #include <vector> @@ -14,6 +15,7 @@ #include "base/memory/raw_ptr.h" #include "base/values.h" #include "components/enterprise/common/proto/synced/browser_events.pb.h" +#include "components/policy/test_support/embedded_policy_test_server.h" class PrefService; @@ -92,6 +94,16 @@ std::map<std::string, std::vector<std::string>>(), bool machine_scope = true); +// Create a policy server that vends the cloud-only +// "OnSecurityEventEnterpriseConnector" policy for integration tests. Returns +// `nullptr` if the server could not be created. +std::unique_ptr<policy::EmbeddedPolicyTestServer> +CreatePolicyTestServerForSecurityEvents( + const std::set<std::string>& enabled_event_names = std::set<std::string>(), + const std::map<std::string, std::vector<std::string>>& + enabled_opt_in_events = + std::map<std::string, std::vector<std::string>>()); + } // namespace enterprise_connectors::test #endif // COMPONENTS_ENTERPRISE_CONNECTORS_CORE_REPORTING_TEST_UTILS_H_
diff --git a/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java b/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java index 332bf54e..9c79b9f 100644 --- a/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java +++ b/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java
@@ -145,6 +145,10 @@ "IPH_AdaptiveButtonInTopToolbarCustomization_PageSummary_Web"; String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_CUSTOMIZATION_PAGE_SUMMARY_PDF_FEATURE = "IPH_AdaptiveButtonInTopToolbarCustomization_PageSummary_Pdf"; + + /** An IPH feature to prompt users to select the 'Add to group' option in the App 3-Dot menu. */ + String MENU_ADD_TO_GROUP = "IPH_MenuAddToGroup"; + String PAGE_SUMMARY_WEB_MENU_FEATURE = "IPH_PageSummaryWebMenu"; String PAGE_SUMMARY_PDF_MENU_FEATURE = "IPH_PageSummaryPdfMenu"; String ANDROID_TAB_DECLUTTER_FEATURE = "IPH_AndroidTabDeclutter";
diff --git a/components/feature_engagement/public/feature_configurations.cc b/components/feature_engagement/public/feature_configurations.cc index 61cf0cb..6aa873be 100644 --- a/components/feature_engagement/public/feature_configurations.cc +++ b/components/feature_engagement/public/feature_configurations.cc
@@ -1004,6 +1004,21 @@ Comparator(LESS_THAN, 3), 90, 360)); return config; } + if (kIPHMenuAddToGroup.name == feature->name) { + // Allows an IPH for the main app menu 'Add to Group' entry: + // * Only once per year. + // * If the user has used chrome for more than 14 days. + // * And only if the menu option hasn't been opened in that time. + FeatureConfig config; + config.valid = true; + config.availability = Comparator(GREATER_THAN_OR_EQUAL, 14); + config.session_rate = Comparator(LESS_THAN, 1); + config.trigger = EventConfig("menu_add_to_group_iph_triggered", + Comparator(EQUAL, 0), 360, 360); + config.used = EventConfig("menu_add_to_group_clicked", Comparator(EQUAL, 0), + 360, 360); + return config; + } if (kIPHPageSummaryWebMenuFeature.name == feature->name) { // A config that allows the web page summary menu item IPH to be shown: // * Once per day. 3 times max in 90 days @@ -1213,10 +1228,11 @@ if (kIPHTabSwitcherAddToGroup.name == feature->name) { // Allows an IPH for the 'Add to Group' 3-dot menu entry: // * Only once per year. + // * If the user has used chrome for more than 14 days. // * And only if the menu option hasn't been opened in that time. FeatureConfig config; config.valid = true; - config.availability = Comparator(ANY, 0); + config.availability = Comparator(GREATER_THAN_OR_EQUAL, 14); config.session_rate = Comparator(LESS_THAN, 1); config.trigger = EventConfig("tab_switcher_add_to_group_iph_triggered", Comparator(EQUAL, 0), 360, 360);
diff --git a/components/feature_engagement/public/feature_constants.cc b/components/feature_engagement/public/feature_constants.cc index 8aa49a3..a016e13 100644 --- a/components/feature_engagement/public/feature_constants.cc +++ b/components/feature_engagement/public/feature_constants.cc
@@ -419,6 +419,9 @@ BASE_FEATURE(kIPHMicToolbarFeature, "IPH_MicToolbar", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kIPHMenuAddToGroup, + "IPH_MenuAddToGroup", + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kIPHPageInfoFeature, "IPH_PageInfo", base::FEATURE_DISABLED_BY_DEFAULT); @@ -772,6 +775,9 @@ BASE_FEATURE(kIPHAutofillAiOptInFeature, "IPH_AutofillAiOptIn", base::FEATURE_ENABLED_BY_DEFAULT); +// This parameter enables updates the Autofill IPH CTA button string. +const base::FeatureParam<int> kAutofillIphCTAVariationsStringValue{ + &feature_engagement::kIPHAutofillAiOptInFeature, "x_autofill_ai_cta_string_value", 0}; BASE_FEATURE(kIPHAutofillVirtualCardCVCSuggestionFeature, "IPH_AutofillVirtualCardCVCSuggestion", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/components/feature_engagement/public/feature_constants.h b/components/feature_engagement/public/feature_constants.h index 084a3df..e4f31d2 100644 --- a/components/feature_engagement/public/feature_constants.h +++ b/components/feature_engagement/public/feature_constants.h
@@ -181,6 +181,7 @@ FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHKeyboardAccessoryPaymentOfferFeature); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHLowUserEngagementDetectorFeature); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHMicToolbarFeature); +FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHMenuAddToGroup); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHPageInfoFeature); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHPageInfoStoreInfoFeature); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHPageZoomFeature); @@ -343,6 +344,9 @@ kIPHAutofillExternalAccountProfileSuggestionFeature); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHAutofillHomeWorkProfileSuggestionFeature); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHAutofillAiOptInFeature); +COMPONENT_EXPORT(FEATURE_ENGAGEMENT_FEATURE_CONSTANTS) +extern const base::FeatureParam<int> kAutofillIphCTAVariationsStringValue; +COMPONENT_EXPORT(FEATURE_ENGAGEMENT_FEATURE_CONSTANTS) FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHAutofillVirtualCardCVCSuggestionFeature); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHAutofillVirtualCardSuggestionFeature); FEATURE_CONSTANTS_DECLARE_FEATURE(kIPHCookieControlsFeature);
diff --git a/components/feature_engagement/public/feature_list.cc b/components/feature_engagement/public/feature_list.cc index c10c355..b3d1d399 100644 --- a/components/feature_engagement/public/feature_list.cc +++ b/components/feature_engagement/public/feature_list.cc
@@ -69,6 +69,7 @@ &kIPHKeyboardAccessoryPaymentOfferFeature, &kIPHLowUserEngagementDetectorFeature, &kIPHMicToolbarFeature, + &kIPHMenuAddToGroup, &kIPHPageInfoFeature, &kIPHPageInfoStoreInfoFeature, &kIPHPageZoomFeature,
diff --git a/components/feature_engagement/public/feature_list.h b/components/feature_engagement/public/feature_list.h index 86667dd..3436823 100644 --- a/components/feature_engagement/public/feature_list.h +++ b/components/feature_engagement/public/feature_list.h
@@ -135,6 +135,7 @@ DEFINE_VARIATION_PARAM(kIPHKeyboardAccessoryPaymentOfferFeature, "IPH_KeyboardAccessoryPaymentOffer"); DEFINE_VARIATION_PARAM(kIPHMicToolbarFeature, "IPH_MicToolbar"); +DEFINE_VARIATION_PARAM(kIPHMenuAddToGroup, "IPH_MenuAddToGroup"); DEFINE_VARIATION_PARAM(kIPHPageInfoFeature, "IPH_PageInfo"); DEFINE_VARIATION_PARAM(kIPHPageInfoStoreInfoFeature, "IPH_PageInfoStoreInfo"); DEFINE_VARIATION_PARAM(kIPHPageZoomFeature, "IPH_PageZoom"); @@ -626,6 +627,7 @@ VARIATION_ENTRY(kIPHKeyboardAccessoryPaymentFillingFeature), VARIATION_ENTRY(kIPHKeyboardAccessoryPaymentOfferFeature), VARIATION_ENTRY(kIPHMicToolbarFeature), + VARIATION_ENTRY(kIPHMenuAddToGroup), VARIATION_ENTRY(kIPHPageInfoFeature), VARIATION_ENTRY(kIPHPageInfoStoreInfoFeature), VARIATION_ENTRY(kIPHPageZoomFeature),
diff --git a/components/history/core/browser/sync/history_sync_bridge_unittest.cc b/components/history/core/browser/sync/history_sync_bridge_unittest.cc index 424c4dcc..9ea66ae 100644 --- a/components/history/core/browser/sync/history_sync_bridge_unittest.cc +++ b/components/history/core/browser/sync/history_sync_bridge_unittest.cc
@@ -28,6 +28,7 @@ #include "components/sync/protocol/history_specifics.pb.h" #include "components/sync/protocol/proto_value_conversions.h" #include "components/sync/test/forwarding_data_type_local_change_processor.h" +#include "google_apis/gaia/gaia_id.h" #include "sql/database.h" #include "sql/meta_table.h" #include "sql/test/test_helpers.h" @@ -211,11 +212,11 @@ bool IsTrackingMetadata() const override { return is_tracking_metadata_; } - std::string TrackedAccountId() const override { + GaiaId TrackedGaiaId() const override { if (!IsTrackingMetadata()) { - return ""; + return GaiaId(); } - return "account_id"; + return GaiaId("gaia_id"); } std::string TrackedCacheGuid() const override {
diff --git a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter.cc b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter.cc index 2b424e7..50dfa9a 100644 --- a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter.cc +++ b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter.cc
@@ -36,8 +36,8 @@ absl::StatusOr<std::unique_ptr<ElGamalEncrypter>> CreateEncrypter( ECGroup const* group, const std::string& serialized_public_key) { - ASSIGN_OR_RETURN(ECPoint g, group->GetFixedGenerator()); - ASSIGN_OR_RETURN(ECPoint y, group->CreateECPoint(serialized_public_key)); + PJC_ASSIGN_OR_RETURN(ECPoint g, group->GetFixedGenerator()); + PJC_ASSIGN_OR_RETURN(ECPoint y, group->CreateECPoint(serialized_public_key)); return std::make_unique<ElGamalEncrypter>( group, std::make_unique<PublicKey>(PublicKey{std::move(g), std::move(y)})); @@ -51,8 +51,8 @@ std::vector<Ciphertext> ciphertext; ciphertext.reserve(tokens.size()); for (const auto& t : tokens) { - ASSIGN_OR_RETURN(ECPoint u, group->CreateECPoint(t.u)); - ASSIGN_OR_RETURN(ECPoint e, group->CreateECPoint(t.e)); + PJC_ASSIGN_OR_RETURN(ECPoint u, group->CreateECPoint(t.u)); + PJC_ASSIGN_OR_RETURN(ECPoint e, group->CreateECPoint(t.e)); ciphertext.emplace_back(std::move(u), std::move(e)); } return ciphertext; @@ -67,14 +67,14 @@ auto context = std::make_unique<Context>(); std::unique_ptr<ECGroup> group; { - ASSIGN_OR_RETURN(ECGroup local_group, - ECGroup::Create(NID_X9_62_prime256v1, context.get())); + PJC_ASSIGN_OR_RETURN(ECGroup local_group, + ECGroup::Create(NID_X9_62_prime256v1, context.get())); group = std::make_unique<ECGroup>(std::move(local_group)); } - ASSIGN_OR_RETURN(std::unique_ptr<ElGamalEncrypter> encrypter, - CreateEncrypter(group.get(), serialized_public_key)); - ASSIGN_OR_RETURN(std::vector<Ciphertext> ciphertext, - CreateCiphertext(group.get(), tokens)); + PJC_ASSIGN_OR_RETURN(std::unique_ptr<ElGamalEncrypter> encrypter, + CreateEncrypter(group.get(), serialized_public_key)); + PJC_ASSIGN_OR_RETURN(std::vector<Ciphertext> ciphertext, + CreateCiphertext(group.get(), tokens)); // Can not use `make_unique` since constructor is private. // Can not use `return std::unique_ptr`, git cl upload // returns pre-submit error and recommends using base::WrapUnique. @@ -105,10 +105,10 @@ const std::string& serialized_public_key, const std::vector<ProbabilisticRevealToken>& tokens) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - ASSIGN_OR_RETURN(std::unique_ptr<ElGamalEncrypter> encrypter, - CreateEncrypter(group_.get(), serialized_public_key)); - ASSIGN_OR_RETURN(std::vector<Ciphertext> ciphertext, - CreateCiphertext(group_.get(), tokens)); + PJC_ASSIGN_OR_RETURN(std::unique_ptr<ElGamalEncrypter> encrypter, + CreateEncrypter(group_.get(), serialized_public_key)); + PJC_ASSIGN_OR_RETURN(std::vector<Ciphertext> ciphertext, + CreateCiphertext(group_.get(), tokens)); // Creating encrypter and ciphertext succeeded, set members. encrypter_.reset(encrypter.release()); ciphertext_ = std::move(ciphertext); @@ -130,14 +130,14 @@ if (i >= ciphertext_.size()) { return absl::InvalidArgumentError("invalid index"); } - ASSIGN_OR_RETURN(Ciphertext randomized_ciphertext, - encrypter_->ReRandomize(ciphertext_[i])); + PJC_ASSIGN_OR_RETURN(Ciphertext randomized_ciphertext, + encrypter_->ReRandomize(ciphertext_[i])); ProbabilisticRevealToken randomized_token; randomized_token.version = 1; - ASSIGN_OR_RETURN(randomized_token.u, - randomized_ciphertext.u.ToBytesCompressed()); - ASSIGN_OR_RETURN(randomized_token.e, - randomized_ciphertext.e.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(randomized_token.u, + randomized_ciphertext.u.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(randomized_token.e, + randomized_ciphertext.e.ToBytesCompressed()); Telemetry().ProbabilisticRevealTokenRandomizationTime( base::TimeTicks::Now() - randomization_start_time); return randomized_token;
diff --git a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter_fuzztests.cc b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter_fuzztests.cc index 328e6f1..25e3441 100644 --- a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter_fuzztests.cc +++ b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter_fuzztests.cc
@@ -32,29 +32,32 @@ // NID_X9_62_prime256v1. absl::StatusOr<std::string> GetSerializedPublicKey(uint64_t private_key) { Context context; - ASSIGN_OR_RETURN(ECGroup group, - ECGroup::Create(NID_X9_62_prime256v1, &context)); - ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); - ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); + PJC_ASSIGN_OR_RETURN(ECGroup group, + ECGroup::Create(NID_X9_62_prime256v1, &context)); + PJC_ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); + PJC_ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); return y.ToBytesCompressed(); } absl::StatusOr<ip_protection::ProbabilisticRevealToken> CreateTokenFromPlaintext(uint64_t private_key, const std::string& plaintext) { Context context; - ASSIGN_OR_RETURN(ECGroup group, - ECGroup::Create(NID_X9_62_prime256v1, &context)); - ASSIGN_OR_RETURN(ECPoint plaintext_point, - group.GetPointByHashingToCurveSha256(plaintext)); + PJC_ASSIGN_OR_RETURN(ECGroup group, + ECGroup::Create(NID_X9_62_prime256v1, &context)); + PJC_ASSIGN_OR_RETURN(ECPoint plaintext_point, + group.GetPointByHashingToCurveSha256(plaintext)); - ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); - ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); + PJC_ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); + PJC_ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); std::unique_ptr<PublicKey> public_key( new PublicKey{std::move(g), std::move(y)}); ElGamalEncrypter encrypter(&group, std::move(public_key)); - ASSIGN_OR_RETURN(Ciphertext ciphertext, encrypter.Encrypt(plaintext_point)); - ASSIGN_OR_RETURN(std::string u_compressed, ciphertext.u.ToBytesCompressed()); - ASSIGN_OR_RETURN(std::string e_compressed, ciphertext.e.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(Ciphertext ciphertext, + encrypter.Encrypt(plaintext_point)); + PJC_ASSIGN_OR_RETURN(std::string u_compressed, + ciphertext.u.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(std::string e_compressed, + ciphertext.e.ToBytesCompressed()); return ip_protection::ProbabilisticRevealToken{ 1, std::move(u_compressed), std::move(e_compressed)}; }
diff --git a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter_unittest.cc b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter_unittest.cc index 97d0822..0d7cdab 100644 --- a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter_unittest.cc +++ b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter_unittest.cc
@@ -39,10 +39,10 @@ // NID_X9_62_prime256v1. absl::StatusOr<std::string> GetSerializedPublicKey(uint64_t private_key) { Context context; - ASSIGN_OR_RETURN(ECGroup group, - ECGroup::Create(NID_X9_62_prime256v1, &context)); - ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); - ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); + PJC_ASSIGN_OR_RETURN(ECGroup group, + ECGroup::Create(NID_X9_62_prime256v1, &context)); + PJC_ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); + PJC_ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); return y.ToBytesCompressed(); } @@ -50,18 +50,21 @@ uint64_t private_key, const std::string& plaintext) { Context context; - ASSIGN_OR_RETURN(ECGroup group, - ECGroup::Create(NID_X9_62_prime256v1, &context)); - ASSIGN_OR_RETURN(ECPoint plaintext_point, - group.GetPointByHashingToCurveSha256(plaintext)); + PJC_ASSIGN_OR_RETURN(ECGroup group, + ECGroup::Create(NID_X9_62_prime256v1, &context)); + PJC_ASSIGN_OR_RETURN(ECPoint plaintext_point, + group.GetPointByHashingToCurveSha256(plaintext)); - ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); - ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); + PJC_ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); + PJC_ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); ElGamalEncrypter encrypter(&group, std::make_unique<PublicKey>(PublicKey{ std::move(g), std::move(y)})); - ASSIGN_OR_RETURN(Ciphertext ciphertext, encrypter.Encrypt(plaintext_point)); - ASSIGN_OR_RETURN(std::string u_compressed, ciphertext.u.ToBytesCompressed()); - ASSIGN_OR_RETURN(std::string e_compressed, ciphertext.e.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(Ciphertext ciphertext, + encrypter.Encrypt(plaintext_point)); + PJC_ASSIGN_OR_RETURN(std::string u_compressed, + ciphertext.u.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(std::string e_compressed, + ciphertext.e.ToBytesCompressed()); return ProbabilisticRevealToken{1, std::move(u_compressed), std::move(e_compressed)}; } @@ -71,9 +74,9 @@ std::size_t num_tokens) { std::vector<ProbabilisticRevealToken> tokens(num_tokens); for (std::size_t i = 0; i < num_tokens; ++i) { - ASSIGN_OR_RETURN(tokens[i], - CreateTokenFromPlaintext( - private_key, "token-" + base::NumberToString(i))); + PJC_ASSIGN_OR_RETURN(tokens[i], + CreateTokenFromPlaintext( + private_key, "token-" + base::NumberToString(i))); } return tokens; } @@ -81,10 +84,10 @@ absl::StatusOr<ECPoint> DecryptToken(uint64_t private_key, const ProbabilisticRevealToken& token) { Context context; - ASSIGN_OR_RETURN(ECGroup group, - ECGroup::Create(NID_X9_62_prime256v1, &context)); - ASSIGN_OR_RETURN(ECPoint u, group.CreateECPoint(token.u)); - ASSIGN_OR_RETURN(ECPoint e, group.CreateECPoint(token.e)); + PJC_ASSIGN_OR_RETURN(ECGroup group, + ECGroup::Create(NID_X9_62_prime256v1, &context)); + PJC_ASSIGN_OR_RETURN(ECPoint u, group.CreateECPoint(token.u)); + PJC_ASSIGN_OR_RETURN(ECPoint e, group.CreateECPoint(token.e)); Ciphertext ciphertext{std::move(u), std::move(e)}; ElGamalDecrypter decrypter(std::make_unique<PrivateKey>( PrivateKey{context.CreateBigNum(private_key)}));
diff --git a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.cc b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.cc index 6862f39..fba22eb2 100644 --- a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.cc +++ b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.cc
@@ -5,6 +5,7 @@ #include "components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.h" #include <optional> +#include <string> #include "base/base64.h" #include "base/base64url.h" @@ -192,16 +193,10 @@ statement.BindBlob(1, token.u); statement.BindBlob(2, token.e); - std::string epoch_id_base64url; - // Align with server side's absl::WebSafeBase64Escape(). - base::Base64UrlEncode(outcome.epoch_id, - base::Base64UrlEncodePolicy::OMIT_PADDING, - &epoch_id_base64url); - statement.BindString(3, epoch_id_base64url); - + statement.BindString(3, base64url_encode(outcome.epoch_id)); statement.BindInt64(4, outcome.expiration_time_seconds); statement.BindInt64(5, outcome.num_tokens_with_signal); - statement.BindString(6, base::Base64Encode(outcome.public_key)); + statement.BindString(6, base64url_encode(outcome.public_key)); statement.BindInt64(7, outcome.tokens.size()); if (!statement.Run()) { @@ -211,4 +206,11 @@ } } +std::string IpProtectionProbabilisticRevealTokenDataStorage::base64url_encode( + std::string x) { + std::string result; + base::Base64UrlEncode(x, base::Base64UrlEncodePolicy::OMIT_PADDING, &result); + return result; +} + } // namespace ip_protection
diff --git a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.h b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.h index a64b90c..33bf02cc 100644 --- a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.h +++ b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage.h
@@ -6,6 +6,7 @@ #define COMPONENTS_IP_PROTECTION_COMMON_IP_PROTECTION_PROBABILISTIC_REVEAL_TOKEN_DATA_STORAGE_H_ #include <optional> +#include <string> #include "base/files/file_path.h" #include "base/sequence_checker.h" @@ -45,6 +46,8 @@ VALID_CONTEXT_REQUIRED(sequence_checker_); bool CreateSchema() VALID_CONTEXT_REQUIRED(sequence_checker_); void DatabaseErrorCallback(int extended_error, sql::Statement* stmt); + // A helper to encode string like absl::WebSafeBase64Escape(). + std::string base64url_encode(std::string); std::optional<base::FilePath> path_to_database_;
diff --git a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage_unittest.cc b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage_unittest.cc index 9e341f8c..20cfc889 100644 --- a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage_unittest.cc +++ b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_data_storage_unittest.cc
@@ -79,7 +79,7 @@ static const char kCountSQL[] = "SELECT COUNT(*) FROM tokens WHERE public_key = ?"; sql::Statement s(db.GetUniqueStatement(kCountSQL)); - s.BindString(0, base::Base64Encode(public_key)); + s.BindString(0, public_key); EXPECT_TRUE(s.Step()); return s.ColumnInt(0); } @@ -250,14 +250,16 @@ EXPECT_TRUE(db.Open(DbPath())); EXPECT_EQ(3u, CountTokenEntries(db)); - EXPECT_EQ(1u, CountTokenEntriesOnPublicKey(db, "public_key")); - EXPECT_EQ(2u, CountTokenEntriesOnPublicKey(db, "public_key_2")); + EXPECT_EQ(1u, CountTokenEntriesOnPublicKey( + db, "cHVibGljX2tleQ")); // base64url_encode(public_key) + EXPECT_EQ(2u, CountTokenEntriesOnPublicKey( + db, "cHVibGljX2tleV8y")); // base64url_encode(public_key_2) EXPECT_EQ(1u, CountTokenEntriesWithBatchSize(db, outcome.tokens.size())); EXPECT_EQ(2u, CountTokenEntriesWithBatchSize(db, outcome2.tokens.size())); - EXPECT_EQ( - 1u, CountTokenEntriesOnEpoch(db, "MDAwMDAwMDA")); // base64url(00000000) - EXPECT_EQ( - 2u, CountTokenEntriesOnEpoch(db, "MTExMTExMTE")); // base64url(11111111) + EXPECT_EQ(1u, CountTokenEntriesOnEpoch( + db, "MDAwMDAwMDA")); // base64url_encode(00000000) + EXPECT_EQ(2u, CountTokenEntriesOnEpoch( + db, "MTExMTExMTE")); // base64url_encode(11111111) CloseDatabase(); }
diff --git a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_direct_fetcher.cc b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_direct_fetcher.cc index a75c600..4ea23701 100644 --- a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_direct_fetcher.cc +++ b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_direct_fetcher.cc
@@ -28,10 +28,6 @@ #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" #include "url/gurl.h" -// The ASSIGN_OR_RETURN macro is defined in the both the base::expected code and -// the private-join-and-compute code. We need to undefine the macro here to -// avoid compiler errors. -#undef ASSIGN_OR_RETURN #include "components/ip_protection/common/ip_protection_probabilistic_reveal_token_crypter.h" #include "components/ip_protection/get_probabilistic_reveal_token.pb.h" #include "net/base/features.h"
diff --git a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_direct_fetcher_unittest.cc b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_direct_fetcher_unittest.cc index 2f4bab31..a046966 100644 --- a/components/ip_protection/common/ip_protection_probabilistic_reveal_token_direct_fetcher_unittest.cc +++ b/components/ip_protection/common/ip_protection_probabilistic_reveal_token_direct_fetcher_unittest.cc
@@ -31,10 +31,6 @@ #include "services/network/public/cpp/url_loader_completion_status.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" #include "services/network/public/mojom/url_response_head.mojom.h" -// The ASSIGN_OR_RETURN macro is defined in the both the base::expected code and -// the private-join-and-compute code. We need to undefine the macro here to -// avoid compiler errors. -#undef ASSIGN_OR_RETURN #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/test/test_url_loader_factory.h" @@ -61,10 +57,10 @@ absl::StatusOr<std::string> GetTestPublicKeyBytes(uint64_t private_key) { Context context; - ASSIGN_OR_RETURN(ECGroup group, - ECGroup::Create(NID_X9_62_prime256v1, &context)); - ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); - ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); + PJC_ASSIGN_OR_RETURN(ECGroup group, + ECGroup::Create(NID_X9_62_prime256v1, &context)); + PJC_ASSIGN_OR_RETURN(ECPoint g, group.GetFixedGenerator()); + PJC_ASSIGN_OR_RETURN(ECPoint y, g.Mul(context.CreateBigNum(private_key))); return y.ToBytesCompressed(); }
diff --git a/components/ip_protection/common/probabilistic_reveal_token_test_issuer.cc b/components/ip_protection/common/probabilistic_reveal_token_test_issuer.cc index 6b0b306..22ef725 100644 --- a/components/ip_protection/common/probabilistic_reveal_token_test_issuer.cc +++ b/components/ip_protection/common/probabilistic_reveal_token_test_issuer.cc
@@ -57,17 +57,17 @@ auto context = std::make_unique<Context>(); std::unique_ptr<ECGroup> group; { - ASSIGN_OR_RETURN(ECGroup local_group, - ECGroup::Create(NID_X9_62_prime256v1, context.get())); + PJC_ASSIGN_OR_RETURN(ECGroup local_group, + ECGroup::Create(NID_X9_62_prime256v1, context.get())); group = std::make_unique<ECGroup>(std::move(local_group)); } std::unique_ptr<ElGamalEncrypter> encrypter; std::string serialized_public_key; { - ASSIGN_OR_RETURN(ECPoint g, group->GetFixedGenerator()); - ASSIGN_OR_RETURN(ECPoint y, g.Mul(context->CreateBigNum(private_key))); - ASSIGN_OR_RETURN(serialized_public_key, y.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(ECPoint g, group->GetFixedGenerator()); + PJC_ASSIGN_OR_RETURN(ECPoint y, g.Mul(context->CreateBigNum(private_key))); + PJC_ASSIGN_OR_RETURN(serialized_public_key, y.ToBytesCompressed()); encrypter = std::make_unique<ElGamalEncrypter>( group.get(), std::make_unique<PublicKey>(std::move(g), std::move(y))); } @@ -123,9 +123,9 @@ absl::StatusOr<std::string> ProbabilisticRevealTokenTestIssuer::RevealTokenInternal( const ProbabilisticRevealToken& token) const { - ASSIGN_OR_RETURN(ECPoint point, Decrypt(token)); - ASSIGN_OR_RETURN(BigNum big_num, group_->RecoverXFromPaddedPoint( - point, kPaddingSize * kBitsPerByte)); + PJC_ASSIGN_OR_RETURN(ECPoint point, Decrypt(token)); + PJC_ASSIGN_OR_RETURN(BigNum big_num, group_->RecoverXFromPaddedPoint( + point, kPaddingSize * kBitsPerByte)); return big_num.ToBytes(); } @@ -135,15 +135,18 @@ if (plaintext.size() != kPlaintextSize) { return absl::InvalidArgumentError("plaintext size must be kPlaintextSize"); } - ASSIGN_OR_RETURN(ECPoint plaintext_point, - group_->GetPointByPaddingX( - context_->CreateBigNum(plaintext), - /*padding_bit_count=*/kPaddingSize * kBitsPerByte)); - ASSIGN_OR_RETURN(std::string serialized_plaintext_point, - plaintext_point.ToBytesCompressed()); - ASSIGN_OR_RETURN(Ciphertext ciphertext, encrypter_->Encrypt(plaintext_point)); - ASSIGN_OR_RETURN(std::string u_compressed, ciphertext.u.ToBytesCompressed()); - ASSIGN_OR_RETURN(std::string e_compressed, ciphertext.e.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(ECPoint plaintext_point, + group_->GetPointByPaddingX( + context_->CreateBigNum(plaintext), + /*padding_bit_count=*/kPaddingSize * kBitsPerByte)); + PJC_ASSIGN_OR_RETURN(std::string serialized_plaintext_point, + plaintext_point.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(Ciphertext ciphertext, + encrypter_->Encrypt(plaintext_point)); + PJC_ASSIGN_OR_RETURN(std::string u_compressed, + ciphertext.u.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(std::string e_compressed, + ciphertext.e.ToBytesCompressed()); return ProbabilisticRevealToken(1, std::move(u_compressed), std::move(e_compressed)); } @@ -173,8 +176,8 @@ absl::StatusOr<std::string> ProbabilisticRevealTokenTestIssuer::DecryptSerializeEncodeInternal( const ProbabilisticRevealToken& token) { - ASSIGN_OR_RETURN(ECPoint point, Decrypt(token)); - ASSIGN_OR_RETURN(std::string serialized_point, point.ToBytesCompressed()); + PJC_ASSIGN_OR_RETURN(ECPoint point, Decrypt(token)); + PJC_ASSIGN_OR_RETURN(std::string serialized_point, point.ToBytesCompressed()); return base::Base64Encode(serialized_point); } @@ -183,7 +186,7 @@ const std::vector<ProbabilisticRevealToken>& tokens) { std::vector<std::string> encoded; for (const auto& t : tokens) { - ASSIGN_OR_RETURN(std::string sp, DecryptSerializeEncodeInternal(t)); + PJC_ASSIGN_OR_RETURN(std::string sp, DecryptSerializeEncodeInternal(t)); encoded.push_back(std::move(sp)); } return encoded; @@ -191,8 +194,8 @@ absl::StatusOr<ECPoint> ProbabilisticRevealTokenTestIssuer::Decrypt( const ProbabilisticRevealToken& token) const { - ASSIGN_OR_RETURN(ECPoint u, group_->CreateECPoint(token.u)); - ASSIGN_OR_RETURN(ECPoint e, group_->CreateECPoint(token.e)); + PJC_ASSIGN_OR_RETURN(ECPoint u, group_->CreateECPoint(token.u)); + PJC_ASSIGN_OR_RETURN(ECPoint e, group_->CreateECPoint(token.e)); Ciphertext ciphertext{std::move(u), std::move(e)}; return decrypter_->Decrypt(ciphertext); }
diff --git a/components/ntp_tiles/most_visited_sites.h b/components/ntp_tiles/most_visited_sites.h index 2b4c07b..1f73b4cc 100644 --- a/components/ntp_tiles/most_visited_sites.h +++ b/components/ntp_tiles/most_visited_sites.h
@@ -153,10 +153,11 @@ // Does not take ownership of |observer|, which must outlive this object and // must not be null. |max_num_sites| indicates the the maximum number of most // visited sites to return. - void AddMostVisitedURLsObserver(Observer* observer, size_t max_num_sites); + virtual void AddMostVisitedURLsObserver(Observer* observer, + size_t max_num_sites); // Removes the observer. - void RemoveMostVisitedURLsObserver(Observer* observer); + virtual void RemoveMostVisitedURLsObserver(Observer* observer); // Sets the client that provides platform-specific homepage preferences. // When used to replace an existing client, the new client will first be
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc index e78f332..9c5ca77 100644 --- a/components/omnibox/browser/autocomplete_controller.cc +++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -1635,7 +1635,7 @@ return; } - #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) +#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) // Attach the contextual search fulfillment actions in the @page keyword mode. if (omnibox_feature_configs::ContextualSearch::Get() .contextual_zero_suggest_lens_fulfillment && @@ -1822,8 +1822,9 @@ (i->description).size(), ACMatchClassification::DIM)); // TODO(crbug.com/407610885): Localize the people suggestion metadata. i->description += - u" - " + template_url->AdjustedShortNameForLocaleDirection() + - u" People"; + u" - " + l10n_util::GetStringFUTF16( + IDS_PERSON_SUGGESTION_DESCRIPTION, + template_url->AdjustedShortNameForLocaleDirection()); } } last_keyword = i->keyword;
diff --git a/components/omnibox/browser/autocomplete_match.cc b/components/omnibox/browser/autocomplete_match.cc index c0abd1c3..b86ebdb8 100644 --- a/components/omnibox/browser/autocomplete_match.cc +++ b/components/omnibox/browser/autocomplete_match.cc
@@ -1895,6 +1895,14 @@ image_dominant_color = duplicate_match.image_dominant_color; image_url = duplicate_match.image_url; icon_url = duplicate_match.icon_url; + + // Prefer to keep the original `type` for more helpful metric logging. + // However, searches and non-searches have different ranking & text display + // (see `swap_contents_and_description` and `UpdateKeywordDescriptions()`). + // Using text from a search/URL match but displaying the match like a + // URL/search could look very broken. + if (IsSearchType(type) != IsSearchType(duplicate_match.type)) + type = duplicate_match.type; } // Copy `rich_autocompletion_triggered` for counterfactual logging.
diff --git a/components/omnibox/browser/enterprise_search_aggregator_provider_unittest.cc b/components/omnibox/browser/enterprise_search_aggregator_provider_unittest.cc index 003e519..b365c2f8 100644 --- a/components/omnibox/browser/enterprise_search_aggregator_provider_unittest.cc +++ b/components/omnibox/browser/enterprise_search_aggregator_provider_unittest.cc
@@ -15,6 +15,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/icu_test_util.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" #include "base/test/test_future.h" @@ -716,6 +717,8 @@ // Test response is parsed accurately. TEST_F(EnterpriseSearchAggregatorProviderTest, Parse) { + base::test::ScopedRestoreDefaultTimezone la_time("America/Los_Angeles"); + scoped_config_.Get().relevance_scoring_mode = "server"; provider_->adjusted_input_ = CreateInput(u"john d", true);
diff --git a/components/omnibox_strings.grdp b/components/omnibox_strings.grdp index aa0db5d..20f0537 100644 --- a/components/omnibox_strings.grdp +++ b/components/omnibox_strings.grdp
@@ -114,6 +114,9 @@ <message name="IDS_CONTENT_SUGGESTION_DESCRIPTION_TEMPLATE_WITHOUT_FILE_TYPE_DESCRIPTION" desc="Product description for content suggestions in omnibox when the file type description is missing."> <ph name="RESULT_MODIFIED_DATE">$1<ex>12/31/2018</ex></ph> - <ph name="RESULT_OWNER">$2<ex>First Last</ex></ph> </message> + <message name="IDS_PERSON_SUGGESTION_DESCRIPTION" desc="Description for person suggestions in omnibox."> + <ph name="ENGINE">$1<ex>Agentspace</ex></ph> People + </message> <if expr="use_titlecase"> <then> <message name="IDS_ACCURACY_CHECK_VERBOSE_STATE" meaning="Text for feature that encourages the user to think about how accurate the content is" desc="This text appears in the address bar chip, which states the title of the feature shown in the page info bubble below (see screenshot). With this feature, the user will see a reminder on the page they're visiting that encourages the user to think about how accurate the content is. You may translate 'Accuracy' as 'Trustworthiness' or 'Reliability,' if those terms work better in your language. The 'Accuracy Check' is a noun; avoid translating this as an imperative command. Chrome does not verify accuracy by providing this feature; avoid any translation that implies Google or Chrome verification.">
diff --git a/components/omnibox_strings_grdp/IDS_PERSON_SUGGESTION_DESCRIPTION.png.sha1 b/components/omnibox_strings_grdp/IDS_PERSON_SUGGESTION_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..164ca7d4 --- /dev/null +++ b/components/omnibox_strings_grdp/IDS_PERSON_SUGGESTION_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +d3891a25508036c7da817d45de48202dc7cd51fd \ No newline at end of file
diff --git a/components/optimization_guide/content/browser/page_content_proto_provider_browsertest.cc b/components/optimization_guide/content/browser/page_content_proto_provider_browsertest.cc index f747cde..0aa9ca27 100644 --- a/components/optimization_guide/content/browser/page_content_proto_provider_browsertest.cc +++ b/components/optimization_guide/content/browser/page_content_proto_provider_browsertest.cc
@@ -52,6 +52,12 @@ EXPECT_EQ(proto_rect.y(), rect.y()); } +void AssertSizesEqual(const optimization_guide::proto::BoundingSize& proto_size, + gfx::Size size) { + EXPECT_EQ(proto_size.width(), size.width()); + EXPECT_EQ(proto_size.height(), size.height()); +} + void AssertRectsEqual(const optimization_guide::proto::BoundingRect& a, const optimization_guide::proto::BoundingRect& b) { EXPECT_EQ(a.width(), b.width()); @@ -242,6 +248,41 @@ EXPECT_EQ(main_frame_origin.value(), iframe_origin.value()); } +IN_PROC_BROWSER_TEST_F(PageContentProtoProviderBrowserTest, ScrollerInfo) { + const gfx::Size window_bounds(web_contents()->GetSize()); + + LoadPage(https_server()->GetURL("a.com", "/scroller.html")); + + const auto& root = page_content().root_node(); + EXPECT_TRUE(root.content_attributes().has_interaction_info()); + EXPECT_TRUE(root.content_attributes().interaction_info().has_scroller_info()); + + const auto& root_scroller = + root.content_attributes().interaction_info().scroller_info(); + AssertSizesEqual( + root_scroller.scrolling_bounds(), + gfx::Size(window_bounds.width() + 50, window_bounds.height() + 30)); + AssertRectsEqual(root_scroller.visible_area(), gfx::Rect(window_bounds)); + + ASSERT_EQ(root.children_nodes().size(), 1); + const auto& child = root.children_nodes().at(0); + EXPECT_TRUE(child.content_attributes().has_interaction_info()); + EXPECT_TRUE( + child.content_attributes().interaction_info().has_scroller_info()); + + const auto& sub_scroller = + child.content_attributes().interaction_info().scroller_info(); + AssertSizesEqual( + sub_scroller.scrolling_bounds(), + gfx::Size(2 * window_bounds.width(), 3 * window_bounds.height())); + AssertRectsEqual( + sub_scroller.visible_area(), + gfx::Rect(200, 100, window_bounds.width(), window_bounds.height())); + + EXPECT_TRUE(sub_scroller.user_scrollable_horizontal()); + EXPECT_TRUE(sub_scroller.user_scrollable_vertical()); +} + class PageContentProtoProviderBrowserTestActionableElements : public PageContentProtoProviderBrowserTest { public: @@ -254,14 +295,13 @@ IN_PROC_BROWSER_TEST_F(PageContentProtoProviderBrowserTestActionableElements, AIPageContent) { - LoadPage(https_server()->GetURL("/simple.html")); + LoadPage(https_server()->GetURL("/actionable_elements.html")); EXPECT_EQ(page_content().version(), optimization_guide::proto:: ANNOTATED_PAGE_CONTENT_VERSION_ONLY_ACTIONABLE_ELEMENTS_1_0); EXPECT_EQ(page_content().root_node().children_nodes().size(), 1); - AssertHasText(page_content().root_node(), "Non empty simple page\n\n"); - EXPECT_TRUE( - page_content().root_node().content_attributes().has_interaction_info()); + const auto& child = page_content().root_node().children_nodes().at(0); + EXPECT_TRUE(child.content_attributes().has_interaction_info()); } IN_PROC_BROWSER_TEST_F(PageContentProtoProviderBrowserTestActionableElements,
diff --git a/components/optimization_guide/content/browser/page_content_proto_util.cc b/components/optimization_guide/content/browser/page_content_proto_util.cc index a0ded3c..074aa41 100644 --- a/components/optimization_guide/content/browser/page_content_proto_util.cc +++ b/components/optimization_guide/content/browser/page_content_proto_util.cc
@@ -114,6 +114,12 @@ serialized_server_token); } +void ConvertSize(const gfx::Size& mojom_size, + optimization_guide::proto::BoundingSize* proto_size) { + proto_size->set_width(mojom_size.width()); + proto_size->set_height(mojom_size.height()); +} + void ConvertRect(const gfx::Rect& mojom_rect, optimization_guide::proto::BoundingRect* proto_rect) { proto_rect->set_x(mojom_rect.x()); @@ -143,14 +149,27 @@ } } +void ConvertScrollerInfo( + const blink::mojom::AIPageContentScrollerInfo& mojom_scroller_info, + optimization_guide::proto::ScrollerInfo* proto_scroller_info) { + ConvertSize(mojom_scroller_info.scrolling_bounds, + proto_scroller_info->mutable_scrolling_bounds()); + ConvertRect(mojom_scroller_info.visible_area, + proto_scroller_info->mutable_visible_area()); + proto_scroller_info->set_user_scrollable_horizontal( + mojom_scroller_info.user_scrollable_horizontal); + proto_scroller_info->set_user_scrollable_vertical( + mojom_scroller_info.user_scrollable_vertical); +} + void ConvertNodeInteractionInfo( const blink::mojom::AIPageContentNodeInteractionInfo& mojom_node_interaction_info, optimization_guide::proto::InteractionInfo* proto_interaction_info) { - proto_interaction_info->set_scrolls_overflow_x( - mojom_node_interaction_info.scrolls_overflow_x); - proto_interaction_info->set_scrolls_overflow_y( - mojom_node_interaction_info.scrolls_overflow_y); + if (mojom_node_interaction_info.scroller_info) { + ConvertScrollerInfo(*mojom_node_interaction_info.scroller_info, + proto_interaction_info->mutable_scroller_info()); + } proto_interaction_info->set_is_selectable( mojom_node_interaction_info.is_selectable); proto_interaction_info->set_is_editable(
diff --git a/components/optimization_guide/content/browser/page_content_proto_util_unittest.cc b/components/optimization_guide/content/browser/page_content_proto_util_unittest.cc index 5406035..800a294 100644 --- a/components/optimization_guide/content/browser/page_content_proto_util_unittest.cc +++ b/components/optimization_guide/content/browser/page_content_proto_util_unittest.cc
@@ -624,10 +624,6 @@ CreateContentNode(blink::mojom::AIPageContentAttributeType::kText); text_node->content_attributes->node_interaction_info = blink::mojom::AIPageContentNodeInteractionInfo::New(); - text_node->content_attributes->node_interaction_info->scrolls_overflow_x = - true; - text_node->content_attributes->node_interaction_info->scrolls_overflow_y = - true; text_node->content_attributes->node_interaction_info->is_selectable = true; text_node->content_attributes->node_interaction_info->is_editable = true; text_node->content_attributes->node_interaction_info->can_resize_horizontal = @@ -654,8 +650,6 @@ .children_nodes(0) .content_attributes() .interaction_info(); - EXPECT_TRUE(interaction_info.scrolls_overflow_x()); - EXPECT_TRUE(interaction_info.scrolls_overflow_y()); EXPECT_TRUE(interaction_info.is_selectable()); EXPECT_TRUE(interaction_info.is_editable()); EXPECT_TRUE(interaction_info.can_resize_horizontal());
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index 39f0026..b8f2f68 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit 39f00263ec7a5f29e755572cfd486765f2dc15dc +Subproject commit b8f2f682ce8d5097597440ee2aaf93f21488da65
diff --git a/components/optimization_guide/proto/features/common_quality_data.proto b/components/optimization_guide/proto/features/common_quality_data.proto index fe23cb03..279c2c7a 100644 --- a/components/optimization_guide/proto/features/common_quality_data.proto +++ b/components/optimization_guide/proto/features/common_quality_data.proto
@@ -337,12 +337,14 @@ // The interaction information for the content node. This indicates whether the // node is interactive and what type of interaction it supports. -// Next ID: 12 +// Next ID: 13 message InteractionInfo { - // Whether the content node can scroll in the x direction. + // Set if the content node is scrollable. + ScrollerInfo scroller_info = 12; + + // DEPRECATED: Use `scroller_info` instead. bool scrolls_overflow_x = 1; - // Whether the content node can scroll in the y direction. bool scrolls_overflow_y = 2; // Whether the content node is selectable. @@ -381,6 +383,32 @@ reserved 8; } +// The coordinate space for the dimensions here is physical coordinates (not +// logical coordinates). This means it's the same irrespective of the writing +// mode. +// The dimensions also exclude non-overlay scrollbars. +message ScrollerInfo { + // The complete layout dimensions of the scroller. This is the total area + // that can be revealed through a scroll operation. + BoundingSize scrolling_bounds = 1; + + // The subset of this scroller's content which is currently scrolled to. This + // is relative to the origin of `scrolling_bounds`. + BoundingRect visible_area = 2; + + // Indicates whether this can be scrolled by the user in horizontal or + // vertical directions. These nodes can still be scrolled by script. + bool user_scrollable_horizontal = 3; + + bool user_scrollable_vertical = 4; +} + +message BoundingSize { + int32 width = 1; + + int32 height = 2; +} + // Next ID: 5 message TextInfo { string text_content = 1;
diff --git a/components/optimization_guide/proto/features/model_prototyping.proto b/components/optimization_guide/proto/features/model_prototyping.proto index 6896d34..9ed2fb6 100644 --- a/components/optimization_guide/proto/features/model_prototyping.proto +++ b/components/optimization_guide/proto/features/model_prototyping.proto
@@ -363,6 +363,7 @@ repeated HistoryQuery history_queries = 1; } +// Next ID: 6 message ExtensionAddedInformation { // Free form data that a prototyper can inject into prompts. repeated string free_form_data = 1; @@ -375,6 +376,8 @@ // The local annotated page content as a list of passages. string local_annotated_page_content_as_passages = 4; + + bytes mhtml = 5; } message ModelPrototypingResponse {
diff --git a/components/page_load_metrics/browser/observers/use_counter/webdx_feature_maps.cc b/components/page_load_metrics/browser/observers/use_counter/webdx_feature_maps.cc index 35ae952..2ae4e55 100644 --- a/components/page_load_metrics/browser/observers/use_counter/webdx_feature_maps.cc +++ b/components/page_load_metrics/browser/observers/use_counter/webdx_feature_maps.cc
@@ -65,6 +65,8 @@ WebDXFeature::kFocusVisible}, {WebFeature::kCSSGridLayout, WebDXFeature::kGrid}, {WebFeature::kCSSSelectorPseudoHas, WebDXFeature::kHas}, + {WebFeature::kCSSSelectorPseudoHasSlotted, + WebDXFeature::kHasSlotted}, {WebFeature::kIdleDetectionStart, WebDXFeature::kIdleDetection}, {WebFeature::kImportMap, WebDXFeature::kImportMaps}, {WebFeature::kIntersectionObserverV2, @@ -423,6 +425,11 @@ {CSSSampleId::kScrollbarGutter, WebDXFeature::kScrollbarGutter}, {CSSSampleId::kScrollbarWidth, WebDXFeature::kScrollbarWidth}, {CSSSampleId::kScrollSnapType, WebDXFeature::kScrollSnap}, + {CSSSampleId::kScrollInitialTarget, + WebDXFeature::kScrollInitialTarget}, + {CSSSampleId::kTextBox, WebDXFeature::kTextBox}, + {CSSSampleId::kTextBoxEdge, WebDXFeature::kTextBox}, + {CSSSampleId::kTextBoxTrim, WebDXFeature::kTextBox}, {CSSSampleId::kTextIndent, WebDXFeature::kTextIndent}, {CSSSampleId::kTextSpacingTrim, WebDXFeature::kTextSpacingTrim}, {CSSSampleId::kTransitionBehavior,
diff --git a/components/password_manager/core/browser/password_autofill_manager_unittest.cc b/components/password_manager/core/browser/password_autofill_manager_unittest.cc index ff07fea..afe4607 100644 --- a/components/password_manager/core/browser/password_autofill_manager_unittest.cc +++ b/components/password_manager/core/browser/password_autofill_manager_unittest.cc
@@ -30,7 +30,7 @@ #include "components/autofill/core/browser/filling/filling_product.h" #include "components/autofill/core/browser/foundations/autofill_client.h" #include "components/autofill/core/browser/foundations/test_autofill_client.h" -#include "components/autofill/core/browser/integrators/mock_identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.h" #include "components/autofill/core/browser/suggestions/suggestion.h" #include "components/autofill/core/browser/suggestions/suggestion_hiding_reason.h" #include "components/autofill/core/browser/suggestions/suggestion_test_helpers.h"
diff --git a/components/password_manager/core/browser/password_suggestion_generator.cc b/components/password_manager/core/browser/password_suggestion_generator.cc index ed5e27d..badde90 100644 --- a/components/password_manager/core/browser/password_suggestion_generator.cc +++ b/components/password_manager/core/browser/password_suggestion_generator.cc
@@ -14,7 +14,7 @@ #include "base/strings/utf_string_conversions.h" #include "components/affiliations/core/browser/affiliation_utils.h" #include "components/autofill/core/browser/field_types.h" -#include "components/autofill/core/browser/integrators/identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/identity_credential_delegate.h" #include "components/autofill/core/browser/suggestions/suggestion.h" #include "components/password_manager/content/common/web_ui_constants.h" #include "components/password_manager/core/browser/features/password_features.h"
diff --git a/components/password_manager/core/browser/password_suggestion_generator_unittest.cc b/components/password_manager/core/browser/password_suggestion_generator_unittest.cc index 9144539..9b3ff21 100644 --- a/components/password_manager/core/browser/password_suggestion_generator_unittest.cc +++ b/components/password_manager/core/browser/password_suggestion_generator_unittest.cc
@@ -14,7 +14,7 @@ #include "base/test/task_environment.h" #include "base/types/expected.h" #include "components/autofill/core/browser/foundations/test_autofill_client.h" -#include "components/autofill/core/browser/integrators/mock_identity_credential_delegate.h" +#include "components/autofill/core/browser/integrators/identity_credential/mock_identity_credential_delegate.h" #include "components/autofill/core/browser/suggestions/suggestion.h" #include "components/autofill/core/browser/suggestions/suggestion_test_helpers.h" #include "components/autofill/core/browser/suggestions/suggestion_type.h"
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto index 8b267e4..135be1f 100644 --- a/components/policy/proto/device_management_backend.proto +++ b/components/policy/proto/device_management_backend.proto
@@ -2519,8 +2519,8 @@ enum ReportType { UNKNOWN = 0; PROFILE_REPORT = 1; - PROFILE_SIGNALS = 2; - PROFILE_REPORT_WITH_SIGNALS = 3; + PROFILE_SECURITY_SIGNALS = 2; + PROFILE_REPORT_WITH_SECURITY_SIGNALS = 3; } // The type of report that is being sent.
diff --git a/components/policy/resources/templates/policy_definitions/Miscellaneous/ProvisionalNotificationsAllowed.yaml b/components/policy/resources/templates/policy_definitions/Miscellaneous/ProvisionalNotificationsAllowed.yaml index 81a5175..779cf1239 100644 --- a/components/policy/resources/templates/policy_definitions/Miscellaneous/ProvisionalNotificationsAllowed.yaml +++ b/components/policy/resources/templates/policy_definitions/Miscellaneous/ProvisionalNotificationsAllowed.yaml
@@ -12,8 +12,8 @@ - scottyoder@google.com - file://components/policy/OWNERS -future_on: -- ios +supported_on: +- ios:137- deprecated: false
diff --git a/components/policy/test_support/client_storage.cc b/components/policy/test_support/client_storage.cc index 679c684f..d6b7c4b 100644 --- a/components/policy/test_support/client_storage.cc +++ b/components/policy/test_support/client_storage.cc
@@ -7,7 +7,7 @@ #include "base/check.h" #include "base/containers/contains.h" #include "base/not_fatal_until.h" -#include "crypto/sha2.h" +#include "crypto/hash.h" namespace policy { @@ -95,7 +95,7 @@ std::vector<std::string> hashes; for (const auto& [device_id, client_info] : clients_) { for (const std::string& key : client_info.state_keys) { - std::string hash = crypto::SHA256HashString(key); + auto hash = crypto::hash::Sha256(key); uint64_t hash_remainder = 0; // Simulate long division in base 256, which allows us to interpret // individual chars in our hash as digits. We only care about the @@ -104,7 +104,7 @@ for (uint64_t digit : hash) hash_remainder = (hash_remainder * 256 + digit) % modulus; if (hash_remainder == remainder) - hashes.push_back(hash); + hashes.emplace_back(base::as_string_view(hash)); } } return hashes;
diff --git a/components/policy/test_support/policy_storage.cc b/components/policy/test_support/policy_storage.cc index dd440be..7d1721ce 100644 --- a/components/policy/test_support/policy_storage.cc +++ b/components/policy/test_support/policy_storage.cc
@@ -3,10 +3,11 @@ // found in the LICENSE file. #include "components/policy/test_support/policy_storage.h" + #include "base/numerics/byte_conversions.h" #include "base/strings/strcat.h" #include "base/strings/string_util.h" -#include "crypto/sha2.h" +#include "crypto/hash.h" namespace policy { @@ -113,13 +114,10 @@ uint64_t remainder) const { std::vector<std::string> hashes; for (const auto& [serial, enrollment_state] : initial_enrollment_states_) { - uint64_t hash = 0UL; - uint8_t hash_bytes[sizeof(hash)]; - crypto::SHA256HashString(serial, hash_bytes, sizeof(hash)); - hash = base::U64FromBigEndian(hash_bytes); - if (hash % modulus == remainder) { - hashes.emplace_back(reinterpret_cast<const char*>(hash_bytes), - sizeof(hash)); + auto hash = crypto::hash::Sha256(serial); + auto hash_first8 = base::span<uint8_t>(hash).first<8>(); + if (base::U64FromBigEndian(hash_first8) % modulus == remainder) { + hashes.emplace_back(base::as_string_view(hash_first8)); } } return hashes;
diff --git a/components/policy/test_support/policy_storage.h b/components/policy/test_support/policy_storage.h index 643df6e..a14ec8a 100644 --- a/components/policy/test_support/policy_storage.h +++ b/components/policy/test_support/policy_storage.h
@@ -200,9 +200,10 @@ const InitialEnrollmentState* GetInitialEnrollmentState( const std::string& brand_serial_id) const; - // Returns hashes for brand serial IDs whose initial enrollment state is - // registered on the server. Only hashes, which, when divied by |modulus|, - // result in the specified |remainder|, are returned. + // Returns truncated hashes (the first 8 bytes only) for brand serial IDs + // whose initial enrollment state is registered on the server. Only hashes, + // which, when divied by |modulus|, result in the specified |remainder|, are + // returned. std::vector<std::string> GetMatchingSerialHashes(uint64_t modulus, uint64_t remainder) const;
diff --git a/components/privacy_sandbox/DIR_METADATA b/components/privacy_sandbox/DIR_METADATA index cb1e73c9..aff2c86 100644 --- a/components/privacy_sandbox/DIR_METADATA +++ b/components/privacy_sandbox/DIR_METADATA
@@ -3,5 +3,5 @@ } team_email: "koilos@google.com" buganizer_public: { - component_id: 1697287 + component_id: 1706459 }
diff --git a/components/privacy_sandbox_chrome_strings_grdp/DIR_METADATA b/components/privacy_sandbox_chrome_strings_grdp/DIR_METADATA index cb1e73c9..aff2c86 100644 --- a/components/privacy_sandbox_chrome_strings_grdp/DIR_METADATA +++ b/components/privacy_sandbox_chrome_strings_grdp/DIR_METADATA
@@ -3,5 +3,5 @@ } team_email: "koilos@google.com" buganizer_public: { - component_id: 1697287 + component_id: 1706459 }
diff --git a/components/privacy_sandbox_strings.grd b/components/privacy_sandbox_strings.grd index 7c933429..8f1c7de9 100644 --- a/components/privacy_sandbox_strings.grd +++ b/components/privacy_sandbox_strings.grd
@@ -280,6 +280,7 @@ <file path="strings/privacy_sandbox_strings_zu.xtb" lang="zu" /> </translations> <release seq="1"> + <!--For strings used exclusively within the Privacy Sandbox Dialogs, those containing the word "Chrome" do not require a "Chromium" conditional variant, as these dialogs only appear in Chrome-branded builds--> <messages fallback_to_english="true"> <!-- Ad Topics Page disclaimer --> <message name="IDS_SETTINGS_TOPICS_PAGE_DISCLAIMER_CLANK" desc="Disclaimer of the new Ad topics setting. This text appears beneath the sublabel." formatter_data="android_java"> @@ -783,38 +784,38 @@ Google requires companies to state publicly that they won't use this data to track you across sites. Companies are responsible for letting you know how they use your data. <ph name="BEGIN_LINK"><link></ph>Learn more in our Privacy Policy<ph name="END_LINK"></link></ph>. </message> <!--Ad Topics Content Parity - Ad Topics Settings--> - <message name="IDS_SETTINGS_AD_TOPICS_PAGE_TOGGLE_SUB_LABEL" desc="A description of the new Ad topics setting page. This sits under the toggle to turn on the topics API." translateable="false" formatter_data="android_java"> + <message name="IDS_SETTINGS_AD_TOPICS_PAGE_TOGGLE_SUB_LABEL" desc="A description of the new Ad topics setting page. This sits under the toggle to turn on the topics API." formatter_data="android_java"> Topics are based on your recent browsing history and help limit what sites and their advertising partners can learn about you to show you personalized ads </message> <if expr="_google_chrome"> <then> - <message name="IDS_SETTINGS_AD_TOPICS_PAGE_ACTIVE_TOPICS_DESCRIPTION" desc="A description that appears beneath the 'Active topics' label." translateable="false" formatter_data="android_java"> + <message name="IDS_SETTINGS_AD_TOPICS_PAGE_ACTIVE_TOPICS_DESCRIPTION" desc="A description that appears beneath the 'Active topics' label." formatter_data="android_java"> Chrome auto-deletes ad topics that are older than 4 weeks </message> </then> <else> - <message name="IDS_SETTINGS_AD_TOPICS_PAGE_ACTIVE_TOPICS_DESCRIPTION" desc="A description that appears beneath the 'Active topics' label." translateable="false" formatter_data="android_java"> + <message name="IDS_SETTINGS_AD_TOPICS_PAGE_ACTIVE_TOPICS_DESCRIPTION" desc="A description that appears beneath the 'Active topics' label." formatter_data="android_java"> Chromium auto-deletes ad topics that are older than 4 weeks </message> </else> </if> - <message name="IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_DESKTOP" desc="This string appears at the bottom of the “Ad topics” settings page. “Sites” refers to websites that the user visits. The tone is informative. “Companies” refers to businesses or organizations that these websites belong to. This is intended to explain the possible user risks currently available with our evolving privacy-preserving technologies, in neutral language." translateable="false"> + <message name="IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_DESKTOP" desc="This string appears at the bottom of the “Ad topics” settings page. “Sites” refers to websites that the user visits. The tone is informative. “Companies” refers to businesses or organizations that these websites belong to. This is intended to explain the possible user risks currently available with our evolving privacy-preserving technologies, in neutral language."> Google requires companies to state publicly that they won't use this data to track you across sites. Some sites may use your activity to personalize your experience for more than just ads. They may also store ad topics for longer than 4 weeks and combine it with other information they already know about you. Companies are responsible for letting you know how they use your data. Learn more in our <ph name="BEGIN_LINK1"><a href="$1" aria-description="$2" on-click="$3" id="$4" target="_blank"></ph>Privacy Policy<ph name="LINK_END1"></a></ph>. </message> - <message name="IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_CLANK" desc="This string appears at the bottom of the “Ad topics” settings page. “Sites” refers to websites that the user visits. The tone is informative. “Companies” refers to businesses or organizations that these websites belong to. This is intended to explain the possible user risks currently available with our evolving privacy-preserving technologies, in neutral language." formatter_data="android_java" translateable="false"> + <message name="IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_CLANK" desc="This string appears at the bottom of the “Ad topics” settings page. “Sites” refers to websites that the user visits. The tone is informative. “Companies” refers to businesses or organizations that these websites belong to. This is intended to explain the possible user risks currently available with our evolving privacy-preserving technologies, in neutral language." formatter_data="android_java"> Google requires companies to state publicly that they won't use this data to track you across sites. Some sites may use your activity to personalize your experience for more than just ads. They may also store ad topics for longer than 4 weeks and combine it with other information they already know about you. Companies are responsible for letting you know how they use your data. Learn more in our <ph name="BEGIN_LINK"><link></ph>Privacy Policy<ph name="END_LINK"></link></ph>. </message> <!--Ad Topics Content Parity - Topics EEA Consent Dialog --> - <message name="IDS_PRIVACY_SANDBOX_M1_CONSENT_DESCRIPTION_1_CONTENT_PARITY" desc="" translateable="false" formatter_data="android_java"> + <message name="IDS_PRIVACY_SANDBOX_M1_CONSENT_DESCRIPTION_1_CONTENT_PARITY" desc="This string gives an overview of “ad topics”, an ad privacy feature. “Topics of interest” refers to topics that are relevant or interesting to the user based on their browsing activity online." formatter_data="android_java"> Ad topics limit what sites and their advertising partners can learn about you to show you personalized ads. Chrome can note topics of interest based on your recent browsing history. Later, a site you visit can ask Chrome for relevant topics to personalize the ads you see. </message> - <message name="IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY" desc="" translateable="false"> + <message name="IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY" desc="This string appears at the bottom of the “Ad topics” settings page. “Sites” refers to websites that the user visits. The tone is informative. “Companies” refers to businesses or organizations that these websites belong to. This is intended to explain the possible user risks currently available with our evolving privacy-preserving technologies, in neutral language."> Google requires companies to state publicly that they won't use this data to track you across sites. Some sites may use your activity to personalize your experience for more than just ads. They may also store ad topics for longer than 4 weeks and combine it with other information they already know about you. Companies are responsible for letting you know how they use your data. <ph name="BEGIN_LINK1"><a href="#" id="$1" aria-description="$2" on-click="$3"></ph>Learn more in our Privacy Policy<ph name="LINK_END1"></a></ph> </message> - <message name="IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_NO_LINK_CONTENT_PARITY" desc="" translateable="false" formatter_data="android_java"> + <message name="IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_NO_LINK_CONTENT_PARITY" desc="This string appears at the bottom of the “Ad topics” settings page. “Sites” refers to websites that the user visits. The tone is informative. “Companies” refers to businesses or organizations that these websites belong to. This is intended to explain the possible user risks currently available with our evolving privacy-preserving technologies, in neutral language." formatter_data="android_java"> Google requires companies to state publicly that they won't use this data to track you across sites. Some sites may use your activity to personalize your experience for more than just ads. They may also store ad topics for longer than 4 weeks and combine it with other information they already know about you. Companies are responsible for letting you know how they use your data. Learn more in our Privacy Policy. </message> - <message name="IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY_CLANK" desc="" translateable="false" formatter_data="android_java"> + <message name="IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY_CLANK" desc="This string appears at the bottom of the “Ad topics” settings page. “Sites” refers to websites that the user visits. The tone is informative. “Companies” refers to businesses or organizations that these websites belong to. This is intended to explain the possible user risks currently available with our evolving privacy-preserving technologies, in neutral language." formatter_data="android_java"> Google requires companies to state publicly that they won't use this data to track you across sites. Some sites may use your activity to personalize your experience for more than just ads. They may also store ad topics for longer than 4 weeks and combine it with other information they already know about you. Companies are responsible for letting you know how they use your data. <ph name="BEGIN_LINK"><link></ph>Learn more in our Privacy Policy<ph name="END_LINK"></link></ph>. </message> <!--Privacy Sandbox Privacy Policy-->
diff --git a/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_DESCRIPTION_1_CONTENT_PARITY.png.sha1 b/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_DESCRIPTION_1_CONTENT_PARITY.png.sha1 new file mode 100644 index 0000000..e68a4e6 --- /dev/null +++ b/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_DESCRIPTION_1_CONTENT_PARITY.png.sha1
@@ -0,0 +1 @@ +892648e9e52fab67962eeb5673f03d32c4fbab31 \ No newline at end of file
diff --git a/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY.png.sha1 b/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY.png.sha1 new file mode 100644 index 0000000..1d16f11 --- /dev/null +++ b/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY.png.sha1
@@ -0,0 +1 @@ +8df469de7881f813006d9b100b54f90a277dd36a \ No newline at end of file
diff --git a/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY_CLANK.png.sha1 b/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY_CLANK.png.sha1 new file mode 100644 index 0000000..e59fe168 --- /dev/null +++ b/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_CONTENT_PARITY_CLANK.png.sha1
@@ -0,0 +1 @@ +e762c13c336e6d0095ebaf82ea6b4c83185bfffa \ No newline at end of file
diff --git a/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_NO_LINK_CONTENT_PARITY.png.sha1 b/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_NO_LINK_CONTENT_PARITY.png.sha1 new file mode 100644 index 0000000..1d16f11 --- /dev/null +++ b/components/privacy_sandbox_strings_grd/IDS_PRIVACY_SANDBOX_M1_CONSENT_LEARN_MORE_BULLET_2_DESCRIPTION_NO_LINK_CONTENT_PARITY.png.sha1
@@ -0,0 +1 @@ +8df469de7881f813006d9b100b54f90a277dd36a \ No newline at end of file
diff --git a/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_ACTIVE_TOPICS_DESCRIPTION.png.sha1 b/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_ACTIVE_TOPICS_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..286a274 --- /dev/null +++ b/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_ACTIVE_TOPICS_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +e553ab7488a25a17025cf776fe4df829dbcd9533 \ No newline at end of file
diff --git a/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_CLANK.png.sha1 b/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_CLANK.png.sha1 new file mode 100644 index 0000000..2eaf7d8b --- /dev/null +++ b/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_CLANK.png.sha1
@@ -0,0 +1 @@ +e47367028227520a11b3c820ebd060290989b729 \ No newline at end of file
diff --git a/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_DESKTOP.png.sha1 b/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_DESKTOP.png.sha1 new file mode 100644 index 0000000..54d0ff718 --- /dev/null +++ b/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_DISCLAIMER_V2_DESKTOP.png.sha1
@@ -0,0 +1 @@ +91d03e83935233c5b2885c850252a8692626af5b \ No newline at end of file
diff --git a/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_TOGGLE_SUB_LABEL.png.sha1 b/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_TOGGLE_SUB_LABEL.png.sha1 new file mode 100644 index 0000000..399f9d9 --- /dev/null +++ b/components/privacy_sandbox_strings_grd/IDS_SETTINGS_AD_TOPICS_PAGE_TOGGLE_SUB_LABEL.png.sha1
@@ -0,0 +1 @@ +ed0d2ac43d59f4f16247ae79a224468e15b938ce \ No newline at end of file
diff --git a/components/reading_list/core/dual_reading_list_model.cc b/components/reading_list/core/dual_reading_list_model.cc index e0751bd5..5a5d65c 100644 --- a/components/reading_list/core/dual_reading_list_model.cc +++ b/components/reading_list/core/dual_reading_list_model.cc
@@ -14,6 +14,7 @@ #include "components/reading_list/core/reading_list_model_impl.h" #include "components/sync/base/features.h" #include "google_apis/gaia/core_account_id.h" +#include "google_apis/gaia/gaia_id.h" #include "url/gurl.h" namespace reading_list { @@ -203,14 +204,13 @@ return local_or_syncable_model_->IsUrlSupported(url); } -CoreAccountId DualReadingListModel::GetAccountWhereEntryIsSavedTo( - const GURL& url) { +GaiaId DualReadingListModel::GetAccountWhereEntryIsSavedTo(const GURL& url) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); - CoreAccountId account_id = account_model_->GetAccountWhereEntryIsSavedTo(url); - if (!account_id.empty()) { - return account_id; + GaiaId gaia_id = account_model_->GetAccountWhereEntryIsSavedTo(url); + if (!gaia_id.empty()) { + return gaia_id; } // `local_or_syncable_model_` may return an account for the case where it's // sync-ing.
diff --git a/components/reading_list/core/dual_reading_list_model.h b/components/reading_list/core/dual_reading_list_model.h index e434fcc..e03998c 100644 --- a/components/reading_list/core/dual_reading_list_model.h +++ b/components/reading_list/core/dual_reading_list_model.h
@@ -16,7 +16,7 @@ #include "components/reading_list/core/reading_list_model.h" #include "components/reading_list/core/reading_list_model_impl.h" #include "components/reading_list/core/reading_list_model_observer.h" -#include "google_apis/gaia/core_account_id.h" +#include "google_apis/gaia/gaia_id.h" #include "url/gurl.h" namespace reading_list { @@ -64,7 +64,7 @@ scoped_refptr<const ReadingListEntry> GetEntryByURL( const GURL& gurl) const override; bool IsUrlSupported(const GURL& url) override; - CoreAccountId GetAccountWhereEntryIsSavedTo(const GURL& url) override; + GaiaId GetAccountWhereEntryIsSavedTo(const GURL& url) override; bool NeedsExplicitUploadToSyncServer(const GURL& url) const override; void MarkAllForUploadToSyncServerIfNeeded() override; const ReadingListEntry& AddOrReplaceEntry(
diff --git a/components/reading_list/core/dual_reading_list_model_unittest.cc b/components/reading_list/core/dual_reading_list_model_unittest.cc index 28450d10..2a4d4df 100644 --- a/components/reading_list/core/dual_reading_list_model_unittest.cc +++ b/components/reading_list/core/dual_reading_list_model_unittest.cc
@@ -696,11 +696,10 @@ StorageStateForTesting::kExistsInBothModels); EXPECT_TRUE(dual_model_->GetAccountWhereEntryIsSavedTo(kLocalUrl).empty()); - // TODO(crbug.com/383089506): removed ToString() once GaiaId is returned. - EXPECT_EQ(dual_model_->GetAccountWhereEntryIsSavedTo(kAccountUrl).ToString(), - kTestGaiaId.ToString()); - EXPECT_EQ(dual_model_->GetAccountWhereEntryIsSavedTo(kCommonUrl).ToString(), - kTestGaiaId.ToString()); + EXPECT_EQ(dual_model_->GetAccountWhereEntryIsSavedTo(kAccountUrl), + kTestGaiaId); + EXPECT_EQ(dual_model_->GetAccountWhereEntryIsSavedTo(kCommonUrl), + kTestGaiaId); EXPECT_TRUE( dual_model_ ->GetAccountWhereEntryIsSavedTo(GURL("http://non_existing_url.com/")) @@ -714,8 +713,8 @@ ASSERT_EQ(dual_model_->GetStorageStateForURLForTesting(kUrl), StorageStateForTesting::kExistsInLocalOrSyncableModelOnly); - EXPECT_EQ(dual_model_->GetAccountWhereEntryIsSavedTo(kUrl).ToString(), - kTestGaiaId.ToString()); + EXPECT_EQ(dual_model_->GetAccountWhereEntryIsSavedTo(kUrl), + kTestGaiaId); EXPECT_TRUE( dual_model_ ->GetAccountWhereEntryIsSavedTo(GURL("http://non_existing_url.com/"))
diff --git a/components/reading_list/core/reading_list_model.h b/components/reading_list/core/reading_list_model.h index c48ae18..c6a7f8c 100644 --- a/components/reading_list/core/reading_list_model.h +++ b/components/reading_list/core/reading_list_model.h
@@ -15,7 +15,7 @@ #include "base/memory/weak_ptr.h" #include "components/keyed_service/core/keyed_service.h" #include "components/reading_list/core/reading_list_entry.h" -#include "google_apis/gaia/core_account_id.h" +#include "google_apis/gaia/gaia_id.h" class GURL; class ReadingListModelObserver; @@ -103,7 +103,7 @@ // If an account exists that syncs the entry which has the given `url`, that // account will be returned. Otherwise, the entry may be saved locally on the // device or may not exist, in that case an empty account will be returned. - virtual CoreAccountId GetAccountWhereEntryIsSavedTo(const GURL& url) = 0; + virtual GaiaId GetAccountWhereEntryIsSavedTo(const GURL& url) = 0; // Returns true if the entry with `url` requires explicit user action to // upload to sync servers.
diff --git a/components/reading_list/core/reading_list_model_impl.cc b/components/reading_list/core/reading_list_model_impl.cc index d67e244..695752b 100644 --- a/components/reading_list/core/reading_list_model_impl.cc +++ b/components/reading_list/core/reading_list_model_impl.cc
@@ -21,7 +21,7 @@ #include "components/reading_list/core/reading_list_model_storage.h" #include "components/reading_list/core/reading_list_sync_bridge.h" #include "components/sync/model/client_tag_based_data_type_processor.h" -#include "google_apis/gaia/core_account_id.h" +#include "google_apis/gaia/gaia_id.h" #include "url/gurl.h" ReadingListModelImpl::ScopedReadingListBatchUpdateImpl:: @@ -324,16 +324,14 @@ return url.SchemeIsHTTPOrHTTPS(); } -CoreAccountId ReadingListModelImpl::GetAccountWhereEntryIsSavedTo( - const GURL& url) { +GaiaId ReadingListModelImpl::GetAccountWhereEntryIsSavedTo(const GURL& url) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(loaded()); if (entries_.find(url) == entries_.end()) { - return CoreAccountId(); + return GaiaId(); } - return CoreAccountId::FromString( - sync_bridge_.change_processor()->TrackedAccountId()); + return sync_bridge_.change_processor()->TrackedGaiaId(); } bool ReadingListModelImpl::NeedsExplicitUploadToSyncServer(
diff --git a/components/reading_list/core/reading_list_model_impl.h b/components/reading_list/core/reading_list_model_impl.h index 06dd1b8..0f2b7500 100644 --- a/components/reading_list/core/reading_list_model_impl.h +++ b/components/reading_list/core/reading_list_model_impl.h
@@ -18,7 +18,7 @@ #include "components/reading_list/core/reading_list_model_storage.h" #include "components/reading_list/core/reading_list_sync_bridge.h" #include "components/sync/base/storage_type.h" -#include "google_apis/gaia/core_account_id.h" +#include "google_apis/gaia/gaia_id.h" namespace base { class Clock; @@ -64,7 +64,7 @@ scoped_refptr<const ReadingListEntry> GetEntryByURL( const GURL& gurl) const override; bool IsUrlSupported(const GURL& url) override; - CoreAccountId GetAccountWhereEntryIsSavedTo(const GURL& url) override; + GaiaId GetAccountWhereEntryIsSavedTo(const GURL& url) override; bool NeedsExplicitUploadToSyncServer(const GURL& url) const override; void MarkAllForUploadToSyncServerIfNeeded() override; const ReadingListEntry& AddOrReplaceEntry(
diff --git a/components/reading_list/core/reading_list_model_unittest.cc b/components/reading_list/core/reading_list_model_unittest.cc index 4b3667c..cd93904 100644 --- a/components/reading_list/core/reading_list_model_unittest.cc +++ b/components/reading_list/core/reading_list_model_unittest.cc
@@ -351,9 +351,8 @@ /*initial_syncable_entries=*/{base::MakeRefCounted<ReadingListEntry>( example, "example_title", clock_.Now())})); - // TODO(crbug.com/383089506): removed ToString() once GaiaId is returned. - EXPECT_EQ(model_->GetAccountWhereEntryIsSavedTo(example).ToString(), - kTestGaiaId.ToString()); + EXPECT_EQ(model_->GetAccountWhereEntryIsSavedTo(example), + kTestGaiaId); EXPECT_TRUE( model_ ->GetAccountWhereEntryIsSavedTo(GURL("http://non_existing_url.com/"))
diff --git a/components/safe_browsing/content/browser/web_ui/resources/safe_browsing.ts b/components/safe_browsing/content/browser/web_ui/resources/safe_browsing.ts index f4d4206..c69ad37 100644 --- a/components/safe_browsing/content/browser/web_ui/resources/safe_browsing.ts +++ b/components/safe_browsing/content/browser/web_ui/resources/safe_browsing.ts
@@ -269,7 +269,7 @@ } function addExperiments(result: string[]) { - addContentHelper(result, 'result-template', 'experiements-list', 'span'); + addContentHelper(result, 'result-template', 'experiments-list', 'span'); } function addPrefs(result: string[]) { @@ -361,17 +361,17 @@ for (let i = 0; i < resLength; i += 2) { const listTemplate = $<HTMLTemplateElement>(templateName); assert(listTemplate); - const formattedTemplated = + const formattedTemplate = listTemplate.content.cloneNode(true) as HTMLElement; const firstResult = result[i]; const secondResult = result[i + 1]; const selectedElements = - formattedTemplated.querySelectorAll(elementSelector); + formattedTemplate.querySelectorAll(elementSelector); const firstElement = selectedElements[0]; const secondElement = selectedElements[1]; const parentList = $(parentListName); - assert(firstResult); + assert(firstResult !== null && firstResult !== undefined); assert(secondResult); assert(firstElement); assert(secondElement); @@ -379,7 +379,7 @@ firstElement.textContent = secondResult + ': '; secondElement.textContent = firstResult; - parentList.appendChild(listTemplate); + parentList.appendChild(formattedTemplate); } } @@ -489,9 +489,10 @@ // A helper function that ensures there are elements within `results` before // adding them to a list. function addResultToTableHelper( - listName: string, result: string[], position: number) { - const tableId = result[0]; - const token = result[1]; + listName: string, result: Array<string|number>, position: number) { + const tableId = + typeof result[0] === 'number' ? (result[0]).toString() : result[0]; + const token = result[1] as string; assert(tableId); assert(token);
diff --git a/components/safe_browsing/core/browser/password_protection/password_protection_service_base.h b/components/safe_browsing/core/browser/password_protection/password_protection_service_base.h index 6afc6705..5aa042d 100644 --- a/components/safe_browsing/core/browser/password_protection/password_protection_service_base.h +++ b/components/safe_browsing/core/browser/password_protection/password_protection_service_base.h
@@ -344,8 +344,6 @@ virtual bool CanShowInterstitial(ReusedPasswordAccountType password_type, const GURL& main_frame_url) = 0; - void CheckCsdAllowlistOnIOThread(const GURL& url, bool* check_result); - // Get information about Delayed Warnings and Omnibox URL display experiments. // This information is sent in PhishGuard pings. virtual LoginReputationClientRequest::UrlDisplayExperiment
diff --git a/components/saved_tab_groups/internal/saved_tab_group_sync_bridge.cc b/components/saved_tab_groups/internal/saved_tab_group_sync_bridge.cc index 9f69039..f3147738 100644 --- a/components/saved_tab_groups/internal/saved_tab_group_sync_bridge.cc +++ b/components/saved_tab_groups/internal/saved_tab_group_sync_bridge.cc
@@ -551,11 +551,12 @@ return change_processor()->TrackedCacheGuid(); } +// TODO(crbug.com/383089506): rename to GetTrackedGaiaId(). std::optional<GaiaId> SavedTabGroupSyncBridge::GetTrackedAccountId() const { if (!change_processor()->IsTrackingMetadata()) { return std::nullopt; } - return GaiaId(change_processor()->TrackedAccountId()); + return change_processor()->TrackedGaiaId(); } bool SavedTabGroupSyncBridge::IsSyncing() const {
diff --git a/components/saved_tab_groups/internal/shared_tab_group_data_sync_bridge.cc b/components/saved_tab_groups/internal/shared_tab_group_data_sync_bridge.cc index acb331c..19ef708 100644 --- a/components/saved_tab_groups/internal/shared_tab_group_data_sync_bridge.cc +++ b/components/saved_tab_groups/internal/shared_tab_group_data_sync_bridge.cc
@@ -1227,9 +1227,8 @@ // tab strip, and associate its local group ID. This is currently prevented // by delaying observer calls in the TabGroupSyncService. StoreSharedGroup(write_batch, specifics, proto::LocalSharedTabGroupData()); - bool use_originating_tab_group_guid = - collaboration_metadata.created_by() == - GaiaId(change_processor()->TrackedAccountId()); + bool use_originating_tab_group_guid = collaboration_metadata.created_by() == + change_processor()->TrackedGaiaId(); model_wrapper_->AddGroup(SpecificsToSharedTabGroup( specifics, collaboration_metadata, creation_time, use_originating_tab_group_guid));
diff --git a/components/saved_tab_groups/internal/tab_group_sync_bridge_mediator.cc b/components/saved_tab_groups/internal/tab_group_sync_bridge_mediator.cc index a5980ef..d2747cf 100644 --- a/components/saved_tab_groups/internal/tab_group_sync_bridge_mediator.cc +++ b/components/saved_tab_groups/internal/tab_group_sync_bridge_mediator.cc
@@ -172,12 +172,11 @@ std::optional<GaiaId> TabGroupSyncBridgeMediator::GetTrackingAccountIdForSharedBridge() const { CHECK(shared_bridge_); - GaiaId tracked_account_id( - shared_bridge_->change_processor()->TrackedAccountId()); - if (tracked_account_id.empty()) { + GaiaId tracked_gaia_id = shared_bridge_->change_processor()->TrackedGaiaId(); + if (tracked_gaia_id.empty()) { return std::nullopt; } - return tracked_account_id; + return tracked_gaia_id; } void TabGroupSyncBridgeMediator::SavedTabGroupAddedLocally(
diff --git a/components/saved_tab_groups/internal/tab_group_sync_service_unittest.cc b/components/saved_tab_groups/internal/tab_group_sync_service_unittest.cc index ab6cb8e..afe19695 100644 --- a/components/saved_tab_groups/internal/tab_group_sync_service_unittest.cc +++ b/components/saved_tab_groups/internal/tab_group_sync_service_unittest.cc
@@ -232,8 +232,8 @@ .WillByDefault(testing::Return(fake_controller_delegate_.GetWeakPtr())); ON_CALL(shared_processor_, IsTrackingMetadata()) .WillByDefault(testing::Return(true)); - ON_CALL(shared_processor_, TrackedAccountId()) - .WillByDefault(testing::Return(kDefaultGaiaId.ToString())); + ON_CALL(shared_processor_, TrackedGaiaId()) + .WillByDefault(testing::Return(kDefaultGaiaId)); ON_CALL(*collaboration_finder_, IsCollaborationAvailable(_)) .WillByDefault(testing::Return(true)); @@ -609,8 +609,8 @@ TEST_F(TabGroupSyncServiceTest, UpdateSharedAttributionsOnUpdateVisualData) { MakeTabGroupShared(local_group_id_1_, "collaboration"); - EXPECT_CALL(*mock_shared_processor(), TrackedAccountId()) - .WillOnce(Return("new_gaia_id")); + EXPECT_CALL(*mock_shared_processor(), TrackedGaiaId()) + .WillOnce(Return(GaiaId("new_gaia_id"))); tab_groups::TabGroupVisualData visual_data = test::CreateTabGroupVisualData(); tab_group_sync_service_->UpdateVisualData(local_group_id_1_, &visual_data); @@ -1157,8 +1157,8 @@ ASSERT_THAT(group->GetTab(local_tab_id), Pointee(HasSharedAttribution(kDefaultGaiaId, kDefaultGaiaId))); - EXPECT_CALL(*mock_shared_processor(), TrackedAccountId()) - .WillOnce(Return("other_gaia_id")); + EXPECT_CALL(*mock_shared_processor(), TrackedGaiaId()) + .WillOnce(Return(GaiaId("other_gaia_id"))); tab_group_sync_service_->NavigateTab(local_group_id_1_, local_tab_id, GURL("http://www.example.com"), u"title 2"); @@ -2125,16 +2125,16 @@ // Mimic the state where we receive a MakeTabGroupShared call while user // hasn't completed sign-in. - EXPECT_CALL(*mock_shared_processor(), TrackedAccountId()) - .WillRepeatedly(Return("")); + EXPECT_CALL(*mock_shared_processor(), TrackedGaiaId()) + .WillRepeatedly(Return(GaiaId())); tab_group_sync_service_->MakeTabGroupShared( local_group_id_1_, "collaboration", mock_callback.Get()); WaitForPostedTasks(); ASSERT_THAT(model_->GetSharedTabGroupsOnly(), IsEmpty()); // Mimic initial merge completion. - EXPECT_CALL(*mock_shared_processor(), TrackedAccountId()) - .WillRepeatedly(Return("some_gaia")); + EXPECT_CALL(*mock_shared_processor(), TrackedGaiaId()) + .WillRepeatedly(Return(GaiaId("some_gaia"))); model_->OnSyncBridgeUpdateTypeChanged(SyncBridgeUpdateType::kDefaultState); WaitForPostedTasks(); ASSERT_THAT(model_->GetSharedTabGroupsOnly(), SizeIs(1));
diff --git a/components/search_engines/template_url_service.h b/components/search_engines/template_url_service.h index bd234a1..f37ad7e 100644 --- a/components/search_engines/template_url_service.h +++ b/components/search_engines/template_url_service.h
@@ -148,25 +148,6 @@ }; // LINT.ThenChange(//tools/metrics/histograms/metadata/search/enums.xml:SearchPolicyConflictType) - // These values are persisted to logs. Entries should not be renumbered and - // numeric values should never be reused. - // LINT.IfChange(KeywordType) - enum class KeywordType { - kNone = 0, - kStarterPack = 1, - kPrepopulated = 2, - kSearchEngineSetByExtension = 3, - kNonFeaturedSiteSearchSetByPolicy = 4, - kFeaturedSiteSearchSetByPolicy = 5, - kSearchAggregatorSetByPolicy = 6, - kDefaultSearchEngineSetByPolicy = 7, - kDefaultSearchEngineSetByUser = 8, - kSubstitutingSiteSearchSetByUser = 9, - kNonSubstitutingSiteSearchSetByUser = 10, - kMaxValue = kNonSubstitutingSiteSearchSetByUser, - }; - // LINT.ThenChange(//tools/metrics/histograms/metadata/omnibox/histograms.xml:KeywordType) - TemplateURLService( PrefService& prefs, search_engines::SearchEngineChoiceService& search_engine_choice_service,
diff --git a/components/sync/model/client_tag_based_data_type_processor.cc b/components/sync/model/client_tag_based_data_type_processor.cc index 8ca76bd..336cb2500 100644 --- a/components/sync/model/client_tag_based_data_type_processor.cc +++ b/components/sync/model/client_tag_based_data_type_processor.cc
@@ -61,10 +61,10 @@ kDataTypeIdMismatch = 2, // The following cases won't result in metadata being cleared. - kEmptyPersistedAuthenticatedAccountId = 3, - kAuthenticatedAccountIdMismatch = 4, + kEmptyPersistedAuthenticatedGaiaId = 3, + kAuthenticatedGaiaIdMismatch = 4, - kMaxValue = kAuthenticatedAccountIdMismatch, + kMaxValue = kAuthenticatedGaiaIdMismatch, }; // LINT.ThenChange(//tools/metrics/histograms/metadata/sync/enums.xml:SyncMetadataConsistency) @@ -89,12 +89,12 @@ // restart (and this does not mean the account has changed, this is checked // above by cache_guid mismatch). if (data_type_state.authenticated_obfuscated_gaia_id().empty()) { - return SyncMetadataConsistency::kEmptyPersistedAuthenticatedAccountId; + return SyncMetadataConsistency::kEmptyPersistedAuthenticatedGaiaId; } if (data_type_state.authenticated_obfuscated_gaia_id() != activation_request.authenticated_gaia_id.ToString()) { - return SyncMetadataConsistency::kAuthenticatedAccountIdMismatch; + return SyncMetadataConsistency::kAuthenticatedGaiaIdMismatch; } return SyncMetadataConsistency::kMetadataConsistent; @@ -398,16 +398,17 @@ return entity_tracker_ != nullptr; } -std::string ClientTagBasedDataTypeProcessor::TrackedAccountId() const { +GaiaId ClientTagBasedDataTypeProcessor::TrackedGaiaId() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Returning non-empty here despite !IsTrackingMetadata() has weird semantics, // e.g. initial updates are being fetched but we haven't received the response // (i.e. prior to exercising MergeFullSyncData()). Let's be cautious and hide // the account ID. if (!IsTrackingMetadata()) { - return ""; + return GaiaId(); } - return entity_tracker_->data_type_state().authenticated_obfuscated_gaia_id(); + return GaiaId( + entity_tracker_->data_type_state().authenticated_obfuscated_gaia_id()); } std::string ClientTagBasedDataTypeProcessor::TrackedCacheGuid() const { @@ -1481,8 +1482,8 @@ switch (sync_metadata_consistency) { case SyncMetadataConsistency::kMetadataConsistent: break; - case SyncMetadataConsistency::kEmptyPersistedAuthenticatedAccountId: - case SyncMetadataConsistency::kAuthenticatedAccountIdMismatch: { + case SyncMetadataConsistency::kEmptyPersistedAuthenticatedGaiaId: + case SyncMetadataConsistency::kAuthenticatedGaiaIdMismatch: { // Fix the field in place. // TODO(crbug.com/40897441): This doesn't fit the method name. It's also // not clear if this codepath is even required.
diff --git a/components/sync/model/client_tag_based_data_type_processor.h b/components/sync/model/client_tag_based_data_type_processor.h index 6d54fa1..d759084 100644 --- a/components/sync/model/client_tag_based_data_type_processor.h +++ b/components/sync/model/client_tag_based_data_type_processor.h
@@ -28,6 +28,7 @@ #include "components/sync/model/metadata_change_list.h" #include "components/sync/model/model_error.h" #include "components/sync/model/processor_entity_tracker.h" +#include "google_apis/gaia/gaia_id.h" namespace sync_pb { class DataTypeState; @@ -86,7 +87,7 @@ void OnModelStarting(DataTypeSyncBridge* bridge) override; void ModelReadyToSync(std::unique_ptr<MetadataBatch> batch) override; bool IsTrackingMetadata() const override; - std::string TrackedAccountId() const override; + GaiaId TrackedGaiaId() const override; std::string TrackedCacheGuid() const override; void ReportError(const ModelError& error) override; std::optional<ModelError> GetError() const override;
diff --git a/components/sync/model/client_tag_based_data_type_processor_unittest.cc b/components/sync/model/client_tag_based_data_type_processor_unittest.cc index a7baecd..7bb4664 100644 --- a/components/sync/model/client_tag_based_data_type_processor_unittest.cc +++ b/components/sync/model/client_tag_based_data_type_processor_unittest.cc
@@ -554,17 +554,16 @@ bool error_reported_ = false; }; -TEST_F(ClientTagBasedDataTypeProcessorTest, ShouldExposeNewlyTrackedAccountId) { +TEST_F(ClientTagBasedDataTypeProcessorTest, ShouldExposeNewlyTrackedGaiaId) { ModelReadyToSync(); - ASSERT_EQ("", type_processor()->TrackedAccountId()); + ASSERT_EQ(GaiaId(), type_processor()->TrackedGaiaId()); OnSyncStarting(); worker()->UpdateFromServer(); - EXPECT_EQ(kDefaultAuthenticatedGaiaId.ToString(), - type_processor()->TrackedAccountId()); + EXPECT_EQ(kDefaultAuthenticatedGaiaId, type_processor()->TrackedGaiaId()); } TEST_F(ClientTagBasedDataTypeProcessorTest, - ShouldExposePreviouslyTrackedAccountId) { + ShouldExposePreviouslyTrackedGaiaId) { const GaiaId kPersistedGaiaId("PersistedGaiaId"); std::unique_ptr<MetadataBatch> metadata_batch = db()->CreateMetadataBatch(); @@ -579,16 +578,16 @@ metadata_batch->SetDataTypeState(data_type_state); type_processor()->ModelReadyToSync(std::move(metadata_batch)); - // Even prior to starting sync, the account ID should already be tracked. - EXPECT_EQ(kPersistedGaiaId.ToString(), type_processor()->TrackedAccountId()); + // Even prior to starting sync, the Gaia ID should already be tracked. + EXPECT_EQ(kPersistedGaiaId, type_processor()->TrackedGaiaId()); // If sync gets started, the account should still be tracked. OnSyncStarting(kPersistedGaiaId); - EXPECT_EQ(kPersistedGaiaId.ToString(), type_processor()->TrackedAccountId()); + EXPECT_EQ(kPersistedGaiaId, type_processor()->TrackedGaiaId()); } TEST_F(ClientTagBasedDataTypeProcessorTest, - ShouldExposeNewlyTrackedAccountIdIfChanged) { + ShouldExposeNewlyTrackedGaiaIdIfChanged) { const GaiaId kPersistedGaiaId("PersistedGaiaId"); std::unique_ptr<MetadataBatch> metadata_batch = db()->CreateMetadataBatch(); @@ -604,13 +603,13 @@ type_processor()->ModelReadyToSync(std::move(metadata_batch)); // Even prior to starting sync, the account ID should already be tracked. - ASSERT_EQ(kPersistedGaiaId.ToString(), type_processor()->TrackedAccountId()); + ASSERT_EQ(kPersistedGaiaId, type_processor()->TrackedGaiaId()); // If sync gets started, the new account should be tracked. const GaiaId kNewGaiaId("NewGaiaId"); OnSyncStarting(kNewGaiaId); EXPECT_TRUE(type_processor()->IsTrackingMetadata()); - EXPECT_EQ(kNewGaiaId.ToString(), type_processor()->TrackedAccountId()); + EXPECT_EQ(kNewGaiaId, type_processor()->TrackedGaiaId()); } TEST_F(ClientTagBasedDataTypeProcessorTest, @@ -2696,40 +2695,42 @@ }; TEST_F(CommitOnlyClientTagBasedDataTypeProcessorTest, - ShouldExposeNewlyTrackedAccountId) { + ShouldExposeNewlyTrackedGaiaId) { ModelReadyToSync(); - ASSERT_EQ("", type_processor()->TrackedAccountId()); + ASSERT_EQ(GaiaId(), type_processor()->TrackedGaiaId()); OnSyncStarting(); - EXPECT_EQ(kDefaultAuthenticatedGaiaId.ToString(), - type_processor()->TrackedAccountId()); + EXPECT_EQ(kDefaultAuthenticatedGaiaId, type_processor()->TrackedGaiaId()); } TEST_F(CommitOnlyClientTagBasedDataTypeProcessorTest, - ShouldExposePreviouslyTrackedAccountId) { + ShouldExposePreviouslyTrackedGaiaId) { + const GaiaId kPersistedGaiaId("PersistedGaiaId"); + std::unique_ptr<MetadataBatch> metadata_batch = db()->CreateMetadataBatch(); sync_pb::DataTypeState data_type_state(metadata_batch->GetDataTypeState()); data_type_state.set_initial_sync_state( sync_pb::DataTypeState_InitialSyncState_INITIAL_SYNC_DONE); data_type_state.set_cache_guid(kCacheGuid); - data_type_state.set_authenticated_obfuscated_gaia_id("PersistedGaiaId"); + data_type_state.set_authenticated_obfuscated_gaia_id( + kPersistedGaiaId.ToString()); data_type_state.mutable_progress_marker()->set_data_type_id( GetSpecificsFieldNumberFromDataType(GetDataType())); metadata_batch->SetDataTypeState(data_type_state); type_processor()->ModelReadyToSync(std::move(metadata_batch)); - // Even prior to starting sync, the account ID should already be tracked. - EXPECT_EQ("PersistedGaiaId", type_processor()->TrackedAccountId()); + // Even prior to starting sync, the Gaia ID should already be tracked. + EXPECT_EQ(kPersistedGaiaId, type_processor()->TrackedGaiaId()); // If sync gets started, the account should still be tracked. - OnSyncStarting(GaiaId("PersistedGaiaId")); - EXPECT_EQ("PersistedGaiaId", type_processor()->TrackedAccountId()); + OnSyncStarting(kPersistedGaiaId); + EXPECT_EQ(kPersistedGaiaId, type_processor()->TrackedGaiaId()); } TEST_F(CommitOnlyClientTagBasedDataTypeProcessorTest, ShouldCallMergeWhenSyncEnabled) { ModelReadyToSync(); - ASSERT_EQ("", type_processor()->TrackedAccountId()); + ASSERT_TRUE(type_processor()->TrackedGaiaId().empty()); ASSERT_EQ(0, bridge()->merge_call_count()); OnSyncStarting(); EXPECT_EQ(1, bridge()->merge_call_count()); @@ -2737,22 +2738,25 @@ TEST_F(CommitOnlyClientTagBasedDataTypeProcessorTest, ShouldNotCallMergeAfterRestart) { + const GaiaId kPersistedGaiaId("PersistedGaiaId"); + std::unique_ptr<MetadataBatch> metadata_batch = db()->CreateMetadataBatch(); sync_pb::DataTypeState data_type_state(metadata_batch->GetDataTypeState()); data_type_state.set_initial_sync_state( sync_pb::DataTypeState_InitialSyncState_INITIAL_SYNC_DONE); data_type_state.set_cache_guid(kCacheGuid); - data_type_state.set_authenticated_obfuscated_gaia_id("PersistedGaiaId"); + data_type_state.set_authenticated_obfuscated_gaia_id( + kPersistedGaiaId.ToString()); data_type_state.mutable_progress_marker()->set_data_type_id( GetSpecificsFieldNumberFromDataType(GetDataType())); metadata_batch->SetDataTypeState(data_type_state); type_processor()->ModelReadyToSync(std::move(metadata_batch)); // Even prior to starting sync, the account ID should already be tracked. - ASSERT_EQ("PersistedGaiaId", type_processor()->TrackedAccountId()); + ASSERT_EQ(kPersistedGaiaId, type_processor()->TrackedGaiaId()); // When sync gets started, MergeFullSyncData() should not be called. - OnSyncStarting(GaiaId("PersistedGaiaId")); + OnSyncStarting(kPersistedGaiaId); ASSERT_EQ(0, bridge()->merge_call_count()); }
diff --git a/components/sync/model/data_type_local_change_processor.h b/components/sync/model/data_type_local_change_processor.h index ff10476..5a1566c 100644 --- a/components/sync/model/data_type_local_change_processor.h +++ b/components/sync/model/data_type_local_change_processor.h
@@ -15,6 +15,7 @@ #include "components/sync/base/data_type.h" #include "components/sync/model/data_type_controller_delegate.h" #include "components/sync/model/model_error.h" +#include "google_apis/gaia/gaia_id.h" namespace sync_pb { class EntitySpecifics; @@ -114,10 +115,9 @@ // then Put() and Delete() will no-op and can be omitted by bridge. virtual bool IsTrackingMetadata() const = 0; - // Returns the account ID for which metadata is being tracked, or empty if not + // Returns the Gaia ID for which metadata is being tracked, or empty if not // tracking metadata. - // TODO(crbug.com/383089506): use GaiaId instead of std::string. - virtual std::string TrackedAccountId() const = 0; + virtual GaiaId TrackedGaiaId() const = 0; // Returns the cache guid for which metadata is being tracked, or empty if not // tracking metadata.
diff --git a/components/sync/test/forwarding_data_type_local_change_processor.cc b/components/sync/test/forwarding_data_type_local_change_processor.cc index a1d2ff2..0bfca92 100644 --- a/components/sync/test/forwarding_data_type_local_change_processor.cc +++ b/components/sync/test/forwarding_data_type_local_change_processor.cc
@@ -84,8 +84,8 @@ return other_->IsTrackingMetadata(); } -std::string ForwardingDataTypeLocalChangeProcessor::TrackedAccountId() const { - return other_->TrackedAccountId(); +GaiaId ForwardingDataTypeLocalChangeProcessor::TrackedGaiaId() const { + return other_->TrackedGaiaId(); } std::string ForwardingDataTypeLocalChangeProcessor::TrackedCacheGuid() const {
diff --git a/components/sync/test/forwarding_data_type_local_change_processor.h b/components/sync/test/forwarding_data_type_local_change_processor.h index 198b446a..e682215e 100644 --- a/components/sync/test/forwarding_data_type_local_change_processor.h +++ b/components/sync/test/forwarding_data_type_local_change_processor.h
@@ -46,7 +46,7 @@ void OnModelStarting(DataTypeSyncBridge* bridge) override; void ModelReadyToSync(std::unique_ptr<MetadataBatch> batch) override; bool IsTrackingMetadata() const override; - std::string TrackedAccountId() const override; + GaiaId TrackedGaiaId() const override; std::string TrackedCacheGuid() const override; void ReportError(const ModelError& error) override; std::optional<ModelError> GetError() const override;
diff --git a/components/sync/test/mock_data_type_local_change_processor.cc b/components/sync/test/mock_data_type_local_change_processor.cc index d9bde55..432027e3 100644 --- a/components/sync/test/mock_data_type_local_change_processor.cc +++ b/components/sync/test/mock_data_type_local_change_processor.cc
@@ -71,9 +71,9 @@ ON_CALL(*this, IsTrackingMetadata()) .WillByDefault( Invoke(delegate, &DataTypeLocalChangeProcessor::IsTrackingMetadata)); - ON_CALL(*this, TrackedAccountId()) + ON_CALL(*this, TrackedGaiaId()) .WillByDefault( - Invoke(delegate, &DataTypeLocalChangeProcessor::TrackedAccountId)); + Invoke(delegate, &DataTypeLocalChangeProcessor::TrackedGaiaId)); ON_CALL(*this, TrackedCacheGuid()) .WillByDefault( Invoke(delegate, &DataTypeLocalChangeProcessor::TrackedCacheGuid));
diff --git a/components/sync/test/mock_data_type_local_change_processor.h b/components/sync/test/mock_data_type_local_change_processor.h index f868d37..ace557d 100644 --- a/components/sync/test/mock_data_type_local_change_processor.h +++ b/components/sync/test/mock_data_type_local_change_processor.h
@@ -13,6 +13,7 @@ #include "components/sync/model/data_type_local_change_processor.h" #include "components/sync/model/data_type_sync_bridge.h" #include "components/sync/model/metadata_batch.h" +#include "google_apis/gaia/gaia_id.h" #include "testing/gmock/include/gmock/gmock.h" namespace syncer { @@ -76,7 +77,7 @@ (std::unique_ptr<MetadataBatch> batch), (override)); MOCK_METHOD(bool, IsTrackingMetadata, (), (const override)); - MOCK_METHOD(std::string, TrackedAccountId, (), (const override)); + MOCK_METHOD(GaiaId, TrackedGaiaId, (), (const override)); MOCK_METHOD(std::string, TrackedCacheGuid, (), (const override)); MOCK_METHOD(void, ReportError, (const ModelError& error), (override)); MOCK_METHOD(std::optional<ModelError>, GetError, (), (const override));
diff --git a/components/sync_user_events/DEPS b/components/sync_user_events/DEPS index 26ec8abc..7b689f8 100644 --- a/components/sync_user_events/DEPS +++ b/components/sync_user_events/DEPS
@@ -5,4 +5,5 @@ "+components/sync/model", "+components/sync/protocol", "+components/sync/test", + "+google_apis/gaia", ]
diff --git a/components/sync_user_events/user_event_service_impl_unittest.cc b/components/sync_user_events/user_event_service_impl_unittest.cc index 8844dd2..b87fbf0 100644 --- a/components/sync_user_events/user_event_service_impl_unittest.cc +++ b/components/sync_user_events/user_event_service_impl_unittest.cc
@@ -15,6 +15,7 @@ #include "components/sync/test/mock_data_type_local_change_processor.h" #include "components/sync/test/test_sync_service.h" #include "components/sync_user_events/user_event_sync_bridge.h" +#include "google_apis/gaia/gaia_id.h" #include "testing/gtest/include/gtest/gtest.h" using sync_pb::UserEventSpecifics; @@ -65,8 +66,8 @@ /*types=*/{syncer::UserSelectableType::kHistory}); ON_CALL(mock_processor_, IsTrackingMetadata()) .WillByDefault(testing::Return(true)); - ON_CALL(mock_processor_, TrackedAccountId()) - .WillByDefault(testing::Return("account_id")); + ON_CALL(mock_processor_, TrackedGaiaId()) + .WillByDefault(testing::Return(GaiaId("gaia_id"))); } std::unique_ptr<UserEventSyncBridge> MakeBridge() {
diff --git a/components/sync_user_events/user_event_sync_bridge.cc b/components/sync_user_events/user_event_sync_bridge.cc index 5a74dfb..62b3484 100644 --- a/components/sync_user_events/user_event_sync_bridge.cc +++ b/components/sync_user_events/user_event_sync_bridge.cc
@@ -89,7 +89,7 @@ EntityChangeList entity_data) { DCHECK(entity_data.empty()); DCHECK(change_processor()->IsTrackingMetadata()); - DCHECK(!change_processor()->TrackedAccountId().empty()); + DCHECK(!change_processor()->TrackedGaiaId().empty()); return ApplyIncrementalSyncChanges(std::move(metadata_change_list), std::move(entity_data)); }
diff --git a/components/sync_user_events/user_event_sync_bridge_unittest.cc b/components/sync_user_events/user_event_sync_bridge_unittest.cc index 25d7716..0a70394e 100644 --- a/components/sync_user_events/user_event_sync_bridge_unittest.cc +++ b/components/sync_user_events/user_event_sync_bridge_unittest.cc
@@ -17,6 +17,7 @@ #include "components/sync/protocol/user_event_specifics.pb.h" #include "components/sync/test/data_type_store_test_util.h" #include "components/sync/test/mock_data_type_local_change_processor.h" +#include "google_apis/gaia/gaia_id.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -116,7 +117,7 @@ } void WaitUntilModelReadyToSync( - const std::string& account_id = "test_account_id") { + const GaiaId& gaia_id = GaiaId("test_account_id")) { base::RunLoop loop; base::RepeatingClosure quit_closure = loop.QuitClosure(); // Let the bridge initialize fully, which should run ModelReadyToSync(). @@ -124,7 +125,7 @@ .WillByDefault(InvokeWithoutArgs([=]() { quit_closure.Run(); })); loop.Run(); ON_CALL(*processor(), IsTrackingMetadata()).WillByDefault(Return(true)); - ON_CALL(*processor(), TrackedAccountId()).WillByDefault(Return(account_id)); + ON_CALL(*processor(), TrackedGaiaId()).WillByDefault(Return(gaia_id)); } static std::string GetStorageKey(const UserEventSpecifics& specifics) { @@ -345,10 +346,10 @@ TEST_F(UserEventSyncBridgeTest, RecordBeforeMetadataLoads) { ON_CALL(*processor(), IsTrackingMetadata()).WillByDefault(Return(false)); - ON_CALL(*processor(), TrackedAccountId()).WillByDefault(Return("")); + ON_CALL(*processor(), TrackedGaiaId()).WillByDefault(Return(GaiaId())); bridge()->RecordUserEvent(SpecificsUniquePtr(1u, 2u, 3u)); EXPECT_CALL(*processor(), ModelReadyToSync); - WaitUntilModelReadyToSync("account_id"); + WaitUntilModelReadyToSync(GaiaId("gaia_id")); EXPECT_THAT(GetAllDataForDebugging(), IsEmpty()); }
diff --git a/components/test/data/optimization_guide/actionable_elements.html b/components/test/data/optimization_guide/actionable_elements.html new file mode 100644 index 0000000..61e2b2bb --- /dev/null +++ b/components/test/data/optimization_guide/actionable_elements.html
@@ -0,0 +1,3 @@ +<body> + <div style='cursor: pointer;'></div> +</body>
diff --git a/components/test/data/optimization_guide/scroller.html b/components/test/data/optimization_guide/scroller.html new file mode 100644 index 0000000..6128aa2d --- /dev/null +++ b/components/test/data/optimization_guide/scroller.html
@@ -0,0 +1,23 @@ +<head> + <meta name="viewport" content="width=device-width,minimum-scale=1"> +</head> +<body style='margin: 0px;'> + <style> + #scroller { + overflow:scroll; width: 100vw; height:100vh; + position:relative; top: 30px; left:50px; + } + + * { + scrollbar-width: none; + } + </style> + <div id='scroller'> + <div style='width: 200vw; height: 300vh; background: grey;'></div> + </div> + <script> + let scroller = document.getElementById('scroller'); + scroller.scrollTop=100; + scroller.scrollLeft=200; + </script> +</body>
diff --git a/components/vector_icons/BUILD.gn b/components/vector_icons/BUILD.gn index 82685889..c13ad2d 100644 --- a/components/vector_icons/BUILD.gn +++ b/components/vector_icons/BUILD.gn
@@ -199,6 +199,7 @@ "save_cloud.icon", "science.icon", "screen_share.icon", + "screen_share_old.icon", "search.icon", "search_chrome_refresh.icon", "select_window.icon",
diff --git a/components/vector_icons/screen_share.icon b/components/vector_icons/screen_share.icon index 8086aee4..f2a9ef3 100644 --- a/components/vector_icons/screen_share.icon +++ b/components/vector_icons/screen_share.icon
@@ -1,26 +1,45 @@ -// Copyright 2016 The Chromium Authors +// Copyright 2025 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -MOVE_TO, 40, 36, -R_CUBIC_TO, 2.2, 0, 3.98, -1.8, 3.98, -4, -LINE_TO, 44, 12, -R_CUBIC_TO, 0, -2.22, -1.8, -4, -4, -4, -H_LINE_TO, 8, -R_CUBIC_TO, -2.22, 0, -4, 1.78, -4, 4, -R_V_LINE_TO, 20, -R_CUBIC_TO, 0, 2.2, 1.78, 4, 4, 4, -H_LINE_TO, 0, -R_V_LINE_TO, 4, -R_H_LINE_TO, 48, -R_V_LINE_TO, -4, -R_H_LINE_TO, -8, +CANVAS_DIMENSIONS, 16, +FILL_RULE_NONZERO, +MOVE_TO, 5.57, 9.23, +R_H_LINE_TO, 1.27, +V_LINE_TO, 8.2, +R_ARC_TO, 0.75, 0.75, 0, 0, 1, 0.77, -0.77, +H_LINE_TO, 8.77, +V_LINE_TO, 8.87, +R_LINE_TO, 2.07, -2.07, +LINE_TO, 8.77, 4.73, +R_V_LINE_TO, 1.44, +H_LINE_TO, 7.2, +R_CUBIC_TO, -0.45, 0, -0.84, 0.16, -1.16, 0.48, +R_CUBIC_TO, -0.32, 0.32, -0.48, 0.7, -0.48, 1.16, CLOSE, -R_MOVE_TO, -14, -7.06, -R_V_LINE_TO, -4.38, -R_CUBIC_TO, -5.56, 0, -9.22, 1.7, -12, 5.44, -R_CUBIC_TO, 1.12, -5.34, 4.22, -10.66, 12, -11.74, -V_LINE_TO, 14, -R_LINE_TO, 8, 7.46, -R_LINE_TO, -8, 7.48, +R_MOVE_TO, -2.72, 2.5, +R_CUBIC_TO, -0.38, 0, -0.71, -0.13, -0.98, -0.4, +R_ARC_TO, 1.34, 1.34, 0, 0, 1, -0.4, -0.98, +V_LINE_TO, 3.65, +R_CUBIC_TO, 0, -0.38, 0.13, -0.71, 0.4, -0.98, +R_CUBIC_TO, 0.27, -0.27, 0.6, -0.4, 0.98, -0.4, +R_H_LINE_TO, 10.31, +R_CUBIC_TO, 0.38, 0, 0.71, 0.13, 0.98, 0.4, +R_CUBIC_TO, 0.27, 0.27, 0.4, 0.6, 0.4, 0.98, +R_V_LINE_TO, 6.7, +R_CUBIC_TO, 0, 0.38, -0.13, 0.71, -0.4, 0.98, +R_CUBIC_TO, -0.27, 0.27, -0.6, 0.4, -0.98, 0.4, +CLOSE, +R_MOVE_TO, 0, -1.38, +R_H_LINE_TO, 10.3, +V_LINE_TO, 3.65, +H_LINE_TO, 2.85, +CLOSE, +R_MOVE_TO, 0, 0, +V_LINE_TO, 3.65, +CLOSE, +MOVE_TO, 0.68, 13.8, +R_V_LINE_TO, -1.26, +R_H_LINE_TO, 14.65, +R_V_LINE_TO, 1.26, CLOSE
diff --git a/components/vector_icons/screen_share_old.icon b/components/vector_icons/screen_share_old.icon new file mode 100644 index 0000000..e771017 --- /dev/null +++ b/components/vector_icons/screen_share_old.icon
@@ -0,0 +1,26 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +MOVE_TO, 40, 36, +R_CUBIC_TO, 2.2, 0, 3.98, -1.8, 3.98, -4, +LINE_TO, 44, 12, +R_CUBIC_TO, 0, -2.22, -1.8, -4, -4, -4, +H_LINE_TO, 8, +R_CUBIC_TO, -2.22, 0, -4, 1.78, -4, 4, +R_V_LINE_TO, 20, +R_CUBIC_TO, 0, 2.2, 1.78, 4, 4, 4, +H_LINE_TO, 0, +R_V_LINE_TO, 4, +R_H_LINE_TO, 48, +R_V_LINE_TO, -4, +R_H_LINE_TO, -8, +CLOSE, +R_MOVE_TO, -14, -7.06, +R_V_LINE_TO, -4.38, +R_CUBIC_TO, -5.56, 0, -9.22, 1.7, -12, 5.44, +R_CUBIC_TO, 1.12, -5.34, 4.22, -10.66, 12, -11.74, +V_LINE_TO, 14, +R_LINE_TO, 8, 7.46, +R_LINE_TO, -8, 7.48, +CLOSE
diff --git a/components/viz/common/features.cc b/components/viz/common/features.cc index 20613c2..468c92c 100644 --- a/components/viz/common/features.cc +++ b/components/viz/common/features.cc
@@ -253,6 +253,15 @@ BASE_FEATURE(kVSyncAlignedPresent, "VSyncAlignedPresent", base::FEATURE_DISABLED_BY_DEFAULT); + +// Present the frame at next VSync only if this frame handles interaction or +// animation as described in kTargetForVSync. Three finch experiment groups for +// kVSyncAlignedPresent. +constexpr const char kTargetForVSyncAllFrames[] = "AllFrames"; +constexpr const char kTargetForVSyncAnimation[] = "Animation"; +constexpr const char kTargetForVSyncInteraction[] = "Interaction"; +const base::FeatureParam<std::string> kTargetForVSync{ + &kVSyncAlignedPresent, "Target", kTargetForVSyncAllFrames}; #endif BASE_FEATURE(kAllowUndamagedNonrootRenderPassToSkip,
diff --git a/components/viz/common/features.h b/components/viz/common/features.h index 6ef1b275..c59a1e1 100644 --- a/components/viz/common/features.h +++ b/components/viz/common/features.h
@@ -92,6 +92,10 @@ #if BUILDFLAG(IS_MAC) VIZ_COMMON_EXPORT BASE_DECLARE_FEATURE(kVSyncAlignedPresent); +VIZ_COMMON_EXPORT extern const base::FeatureParam<std::string> kTargetForVSync; +VIZ_COMMON_EXPORT extern const char kTargetForVSyncAllFrames[]; +VIZ_COMMON_EXPORT extern const char kTargetForVSyncAnimation[]; +VIZ_COMMON_EXPORT extern const char kTargetForVSyncInteraction[]; #endif VIZ_COMMON_EXPORT BASE_DECLARE_FEATURE(kAllowUndamagedNonrootRenderPassToSkip);
diff --git a/components/viz/service/display/display.cc b/components/viz/service/display/display.cc index 5383e497..2e95e6a 100644 --- a/components/viz/service/display/display.cc +++ b/components/viz/service/display/display.cc
@@ -89,6 +89,7 @@ #if BUILDFLAG(IS_ANDROID) #include "ui/gfx/android/android_surface_control_compat.h" #endif + namespace viz { namespace { @@ -1447,7 +1448,9 @@ void Display::SetPreferredFrameInterval(base::TimeDelta interval) { #if BUILDFLAG(IS_ANDROID) if (OutputSurfaceSupportsSetFrameRate()) { - SetFrameIntervalOnOutputSurface(interval); + float interval_s = interval.InSecondsF(); + float frame_rate = interval_s == 0 ? 0 : (1 / interval_s); + SetFrameIntervalOnOutputSurface({.frame_rate = frame_rate}); return; } #endif @@ -1481,10 +1484,9 @@ gfx::SurfaceControl::SupportsSetFrameRate(); } -void Display::SetFrameIntervalOnOutputSurface(base::TimeDelta interval) { - float interval_s = interval.InSecondsF(); - float frame_rate = interval_s == 0 ? 0 : (1 / interval_s); - output_surface_->SetFrameRate({.frame_rate = frame_rate}); +void Display::SetFrameIntervalOnOutputSurface( + gfx::SurfaceControlFrameRate frame_rate) { + output_surface_->SetFrameRate(frame_rate); } base::ScopedClosureRunner Display::GetCacheBackBufferCb() {
diff --git a/components/viz/service/display/display.h b/components/viz/service/display/display.h index 15bfae48..84cf0df2 100644 --- a/components/viz/service/display/display.h +++ b/components/viz/service/display/display.h
@@ -41,6 +41,10 @@ #include "ui/gfx/swap_result.h" #include "ui/latency/latency_info.h" +#if BUILDFLAG(IS_ANDROID) +#include "ui/gfx/android/surface_control_frame_rate.h" +#endif + namespace gfx { class Size; } @@ -204,7 +208,7 @@ #if BUILDFLAG(IS_ANDROID) bool OutputSurfaceSupportsSetFrameRate(); - void SetFrameIntervalOnOutputSurface(base::TimeDelta interval); + void SetFrameIntervalOnOutputSurface(gfx::SurfaceControlFrameRate frame_rate); #endif void PreserveChildSurfaceControls();
diff --git a/components/viz/service/display/frame_interval_decider.cc b/components/viz/service/display/frame_interval_decider.cc index b8763890..f47e3ee0 100644 --- a/components/viz/service/display/frame_interval_decider.cc +++ b/components/viz/service/display/frame_interval_decider.cc
@@ -94,10 +94,10 @@ base::UmaHistogramEnumeration("Viz.FrameIntervalDecider.ResultMatcherType", matcher_type); if (match_result && - std::holds_alternative<base::TimeDelta>(match_result.value())) { + std::holds_alternative<ResultInterval>(match_result.value())) { base::UmaHistogramCustomTimes( "Viz.FrameIntervalDecider.ResultTimeDelta", - std::get<base::TimeDelta>(match_result.value()), + std::get<ResultInterval>(match_result.value()).interval, base::Milliseconds(0), base::Milliseconds(500), 50); } } @@ -110,11 +110,11 @@ return FrameIntervalClass::kDefault; }, [](const FixedIntervalSettings& fixed_interval_settings) -> Result { - return fixed_interval_settings.default_interval; + return ResultInterval{fixed_interval_settings.default_interval}; }, [](const ContinuousRangeSettings& continuous_range_settings) -> Result { - return continuous_range_settings.default_interval; + return ResultInterval{continuous_range_settings.default_interval}; }), settings_.interval_settings); } @@ -127,11 +127,12 @@ // Same as above but using epsilon comparison for frame interval. if (current_result_ && match_result && - std::holds_alternative<base::TimeDelta>(current_result_.value()) && - std::holds_alternative<base::TimeDelta>(match_result.value()) && + std::holds_alternative<ResultInterval>(current_result_.value()) && + std::holds_alternative<ResultInterval>(match_result.value()) && FrameIntervalMatcher::AreAlmostEqual( - std::get<base::TimeDelta>(current_result_.value()), - std::get<base::TimeDelta>(match_result.value()), settings_.epsilon)) { + std::get<ResultInterval>(current_result_.value()).interval, + std::get<ResultInterval>(match_result.value()).interval, + settings_.epsilon)) { current_result_frame_time_ = frame_time; return; } @@ -173,12 +174,12 @@ return static_cast<int>(from_frame_interval_class) > static_cast<int>(to_frame_interval_class); }, - [&](base::TimeDelta from_interval) { - if (!std::holds_alternative<base::TimeDelta>(to.value())) { + [&](ResultInterval from_interval) { + if (!std::holds_alternative<ResultInterval>(to.value())) { return true; } - base::TimeDelta to_interval = std::get<base::TimeDelta>(to.value()); - return from_interval > to_interval; + ResultInterval to_interval = std::get<ResultInterval>(to.value()); + return from_interval.interval > to_interval.interval; }), from.value()); }
diff --git a/components/viz/service/display/frame_interval_decider.h b/components/viz/service/display/frame_interval_decider.h index 53727a55..df46059 100644 --- a/components/viz/service/display/frame_interval_decider.h +++ b/components/viz/service/display/frame_interval_decider.h
@@ -28,6 +28,7 @@ class VIZ_SERVICE_EXPORT FrameIntervalDecider { public: using FrameIntervalClass = FrameIntervalMatcher::FrameIntervalClass; + using ResultInterval = FrameIntervalMatcher::ResultInterval; using Result = FrameIntervalMatcher::Result; using ResultCallback = FrameIntervalMatcher::ResultCallback; using FixedIntervalSettings = FrameIntervalMatcher::FixedIntervalSettings;
diff --git a/components/viz/service/display/frame_interval_decider_unittest.cc b/components/viz/service/display/frame_interval_decider_unittest.cc index 0ff2969..eeebd66 100644 --- a/components/viz/service/display/frame_interval_decider_unittest.cc +++ b/components/viz/service/display/frame_interval_decider_unittest.cc
@@ -26,6 +26,7 @@ using ContinuousRangeSettings = FrameIntervalDecider::ContinuousRangeSettings; using FixedIntervalSettings = FrameIntervalDecider::FixedIntervalSettings; using FrameIntervalClass = FrameIntervalDecider::FrameIntervalClass; +using ResultInterval = FrameIntervalMatcher::ResultInterval; using Result = FrameIntervalDecider::Result; constexpr base::TimeTicks kNow = base::TimeTicks() + base::Seconds(1234); @@ -36,8 +37,8 @@ } void ExpectResult(Result result, base::TimeDelta interval) { - ASSERT_TRUE(std::holds_alternative<base::TimeDelta>(result)); - EXPECT_EQ(interval, std::get<base::TimeDelta>(result)); + ASSERT_TRUE(std::holds_alternative<ResultInterval>(result)); + EXPECT_EQ(interval, std::get<ResultInterval>(result).interval); } class TestFrameIntervalMatcher : public FrameIntervalMatcher { @@ -284,7 +285,7 @@ TEST_F(FrameIntervalDeciderTest, FirstMatch) { InitializeDecider(); - matchers_[1]->SetResult(base::Milliseconds(32)); + matchers_[1]->SetResult(ResultInterval(base::Milliseconds(32))); FrameIntervalInputs inputs; inputs.frame_time = kNow; @@ -299,7 +300,7 @@ TEST_F(FrameIntervalDeciderTest, NoChange) { InitializeDecider(); - matchers_[0]->SetResult(base::Milliseconds(32)); + matchers_[0]->SetResult(ResultInterval(base::Milliseconds(32))); FrameIntervalInputs inputs; inputs.frame_time = kNow; @@ -323,7 +324,7 @@ InitializeDecider(); base::TimeTicks now = kNow; - matchers_[0]->SetResult(base::Milliseconds(32)); + matchers_[0]->SetResult(ResultInterval(base::Milliseconds(32))); FrameIntervalInputs inputs; inputs.frame_time = now; @@ -333,13 +334,13 @@ EXPECT_EQ(FrameIntervalMatcherType::kInputBoost, TakeLastMatcherType()); now = kNow + base::Milliseconds(16); - matchers_[0]->SetResult(base::Milliseconds(16)); + matchers_[0]->SetResult(ResultInterval(base::Milliseconds(16))); DrawSurfaces({surface}, now); ExpectResult(TakeLastResult(), base::Milliseconds(16)); EXPECT_EQ(FrameIntervalMatcherType::kInputBoost, TakeLastMatcherType()); now = kNow + base::Milliseconds(32); - matchers_[0]->SetResult(base::Milliseconds(32)); + matchers_[0]->SetResult(ResultInterval(base::Milliseconds(32))); DrawSurfaces({surface}, now); EXPECT_FALSE(has_result()); EXPECT_FALSE(has_matcher_type()); @@ -397,7 +398,7 @@ EXPECT_EQ(FrameIntervalMatcherType::kInputBoost, TakeLastMatcherType()); now = kNow + base::Milliseconds(16); - matchers_[0]->SetResult(base::Milliseconds(16)); + matchers_[0]->SetResult(ResultInterval(base::Milliseconds(16))); DrawSurfaces({surface}, now); ExpectResult(TakeLastResult(), base::Milliseconds(16)); EXPECT_EQ(FrameIntervalMatcherType::kInputBoost, TakeLastMatcherType()); @@ -409,7 +410,7 @@ EXPECT_EQ(FrameIntervalMatcherType::kInputBoost, TakeLastMatcherType()); now = kNow + base::Milliseconds(48); - matchers_[0]->SetResult(base::Milliseconds(32)); + matchers_[0]->SetResult(ResultInterval(base::Milliseconds(32))); DrawSurfaces({surface}, now); ExpectResult(TakeLastResult(), base::Milliseconds(32)); EXPECT_EQ(FrameIntervalMatcherType::kInputBoost, TakeLastMatcherType());
diff --git a/components/viz/service/display/frame_interval_matchers.cc b/components/viz/service/display/frame_interval_matchers.cc index 094ea13..ddbb7e5 100644 --- a/components/viz/service/display/frame_interval_matchers.cc +++ b/components/viz/service/display/frame_interval_matchers.cc
@@ -55,7 +55,7 @@ return std::nullopt; } - return std::visit( + base::TimeDelta interval = std::visit( base::Overloaded( [&](const std::monostate& monostate) { // If no intervals settings are given, then just return the content @@ -119,10 +119,13 @@ return content_interval.value(); }), matcher_inputs.settings->interval_settings); + return FrameIntervalMatcher::ResultInterval{interval}; } } // namespace +bool FrameIntervalMatcher::ResultInterval::operator==( + const ResultInterval& other) const = default; FrameIntervalMatcher::FixedIntervalSettings::FixedIntervalSettings() = default; FrameIntervalMatcher::FixedIntervalSettings::FixedIntervalSettings( const FixedIntervalSettings&) = default; @@ -197,9 +200,10 @@ return "kDefault"; } }, - [](base::TimeDelta interval) { - return base::StringPrintf("%" PRId64 "us", - interval.InMicroseconds()); + [](ResultInterval interval) { + return base::StringPrintf("%" PRId64 "us type:%d", + interval.interval.InMicroseconds(), + static_cast<int>(interval.type)); }), result); } @@ -257,10 +261,15 @@ }, [](const FixedIntervalSettings& fixed_interval_settings) -> Result { - return *fixed_interval_settings.supported_intervals.begin(); + return ResultInterval{ + *fixed_interval_settings.supported_intervals.begin(), + ResultIntervalType::kAtLeast}; }, [](const ContinuousRangeSettings& continuous_range_settings) - -> Result { return continuous_range_settings.min_interval; }), + -> Result { + return ResultInterval{continuous_range_settings.min_interval, + ResultIntervalType::kAtLeast}; + }), matcher_inputs.settings->interval_settings); } } @@ -314,7 +323,7 @@ return std::nullopt; } - return std::visit( + base::TimeDelta interval = std::visit( base::Overloaded( [&](const std::monostate& monostate) { return min_interval.value(); }, [&](const FixedIntervalSettings& fixed_interval_settings) { @@ -341,6 +350,7 @@ continuous_range_settings.max_interval); }), matcher_inputs.settings->interval_settings); + return ResultInterval{interval}; } DefineSimpleMatcherConstructorDestructor(OnlyAnimatingImageMatcher,
diff --git a/components/viz/service/display/frame_interval_matchers.h b/components/viz/service/display/frame_interval_matchers.h index c7cb745b..0f84a6d5 100644 --- a/components/viz/service/display/frame_interval_matchers.h +++ b/components/viz/service/display/frame_interval_matchers.h
@@ -50,7 +50,16 @@ // scrolling. kDefault, // Used if nothing matched. }; - using Result = std::variant<FrameIntervalClass, base::TimeDelta>; + enum class ResultIntervalType { + kExact, + kAtLeast, + }; + struct ResultInterval { + base::TimeDelta interval; + ResultIntervalType type = ResultIntervalType::kExact; + bool operator==(const ResultInterval& other) const; + }; + using Result = std::variant<FrameIntervalClass, ResultInterval>; using ResultCallback = base::RepeatingCallback<void(Result, FrameIntervalMatcherType)>;
diff --git a/components/viz/service/display/frame_interval_matchers_unittest.cc b/components/viz/service/display/frame_interval_matchers_unittest.cc index 21067247..e7c5e80f 100644 --- a/components/viz/service/display/frame_interval_matchers_unittest.cc +++ b/components/viz/service/display/frame_interval_matchers_unittest.cc
@@ -15,6 +15,7 @@ namespace { using FrameIntervalClass = FrameIntervalMatcher::FrameIntervalClass; +using ResultInterval = FrameIntervalMatcher::ResultInterval; using Result = FrameIntervalMatcher::Result; using FixedIntervalSettings = FrameIntervalMatcher::FixedIntervalSettings; using ContinuousRangeSettings = FrameIntervalMatcher::ContinuousRangeSettings; @@ -35,8 +36,8 @@ base::TimeDelta interval) { ASSERT_TRUE(result_opt.has_value()); const Result& result = result_opt.value(); - ASSERT_TRUE(std::holds_alternative<base::TimeDelta>(result)); - EXPECT_EQ(interval, std::get<base::TimeDelta>(result)); + ASSERT_TRUE(std::holds_alternative<ResultInterval>(result)); + EXPECT_EQ(interval, std::get<ResultInterval>(result).interval); } void ExpectNullResult(const std::optional<Result> result_opt) {
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc index 7898d49..b16eec7 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -54,6 +54,21 @@ namespace viz { +namespace { +#if BUILDFLAG(IS_ANDROID) +gfx::SurfaceControlFrameRateCompatibility IntervalTypeToCompat( + FrameIntervalMatcher::ResultIntervalType interval_type) { + switch (interval_type) { + case FrameIntervalMatcher::ResultIntervalType::kExact: + return gfx::SurfaceControlFrameRateCompatibility::kFixedSource; + case FrameIntervalMatcher::ResultIntervalType::kAtLeast: + return gfx::SurfaceControlFrameRateCompatibility::kAtLeast; + } + NOTREACHED(); +} +#endif +} // namespace + class RootCompositorFrameSinkImpl::StandaloneBeginFrameObserver : public BeginFrameObserverBase { public: @@ -724,22 +739,38 @@ FrameIntervalDecider::Result result, FrameIntervalMatcherType matcher_type) { #if BUILDFLAG(IS_ANDROID) - base::TimeDelta interval = std::visit( - base::Overloaded( - [](FrameIntervalDecider::FrameIntervalClass frame_interval_class) { - switch (frame_interval_class) { - case FrameIntervalDecider::FrameIntervalClass::kBoost: - // Currently there is no Android API to get the highest - // available frame rate. So only option for now is to use system - // its heuristics which hopefully should boost in this case. - return base::Milliseconds(0); - case FrameIntervalDecider::FrameIntervalClass::kDefault: - // 0 is a special value on Android for no preference. - return base::Milliseconds(0); - } - }, - [](base::TimeDelta interval) { return interval; }), - result); + base::TimeDelta interval; + std::pair<base::TimeDelta, gfx::SurfaceControlFrameRateCompatibility> + interval_and_compat = std::visit( + base::Overloaded( + [](FrameIntervalDecider::FrameIntervalClass + frame_interval_class) { + switch (frame_interval_class) { + case FrameIntervalDecider::FrameIntervalClass::kBoost: + return std::pair(base::Milliseconds(0), + gfx::SurfaceControlFrameRateCompatibility:: + kFixedSource); + case FrameIntervalDecider::FrameIntervalClass::kDefault: + // 0 is a special value on Android for no preference. + return std::pair(base::Milliseconds(0), + gfx::SurfaceControlFrameRateCompatibility:: + kFixedSource); + } + }, + [](FrameIntervalDecider::ResultInterval interval) { + return std::pair(interval.interval, + IntervalTypeToCompat(interval.type)); + }), + result); + interval = interval_and_compat.first; + gfx::SurfaceControlFrameRateCompatibility compat = interval_and_compat.second; + + if (decided_display_interval_ == interval && + decided_display_frame_rate_compat_ == compat) { + return; + } + decided_display_interval_ = interval; + decided_display_frame_rate_compat_ = compat; #else base::TimeDelta interval = std::visit( base::Overloaded( @@ -751,18 +782,23 @@ return FrameRateDecider::UnspecifiedFrameInterval(); } }, - [](base::TimeDelta interval) { return interval; }), + [](FrameIntervalDecider::ResultInterval interval) { + return interval.interval; + }), result); -#endif if (decided_display_interval_ == interval) { return; } decided_display_interval_ = interval; +#endif #if BUILDFLAG(IS_ANDROID) if (display_->OutputSurfaceSupportsSetFrameRate()) { - display_->SetFrameIntervalOnOutputSurface(interval); + float interval_s = interval.InSecondsF(); + float frame_rate = interval_s == 0 ? 0 : (1 / interval_s); + display_->SetFrameIntervalOnOutputSurface( + {.frame_rate = frame_rate, .compatibility = compat}); return; } #endif
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h index ea318531..f44ffbd 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h
@@ -33,6 +33,10 @@ #include "ui/base/ozone_buildflags.h" #include "ui/gfx/ca_layer_params.h" +#if BUILDFLAG(IS_ANDROID) +#include "ui/gfx/android/surface_control_frame_rate.h" +#endif + namespace viz { class Display; @@ -206,6 +210,10 @@ bool interval_decider_use_fixed_intervals_ = true; // The current display frame interval that FrameIntervalDecider decided on. base::TimeDelta decided_display_interval_; +#if BUILDFLAG(IS_ANDROID) + gfx::SurfaceControlFrameRateCompatibility decided_display_frame_rate_compat_ = + gfx::SurfaceControlFrameRateCompatibility::kFixedSource; +#endif // RootCompositorFrameSinkImpl holds a Display and a BeginFrameSource if it // was created with a non-null gpu::SurfaceHandle. The source can either be a
diff --git a/components/viz/service/layers/layer_context_impl.cc b/components/viz/service/layers/layer_context_impl.cc index e858b10..858202c 100644 --- a/components/viz/service/layers/layer_context_impl.cc +++ b/components/viz/service/layers/layer_context_impl.cc
@@ -55,7 +55,7 @@ return settings; } -std::unique_ptr<cc::LayerImpl> CreateLayer(LayerContextImpl& context, +std::unique_ptr<cc::LayerImpl> CreateLayer(cc::LayerTreeHostImpl& host_impl, cc::LayerTreeImpl& tree, cc::mojom::LayerType type, int id) { @@ -67,7 +67,7 @@ return cc::MirrorLayerImpl::Create(&tree, id); case cc::mojom::LayerType::kPicture: - return std::make_unique<cc::TileDisplayLayerImpl>(context, tree, id); + return std::make_unique<cc::TileDisplayLayerImpl>(tree, id); case cc::mojom::LayerType::kSurface: // The callback is triggered in the renderer side during WillDraw(), @@ -491,7 +491,7 @@ } base::expected<void, std::string> CreateOrUpdateLayers( - LayerContextImpl& context, + cc::LayerTreeHostImpl& host_impl, const std::vector<mojom::LayerPtr>& updates, std::optional<std::vector<int32_t>>& layer_order, cc::LayerTreeImpl& layers) { @@ -517,7 +517,7 @@ for (auto& wire : updates) { auto& layer = layer_map[wire->id]; if (!layer) { - layer = CreateLayer(context, layers, wire->type, wire->id); + layer = CreateLayer(host_impl, layers, wire->type, wire->id); } RETURN_IF_ERROR(UpdateLayer(*wire, *layer)); } @@ -1115,6 +1115,10 @@ return 0; } +void LayerContextImpl::ReturnResource(ReturnedResource returned_resource) { + resources_to_return_.emplace_back(std::move(returned_resource)); +} + void LayerContextImpl::DidObserveFirstScrollDelay( int source_frame_number, base::TimeDelta first_scroll_delay, @@ -1163,27 +1167,6 @@ compositor_sink_->DidNotProduceFrame(ack); } -void LayerContextImpl::ImportResource(TransferableResource resource) { - auto release_callback = base::BindOnce( - [](LayerContextImpl* impl, ResourceId id, - const gpu::SyncToken& sync_token, bool is_lost) { - impl->resources_to_return_.emplace_back( - id, sync_token, - /*release_fence=*/gfx::GpuFenceHandle(), - /*count=*/1, is_lost); - }, - base::Unretained(this), resource.id); - - host_impl_->resource_provider()->ImportResource( - resource, /*impl_release_callback=*/std::move(release_callback), - /*main_thread_release_callback=*/base::NullCallback(), - /*evicted_callback=*/base::NullCallback()); -} - -void LayerContextImpl::DiscardResource(ResourceId resource) { - host_impl_->resource_provider()->RemoveImportedResource(resource); -} - void LayerContextImpl::SetVisible(bool visible) { host_impl_->SetVisible(visible); } @@ -1265,8 +1248,8 @@ *(update->view_transition_requests)); } - RETURN_IF_ERROR( - CreateOrUpdateLayers(*this, update->layers, update->layer_order, layers)); + RETURN_IF_ERROR(CreateOrUpdateLayers( + *(this->host_impl_.get()), update->layers, update->layer_order, layers)); if (update->local_surface_id_from_parent) { layers.SetLocalSurfaceIdFromParent(*update->local_surface_id_from_parent);
diff --git a/components/viz/service/layers/layer_context_impl.h b/components/viz/service/layers/layer_context_impl.h index 0c2b2d3..486ccae 100644 --- a/components/viz/service/layers/layer_context_impl.h +++ b/components/viz/service/layers/layer_context_impl.h
@@ -36,7 +36,6 @@ // provides the service backend for a client-side VizLayerContext. class LayerContextImpl : public cc::LayerTreeHostImplClient, public cc::LayerTreeFrameSink, - public cc::TileDisplayLayerImpl::Client, public mojom::LayerContext { public: // Constructs a new LayerContextImpl which submits frames to the local @@ -99,6 +98,7 @@ void ClearHistory() override; void SetHasActiveThreadedScroll(bool is_scrolling) override; void SetWaitingForScrollEvent(bool waiting_for_scroll_event) override; + void ReturnResource(ReturnedResource returned_resource) override; size_t CommitDurationSampleCountForTesting() const override; void DidObserveFirstScrollDelay( int source_frame_number, @@ -114,10 +114,6 @@ void DidNotProduceFrame(const BeginFrameAck& ack, cc::FrameSkippedReason reason) override; - // cc::TileDisplayLayerImpl::Client: - void ImportResource(TransferableResource resource) override; - void DiscardResource(ResourceId resource) override; - // mojom::LayerContext: void SetVisible(bool visible) override; void UpdateDisplayTree(mojom::LayerTreeUpdatePtr update) override; @@ -134,11 +130,11 @@ mojo::AssociatedRemote<mojom::LayerContextClient> client_; const std::unique_ptr<cc::TaskRunnerProvider> task_runner_provider_; const std::unique_ptr<cc::RenderingStatsInstrumentation> rendering_stats_; - const std::unique_ptr<cc::LayerTreeHostImpl> host_impl_; std::vector<ReturnedResource> resources_to_return_; raw_ptr<cc::LayerTreeFrameSinkClient> frame_sink_client_ = nullptr; + const std::unique_ptr<cc::LayerTreeHostImpl> host_impl_; }; } // namespace viz
diff --git a/components/webauthn/android/BUILD.gn b/components/webauthn/android/BUILD.gn index 67b78a5..b3047ea 100644 --- a/components/webauthn/android/BUILD.gn +++ b/components/webauthn/android/BUILD.gn
@@ -218,6 +218,7 @@ "//base:base_junit_test_support", "//components/payments/content/android:junit_test_support", "//content/public/android:content_java", + "//mojo/public/mojom/base:base_java", "//net/android:net_java", "//services/device/public/java:device_feature_list_java", "//third_party/androidx:androidx_test_core_java",
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java index e67db6a..85e4c39 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/AuthenticatorImpl.java
@@ -20,6 +20,7 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.blink.mojom.Authenticator; import org.chromium.blink.mojom.AuthenticatorStatus; +import org.chromium.blink.mojom.CredentialInfo; import org.chromium.blink.mojom.GetAssertionAuthenticatorResponse; import org.chromium.blink.mojom.GetAssertionResponse; import org.chromium.blink.mojom.GetCredentialResponse; @@ -204,11 +205,6 @@ getCredentialResponseForAssertion(AuthenticatorStatus.PENDING_REQUEST, null)); return; } - if (options.mediation == Mediation.IMMEDIATE) { - callback.call( - getCredentialResponseForAssertion(AuthenticatorStatus.NOT_IMPLEMENTED, null)); - return; - } mGetCredentialCallback = callback; mIsOperationPending = true; @@ -389,12 +385,23 @@ cleanupRequest(); } - public void onSignResponse(int status, GetAssertionAuthenticatorResponse response) { + public void onSignResponse( + @Nullable GetAssertionAuthenticatorResponse assertionResponse, + @Nullable CredentialInfo passwordCredential) { + assert assertionResponse == null ^ passwordCredential == null; + // In case mojo pipe is closed due to the page begin destroyed while waiting for response. if (!mIsOperationPending) return; assert mGetCredentialCallback != null; - mGetCredentialCallback.call(getCredentialResponseForAssertion(status, response)); + if (assertionResponse != null) { + mGetCredentialCallback.call( + getCredentialResponseForAssertion( + AuthenticatorStatus.SUCCESS, assertionResponse)); + } else { + assumeNonNull(passwordCredential); + mGetCredentialCallback.call(getCredentialResponseForPassword(passwordCredential)); + } cleanupRequest(); } @@ -522,4 +529,11 @@ finalResponse.setGetAssertionResponse(assertionResponse); return finalResponse; } + + private GetCredentialResponse getCredentialResponseForPassword( + CredentialInfo passwordCredential) { + GetCredentialResponse response = new GetCredentialResponse(); + response.setPasswordResponse(passwordCredential); + return response; + } }
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2ApiTestHelper.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2ApiTestHelper.java index d303bf70..50c629f 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2ApiTestHelper.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2ApiTestHelper.java
@@ -24,7 +24,9 @@ import org.chromium.blink.mojom.AuthenticationExtensionsClientInputs; import org.chromium.blink.mojom.AuthenticatorAttachment; import org.chromium.blink.mojom.AuthenticatorSelectionCriteria; +import org.chromium.blink.mojom.AuthenticatorStatus; import org.chromium.blink.mojom.CableAuthentication; +import org.chromium.blink.mojom.CredentialInfo; import org.chromium.blink.mojom.GetAssertionAuthenticatorResponse; import org.chromium.blink.mojom.MakeCredentialAuthenticatorResponse; import org.chromium.blink.mojom.PaymentCredentialInstrument; @@ -821,6 +823,7 @@ private Integer mOutcome; private MakeCredentialAuthenticatorResponse mMakeCredentialResponse; private GetAssertionAuthenticatorResponse mGetAssertionAuthenticatorResponse; + private CredentialInfo mPasswordCredential; private List<byte[]> mGetMatchingCredentialIdsResponse; // Signals when request is complete. @@ -835,7 +838,18 @@ unblock(); } - public void onSignResponse(int status, GetAssertionAuthenticatorResponse response) { + public void onSignResponse( + @Nullable GetAssertionAuthenticatorResponse response, + @Nullable CredentialInfo passwordCredential) { + assert mStatus == null; + mStatus = AuthenticatorStatus.SUCCESS; + mGetAssertionAuthenticatorResponse = response; + mPasswordCredential = passwordCredential; + unblock(); + } + + public void onSignResponseWithStatus( + int status, GetAssertionAuthenticatorResponse response) { assert mStatus == null; mStatus = status; mGetAssertionAuthenticatorResponse = response; @@ -874,6 +888,10 @@ return mGetAssertionAuthenticatorResponse; } + public CredentialInfo getGetAssertionPasswordCredential() { + return mPasswordCredential; + } + public List<byte[]> getGetMatchingCredentialIdsResponse() { return mGetMatchingCredentialIdsResponse; }
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java index d23b51d..71a1eb13 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/Fido2CredentialRequest.java
@@ -423,8 +423,6 @@ RecordOutcomeCallback recordingCallback) { RenderFrameHost frameHost = mAuthenticationContextProvider.getRenderFrameHost(); assert frameHost != null; - assert payment == null || frameHost != null; - assert options.mediation != Mediation.CONDITIONAL || frameHost != null; assert mGetAssertionCallback == null && mErrorCallback == null; mGetAssertionCallback = callback; mErrorCallback = errorCallback; @@ -435,6 +433,26 @@ returnErrorAndResetCallback(AuthenticatorStatus.NOT_IMPLEMENTED); return; } + + if (options.mediation == Mediation.IMMEDIATE) { + WebContents webContents = mAuthenticationContextProvider.getWebContents(); + // TODO(https://crbug.com/393055190): Implement Immediate Mediation for when CredMan is + // not available. + if (!isChrome(webContents) || getBarrierMode() == Barrier.Mode.ONLY_FIDO_2_API) { + returnErrorAndResetCallback(AuthenticatorStatus.NOT_IMPLEMENTED); + return; + } + if (options.allowCredentials != null && options.allowCredentials.length != 0) { + mGetAssertionErrorOutcome = GetAssertionOutcome.SECURITY_ERROR; + returnErrorAndResetCallback(AuthenticatorStatus.NOT_ALLOWED_ERROR); + return; + } + if (webContents != null && webContents.isIncognito()) { + returnErrorAndResetCallback(AuthenticatorStatus.NOT_ALLOWED_ERROR); + return; + } + } + @Nullable Origin remoteDesktopOrigin = null; if (DeviceFeatureMap.isEnabled(DeviceFeatureList.WEBAUTHN_REMOTE_DESKTOP_ALLOWED_ORIGINS) && options.extensions.remoteDesktopClientOverride != null @@ -556,8 +574,12 @@ } // Payments should still go through Google Play Services. + // TODO(https://crbug.com/393055190): Immediate mediation should work with parallel mode + // when it is made to work with Chrome UI. final byte[] finalClientDataHash = clientDataHash; - if (payment == null && getBarrierMode() == Barrier.Mode.ONLY_CRED_MAN) { + if (payment == null + && (getBarrierMode() == Barrier.Mode.ONLY_CRED_MAN + || options.mediation == Mediation.IMMEDIATE)) { if (options.mediation == Mediation.CONDITIONAL) { mBarrier.resetAndSetWaitStatus(Barrier.Mode.ONLY_CRED_MAN); mCredManHelper.startPrefetchRequest( @@ -583,8 +605,16 @@ } checkForMatchingCredentials(options, origin, clientDataHash); } else { - // WebauthnMode.CHROME_3PP_ENABLED will keep using CredMan's no credentials UI. - if (is(mAuthenticationContextProvider.getWebContents(), WebauthnMode.CHROME)) { + if (options.mediation == Mediation.IMMEDIATE) { + // TODO(https://crbug.com/408002783): This should have a distinct + // GetAssertionOutcome for logging. + mCredManHelper.setNoCredentialsFallback( + () -> + this.returnErrorAndResetCallback( + AuthenticatorStatus.NOT_ALLOWED_ERROR)); + } else if (is( + mAuthenticationContextProvider.getWebContents(), WebauthnMode.CHROME)) { + // WebauthnMode.CHROME_3PP_ENABLED will keep using CredMan's no credentials UI. mCredManHelper.setNoCredentialsFallback( () -> this.maybeDispatchGetAssertionRequest( @@ -1301,7 +1331,7 @@ frameHost.notifyWebAuthnAssertionRequestSucceeded(); } r.extensions.echoAppidExtension = mAppIdExtensionUsed; - mGetAssertionCallback.onSignResponse(AuthenticatorStatus.SUCCESS, r); + mGetAssertionCallback.onSignResponse(r, /* passwordCredential= */ null); mGetAssertionCallback = null; return; }
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/GetAssertionResponseCallback.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/GetAssertionResponseCallback.java index 3a02078..65017fe 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/GetAssertionResponseCallback.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/GetAssertionResponseCallback.java
@@ -4,14 +4,18 @@ package org.chromium.components.webauthn; +import org.chromium.blink.mojom.CredentialInfo; import org.chromium.blink.mojom.GetAssertionAuthenticatorResponse; import org.chromium.build.annotations.NullMarked; +import org.chromium.build.annotations.Nullable; /** - * Callback interface for receiving a response from a request to produce a - * signed assertion from an authenticator. + * Callback interface for receiving a response from a request to produce a signed assertion from an + * authenticator, or a username/password `CredentialInfo` in some cases. */ @NullMarked public interface GetAssertionResponseCallback { - public void onSignResponse(int status, GetAssertionAuthenticatorResponse response); + public void onSignResponse( + @Nullable GetAssertionAuthenticatorResponse assertionResponse, + @Nullable CredentialInfo passwordCredential); }
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelper.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelper.java index 7cedd8bb..6281c58a 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelper.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManGetCredentialRequestHelper.java
@@ -41,7 +41,6 @@ private boolean mRequestPasswords; private @Nullable String mOrigin; - private boolean mPlayServicesAvailable; private boolean mIgnoreGpm; private @Nullable RenderFrameHost mRenderFrameHost; @@ -67,11 +66,6 @@ return this; } - Builder setPlayServicesAvailable(boolean playServicesAvailable) { - mHelper.mPlayServicesAvailable = playServicesAvailable; - return this; - } - Builder setIgnoreGpm(boolean ignoreGpm) { mHelper.mIgnoreGpm = ignoreGpm; return this; @@ -110,10 +104,6 @@ return mOrigin; } - boolean getPlayServicesAvailable() { - return mPlayServicesAvailable; - } - boolean getIgnoreGpm() { return mIgnoreGpm; }
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java index 7f2666a..a5727cb 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/CredManHelper.java
@@ -27,6 +27,9 @@ import org.chromium.base.Log; import org.chromium.blink.mojom.AuthenticatorStatus; +import org.chromium.blink.mojom.CredentialInfo; +import org.chromium.blink.mojom.CredentialType; +import org.chromium.blink.mojom.CredentialTypeFlags; import org.chromium.blink.mojom.GetAssertionAuthenticatorResponse; import org.chromium.blink.mojom.MakeCredentialAuthenticatorResponse; import org.chromium.blink.mojom.Mediation; @@ -49,6 +52,7 @@ import org.chromium.components.webauthn.cred_man.CredManMetricsHelper.CredManGetRequestEnum; import org.chromium.components.webauthn.cred_man.CredManMetricsHelper.CredManPrepareRequestEnum; import org.chromium.content_public.browser.RenderFrameHost; +import org.chromium.mojo_base.mojom.String16; import java.nio.ByteBuffer; @@ -409,6 +413,24 @@ String type = getCredentialResponse.getCredential().getType(); if (!TYPE_PASSKEY.equals(type)) { + if (options.mediation == Mediation.IMMEDIATE) { + CredentialInfo passwordCredential = new CredentialInfo(); + passwordCredential.type = CredentialType.PASSWORD; + String16 name = + stringToMojoString16( + data.getString(CRED_MAN_PREFIX + "BUNDLE_KEY_ID")); + passwordCredential.name = name; + passwordCredential.id = name; + passwordCredential.password = + stringToMojoString16( + data.getString( + CRED_MAN_PREFIX + "BUNDLE_KEY_PASSWORD")); + assumeNonNull(getCallback); + getCallback.onSignResponse( + /* assertionResponse= */ null, passwordCredential); + return; + } + localBridge.onPasswordCredentialReceived( frameHost, data.getString(CRED_MAN_PREFIX + "BUNDLE_KEY_ID"), @@ -473,7 +495,7 @@ frameHost.notifyWebAuthnAssertionRequestSucceeded(); } assumeNonNull(getCallback); - getCallback.onSignResponse(AuthenticatorStatus.SUCCESS, response); + getCallback.onSignResponse(response, /* passwordCredential= */ null); } }; @@ -483,6 +505,12 @@ CredManGetRequestEnum.COULD_NOT_SEND_REQUEST, mConditionalUiState); return AuthenticatorStatus.NOT_ALLOWED_ERROR; } + + boolean passwordCredentialsRequested = + (options.requestedCredentialTypeFlags & CredentialTypeFlags.PASSWORD) != 0; + if (options.mediation == Mediation.IMMEDIATE && passwordCredentialsRequested) { + mRequestPasswords = true; + } mConditionalUiState = options.mediation == Mediation.CONDITIONAL ? ConditionalUiState.WAITING_FOR_CREDENTIAL_LIST @@ -545,10 +573,15 @@ } boolean shouldPreferImmediatelyAvailable(@Mediation.EnumType int mediation) { + if (mediation == Mediation.IMMEDIATE) { + return true; + } + // Chrome renders its own UI when there are no credentials when using CredMan. However, this // is not true for WebView or Chrome 3rd party PWM mode - there are no other UIs. Thus // they never ask CredMan to skip its UI. - if (is(mAuthenticationContextProvider.getWebContents(), WebauthnMode.CHROME)) { + if (is(mAuthenticationContextProvider.getWebContents(), WebauthnMode.CHROME) + && mPlayServicesAvailable) { return mediation != Mediation.CONDITIONAL; } return false; @@ -593,7 +626,6 @@ hasAllowCredentials, requestPasswords) .setOrigin(originString) - .setPlayServicesAvailable(mPlayServicesAvailable) .setIgnoreGpm(ignoreGpm) .setRenderFrameHost(mAuthenticationContextProvider.getRenderFrameHost()) .build(); @@ -615,4 +647,17 @@ + " otherwise decoding may still fail in tests.", e); } + + private static @Nullable String16 stringToMojoString16(@Nullable String javaString) { + if (javaString == null) { + return null; + } + short[] data = new short[javaString.length()]; + for (int i = 0; i < data.length; i++) { + data[i] = (short) javaString.charAt(i); + } + String16 mojoString = new String16(); + mojoString.data = data; + return mojoString; + } }
diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecorator.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecorator.java index 4a4b571..2abfa059 100644 --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecorator.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecorator.java
@@ -93,7 +93,7 @@ // error which is handled by calling Play Services to render the error. getCredentialRequestBundle.putBoolean( CRED_MAN_PREFIX + "BUNDLE_KEY_PREFER_IMMEDIATELY_AVAILABLE_CREDENTIALS", - helper.getPreferImmediatelyAvailable() && helper.getPlayServicesAvailable()); + helper.getPreferImmediatelyAvailable()); } @Override
diff --git a/components/webauthn/android/junit/src/org/chromium/components/webauthn/Fido2CredentialRequestRobolectricTest.java b/components/webauthn/android/junit/src/org/chromium/components/webauthn/Fido2CredentialRequestRobolectricTest.java index 372f4c9..ffe639e 100644 --- a/components/webauthn/android/junit/src/org/chromium/components/webauthn/Fido2CredentialRequestRobolectricTest.java +++ b/components/webauthn/android/junit/src/org/chromium/components/webauthn/Fido2CredentialRequestRobolectricTest.java
@@ -798,6 +798,58 @@ assertThat(mFido2ApiCallHelper.mGetAssertionCalled).isFalse(); } + @Test + @SmallTest + public void testImmediateGetAssertion_success() { + mRequestOptions.mediation = Mediation.IMMEDIATE; + + mRequest.handleGetAssertionRequest( + mRequestOptions, + mOrigin, + mOrigin, + /* payment= */ null, + mCallback::onSignResponse, + mCallback::onError, + mCallback::onRequestOutcome); + + String originString = Fido2CredentialRequest.convertOriginToString(mOrigin); + verify(mCredManHelperMock) + .startGetRequest( + eq(mRequestOptions), + eq(originString), + eq(TEST_CLIENT_DATA_JSON.getBytes()), + /* clientDataHash= */ notNull(), + /* getCallback= */ any(), + /* errorCallback= */ any(), + /* ignoreGpm= */ eq(false)); + verify(mBrowserBridgeMock, never()).onCredManUiClosed(any(), anyBoolean()); + } + + @Test + @SmallTest + public void testImmediateGetAssertion_withAllowList_notAllowed() { + mRequestOptions.mediation = Mediation.IMMEDIATE; + PublicKeyCredentialDescriptor descriptor = new PublicKeyCredentialDescriptor(); + descriptor.type = 0; + descriptor.id = new byte[] {1, 2, 3, 4}; + descriptor.transports = new int[] {0}; + mRequestOptions.allowCredentials = new PublicKeyCredentialDescriptor[] {descriptor}; + + mRequest.handleGetAssertionRequest( + mRequestOptions, + mOrigin, + mOrigin, + /* payment= */ null, + mCallback::onSignResponse, + mCallback::onError, + mCallback::onRequestOutcome); + + verify(mCredManHelperMock, never()) + .startGetRequest(any(), any(), any(), any(), any(), any(), anyBoolean()); + assertThat(mCallback.getStatus()) + .isEqualTo(Integer.valueOf(AuthenticatorStatus.NOT_ALLOWED_ERROR)); + } + private WebauthnCredentialDetails createWebauthnCredential() { PublicKeyCredentialDescriptor descriptor = new PublicKeyCredentialDescriptor(); descriptor.type = 0;
diff --git a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java index 03bdf1c..a884c5a5 100644 --- a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java +++ b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/CredManHelperRobolectricTest.java
@@ -32,6 +32,7 @@ import androidx.test.filters.SmallTest; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -64,6 +65,7 @@ import org.chromium.components.webauthn.cred_man.CredManMetricsHelper.CredManPrepareRequestEnum; import org.chromium.content_public.browser.RenderFrameHost; import org.chromium.content_public.browser.WebContents; +import org.chromium.mojo_base.mojom.String16; @RunWith(BaseRobolectricTestRunner.class) @Config( @@ -690,6 +692,43 @@ assertThat(credManRequest).isEqualTo(mGetCredentialRequest); } + @Test + @SmallTest + public void testImmediateMediation_userSelectsPassword_canHavePasswordResponse() { + mRequestOptions.mediation = Mediation.IMMEDIATE; + + int result = + mCredManHelper.startGetRequest( + mRequestOptions, + mOriginString, + /* clientDataJson= */ null, + mClientDataHash, + mCallback::onSignResponse, + mErrorCallback, + /* ignoreGpm= */ false); + + assertThat(result).isEqualTo(AuthenticatorStatus.SUCCESS); + + ShadowCredentialManager shadowCredentialManager = Shadow.extract(mCredentialManager); + String username = "user123"; + String password = "hunter2"; + GetCredentialResponse response = + new GetCredentialResponse(createPasswordCredential(username, password)); + shadowCredentialManager.getGetCredentialCallback().onResult(response); + + verify(mBrowserBridge, never()).onCredManUiClosed(any(), anyBoolean()); + verify(mBrowserBridge, never()).onPasswordCredentialReceived(any(), any(), any()); + + assertThat(mCallback.getStatus()).isEqualTo(Integer.valueOf(AuthenticatorStatus.SUCCESS)); + Assert.assertNotNull(mCallback.getGetAssertionPasswordCredential()); + assertThat(mojoStringToJavaString(mCallback.getGetAssertionPasswordCredential().name)) + .isEqualTo(username); + assertThat(mojoStringToJavaString(mCallback.getGetAssertionPasswordCredential().id)) + .isEqualTo(username); + assertThat(mojoStringToJavaString(mCallback.getGetAssertionPasswordCredential().password)) + .isEqualTo(password); + } + private Credential createPasskeyCredential() { Bundle data = new Bundle(); data.putString("androidx.credentials.BUNDLE_KEY_AUTHENTICATION_RESPONSE_JSON", "json"); @@ -702,4 +741,13 @@ data.putString("androidx.credentials.BUNDLE_KEY_PASSWORD", password); return new Credential(Credential.TYPE_PASSWORD_CREDENTIAL, data); } + + private static String mojoStringToJavaString(String16 mojoString) { + short[] data = mojoString.data; + char[] chars = new char[data.length]; + for (int i = 0; i < chars.length; i++) { + chars[i] = (char) data[i]; + } + return String.valueOf(chars); + } }
diff --git a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecoratorRobolectricTest.java b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecoratorRobolectricTest.java index 1469aba5..71fc862 100644 --- a/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecoratorRobolectricTest.java +++ b/components/webauthn/android/junit/src/org/chromium/components/webauthn/cred_man/GpmCredManRequestDecoratorRobolectricTest.java
@@ -86,7 +86,6 @@ @SmallTest public void testUpdateGetCredentialRequestBundle_whenIgnoreGpmFalse_thenBundleContainsBranding() { - when(mGetHelper.getPlayServicesAvailable()).thenReturn(true); when(mGetHelper.getPreferImmediatelyAvailable()).thenReturn(true); when(mGetHelper.getIgnoreGpm()).thenReturn(false); Bundle bundle = new Bundle(); @@ -107,7 +106,6 @@ @SmallTest public void testUpdateGetCredentialRequestBundle_whenIgnoreGpmTrue_thenBundleDoesNotContainBranding() { - when(mGetHelper.getPlayServicesAvailable()).thenReturn(true); when(mGetHelper.getPreferImmediatelyAvailable()).thenReturn(true); when(mGetHelper.getIgnoreGpm()).thenReturn(true); Bundle bundle = new Bundle();
diff --git a/content/browser/accessibility/web_contents_accessibility_android.cc b/content/browser/accessibility/web_contents_accessibility_android.cc index 90f5942..2ab5a44 100644 --- a/content/browser/accessibility/web_contents_accessibility_android.cc +++ b/content/browser/accessibility/web_contents_accessibility_android.cc
@@ -622,39 +622,65 @@ void WebContentsAccessibilityAndroid::SetBrowserAXMode( JNIEnv* env, - jboolean needs_full_engine, + jboolean is_known_screen_reader_enabled, + jboolean is_complex_accessibility_service_enabled, jboolean is_form_controls_candidate, - jboolean is_screen_reader_running, - jboolean on_screen_mode) { + jboolean is_on_screen_mode_candidate) { BrowserAccessibilityStateImpl* accessibility_state = BrowserAccessibilityStateImpl::GetInstance(); + auto* accessibility_state_android = static_cast<BrowserAccessibilityStateImplAndroid*>(accessibility_state); accessibility_state_android->SetScreenReaderAppActive( - is_screen_reader_running); + is_known_screen_reader_enabled); - ui::AXMode target_mode; // Set the AXMode based on currently running services, sent from Java-side - // code and will fit into one of the below categories: - // 1. Screen reader -- |ui::kAXModeComplete|. - // 2. Only Screen reader running -- |ui::kAccessibilityOnScreenMode|. - // 3. Performance filtering disallowed -- |ui::kAXModeComplete|. - // 4. Only password manager running -- |ui::kAXModeFormControls| - // 5. Some accessibility services running that need more information than a - // password manager, but not as much as a screenreader - - // |ui::kAXModeBasic| + // code, in the following priority: + // + // (Note: This must /always/ take the top priority.) + // 1. If the performance filtering enterprise policy is disabled, then the + // mode must be the most complete mode possible (i.e. no performance + // optimizations). (ui::kAXModeComplete) + // + // 2. When a known screen reader is running, use the complete mode. + // (ui::kAXModeComplete) + // 2a. (Experimental) If a known screen reader is the only service + // running, then this is a candidate to use the "on screen only" + // experimental mode. (ui::kAXModeOnScreen) + // + // 3. When services are running that require detailed information according to + // the Java-side code (i.e. a "complex" accessibility service), use the + // complete mode. (ui::kAXModeComplete) + // TODO(aleventahl): We should split this from the known screen reader case by + // adding a mode specific to screen readers. + // + // 4. When the only services running are password managers, then this is a + // candidate for filtering for only form controls. (ui::kAXModeFormControls) + // + // 5. As a final case - at least one accessibility service must be enabled, + // and the union of all services has not requested enough information to be in + // a complete state, but has requested more than a limited state such as form + // controls, so fallback to a basic state. (ui::kAXModeBasic) + // + // TODO(crbug.com/413016129): Consider adding the ability to turn off the + // AXMode here by sending whether or not any service is running. This case is + // currently handled by the AutoDisableAccessibilityHandler, which waits ~5 + // seconds before turning off accessibility, to account for quick toggling of + // the state. Analysis of existing data could show whether the 5 second wait + // is necessary. + ui::AXMode target_mode; if (!accessibility_state->IsPerformanceFilteringAllowed()) { target_mode = ui::kAXModeComplete; - } else if (needs_full_engine) { - if (features::IsAccessibilityOnScreenAXModeEnabled() && on_screen_mode) { - // Add on screen experimental mode. - // TODO(accessibility): expand this for other services running, not only - // screen reader on its own. - CHECK(accessibility_state->IsPerformanceFilteringAllowed()); - target_mode = ui::kAXModeOnScreen; + } else if (is_known_screen_reader_enabled) { + if (is_on_screen_mode_candidate) { + target_mode = features::IsAccessibilityOnScreenAXModeEnabled() + ? ui::kAXModeOnScreen + : ui::kAXModeComplete; } else { target_mode = ui::kAXModeComplete; } + } else if (is_complex_accessibility_service_enabled) { + target_mode = ui::kAXModeComplete; } else if (is_form_controls_candidate) { target_mode = ui::kAXModeFormControls; } else { @@ -1197,7 +1223,7 @@ node->IsContentInvalid(), node->IsEnabled(), node->IsFocusable(), node->IsFocused(), node->HasImage(), node->IsPasswordField(), node->IsScrollable(), node->IsSelected(), node->IsVisibleToUser(), - node->HasCharacterLocations(), node->IsRequired()); + node->HasCharacterLocations(), node->IsRequired(), node->IsHeading()); Java_AccessibilityNodeInfoBuilder_addAccessibilityNodeInfoActions( env, obj, info, unique_id, node->CanScrollForward(), @@ -1511,8 +1537,8 @@ jboolean forwards, jboolean can_wrap_to_last_element, jboolean use_default_predicate, - jboolean is_talkback_enabled, - jboolean is_only_talkback_enabled) { + jboolean is_known_screen_reader_enabled, + jboolean is_only_one_accessibility_service_enabled) { base::ElapsedTimer timer; BrowserAccessibilityAndroid* start_node = GetAXFromUniqueID(start_id); if (!start_node) { @@ -1552,13 +1578,14 @@ } // Record the type of element that was used for navigation, splitting by - // whether or not TalkBack was running to see how frequently other apps use - // this functionality. - if (is_only_talkback_enabled) { + // whether or not a screen reader was running to see how frequently other apps + // use this functionality. + if (is_known_screen_reader_enabled && + is_only_one_accessibility_service_enabled) { base::UmaHistogramEnumeration( "Accessibility.Android.FindElementType.Usage2.TalkBack", EnumForPredicate(element_type)); - } else if (is_talkback_enabled) { + } else if (is_known_screen_reader_enabled) { base::UmaHistogramEnumeration( "Accessibility.Android.FindElementType.Usage2." "TalkBackWithOtherAT",
diff --git a/content/browser/accessibility/web_contents_accessibility_android.h b/content/browser/accessibility/web_contents_accessibility_android.h index 38437dd..c135373 100644 --- a/content/browser/accessibility/web_contents_accessibility_android.h +++ b/content/browser/accessibility/web_contents_accessibility_android.h
@@ -137,10 +137,10 @@ // This method turns on the renderer-side accessibility engine for this // web contents. void SetBrowserAXMode(JNIEnv* env, - jboolean needs_full_engine, - jboolean form_controls_mode, - jboolean is_screen_reader_running, - jboolean on_screen_mode); + jboolean is_known_screen_reader_enabled, + jboolean is_complex_accessibility_service_enabled, + jboolean is_form_controls_candidate, + jboolean is_on_screen_mode_candidate); base::android::ScopedJavaLocalRef<jstring> GetSupportedHtmlElementTypes( JNIEnv* env); @@ -201,14 +201,15 @@ // Use |can_wrap_to_last_element| to specify if a backwards search can wrap // around to the last element. This is used to expose the last HTML element // upon swiping backwards into a WebView. - jint FindElementType(JNIEnv* env, - jint start_id, - const base::android::JavaParamRef<jstring>& element_type, - jboolean forwards, - jboolean can_wrap_to_last_element, - jboolean use_default_predicate, - jboolean is_talkback_enabled, - jboolean is_only_talkback_enabled); + jint FindElementType( + JNIEnv* env, + jint start_id, + const base::android::JavaParamRef<jstring>& element_type_str, + jboolean forwards, + jboolean can_wrap_to_last_element, + jboolean use_default_predicate, + jboolean is_known_screen_reader_enabled, + jboolean is_only_one_accessibility_service_enabled); // Respond to a ACTION_[NEXT/PREVIOUS]_AT_MOVEMENT_GRANULARITY action // and move the cursor/selection within the given node id. We keep track
diff --git a/content/browser/attribution_reporting/attribution_manager_impl.cc b/content/browser/attribution_reporting/attribution_manager_impl.cc index 982d365..2bb7b67 100644 --- a/content/browser/attribution_reporting/attribution_manager_impl.cc +++ b/content/browser/attribution_reporting/attribution_manager_impl.cc
@@ -7,6 +7,7 @@ #include <stddef.h> #include <stdint.h> +#include <algorithm> #include <cmath> #include <functional> #include <optional> @@ -91,6 +92,7 @@ #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" #include "net/base/schemeful_site.h" +#include "services/metrics/public/cpp/metrics_utils.h" #include "services/metrics/public/cpp/ukm_builders.h" #include "services/metrics/public/cpp/ukm_recorder.h" #include "services/metrics/public/cpp/ukm_source_id.h" @@ -495,6 +497,17 @@ time_since_original_report_time > base::Days(30)); RecordReportRetriesEventLevel(report.failed_send_attempts()); + + // `time_since_original_report_time` can be negative when sent from the + // web UI. + dwa::builders::AttributionConversionsSendReport() + .SetContent(report.reporting_origin().Serialize()) + .SetEventLevelExtraReportDelay( + ukm::GetSemanticBucketMinForDurationTiming( + std::max(time_since_original_report_time.InMilliseconds(), + int64_t(0)))) + .Record(metrics::dwa::DwaRecorder::Get()); + break; case AttributionReport::Type::kAggregatableAttribution: UMA_HISTOGRAM_CUSTOM_TIMES( @@ -517,6 +530,16 @@ time_since_original_report_time > base::Days(30)); RecordReportRetriesAggregatable(report.failed_send_attempts()); + + // `time_from_conversion_to_report_sent` can be negative in edge cases, + // e.g. the user adjusted the clock backwards and sent from the web UI. + dwa::builders::AttributionConversionsSendReport() + .SetContent(report.reporting_origin().Serialize()) + .SetAggregatableReportDelayFromTrigger( + ukm::GetSemanticBucketMinForDurationTiming( + std::max(time_from_conversion_to_report_sent.InMilliseconds(), + int64_t(0)))) + .Record(metrics::dwa::DwaRecorder::Get()); break; case AttributionReport::Type::kNullAggregatable: break;
diff --git a/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc b/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc index e21f9ed4b..2d05257 100644 --- a/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc +++ b/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc
@@ -2879,6 +2879,9 @@ TEST_F(AttributionManagerImplTest, OnReportSent_RecordReportDelay) { base::HistogramTester histograms; + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeature(metrics::dwa::kDwaFeature); + attribution_manager_->HandleSource(TestAggregatableSourceProvider() .GetBuilder() .SetExpiry(kImpressionExpiry) @@ -2908,6 +2911,11 @@ checkpoint.Call(1); + metrics::dwa::DwaRecorder::Get()->EnableRecording(); + metrics::dwa::DwaRecorder::Get()->Purge(); + ASSERT_THAT(metrics::dwa::DwaRecorder::Get()->GetEntriesForTesting(), + IsEmpty()); + std::vector<ReportSentCallback> report_sent_callbacks; std::vector<AttributionReport> sent_reports; @@ -2941,6 +2949,35 @@ base::Days(3) + base::Minutes(1), 1); histograms.ExpectUniqueSample( "Conversions.AggregatableReport.ReportRetriesTillSuccessOrFailure", 0, 1); + + // The content is set as the reporting origin. In unit tests, this value is + // set to "https://report.test". DWA content sanitization extracts the eTLD+1 + // from this value, yielding "report.test". + EXPECT_THAT( + metrics::dwa::DwaRecorder::Get()->GetEntriesForTesting(), + UnorderedElementsAre( + Pointee(AllOf( + Field(&metrics::dwa::mojom::DwaEntry::event_hash, + base::HashMetricName("AttributionConversionsSendReport")), + Field(&metrics::dwa::mojom::DwaEntry::content_hash, + base::HashMetricName("report.test")), + Field(&metrics::dwa::mojom::DwaEntry::metrics, + UnorderedElementsAre(testing::Pair( + base::HashMetricName("EventLevelExtraReportDelay"), + // base::Days(3) + base::Minutes(1) bucketed to 2 days. + base::Days(2).InMilliseconds()))))), + Pointee(AllOf( + Field(&metrics::dwa::mojom::DwaEntry::event_hash, + base::HashMetricName("AttributionConversionsSendReport")), + Field(&metrics::dwa::mojom::DwaEntry::content_hash, + base::HashMetricName("report.test")), + Field(&metrics::dwa::mojom::DwaEntry::metrics, + UnorderedElementsAre( + testing::Pair(base::HashMetricName( + "AggregatableReportDelayFromTrigger"), + // kFirstReportingWindow + base::Days(3) + + // base::Minutes(1) bucketed to 4 days. + base::Days(4).InMilliseconds()))))))); } TEST_F(AttributionManagerImplTest,
diff --git a/content/browser/devtools/protocol/page_handler.cc b/content/browser/devtools/protocol/page_handler.cc index f273158..a3da30a5 100644 --- a/content/browser/devtools/protocol/page_handler.cc +++ b/content/browser/devtools/protocol/page_handler.cc
@@ -604,13 +604,15 @@ } void PageHandler::DidRunJavaScriptDialog(const GURL& url, + const base::UnguessableToken& frame_id, const std::u16string& message, const std::u16string& default_prompt, JavaScriptDialogType dialog_type, bool has_non_devtools_handlers, JavaScriptDialogCallback callback) { - if (!enabled_) + if (!enabled_) { return; + } DCHECK(pending_dialog_.is_null()); pending_dialog_ = std::move(callback); std::string type = Page::DialogTypeEnum::Alert; @@ -618,29 +620,37 @@ type = Page::DialogTypeEnum::Confirm; if (dialog_type == JAVASCRIPT_DIALOG_TYPE_PROMPT) type = Page::DialogTypeEnum::Prompt; - frontend_->JavascriptDialogOpening(url.spec(), base::UTF16ToUTF8(message), - type, has_non_devtools_handlers, - base::UTF16ToUTF8(default_prompt)); + frontend_->JavascriptDialogOpening( + url.spec(), frame_id.ToString(), base::UTF16ToUTF8(message), type, + has_non_devtools_handlers, base::UTF16ToUTF8(default_prompt)); } -void PageHandler::DidRunBeforeUnloadConfirm(const GURL& url, - bool has_non_devtools_handlers, - JavaScriptDialogCallback callback) { - if (!enabled_) +void PageHandler::DidRunBeforeUnloadConfirm( + const GURL& url, + const base::UnguessableToken& frame_id, + bool has_non_devtools_handlers, + JavaScriptDialogCallback callback) { + if (!enabled_) { return; + } DCHECK(pending_dialog_.is_null()); pending_dialog_ = std::move(callback); - frontend_->JavascriptDialogOpening(url.spec(), std::string(), + frontend_->JavascriptDialogOpening(url.spec(), frame_id.ToString(), + std::string(), Page::DialogTypeEnum::Beforeunload, has_non_devtools_handlers, std::string()); } -void PageHandler::DidCloseJavaScriptDialog(bool success, - const std::u16string& user_input) { - if (!enabled_) +void PageHandler::DidCloseJavaScriptDialog( + const base::UnguessableToken& frame_id, + bool success, + const std::u16string& user_input) { + if (!enabled_) { return; + } pending_dialog_.Reset(); - frontend_->JavascriptDialogClosed(success, base::UTF16ToUTF8(user_input)); + frontend_->JavascriptDialogClosed(frame_id.ToString(), success, + base::UTF16ToUTF8(user_input)); } Response PageHandler::Enable(
diff --git a/content/browser/devtools/protocol/page_handler.h b/content/browser/devtools/protocol/page_handler.h index 8ef415e..2d7c934 100644 --- a/content/browser/devtools/protocol/page_handler.h +++ b/content/browser/devtools/protocol/page_handler.h
@@ -89,15 +89,19 @@ using JavaScriptDialogCallback = content::JavaScriptDialogManager::DialogClosedCallback; void DidRunJavaScriptDialog(const GURL& url, + const base::UnguessableToken& frame_id, const std::u16string& message, const std::u16string& default_prompt, JavaScriptDialogType dialog_type, bool has_non_devtools_handlers, JavaScriptDialogCallback callback); void DidRunBeforeUnloadConfirm(const GURL& url, + const base::UnguessableToken& frame_id, bool has_non_devtools_handlers, JavaScriptDialogCallback callback); - void DidCloseJavaScriptDialog(bool success, const std::u16string& user_input); + void DidCloseJavaScriptDialog(const base::UnguessableToken& frame_id, + bool success, + const std::u16string& user_input); void NavigationReset(NavigationRequest* navigation_request); void DownloadWillBegin(FrameTreeNode* ftn, download::DownloadItem* item); void DidStartNavigating(FrameTreeNode& ftn,
diff --git a/content/browser/loader/keep_alive_url_loader_service_unittest.cc b/content/browser/loader/keep_alive_url_loader_service_unittest.cc index e1a595d0..d9fc33cb 100644 --- a/content/browser/loader/keep_alive_url_loader_service_unittest.cc +++ b/content/browser/loader/keep_alive_url_loader_service_unittest.cc
@@ -1467,16 +1467,8 @@ EXPECT_EQ(network_url_loader_factory().NumPending(), 1); } -// TODO(https://crbug.com/368570340) -#if BUILDFLAG(IS_ANDROID) -#define MAYBE_ForwardRedirectsAndResponseToAttributionRequestHelper \ - DISABLED_ForwardRedirectsAndResponseToAttributionRequestHelper -#else -#define MAYBE_ForwardRedirectsAndResponseToAttributionRequestHelper \ - ForwardRedirectsAndResponseToAttributionRequestHelper -#endif TEST_F(FetchLaterKeepAliveURLLoaderServiceTest, - MAYBE_ForwardRedirectsAndResponseToAttributionRequestHelper) { + ForwardRedirectsAndResponseToAttributionRequestHelper) { // The Attribution Manager uses the DataDecoder service, which, when an // InProcessDataDecoer object exists, will route to an internal in-process // instance. @@ -1511,24 +1503,33 @@ // The network should now have created pending URLLoader. EXPECT_EQ(network_url_loader_factory().NumPending(), 1); + base::RunLoop run_loop_1; + // Simluates receiving a redirect in the network service. - EXPECT_CALL(*mock_attribution_manager, HandleTrigger).Times(1); + EXPECT_CALL(*mock_attribution_manager, HandleTrigger) + .WillOnce([&](AttributionTrigger, GlobalRenderFrameHostId) { + run_loop_1.Quit(); + }); constexpr char kRegisterTriggerJson[] = R"json({ })json"; GetLastPendingRequest()->client->OnReceiveRedirect( CreateRedirectInfo(GURL(kTestRedirectRequestUrl)), CreateResponseHead({{kAttributionReportingRegisterTriggerHeader, kRegisterTriggerJson}})); + run_loop_1.Run(); + + base::RunLoop run_loop_2; // Simluates receiving response in the network service. - EXPECT_CALL(*mock_attribution_manager, HandleSource).Times(1); + EXPECT_CALL(*mock_attribution_manager, HandleSource) + .WillOnce( + [&](StorableSource, GlobalRenderFrameHostId) { run_loop_2.Quit(); }); constexpr char kRegisterSourceJson[] = R"json({"destination":"https://destination.example"})json"; GetLastPendingRequest()->client->OnReceiveResponse( CreateResponseHead( {{kAttributionReportingRegisterSourceHeader, kRegisterSourceJson}}), /*body=*/{}, /*cached_metadata=*/std::nullopt); - - base::RunLoop().RunUntilIdle(); + run_loop_2.Run(); } } // namespace content
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 1322309..749dbef 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -8646,7 +8646,8 @@ for (auto* handler : page_handlers) { handler->DidRunJavaScriptDialog( - render_frame_host->GetLastCommittedURL(), normalized_message, + render_frame_host->GetLastCommittedURL(), + render_frame_host->devtools_frame_token(), normalized_message, default_prompt, dialog_type, has_non_devtools_handlers, base::BindOnce(&CloseDialogCallbackWrapper::Run, wrapper, false)); } @@ -8749,7 +8750,8 @@ GURL frame_url = render_frame_host->GetLastCommittedURL(); for (auto* handler : page_handlers) { handler->DidRunBeforeUnloadConfirm( - frame_url, has_non_devtools_handlers, + frame_url, render_frame_host->devtools_frame_token(), + has_non_devtools_handlers, base::BindOnce(&CloseDialogCallbackWrapper::Run, wrapper, false)); } @@ -10510,7 +10512,8 @@ std::vector<protocol::PageHandler*> page_handlers = protocol::PageHandler::EnabledForWebContents(this); for (auto* handler : page_handlers) { - handler->DidCloseJavaScriptDialog(success, user_input); + handler->DidCloseJavaScriptDialog(rfh->devtools_frame_token(), + success, user_input); } is_showing_javascript_dialog_ = false;
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc index 2c19eb3..9e1955ea 100644 --- a/content/browser/web_contents/web_contents_view_android.cc +++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -8,7 +8,6 @@ #include <optional> #include <utility> -#include "base/android/build_info.h" #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/check.h" @@ -76,8 +75,6 @@ // compositor event queue. bool ShouldRequestUnbufferedDispatch() { static bool should_request_unbuffered_dispatch = - base::android::BuildInfo::GetInstance()->sdk_int() >= - base::android::SDK_VERSION_LOLLIPOP && !GetContentClient()->UsingSynchronousCompositing() && !base::FeatureList::IsEnabled( input::features::kUseAndroidBufferedInputDispatch);
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityHistogramRecorder.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityHistogramRecorder.java index d9bacd9..4bfd3ee 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityHistogramRecorder.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityHistogramRecorder.java
@@ -455,8 +455,8 @@ public void recordTimeToFirstAccessibilityFocus() { if (mHasRecordedTimeToFirstAccessibilityFocus) return; - // We are only interested in this for TalkBack, which always focuses the root node on load. - if (!AccessibilityState.getTalkBackEnabledState().first) return; + // We are only interested in this for screen readers, which focus the root node on load. + if (!AccessibilityState.isKnownScreenReaderEnabled()) return; // TODO(mschillaci): This uses a 5 sec max, check scale after initial data collection. RecordHistogram.recordCustomTimesHistogram(
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityNodeInfoBuilder.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityNodeInfoBuilder.java index 1ff6752f..baec9373 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityNodeInfoBuilder.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityNodeInfoBuilder.java
@@ -208,7 +208,8 @@ boolean selected, boolean visibleToUser, boolean hasCharacterLocations, - boolean isRequired) { + boolean isRequired, + boolean isHeading) { node.setCheckable(checkable); node.setClickable(clickable); node.setEnabled(enabled); @@ -220,6 +221,7 @@ node.setVisibleToUser(visibleToUser); node.setFieldRequired(isRequired); node.setContentInvalid(contentInvalid); + node.setHeading(isHeading); if (hasImage) { Bundle bundle = node.getExtras();
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java index a9b341c..4ecabea 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java
@@ -66,7 +66,6 @@ import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; -import android.util.Pair; import android.util.SparseArray; import android.view.MotionEvent; import android.view.View; @@ -805,10 +804,10 @@ WebContentsAccessibilityImplJni.get() .setBrowserAXMode( mNativeObj, + AccessibilityState.isKnownScreenReaderEnabled(), AccessibilityState.isComplexUserInteractionServiceEnabled(), AccessibilityState.isOnlyPasswordManagersEnabled(), - AccessibilityState.isKnownScreenReaderEnabled(), - AccessibilityState.getTalkBackEnabledState().second); + AccessibilityState.getNumberOfRunningServices() == 1); // Update the state of enabling/disabling the image descriptions feature. To enable the // feature, this instance must be a candidate and a screen reader must be enabled. @@ -1472,7 +1471,6 @@ boolean forwards, boolean canWrap, boolean setSequentialFocus) { - Pair<Boolean, Boolean> talkbackEnabledState = AccessibilityState.getTalkBackEnabledState(); int id = WebContentsAccessibilityImplJni.get() .findElementType( @@ -1482,8 +1480,8 @@ forwards, canWrap, elementType.isEmpty(), - talkbackEnabledState.first, - talkbackEnabledState.second); + AccessibilityState.isKnownScreenReaderEnabled(), + AccessibilityState.getNumberOfRunningServices() == 1); if (id == 0) return false; if (setSequentialFocus) { @@ -2279,10 +2277,10 @@ void setBrowserAXMode( long nativeWebContentsAccessibilityAndroid, - boolean screenReaderMode, - boolean formControlsMode, - boolean isScreenReaderRunning, - boolean onScreenMode); + boolean isKnownScreenReaderEnabled, + boolean isComplexAccessibilityServiceEnabled, + boolean isFormControlsCandidate, + boolean isOnScreenModeCandidate); void disableRendererAccessibility(long nativeWebContentsAccessibilityAndroid);
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTest.java b/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTest.java index a957242..574f3fc 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTest.java
@@ -859,7 +859,7 @@ // Set the relevant features and accessibility state. ThreadUtils.runOnUiThreadBlocking( () -> { - AccessibilityState.setIsComplexUserInteractionServiceEnabledForTesting(true); + AccessibilityState.setIsKnownScreenReaderEnabledForTesting(true); AccessibilityState.setIsOnlyPasswordManagersEnabledForTesting(false); AccessibilityState.setServiceIdsForTesting(KNOWN_SCREEN_READER_SERVICE_IDS); });
diff --git a/gpu/command_buffer/service/dawn_context_provider.cc b/gpu/command_buffer/service/dawn_context_provider.cc index 3612fb3..3f68b1c 100644 --- a/gpu/command_buffer/service/dawn_context_provider.cc +++ b/gpu/command_buffer/service/dawn_context_provider.cc
@@ -164,15 +164,12 @@ if (backend_type == wgpu::BackendType::Vulkan) { #if BUILDFLAG(IS_ANDROID) - const auto* build_info = base::android::BuildInfo::GetInstance(); - // Samsung devices are failing validation checks that texture allocation - // size is bigger than AHB size when they should. See - // https://crbug.com/377935752 for details. - // TODO(crbug.com/407497928): Enable this toggle over GpuInfoCollector. - if (std::string_view(build_info->brand()) == "samsung") { - enabled_toggles.push_back( - "ignore_imported_ahardwarebuffer_vulkan_image_size"); - } + // Enable this toggle for all Android devices suspecting vulkan image size + // mismatch causing SharedTextureMemory creation failures, leading to + // promise image creation failures. See https://crbug.com/377935752 for + // details. + enabled_toggles.push_back( + "ignore_imported_ahardwarebuffer_vulkan_image_size"); #endif // Use a single VkPipelineCache inside dawn.
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc index 9261b38..272e5d7 100644 --- a/gpu/config/gpu_info_collector.cc +++ b/gpu/config/gpu_info_collector.cc
@@ -298,6 +298,10 @@ #endif // BUILDFLAG(IS_WIN) if (backend_type == wgpu::BackendType::Vulkan) { force_enabled_toggles->push_back("vulkan_monolithic_pipeline_cache"); +#if BUILDFLAG(IS_ANDROID) + force_enabled_toggles->push_back( + "ignore_imported_ahardwarebuffer_vulkan_image_size"); +#endif } #endif // DCHECK_IS_ON() }
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm index c4083e198..5cb4557 100644 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -61,9 +61,6 @@ base::FEATURE_ENABLED_BY_DEFAULT); #if BUILDFLAG(IS_MAC) -BASE_FEATURE(kPresentationDelayForInteractiveFrames, - "PresentationDelayForInteractiveFrames", - base::FEATURE_ENABLED_BY_DEFAULT); // Record the delay from the system CVDisplayLink or CADisplaylink source to // CrGpuMain OnVSyncPresentation(). @@ -195,18 +192,27 @@ weak_ptr_factory_.GetWeakPtr())); } + const std::string target_name = features::kTargetForVSync.Get(); + const bool finch_target_interaction = + target_name == features::kTargetForVSyncInteraction; + const bool finch_target_animation = + target_name == features::kTargetForVSyncAnimation; + const bool finch_target_all_frames = + target_name == features::kTargetForVSyncAllFrames; bool delay_presenetation_until_next_vsync = - features::IsVSyncAlignedPresentEnabled(); + features::IsVSyncAlignedPresentEnabled() && + (finch_target_all_frames || + (finch_target_animation && data.is_handling_animation) || + (finch_target_interaction && data.is_handling_interaction)); // The current frame has been added to // ca_layer_tree_coordinator_->NumPendingSwaps() after calling // ca_layer_tree_coordinator_->Present(). Check NumPendingSwaps() > 1 to see // whether there is any previous pending frame. The current frame must wait in // the queue if there is already one before this. - if (base::FeatureList::IsEnabled(kPresentationDelayForInteractiveFrames) && - ca_layer_tree_coordinator_->NumPendingSwaps() > 1 && - !data.is_handling_interaction && !data.is_handling_animation) { - delay_presenetation_until_next_vsync = false; + if (features::IsVSyncAlignedPresentEnabled() && + ca_layer_tree_coordinator_->NumPendingSwaps() > 1) { + delay_presenetation_until_next_vsync = true; } if (vsync_callback_mac_) {
diff --git a/infra/config/generated/cq-usage/mega_cq_bots.txt b/infra/config/generated/cq-usage/mega_cq_bots.txt index fbc32209..bb9a274 100644 --- a/infra/config/generated/cq-usage/mega_cq_bots.txt +++ b/infra/config/generated/cq-usage/mega_cq_bots.txt
@@ -38,9 +38,6 @@ chromium/try/android-cronet-x86-dbg-oreo-tests chromium/try/android-cronet-x86-dbg-pie-tests chromium/try/android-cronet-x86-rel -chromium/try/android-dawn-arm-rel -chromium/try/android-dawn-arm64-rel -chromium/try/android-dawn-arm64-s24-rel chromium/try/android-desktop-15-x64-rel chromium/try/android-desktop-x64-rel chromium/try/android-official @@ -69,28 +66,6 @@ chromium/try/chromeos-jacuzzi-rel chromium/try/chromeos-libfuzzer-asan-rel chromium/try/chromeos-octopus-rel -chromium/try/dawn-android-arm-deps-rel -chromium/try/dawn-android-arm64-deps-rel -chromium/try/dawn-chromium-presubmit -chromium/try/dawn-linux-x64-deps-rel -chromium/try/dawn-mac-arm64-deps-rel -chromium/try/dawn-mac-x64-deps-rel -chromium/try/dawn-try-linux-tsan-rel -chromium/try/dawn-try-linux-x64-intel-uhd770-rel -chromium/try/dawn-try-mac-amd-exp -chromium/try/dawn-try-mac-arm64-deps-rel -chromium/try/dawn-try-mac-arm64-m2-exp -chromium/try/dawn-try-mac-arm64-rel -chromium/try/dawn-try-mac-intel-exp -chromium/try/dawn-try-win-x64-intel-exp -chromium/try/dawn-try-win-x64-intel-uhd770-rel -chromium/try/dawn-try-win-x64-nvidia-exp -chromium/try/dawn-try-win-x86-intel-exp -chromium/try/dawn-try-win-x86-nvidia-exp -chromium/try/dawn-try-win10-x86-rel -chromium/try/dawn-win10-x64-deps-rel -chromium/try/dawn-win10-x86-deps-rel -chromium/try/dawn-win11-arm64-deps-rel chromium/try/fuchsia-arm64-cast-receiver-rel chromium/try/fuchsia-fyi-arm64-dbg chromium/try/fuchsia-fyi-x64-asan @@ -126,9 +101,6 @@ chromium/try/linux-chromeos-dbg chromium/try/linux-chromeos-rel chromium/try/linux-clobber-rel -chromium/try/linux-dawn-intel-exp-rel -chromium/try/linux-dawn-nvidia-1660-exp-rel -chromium/try/linux-dawn-rel chromium/try/linux-dcheck-off-rel chromium/try/linux-extended-tracing-rel chromium/try/linux-full-remote-rel @@ -160,12 +132,10 @@ chromium/try/linux_chromium_tsan_rel_ng chromium/try/linux_chromium_ubsan_rel_ng chromium/try/mac-arm64-clobber-rel -chromium/try/mac-arm64-dawn-rel chromium/try/mac-arm64-on-arm64-rel chromium/try/mac-asan-media-rel chromium/try/mac-asan-rel chromium/try/mac-clobber-rel -chromium/try/mac-dawn-rel chromium/try/mac-libfuzzer-asan-rel chromium/try/mac-official chromium/try/mac11-arm64-rel @@ -185,11 +155,9 @@ chromium/try/win-asan-media-rel chromium/try/win-asan-rel chromium/try/win-clobber-rel -chromium/try/win-dawn-rel chromium/try/win-libfuzzer-asan-rel chromium/try/win-official chromium/try/win-rel -chromium/try/win11-arm64-dawn-rel chromium/try/win11-rel chromium/try/win32-clobber-rel chromium/try/win32-official
diff --git a/infra/config/lib/builder_exemptions.star b/infra/config/lib/builder_exemptions.star index f49098ac..7418ceb5 100644 --- a/infra/config/lib/builder_exemptions.star +++ b/infra/config/lib/builder_exemptions.star
@@ -1150,10 +1150,14 @@ # CLs on the Chromium-side. So trybots for these aren't as # critical. "chromium.clang", - # Some GPU trybots share the same limited pool of bots, so can't - # handle more than a few builds at a time. Keep them out of the - # mega CQ for now. + # Some GPU and Dawn trybots share the same limited pool of bots, + # so can't handle more than a few builds at a time. + # TODO(crbug.com/413080339): Trigger these trybots on mega CQ only on CLs + # that are likely to affect them, similarly to how optional GPU CQ bots + # like "gpu-fyi-cq-android-arm64" and "dawn-mac-x64-deps-rel" are triggered + # using "location_filters". "chromium.gpu", + "dawn", # "cft" builders are very red. "cft", ]
diff --git a/ios/chrome/app/profile/profile_state_unittest.mm b/ios/chrome/app/profile/profile_state_unittest.mm index 1be346a6..1f3d768 100644 --- a/ios/chrome/app/profile/profile_state_unittest.mm +++ b/ios/chrome/app/profile/profile_state_unittest.mm
@@ -6,7 +6,6 @@ #import <optional> -#import "base/test/task_environment.h" #import "ios/chrome/app/application_delegate/app_state.h" #import "ios/chrome/app/application_delegate/fake_startup_information.h" #import "ios/chrome/app/profile/profile_init_stage.h" @@ -16,6 +15,7 @@ #import "ios/chrome/browser/shared/coordinator/scene/scene_activation_level.h" #import "ios/chrome/browser/shared/coordinator/scene/scene_state.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -51,7 +51,7 @@ // Tests that -profile uses a weak pointer. TEST_F(ProfileStateTest, profile) { - base::test::TaskEnvironment task_environment; + web::WebTaskEnvironment task_environment; std::unique_ptr<TestProfileIOS> profile = TestProfileIOS::Builder().Build(); ProfileState* state = [[ProfileState alloc] initWithAppState:nil];
diff --git a/ios/chrome/app/profile/session_metrics_profile_agent_unittest.mm b/ios/chrome/app/profile/session_metrics_profile_agent_unittest.mm index aa5ee2b2..d60da873 100644 --- a/ios/chrome/app/profile/session_metrics_profile_agent_unittest.mm +++ b/ios/chrome/app/profile/session_metrics_profile_agent_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/app/profile/session_metrics_profile_agent.h" #import "base/functional/bind.h" -#import "base/test/task_environment.h" #import "ios/chrome/app/profile/profile_state.h" #import "ios/chrome/app/profile/profile_state_test_utils.h" #import "ios/chrome/browser/metrics/model/ios_profile_session_durations_service.h" @@ -14,6 +13,7 @@ #import "ios/chrome/browser/shared/coordinator/scene/scene_state.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" namespace { @@ -79,7 +79,7 @@ ProfileState* profile_state() { return profile_state_; } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; std::unique_ptr<TestProfileIOS> profile_; ProfileState* profile_state_;
diff --git a/ios/chrome/app/spotlight/BUILD.gn b/ios/chrome/app/spotlight/BUILD.gn index dfac0eb..46ccd91 100644 --- a/ios/chrome/app/spotlight/BUILD.gn +++ b/ios/chrome/app/spotlight/BUILD.gn
@@ -101,6 +101,7 @@ "//ios/chrome/browser/shared/model/browser/test:test_support", "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/model/web_state_list:web_state_list", + "//ios/web/public/test", "//ios/web/public/test/fakes:fakes", "//net", "//testing/gtest",
diff --git a/ios/chrome/app/spotlight/open_tabs_spotlight_manager_unittest.mm b/ios/chrome/app/spotlight/open_tabs_spotlight_manager_unittest.mm index dc565f0..1fb4fb1 100644 --- a/ios/chrome/app/spotlight/open_tabs_spotlight_manager_unittest.mm +++ b/ios/chrome/app/spotlight/open_tabs_spotlight_manager_unittest.mm
@@ -8,7 +8,6 @@ #import "base/containers/span.h" #import "base/memory/raw_ptr.h" #import "base/test/ios/wait_util.h" -#import "base/test/task_environment.h" #import "components/favicon/core/large_icon_service_impl.h" #import "components/favicon/core/test/mock_favicon_service.h" #import "ios/chrome/app/spotlight/fake_searchable_item_factory.h" @@ -23,6 +22,7 @@ #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/skia/include/core/SkBitmap.h" #import "ui/base/test/ios/ui_image_test_utils.h" @@ -138,7 +138,7 @@ }); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> test_profile_; FakeSearchableItemFactory* searchableItemFactory_; testing::StrictMock<favicon::MockFaviconService> mock_favicon_service_;
diff --git a/ios/chrome/app/spotlight/reading_list_spotlight_manager_unittest.mm b/ios/chrome/app/spotlight/reading_list_spotlight_manager_unittest.mm index 5ecaa103..91254ea 100644 --- a/ios/chrome/app/spotlight/reading_list_spotlight_manager_unittest.mm +++ b/ios/chrome/app/spotlight/reading_list_spotlight_manager_unittest.mm
@@ -13,7 +13,6 @@ #import "base/task/sequenced_task_runner.h" #import "base/task/single_thread_task_runner.h" #import "base/test/ios/wait_util.h" -#import "base/test/task_environment.h" #import "components/favicon/core/large_icon_service_impl.h" #import "components/favicon/core/test/mock_favicon_service.h" #import "components/reading_list/core/reading_list_model.h" @@ -24,6 +23,7 @@ #import "ios/chrome/browser/reading_list/model/reading_list_model_factory.h" #import "ios/chrome/browser/reading_list/model/reading_list_test_utils.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "net/base/apple/url_conversions.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" @@ -113,7 +113,7 @@ }); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; testing::StrictMock<favicon::MockFaviconService> mock_favicon_service_; std::unique_ptr<favicon::LargeIconServiceImpl> large_icon_service_;
diff --git a/ios/chrome/browser/account_picker/ui_bundled/BUILD.gn b/ios/chrome/browser/account_picker/ui_bundled/BUILD.gn index 173e333..4fbfd62 100644 --- a/ios/chrome/browser/account_picker/ui_bundled/BUILD.gn +++ b/ios/chrome/browser/account_picker/ui_bundled/BUILD.gn
@@ -72,6 +72,7 @@ "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/test:test_support", "//ios/chrome/test/fakes", + "//ios/web/public/test", "//testing/gtest", "//third_party/ocmock:ocmock", ]
diff --git a/ios/chrome/browser/account_picker/ui_bundled/account_picker_coordinator_unittest.mm b/ios/chrome/browser/account_picker/ui_bundled/account_picker_coordinator_unittest.mm index 76005bb..aaa42ca 100644 --- a/ios/chrome/browser/account_picker/ui_bundled/account_picker_coordinator_unittest.mm +++ b/ios/chrome/browser/account_picker/ui_bundled/account_picker_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_coordinator.h" #import "base/apple/foundation_util.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_configuration.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_confirmation/account_picker_confirmation_screen_coordinator.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_confirmation/account_picker_confirmation_screen_coordinator_delegate.h" @@ -15,6 +14,7 @@ #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/fakes/fake_ui_view_controller.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -51,7 +51,7 @@ return configuration; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; UIViewController* base_view_controller_;
diff --git a/ios/chrome/browser/app_launcher/model/app_launcher_tab_helper_unittest.mm b/ios/chrome/browser/app_launcher/model/app_launcher_tab_helper_unittest.mm index 6021b7df..04fe4450 100644 --- a/ios/chrome/browser/app_launcher/model/app_launcher_tab_helper_unittest.mm +++ b/ios/chrome/browser/app_launcher/model/app_launcher_tab_helper_unittest.mm
@@ -13,7 +13,6 @@ #import "base/memory/raw_ptr.h" #import "base/memory/scoped_refptr.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "base/time/default_clock.h" #import "components/policy/policy_constants.h" #import "components/reading_list/core/reading_list_entry.h" @@ -32,6 +31,7 @@ #import "ios/web/common/features.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -260,7 +260,7 @@ return entry->IsRead() == expected_read_status; } - base::test::TaskEnvironment task_environment; + web::WebTaskEnvironment task_environment; std::unique_ptr<TestProfileIOS> profile_; web::FakeWebState web_state_; bool incognito_ = false;
diff --git a/ios/chrome/browser/authentication/ui_bundled/signin/account_menu/account_menu_egtest.mm b/ios/chrome/browser/authentication/ui_bundled/signin/account_menu/account_menu_egtest.mm index 42dc7814..d08dc402 100644 --- a/ios/chrome/browser/authentication/ui_bundled/signin/account_menu/account_menu_egtest.mm +++ b/ios/chrome/browser/authentication/ui_bundled/signin/account_menu/account_menu_egtest.mm
@@ -351,17 +351,22 @@ // Tests that the sign out button actually signs out and the account menu view // is closed, from a managed account. - (void)testSignOutFromManaged { - [SigninEarlGrey signinWithFakeIdentity:kManagedIdentity1]; + [SigninEarlGrey + signinWithFakeManagedIdentityInPersonalProfile:kManagedIdentity1]; [self selectIdentityDisc]; [[EarlGrey selectElementWithMatcher:grey_accessibilityID( kAccountMenuSignoutButtonId)] performAction:grey_tap()]; - [[EarlGrey - selectElementWithMatcher: - grey_allOf(chrome_test_util::AlertAction(l10n_util::GetNSString( - IDS_IOS_SIGNOUT_AND_DELETE_DIALOG_SIGN_OUT_BUTTON)), - grey_sufficientlyVisible(), nil)] - performAction:grey_tap()]; + // Confirm "Delete and Signout" alert dialog that data will be cleared is + // shown. This dialog is only shown when multi profiles are not available. + if (![SigninEarlGrey areSeparateProfilesForManagedAccountsEnabled]) { + [[EarlGrey + selectElementWithMatcher: + grey_allOf(chrome_test_util::AlertAction(l10n_util::GetNSString( + IDS_IOS_SIGNOUT_AND_DELETE_DIALOG_SIGN_OUT_BUTTON)), + grey_sufficientlyVisible(), nil)] + performAction:grey_tap()]; + } [SigninEarlGrey verifySignedOut]; [self assertAccountMenuIsNotShown]; } @@ -443,12 +448,8 @@ // Tests that tapping on an account button causes the managed account to sign // out with a sign-out confirmation dialog. - (void)testSwitchFromManagedAccount { - if ([SigninEarlGrey areSeparateProfilesForManagedAccountsEnabled]) { - [SigninEarlGrey - signinWithFakeManagedIdentityInPersonalProfile:kManagedIdentity1]; - } else { - [SigninEarlGrey signinWithFakeIdentity:kManagedIdentity1]; - } + [SigninEarlGrey + signinWithFakeManagedIdentityInPersonalProfile:kManagedIdentity1]; [ChromeEarlGreyUI waitForAppToIdle]; [SigninEarlGrey addFakeIdentity:kPrimaryIdentity]; [self selectIdentityDisc]; @@ -499,12 +500,8 @@ } - (void)testSwitchFromManagedAccountToManagedAccount { - if ([SigninEarlGrey areSeparateProfilesForManagedAccountsEnabled]) { - [SigninEarlGrey - signinWithFakeManagedIdentityInPersonalProfile:kManagedIdentity1]; - } else { - [SigninEarlGrey signinWithFakeIdentity:kManagedIdentity1]; - } + [SigninEarlGrey + signinWithFakeManagedIdentityInPersonalProfile:kManagedIdentity1]; [ChromeEarlGreyUI waitForAppToIdle]; [SigninEarlGrey addFakeIdentity:kManagedIdentity2]; [self selectIdentityDisc];
diff --git a/ios/chrome/browser/authentication/ui_bundled/signin/account_menu/account_menu_view_controller.mm b/ios/chrome/browser/authentication/ui_bundled/signin/account_menu/account_menu_view_controller.mm index ab0c99f50..0d83855f 100644 --- a/ios/chrome/browser/authentication/ui_bundled/signin/account_menu/account_menu_view_controller.mm +++ b/ios/chrome/browser/authentication/ui_bundled/signin/account_menu/account_menu_view_controller.mm
@@ -264,8 +264,9 @@ weight:UIImageSymbolWeightRegular scale:UIImageSymbolScaleMedium]; // Stop button - UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom]; - if (idiom != UIUserInterfaceIdiomPad) { + if (self.traitCollection.horizontalSizeClass == + UIUserInterfaceSizeClassCompact || + self.navigationController.sheetPresentationController) { _closeButton = [self addTopButtonWithSymbolName:kXMarkCircleFillSymbol symbolConfiguration:symbolConfiguration isLeading:NO @@ -446,16 +447,22 @@ presentationController.prefersEdgeAttachedInCompactHeight = YES; presentationController.widthFollowsPreferredContentSizeWhenEdgeAttached = YES; presentationController.preferredCornerRadius = kHalfSheetCornerRadius; - __weak __typeof(self) weakSelf = self; - auto preferredHeightForSheetContent = ^CGFloat( - id<UISheetPresentationControllerDetentResolutionContext> context) { - return [weakSelf preferredHeightForSheetContent]; - }; - UISheetPresentationControllerDetent* customDetent = - [UISheetPresentationControllerDetent - customDetentWithIdentifier:kCustomMinimizedDetentIdentifier - resolver:preferredHeightForSheetContent]; - presentationController.detents = @[ customDetent ]; + + // In case of compact width only, adjust detents. + if (self.traitCollection.horizontalSizeClass == + UIUserInterfaceSizeClassCompact) { + __weak __typeof(self) weakSelf = self; + auto preferredHeightForSheetContent = ^CGFloat( + id<UISheetPresentationControllerDetentResolutionContext> context) { + return [weakSelf preferredHeightForSheetContent]; + }; + UISheetPresentationControllerDetent* customDetent = + [UISheetPresentationControllerDetent + customDetentWithIdentifier:kCustomMinimizedDetentIdentifier + resolver:preferredHeightForSheetContent]; + presentationController.detents = @[ customDetent ]; + } + presentationController.selectedDetentIdentifier = kCustomMinimizedDetentIdentifier; } @@ -527,8 +534,11 @@ [_accountMenuDataSource applySnapshot:snapshot animatingDifferences:YES]; } -// Returns the sheet presentation controller if it exists. +// Returns the sheet presentation controller of the used presentation style. - (UISheetPresentationController*)sheetPresentationController { + if (self.navigationController.sheetPresentationController) { + return self.navigationController.sheetPresentationController; + } return self.navigationController.popoverPresentationController .adaptiveSheetPresentationController; }
diff --git a/ios/chrome/browser/authentication/ui_bundled/signin/fullscreen_signin/test/forced_signin_egtest.mm b/ios/chrome/browser/authentication/ui_bundled/signin/fullscreen_signin/test/forced_signin_egtest.mm index 322fddf..ad0b14b 100644 --- a/ios/chrome/browser/authentication/ui_bundled/signin/fullscreen_signin/test/forced_signin_egtest.mm +++ b/ios/chrome/browser/authentication/ui_bundled/signin/fullscreen_signin/test/forced_signin_egtest.mm
@@ -848,11 +848,6 @@ EARL_GREY_TEST_DISABLED(@"Multiple windows can't be opened."); } - // TODO(crbug.com/40868899): Test is failing on iPad devices and simulator. - if ([ChromeEarlGrey isIPadIdiom]) { - EARL_GREY_TEST_DISABLED(@"Test disabled on iPad."); - } - // Restart the app to reset the policies. [self restartAppWithoutEnterprisePolicy];
diff --git a/ios/chrome/browser/authentication/ui_bundled/signin/reauth/BUILD.gn b/ios/chrome/browser/authentication/ui_bundled/signin/reauth/BUILD.gn index 1b75372..0e8a850 100644 --- a/ios/chrome/browser/authentication/ui_bundled/signin/reauth/BUILD.gn +++ b/ios/chrome/browser/authentication/ui_bundled/signin/reauth/BUILD.gn
@@ -41,6 +41,7 @@ "//ios/chrome/browser/signin/model:test_support", "//ios/chrome/test:test_support", "//ios/web/common:uikit", + "//ios/web/public/test", "//testing/gtest", "//third_party/ocmock", ]
diff --git a/ios/chrome/browser/authentication/ui_bundled/signin/reauth/reauth_coordinator_unittest.mm b/ios/chrome/browser/authentication/ui_bundled/signin/reauth/reauth_coordinator_unittest.mm index 5bfe4c7..ec430f22 100644 --- a/ios/chrome/browser/authentication/ui_bundled/signin/reauth/reauth_coordinator_unittest.mm +++ b/ios/chrome/browser/authentication/ui_bundled/signin/reauth/reauth_coordinator_unittest.mm
@@ -12,7 +12,6 @@ #import "base/functional/callback_forward.h" #import "base/strings/sys_string_conversions.h" #import "base/test/bind.h" -#import "base/test/task_environment.h" #import "components/signin/public/identity_manager/account_info.h" #import "components/signin/public/identity_manager/identity_test_utils.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h" @@ -25,6 +24,7 @@ #import "ios/chrome/browser/signin/model/identity_test_environment_browser_state_adaptor.h" #import "ios/chrome/browser/signin/model/system_identity_interaction_manager.h" #import "ios/web/common/uikit_ui_util.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/gtest_support.h" @@ -102,7 +102,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; OCMockObject<SystemIdentityInteractionManager>* mock_interaction_manager_ =
diff --git a/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/BUILD.gn b/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/BUILD.gn index b020e3b..c0395c70 100644 --- a/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/BUILD.gn +++ b/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/BUILD.gn
@@ -67,6 +67,7 @@ "//ios/chrome/browser/sync/model", "//ios/chrome/browser/sync/model:test_support", "//ios/chrome/test:test_support", + "//ios/web/public/test", "//third_party/ocmock", "//ui/strings", ]
diff --git a/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/signout_action_sheet_coordinator_unittest.mm b/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/signout_action_sheet_coordinator_unittest.mm index 5d6262e..31294647e 100644 --- a/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/signout_action_sheet_coordinator_unittest.mm +++ b/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/signout_action_sheet_coordinator_unittest.mm
@@ -12,7 +12,6 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/mock_callback.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/prefs/pref_service.h" #import "components/signin/public/base/signin_metrics.h" #import "components/signin/public/base/signin_pref_names.h" @@ -39,6 +38,7 @@ #import "ios/chrome/browser/sync/model/sync_service_factory.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/gtest_support.h" @@ -169,7 +169,7 @@ protected: // Needed for test profile created by TestProfileIOS(). - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_;
diff --git a/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/signout_action_sheet_egtest.mm b/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/signout_action_sheet_egtest.mm index 4804041..a13d348 100644 --- a/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/signout_action_sheet_egtest.mm +++ b/ios/chrome/browser/authentication/ui_bundled/signout_action_sheet/signout_action_sheet_egtest.mm
@@ -249,12 +249,8 @@ // Sign in with managed account. FakeSystemIdentity* fakeManagedIdentity = [FakeSystemIdentity fakeManagedIdentity]; - if ([SigninEarlGrey areSeparateProfilesForManagedAccountsEnabled]) { - [SigninEarlGrey - signinWithFakeManagedIdentityInPersonalProfile:fakeManagedIdentity]; - } else { - [SigninEarlGrey signinWithFakeIdentity:fakeManagedIdentity]; - } + [SigninEarlGrey + signinWithFakeManagedIdentityInPersonalProfile:fakeManagedIdentity]; // The sign out button should directly sign out the user. ClickSignOutInAccountSettings();
diff --git a/ios/chrome/browser/autocomplete/model/BUILD.gn b/ios/chrome/browser/autocomplete/model/BUILD.gn index d26fcd5..fb56c05 100644 --- a/ios/chrome/browser/autocomplete/model/BUILD.gn +++ b/ios/chrome/browser/autocomplete/model/BUILD.gn
@@ -71,6 +71,7 @@ ":model", "//base/test:test_support", "//ios/chrome/browser/shared/model/profile/test", + "//ios/web/public/test", "//testing/gtest", ] }
diff --git a/ios/chrome/browser/autocomplete/model/remote_suggestions_service_factory_unittest.mm b/ios/chrome/browser/autocomplete/model/remote_suggestions_service_factory_unittest.mm index c206793..5286cbd5 100644 --- a/ios/chrome/browser/autocomplete/model/remote_suggestions_service_factory_unittest.mm +++ b/ios/chrome/browser/autocomplete/model/remote_suggestions_service_factory_unittest.mm
@@ -4,8 +4,8 @@ #import "ios/chrome/browser/autocomplete/model/remote_suggestions_service_factory.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" class RemoteSuggestionsServiceFactoryTest : public PlatformTest { @@ -13,7 +13,7 @@ RemoteSuggestionsServiceFactoryTest() : profile_(TestProfileIOS::Builder().Build()) {} - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; };
diff --git a/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_coordinator.mm b/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_coordinator.mm index 69277f98..3c0ac977 100644 --- a/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_coordinator.mm +++ b/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_coordinator.mm
@@ -415,6 +415,14 @@ [self reset]; } +- (void)dismissPopover { + if (IsKeyboardAccessoryUpgradeEnabled() && + ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET) { + // Close the popover view. + [self stopChildren]; + } +} + - (void)notifyAutofillSuggestionWithIPHSelectedFor: (SuggestionFeatureForIPH)featureForIPH { // The engagement tracker can change during testing (in feature engagement app
diff --git a/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_mediator.mm b/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_mediator.mm index 919d3e4..e6cb2cd 100644 --- a/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_mediator.mm +++ b/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_mediator.mm
@@ -854,6 +854,9 @@ provider:formSuggestion.provider]; } + // Close the popover view. + [self.handler dismissPopover]; + [self logReauthenticationEvent:ReauthenticationEvent::kAttempt forSuggestion:formSuggestion];
diff --git a/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_mediator_handler.h b/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_mediator_handler.h index a641039..f7e8e11 100644 --- a/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_mediator_handler.h +++ b/ios/chrome/browser/autofill/ui_bundled/form_input_accessory/form_input_accessory_mediator_handler.h
@@ -19,6 +19,9 @@ // The mediator detected that the keyboard input view should be reset. - (void)resetFormInputView; +// Dismisses the popover (tablet only). +- (void)dismissPopover; + // The mediator shows autofill suggestion tip if needed. - (void)showAutofillSuggestionIPHIfNeededFor: (SuggestionFeatureForIPH)featureForIPH;
diff --git a/ios/chrome/browser/autofill/ui_bundled/manual_fill/password_view_controller_egtest.mm b/ios/chrome/browser/autofill/ui_bundled/manual_fill/password_view_controller_egtest.mm index 7564217d..3834e86 100644 --- a/ios/chrome/browser/autofill/ui_bundled/manual_fill/password_view_controller_egtest.mm +++ b/ios/chrome/browser/autofill/ui_bundled/manual_fill/password_view_controller_egtest.mm
@@ -774,15 +774,7 @@ // Tests that the Password View Controller is dismissed when tapping the outside // the popover on iPad. -// TODO(crbug.com/412722420): Test is flaky on simulator. -#if TARGET_OS_SIMULATOR -#define MAYBE_testIPadTappingOutsidePopOverDismissPasswordController \ - FLAKY_testIPadTappingOutsidePopOverDismissPasswordController -#else -#define MAYBE_testIPadTappingOutsidePopOverDismissPasswordController \ - testIPadTappingOutsidePopOverDismissPasswordController -#endif -- (void)MAYBE_testIPadTappingOutsidePopOverDismissPasswordController { +- (void)testIPadTappingOutsidePopOverDismissPasswordController { if (![ChromeEarlGrey isIPadIdiom]) { return; }
diff --git a/ios/chrome/browser/badges/ui_bundled/BUILD.gn b/ios/chrome/browser/badges/ui_bundled/BUILD.gn index 6d0a48ca..1c49692 100644 --- a/ios/chrome/browser/badges/ui_bundled/BUILD.gn +++ b/ios/chrome/browser/badges/ui_bundled/BUILD.gn
@@ -105,6 +105,7 @@ "//ios/chrome/browser/shared/model/browser/test:test_support", "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/model/web_state_list", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", ]
diff --git a/ios/chrome/browser/badges/ui_bundled/badge_mediator_unittest.mm b/ios/chrome/browser/badges/ui_bundled/badge_mediator_unittest.mm index b6ca460..10f39ae 100644 --- a/ios/chrome/browser/badges/ui_bundled/badge_mediator_unittest.mm +++ b/ios/chrome/browser/badges/ui_bundled/badge_mediator_unittest.mm
@@ -9,7 +9,6 @@ #import "base/containers/contains.h" #import "base/memory/raw_ptr.h" #import "base/strings/utf_string_conversions.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/badges/ui_bundled/badge_consumer.h" #import "ios/chrome/browser/badges/ui_bundled/badge_item.h" #import "ios/chrome/browser/badges/ui_bundled/badge_type.h" @@ -32,6 +31,7 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/web_state_user_data.h" #import "testing/gtest/include/gtest/gtest.h" @@ -149,7 +149,7 @@ return InfobarBadgeTabHelper::GetOrCreateForWebState(web_state()); } - base::test::TaskEnvironment environment_; + web::WebTaskEnvironment environment_; FakeBadgeConsumer* badge_consumer_; std::unique_ptr<ProfileIOS> profile_; std::unique_ptr<Browser> browser_;
diff --git a/ios/chrome/browser/banner_promo/model/BUILD.gn b/ios/chrome/browser/banner_promo/model/BUILD.gn index 71655a1f..d4d57d2 100644 --- a/ios/chrome/browser/banner_promo/model/BUILD.gn +++ b/ios/chrome/browser/banner_promo/model/BUILD.gn
@@ -51,6 +51,7 @@ "//ios/chrome/browser/shared/public/features", "//ios/chrome/test:test_support", "//ios/web/public", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", ]
diff --git a/ios/chrome/browser/banner_promo/model/default_browser_banner_promo_app_agent_unittest.mm b/ios/chrome/browser/banner_promo/model/default_browser_banner_promo_app_agent_unittest.mm index 2940479..60a4557 100644 --- a/ios/chrome/browser/banner_promo/model/default_browser_banner_promo_app_agent_unittest.mm +++ b/ios/chrome/browser/banner_promo/model/default_browser_banner_promo_app_agent_unittest.mm
@@ -6,7 +6,6 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/feature_engagement/public/feature_constants.h" #import "components/feature_engagement/test/mock_tracker.h" #import "components/google/core/common/google_util.h" @@ -25,6 +24,7 @@ #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/web_state.h" #import "testing/platform_test.h" @@ -116,7 +116,7 @@ return scene_state; } - base::test::TaskEnvironment task_env_; + web::WebTaskEnvironment task_env_; base::test::ScopedFeatureList scoped_feature_list_{ kDefaultBrowserBannerPromo};
diff --git a/ios/chrome/browser/browser_container/ui_bundled/browser_container_coordinator_unittest.mm b/ios/chrome/browser/browser_container/ui_bundled/browser_container_coordinator_unittest.mm index cf5d7551..dfa76f7 100644 --- a/ios/chrome/browser/browser_container/ui_bundled/browser_container_coordinator_unittest.mm +++ b/ios/chrome/browser/browser_container/ui_bundled/browser_container_coordinator_unittest.mm
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> #import "base/apple/foundation_util.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/browser_container/ui_bundled/browser_container_view_controller.h" #import "ios/chrome/browser/browser_container/ui_bundled/edit_menu_alert_delegate.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" @@ -19,6 +18,7 @@ #import "ios/chrome/browser/shared/public/commands/settings_commands.h" #import "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -65,7 +65,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; id mocked_activity_service_handler_;
diff --git a/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate.mm b/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate.mm index ec6a784..19c6c3a8f 100644 --- a/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate.mm +++ b/ios/chrome/browser/collaboration/model/ios_collaboration_controller_delegate.mm
@@ -81,7 +81,7 @@ const CGFloat kScrimOpacity = 0.3; // Maximum delay to return preview items. -constexpr base::TimeDelta kFetchPreviewItemsTimeDelay = base::Seconds(15); +constexpr base::TimeDelta kFetchPreviewItemsTimeDelay = base::Seconds(5); } // namespace
diff --git a/ios/chrome/browser/content_notification/model/BUILD.gn b/ios/chrome/browser/content_notification/model/BUILD.gn index c11c8b35..020eb75 100644 --- a/ios/chrome/browser/content_notification/model/BUILD.gn +++ b/ios/chrome/browser/content_notification/model/BUILD.gn
@@ -129,6 +129,7 @@ "//ios/chrome/browser/shared/public/commands", "//ios/chrome/test:test_support", "//ios/testing:block_swizzler", + "//ios/web/public/test", "//third_party/ocmock", ] }
diff --git a/ios/chrome/browser/content_notification/model/content_notification_client_unittest.mm b/ios/chrome/browser/content_notification/model/content_notification_client_unittest.mm index 726e8d8..6653a45 100644 --- a/ios/chrome/browser/content_notification/model/content_notification_client_unittest.mm +++ b/ios/chrome/browser/content_notification/model/content_notification_client_unittest.mm
@@ -7,7 +7,6 @@ #import <UserNotifications/UserNotifications.h> #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "base/threading/thread_restrictions.h" #import "components/prefs/scoped_user_pref_update.h" #import "ios/chrome/browser/default_browser/model/promo_source.h" @@ -28,6 +27,7 @@ #import "ios/chrome/browser/shared/public/commands/settings_commands.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/testing/scoped_block_swizzler.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -79,7 +79,7 @@ return request; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; TestProfileManagerIOS profile_manager_; id mock_scene_state_;
diff --git a/ios/chrome/browser/content_notification/model/content_notification_service_factory_unittest.mm b/ios/chrome/browser/content_notification/model/content_notification_service_factory_unittest.mm index f87c8a62..8092d81 100644 --- a/ios/chrome/browser/content_notification/model/content_notification_service_factory_unittest.mm +++ b/ios/chrome/browser/content_notification/model/content_notification_service_factory_unittest.mm
@@ -4,8 +4,8 @@ #import "ios/chrome/browser/content_notification/model/content_notification_service_factory.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -19,7 +19,7 @@ ProfileIOS* otr_profile() { return profile_->GetOffTheRecordProfile(); } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; };
diff --git a/ios/chrome/browser/content_suggestions/ui_bundled/ntp_home_constant.h b/ios/chrome/browser/content_suggestions/ui_bundled/ntp_home_constant.h index 6fc3902..810c39d 100644 --- a/ios/chrome/browser/content_suggestions/ui_bundled/ntp_home_constant.h +++ b/ios/chrome/browser/content_suggestions/ui_bundled/ntp_home_constant.h
@@ -44,6 +44,9 @@ extern const CGFloat kSignedOutIdentityIconSize; // Dimension of the customization menu button's icon. extern const CGFloat kCustomizationMenuIconSize; +// Customization Menu icon size used when the sign-in button is shown without an +// avatar. +extern const CGFloat kCustomizationMenuIconSizeWhenSignInButtonHasNoAvatar; // Dimension of the customization menu button. extern const CGFloat kCustomizationMenuButtonDimension; // The corner radius of the customization menu button.
diff --git a/ios/chrome/browser/content_suggestions/ui_bundled/ntp_home_constant.mm b/ios/chrome/browser/content_suggestions/ui_bundled/ntp_home_constant.mm index e722885..d95dee9 100644 --- a/ios/chrome/browser/content_suggestions/ui_bundled/ntp_home_constant.mm +++ b/ios/chrome/browser/content_suggestions/ui_bundled/ntp_home_constant.mm
@@ -28,6 +28,7 @@ const CGFloat kIdentityAvatarPadding = 8; const CGFloat kSignedOutIdentityIconSize = 24; const CGFloat kCustomizationMenuIconSize = 16; +const CGFloat kCustomizationMenuIconSizeWhenSignInButtonHasNoAvatar = 17; const CGFloat kCustomizationMenuButtonDimension = 37; const CGFloat kCustomizationMenuButtonCornerRadius = 11;
diff --git a/ios/chrome/browser/content_suggestions/ui_bundled/set_up_list/set_up_list_default_browser_promo_coordinator_unittest.mm b/ios/chrome/browser/content_suggestions/ui_bundled/set_up_list/set_up_list_default_browser_promo_coordinator_unittest.mm index 73d9f0c..cc98f87f 100644 --- a/ios/chrome/browser/content_suggestions/ui_bundled/set_up_list/set_up_list_default_browser_promo_coordinator_unittest.mm +++ b/ios/chrome/browser/content_suggestions/ui_bundled/set_up_list/set_up_list_default_browser_promo_coordinator_unittest.mm
@@ -9,7 +9,6 @@ #import "base/test/ios/wait_util.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/metrics/user_action_tester.h" -#import "base/test/task_environment.h" #import "components/prefs/pref_change_registrar.h" #import "ios/chrome/browser/content_suggestions/ui_bundled/set_up_list/set_up_list_default_browser_promo_coordinator_delegate.h" #import "ios/chrome/browser/default_browser/model/utils.h" @@ -19,6 +18,7 @@ #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -64,7 +64,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_;
diff --git a/ios/chrome/browser/context_menu/ui_bundled/BUILD.gn b/ios/chrome/browser/context_menu/ui_bundled/BUILD.gn index 66ff9517..b04f900 100644 --- a/ios/chrome/browser/context_menu/ui_bundled/BUILD.gn +++ b/ios/chrome/browser/context_menu/ui_bundled/BUILD.gn
@@ -120,6 +120,7 @@ "//ios/chrome/test:test_support", "//ios/web/common", "//ios/web/public", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//net", "//testing/gtest",
diff --git a/ios/chrome/browser/context_menu/ui_bundled/context_menu_configuration_provider_unittest.mm b/ios/chrome/browser/context_menu/ui_bundled/context_menu_configuration_provider_unittest.mm index f2e7d65..8f8ffa7 100644 --- a/ios/chrome/browser/context_menu/ui_bundled/context_menu_configuration_provider_unittest.mm +++ b/ios/chrome/browser/context_menu/ui_bundled/context_menu_configuration_provider_unittest.mm
@@ -8,7 +8,6 @@ #import "base/ios/ios_util.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/optimization_guide/core/optimization_guide_enums.h" #import "components/policy/core/common/policy_pref_names.h" #import "components/prefs/testing_pref_service.h" @@ -38,6 +37,7 @@ #import "ios/chrome/browser/signin/model/identity_test_environment_browser_state_adaptor.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/ui/context_menu_params.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -175,7 +175,7 @@ } IOSChromeScopedTestingLocalState scoped_testing_local_state_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; UIViewController* base_view_controller_;
diff --git a/ios/chrome/browser/context_menu/ui_bundled/context_menu_egtest.mm b/ios/chrome/browser/context_menu/ui_bundled/context_menu_egtest.mm index 4956e0d..b93a71b 100644 --- a/ios/chrome/browser/context_menu/ui_bundled/context_menu_egtest.mm +++ b/ios/chrome/browser/context_menu/ui_bundled/context_menu_egtest.mm
@@ -92,6 +92,14 @@ // The text of the long link to the destination page. const char kInitialPageDestinationLongLinkText[] = "LongLink"; +// ElementSelector for long press action. +ElementSelector* kLogoPageChromiumImageIdSelector = + [ElementSelector selectorWithElementID:kLogoPageChromiumImageId]; +ElementSelector* kInitialPageDestinationLinkIdSelector = + [ElementSelector selectorWithElementID:kInitialPageDestinationLinkId]; +ElementSelector* kInitialPageDestinationLongLinkIDSelector = + [ElementSelector selectorWithElementID:kInitialPageDestinationLongLinkID]; + // URL to a page with a link with a javascript: scheme. const char kJavaScriptPageUrl[] = "/scenarionContextMenuJavaScript"; // HTML content of a page with a javascript link. @@ -257,14 +265,6 @@ return std::move(http_response); } -// Long presses on `element_id` to trigger context menu. -void LongPressElement(const char* element_id) { - [[EarlGrey selectElementWithMatcher:WebViewMatcher()] - performAction:chrome_test_util::LongPressElementForContextMenu( - [ElementSelector selectorWithElementID:element_id], - true /* menu should appear */)]; -} - // Taps on the web view to dismiss the context menu without using anything on // it. void ClearContextMenu() { @@ -338,7 +338,8 @@ [ChromeEarlGrey loadURL:pageURL]; [ChromeEarlGrey waitForWebStateContainingText:kLogoPageText]; - LongPressElement(kLogoPageChromiumImageId); + [ChromeEarlGreyUI longPressElementOnWebView:kLogoPageChromiumImageIdSelector]; + TapOnContextMenuButton(OpenImageButton()); [ChromeEarlGrey waitForPageToFinishLoading]; @@ -355,7 +356,8 @@ [ChromeEarlGrey loadURL:pageURL]; [ChromeEarlGrey waitForWebStateContainingText:kLogoPageText]; - LongPressElement(kLogoPageChromiumImageId); + [ChromeEarlGreyUI longPressElementOnWebView:kLogoPageChromiumImageIdSelector]; + TapOnContextMenuButton(OpenImageInNewTabButton()); [ChromeEarlGrey waitForMainTabCount:2]; @@ -380,7 +382,9 @@ waitForWebStateContainingText:kInitialPageDestinationLinkText]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; + TapOnContextMenuButton(OpenLinkInNewTabButton()); [ChromeEarlGrey waitForMainTabCount:2]; @@ -432,12 +436,15 @@ [ChromeEarlGrey waitForPageToFinishLoading]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kLogoPageChromiumImageId); + [ChromeEarlGreyUI longPressElementOnWebView:kLogoPageChromiumImageIdSelector]; + [[EarlGrey selectElementWithMatcher:grey_text(kShortImgTitle)] assertWithMatcher:grey_notNil()]; ClearContextMenu(); - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; + // Links get prefixed with the hostname, so check for partial text match [[EarlGrey selectElementWithMatcher:chrome_test_util::ContainsPartialText( kShortLinkHref)] @@ -449,12 +456,14 @@ [ChromeEarlGrey waitForPageToFinishLoading]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kLogoPageChromiumImageId); + [ChromeEarlGreyUI longPressElementOnWebView:kLogoPageChromiumImageIdSelector]; + [[EarlGrey selectElementWithMatcher:grey_text(kLongImgTitle)] assertWithMatcher:grey_notNil()]; ClearContextMenu(); - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; // But expect that some of the link is visible in the title. NSString* startOfTitle = [kLongLinkHref substringToIndex:30]; @@ -469,7 +478,8 @@ [ChromeEarlGrey loadURL:pageURL]; [ChromeEarlGrey waitForWebStateContainingText:kLogoPageText]; - LongPressElement(kLogoPageChromiumImageId); + [ChromeEarlGreyUI longPressElementOnWebView:kLogoPageChromiumImageIdSelector]; + TapOnContextMenuButton(OpenImageButton()); [ChromeEarlGrey waitForPageToFinishLoading]; @@ -489,7 +499,10 @@ [ChromeEarlGrey waitForWebStateContainingText:kDestinationPageText]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kDestinationPageTextId); + [ChromeEarlGreyUI + longPressElementOnWebView: + [ElementSelector selectorWithElementID:kDestinationPageTextId]]; + // TODO(crbug.com/40191349): Xcode 13 gesture recognizers seem to get stuck // when the user longs presses on plain text. For this test, disable EG // synchronization. @@ -520,7 +533,8 @@ // Display the context menu twice. for (NSInteger i = 0; i < 2; i++) { - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; // Make sure the context menu appeared. [[EarlGrey selectElementWithMatcher:OpenLinkInNewTabButton()] @@ -549,7 +563,8 @@ } // Display the context menu one last time. - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; // Make sure the context menu appeared. [[EarlGrey selectElementWithMatcher:OpenLinkInNewTabButton()] @@ -564,7 +579,8 @@ waitForWebStateContainingText:kInitialPageDestinationLinkText]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; // Check the different buttons. [[EarlGrey @@ -616,7 +632,8 @@ [ChromeEarlGrey waitForWebStateZoomScale:1.0]; // Display the context menu. - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; // Open link in new window. [[EarlGrey @@ -648,7 +665,8 @@ [ChromeEarlGrey waitForWebStateZoomScale:1.0]; // Display the context menu. - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; // Open link in new window. [[EarlGrey @@ -671,7 +689,8 @@ const GURL initialURL = self.testServer->GetURL(kJavaScriptPageUrl); [ChromeEarlGrey loadURL:initialURL]; - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; // Check the different buttons. [[EarlGrey selectElementWithMatcher:ContextMenuItemWithAccessibilityLabelId( @@ -689,7 +708,8 @@ const GURL initialURL = self.testServer->GetURL(kMagnetPageUrl); [ChromeEarlGrey loadURL:initialURL]; - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; // Check the different buttons. [[EarlGrey selectElementWithMatcher:ContextMenuItemWithAccessibilityLabelId( @@ -708,7 +728,9 @@ waitForWebStateContainingText:kInitialPageDestinationLinkText]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; + TapOnContextMenuButton(OpenLinkInNewTabButton()); [ChromeEarlGrey waitForMainTabCount:2]; @@ -750,7 +772,9 @@ waitForWebStateContainingText:kInitialPageDestinationLinkText]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; + TapOnContextMenuButton(OpenLinkInNewGroupButton()); [ChromeEarlGrey waitForMainTabCount:2]; @@ -772,7 +796,9 @@ [ChromeEarlGrey waitForWebStateContainingText:kInitialPageDestinationLinkText]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; + TapOnContextMenuButton(OpenLinkInGroupButton()); TapOnContextMenuButton(OpenLinkInOneTabGroupButton()); @@ -800,7 +826,8 @@ waitForWebStateContainingText:kInitialPageDestinationLinkText]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kInitialPageDestinationLinkId); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLinkIdSelector]; [ChromeEarlGrey verifyShareActionWithURL:pageURL pageTitle:pageTitle]; @@ -828,7 +855,8 @@ waitForWebStateContainingText:kInitialPageDestinationLongLinkText]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kInitialPageDestinationLongLinkID); + [ChromeEarlGreyUI + longPressElementOnWebView:kInitialPageDestinationLongLinkIDSelector]; std::u16string formattedURL = url_formatter::FormatUrl(longURL); NSString* stringURL = base::SysUTF16ToNSString(formattedURL); @@ -859,7 +887,8 @@ [ChromeEarlGrey waitForPageToFinishLoading]; [ChromeEarlGrey waitForWebStateZoomScale:1.0]; - LongPressElement(kLogoPageChromiumImageId); + [ChromeEarlGreyUI longPressElementOnWebView:kLogoPageChromiumImageIdSelector]; + [ChromeEarlGrey waitForForegroundWindowCount:1]; [[EarlGrey selectElementWithMatcher:grey_text(kShortImgTitle)] assertWithMatcher:grey_notNil()];
diff --git a/ios/chrome/browser/crash_report/model/breadcrumbs/breadcrumb_manager_tab_helper_unittest.mm b/ios/chrome/browser/crash_report/model/breadcrumbs/breadcrumb_manager_tab_helper_unittest.mm index 13800ea..9493e88 100644 --- a/ios/chrome/browser/crash_report/model/breadcrumbs/breadcrumb_manager_tab_helper_unittest.mm +++ b/ios/chrome/browser/crash_report/model/breadcrumbs/breadcrumb_manager_tab_helper_unittest.mm
@@ -10,7 +10,6 @@ #import "base/containers/contains.h" #import "base/strings/string_split.h" #import "base/strings/stringprintf.h" -#import "base/test/task_environment.h" #import "components/breadcrumbs/core/breadcrumb_manager.h" #import "components/infobars/core/infobar_delegate.h" #import "ios/chrome/browser/infobars/model/infobar_ios.h" @@ -24,6 +23,7 @@ #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/ui/crw_web_view_proxy.h" #import "ios/web/public/ui/crw_web_view_scroll_view_proxy.h" #import "testing/gtest/include/gtest/gtest.h" @@ -75,7 +75,7 @@ BreadcrumbManagerTabHelper::CreateForWebState(&first_web_state_); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; web::FakeWebState first_web_state_; web::FakeWebState second_web_state_;
diff --git a/ios/chrome/browser/crash_report/model/crash_reporter_breadcrumb_observer_unittest.mm b/ios/chrome/browser/crash_report/model/crash_reporter_breadcrumb_observer_unittest.mm index b5caf2f..a58bb02 100644 --- a/ios/chrome/browser/crash_report/model/crash_reporter_breadcrumb_observer_unittest.mm +++ b/ios/chrome/browser/crash_report/model/crash_reporter_breadcrumb_observer_unittest.mm
@@ -9,7 +9,6 @@ #import "base/containers/contains.h" #import "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" -#import "base/test/task_environment.h" #import "components/breadcrumbs/core/breadcrumb_manager.h" #import "components/breadcrumbs/core/breadcrumb_manager_keyed_service.h" #import "components/breadcrumbs/core/crash_reporter_breadcrumb_constants.h" @@ -18,6 +17,7 @@ #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/common/crash_report/crash_helper.h" #import "ios/testing/scoped_block_swizzler.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -73,7 +73,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestProfileIOS> profile_2_; };
diff --git a/ios/chrome/browser/crash_report/model/crash_reporter_url_observer_unittest.mm b/ios/chrome/browser/crash_report/model/crash_reporter_url_observer_unittest.mm index 8e315e12..5a55c8b 100644 --- a/ios/chrome/browser/crash_report/model/crash_reporter_url_observer_unittest.mm +++ b/ios/chrome/browser/crash_report/model/crash_reporter_url_observer_unittest.mm
@@ -7,7 +7,6 @@ #import <Foundation/Foundation.h> #import "base/strings/sys_string_conversions.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/model/web_state_list/test/fake_web_state_list_delegate.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" @@ -16,6 +15,7 @@ #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -116,7 +116,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> test_profile_; FakeWebStateListDelegate web_state_list_delegate_; DictionaryParameterSetter* params_;
diff --git a/ios/chrome/browser/default_promo/ui_bundled/generic/default_browser_generic_promo_coordinator_unittest.mm b/ios/chrome/browser/default_promo/ui_bundled/generic/default_browser_generic_promo_coordinator_unittest.mm index 63c4ad7..152c984 100644 --- a/ios/chrome/browser/default_promo/ui_bundled/generic/default_browser_generic_promo_coordinator_unittest.mm +++ b/ios/chrome/browser/default_promo/ui_bundled/generic/default_browser_generic_promo_coordinator_unittest.mm
@@ -9,7 +9,6 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/metrics/user_action_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/feature_engagement/public/event_constants.h" #import "components/feature_engagement/public/feature_constants.h" #import "components/feature_engagement/test/mock_tracker.h" @@ -21,6 +20,7 @@ #import "ios/chrome/common/ui/confirmation_alert/constants.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -176,7 +176,7 @@ PlatformTest::TearDown(); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_;
diff --git a/ios/chrome/browser/dom_distiller/model/BUILD.gn b/ios/chrome/browser/dom_distiller/model/BUILD.gn index 0c3946a..b121519 100644 --- a/ios/chrome/browser/dom_distiller/model/BUILD.gn +++ b/ios/chrome/browser/dom_distiller/model/BUILD.gn
@@ -4,13 +4,33 @@ source_set("model") { sources = [ + "distiller_service.h", + "distiller_service.mm", + "distiller_service_factory.h", + "distiller_service_factory.mm", "distiller_viewer.cc", "distiller_viewer.h", ] deps = [ "//base", + "//components/keyed_service/core", + "//ios/chrome/browser/shared/model/profile", + "//ios/chrome/browser/shared/model/profile:profile_keyed_service_factory", + "//services/network/public/cpp", "//ui/gfx", "//url", ] public_deps = [ "//components/dom_distiller/core" ] } + +source_set("unit_tests") { + testonly = true + sources = [ "distiller_service_factory_unittest.mm" ] + deps = [ + ":model", + "//base/test:test_support", + "//ios/chrome/browser/shared/model/profile/test", + "//ios/web/public/test", + "//testing/gtest", + ] +}
diff --git a/ios/chrome/browser/dom_distiller/model/distiller_service.h b/ios/chrome/browser/dom_distiller/model/distiller_service.h new file mode 100644 index 0000000..bf51e365 --- /dev/null +++ b/ios/chrome/browser/dom_distiller/model/distiller_service.h
@@ -0,0 +1,40 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_DOM_DISTILLER_MODEL_DISTILLER_SERVICE_H_ +#define IOS_CHROME_BROWSER_DOM_DISTILLER_MODEL_DISTILLER_SERVICE_H_ + +#import <memory> + +#import "components/dom_distiller/core/distiller.h" +#import "components/dom_distiller/core/distiller_page.h" +#import "components/keyed_service/core/keyed_service.h" +#import "url/gurl.h" + +// Profile-keyed service that extracts the main content from a given web page +// and converts it into a structured output. +class DistillerService : public KeyedService { + public: + DistillerService( + std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory); + ~DistillerService() override; + + // Extracts the content from the given `url` web page with instructions + // from the `distiller_page` and runs the callback with a structured + // result containing the simplified html, page, and image information. + void DistillPage( + const GURL& url, + std::unique_ptr<dom_distiller::DistillerPage> distiller_page, + dom_distiller::Distiller::DistillationFinishedCallback finished_cb, + const dom_distiller::Distiller::DistillationUpdateCallback& update_cb); + + // KeyedService implementation. + void Shutdown() override; + + private: + std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory_; + std::unique_ptr<dom_distiller::Distiller> distiller_; +}; + +#endif // IOS_CHROME_BROWSER_DOM_DISTILLER_MODEL_DISTILLER_SERVICE_H_
diff --git a/ios/chrome/browser/dom_distiller/model/distiller_service.mm b/ios/chrome/browser/dom_distiller/model/distiller_service.mm new file mode 100644 index 0000000..f828193 --- /dev/null +++ b/ios/chrome/browser/dom_distiller/model/distiller_service.mm
@@ -0,0 +1,26 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/dom_distiller/model/distiller_service.h" + +#import "components/dom_distiller/core/distiller.h" + +DistillerService::DistillerService( + std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory) + : distiller_factory_(std::move(distiller_factory)) { + distiller_ = distiller_factory_->CreateDistiller(); +} + +DistillerService::~DistillerService() = default; + +void DistillerService::DistillPage( + const GURL& url, + std::unique_ptr<dom_distiller::DistillerPage> distiller_page, + dom_distiller::Distiller::DistillationFinishedCallback finished_cb, + const dom_distiller::Distiller::DistillationUpdateCallback& update_cb) { + distiller_->DistillPage(url, std::move(distiller_page), + std::move(finished_cb), update_cb); +} + +void DistillerService::Shutdown() {}
diff --git a/ios/chrome/browser/dom_distiller/model/distiller_service_factory.h b/ios/chrome/browser/dom_distiller/model/distiller_service_factory.h new file mode 100644 index 0000000..c8d3922 --- /dev/null +++ b/ios/chrome/browser/dom_distiller/model/distiller_service_factory.h
@@ -0,0 +1,29 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_DOM_DISTILLER_MODEL_DISTILLER_SERVICE_FACTORY_H_ +#define IOS_CHROME_BROWSER_DOM_DISTILLER_MODEL_DISTILLER_SERVICE_FACTORY_H_ + +#import "base/no_destructor.h" +#import "ios/chrome/browser/dom_distiller/model/distiller_service.h" +#import "ios/chrome/browser/shared/model/profile/profile_keyed_service_factory_ios.h" + +// Singleton that creates the Distiller service for a given profile. +class DistillerServiceFactory : public ProfileKeyedServiceFactoryIOS { + public: + static DistillerService* GetForProfile(ProfileIOS* profile); + static DistillerServiceFactory* GetInstance(); + + private: + friend class base::NoDestructor<DistillerServiceFactory>; + + DistillerServiceFactory(); + ~DistillerServiceFactory() override; + + // BrowserStateKeyedServiceFactory implementation. + std::unique_ptr<KeyedService> BuildServiceInstanceFor( + web::BrowserState* context) const override; +}; + +#endif // IOS_CHROME_BROWSER_DOM_DISTILLER_MODEL_DISTILLER_SERVICE_FACTORY_H_
diff --git a/ios/chrome/browser/dom_distiller/model/distiller_service_factory.mm b/ios/chrome/browser/dom_distiller/model/distiller_service_factory.mm new file mode 100644 index 0000000..951a734d --- /dev/null +++ b/ios/chrome/browser/dom_distiller/model/distiller_service_factory.mm
@@ -0,0 +1,41 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/dom_distiller/model/distiller_service_factory.h" + +#import "components/dom_distiller/core/distiller.h" +#import "components/dom_distiller/core/distiller_url_fetcher.h" +#import "ios/chrome/browser/dom_distiller/model/distiller_service.h" +#import "ios/chrome/browser/shared/model/profile/profile_ios.h" +#import "services/network/public/cpp/shared_url_loader_factory.h" + +// static +DistillerService* DistillerServiceFactory::GetForProfile(ProfileIOS* profile) { + return GetInstance()->GetServiceForProfileAs<DistillerService>( + profile, /*create=*/true); +} + +// static +DistillerServiceFactory* DistillerServiceFactory::GetInstance() { + static base::NoDestructor<DistillerServiceFactory> instance; + return instance.get(); +} + +DistillerServiceFactory::DistillerServiceFactory() + : ProfileKeyedServiceFactoryIOS("DistillerService", + ProfileSelection::kRedirectedInIncognito) {} + +DistillerServiceFactory::~DistillerServiceFactory() {} + +std::unique_ptr<KeyedService> DistillerServiceFactory::BuildServiceInstanceFor( + web::BrowserState* context) const { + auto distiller_url_fetcher_factory = + std::make_unique<dom_distiller::DistillerURLFetcherFactory>( + context->GetSharedURLLoaderFactory()); + + dom_distiller::proto::DomDistillerOptions options; + return std::make_unique<DistillerService>( + std::make_unique<dom_distiller::DistillerFactoryImpl>( + std::move(distiller_url_fetcher_factory), options)); +}
diff --git a/ios/chrome/browser/dom_distiller/model/distiller_service_factory_unittest.mm b/ios/chrome/browser/dom_distiller/model/distiller_service_factory_unittest.mm new file mode 100644 index 0000000..0bc2738 --- /dev/null +++ b/ios/chrome/browser/dom_distiller/model/distiller_service_factory_unittest.mm
@@ -0,0 +1,29 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/dom_distiller/model/distiller_service_factory.h" + +#import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" +#import "testing/platform_test.h" + +class DistillerServiceFactoryTest : public PlatformTest { + protected: + DistillerServiceFactoryTest() : profile_(TestProfileIOS::Builder().Build()) {} + + web::WebTaskEnvironment task_environment_; + std::unique_ptr<TestProfileIOS> profile_; +}; + +// Checks that the same instance is returned for on-the-record and +// off-the-record profile. +TEST_F(DistillerServiceFactoryTest, ProfileRedirectedInIncognito) { + DistillerService* on_the_record_service = + DistillerServiceFactory::GetForProfile(profile_.get()); + DistillerService* off_the_record_service = + DistillerServiceFactory::GetForProfile( + profile_->GetOffTheRecordProfile()); + EXPECT_TRUE(on_the_record_service != nullptr); + EXPECT_EQ(on_the_record_service, off_the_record_service); +}
diff --git a/ios/chrome/browser/dom_distiller/model/distiller_viewer.cc b/ios/chrome/browser/dom_distiller/model/distiller_viewer.cc index 1e03109..3d63125 100644 --- a/ios/chrome/browser/dom_distiller/model/distiller_viewer.cc +++ b/ios/chrome/browser/dom_distiller/model/distiller_viewer.cc
@@ -13,16 +13,14 @@ #include "components/dom_distiller/core/distilled_page_prefs.h" #include "components/dom_distiller/core/distiller.h" #include "components/dom_distiller/core/dom_distiller_request_view_base.h" -#include "components/dom_distiller/core/dom_distiller_service.h" #include "components/dom_distiller/core/proto/distilled_article.pb.h" #include "components/dom_distiller/core/task_tracker.h" #include "components/dom_distiller/core/viewer.h" +#import "ios/chrome/browser/dom_distiller/model/distiller_service.h" #include "ui/gfx/geometry/size.h" -namespace dom_distiller { - DistillerViewer::DistillerViewer( - dom_distiller::DistillerFactory* distiller_factory, + DistillerService* distiller_service, std::unique_ptr<dom_distiller::DistillerPage> page, PrefService* prefs, const GURL& url, @@ -33,8 +31,7 @@ callback_(std::move(callback)) { DCHECK(url.is_valid()); SendCommonJavaScript(); - distiller_ = distiller_factory->CreateDistiller(); - distiller_->DistillPage( + distiller_service->DistillPage( url, std::move(page), base::BindOnce(&DistillerViewer::OnDistillerFinished, weak_ptr_factory_.GetWeakPtr()), @@ -67,7 +64,7 @@ } } - const std::string html = viewer::GetArticleTemplateHtml( + const std::string html = dom_distiller::viewer::GetArticleTemplateHtml( distilled_page_prefs_->GetTheme(), distilled_page_prefs_->GetFontFamily(), csp_nonce_); @@ -90,5 +87,3 @@ std::string DistillerViewer::GetCspNonce() { return csp_nonce_; } - -} // namespace dom_distiller
diff --git a/ios/chrome/browser/dom_distiller/model/distiller_viewer.h b/ios/chrome/browser/dom_distiller/model/distiller_viewer.h index e0e71e6..2fd67f9 100644 --- a/ios/chrome/browser/dom_distiller/model/distiller_viewer.h +++ b/ios/chrome/browser/dom_distiller/model/distiller_viewer.h
@@ -10,18 +10,19 @@ #include "components/dom_distiller/core/dom_distiller_request_view_base.h" #include "components/dom_distiller/core/task_tracker.h" +#import "ios/chrome/browser/dom_distiller/model/distiller_service.h" class GURL; namespace dom_distiller { - class DistilledPagePrefs; -class Distiller; +} // namespace dom_distiller // An interface for a dom_distiller ViewRequestDelegate that distills a URL and // calls the given callback with the distilled HTML string and the images it // contains. -class DistillerViewerInterface : public DomDistillerRequestViewBase { +class DistillerViewerInterface + : public dom_distiller::DomDistillerRequestViewBase { public: struct ImageInfo { // The url of the image. @@ -37,7 +38,8 @@ const std::string& csp_nonce)>; DistillerViewerInterface(PrefService* prefs) - : DomDistillerRequestViewBase(new DistilledPagePrefs(prefs)) {} + : dom_distiller::DomDistillerRequestViewBase( + new dom_distiller::DistilledPagePrefs(prefs)) {} DistillerViewerInterface(const DistillerViewerInterface&) = delete; DistillerViewerInterface& operator=(const DistillerViewerInterface&) = delete; @@ -55,11 +57,11 @@ // A very simple and naive implementation of the DistillerViewer. class DistillerViewer : public DistillerViewerInterface { public: - // Creates a `DistillerView` without depending on the DomDistillerService. - // Caller must provide `distiller_factory` and `page` which cannot be null. + // Creates a `DistillerView` without depending on the DistillerService. + // Caller must provide `distiller_service` and `page` which cannot be null. // `callback` is called when distillation is finished with the protobuf // containing the distilled page. - DistillerViewer(dom_distiller::DistillerFactory* distiller_factory, + DistillerViewer(DistillerService* distiller_service, std::unique_ptr<dom_distiller::DistillerPage> page, PrefService* prefs, const GURL& url, @@ -96,12 +98,8 @@ std::string csp_nonce_; // Callback to run once distillation is complete. DistillationFinishedCallback callback_; - // Keep reference of the distiller_ during distillation. - std::unique_ptr<Distiller> distiller_; base::WeakPtrFactory<DistillerViewer> weak_ptr_factory_{this}; }; -} // namespace dom_distiller - #endif // IOS_CHROME_BROWSER_DOM_DISTILLER_MODEL_DISTILLER_VIEWER_H_
diff --git a/ios/chrome/browser/download/coordinator/ar_quick_look_coordinator_unittest.mm b/ios/chrome/browser/download/coordinator/ar_quick_look_coordinator_unittest.mm index 480285fe..81ab42f4 100644 --- a/ios/chrome/browser/download/coordinator/ar_quick_look_coordinator_unittest.mm +++ b/ios/chrome/browser/download/coordinator/ar_quick_look_coordinator_unittest.mm
@@ -14,7 +14,6 @@ #import "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/download/model/ar_quick_look_tab_helper.h" #import "ios/chrome/browser/download/model/ar_quick_look_tab_helper_delegate.h" #import "ios/chrome/browser/download/model/download_test_util.h" @@ -24,6 +23,7 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/chrome/test/scoped_key_window.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -74,7 +74,7 @@ } // Needed for test profile created by TestBrowser(). - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; UIViewController* base_view_controller_;
diff --git a/ios/chrome/browser/download/coordinator/pass_kit_coordinator_unittest.mm b/ios/chrome/browser/download/coordinator/pass_kit_coordinator_unittest.mm index 08ab8e1..1d0dc5f2 100644 --- a/ios/chrome/browser/download/coordinator/pass_kit_coordinator_unittest.mm +++ b/ios/chrome/browser/download/coordinator/pass_kit_coordinator_unittest.mm
@@ -13,7 +13,6 @@ #import "base/memory/raw_ptr.h" #import "base/test/ios/wait_util.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "components/infobars/core/confirm_infobar_delegate.h" #import "components/infobars/core/infobar.h" #import "ios/chrome/browser/download/model/download_test_util.h" @@ -28,6 +27,7 @@ #import "ios/chrome/test/scoped_key_window.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" #import "ui/base/device_form_factor.h" @@ -68,7 +68,7 @@ return PassKitTabHelper::GetOrCreateForWebState(web_state_); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; UIViewController* base_view_controller_;
diff --git a/ios/chrome/browser/download/coordinator/safari_download_coordinator_unittest.mm b/ios/chrome/browser/download/coordinator/safari_download_coordinator_unittest.mm index c5a3c61..16f3393 100644 --- a/ios/chrome/browser/download/coordinator/safari_download_coordinator_unittest.mm +++ b/ios/chrome/browser/download/coordinator/safari_download_coordinator_unittest.mm
@@ -11,7 +11,6 @@ #import "base/test/ios/wait_util.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/download/model/download_test_util.h" #import "ios/chrome/browser/download/model/safari_download_tab_helper.h" #import "ios/chrome/browser/download/model/safari_download_tab_helper_delegate.h" @@ -22,6 +21,7 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/chrome/test/scoped_key_window.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "net/base/apple/url_conversions.h" #import "net/test/embedded_test_server/embedded_test_server.h" #import "net/test/embedded_test_server/http_request.h" @@ -96,7 +96,7 @@ } // Needed for test profile created by TestBrowser(). - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; base::test::ScopedFeatureList feature_list_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_;
diff --git a/ios/chrome/browser/download/coordinator/vcard_coordinator_unittest.mm b/ios/chrome/browser/download/coordinator/vcard_coordinator_unittest.mm index 52402c7b..b94507f 100644 --- a/ios/chrome/browser/download/coordinator/vcard_coordinator_unittest.mm +++ b/ios/chrome/browser/download/coordinator/vcard_coordinator_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/download/coordinator/vcard_coordinator.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/download/model/vcard_tab_helper.h" #import "ios/chrome/browser/download/model/vcard_tab_helper_delegate.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" @@ -13,6 +12,7 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/chrome/test/scoped_key_window.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" // Test fixture for VcardCoordinatorTest class. @@ -32,7 +32,7 @@ ~VcardCoordinatorTest() override { [coordinator_ stop]; } // Needed for test profile created by TestBrowser(). - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; VcardCoordinator* coordinator_;
diff --git a/ios/chrome/browser/download/model/background_service/BUILD.gn b/ios/chrome/browser/download/model/background_service/BUILD.gn index c50629a..e941d220 100644 --- a/ios/chrome/browser/download/model/background_service/BUILD.gn +++ b/ios/chrome/browser/download/model/background_service/BUILD.gn
@@ -32,6 +32,7 @@ "//components/download/internal/background_service/test:test_support", "//components/download/public/background_service/test:test_support", "//ios/chrome/browser/shared/model/profile/test", + "//ios/web/public/test", "//net", "//net:test_support", "//testing/gmock",
diff --git a/ios/chrome/browser/download/model/background_service/background_download_service_test.cc b/ios/chrome/browser/download/model/background_service/background_download_service_test.cc index 6f51ffc..07ff2daa 100644 --- a/ios/chrome/browser/download/model/background_service/background_download_service_test.cc +++ b/ios/chrome/browser/download/model/background_service/background_download_service_test.cc
@@ -16,6 +16,7 @@ #include "components/download/public/background_service/test/mock_client.h" #include "ios/chrome/browser/download/model/background_service/background_download_service_factory.h" #include "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#include "ios/web/public/test/web_task_environment.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -154,6 +155,7 @@ } private: + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> profile_; raw_ptr<download::BackgroundDownloadService> service_; raw_ptr<FakeClient> fake_client_ = nullptr;
diff --git a/ios/chrome/browser/drive/model/BUILD.gn b/ios/chrome/browser/drive/model/BUILD.gn index bd86f06f..37afa996 100644 --- a/ios/chrome/browser/drive/model/BUILD.gn +++ b/ios/chrome/browser/drive/model/BUILD.gn
@@ -193,6 +193,7 @@ "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/public/features", "//ios/chrome/browser/signin/model:fake_system_identity", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", ]
diff --git a/ios/chrome/browser/drive/model/drive_service_factory_unittest.mm b/ios/chrome/browser/drive/model/drive_service_factory_unittest.mm index b48f04f..257988b 100644 --- a/ios/chrome/browser/drive/model/drive_service_factory_unittest.mm +++ b/ios/chrome/browser/drive/model/drive_service_factory_unittest.mm
@@ -5,9 +5,9 @@ #import "ios/chrome/browser/drive/model/drive_service_factory.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/public/features/features.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" class DriveServiceFactoryTest : public PlatformTest { @@ -15,7 +15,7 @@ DriveServiceFactoryTest() { profile_ = TestProfileIOS::Builder().Build(); } base::test::ScopedFeatureList scoped_feature_list_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; };
diff --git a/ios/chrome/browser/drive/model/drive_tab_helper_unittest.mm b/ios/chrome/browser/drive/model/drive_tab_helper_unittest.mm index 7bbe698..819ec55 100644 --- a/ios/chrome/browser/drive/model/drive_tab_helper_unittest.mm +++ b/ios/chrome/browser/drive/model/drive_tab_helper_unittest.mm
@@ -5,13 +5,13 @@ #import "ios/chrome/browser/drive/model/drive_tab_helper.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/drive/model/upload_task.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/browser/signin/model/fake_system_identity.h" #import "ios/web/public/test/fakes/fake_download_task.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" namespace { @@ -36,7 +36,7 @@ helper_ = DriveTabHelper::GetOrCreateForWebState(web_state_.get()); } - base::test::TaskEnvironment task_environment; + web::WebTaskEnvironment task_environment; base::test::ScopedFeatureList scoped_feature_list_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<web::FakeWebState> web_state_;
diff --git a/ios/chrome/browser/drive_file_picker/coordinator/browse_drive_file_picker_coordinator_unittest.mm b/ios/chrome/browser/drive_file_picker/coordinator/browse_drive_file_picker_coordinator_unittest.mm index 4083aed..b4b34d9 100644 --- a/ios/chrome/browser/drive_file_picker/coordinator/browse_drive_file_picker_coordinator_unittest.mm +++ b/ios/chrome/browser/drive_file_picker/coordinator/browse_drive_file_picker_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/drive_file_picker/coordinator/browse_drive_file_picker_coordinator.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/drive/model/drive_list.h" #import "ios/chrome/browser/drive_file_picker/coordinator/drive_file_picker_metrics_helper.h" #import "ios/chrome/browser/drive_file_picker/coordinator/fake_drive_file_picker_handler.h" @@ -18,6 +17,7 @@ #import "ios/chrome/browser/web/model/choose_file/choose_file_tab_helper.h" #import "ios/chrome/browser/web/model/choose_file/fake_choose_file_controller.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" // Test fixture for testing `BrowseDriveFilePickerCoordinator` class. @@ -76,7 +76,7 @@ PlatformTest::TearDown(); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; base::test::ScopedFeatureList scoped_feature_list_; UIViewController* root_view_controller_; UINavigationController* navigation_controller_;
diff --git a/ios/chrome/browser/drive_file_picker/coordinator/drive_file_picker_mediator_unittest.mm b/ios/chrome/browser/drive_file_picker/coordinator/drive_file_picker_mediator_unittest.mm index e55a4e0..ca22907 100644 --- a/ios/chrome/browser/drive_file_picker/coordinator/drive_file_picker_mediator_unittest.mm +++ b/ios/chrome/browser/drive_file_picker/coordinator/drive_file_picker_mediator_unittest.mm
@@ -6,7 +6,6 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/image_fetcher/core/cached_image_fetcher.h" #import "components/image_fetcher/core/image_data_fetcher.h" #import "ios/chrome/browser/drive/model/drive_list.h" @@ -29,6 +28,7 @@ #import "ios/chrome/browser/web/model/choose_file/choose_file_tab_helper.h" #import "ios/chrome/browser/web/model/choose_file/fake_choose_file_controller.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #import "services/network/test/test_url_loader_factory.h" #import "testing/gtest_mac.h" @@ -316,7 +316,7 @@ PlatformTest::TearDown(); } - using TaskEnvironment = base::test::TaskEnvironment; + using TaskEnvironment = web::WebTaskEnvironment; TaskEnvironment task_environment_{TaskEnvironment::TimeSource::MOCK_TIME}; base::test::ScopedFeatureList scoped_feature_list_; NSMutableSet<NSString*>* images_pending_;
diff --git a/ios/chrome/browser/explain_with_gemini/coordinator/explain_with_gemini_mediator_egtest.mm b/ios/chrome/browser/explain_with_gemini/coordinator/explain_with_gemini_mediator_egtest.mm index 5260437f..bb5ab7c 100644 --- a/ios/chrome/browser/explain_with_gemini/coordinator/explain_with_gemini_mediator_egtest.mm +++ b/ios/chrome/browser/explain_with_gemini/coordinator/explain_with_gemini_mediator_egtest.mm
@@ -21,6 +21,7 @@ #import "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/earl_grey/chrome_actions.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" +#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/scoped_eg_synchronization_disabler.h" @@ -40,6 +41,8 @@ namespace { const char kElementToLongPress[] = "selectid"; +ElementSelector* kElementToLongPressSelector = + [ElementSelector selectorWithElementID:kElementToLongPress]; // An HTML template that puts some text in a simple span element. const char kBasicSelectionUrl[] = "/basic"; @@ -99,35 +102,6 @@ return !error; } -// Long presses on `element_id`. -void LongPressElement(const char* element_id) { - // Use triggers_context_menu = true as this is really "triggers_browser_menu". - [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()] - performAction:chrome_test_util::LongPressElementForContextMenu( - [ElementSelector selectorWithElementID:element_id], - true)]; -} - -// Convenient function to trigger the Edit Menu on `kElementToLongPress`. -void TriggerEditMenu() { - [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] - assertWithMatcher:grey_notVisible()]; - LongPressElement(kElementToLongPress); - - NSError* error = nil; - [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] - assertWithMatcher:grey_sufficientlyVisible() - error:&error]; - if (error) { - // If edit is not visible, try to tap the element again. - // This is possible on inputs when the first long press just selects the - // input. - LongPressElement(kElementToLongPress); - [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] - assertWithMatcher:grey_sufficientlyVisible()]; - } -} - } // namespace // Tests for the Search With Edit menu entry. @@ -170,7 +144,7 @@ // `kCanUseModelExecutionFeaturesName` capability. - (void)testExplainWithGemini { [self loadPage]; - TriggerEditMenu(); + [ChromeEarlGreyUI triggerEditMenu:kElementToLongPressSelector]; bool found = FindEditMenuAction([NSString stringWithFormat:@"✦ %@", l10n_util::GetNSString( IDS_IOS_EXPLAIN_GEMINI_EDIT_MENU)]); @@ -210,7 +184,7 @@ - (void)testExplainWithGeminiIncognito { [ChromeEarlGrey openNewIncognitoTab]; [self loadPage]; - TriggerEditMenu(); + [ChromeEarlGreyUI triggerEditMenu:kElementToLongPressSelector]; bool found = FindEditMenuAction([NSString stringWithFormat:@"✦ %@", l10n_util::GetNSString( IDS_IOS_EXPLAIN_GEMINI_EDIT_MENU)]); @@ -223,7 +197,7 @@ [SigninEarlGrey signOut]; [SigninEarlGrey verifySignedOut]; [self loadPage]; - TriggerEditMenu(); + [ChromeEarlGreyUI triggerEditMenu:kElementToLongPressSelector]; bool found = FindEditMenuAction([NSString stringWithFormat:@"✦ %@", l10n_util::GetNSString( IDS_IOS_EXPLAIN_GEMINI_EDIT_MENU)]); @@ -242,7 +216,7 @@ [SigninEarlGrey signinWithFakeIdentity:fakeIdentity]; [self loadPage]; - TriggerEditMenu(); + [ChromeEarlGreyUI triggerEditMenu:kElementToLongPressSelector]; bool found = FindEditMenuAction([NSString stringWithFormat:@"✦ %@", l10n_util::GetNSString( IDS_IOS_EXPLAIN_GEMINI_EDIT_MENU)]); @@ -257,9 +231,10 @@ [SigninEarlGrey verifySignedOut]; FakeSystemIdentity* fakeManagedIdentity = [FakeSystemIdentity fakeManagedIdentity]; - [SigninEarlGrey signinWithFakeIdentity:fakeManagedIdentity]; + [SigninEarlGrey + signinWithFakeManagedIdentityInPersonalProfile:fakeManagedIdentity]; [self loadPage]; - TriggerEditMenu(); + [ChromeEarlGreyUI triggerEditMenu:kElementToLongPressSelector]; bool found = FindEditMenuAction([NSString stringWithFormat:@"✦ %@", l10n_util::GetNSString( IDS_IOS_EXPLAIN_GEMINI_EDIT_MENU)]);
diff --git a/ios/chrome/browser/find_in_page/model/find_in_page_egtest_util.mm b/ios/chrome/browser/find_in_page/model/find_in_page_egtest_util.mm index 3fbbd7b0..b019184 100644 --- a/ios/chrome/browser/find_in_page/model/find_in_page_egtest_util.mm +++ b/ios/chrome/browser/find_in_page/model/find_in_page_egtest_util.mm
@@ -81,14 +81,6 @@ return std::move(http_response); } -// Long presses on `element_id` to trigger context menu. -void LongPressElement(const char* element_id) { - [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()] - performAction:chrome_test_util::LongPressElementForContextMenu( - [ElementSelector selectorWithElementID:element_id], - true /* menu should appear */)]; -} - } // namespace const char kFindInPageTestRepeatingText[] = "repeating"; @@ -296,7 +288,9 @@ [ChromeEarlGrey loadURL:destinationURL]; // Select and copy text on the web page. - LongPressElement(kFindInPageTestShortTextID); + [ChromeEarlGreyUI + longPressElementOnWebView: + [ElementSelector selectorWithElementID:kFindInPageTestShortTextID]]; [[EarlGrey selectElementWithMatcher:
diff --git a/ios/chrome/browser/fullscreen/ui_bundled/BUILD.gn b/ios/chrome/browser/fullscreen/ui_bundled/BUILD.gn index 518098f1..79de5d8d 100644 --- a/ios/chrome/browser/fullscreen/ui_bundled/BUILD.gn +++ b/ios/chrome/browser/fullscreen/ui_bundled/BUILD.gn
@@ -139,6 +139,7 @@ "//ios/web/common", "//ios/web/public", "//ios/web/public/security", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gmock", "//testing/gtest",
diff --git a/ios/chrome/browser/fullscreen/ui_bundled/fullscreen_browser_observer_unittest.mm b/ios/chrome/browser/fullscreen/ui_bundled/fullscreen_browser_observer_unittest.mm index abc2066..b8372fac 100644 --- a/ios/chrome/browser/fullscreen/ui_bundled/fullscreen_browser_observer_unittest.mm +++ b/ios/chrome/browser/fullscreen/ui_bundled/fullscreen_browser_observer_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/fullscreen/ui_bundled/fullscreen_browser_observer.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/fullscreen/ui_bundled/fullscreen_mediator.h" #import "ios/chrome/browser/fullscreen/ui_bundled/fullscreen_model.h" #import "ios/chrome/browser/fullscreen/ui_bundled/fullscreen_web_state_list_observer.h" @@ -12,6 +11,7 @@ #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" // Tests FullscreenBrowserObserver functionality. @@ -35,7 +35,7 @@ ~FullscreenBrowserObserverTest() override { mediator_->Disconnect(); } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; std::unique_ptr<FullscreenModel> model_;
diff --git a/ios/chrome/browser/history/model/BUILD.gn b/ios/chrome/browser/history/model/BUILD.gn index ba7aac3..c471da3 100644 --- a/ios/chrome/browser/history/model/BUILD.gn +++ b/ios/chrome/browser/history/model/BUILD.gn
@@ -98,6 +98,7 @@ "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/model/url:constants", "//ios/web", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", ]
diff --git a/ios/chrome/browser/history/model/history_tab_helper_unittest.mm b/ios/chrome/browser/history/model/history_tab_helper_unittest.mm index 45e7a8f..32c29bc 100644 --- a/ios/chrome/browser/history/model/history_tab_helper_unittest.mm +++ b/ios/chrome/browser/history/model/history_tab_helper_unittest.mm
@@ -10,7 +10,6 @@ #import "base/run_loop.h" #import "base/strings/utf_string_conversions.h" #import "base/test/bind.h" -#import "base/test/task_environment.h" #import "components/history/core/browser/history_service.h" #import "components/keyed_service/core/service_access_type.h" #import "ios/chrome/browser/history/model/history_service_factory.h" @@ -20,6 +19,7 @@ #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -72,7 +72,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; web::FakeWebState web_state_; raw_ptr<web::FakeNavigationManager> navigation_manager_;
diff --git a/ios/chrome/browser/https_upgrades/model/https_only_mode_upgrade_tab_helper_unittest.mm b/ios/chrome/browser/https_upgrades/model/https_only_mode_upgrade_tab_helper_unittest.mm index 555f4c5e..e65b052 100644 --- a/ios/chrome/browser/https_upgrades/model/https_only_mode_upgrade_tab_helper_unittest.mm +++ b/ios/chrome/browser/https_upgrades/model/https_only_mode_upgrade_tab_helper_unittest.mm
@@ -6,7 +6,6 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/keyed_service/core/keyed_service.h" #import "components/prefs/pref_service.h" #import "ios/chrome/browser/https_upgrades/model/https_upgrade_service_factory.h" @@ -23,6 +22,7 @@ #import "ios/web/public/navigation/web_state_policy_decider.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "net/base/apple/url_conversions.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -148,7 +148,7 @@ private: base::test::ScopedFeatureList scoped_feature_list_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> profile_; };
diff --git a/ios/chrome/browser/infobars/model/overlays/translate_overlay_tab_helper_unittest.mm b/ios/chrome/browser/infobars/model/overlays/translate_overlay_tab_helper_unittest.mm index bdd262b..0ce90b9 100644 --- a/ios/chrome/browser/infobars/model/overlays/translate_overlay_tab_helper_unittest.mm +++ b/ios/chrome/browser/infobars/model/overlays/translate_overlay_tab_helper_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/infobars/model/overlays/translate_overlay_tab_helper.h" #import "base/memory/raw_ptr.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/infobars/model/infobar_ios.h" #import "ios/chrome/browser/infobars/model/infobar_manager_impl.h" #import "ios/chrome/browser/infobars/model/overlays/default_infobar_overlay_request_factory.h" @@ -24,6 +23,7 @@ #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" namespace { @@ -90,7 +90,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; std::unique_ptr<TestProfileIOS> profile_; web::FakeWebState web_state_;
diff --git a/ios/chrome/browser/lens_overlay/coordinator/lens_omnibox_client_unittest.mm b/ios/chrome/browser/lens_overlay/coordinator/lens_omnibox_client_unittest.mm index 78f45fc..cc46d9d 100644 --- a/ios/chrome/browser/lens_overlay/coordinator/lens_omnibox_client_unittest.mm +++ b/ios/chrome/browser/lens_overlay/coordinator/lens_omnibox_client_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/lens_overlay/coordinator/lens_omnibox_client.h" -#import "base/test/task_environment.h" #import "components/feature_engagement/public/tracker.h" #import "components/feature_engagement/test/test_tracker.h" #import "components/omnibox/browser/autocomplete_match.h" @@ -19,6 +18,7 @@ #import "ios/testing/nserror_util.h" #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -64,7 +64,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<feature_engagement::Tracker> tracker_;
diff --git a/ios/chrome/browser/lens_overlay/coordinator/lens_overlay_mediator_unittest.mm b/ios/chrome/browser/lens_overlay/coordinator/lens_overlay_mediator_unittest.mm index 7f4c9ab..329fcbd8 100644 --- a/ios/chrome/browser/lens_overlay/coordinator/lens_overlay_mediator_unittest.mm +++ b/ios/chrome/browser/lens_overlay/coordinator/lens_overlay_mediator_unittest.mm
@@ -253,7 +253,7 @@ EXPECT_OCMOCK_VERIFY(mock_toolbar_consumer_); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; LensOverlayMediator* mediator_;
diff --git a/ios/chrome/browser/menu/ui_bundled/browser_action_factory_unittest.mm b/ios/chrome/browser/menu/ui_bundled/browser_action_factory_unittest.mm index 2b8322c67..b0e46d0d 100644 --- a/ios/chrome/browser/menu/ui_bundled/browser_action_factory_unittest.mm +++ b/ios/chrome/browser/menu/ui_bundled/browser_action_factory_unittest.mm
@@ -6,7 +6,6 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/policy/core/common/policy_pref_names.h" #import "components/sync_preferences/testing_pref_service_syncable.h" #import "ios/chrome/browser/menu/ui_bundled/menu_action_type.h" @@ -29,6 +28,7 @@ #import "ios/chrome/browser/window_activities/model/window_activity_helpers.h" #import "ios/chrome/grit/ios_strings.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -93,7 +93,7 @@ } base::test::ScopedFeatureList feature_list_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; base::HistogramTester histogram_tester_; NSString* test_title_; std::unique_ptr<TestProfileIOS> profile_;
diff --git a/ios/chrome/browser/metrics/model/ios_feed_activity_metrics_provider_unittest.mm b/ios/chrome/browser/metrics/model/ios_feed_activity_metrics_provider_unittest.mm index 8ba6cc0..ac340a0 100644 --- a/ios/chrome/browser/metrics/model/ios_feed_activity_metrics_provider_unittest.mm +++ b/ios/chrome/browser/metrics/model/ios_feed_activity_metrics_provider_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/metrics/model/ios_feed_activity_metrics_provider.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "base/types/cxx23_to_underlying.h" #import "components/sync_preferences/testing_pref_service_syncable.h" #import "ios/chrome/browser/metrics/model/constants.h" @@ -14,6 +13,7 @@ #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_manager_ios.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -36,7 +36,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; TestProfileManagerIOS profile_manager_; base::HistogramTester histogram_tester_;
diff --git a/ios/chrome/browser/metrics/model/ios_feed_enabled_metrics_provider_unittest.mm b/ios/chrome/browser/metrics/model/ios_feed_enabled_metrics_provider_unittest.mm index 12054d2b..869384a7 100644 --- a/ios/chrome/browser/metrics/model/ios_feed_enabled_metrics_provider_unittest.mm +++ b/ios/chrome/browser/metrics/model/ios_feed_enabled_metrics_provider_unittest.mm
@@ -9,7 +9,6 @@ #import "base/functional/overloaded.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/feed/core/shared_prefs/pref_names.h" #import "components/metrics/metrics_log_uploader.h" #import "components/prefs/pref_registry_simple.h" @@ -20,6 +19,7 @@ #import "ios/chrome/browser/shared/model/profile/test/test_profile_manager_ios.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/platform_test.h" @@ -129,7 +129,7 @@ private: base::test::ScopedFeatureList feature_list_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; TestProfileManagerIOS profile_manager_; base::HistogramTester histogram_tester_;
diff --git a/ios/chrome/browser/mini_map/ui_bundled/mini_map_coordinator_unittest.mm b/ios/chrome/browser/mini_map/ui_bundled/mini_map_coordinator_unittest.mm index 60b9863..125e714 100644 --- a/ios/chrome/browser/mini_map/ui_bundled/mini_map_coordinator_unittest.mm +++ b/ios/chrome/browser/mini_map/ui_bundled/mini_map_coordinator_unittest.mm
@@ -9,7 +9,6 @@ #import "base/test/ios/wait_util.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/sync_preferences/testing_pref_service_syncable.h" #import "ios/chrome/browser/mini_map/ui_bundled/mini_map_mediator.h" #import "ios/chrome/browser/mini_map/ui_bundled/mini_map_mediator_delegate.h" @@ -26,6 +25,7 @@ #import "ios/chrome/test/providers/mini_map/test_mini_map.h" #import "ios/chrome/test/scoped_key_window.h" #import "ios/web/common/features.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -142,7 +142,7 @@ } protected: - base::test::TaskEnvironment environment_; + web::WebTaskEnvironment environment_; std::unique_ptr<TestProfileIOS> profile_; id<MiniMapMediatorDelegate> delegate_; std::unique_ptr<Browser> browser_;
diff --git a/ios/chrome/browser/mini_map/ui_bundled/mini_map_mediator_unittest.mm b/ios/chrome/browser/mini_map/ui_bundled/mini_map_mediator_unittest.mm index e639c8c2..5f56f481 100644 --- a/ios/chrome/browser/mini_map/ui_bundled/mini_map_mediator_unittest.mm +++ b/ios/chrome/browser/mini_map/ui_bundled/mini_map_mediator_unittest.mm
@@ -6,13 +6,13 @@ #import "base/ios/ios_util.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/sync_preferences/testing_pref_service_syncable.h" #import "ios/chrome/browser/mini_map/ui_bundled/mini_map_mediator_delegate.h" #import "ios/chrome/browser/shared/model/prefs/browser_prefs.h" #import "ios/chrome/browser/shared/model/prefs/pref_names.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/web/common/features.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -48,7 +48,7 @@ } protected: - base::test::TaskEnvironment environment_; + web::WebTaskEnvironment environment_; std::unique_ptr<TestProfileIOS> profile_; id delegate_; MiniMapMediator* mediator_;
diff --git a/ios/chrome/browser/ntp/ui_bundled/new_tab_page_header_view_controller.mm b/ios/chrome/browser/ntp/ui_bundled/new_tab_page_header_view_controller.mm index 9c83faa..95afdc9f 100644 --- a/ios/chrome/browser/ntp/ui_bundled/new_tab_page_header_view_controller.mm +++ b/ios/chrome/browser/ntp/ui_bundled/new_tab_page_header_view_controller.mm
@@ -121,6 +121,8 @@ NSLayoutConstraint* _identityDiscHeightConstraint; // Trailing Anchor for the identity disc button. NSLayoutConstraint* _identityDiscTrailingConstraint; + // Constraint for the identity disc button's capsule-style width. + NSLayoutConstraint* _identityDiscCapsuleWidthConstraint; } - (instancetype)initWithUseNewBadgeForLensButton:(BOOL)useNewBadgeForLensButton @@ -529,6 +531,9 @@ constraintEqualToAnchor:self.headerView.safeAreaLayoutGuide.trailingAnchor constant:0]; _identityDiscTrailingConstraint.active = YES; + _identityDiscCapsuleWidthConstraint = [self.identityDiscButton.widthAnchor + constraintGreaterThanOrEqualToAnchor:self.identityDiscButton.heightAnchor + multiplier:2.0]; // Initially set the constraints of the identity disc. [self updateIdentityDiscConstraints]; @@ -538,23 +543,31 @@ - (void)addCustomizationMenu { UIButton* customizationMenuButton = [[ExtendedTouchTargetButton alloc] initWithFrame:CGRectZero]; - UIButtonConfiguration* buttonConfiguration = - [UIButtonConfiguration plainButtonConfiguration]; - buttonConfiguration.image = DefaultSymbolTemplateWithPointSize( - kPencilSymbol, ntp_home::kCustomizationMenuIconSize); - buttonConfiguration.background.backgroundColor = - [[UIColor colorNamed:@"fake_omnibox_solid_background_color"] - colorWithAlphaComponent:0.8]; - buttonConfiguration.baseForegroundColor = [UIColor - colorNamed:IsSignInButtonNoAvatarEnabled() ? kBlueColor - : kTextSecondaryColor]; + + UIImage* icon = DefaultSymbolTemplateWithPointSize( + kPencilSymbol, + IsSignInButtonNoAvatarEnabled() + ? ntp_home::kCustomizationMenuIconSizeWhenSignInButtonHasNoAvatar + : ntp_home::kCustomizationMenuIconSize); + [customizationMenuButton setImage:icon forState:UIControlStateNormal]; + + UIColor* backgroundColor = + IsSignInButtonNoAvatarEnabled() + ? [[UIColor colorNamed:kBlueColor] colorWithAlphaComponent:0.08] + : [[UIColor colorNamed:@"fake_omnibox_solid_background_color"] + colorWithAlphaComponent:0.8]; + customizationMenuButton.backgroundColor = backgroundColor; + + UIColor* tintColor = [UIColor + colorNamed:(IsSignInButtonNoAvatarEnabled() ? kBlueColor + : kTextSecondaryColor)]; + customizationMenuButton.tintColor = tintColor; customizationMenuButton.accessibilityIdentifier = kNTPCustomizationMenuButtonIdentifier; customizationMenuButton.accessibilityLabel = l10n_util::GetNSString(IDS_IOS_HOME_CUSTOMIZATION_ACCESSIBILITY_LABEL); - customizationMenuButton.configuration = buttonConfiguration; [customizationMenuButton addTarget:self.commandHandler action:@selector(customizationMenuWasTapped:) forControlEvents:UIControlEventTouchUpInside]; @@ -584,12 +597,10 @@ UIButtonConfiguration* config = [UIButtonConfiguration plainButtonConfiguration]; config.background.backgroundColor = - [[UIColor colorNamed:@"fake_omnibox_solid_background_color"] - colorWithAlphaComponent:0.8]; + [[UIColor colorNamed:kBlueColor] colorWithAlphaComponent:0.08]; NSDictionary* attributes = @{ - NSFontAttributeName : PreferredFontForTextStyle(UIFontTextStyleCaption1, - UIFontWeightSemibold, - kIdentityDiscMaxFontSize), + NSFontAttributeName : PreferredFontForTextStyle( + UIFontTextStyleBody, UIFontWeightSemibold, kIdentityDiscMaxFontSize), NSForegroundColorAttributeName : [UIColor colorNamed:kBlueColor], }; config.attributedTitle = [[NSAttributedString alloc] @@ -978,6 +989,7 @@ _identityDiscWidthConstraint.active = !showSignInButtonWithoutAvatar; _identityDiscHeightConstraint.active = !showSignInButtonWithoutAvatar; _identityDiscTrailingConstraint.constant = -identityAvatarPadding; + _identityDiscCapsuleWidthConstraint.active = showSignInButtonWithoutAvatar; } - (void)updateIdentityDiscAccessibilityLabelWithName:(NSString*)name
diff --git a/ios/chrome/browser/omnibox/coordinator/omnibox_coordinator.mm b/ios/chrome/browser/omnibox/coordinator/omnibox_coordinator.mm index 4321f555..597afb8 100644 --- a/ios/chrome/browser/omnibox/coordinator/omnibox_coordinator.mm +++ b/ios/chrome/browser/omnibox/coordinator/omnibox_coordinator.mm
@@ -316,8 +316,6 @@ std::make_unique<OmniboxPopupViewIOS>(_editView->controller(), _omniboxAutocompleteController); - _editView->SetPopupProvider(popupView.get()); - OmniboxPopupCoordinator* coordinator = [[OmniboxPopupCoordinator alloc] initWithBaseViewController:nil browser:self.browser
diff --git a/ios/chrome/browser/omnibox/model/autocomplete_result_wrapper_unittest.mm b/ios/chrome/browser/omnibox/model/autocomplete_result_wrapper_unittest.mm index a12ddc1..8d60009 100644 --- a/ios/chrome/browser/omnibox/model/autocomplete_result_wrapper_unittest.mm +++ b/ios/chrome/browser/omnibox/model/autocomplete_result_wrapper_unittest.mm
@@ -63,7 +63,7 @@ ~AutocompleteResultWrapperTest() override { [wrapper_ disconnect]; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; AutocompleteResultWrapper* wrapper_; search_engines::SearchEnginesTestEnvironment search_engines_test_environment_;
diff --git a/ios/chrome/browser/omnibox/model/chrome_omnibox_client_ios_unittest.mm b/ios/chrome/browser/omnibox/model/chrome_omnibox_client_ios_unittest.mm index fbf59b34..be02aa3 100644 --- a/ios/chrome/browser/omnibox/model/chrome_omnibox_client_ios_unittest.mm +++ b/ios/chrome/browser/omnibox/model/chrome_omnibox_client_ios_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/omnibox/model/chrome_omnibox_client_ios.h" -#import "base/test/task_environment.h" #import "components/feature_engagement/public/tracker.h" #import "components/feature_engagement/test/test_tracker.h" #import "components/omnibox/browser/autocomplete_provider.h" @@ -18,6 +17,7 @@ #import "ios/testing/nserror_util.h" #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -57,7 +57,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestWebLocationBar> web_location_bar_; std::unique_ptr<TestProfileIOS> profile_;
diff --git a/ios/chrome/browser/omnibox/model/omnibox_autocomplete_controller.mm b/ios/chrome/browser/omnibox/model/omnibox_autocomplete_controller.mm index 54e8ab3..a2ebf08 100644 --- a/ios/chrome/browser/omnibox/model/omnibox_autocomplete_controller.mm +++ b/ios/chrome/browser/omnibox/model/omnibox_autocomplete_controller.mm
@@ -229,9 +229,7 @@ } - (void)onCallAction { - if (_omniboxViewIOS) { - _omniboxViewIOS->OnCallActionTap(); - } + [self.omniboxTextController hideKeyboard]; } #pragma mark - OmniboxText events
diff --git a/ios/chrome/browser/omnibox/model/omnibox_text_controller.h b/ios/chrome/browser/omnibox/model/omnibox_text_controller.h index 9bc3747e..5f46ff8 100644 --- a/ios/chrome/browser/omnibox/model/omnibox_text_controller.h +++ b/ios/chrome/browser/omnibox/model/omnibox_text_controller.h
@@ -120,6 +120,16 @@ /// Notifies of scroll event. - (void)onScroll; +/// Hides the keyboard. +- (void)hideKeyboard; + +#pragma mark - Private event +// Events that are private. Removed from header after refactoring +// (crbug.com/390409559). Since these methods should be private, comments are in +// the implementation file. + +- (void)updatePopupLayoutDirection; + @end #endif // IOS_CHROME_BROWSER_OMNIBOX_MODEL_OMNIBOX_TEXT_CONTROLLER_H_
diff --git a/ios/chrome/browser/omnibox/model/omnibox_text_controller.mm b/ios/chrome/browser/omnibox/model/omnibox_text_controller.mm index c189aeb8..d39a5bf 100644 --- a/ios/chrome/browser/omnibox/model/omnibox_text_controller.mm +++ b/ios/chrome/browser/omnibox/model/omnibox_text_controller.mm
@@ -88,12 +88,8 @@ } - (void)endEditing { - // This check is a tentative fix for a crash that happens when calling - // `resignFirstResponder`. TODO(crbug.com/375429786): Verify the crash rate - // and remove the comment or check if needed. - if (self.textField.window) { - [self.textField resignFirstResponder]; - } + [self hideKeyboard]; + if (!_omniboxEditModel || !_omniboxEditModel->has_focus()) { return; } @@ -390,11 +386,19 @@ } - (void)onScroll { - /// Hides the keyboard. - [self.textField resignFirstResponder]; + [self hideKeyboard]; _suggestionsListScrolled = YES; } +- (void)hideKeyboard { + // This check is a tentative fix for a crash that happens when calling + // `resignFirstResponder`. TODO(crbug.com/375429786): Verify the crash rate + // and remove the comment or check if needed. + if (self.textField.window) { + [self.textField resignFirstResponder]; + } +} + #pragma mark - Private /// Previews `suggestion` in the Omnibox. Called when a suggestion is @@ -408,6 +412,15 @@ [textModel setText:previewText userTextLength:previewText.length]; } +/// Updates the appearance of popup to have proper text alignment. +- (void)updatePopupLayoutDirection { + OmniboxTextFieldIOS* textField = self.textField; + [self.omniboxAutocompleteController + setTextAlignment:[textField bestTextAlignment]]; + [self.omniboxAutocompleteController + setSemanticContentAttribute:[textField bestSemanticContentAttribute]]; +} + - (OmniboxClient*)client { return _omniboxController ? _omniboxController->client() : nullptr; }
diff --git a/ios/chrome/browser/omnibox/ui_bundled/BUILD.gn b/ios/chrome/browser/omnibox/ui_bundled/BUILD.gn index 1838d75..329bb81 100644 --- a/ios/chrome/browser/omnibox/ui_bundled/BUILD.gn +++ b/ios/chrome/browser/omnibox/ui_bundled/BUILD.gn
@@ -196,6 +196,7 @@ "//ios/chrome/test:block_cleanup_test", "//ios/testing:nserror_support", "//ios/web/common:uikit", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", "//third_party/ocmock",
diff --git a/ios/chrome/browser/omnibox/ui_bundled/omnibox_view_ios.h b/ios/chrome/browser/omnibox/ui_bundled/omnibox_view_ios.h index 2420ee63..37736dced 100644 --- a/ios/chrome/browser/omnibox/ui_bundled/omnibox_view_ios.h +++ b/ios/chrome/browser/omnibox/ui_bundled/omnibox_view_ios.h
@@ -13,7 +13,6 @@ #import "base/memory/raw_ptr.h" #import "components/omnibox/browser/location_bar_model.h" #import "components/omnibox/browser/omnibox_view.h" -#import "ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_provider.h" struct AutocompleteMatch; class GURL; @@ -38,10 +37,6 @@ ~OmniboxViewIOS() override; - void SetPopupProvider(OmniboxPopupProvider* provider) { - popup_provider_ = provider; - } - void SetOmniboxTextController(OmniboxTextController* controller) { omnibox_text_controller_ = controller; } @@ -103,15 +98,6 @@ // OmniboxAutocompleteController interactions. void OnSelectedMatchForAppending(const std::u16string& str); - void OnCallActionTap(); - - // Updates the appearance of popup to have proper text alignment. - void UpdatePopupAppearance(); - - // Hide keyboard only. Used when omnibox popups grab focus but editing isn't - // complete. - void HideKeyboard(); - // Focus the omnibox field. This is used when the omnibox popup copies a // search query to the omnibox so the user can modify it further. // This does not affect the popup state and is a NOOP if the omnibox is @@ -139,8 +125,6 @@ // the popup, and then remove this hack. BOOL ignore_popup_updates_; - raw_ptr<OmniboxPopupProvider> popup_provider_; // weak - /// Controller that will replace OmniboxViewIOS at the end of the refactoring /// crbug.com/390409559. __weak OmniboxTextController* omnibox_text_controller_;
diff --git a/ios/chrome/browser/omnibox/ui_bundled/omnibox_view_ios.mm b/ios/chrome/browser/omnibox/ui_bundled/omnibox_view_ios.mm index 5e441ee..7911115c 100644 --- a/ios/chrome/browser/omnibox/ui_bundled/omnibox_view_ios.mm +++ b/ios/chrome/browser/omnibox/ui_bundled/omnibox_view_ios.mm
@@ -58,8 +58,7 @@ id<ToolbarCommands> toolbar_commands_handler) : OmniboxView(std::move(client)), field_(field), - ignore_popup_updates_(false), - popup_provider_(nullptr) { + ignore_popup_updates_(false) { DCHECK(field_); } @@ -126,16 +125,7 @@ prevent_inline_autocomplete); } - UpdatePopupAppearance(); -} - -void OmniboxViewIOS::UpdatePopupAppearance() { - if (!popup_provider_) { - return; - } - popup_provider_->SetTextAlignment([field_ bestTextAlignment]); - popup_provider_->SetSemanticContentAttribute( - [field_ bestSemanticContentAttribute]); + [omnibox_text_controller_ updatePopupLayoutDirection]; } void OmniboxViewIOS::OnTemporaryTextMaybeChanged( @@ -385,14 +375,6 @@ OnDidChange(/*processing_user_event=*/true); } -void OmniboxViewIOS::HideKeyboard() { - [field_ resignFirstResponder]; -} - -void OmniboxViewIOS::OnCallActionTap() { - this->HideKeyboard(); -} - void OmniboxViewIOS::FocusOmnibox() { [field_ becomeFirstResponder]; }
diff --git a/ios/chrome/browser/omnibox/ui_bundled/popup/BUILD.gn b/ios/chrome/browser/omnibox/ui_bundled/popup/BUILD.gn index fe505c0a..819d123f 100644 --- a/ios/chrome/browser/omnibox/ui_bundled/popup/BUILD.gn +++ b/ios/chrome/browser/omnibox/ui_bundled/popup/BUILD.gn
@@ -6,7 +6,6 @@ sources = [ "omnibox_popup_presenter.h", "omnibox_popup_presenter.mm", - "omnibox_popup_provider.h", "omnibox_popup_view_ios.h", "omnibox_popup_view_ios.mm", ]
diff --git a/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_provider.h b/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_provider.h deleted file mode 100644 index ba90166..0000000 --- a/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_provider.h +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2017 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_OMNIBOX_UI_BUNDLED_POPUP_OMNIBOX_POPUP_PROVIDER_H_ -#define IOS_CHROME_BROWSER_OMNIBOX_UI_BUNDLED_POPUP_OMNIBOX_POPUP_PROVIDER_H_ - -#import <UIKit/UIKit.h> - -/// An interface for a provider of an omnibox popup. Allows to get information -/// about the state of and configure the popup. -class OmniboxPopupProvider { - public: - virtual void SetTextAlignment(NSTextAlignment alignment) = 0; - virtual void SetSemanticContentAttribute( - UISemanticContentAttribute semanticContentAttrbute) = 0; - virtual void SetHasThumbnail(bool has_thumbnail) = 0; -}; - -#endif // IOS_CHROME_BROWSER_OMNIBOX_UI_BUNDLED_POPUP_OMNIBOX_POPUP_PROVIDER_H_
diff --git a/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_view_ios.h b/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_view_ios.h index 33409060..8130e64 100644 --- a/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_view_ios.h +++ b/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_view_ios.h
@@ -9,7 +9,6 @@ #import "base/memory/raw_ptr.h" #import "components/omnibox/browser/omnibox_popup_view.h" -#import "ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_provider.h" @class OmniboxAutocompleteController; @class OmniboxPopupMediator; @@ -17,8 +16,7 @@ struct AutocompleteMatch; // iOS implementation of OmniboxPopupView. -class OmniboxPopupViewIOS : public OmniboxPopupView, - public OmniboxPopupProvider { +class OmniboxPopupViewIOS : public OmniboxPopupView { public: OmniboxPopupViewIOS( OmniboxController* controller, @@ -34,12 +32,6 @@ void OnDragCanceled() override {} void GetPopupAccessibleNodeData(ui::AXNodeData* node_data) const override {} - // OmniboxPopupProvider implemetation. - void SetTextAlignment(NSTextAlignment alignment) override; - void SetSemanticContentAttribute( - UISemanticContentAttribute semanticContentAttribute) override; - void SetHasThumbnail(bool has_thumbnail) override; - private: __weak OmniboxAutocompleteController* omnibox_autocomplete_controller_; };
diff --git a/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_view_ios.mm b/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_view_ios.mm index 00e25c0..67a82d5d 100644 --- a/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_view_ios.mm +++ b/ios/chrome/browser/omnibox/ui_bundled/popup/omnibox_popup_view_ios.mm
@@ -52,19 +52,3 @@ bool OmniboxPopupViewIOS::IsOpen() const { return omnibox_autocomplete_controller_.hasSuggestions; } - -#pragma mark - OmniboxPopupProvider - -void OmniboxPopupViewIOS::SetTextAlignment(NSTextAlignment alignment) { - [omnibox_autocomplete_controller_ setTextAlignment:alignment]; -} - -void OmniboxPopupViewIOS::SetSemanticContentAttribute( - UISemanticContentAttribute semanticContentAttribute) { - [omnibox_autocomplete_controller_ - setSemanticContentAttribute:semanticContentAttribute]; -} - -void OmniboxPopupViewIOS::SetHasThumbnail(bool has_thumbnail) { - [omnibox_autocomplete_controller_ setHasThumbnail:has_thumbnail]; -}
diff --git a/ios/chrome/browser/optimization_guide/model/optimization_guide_service_factory_unittest.mm b/ios/chrome/browser/optimization_guide/model/optimization_guide_service_factory_unittest.mm index 9c35b56..428d3fb 100644 --- a/ios/chrome/browser/optimization_guide/model/optimization_guide_service_factory_unittest.mm +++ b/ios/chrome/browser/optimization_guide/model/optimization_guide_service_factory_unittest.mm
@@ -5,11 +5,11 @@ #import "ios/chrome/browser/optimization_guide/model/optimization_guide_service_factory.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/optimization_guide/core/optimization_guide_features.h" #import "ios/chrome/browser/optimization_guide/model/optimization_guide_service.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -34,7 +34,7 @@ protected: IOSChromeScopedTestingLocalState scoped_testing_local_state_; base::test::ScopedFeatureList scoped_feature_list_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; }; @@ -58,7 +58,7 @@ protected: base::test::ScopedFeatureList scoped_feature_list_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> profile_; };
diff --git a/ios/chrome/browser/optimization_guide/model/optimization_guide_tab_helper_unittest.mm b/ios/chrome/browser/optimization_guide/model/optimization_guide_tab_helper_unittest.mm index e1c4965..bb5b932 100644 --- a/ios/chrome/browser/optimization_guide/model/optimization_guide_tab_helper_unittest.mm +++ b/ios/chrome/browser/optimization_guide/model/optimization_guide_tab_helper_unittest.mm
@@ -8,7 +8,6 @@ #import "base/memory/raw_ptr.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/optimization_guide/core/optimization_guide_features.h" #import "components/optimization_guide/core/optimization_guide_navigation_data.h" #import "components/optimization_guide/core/optimization_guide_switches.h" @@ -21,6 +20,7 @@ #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -131,7 +131,7 @@ protected: IOSChromeScopedTestingLocalState scoped_testing_local_state_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; base::test::ScopedFeatureList scoped_feature_list_; base::HistogramTester histogram_tester_; std::unique_ptr<TestProfileIOS> profile_;
diff --git a/ios/chrome/browser/optimization_guide/model/optimization_guide_validation_tab_helper_unittest.mm b/ios/chrome/browser/optimization_guide/model/optimization_guide_validation_tab_helper_unittest.mm index dae217b..cd17d84 100644 --- a/ios/chrome/browser/optimization_guide/model/optimization_guide_validation_tab_helper_unittest.mm +++ b/ios/chrome/browser/optimization_guide/model/optimization_guide_validation_tab_helper_unittest.mm
@@ -8,7 +8,6 @@ #import "base/memory/raw_ptr.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/optimization_guide/core/optimization_guide_features.h" #import "components/optimization_guide/core/optimization_guide_switches.h" #import "components/optimization_guide/core/optimization_guide_test_util.h" @@ -21,6 +20,7 @@ #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "url/gurl.h" @@ -76,7 +76,7 @@ protected: IOSChromeScopedTestingLocalState scoped_testing_local_state_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; base::test::ScopedFeatureList scoped_feature_list_; base::HistogramTester histogram_tester_; std::unique_ptr<TestProfileIOS> profile_;
diff --git a/ios/chrome/browser/optimization_guide/model/tab_url_provider_impl_unittest.mm b/ios/chrome/browser/optimization_guide/model/tab_url_provider_impl_unittest.mm index bd42ed43..e931ccba 100644 --- a/ios/chrome/browser/optimization_guide/model/tab_url_provider_impl_unittest.mm +++ b/ios/chrome/browser/optimization_guide/model/tab_url_provider_impl_unittest.mm
@@ -8,7 +8,6 @@ #import "base/memory/raw_ptr.h" #import "base/test/simple_test_clock.h" -#import "base/test/task_environment.h" #import "components/optimization_guide/core/tab_url_provider.h" #import "ios/chrome/browser/shared/model/browser/browser_list.h" #import "ios/chrome/browser/shared/model/browser/browser_list_factory.h" @@ -17,6 +16,7 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -73,7 +73,7 @@ base::SimpleTestClock* clock() { return &clock_; } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> profile_; base::SimpleTestClock clock_; std::unique_ptr<TestBrowser> browser_;
diff --git a/ios/chrome/browser/passwords/model/BUILD.gn b/ios/chrome/browser/passwords/model/BUILD.gn index a6477aa..9e31684 100644 --- a/ios/chrome/browser/passwords/model/BUILD.gn +++ b/ios/chrome/browser/passwords/model/BUILD.gn
@@ -332,9 +332,14 @@ "//base/test:test_support", "//components/autofill/core/browser:test_support", "//components/autofill/ios/common", + "//components/enterprise", + "//components/enterprise/connectors/core", + "//components/enterprise/connectors/core:test_support", "//components/password_manager/core/browser/features:password_features", "//components/password_manager/core/common", "//components/plus_addresses:features", + "//components/policy/core/common:common_constants", + "//components/policy/test_support", "//components/strings", "//components/sync/base", "//components/sync/service", @@ -342,6 +347,7 @@ "//ios/chrome/browser/authentication/ui_bundled:eg_test_support+eg2", "//ios/chrome/browser/autofill/ui_bundled:eg_test_support+eg2", "//ios/chrome/browser/infobars/ui_bundled/banners:public", + "//ios/chrome/browser/metrics/model:eg_test_support+eg2", "//ios/chrome/browser/passwords/ui_bundled/bottom_sheet:eg_test_support+eg2", "//ios/chrome/browser/settings/ui_bundled/google_services:constants", "//ios/chrome/browser/signin/model:fake_system_identity",
diff --git a/ios/chrome/browser/passwords/model/DEPS b/ios/chrome/browser/passwords/model/DEPS index 4b510c4..18314cb2 100644 --- a/ios/chrome/browser/passwords/model/DEPS +++ b/ios/chrome/browser/passwords/model/DEPS
@@ -17,5 +17,7 @@ "+ios/chrome/browser/shared/ui/util/rtl_geometry.h", "+ios/chrome/browser/shared/ui/util/uikit_ui_util.h", ], - + "^password_controller_egtest.mm": [ + "+components/policy/test_support/embedded_policy_test_server.h", + ], }
diff --git a/ios/chrome/browser/passwords/model/password_controller_egtest.mm b/ios/chrome/browser/passwords/model/password_controller_egtest.mm index 2d21255b..fade3f7 100644 --- a/ios/chrome/browser/passwords/model/password_controller_egtest.mm +++ b/ios/chrome/browser/passwords/model/password_controller_egtest.mm
@@ -7,6 +7,7 @@ #import <memory> +#import "base/check.h" #import "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" #import "base/time/time.h" @@ -14,9 +15,16 @@ #import "components/autofill/core/browser/field_types.h" #import "components/autofill/core/browser/test_utils/autofill_test_utils.h" #import "components/autofill/ios/common/features.h" +#import "components/enterprise/browser/enterprise_switches.h" +#import "components/enterprise/connectors/core/features.h" +#import "components/enterprise/connectors/core/realtime_reporting_test_server.h" +#import "components/enterprise/connectors/core/reporting_test_utils.h" #import "components/password_manager/core/browser/features/password_features.h" #import "components/password_manager/core/common/password_manager_features.h" #import "components/plus_addresses/features.h" +#import "components/policy/core/common/policy_loader_ios_constants.h" +#import "components/policy/core/common/policy_switches.h" +#import "components/policy/test_support/embedded_policy_test_server.h" #import "components/strings/grit/components_strings.h" #import "components/sync/base/user_selectable_type.h" #import "components/sync/service/sync_prefs.h" @@ -24,6 +32,7 @@ #import "ios/chrome/browser/authentication/ui_bundled/signin_earl_grey_ui_test_util.h" #import "ios/chrome/browser/autofill/ui_bundled/autofill_app_interface.h" #import "ios/chrome/browser/infobars/ui_bundled/banners/infobar_banner_constants.h" +#import "ios/chrome/browser/metrics/model/metrics_app_interface.h" #import "ios/chrome/browser/passwords/model/password_manager_app_interface.h" #import "ios/chrome/browser/passwords/ui_bundled/bottom_sheet/password_suggestion_bottom_sheet_app_interface.h" #import "ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_constants.h" @@ -46,9 +55,15 @@ namespace { NSString* const kPassphrase = @"hello"; +constexpr base::TimeDelta kReportUploadTimeout = base::Seconds(15); +constexpr char kEnrollmentToken[] = "fake-enrollment-token"; +constexpr char kEnrollmentTokenPolicyName[] = "CloudManagementEnrollmentToken"; using base::test::ios::kWaitForUIElementTimeout; using base::test::ios::WaitUntilConditionOrTimeout; +using ::chrome::cros::reporting::proto::Event; +using ::chrome::cros::reporting::proto::UploadEventsRequest; +using chrome_test_util::GREYAssertErrorNil; using chrome_test_util::SettingsAccountButton; using chrome_test_util::SettingsDoneButton; using chrome_test_util::TapWebElementWithId; @@ -151,9 +166,28 @@ @interface PasswordControllerEGTest : WebHttpServerChromeTestCase @end -@implementation PasswordControllerEGTest +@implementation PasswordControllerEGTest { + std::unique_ptr<policy::EmbeddedPolicyTestServer> _policyServer; + std::unique_ptr<enterprise_connectors::test::RealtimeReportingTestServer> + _reportingServer; +} - (void)setUp { + if ([self isRunningTest:@selector(testLoginEventReported)]) { + // Start the servers before calling the superclass's `-setUp` so that their + // addresses can be added to the app launch config. `GREYAssertTrue` can + // only be used after calling the superclass's `-setUp`, so use `CHECK()` + // instead. + _policyServer = + enterprise_connectors::test::CreatePolicyTestServerForSecurityEvents( + {"loginEvent"}, {{"loginEvent", {"*"}}}); + CHECK(_policyServer); + CHECK(_policyServer->Start()); + _reportingServer = std::make_unique< + enterprise_connectors::test::RealtimeReportingTestServer>(); + CHECK(_reportingServer->Start()); + } + [super setUp]; // Set up server. @@ -169,9 +203,15 @@ GREYAssertTrue([PasswordManagerAppInterface clearCredentials], @"Clearing credentials wasn't done."); [AutofillAppInterface clearProfilesStore]; + + chrome_test_util::GREYAssertErrorNil( + [MetricsAppInterface setupHistogramTester]); } - (void)tearDownHelper { + chrome_test_util::GREYAssertErrorNil( + [MetricsAppInterface releaseHistogramTester]); + GREYAssertTrue([PasswordManagerAppInterface clearCredentials], @"Clearing credentials wasn't done."); [AutofillAppInterface clearProfilesStore]; @@ -185,6 +225,27 @@ config.features_enabled.push_back(kAutofillStickyInfobarIos); } + // Set Enterprise features for testing password-related event reporting. + if ([self isRunningTest:@selector(testLoginEventReported)]) { + CHECK(_policyServer); + CHECK(_reportingServer); + config.additional_args.push_back( + base::StrCat({"--", switches::kEnableChromeBrowserCloudManagement})); + config.additional_args.push_back(base::StrCat( + {"-", base::SysNSStringToUTF8(kPolicyLoaderIOSConfigurationKey)})); + config.additional_args.push_back( + base::StrCat({"<dict><key>", kEnrollmentTokenPolicyName, + "</key><string>", kEnrollmentToken, "</string></dict>"})); + config.additional_args.push_back( + base::StrCat({"--", policy::switches::kDeviceManagementUrl, "=", + _policyServer->GetServiceURL().spec()})); + config.additional_args.push_back( + base::StrCat({"--", policy::switches::kRealtimeReportingUrl, "=", + _reportingServer->GetServiceURL().spec()})); + config.features_enabled.push_back( + enterprise_connectors::kEnterpriseRealtimeEventReportingOnIOS); + } + // The proactive password suggestion bottom sheet isn't tested here, it // is tested in its own suite in password_suggestion_egtest.mm. config.features_disabled.push_back( @@ -696,4 +757,52 @@ password:passwordValue]; } +// Tests that log in events are reported to an enterprise connector. +- (void)testLoginEventReported { + [self loadLoginPage]; + + // Simulate login. + TypeTextOnField(@"test-username@test-domain.com", kFormUsername); + TypeTextOnField(@"test-password", kFormPassword); + [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()] + performAction:chrome_test_util::TapWebElementWithId("submit_button")]; + + // Use metrics to detect that the report upload completed. This is the best + // known way to wait because a task environment isn't available here, so + // there's nothing for `_reportingServer` to post to when the request + // arrives. This also precludes helpers like `base::RunLoop` or + // `net::test_server::ControllableHttpResponse` that require such an + // environment. + GREYAssertTrue( + WaitUntilConditionOrTimeout( + kReportUploadTimeout, + ^{ + NSError* error = [MetricsAppInterface + expectTotalCount:1 + forHistogram:@"Enterprise.ReportingEventUploadSuccess"]; + return error == nil; + }), + @"Timed out uploading security event."); + GREYAssertErrorNil([MetricsAppInterface + expectTotalCount:0 + forHistogram:@"Enterprise.ReportingEventUploadFailure"]); + + std::vector<UploadEventsRequest> requests = + _reportingServer->GetUploadedReports(); + GREYAssertEqual(1U, requests.size(), @"Wrong number of reports."); + GREYAssertEqual(std::string("iOS"), requests[0].device().os_platform(), + @"Wrong OS platform in report."); + GREYAssertEqual(1, requests[0].events_size(), @"Wrong number of events."); + + const Event& event = requests[0].events(0); + GREYAssertTrue(event.has_login_event(), @"Wrong event type."); + GREYAssertEqual(self.testServer->GetURL("/"), event.login_event().url(), + @"Wrong URL reported to server."); + // The `test-username` portion of the email will be masked, but the domain + // part shouldn't be. + GREYAssertTrue( + event.login_event().login_user_name().ends_with("@test-domain.com"), + @"Wrong domain in login user name."); +} + @end
diff --git a/ios/chrome/browser/photos/model/BUILD.gn b/ios/chrome/browser/photos/model/BUILD.gn index 118599d..fc7044a 100644 --- a/ios/chrome/browser/photos/model/BUILD.gn +++ b/ios/chrome/browser/photos/model/BUILD.gn
@@ -70,6 +70,7 @@ ":photos_service_factory", "//base/test:test_support", "//ios/chrome/browser/shared/model/profile/test", + "//ios/web/public/test", "//testing/gtest", ] }
diff --git a/ios/chrome/browser/photos/model/photos_service_factory_unittest.mm b/ios/chrome/browser/photos/model/photos_service_factory_unittest.mm index 308da31..dcc7d9d 100644 --- a/ios/chrome/browser/photos/model/photos_service_factory_unittest.mm +++ b/ios/chrome/browser/photos/model/photos_service_factory_unittest.mm
@@ -4,15 +4,15 @@ #import "ios/chrome/browser/photos/model/photos_service_factory.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" class PhotosServiceFactoryTest : public PlatformTest { protected: PhotosServiceFactoryTest() : profile_(TestProfileIOS::Builder().Build()) {} - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; };
diff --git a/ios/chrome/browser/plus_addresses/coordinator/plus_address_bottom_sheet_mediator_unittest.mm b/ios/chrome/browser/plus_addresses/coordinator/plus_address_bottom_sheet_mediator_unittest.mm index 1c42545..af825f5 100644 --- a/ios/chrome/browser/plus_addresses/coordinator/plus_address_bottom_sheet_mediator_unittest.mm +++ b/ios/chrome/browser/plus_addresses/coordinator/plus_address_bottom_sheet_mediator_unittest.mm
@@ -8,7 +8,6 @@ #import "base/strings/sys_string_conversions.h" #import "base/test/metrics/user_action_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "base/types/expected.h" #import "components/plus_addresses/fake_plus_address_service.h" #import "components/plus_addresses/features.h" @@ -23,6 +22,7 @@ #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/url_loading/model/fake_url_loading_browser_agent.h" #import "ios/chrome/browser/url_loading/model/url_loading_notifier_browser_agent.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -69,7 +69,7 @@ id consumer_; private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; TestBrowser browser_; FakePlusAddressService service_;
diff --git a/ios/chrome/browser/policy/model/reporting/browser_report_generator_ios_unittest.mm b/ios/chrome/browser/policy/model/reporting/browser_report_generator_ios_unittest.mm index c348b67..13a86ba 100644 --- a/ios/chrome/browser/policy/model/reporting/browser_report_generator_ios_unittest.mm +++ b/ios/chrome/browser/policy/model/reporting/browser_report_generator_ios_unittest.mm
@@ -9,11 +9,11 @@ #import "base/files/file_path.h" #import "base/run_loop.h" #import "base/test/bind.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/policy/model/reporting/reporting_delegate_factory_ios.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_manager_ios.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" namespace em = enterprise_management; @@ -59,7 +59,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; TestProfileManagerIOS profile_manager_; raw_ptr<ProfileIOS> profile_;
diff --git a/ios/chrome/browser/policy/ui_bundled/idle/idle_timeout_policy_scene_agent_unittest.mm b/ios/chrome/browser/policy/ui_bundled/idle/idle_timeout_policy_scene_agent_unittest.mm index ecde6173..68e1d56 100644 --- a/ios/chrome/browser/policy/ui_bundled/idle/idle_timeout_policy_scene_agent_unittest.mm +++ b/ios/chrome/browser/policy/ui_bundled/idle/idle_timeout_policy_scene_agent_unittest.mm
@@ -6,7 +6,6 @@ #import <MaterialComponents/MaterialSnackbar.h> -#import "base/test/task_environment.h" #import "components/enterprise/idle/idle_pref_names.h" #import "ios/chrome/app/application_delegate/app_state.h" #import "ios/chrome/app/profile/profile_init_stage.h" @@ -26,6 +25,7 @@ #import "ios/chrome/browser/shared/public/commands/command_dispatcher.h" #import "ios/chrome/browser/shared/public/commands/settings_commands.h" #import "ios/chrome/browser/shared/public/commands/snackbar_commands.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -138,7 +138,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<enterprise_idle::IdleService> idle_service_; AppState* app_state_;
diff --git a/ios/chrome/browser/price_insights/coordinator/price_insights_modulator_unittest.mm b/ios/chrome/browser/price_insights/coordinator/price_insights_modulator_unittest.mm index 761465e..4561f0f 100644 --- a/ios/chrome/browser/price_insights/coordinator/price_insights_modulator_unittest.mm +++ b/ios/chrome/browser/price_insights/coordinator/price_insights_modulator_unittest.mm
@@ -7,7 +7,6 @@ #import "base/memory/raw_ptr.h" #import "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" -#import "base/test/task_environment.h" #import "components/commerce/core/commerce_types.h" #import "components/commerce/core/mock_shopping_service.h" #import "ios/chrome/browser/bookmarks/model/bookmark_model_factory.h" @@ -23,6 +22,7 @@ #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/web_state.h" #import "testing/platform_test.h" @@ -94,7 +94,7 @@ protected: IOSChromeScopedTestingLocalState scoped_testing_local_state_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; TestProfileManagerIOS profile_manager_; std::unique_ptr<TestBrowser> browser_; UIViewController* base_view_controller_;
diff --git a/ios/chrome/browser/price_insights/model/price_insights_model_unittest.mm b/ios/chrome/browser/price_insights/model/price_insights_model_unittest.mm index e1f1dcc3..e1e8b6cd 100644 --- a/ios/chrome/browser/price_insights/model/price_insights_model_unittest.mm +++ b/ios/chrome/browser/price_insights/model/price_insights_model_unittest.mm
@@ -7,7 +7,6 @@ #import "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/commerce/core/commerce_feature_list.h" #import "components/commerce/core/commerce_types.h" #import "components/commerce/core/mock_shopping_service.h" @@ -22,6 +21,7 @@ #import "ios/web/public/browser_state.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/web_state.h" #import "testing/platform_test.h" #import "ui/base/l10n/l10n_util.h" @@ -94,7 +94,7 @@ protected: base::test::ScopedFeatureList features_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<PriceInsightsModel> price_insights_model_; raw_ptr<commerce::MockShoppingService> shopping_service_; std::unique_ptr<ContextualPanelItemConfiguration> returned_configuration_;
diff --git a/ios/chrome/browser/profile/model/keyed_service_factories.mm b/ios/chrome/browser/profile/model/keyed_service_factories.mm index 50398a2..ec2b6f54 100644 --- a/ios/chrome/browser/profile/model/keyed_service_factories.mm +++ b/ios/chrome/browser/profile/model/keyed_service_factories.mm
@@ -44,6 +44,7 @@ #import "ios/chrome/browser/device_reauth/model/ios_device_authenticator_factory.h" #import "ios/chrome/browser/device_sharing/model/device_sharing_manager_factory.h" #import "ios/chrome/browser/discover_feed/model/discover_feed_service_factory.h" +#import "ios/chrome/browser/dom_distiller/model/distiller_service_factory.h" #import "ios/chrome/browser/download/model/background_service/background_download_service_factory.h" #import "ios/chrome/browser/download/model/browser_download_service_factory.h" #import "ios/chrome/browser/drive/model/drive_service_factory.h" @@ -263,6 +264,7 @@ DeviceInfoSyncServiceFactory::GetInstance(); DeviceSharingManagerFactory::GetInstance(); DiscoverFeedServiceFactory::GetInstance(); + DistillerServiceFactory::GetInstance(); DomainDiversityReporterFactory::GetInstance(); ExternalFileRemoverFactory::GetInstance(); FollowServiceFactory::GetInstance();
diff --git a/ios/chrome/browser/reading_list/model/reading_list_browser_agent.mm b/ios/chrome/browser/reading_list/model/reading_list_browser_agent.mm index 831e56d5..b61163aa 100644 --- a/ios/chrome/browser/reading_list/model/reading_list_browser_agent.mm +++ b/ios/chrome/browser/reading_list/model/reading_list_browser_agent.mm
@@ -157,12 +157,12 @@ const GURL& url) { ReadingListModel* reading_model = ReadingListModelFactory::GetForProfile(browser_->GetProfile()); - CoreAccountId account_id = reading_model->GetAccountWhereEntryIsSavedTo(url); + GaiaId gaia_id = reading_model->GetAccountWhereEntryIsSavedTo(url); signin::IdentityManager* identity_manager = IdentityManagerFactory::GetForProfile( browser_->GetProfile()->GetOriginalProfile()); AccountInfo account_info = - identity_manager->FindExtendedAccountInfoByAccountId(account_id); + identity_manager->FindExtendedAccountInfoByGaiaId(gaia_id); return account_info; }
diff --git a/ios/chrome/browser/reading_list/model/reading_list_download_service.h b/ios/chrome/browser/reading_list/model/reading_list_download_service.h index 78d78d8..5492513 100644 --- a/ios/chrome/browser/reading_list/model/reading_list_download_service.h +++ b/ios/chrome/browser/reading_list/model/reading_list_download_service.h
@@ -11,6 +11,7 @@ #include "base/scoped_observation.h" #include "components/keyed_service/core/keyed_service.h" #include "components/reading_list/core/reading_list_model_observer.h" +#include "ios/chrome/browser/dom_distiller/model/distiller_service.h" #include "ios/chrome/browser/reading_list/model/url_downloader.h" #include "services/network/public/cpp/network_connection_tracker.h" @@ -39,7 +40,7 @@ PrefService* prefs, base::FilePath chrome_profile_path, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory, + DistillerService* distiller_service, std::unique_ptr<reading_list::ReadingListDistillerPageFactory> distiller_page_factory); @@ -114,7 +115,7 @@ bool had_connection_; std::unique_ptr<reading_list::ReadingListDistillerPageFactory> distiller_page_factory_; - std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory_; + raw_ptr<DistillerService> distiller_service_; base::ScopedObservation<ReadingListModel, ReadingListModelObserver> model_observation_{this};
diff --git a/ios/chrome/browser/reading_list/model/reading_list_download_service.mm b/ios/chrome/browser/reading_list/model/reading_list_download_service.mm index 6da155fd..2ea0758 100644 --- a/ios/chrome/browser/reading_list/model/reading_list_download_service.mm +++ b/ios/chrome/browser/reading_list/model/reading_list_download_service.mm
@@ -20,6 +20,7 @@ #import "components/reading_list/core/offline_url_utils.h" #import "components/reading_list/core/reading_list_entry.h" #import "components/reading_list/core/reading_list_model.h" +#import "ios/chrome/browser/dom_distiller/model/distiller_service.h" #import "ios/chrome/browser/reading_list/model/reading_list_distiller_page_factory.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "net/base/network_change_notifier.h" @@ -69,19 +70,19 @@ PrefService* prefs, base::FilePath chrome_profile_path, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory, + DistillerService* distiller_service, std::unique_ptr<reading_list::ReadingListDistillerPageFactory> distiller_page_factory) : reading_list_model_(reading_list_model), chrome_profile_path_(chrome_profile_path), had_connection_(!net::NetworkChangeNotifier::IsOffline()), distiller_page_factory_(std::move(distiller_page_factory)), - distiller_factory_(std::move(distiller_factory)), + distiller_service_(distiller_service), weak_ptr_factory_(this) { DCHECK(reading_list_model); url_downloader_ = std::make_unique<URLDownloader>( - distiller_factory_.get(), distiller_page_factory_.get(), prefs, + distiller_service_, distiller_page_factory_.get(), prefs, chrome_profile_path, url_loader_factory, base::BindRepeating(&ReadingListDownloadService::OnDownloadEnd, weak_ptr_factory_.GetWeakPtr()),
diff --git a/ios/chrome/browser/reading_list/model/reading_list_download_service_factory.mm b/ios/chrome/browser/reading_list/model/reading_list_download_service_factory.mm index 594a6466..e7d3d4f 100644 --- a/ios/chrome/browser/reading_list/model/reading_list_download_service_factory.mm +++ b/ios/chrome/browser/reading_list/model/reading_list_download_service_factory.mm
@@ -6,8 +6,7 @@ #import "base/files/file_path.h" #import "base/no_destructor.h" -#import "components/dom_distiller/core/distiller.h" -#import "components/dom_distiller/core/distiller_url_fetcher.h" +#import "ios/chrome/browser/dom_distiller/model/distiller_service_factory.h" #import "ios/chrome/browser/favicon/model/favicon_service_factory.h" #import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/reading_list/model/reading_list_distiller_page_factory.h" @@ -36,6 +35,7 @@ DependsOn(ReadingListModelFactory::GetInstance()); DependsOn(ios::FaviconServiceFactory::GetInstance()); DependsOn(ios::HistoryServiceFactory::GetInstance()); + DependsOn(DistillerServiceFactory::GetInstance()); } ReadingListDownloadServiceFactory::~ReadingListDownloadServiceFactory() {} @@ -50,17 +50,9 @@ std::make_unique<reading_list::ReadingListDistillerPageFactory>( context); - auto distiller_url_fetcher_factory = - std::make_unique<dom_distiller::DistillerURLFetcherFactory>( - context->GetSharedURLLoaderFactory()); - - dom_distiller::proto::DomDistillerOptions options; - auto distiller_factory = - std::make_unique<dom_distiller::DistillerFactoryImpl>( - std::move(distiller_url_fetcher_factory), options); - return std::make_unique<ReadingListDownloadService>( ReadingListModelFactory::GetForProfile(profile), profile->GetPrefs(), profile->GetStatePath(), profile->GetSharedURLLoaderFactory(), - std::move(distiller_factory), std::move(distiller_page_factory)); + DistillerServiceFactory::GetForProfile(profile), + std::move(distiller_page_factory)); }
diff --git a/ios/chrome/browser/reading_list/model/url_downloader.h b/ios/chrome/browser/reading_list/model/url_downloader.h index 8978ddaa..d0eb83a 100644 --- a/ios/chrome/browser/reading_list/model/url_downloader.h +++ b/ios/chrome/browser/reading_list/model/url_downloader.h
@@ -12,6 +12,7 @@ #import "base/functional/callback.h" #import "base/memory/raw_ptr.h" #import "base/task/cancelable_task_tracker.h" +#import "ios/chrome/browser/dom_distiller/model/distiller_service.h" #import "ios/chrome/browser/dom_distiller/model/distiller_viewer.h" #import "ios/chrome/browser/reading_list/model/reading_list_distiller_page.h" @@ -82,7 +83,7 @@ // and a boolean indicating success. For downloads, if distillation was // successful, it will also include the distilled url and extracted title. URLDownloader( - dom_distiller::DistillerFactory* distiller_factory, + DistillerService* distiller_service, reading_list::ReadingListDistillerPageFactory* distiller_page_factory, PrefService* prefs, base::FilePath chrome_profile_path, @@ -157,8 +158,7 @@ void DistillerCallback( const GURL& pageURL, const std::string& html, - const std::vector<dom_distiller::DistillerViewerInterface::ImageInfo>& - images, + const std::vector<DistillerViewerInterface::ImageInfo>& images, const std::string& title, const std::string& csp_nonce); @@ -170,7 +170,7 @@ raw_ptr<reading_list::ReadingListDistillerPageFactory> distiller_page_factory_; - raw_ptr<dom_distiller::DistillerFactory> distiller_factory_; + raw_ptr<DistillerService> distiller_service_; raw_ptr<PrefService> pref_service_; const DownloadCompletion download_completion_; const SuccessCompletion delete_completion_; @@ -186,7 +186,7 @@ std::unique_ptr<network::SimpleURLLoader> url_loader_; // URLLoaderFactory needed for the URLLoader. scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_; - std::unique_ptr<dom_distiller::DistillerViewerInterface> distiller_; + std::unique_ptr<DistillerViewerInterface> distiller_viewer_; scoped_refptr<base::SequencedTaskRunner> task_runner_; base::CancelableTaskTracker task_tracker_;
diff --git a/ios/chrome/browser/reading_list/model/url_downloader.mm b/ios/chrome/browser/reading_list/model/url_downloader.mm index 8b98bd7c..69986d49 100644 --- a/ios/chrome/browser/reading_list/model/url_downloader.mm +++ b/ios/chrome/browser/reading_list/model/url_downloader.mm
@@ -112,8 +112,7 @@ std::string ReplaceImagesInHTML( const GURL& url, const std::string& html, - const std::vector<dom_distiller::DistillerViewerInterface::ImageInfo>& - images, + const std::vector<DistillerViewerInterface::ImageInfo>& images, const GURL& distilled_url, const std::string& csp_nonce) { std::string mutable_html = html; @@ -193,8 +192,7 @@ // Saves distilled html to disk, including saving images and main file. std::pair<URLDownloader::SuccessState, int64_t> SaveDistilledHTML( const GURL& url, - const std::vector<dom_distiller::DistillerViewerInterface::ImageInfo>& - images, + const std::vector<DistillerViewerInterface::ImageInfo>& images, const std::string& html, const base::FilePath& base_directory, const GURL& distilled_url, @@ -233,7 +231,7 @@ // URLDownloader URLDownloader::URLDownloader( - dom_distiller::DistillerFactory* distiller_factory, + DistillerService* distiller_service, reading_list::ReadingListDistillerPageFactory* distiller_page_factory, PrefService* prefs, base::FilePath chrome_profile_path, @@ -241,7 +239,7 @@ const DownloadCompletion& download_completion, const SuccessCompletion& delete_completion) : distiller_page_factory_(distiller_page_factory), - distiller_factory_(distiller_factory), + distiller_service_(distiller_service), pref_service_(prefs), download_completion_(download_completion), delete_completion_(delete_completion), @@ -326,7 +324,7 @@ SuccessState success) { download_completion_.Run(url, distilled_url_, success, offline_path, saved_size_, title); - distiller_.reset(); + distiller_viewer_.reset(); working_ = false; HandleNextTask(); } @@ -357,7 +355,7 @@ base::BindOnce(&URLDownloader::DeleteCompletionHandler, weak_factory_.GetWeakPtr(), url)); } else if (task.first == DOWNLOAD) { - DCHECK(!distiller_); + DCHECK(!distiller_viewer_); OfflinePathExists(directory_path, base::BindOnce(&URLDownloader::DownloadURL, weak_factory_.GetWeakPtr(), url)); @@ -378,8 +376,8 @@ reading_list_distiller_page = distiller_page_factory_->CreateReadingListDistillerPage(url, this); - distiller_.reset(new dom_distiller::DistillerViewer( - distiller_factory_, std::move(reading_list_distiller_page), pref_service_, + distiller_viewer_.reset(new DistillerViewer( + distiller_service_, std::move(reading_list_distiller_page), pref_service_, url, base::BindRepeating(&URLDownloader::DistillerCallback, weak_factory_.GetWeakPtr()))); @@ -423,7 +421,7 @@ void URLDownloader::CancelTask() { task_tracker_.TryCancelAll(); - distiller_.reset(); + distiller_viewer_.reset(); } void URLDownloader::FetchPDFFile() { @@ -445,8 +443,7 @@ void URLDownloader::DistillerCallback( const GURL& page_url, const std::string& html, - const std::vector<dom_distiller::DistillerViewerInterface::ImageInfo>& - images, + const std::vector<DistillerViewerInterface::ImageInfo>& images, const std::string& title, const std::string& csp_nonce) { if (html.empty()) {
diff --git a/ios/chrome/browser/reading_list/model/url_downloader_unittest.mm b/ios/chrome/browser/reading_list/model/url_downloader_unittest.mm index cf6ff5d..4e53ee3 100644 --- a/ios/chrome/browser/reading_list/model/url_downloader_unittest.mm +++ b/ios/chrome/browser/reading_list/model/url_downloader_unittest.mm
@@ -31,7 +31,7 @@ const char kBadImageUrl[] = "http://image/bad"; const char kGoodImageUrl[] = "http://image/good"; -class DistillerViewerTest : public dom_distiller::DistillerViewerInterface { +class DistillerViewerTest : public DistillerViewerInterface { public: DistillerViewerTest(const GURL& url, DistillationFinishedCallback callback, @@ -39,7 +39,7 @@ const std::string& html, const GURL& redirect_url, const std::string& mime_type) - : dom_distiller::DistillerViewerInterface(nil) { + : DistillerViewerInterface(nil) { std::vector<ImageInfo> images; ImageInfo image; @@ -127,7 +127,7 @@ } original_url_ = url; saved_size_ = 0; - distiller_.reset(new DistillerViewerTest( + distiller_viewer_.reset(new DistillerViewerTest( url, base::BindRepeating(&URLDownloader::DistillerCallback, base::Unretained(this)),
diff --git a/ios/chrome/browser/reminder_notifications/coordinator/BUILD.gn b/ios/chrome/browser/reminder_notifications/coordinator/BUILD.gn index 3d65063..28c047fb3 100644 --- a/ios/chrome/browser/reminder_notifications/coordinator/BUILD.gn +++ b/ios/chrome/browser/reminder_notifications/coordinator/BUILD.gn
@@ -28,6 +28,7 @@ "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/public/commands", "//ios/chrome/test:test_support", + "//ios/web/public/test", "//testing/gtest", "//third_party/ocmock", ]
diff --git a/ios/chrome/browser/reminder_notifications/coordinator/reminder_notifications_coordinator_unittest.mm b/ios/chrome/browser/reminder_notifications/coordinator/reminder_notifications_coordinator_unittest.mm index 2059109..2636a77 100644 --- a/ios/chrome/browser/reminder_notifications/coordinator/reminder_notifications_coordinator_unittest.mm +++ b/ios/chrome/browser/reminder_notifications/coordinator/reminder_notifications_coordinator_unittest.mm
@@ -6,7 +6,6 @@ #import <UIKit/UIKit.h> -#import "base/test/task_environment.h" #import "ios/chrome/browser/reminder_notifications/ui/reminder_notifications_view_controller.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" @@ -14,6 +13,7 @@ #import "ios/chrome/browser/shared/public/commands/reminder_notifications_commands.h" #import "ios/chrome/common/ui/confirmation_alert/confirmation_alert_action_handler.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -49,7 +49,7 @@ return coordinator_; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; ReminderNotificationsCoordinator* coordinator_;
diff --git a/ios/chrome/browser/save_to_drive/ui_bundled/BUILD.gn b/ios/chrome/browser/save_to_drive/ui_bundled/BUILD.gn index f68c871..0aa4f6d 100644 --- a/ios/chrome/browser/save_to_drive/ui_bundled/BUILD.gn +++ b/ios/chrome/browser/save_to_drive/ui_bundled/BUILD.gn
@@ -115,6 +115,7 @@ "//ios/chrome/browser/signin/model:fake_system_identity", "//ios/chrome/test/fakes", "//ios/web/public/download", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", "//third_party/ocmock",
diff --git a/ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_coordinator_unittest.mm b/ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_coordinator_unittest.mm index 698cf222..0b60136 100644 --- a/ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_coordinator_unittest.mm +++ b/ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_coordinator.h" #import "base/apple/foundation_util.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_configuration.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_coordinator.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_coordinator_delegate.h" @@ -31,6 +30,7 @@ #import "ios/chrome/test/fakes/fake_ui_view_controller.h" #import "ios/web/public/test/fakes/fake_download_task.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -122,7 +122,7 @@ browser_->GetWebStateList()->GetActiveWebState()); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; UIViewController* base_view_controller_;
diff --git a/ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_mediator_unittest.mm b/ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_mediator_unittest.mm index d3dfa4e..44ee302 100644 --- a/ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_mediator_unittest.mm +++ b/ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_mediator_unittest.mm
@@ -6,7 +6,6 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/download/model/download_manager_tab_helper.h" #import "ios/chrome/browser/drive/model/drive_metrics.h" #import "ios/chrome/browser/drive/model/drive_service_factory.h" @@ -24,6 +23,7 @@ #import "ios/chrome/browser/signin/model/fake_system_identity.h" #import "ios/web/public/test/fakes/fake_download_task.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/gtest_support.h" @@ -112,7 +112,7 @@ DownloadManagerTabHelper::FromWebState(web_state_.get())); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; base::test::ScopedFeatureList scoped_feature_list_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<web::FakeWebState> web_state_;
diff --git a/ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_coordinator_unittest.mm b/ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_coordinator_unittest.mm index 83b78627..8f1a0472 100644 --- a/ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_coordinator_unittest.mm +++ b/ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_coordinator_unittest.mm
@@ -7,7 +7,6 @@ #import <StoreKit/StoreKit.h> #import "base/apple/foundation_util.h" -#import "base/test/task_environment.h" #import "components/signin/public/identity_manager/identity_test_environment.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_configuration.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_coordinator.h" @@ -38,6 +37,7 @@ #import "ios/chrome/browser/store_kit/model/store_kit_coordinator.h" #import "ios/chrome/test/fakes/fake_ui_view_controller.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -160,7 +160,7 @@ browser_->GetWebStateList()->GetActiveWebState()); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; FakeUIViewController* base_view_controller_;
diff --git a/ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_mediator_unittest.mm b/ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_mediator_unittest.mm index ed34a3f..a6d3a58 100644 --- a/ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_mediator_unittest.mm +++ b/ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_mediator_unittest.mm
@@ -9,7 +9,6 @@ #import "base/functional/callback_forward.h" #import "base/strings/sys_string_conversions.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "components/prefs/pref_service.h" #import "components/signin/public/base/consent_level.h" #import "components/signin/public/identity_manager/identity_test_utils.h" @@ -36,6 +35,7 @@ #import "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/providers/photos/test_photos_service.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -207,7 +207,7 @@ ImageFetchTabHelper::FromWebState(web_state_.get())); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; std::unique_ptr<web::FakeWebState> web_state_;
diff --git a/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h b/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h index cd9b7f2e..2090662 100644 --- a/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h +++ b/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h
@@ -20,10 +20,6 @@ static TabGroupSyncService* GetForProfile(ProfileIOS* profile); static TabGroupSyncServiceFactory* GetInstance(); - // Returns the default factory used to build TabGroupSyncService-s. Can be - // registered with AddTestingFactory to use real instances during testing. - static TestingFactory GetDefaultFactory(); - private: friend class base::NoDestructor<TabGroupSyncServiceFactory>;
diff --git a/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.mm b/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.mm index 7beab05..a1d6e89 100644 --- a/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.mm +++ b/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.mm
@@ -96,16 +96,9 @@ return instance.get(); } -// static -BrowserStateKeyedServiceFactory::TestingFactory -TabGroupSyncServiceFactory::GetDefaultFactory() { - return base::BindOnce(&BuildService, nullptr); -} - TabGroupSyncServiceFactory::TabGroupSyncServiceFactory() : ProfileKeyedServiceFactoryIOS("TabGroupSyncServiceFactory", - ServiceCreation::kCreateWithProfile, - TestingCreation::kNoServiceForTests), + ServiceCreation::kCreateWithProfile), synthetic_field_trial_helper_(std::make_unique<SyntheticFieldTrialHelper>( base::BindRepeating(&TabGroupSyncServiceFactory::OnHadSyncedTabGroup), base::BindRepeating(
diff --git a/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory_unittest.mm b/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory_unittest.mm index 126c688..1f4af3c 100644 --- a/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory_unittest.mm +++ b/ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory_unittest.mm
@@ -25,8 +25,6 @@ }, /*disable_features=*/{}); TestProfileIOS::Builder builder; - builder.AddTestingFactory(TabGroupSyncServiceFactory::GetInstance(), - TabGroupSyncServiceFactory::GetDefaultFactory()); profile_ = std::move(builder).Build(); }
diff --git a/ios/chrome/browser/search_with/ui_bundled/search_with_mediator_egtest.mm b/ios/chrome/browser/search_with/ui_bundled/search_with_mediator_egtest.mm index 75b8354..d468ac0 100644 --- a/ios/chrome/browser/search_with/ui_bundled/search_with_mediator_egtest.mm +++ b/ios/chrome/browser/search_with/ui_bundled/search_with_mediator_egtest.mm
@@ -12,6 +12,7 @@ #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/test/earl_grey/chrome_actions.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" +#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/testing/earl_grey/earl_grey_test.h" @@ -24,6 +25,8 @@ namespace { const char kElementToLongPress[] = "selectid"; +ElementSelector* kElementToLongPressSelector = + [ElementSelector selectorWithElementID:kElementToLongPress]; // An HTML template that puts some text in a simple span element. const char kBasicSelectionUrl[] = "/basic"; @@ -108,38 +111,6 @@ error:&error]; return !error; } - -// Long presses on `element_id`. -void LongPressElement(const char* element_id) { - // Use triggers_context_menu = true as this is really "triggers_browser_menu". - [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()] - performAction:chrome_test_util::LongPressElementForContextMenu( - [ElementSelector selectorWithElementID:element_id], - true)]; -} - -// Convenient function to trigger the Edit Menu on `kElementToLongPress`. -// TODO(crbug.com/40264849): extract this function and have all edit menu -// tests use it. -void TriggerEditMenu() { - [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] - assertWithMatcher:grey_notVisible()]; - LongPressElement(kElementToLongPress); - - NSError* error = nil; - [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] - assertWithMatcher:grey_sufficientlyVisible() - error:&error]; - if (error) { - // If edit is not visible, try to tap the element again. - // This is possible on inputs when the first long press just selects the - // input. - LongPressElement(kElementToLongPress); - [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] - assertWithMatcher:grey_sufficientlyVisible()]; - } -} - } // namespace // Tests for the Search With Edit menu entry. @@ -179,7 +150,7 @@ - (void)testSearchWith { [self loadPage]; - TriggerEditMenu(); + [ChromeEarlGreyUI triggerEditMenu:kElementToLongPressSelector]; bool found = FindEditMenuAction(@"Search with test"); GREYAssertTrue(found, @"Search Web button not found"); [[EarlGrey selectElementWithMatcher: @@ -195,7 +166,7 @@ - (void)testSearchWithIncognito { [ChromeEarlGrey openNewIncognitoTab]; [self loadPage]; - TriggerEditMenu(); + [ChromeEarlGreyUI triggerEditMenu:kElementToLongPressSelector]; bool found = FindEditMenuAction(@"Search with test"); GREYAssertTrue(found, @"Search Web button not found"); [[EarlGrey selectElementWithMatcher:
diff --git a/ios/chrome/browser/sessions/model/BUILD.gn b/ios/chrome/browser/sessions/model/BUILD.gn index 7f4a219..f585166 100644 --- a/ios/chrome/browser/sessions/model/BUILD.gn +++ b/ios/chrome/browser/sessions/model/BUILD.gn
@@ -422,11 +422,15 @@ ":test_support", "//base", "//base/test:test_support", + "//components/data_sharing:test_support", "//components/prefs", + "//components/saved_tab_groups/test_support", "//components/sessions:session_id", "//components/tab_groups", + "//ios/chrome/browser/data_sharing/model", "//ios/chrome/browser/main/model", "//ios/chrome/browser/ntp/model", + "//ios/chrome/browser/saved_tab_groups/model", "//ios/chrome/browser/sessions/model/proto", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/browser/test:test_support",
diff --git a/ios/chrome/browser/sessions/model/DEPS b/ios/chrome/browser/sessions/model/DEPS index 51cf302b..1ffc5b2 100644 --- a/ios/chrome/browser/sessions/model/DEPS +++ b/ios/chrome/browser/sessions/model/DEPS
@@ -14,6 +14,8 @@ "+ios/chrome/browser/shared/coordinator/scene/scene_state.h", ], "^.*_unittest.mm": [ + "+components/data_sharing/test_support", + "+components/saved_tab_groups/test_support", "+ios/chrome/browser/web/model/chrome_web_client.h", ] }
diff --git a/ios/chrome/browser/sessions/model/legacy_session_restoration_service_unittest.mm b/ios/chrome/browser/sessions/model/legacy_session_restoration_service_unittest.mm index e2f8840d..f1a5816 100644 --- a/ios/chrome/browser/sessions/model/legacy_session_restoration_service_unittest.mm +++ b/ios/chrome/browser/sessions/model/legacy_session_restoration_service_unittest.mm
@@ -22,6 +22,8 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" #import "base/time/time.h" +#import "components/saved_tab_groups/test_support/fake_tab_group_sync_service.h" +#import "ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h" #import "ios/chrome/browser/sessions/model/session_constants.h" #import "ios/chrome/browser/sessions/model/session_internal_util.h" #import "ios/chrome/browser/sessions/model/session_loading.h" @@ -372,7 +374,16 @@ // Create a test ProfileIOS and an object to track the files // that are created by the session restoration service operations. - profile_ = TestProfileIOS::Builder().Build(); + TestProfileIOS::Builder builder; + builder.AddTestingFactory( + tab_groups::TabGroupSyncServiceFactory::GetInstance(), + base::BindOnce( + [](web::BrowserState* context) -> std::unique_ptr<KeyedService> { + // Creates a FakeTabGroupSyncService, as the real implementation + // affects the list of created files. + return std::make_unique<tab_groups::FakeTabGroupSyncService>(); + })); + profile_ = std::move(builder).Build(); file_tracker_.Start(profile_->GetStatePath()); SessionServiceIOS* session_service_ios = [[SessionServiceIOS alloc]
diff --git a/ios/chrome/browser/sessions/model/session_restoration_service_factory_unittest.mm b/ios/chrome/browser/sessions/model/session_restoration_service_factory_unittest.mm index c219c862..1d6108a 100644 --- a/ios/chrome/browser/sessions/model/session_restoration_service_factory_unittest.mm +++ b/ios/chrome/browser/sessions/model/session_restoration_service_factory_unittest.mm
@@ -6,14 +6,16 @@ #import "base/run_loop.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "base/types/cxx23_to_underlying.h" +#import "components/data_sharing/test_support/mock_data_sharing_service.h" #import "components/prefs/pref_service.h" +#import "ios/chrome/browser/data_sharing/model/data_sharing_service_factory.h" #import "ios/chrome/browser/sessions/model/proto/storage.pb.h" #import "ios/chrome/browser/sessions/model/session_constants.h" #import "ios/chrome/browser/sessions/model/session_internal_util.h" #import "ios/chrome/browser/sessions/model/session_window_ios.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -102,12 +104,23 @@ return ios::sessions::ParseProto(session_path, session_storage); } +// Creates a MockDataSharingService. +std::unique_ptr<KeyedService> CreateMockDataSharingService( + web::BrowserState* context) { + return std::make_unique<data_sharing::MockDataSharingService>(); +} + } // namespace class SessionRestorationServiceFactoryTest : public PlatformTest { public: - SessionRestorationServiceFactoryTest() - : profile_(TestProfileIOS::Builder().Build()) {} + SessionRestorationServiceFactoryTest() { + TestProfileIOS::Builder builder; + builder.AddTestingFactory( + data_sharing::DataSharingServiceFactory::GetInstance(), + base::BindRepeating(&CreateMockDataSharingService)); + profile_ = std::move(builder).Build(); + } ProfileIOS* profile() { return profile_.get(); } @@ -118,7 +131,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; base::HistogramTester histogram_tester_; };
diff --git a/ios/chrome/browser/sessions/model/session_restoration_service_impl_unittest.mm b/ios/chrome/browser/sessions/model/session_restoration_service_impl_unittest.mm index 073572c..6084f05 100644 --- a/ios/chrome/browser/sessions/model/session_restoration_service_impl_unittest.mm +++ b/ios/chrome/browser/sessions/model/session_restoration_service_impl_unittest.mm
@@ -20,6 +20,8 @@ #import "base/scoped_multi_source_observation.h" #import "base/test/metrics/histogram_tester.h" #import "base/time/time.h" +#import "components/saved_tab_groups/test_support/fake_tab_group_sync_service.h" +#import "ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h" #import "ios/chrome/browser/sessions/model/proto/storage.pb.h" #import "ios/chrome/browser/sessions/model/session_constants.h" #import "ios/chrome/browser/sessions/model/session_internal_util.h" @@ -364,7 +366,16 @@ // Create a test ProfileIOS and an object to track the files // that are created by the session restoration service operations. - profile_ = TestProfileIOS::Builder().Build(); + TestProfileIOS::Builder builder; + builder.AddTestingFactory( + tab_groups::TabGroupSyncServiceFactory::GetInstance(), + base::BindOnce( + [](web::BrowserState* context) -> std::unique_ptr<KeyedService> { + // Creates a FakeTabGroupSyncService, as the real implementation + // affects the list of created files. + return std::make_unique<tab_groups::FakeTabGroupSyncService>(); + })); + profile_ = std::move(builder).Build(); file_tracker_.Start(profile_->GetStatePath()); // Create the service, force enabling features support.
diff --git a/ios/chrome/browser/settings/ui_bundled/downloads/BUILD.gn b/ios/chrome/browser/settings/ui_bundled/downloads/BUILD.gn index 5c212f87..f1c0e87 100644 --- a/ios/chrome/browser/settings/ui_bundled/downloads/BUILD.gn +++ b/ios/chrome/browser/settings/ui_bundled/downloads/BUILD.gn
@@ -89,6 +89,7 @@ "//ios/chrome/browser/signin/model:test_support", "//ios/chrome/common/ui/colors", "//ios/chrome/test/fakes", + "//ios/web/public/test", "//testing/gtest", "//third_party/ocmock", "//ui/base",
diff --git a/ios/chrome/browser/settings/ui_bundled/downloads/downloads_settings_coordinator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/downloads/downloads_settings_coordinator_unittest.mm index 661cbc2..0203084 100644 --- a/ios/chrome/browser/settings/ui_bundled/downloads/downloads_settings_coordinator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/downloads/downloads_settings_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/settings/ui_bundled/downloads/downloads_settings_coordinator.h" #import "base/apple/foundation_util.h" -#import "base/test/task_environment.h" #import "components/signin/public/identity_manager/identity_test_environment.h" #import "ios/chrome/browser/authentication/ui_bundled/signin/signin_constants.h" #import "ios/chrome/browser/photos/model/photos_service_factory.h" @@ -30,6 +29,7 @@ #import "ios/chrome/browser/signin/model/system_identity.h" #import "ios/chrome/test/fakes/fake_ui_navigation_controller.h" #import "ios/chrome/test/fakes/fake_ui_view_controller.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/gtest_support.h" @@ -135,7 +135,7 @@ } } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; FakeUINavigationController* base_navigation_controller_;
diff --git a/ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/BUILD.gn b/ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/BUILD.gn index 027aefc0..826b013 100644 --- a/ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/BUILD.gn +++ b/ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/BUILD.gn
@@ -74,6 +74,7 @@ "//ios/chrome/browser/signin/model:fake_system_identity_manager", "//ios/chrome/browser/signin/model:test_support", "//ios/chrome/common/ui/colors", + "//ios/web/public/test", "//testing/gtest", "//ui/base", ]
diff --git a/ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/save_to_photos_settings_mediator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/save_to_photos_settings_mediator_unittest.mm index 31ecca20..490ab35 100644 --- a/ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/save_to_photos_settings_mediator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/save_to_photos_settings_mediator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/settings/ui_bundled/downloads/save_to_photos/save_to_photos_settings_mediator.h" #import "base/strings/sys_string_conversions.h" -#import "base/test/task_environment.h" #import "components/prefs/pref_service.h" #import "components/signin/public/identity_manager/identity_test_utils.h" #import "ios/chrome/browser/account_picker/ui_bundled/account_picker_selection/account_picker_selection_screen_identity_item_configurator.h" @@ -22,6 +21,7 @@ #import "ios/chrome/browser/signin/model/fake_system_identity_manager.h" #import "ios/chrome/browser/signin/model/identity_manager_factory.h" #import "ios/chrome/browser/signin/model/identity_test_environment_browser_state_adaptor.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -224,7 +224,7 @@ } } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; id<SystemIdentity> fake_identity_a_; id<SystemIdentity> fake_identity_b_;
diff --git a/ios/chrome/browser/settings/ui_bundled/google_services/google_services_settings_egtest.mm b/ios/chrome/browser/settings/ui_bundled/google_services/google_services_settings_egtest.mm index 76e3f4a..183668e 100644 --- a/ios/chrome/browser/settings/ui_bundled/google_services/google_services_settings_egtest.mm +++ b/ios/chrome/browser/settings/ui_bundled/google_services/google_services_settings_egtest.mm
@@ -236,12 +236,8 @@ // Sign in with a managed identity. FakeSystemIdentity* fakeManagedIdentity = [FakeSystemIdentity fakeManagedIdentity]; - if ([SigninEarlGrey areSeparateProfilesForManagedAccountsEnabled]) { - [SigninEarlGrey - signinWithFakeManagedIdentityInPersonalProfile:fakeManagedIdentity]; - } else { - [SigninEarlGrey signinWithFakeIdentity:fakeManagedIdentity]; - } + [SigninEarlGrey + signinWithFakeManagedIdentityInPersonalProfile:fakeManagedIdentity]; [SigninEarlGrey verifySignedInWithFakeIdentity:fakeManagedIdentity]; // Turn off "Allow Chrome Sign-in" feature, which prompts the user with a
diff --git a/ios/chrome/browser/settings/ui_bundled/google_services/manage_accounts/legacy_accounts_table_egtest.mm b/ios/chrome/browser/settings/ui_bundled/google_services/manage_accounts/legacy_accounts_table_egtest.mm index 5d763b7..de4ac41 100644 --- a/ios/chrome/browser/settings/ui_bundled/google_services/manage_accounts/legacy_accounts_table_egtest.mm +++ b/ios/chrome/browser/settings/ui_bundled/google_services/manage_accounts/legacy_accounts_table_egtest.mm
@@ -492,12 +492,7 @@ - (void)testSignOutWithManagedAccount { // Sign In `fakeManagedIdentity`. FakeSystemIdentity* fakeIdentity = [FakeSystemIdentity fakeManagedIdentity]; - if ([SigninEarlGrey areSeparateProfilesForManagedAccountsEnabled]) { - [SigninEarlGrey - signinWithFakeManagedIdentityInPersonalProfile:fakeIdentity]; - } else { - [SigninEarlGrey signinWithFakeIdentity:fakeIdentity]; - } + [SigninEarlGrey signinWithFakeManagedIdentityInPersonalProfile:fakeIdentity]; [BookmarkEarlGrey setupStandardBookmarksInStorage:BookmarkStorageType::kLocalOrSyncable];
diff --git a/ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_coordinator.mm b/ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_coordinator.mm index 63f9f52..f9a42f1a 100644 --- a/ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_coordinator.mm +++ b/ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_coordinator.mm
@@ -490,7 +490,7 @@ accountMenuCoordinatorWithBaseViewController:self.viewController browser:self.browser contextStyle:SigninContextStyle::kDefault - anchorView:_viewController.view + anchorView:nil accessPoint:AccountMenuAccessPoint:: kSettings];
diff --git a/ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_egtest.mm b/ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_egtest.mm index 642e370e..6b3cd29 100644 --- a/ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_egtest.mm +++ b/ios/chrome/browser/settings/ui_bundled/google_services/manage_sync_settings_egtest.mm
@@ -1778,11 +1778,6 @@ // Test signing out from the account menu. - (void)testSignOutFromAccountFromAccountMenu { - // TODO(crbug.com/404180896): Test fails on iPad. - if ([ChromeEarlGrey isIPadIdiom]) { - EARL_GREY_TEST_DISABLED(@"Fails on iPad."); - } - // Separate profiles are only available in iOS 17+. if (!@available(iOS 17, *)) { return;
diff --git a/ios/chrome/browser/settings/ui_bundled/language/BUILD.gn b/ios/chrome/browser/settings/ui_bundled/language/BUILD.gn index 51d9d82..e3a956e 100644 --- a/ios/chrome/browser/settings/ui_bundled/language/BUILD.gn +++ b/ios/chrome/browser/settings/ui_bundled/language/BUILD.gn
@@ -89,6 +89,7 @@ "//ios/chrome/browser/shared/model/prefs:browser_prefs", "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/translate/model", + "//ios/web/public/test", "//testing/gmock", "//testing/gtest", "//ui/base:base",
diff --git a/ios/chrome/browser/settings/ui_bundled/language/language_settings_mediator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/language/language_settings_mediator_unittest.mm index 58973552..a54037c 100644 --- a/ios/chrome/browser/settings/ui_bundled/language/language_settings_mediator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/language/language_settings_mediator_unittest.mm
@@ -11,7 +11,6 @@ #import "base/containers/contains.h" #import "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" -#import "base/test/task_environment.h" #import "base/time/time.h" #import "components/language/core/browser/language_prefs.h" #import "components/language/core/browser/pref_names.h" @@ -27,6 +26,7 @@ #import "ios/chrome/browser/shared/model/prefs/browser_prefs.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/translate/model/chrome_ios_translate_client.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -92,7 +92,7 @@ class LanguageSettingsMediatorTest : public PlatformTest { protected: LanguageSettingsMediatorTest() - : task_environment_(base::test::TaskEnvironment::MainThreadType::UI) { + : task_environment_(web::WebTaskEnvironment::MainThreadType::UI) { // Create profile. TestProfileIOS::Builder builder; builder.SetPrefService(CreatePrefService()); @@ -140,7 +140,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<translate::TranslatePrefs> translate_prefs_; FakeLanguageSettingsConsumer* consumer_;
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_coordinator.mm b/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_coordinator.mm index 32f1fd7..4949b31c 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_coordinator.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_coordinator.mm
@@ -187,10 +187,11 @@ self.mediator.consumer = self.viewController; self.viewController.handler = self; self.viewController.delegate = self.mediator; - self.viewController.applicationCommandsHandler = HandlerForProtocol( - self.browser->GetCommandDispatcher(), ApplicationCommands); - self.viewController.snackbarCommandsHandler = HandlerForProtocol( - self.browser->GetCommandDispatcher(), SnackbarCommands); + CommandDispatcher* dispatcher = self.browser->GetCommandDispatcher(); + self.viewController.applicationHandler = + HandlerForProtocol(dispatcher, ApplicationCommands); + self.viewController.snackbarHandler = + HandlerForProtocol(dispatcher, SnackbarCommands); self.viewController.reauthModule = self.reauthenticationModule; if (self.openInEditMode) { [self.viewController editButtonPressed];
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller.h b/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller.h index ab12029..e2cb463d 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller.h +++ b/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller.h
@@ -9,11 +9,9 @@ #import "ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_consumer.h" #import "ios/chrome/browser/settings/ui_bundled/settings_controller_protocol.h" -@protocol ApplicationCommands; @protocol PasswordDetailsHandler; @protocol PasswordDetailsTableViewControllerDelegate; @protocol ReauthenticationProtocol; -@protocol SnackbarCommands; // Screen which shows password details and allows to edit it. @interface PasswordDetailsTableViewController @@ -33,12 +31,6 @@ @property(nonatomic, weak) id<PasswordDetailsTableViewControllerDelegate> delegate; -// ApplicationCommands handler. -@property(nonatomic, weak) id<ApplicationCommands> applicationCommandsHandler; - -// SnackbarCommands handler. -@property(nonatomic, weak) id<SnackbarCommands> snackbarCommandsHandler; - // Module containing the reauthentication mechanism for interactions // with password. @property(nonatomic, weak) id<ReauthenticationProtocol> reauthModule;
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller.mm b/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller.mm index ecf6b656..0ea15548 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller.mm
@@ -651,7 +651,7 @@ } case PasswordDetailsItemTypeChangePasswordButton: if (!self.tableView.editing) { - DCHECK(self.applicationCommandsHandler); + CHECK(self.applicationHandler); CredentialDetails* passwordDetails = self.credentials[indexPath.section]; DCHECK(passwordDetails.changePasswordURL.has_value()); @@ -664,7 +664,7 @@ OpenNewTabCommand* command = [OpenNewTabCommand commandWithURLFromChrome:passwordDetails.changePasswordURL.value()]; - [self.applicationCommandsHandler closePresentedViewsAndOpenURL:command]; + [self.applicationHandler closePresentedViewsAndOpenURL:command]; } break; case PasswordDetailsItemTypeNote: { @@ -1085,10 +1085,10 @@ TriggerHapticFeedbackForNotification(success ? UINotificationFeedbackTypeSuccess : UINotificationFeedbackTypeError); - [self.snackbarCommandsHandler showSnackbarWithMessage:message - buttonText:nil - messageAction:nil - completionAction:nil]; + [self.snackbarHandler showSnackbarWithMessage:message + buttonText:nil + messageAction:nil + completionAction:nil]; if ([self.tableView indexPathForSelectedRow]) { [self.tableView
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller_unittest.mm b/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller_unittest.mm index 1862d5616..f0875aa 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_details/password_details_table_view_controller_unittest.mm
@@ -205,7 +205,7 @@ controller.handler = handler_; controller.delegate = delegate_; controller.reauthModule = reauthentication_module_; - controller.snackbarCommandsHandler = snack_bar_; + controller.snackbarHandler = snack_bar_; return controller; } @@ -577,7 +577,7 @@ controller()); id applicationCommandsMock = OCMProtocolMock(@protocol(ApplicationCommands)); - password_details.applicationCommandsHandler = applicationCommandsMock; + password_details.applicationHandler = applicationCommandsMock; TableViewModel* model = password_details.tableViewModel; NSIndexPath* indexPath =
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_picker_coordinator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_picker_coordinator_unittest.mm index 845d1e9..a7bf1d9 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_picker_coordinator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_picker_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_picker_coordinator.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "components/password_manager/core/browser/sharing/recipients_fetcher.h" #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_picker_view_controller.h" #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_picker_view_controller_presentation_delegate.h" @@ -18,6 +17,7 @@ #import "ios/chrome/browser/shared/public/commands/open_new_tab_command.h" #import "ios/chrome/browser/shared/public/commands/settings_commands.h" #import "ios/chrome/test/fakes/fake_ui_navigation_controller.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -67,7 +67,7 @@ @protocol(FamilyPickerViewControllerPresentationDelegate)]); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestBrowser> browser_; FamilyPickerCoordinator* coordinator_; FamilyPickerViewController* view_controller_;
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_promo_coordinator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_promo_coordinator_unittest.mm index aa936d5..de41c6be 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_promo_coordinator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_promo_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_promo_coordinator.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/family_promo_action_handler.h" #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_metrics.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" @@ -15,6 +14,7 @@ #import "ios/chrome/browser/shared/public/commands/open_new_tab_command.h" #import "ios/chrome/browser/shared/public/commands/settings_commands.h" #import "ios/chrome/test/fakes/fake_ui_view_controller.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -45,7 +45,7 @@ browser:browser_.get()]; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestBrowser> browser_; id mock_application_commands_handler_;
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_first_run_coordinator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_first_run_coordinator_unittest.mm index de6c469b..d11cd8a 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_first_run_coordinator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_first_run_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_first_run_coordinator.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_first_run_action_handler.h" #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_metrics.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" @@ -15,6 +14,7 @@ #import "ios/chrome/browser/shared/public/commands/open_new_tab_command.h" #import "ios/chrome/browser/shared/public/commands/settings_commands.h" #import "ios/chrome/test/fakes/fake_ui_view_controller.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -42,7 +42,7 @@ browser:browser_.get()]; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestBrowser> browser_; PasswordSharingFirstRunCoordinator* coordinator_;
diff --git a/ios/chrome/browser/settings/ui_bundled/password/password_sharing/sharing_status_coordinator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/password/password_sharing/sharing_status_coordinator_unittest.mm index 6dfe6e09..8a06704 100644 --- a/ios/chrome/browser/settings/ui_bundled/password/password_sharing/sharing_status_coordinator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/password/password_sharing/sharing_status_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/sharing_status_coordinator.h" #import "base/test/metrics/histogram_tester.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/password_sharing_metrics.h" #import "ios/chrome/browser/settings/ui_bundled/password/password_sharing/sharing_status_view_controller_presentation_delegate.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" @@ -15,6 +14,7 @@ #import "ios/chrome/browser/shared/public/commands/open_new_tab_command.h" #import "ios/chrome/browser/shared/public/commands/settings_commands.h" #import "ios/chrome/test/fakes/fake_ui_view_controller.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -49,7 +49,7 @@ @protocol(SharingStatusViewControllerPresentationDelegate)]); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestBrowser> browser_; SharingStatusCoordinator* coordinator_;
diff --git a/ios/chrome/browser/settings/ui_bundled/privacy/privacy_guide/BUILD.gn b/ios/chrome/browser/settings/ui_bundled/privacy/privacy_guide/BUILD.gn index 16116a1..f989046 100644 --- a/ios/chrome/browser/settings/ui_bundled/privacy/privacy_guide/BUILD.gn +++ b/ios/chrome/browser/settings/ui_bundled/privacy/privacy_guide/BUILD.gn
@@ -80,6 +80,7 @@ "//ios/chrome/browser/shared/model/browser/test:test_support", "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/test:test_support", + "//ios/web/public/test", "//testing/gtest", ] }
diff --git a/ios/chrome/browser/settings/ui_bundled/privacy/privacy_guide/privacy_guide_main_coordinator_unittest.mm b/ios/chrome/browser/settings/ui_bundled/privacy/privacy_guide/privacy_guide_main_coordinator_unittest.mm index b4a75c6..6343df9 100644 --- a/ios/chrome/browser/settings/ui_bundled/privacy/privacy_guide/privacy_guide_main_coordinator_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/privacy/privacy_guide/privacy_guide_main_coordinator_unittest.mm
@@ -10,10 +10,10 @@ #import "base/apple/foundation_util.h" #import "base/test/ios/wait_util.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -46,7 +46,7 @@ isKindOfClass:[UINavigationController class]]; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; UIViewController* root_view_controller_;
diff --git a/ios/chrome/browser/settings/ui_bundled/settings_root_table_view_controller_unittest.mm b/ios/chrome/browser/settings/ui_bundled/settings_root_table_view_controller_unittest.mm index fcfaa07..b1e4c46 100644 --- a/ios/chrome/browser/settings/ui_bundled/settings_root_table_view_controller_unittest.mm +++ b/ios/chrome/browser/settings/ui_bundled/settings_root_table_view_controller_unittest.mm
@@ -4,11 +4,11 @@ #import "ios/chrome/browser/settings/ui_bundled/settings_root_table_view_controller.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/settings/ui_bundled/settings_navigation_controller.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/grit/ios_strings.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -62,7 +62,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; };
diff --git a/ios/chrome/browser/shared/coordinator/alert/BUILD.gn b/ios/chrome/browser/shared/coordinator/alert/BUILD.gn index 8bd0f26..2552764 100644 --- a/ios/chrome/browser/shared/coordinator/alert/BUILD.gn +++ b/ios/chrome/browser/shared/coordinator/alert/BUILD.gn
@@ -41,6 +41,7 @@ "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/ui/util", "//ios/chrome/test:test_support", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", "//third_party/ocmock",
diff --git a/ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator_unittest.mm b/ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator_unittest.mm index 448fae38..c0144c1e 100644 --- a/ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator_unittest.mm +++ b/ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator_unittest.mm
@@ -7,10 +7,10 @@ #import <UIKit/UIKit.h> #import "base/apple/foundation_util.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "ui/base/l10n/l10n_util.h" @@ -49,7 +49,7 @@ base_view_controller_.presentedViewController); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; ScopedKeyWindow scoped_key_window_; std::unique_ptr<TestProfileIOS> profile_;
diff --git a/ios/chrome/browser/shared/coordinator/alert/alert_coordinator_unittest.mm b/ios/chrome/browser/shared/coordinator/alert/alert_coordinator_unittest.mm index 78485f9..42f6c4d 100644 --- a/ios/chrome/browser/shared/coordinator/alert/alert_coordinator_unittest.mm +++ b/ios/chrome/browser/shared/coordinator/alert/alert_coordinator_unittest.mm
@@ -7,10 +7,10 @@ #import <UIKit/UIKit.h> #import "base/apple/foundation_util.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -55,7 +55,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; AlertCoordinator* alert_coordinator_;
diff --git a/ios/chrome/browser/shared/coordinator/alert/repost_form_coordinator_unittest.mm b/ios/chrome/browser/shared/coordinator/alert/repost_form_coordinator_unittest.mm index 84554a6..842407e 100644 --- a/ios/chrome/browser/shared/coordinator/alert/repost_form_coordinator_unittest.mm +++ b/ios/chrome/browser/shared/coordinator/alert/repost_form_coordinator_unittest.mm
@@ -8,13 +8,13 @@ #import "base/apple/foundation_util.h" #import "base/test/ios/wait_util.h" -#import "base/test/task_environment.h" #import "base/test/test_timeouts.h" #import "components/strings/grit/components_strings.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/scoped_key_window.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "ui/base/device_form_factor.h" @@ -57,7 +57,7 @@ RepostFormCoordinator* coordinator_; private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; ScopedKeyWindow scoped_key_window_;
diff --git a/ios/chrome/browser/shared/coordinator/default_browser_promo/BUILD.gn b/ios/chrome/browser/shared/coordinator/default_browser_promo/BUILD.gn index f533ca2..b088da2 100644 --- a/ios/chrome/browser/shared/coordinator/default_browser_promo/BUILD.gn +++ b/ios/chrome/browser/shared/coordinator/default_browser_promo/BUILD.gn
@@ -60,6 +60,7 @@ "//ios/chrome/browser/shared/model/web_state_list", "//ios/chrome/browser/shared/public/commands", "//ios/chrome/test:test_support", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", "//third_party/ocmock",
diff --git a/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent_unittest.mm b/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent_unittest.mm index d9b09b5..9b2b1b62 100644 --- a/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent_unittest.mm +++ b/ios/chrome/browser/shared/coordinator/default_browser_promo/non_modal_default_browser_promo_scheduler_scene_agent_unittest.mm
@@ -8,7 +8,6 @@ #import "base/memory/raw_ptr.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "base/time/time.h" #import "components/feature_engagement/public/event_constants.h" #import "components/feature_engagement/public/feature_constants.h" @@ -44,6 +43,7 @@ #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -129,8 +129,8 @@ return base::IgnoreArgs<bool>(run_loop_.QuitClosure()); } - base::test::TaskEnvironment task_env_{ - base::test::TaskEnvironment::TimeSource::MOCK_TIME}; + web::WebTaskEnvironment task_env_{ + web::WebTaskEnvironment::TimeSource::MOCK_TIME}; base::test::ScopedFeatureList feature_list_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; std::unique_ptr<TestProfileIOS> profile_;
diff --git a/ios/chrome/browser/shared/model/browser/all_web_state_list_observation_registrar_unittest.mm b/ios/chrome/browser/shared/model/browser/all_web_state_list_observation_registrar_unittest.mm index 0f7cd89..dd73007a 100644 --- a/ios/chrome/browser/shared/model/browser/all_web_state_list_observation_registrar_unittest.mm +++ b/ios/chrome/browser/shared/model/browser/all_web_state_list_observation_registrar_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/shared/model/browser/all_web_state_list_observation_registrar.h" #import "base/memory/raw_ptr.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/browser_list.h" #import "ios/chrome/browser/shared/model/browser/browser_list_factory.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" @@ -70,7 +69,7 @@ browser->GetWebStateList()->InsertWebState(std::move(fake_web_state)); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; // Unique pointer to an observer moved into the registrar under test. std::unique_ptr<TestRegisteredWebStateListObserver> owned_observer_; // Weak pointer to the the moved observer
diff --git a/ios/chrome/browser/shared/model/browser/browser_list_factory_unittest.mm b/ios/chrome/browser/shared/model/browser/browser_list_factory_unittest.mm index d85a5de..31ea5d7e 100644 --- a/ios/chrome/browser/shared/model/browser/browser_list_factory_unittest.mm +++ b/ios/chrome/browser/shared/model/browser/browser_list_factory_unittest.mm
@@ -6,7 +6,6 @@ #import <memory> -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" @@ -18,7 +17,7 @@ ProfileIOS* profile() { return profile_.get(); } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> profile_; };
diff --git a/ios/chrome/browser/shared/model/browser/browser_list_unittest.mm b/ios/chrome/browser/shared/model/browser/browser_list_unittest.mm index ff28a6b..173fce1 100644 --- a/ios/chrome/browser/shared/model/browser/browser_list_unittest.mm +++ b/ios/chrome/browser/shared/model/browser/browser_list_unittest.mm
@@ -6,7 +6,6 @@ #import <memory> -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser_list_observer.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" @@ -24,7 +23,7 @@ ProfileIOS* profile() { return profile_.get(); } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; BrowserList browser_list_; };
diff --git a/ios/chrome/browser/shared/model/profile/incognito_session_tracker_unittest.mm b/ios/chrome/browser/shared/model/profile/incognito_session_tracker_unittest.mm index c9b2490..49f21da 100644 --- a/ios/chrome/browser/shared/model/profile/incognito_session_tracker_unittest.mm +++ b/ios/chrome/browser/shared/model/profile/incognito_session_tracker_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/shared/model/profile/incognito_session_tracker.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/browser_list.h" #import "ios/chrome/browser/shared/model/browser/browser_list_factory.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" @@ -14,6 +13,7 @@ #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -123,7 +123,7 @@ ProfileManagerIOS* profile_manager() { return &profile_manager_; } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_local_state_; TestProfileManagerIOS profile_manager_; };
diff --git a/ios/chrome/browser/shared/model/profile/profile_keyed_service_factory_ios_unittest.cc b/ios/chrome/browser/shared/model/profile/profile_keyed_service_factory_ios_unittest.cc index e263f9c4..73553b6 100644 --- a/ios/chrome/browser/shared/model/profile/profile_keyed_service_factory_ios_unittest.cc +++ b/ios/chrome/browser/shared/model/profile/profile_keyed_service_factory_ios_unittest.cc
@@ -8,9 +8,9 @@ #include "base/notreached.h" #include "base/strings/string_util.h" -#include "base/test/task_environment.h" #include "components/keyed_service/core/keyed_service.h" #include "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#include "ios/web/public/test/web_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -117,7 +117,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; DummyServiceFactory dummy_service_factory_; std::unique_ptr<TestProfileIOS> test_profile_; };
diff --git a/ios/chrome/browser/shared/model/profile/profile_keyed_service_utils_unittest.cc b/ios/chrome/browser/shared/model/profile/profile_keyed_service_utils_unittest.cc index 8b08f42c..0e6d61a 100644 --- a/ios/chrome/browser/shared/model/profile/profile_keyed_service_utils_unittest.cc +++ b/ios/chrome/browser/shared/model/profile/profile_keyed_service_utils_unittest.cc
@@ -5,8 +5,8 @@ #include "ios/chrome/browser/shared/model/profile/profile_keyed_service_utils.h" #import "base/memory/raw_ptr.h" -#include "base/test/task_environment.h" #include "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#include "ios/web/public/test/web_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -24,7 +24,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> test_profile_; };
diff --git a/ios/chrome/browser/shared/model/profile/refcounted_profile_keyed_service_factory_ios_unittest.cc b/ios/chrome/browser/shared/model/profile/refcounted_profile_keyed_service_factory_ios_unittest.cc index 66cb47096..6fc6a94 100644 --- a/ios/chrome/browser/shared/model/profile/refcounted_profile_keyed_service_factory_ios_unittest.cc +++ b/ios/chrome/browser/shared/model/profile/refcounted_profile_keyed_service_factory_ios_unittest.cc
@@ -9,9 +9,9 @@ #include "base/memory/scoped_refptr.h" #include "base/notreached.h" #include "base/strings/string_util.h" -#include "base/test/task_environment.h" #include "components/keyed_service/core/refcounted_keyed_service.h" #include "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#include "ios/web/public/test/web_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -126,7 +126,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; DummyServiceFactory dummy_service_factory_; std::unique_ptr<TestProfileIOS> test_profile_; };
diff --git a/ios/chrome/browser/shared/ui/elements/BUILD.gn b/ios/chrome/browser/shared/ui/elements/BUILD.gn index acd04fb..8249980 100644 --- a/ios/chrome/browser/shared/ui/elements/BUILD.gn +++ b/ios/chrome/browser/shared/ui/elements/BUILD.gn
@@ -85,6 +85,7 @@ "//ios/chrome/browser/shared/public/features", "//ios/chrome/common/ui/colors", "//ios/chrome/test:test_support", + "//ios/web/public/test", "//testing/gtest", "//third_party/ocmock", ]
diff --git a/ios/chrome/browser/shared/ui/elements/activity_overlay_coordinator_unittest.mm b/ios/chrome/browser/shared/ui/elements/activity_overlay_coordinator_unittest.mm index 1e9bb19..8f2857f 100644 --- a/ios/chrome/browser/shared/ui/elements/activity_overlay_coordinator_unittest.mm +++ b/ios/chrome/browser/shared/ui/elements/activity_overlay_coordinator_unittest.mm
@@ -4,10 +4,10 @@ #import "ios/chrome/browser/shared/ui/elements/activity_overlay_coordinator.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/ui/elements/activity_overlay_view_controller.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -17,7 +17,7 @@ // Tests that invoking start and stop on the coordinator presents and dismisses // the activity overlay view, respectively. TEST_F(ActivityOverlayCoordinatorTest, StartAndStop) { - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; __weak UIView* overlay_view; @autoreleasepool { UIViewController* base_view_controller = [[UIViewController alloc] init];
diff --git a/ios/chrome/browser/shared/ui/elements/chrome_activity_overlay_coordinator_unittest.mm b/ios/chrome/browser/shared/ui/elements/chrome_activity_overlay_coordinator_unittest.mm index 8f011598..c79c818 100644 --- a/ios/chrome/browser/shared/ui/elements/chrome_activity_overlay_coordinator_unittest.mm +++ b/ios/chrome/browser/shared/ui/elements/chrome_activity_overlay_coordinator_unittest.mm
@@ -4,9 +4,9 @@ #import "ios/chrome/browser/shared/ui/elements/chrome_activity_overlay_coordinator.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -18,7 +18,7 @@ TEST_F(ChromeActivityOverlayCoordinatorTest, StartAndStop) { __weak UIView* overlay_view; @autoreleasepool { - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; UIViewController* base_view_controller = [[UIViewController alloc] init]; std::unique_ptr<TestProfileIOS> profile = TestProfileIOS::Builder().Build(); std::unique_ptr<Browser> browser =
diff --git a/ios/chrome/browser/sharing/ui_bundled/qr_generator/qr_generator_coordinator_unittest.mm b/ios/chrome/browser/sharing/ui_bundled/qr_generator/qr_generator_coordinator_unittest.mm index dc2a223..2c0b67c2 100644 --- a/ios/chrome/browser/sharing/ui_bundled/qr_generator/qr_generator_coordinator_unittest.mm +++ b/ios/chrome/browser/sharing/ui_bundled/qr_generator/qr_generator_coordinator_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/sharing/ui_bundled/qr_generator/qr_generator_coordinator.h" #import "base/apple/foundation_util.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/public/commands/bookmarks_commands.h" @@ -16,6 +15,7 @@ #import "ios/chrome/common/ui/confirmation_alert/confirmation_alert_action_handler.h" #import "ios/chrome/common/ui/elements/popover_label_view_controller.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "net/base/apple/url_conversions.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -51,7 +51,7 @@ mock_qr_generation_commands_handler_]; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; id mock_qr_generation_commands_handler_;
diff --git a/ios/chrome/browser/signin/model/account_capabilities_fetcher_ios_unittest.mm b/ios/chrome/browser/signin/model/account_capabilities_fetcher_ios_unittest.mm index a6a6975..999de54 100644 --- a/ios/chrome/browser/signin/model/account_capabilities_fetcher_ios_unittest.mm +++ b/ios/chrome/browser/signin/model/account_capabilities_fetcher_ios_unittest.mm
@@ -10,7 +10,6 @@ #import "base/memory/raw_ptr.h" #import "base/run_loop.h" #import "base/strings/sys_string_conversions.h" -#import "base/test/task_environment.h" #import "components/signin/public/identity_manager/identity_test_environment.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" @@ -20,6 +19,7 @@ #import "ios/chrome/browser/signin/model/chrome_account_manager_service_factory.h" #import "ios/chrome/browser/signin/model/fake_system_identity.h" #import "ios/chrome/browser/signin/model/fake_system_identity_manager.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -92,7 +92,7 @@ } private: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; signin::IdentityTestEnvironment identity_test_environment_; std::unique_ptr<TestProfileIOS> profile_; raw_ptr<ChromeAccountManagerService> account_manager_service_;
diff --git a/ios/chrome/browser/signin/model/account_profile_mapper_unittest.mm b/ios/chrome/browser/signin/model/account_profile_mapper_unittest.mm index 08fffca..068d36d 100644 --- a/ios/chrome/browser/signin/model/account_profile_mapper_unittest.mm +++ b/ios/chrome/browser/signin/model/account_profile_mapper_unittest.mm
@@ -11,7 +11,6 @@ #import "base/task/thread_pool.h" #import "base/test/gmock_callback_support.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "base/test/test_file_util.h" #import "base/test/test_future.h" #import "base/uuid.h" @@ -27,6 +26,7 @@ #import "ios/chrome/browser/signin/model/fake_system_identity.h" #import "ios/chrome/browser/signin/model/fake_system_identity_manager.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gmock/include/gmock/gmock.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" @@ -356,8 +356,8 @@ protected: IOSChromeScopedTestingLocalState scoped_testing_local_state_; - base::test::TaskEnvironment task_environment_{ - base::test::TaskEnvironment::TimeSource::MOCK_TIME}; + web::WebTaskEnvironment task_environment_{ + web::WebTaskEnvironment::TimeSource::MOCK_TIME}; std::unique_ptr<FakeProfileManagerIOS> profile_manager_; raw_ptr<FakeSystemIdentityManager> system_identity_manager_; std::unique_ptr<AccountProfileMapper> account_profile_mapper_;
diff --git a/ios/chrome/browser/signin/model/chrome_account_manager_service_unittest.mm b/ios/chrome/browser/signin/model/chrome_account_manager_service_unittest.mm index 6f6a2ae..98a0ea7 100644 --- a/ios/chrome/browser/signin/model/chrome_account_manager_service_unittest.mm +++ b/ios/chrome/browser/signin/model/chrome_account_manager_service_unittest.mm
@@ -79,7 +79,7 @@ protected: IOSChromeScopedTestingLocalState scoped_testing_local_state_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; raw_ptr<ChromeAccountManagerService> account_manager_; };
diff --git a/ios/chrome/browser/snapshots/model/snapshot_browser_agent_unittest.mm b/ios/chrome/browser/snapshots/model/snapshot_browser_agent_unittest.mm index a02cd21..8c17755 100644 --- a/ios/chrome/browser/snapshots/model/snapshot_browser_agent_unittest.mm +++ b/ios/chrome/browser/snapshots/model/snapshot_browser_agent_unittest.mm
@@ -5,10 +5,10 @@ #import "ios/chrome/browser/snapshots/model/snapshot_browser_agent.h" #import "base/strings/sys_string_conversions.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/browser.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" namespace { @@ -26,7 +26,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<Browser> browser_; };
diff --git a/ios/chrome/browser/store_kit/model/store_kit_coordinator_unittest.mm b/ios/chrome/browser/store_kit/model/store_kit_coordinator_unittest.mm index 21f9184..3470245c 100644 --- a/ios/chrome/browser/store_kit/model/store_kit_coordinator_unittest.mm +++ b/ios/chrome/browser/store_kit/model/store_kit_coordinator_unittest.mm
@@ -7,11 +7,11 @@ #import <StoreKit/StoreKit.h> #import "base/test/ios/wait_util.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/test/fakes/fake_ui_view_controller.h" #import "ios/chrome/test/scoped_key_window.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" @@ -44,7 +44,7 @@ } } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; UIViewController* root_view_controller_;
diff --git a/ios/chrome/browser/sync/model/BUILD.gn b/ios/chrome/browser/sync/model/BUILD.gn index 1b699c3..447c27b 100644 --- a/ios/chrome/browser/sync/model/BUILD.gn +++ b/ios/chrome/browser/sync/model/BUILD.gn
@@ -238,7 +238,6 @@ "//ios/chrome/browser/history/model", "//ios/chrome/browser/infobars/model", "//ios/chrome/browser/passwords/model", - "//ios/chrome/browser/saved_tab_groups/model", "//ios/chrome/browser/shared/model/browser/test:test_support", "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/model/url:constants",
diff --git a/ios/chrome/browser/sync/model/sync_service_factory_unittest.mm b/ios/chrome/browser/sync/model/sync_service_factory_unittest.mm index 01afdf8c..bec577b 100644 --- a/ios/chrome/browser/sync/model/sync_service_factory_unittest.mm +++ b/ios/chrome/browser/sync/model/sync_service_factory_unittest.mm
@@ -16,7 +16,6 @@ #import "components/sync/service/sync_service_impl.h" #import "ios/chrome/browser/favicon/model/favicon_service_factory.h" #import "ios/chrome/browser/history/model/history_service_factory.h" -#import "ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/browser/webdata_services/model/web_data_service_factory.h" @@ -41,9 +40,6 @@ profile_builder.AddTestingFactory( ios::WebDataServiceFactory::GetInstance(), ios::WebDataServiceFactory::GetDefaultFactory()); - profile_builder.AddTestingFactory( - tab_groups::TabGroupSyncServiceFactory::GetInstance(), - tab_groups::TabGroupSyncServiceFactory::GetDefaultFactory()); profile_ = std::move(profile_builder).Build(); }
diff --git a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/BUILD.gn b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/BUILD.gn index 1361df7e..60f4000 100644 --- a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/BUILD.gn +++ b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/BUILD.gn
@@ -238,7 +238,6 @@ "//ios/chrome/browser/incognito_reauth/ui_bundled:incognito_reauth_scene_agent", "//ios/chrome/browser/main/ui_bundled", "//ios/chrome/browser/popup_menu/ui_bundled", - "//ios/chrome/browser/saved_tab_groups/model", "//ios/chrome/browser/sessions/model", "//ios/chrome/browser/shared/coordinator/scene:scene_state_header", "//ios/chrome/browser/shared/model/browser/test:test_support",
diff --git a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_grid_coordinator_unittest.mm b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_grid_coordinator_unittest.mm index 9a37191b..b5b81989 100644 --- a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_grid_coordinator_unittest.mm +++ b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_grid_coordinator_unittest.mm
@@ -18,7 +18,6 @@ #import "ios/chrome/browser/incognito_reauth/ui_bundled/incognito_reauth_scene_agent.h" #import "ios/chrome/browser/main/ui_bundled/bvc_container_view_controller.h" #import "ios/chrome/browser/popup_menu/ui_bundled/popup_menu_coordinator.h" -#import "ios/chrome/browser/saved_tab_groups/model/tab_group_sync_service_factory.h" #import "ios/chrome/browser/sessions/model/ios_chrome_tab_restore_service_factory.h" #import "ios/chrome/browser/shared/coordinator/scene/scene_state.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" @@ -109,9 +108,6 @@ AuthenticationServiceFactory::GetInstance(), AuthenticationServiceFactory::GetFactoryWithDelegate( std::make_unique<FakeAuthenticationServiceDelegate>())); - builder.AddTestingFactory( - tab_groups::TabGroupSyncServiceFactory::GetInstance(), - tab_groups::TabGroupSyncServiceFactory::GetDefaultFactory()); builder.AddTestingFactory(ios::BookmarkModelFactory::GetInstance(), ios::BookmarkModelFactory::GetDefaultFactory()); profile_ = std::move(builder).Build();
diff --git a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/shared_tab_groups_signin_egtest.mm b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/shared_tab_groups_signin_egtest.mm index 977a41f..80f13397 100644 --- a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/shared_tab_groups_signin_egtest.mm +++ b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/shared_tab_groups_signin_egtest.mm
@@ -37,6 +37,7 @@ #import "net/test/embedded_test_server/embedded_test_server.h" #import "ui/base/l10n/l10n_util.h" +using ::base::test::ios::kWaitForActionTimeout; using chrome_test_util::CreateTabGroupAtIndex; using chrome_test_util::FakeJoinFlowView; using chrome_test_util::FakeShareFlowView; @@ -71,6 +72,22 @@ @"Long press failed."); } +// Waits for the fake join flow view to appear. +void WaitForFakeJoinFlowView() { + GREYCondition* waitForFakeJoinFlowView = [GREYCondition + conditionWithName:@"Wait for the fake join flow view to appear." + block:^{ + NSError* error = nil; + [[EarlGrey selectElementWithMatcher:FakeJoinFlowView()] + assertWithMatcher:grey_sufficientlyVisible() + error:&error]; + return error == nil; + }]; + GREYAssertTrue([waitForFakeJoinFlowView + waitWithTimeout:kWaitForActionTimeout.InSecondsF()], + @"The fake join flow view did not appear."); +} + // Long presses a tab group cell. void LongPressTabGroupCellAtIndex(unsigned int index) { // Make sure the cell has appeared. Otherwise, long pressing can be flaky. @@ -295,9 +312,7 @@ @"History sync is disabled."); // Verify that this opened the fake Join flow. - [ChromeEarlGrey waitForUIElementToAppearWithMatcher:FakeJoinFlowView()]; - [[EarlGrey selectElementWithMatcher:FakeJoinFlowView()] - assertWithMatcher:grey_sufficientlyVisible()]; + WaitForFakeJoinFlowView(); // Join the group. [[EarlGrey selectElementWithMatcher:NavigationBarSaveButton()] @@ -339,9 +354,7 @@ @"History sync is disabled."); // Verify that this opened the fake Join flow. - [ChromeEarlGrey waitForUIElementToAppearWithMatcher:FakeJoinFlowView()]; - [[EarlGrey selectElementWithMatcher:FakeJoinFlowView()] - assertWithMatcher:grey_sufficientlyVisible()]; + WaitForFakeJoinFlowView(); // Join the group. [[EarlGrey selectElementWithMatcher:NavigationBarSaveButton()]
diff --git a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_group_view_controller.mm b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_group_view_controller.mm index c85de0e..72dca7f 100644 --- a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_group_view_controller.mm +++ b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_group_view_controller.mm
@@ -154,8 +154,13 @@ TabGridBottomToolbar* _bottomToolbar; // The face pile view that displays the share button or the face pile. UIView* _facePileView; + // Constraints for the container on narrow vs large windows. + NSArray<NSLayoutConstraint*>* _narrowWidthConstraints; + NSArray<NSLayoutConstraint*>* _largeWidthConstraints; // Container for the content of the ViewController. UIView* _container; + // The background of the container, for animations. + UIView* _containerBackground; // The gesture recognizer to swipe to dismiss the tab group view. UIPanGestureRecognizer* _swipeDownGestureRecognizer; } @@ -198,7 +203,12 @@ [self contentWillAppearAnimated:YES]; - _navigationBar.alpha = 0; + if (IsContainedTabGroupEnabled()) { + _topToolbar.alpha = 0; + _containerBackground.alpha = 0; + } else { + _navigationBar.alpha = 0; + } _gridViewController.view.alpha = 0; CGPoint center = [_gridViewController.view convertPoint:self.view.center fromView:self.view]; @@ -208,10 +218,17 @@ } - (void)animateTopElementsPresentation { - _navigationBar.alpha = 1; + if (IsContainedTabGroupEnabled()) { + _topToolbar.alpha = 1; + } else { + _navigationBar.alpha = 1; + } } - (void)animateGridPresentation { + if (IsContainedTabGroupEnabled()) { + _containerBackground.alpha = 1; + } _gridViewController.view.alpha = 1; [_gridViewController resetVisibleCellsCenterAndScale]; } @@ -297,11 +314,30 @@ [self.view addSubview:_container]; if (IsContainedTabGroupEnabled()) { - _container.backgroundColor = + _containerBackground = [[UIView alloc] init]; + _containerBackground.translatesAutoresizingMaskIntoConstraints = NO; + _containerBackground.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:kContainerBackgroundAlpha]; + [_container addSubview:_containerBackground]; + AddSameConstraints(_container, _containerBackground); + _container.layer.cornerRadius = kContainerCornerRadius; _container.layer.masksToBounds = YES; + _narrowWidthConstraints = @[ + [self.view.trailingAnchor + constraintEqualToAnchor:_container.trailingAnchor + constant:kContainerMargin], + [self.view.leadingAnchor constraintEqualToAnchor:_container.leadingAnchor + constant:-kContainerMargin], + ]; + _largeWidthConstraints = @[ + [_container.widthAnchor constraintEqualToAnchor:self.view.widthAnchor + multiplier:kContainerMultiplier], + ]; + + [self updateContainerConstraints]; + [NSLayoutConstraint activateConstraints:@[ [self.view.centerXAnchor constraintEqualToAnchor:_container.centerXAnchor], @@ -309,11 +345,6 @@ constraintEqualToAnchor:_container.centerYAnchor], [_container.heightAnchor constraintEqualToAnchor:self.view.heightAnchor multiplier:kContainerMultiplier], - [self.view.trailingAnchor - constraintEqualToAnchor:_container.trailingAnchor - constant:kContainerMargin], - [self.view.leadingAnchor constraintEqualToAnchor:_container.leadingAnchor - constant:-kContainerMargin], ]]; } else { AddSameConstraints(self.view, _container); @@ -366,9 +397,9 @@ if (@available(iOS 17, *)) { [self registerForTraitChanges:@[ UITraitVerticalSizeClass.class ] - withAction:@selector(updateGridInsets)]; + withAction:@selector(sizeClassDidChange)]; [self registerForTraitChanges:@[ UITraitHorizontalSizeClass.class ] - withAction:@selector(updateGridInsets)]; + withAction:@selector(sizeClassDidChange)]; } } @@ -392,7 +423,7 @@ self.traitCollection.verticalSizeClass || previousTraitCollection.horizontalSizeClass != self.traitCollection.horizontalSizeClass) { - [self updateGridInsets]; + [self sizeClassDidChange]; } } #endif @@ -1032,6 +1063,12 @@ .rightBarButtonItems[0]]; } +// Called when the size class changed. +- (void)sizeClassDidChange { + [self updateGridInsets]; + [self updateContainerConstraints]; +} + // Updates the safe area inset of the grid based on this VC safe areas and the // bottom toolbar, except the top one as the grid is below a toolbar. - (void)updateGridInsets { @@ -1057,6 +1094,24 @@ _gridViewController.contentInsets = safeAreaInsets; } +// Updates the constraints of the container based on the size class. +- (void)updateContainerConstraints { + if (!IsContainedTabGroupEnabled()) { + return; + } + BOOL isNarrowWidth = + self.traitCollection.horizontalSizeClass == + UIUserInterfaceSizeClassCompact && + self.traitCollection.verticalSizeClass == UIUserInterfaceSizeClassRegular; + if (isNarrowWidth) { + [NSLayoutConstraint deactivateConstraints:_largeWidthConstraints]; + [NSLayoutConstraint activateConstraints:_narrowWidthConstraints]; + } else { + [NSLayoutConstraint deactivateConstraints:_narrowWidthConstraints]; + [NSLayoutConstraint activateConstraints:_largeWidthConstraints]; + } +} + // Starts managing the shared group. - (void)manageGroup { CHECK(_gridViewController.shared);
diff --git a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_groups_panel_coordinator_unittest.mm b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_groups_panel_coordinator_unittest.mm index e417702c..313851db 100644 --- a/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_groups_panel_coordinator_unittest.mm +++ b/ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_groups_panel_coordinator_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_groups_panel_coordinator.h" -#import "base/test/task_environment.h" #import "components/policy/core/common/policy_pref_names.h" #import "components/prefs/testing_pref_service.h" #import "components/saved_tab_groups/test_support/mock_tab_group_sync_service.h" @@ -21,6 +20,7 @@ #import "ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_groups_panel_mediator.h" #import "ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/tab_groups/tab_groups_panel_view_controller.h" #import "ios/chrome/browser/tab_switcher/ui_bundled/tab_grid/toolbars/tab_grid_toolbars_main_tab_grid_delegate.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/gtest_support.h" @@ -106,7 +106,7 @@ } // Needed for test profile created by TestBrowser(). - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; UIViewController* base_view_controller_;
diff --git a/ios/chrome/browser/tabs/model/tab_helper_delegate_installer_unittest.mm b/ios/chrome/browser/tabs/model/tab_helper_delegate_installer_unittest.mm index 3aac87f..8591433b 100644 --- a/ios/chrome/browser/tabs/model/tab_helper_delegate_installer_unittest.mm +++ b/ios/chrome/browser/tabs/model/tab_helper_delegate_installer_unittest.mm
@@ -5,13 +5,13 @@ #import "ios/chrome/browser/tabs/model/tab_helper_delegate_installer.h" #import "base/memory/raw_ptr.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list_delegate.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/web_state_user_data.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -105,7 +105,7 @@ std::make_unique<FakeTabHelperWebStateListDelegate>())) {} ~TabHelperDelegateInstallerTest() override {} - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<ProfileIOS> profile_; std::unique_ptr<Browser> browser_; Delegate delegate_;
diff --git a/ios/chrome/browser/tabs/model/tabs_closer_unittest.mm b/ios/chrome/browser/tabs/model/tabs_closer_unittest.mm index ee3c5a9c..6bfc21ed 100644 --- a/ios/chrome/browser/tabs/model/tabs_closer_unittest.mm +++ b/ios/chrome/browser/tabs/model/tabs_closer_unittest.mm
@@ -145,9 +145,6 @@ builder.AddTestingFactory( SessionRestorationServiceFactory::GetInstance(), TestSessionRestorationService::GetTestingFactory()); - builder.AddTestingFactory( - tab_groups::TabGroupSyncServiceFactory::GetInstance(), - tab_groups::TabGroupSyncServiceFactory::GetDefaultFactory()); builder.AddTestingFactory(IOSChromeTabRestoreServiceFactory::GetInstance(), FakeTabRestoreService::GetTestingFactory()); builder.AddTestingFactory(
diff --git a/ios/chrome/browser/tips_notifications/model/BUILD.gn b/ios/chrome/browser/tips_notifications/model/BUILD.gn index 5f2fa41..5bbf334c 100644 --- a/ios/chrome/browser/tips_notifications/model/BUILD.gn +++ b/ios/chrome/browser/tips_notifications/model/BUILD.gn
@@ -83,6 +83,7 @@ "//ios/chrome/browser/shared/public/features", "//ios/chrome/test:test_support", "//ios/testing:block_swizzler", + "//ios/web/public/test", "//third_party/ocmock", ] }
diff --git a/ios/chrome/browser/tips_notifications/model/tips_notification_client_unittest.mm b/ios/chrome/browser/tips_notifications/model/tips_notification_client_unittest.mm index 44cc7b5..1110151 100644 --- a/ios/chrome/browser/tips_notifications/model/tips_notification_client_unittest.mm +++ b/ios/chrome/browser/tips_notifications/model/tips_notification_client_unittest.mm
@@ -9,7 +9,6 @@ #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" #import "base/test/scoped_mock_clock_override.h" -#import "base/test/task_environment.h" #import "base/threading/thread_restrictions.h" #import "components/prefs/scoped_user_pref_update.h" #import "components/safe_browsing/core/common/safe_browsing_prefs.h" @@ -38,6 +37,7 @@ #import "ios/chrome/browser/tips_notifications/model/utils.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" #import "ios/testing/scoped_block_swizzler.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -245,7 +245,7 @@ local_state->GetInteger(kTipsNotificationsUserType)); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; const base::HistogramTester histogram_tester_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; TestProfileManagerIOS profile_manager_;
diff --git a/ios/chrome/browser/toolbar/ui_bundled/toolbar_coordinator_unittest.mm b/ios/chrome/browser/toolbar/ui_bundled/toolbar_coordinator_unittest.mm index c71e4567..0ac775c 100644 --- a/ios/chrome/browser/toolbar/ui_bundled/toolbar_coordinator_unittest.mm +++ b/ios/chrome/browser/toolbar/ui_bundled/toolbar_coordinator_unittest.mm
@@ -6,7 +6,6 @@ #import "base/scoped_observation.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/omnibox/model/omnibox_position/omnibox_position_browser_agent.h" #import "ios/chrome/browser/omnibox/model/omnibox_position/omnibox_position_browser_agent_observer.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h" @@ -26,6 +25,7 @@ #import "ios/chrome/browser/shared/public/commands/settings_commands.h" #import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h" #import "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -113,7 +113,7 @@ void TearDown() override { [coordinator_ stop]; } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_;
diff --git a/ios/chrome/browser/translate/model/chrome_ios_translate_client_unittest.mm b/ios/chrome/browser/translate/model/chrome_ios_translate_client_unittest.mm index 6bcea4d..6bcb7f1 100644 --- a/ios/chrome/browser/translate/model/chrome_ios_translate_client_unittest.mm +++ b/ios/chrome/browser/translate/model/chrome_ios_translate_client_unittest.mm
@@ -9,7 +9,6 @@ #import "base/path_service.h" #import "base/test/metrics/histogram_tester.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "base/values.h" #import "components/language_detection/ios/browser/language_detection_model_loader_service_ios.h" #import "components/optimization_guide/core/optimization_guide_features.h" @@ -31,6 +30,7 @@ #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_frames_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "url/gurl.h" @@ -70,7 +70,7 @@ } protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; IOSChromeScopedTestingLocalState scoped_testing_local_state_; base::test::ScopedFeatureList scoped_feature_list_; base::HistogramTester histogram_tester_;
diff --git a/ios/chrome/browser/url_loading/model/image_search_param_generator_unittest.mm b/ios/chrome/browser/url_loading/model/image_search_param_generator_unittest.mm index f96bdd0..0fdeebac 100644 --- a/ios/chrome/browser/url_loading/model/image_search_param_generator_unittest.mm +++ b/ios/chrome/browser/url_loading/model/image_search_param_generator_unittest.mm
@@ -4,9 +4,9 @@ #import "ios/chrome/browser/url_loading/model/image_search_param_generator.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/gtest_support.h" #import "ui/base/test/ios/ui_image_test_utils.h" @@ -25,7 +25,7 @@ profile_ = std::move(test_profile_builder).Build(); } - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; };
diff --git a/ios/chrome/browser/web/model/print/print_tab_helper_unittest.mm b/ios/chrome/browser/web/model/print/print_tab_helper_unittest.mm index d807ebfc..8a7252a 100644 --- a/ios/chrome/browser/web/model/print/print_tab_helper_unittest.mm +++ b/ios/chrome/browser/web/model/print/print_tab_helper_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/web/model/print/print_tab_helper.h" -#import "base/test/task_environment.h" #import "components/sync_preferences/pref_service_mock_factory.h" #import "components/sync_preferences/pref_service_syncable.h" #import "ios/chrome/browser/shared/model/prefs/browser_prefs.h" @@ -12,6 +11,7 @@ #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/web/model/print/web_state_printer.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "ios/web/public/web_state.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -49,7 +49,7 @@ } PrintTabHelperTestPrinter* printer_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; web::FakeWebState web_state_; };
diff --git a/ios/chrome/browser/web/model/sad_tab_tab_helper_unittest.mm b/ios/chrome/browser/web/model/sad_tab_tab_helper_unittest.mm index 93e3e55..5c47c95 100644 --- a/ios/chrome/browser/web/model/sad_tab_tab_helper_unittest.mm +++ b/ios/chrome/browser/web/model/sad_tab_tab_helper_unittest.mm
@@ -7,7 +7,6 @@ #import <memory> #import "base/memory/raw_ptr.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/ntp/model/new_tab_page_tab_helper.h" #import "ios/chrome/browser/ntp/model/new_tab_page_tab_helper_delegate.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" @@ -20,6 +19,7 @@ #import "ios/web/public/test/fakes/fake_navigation_context.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" @@ -96,7 +96,7 @@ ~SadTabTabHelperTest() override { [application_ stopMocking]; } - base::test::TaskEnvironment environment_; + web::WebTaskEnvironment environment_; ScopedKeyWindow scoped_key_window_; UIView* web_state_view_; std::unique_ptr<ProfileIOS> profile_;
diff --git a/ios/chrome/browser/web_state_list/model/web_usage_enabler/BUILD.gn b/ios/chrome/browser/web_state_list/model/web_usage_enabler/BUILD.gn index a3583be..8aa23d04a 100644 --- a/ios/chrome/browser/web_state_list/model/web_usage_enabler/BUILD.gn +++ b/ios/chrome/browser/web_state_list/model/web_usage_enabler/BUILD.gn
@@ -31,6 +31,7 @@ "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/shared/model/web_state_list", "//ios/web", + "//ios/web/public/test", "//ios/web/public/test/fakes", "//testing/gtest", "//url",
diff --git a/ios/chrome/browser/web_state_list/model/web_usage_enabler/web_usage_enabler_browser_agent_unittest.mm b/ios/chrome/browser/web_state_list/model/web_usage_enabler/web_usage_enabler_browser_agent_unittest.mm index bc6fe4f..5e81833 100644 --- a/ios/chrome/browser/web_state_list/model/web_usage_enabler/web_usage_enabler_browser_agent_unittest.mm +++ b/ios/chrome/browser/web_state_list/model/web_usage_enabler/web_usage_enabler_browser_agent_unittest.mm
@@ -5,13 +5,13 @@ #import "ios/chrome/browser/web_state_list/model/web_usage_enabler/web_usage_enabler_browser_agent.h" #import "base/memory/raw_ptr.h" -#import "base/test/task_environment.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_opener.h" #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/gtest/include/gtest/gtest.h" #import "testing/platform_test.h" @@ -37,7 +37,7 @@ const WebUsageEnablerBrowserAgentTest&) = delete; protected: - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<TestProfileIOS> profile_; std::unique_ptr<TestBrowser> browser_; raw_ptr<WebStateList> web_state_list_;
diff --git a/ios/chrome/browser/whats_new/coordinator/promo/BUILD.gn b/ios/chrome/browser/whats_new/coordinator/promo/BUILD.gn index f05e46a..03d8366 100644 --- a/ios/chrome/browser/whats_new/coordinator/promo/BUILD.gn +++ b/ios/chrome/browser/whats_new/coordinator/promo/BUILD.gn
@@ -46,6 +46,7 @@ "//ios/chrome/browser/shared/model/profile/test", "//ios/chrome/browser/whats_new/coordinator:util", "//ios/chrome/browser/whats_new/public:constants", + "//ios/web/public/test", "//third_party/ocmock", ] }
diff --git a/ios/chrome/browser/whats_new/coordinator/promo/whats_new_scene_agent_unittest.mm b/ios/chrome/browser/whats_new/coordinator/promo/whats_new_scene_agent_unittest.mm index 2b7c0826..7450290b 100644 --- a/ios/chrome/browser/whats_new/coordinator/promo/whats_new_scene_agent_unittest.mm +++ b/ios/chrome/browser/whats_new/coordinator/promo/whats_new_scene_agent_unittest.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/whats_new/coordinator/promo/whats_new_scene_agent.h" #import "base/test/scoped_feature_list.h" -#import "base/test/task_environment.h" #import "components/commerce/core/commerce_feature_list.h" #import "ios/chrome/app/application_delegate/app_state.h" #import "ios/chrome/app/application_delegate/fake_startup_information.h" @@ -18,6 +17,7 @@ #import "ios/chrome/browser/shared/model/profile/test/test_profile_ios.h" #import "ios/chrome/browser/whats_new/coordinator/whats_new_util.h" #import "ios/chrome/browser/whats_new/public/constants.h" +#import "ios/web/public/test/web_task_environment.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/gtest_support.h" @@ -55,7 +55,7 @@ AppState* app_state_; base::test::ScopedFeatureList feature_list_; SceneState* scene_state_; - base::test::TaskEnvironment task_environment_; + web::WebTaskEnvironment task_environment_; std::unique_ptr<MockPromosManager> promos_manager_; };
diff --git a/ios/chrome/test/BUILD.gn b/ios/chrome/test/BUILD.gn index d8ce7f1..b821e98f 100644 --- a/ios/chrome/test/BUILD.gn +++ b/ios/chrome/test/BUILD.gn
@@ -282,6 +282,7 @@ "//ios/chrome/browser/dialogs/ui_bundled:unit_tests", "//ios/chrome/browser/dialogs/ui_bundled:unit_tests_internal", "//ios/chrome/browser/docking_promo/coordinator:unit_tests", + "//ios/chrome/browser/dom_distiller/model:unit_tests", "//ios/chrome/browser/download/coordinator:unit_tests", "//ios/chrome/browser/download/model:unit_tests", "//ios/chrome/browser/download/model/auto_deletion:unit_tests",
diff --git a/ios/chrome/test/earl_grey/chrome_actions.mm b/ios/chrome/test/earl_grey/chrome_actions.mm index cd00eb9..b099b83 100644 --- a/ios/chrome/test/earl_grey/chrome_actions.mm +++ b/ios/chrome/test/earl_grey/chrome_actions.mm
@@ -14,8 +14,9 @@ id<GREYAction> LongPressElementForContextMenu(ElementSelector* selector, bool triggers_context_menu) { - return [ChromeActionsAppInterface longPressElement:selector - triggerContextMenu:triggers_context_menu]; + return [ChromeActionsAppInterface + longPressElementOnWebView:selector + triggerContextMenu:triggers_context_menu]; } id<GREYAction> ScrollElementToVisible(ElementSelector* selector) {
diff --git a/ios/chrome/test/earl_grey/chrome_actions_app_interface.h b/ios/chrome/test/earl_grey/chrome_actions_app_interface.h index e5cfc15..8294dae 100644 --- a/ios/chrome/test/earl_grey/chrome_actions_app_interface.h +++ b/ios/chrome/test/earl_grey/chrome_actions_app_interface.h
@@ -22,8 +22,8 @@ // in the webview. If `triggers_context_menu` is false, the converse is true. // This action doesn't fail if the context menu isn't displayed; calling code // should check for that separately with a matcher. -+ (id<GREYAction>)longPressElement:(ElementSelector*)selector - triggerContextMenu:(BOOL)triggerContextMenu; ++ (id<GREYAction>)longPressElementOnWebView:(ElementSelector*)selector + triggerContextMenu:(BOOL)triggerContextMenu; // Action to scroll a web element described by the given `selector` to visible // on the current web state.
diff --git a/ios/chrome/test/earl_grey/chrome_actions_app_interface.mm b/ios/chrome/test/earl_grey/chrome_actions_app_interface.mm index 520c635f..bb20c43 100644 --- a/ios/chrome/test/earl_grey/chrome_actions_app_interface.mm +++ b/ios/chrome/test/earl_grey/chrome_actions_app_interface.mm
@@ -73,8 +73,8 @@ @implementation ChromeActionsAppInterface : NSObject -+ (id<GREYAction>)longPressElement:(ElementSelector*)selector - triggerContextMenu:(BOOL)triggerContextMenu { ++ (id<GREYAction>)longPressElementOnWebView:(ElementSelector*)selector + triggerContextMenu:(BOOL)triggerContextMenu { return WebViewLongPressElementForContextMenu( chrome_test_util::GetCurrentWebState(), selector, triggerContextMenu); }
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.h b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.h index 5678dac..cb222a1 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.h
@@ -10,6 +10,7 @@ #import <string> #import "ios/testing/earl_grey/base_eg_test_helper_impl.h" +#import "ios/web/public/test/element_selector.h" @protocol GREYMatcher; @@ -183,6 +184,12 @@ // dismissable by tapping. - (void)dismissByTappingOnTheWindowOfPopover:(id<GREYMatcher>)matcher; +// Long presses on selector. +- (void)longPressElementOnWebView:(ElementSelector*)selector; + +// Convenient function to trigger the Edit Menu on selector. +- (void)triggerEditMenu:(ElementSelector*)selector; + @end #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_UI_H_
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm index a0091a7..7f30e1a 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm
@@ -8,16 +8,20 @@ #import "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" #import "components/strings/grit/components_strings.h" +#import "ios/chrome/browser/browser_container/ui_bundled/edit_menu_app_interface.h" #import "ios/chrome/browser/popup_menu/ui_bundled/popup_menu_constants.h" #import "ios/chrome/browser/settings/ui_bundled/cells/clear_browsing_data_constants.h" #import "ios/chrome/browser/shared/ui/table_view/table_view_constants.h" #import "ios/chrome/grit/ios_strings.h" +#import "ios/chrome/test/earl_grey/chrome_actions.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h" +#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/scoped_disable_timer_tracking.h" #import "ios/chrome/test/scoped_eg_synchronization_disabler.h" #import "ios/testing/earl_grey/app_launch_manager.h" #import "ios/testing/earl_grey/earl_grey_test.h" +#import "ios/web/public/test/element_selector.h" #import "ui/base/l10n/l10n_util.h" // Redefine EarlGrey macro to use line number and file name taken from the place @@ -461,8 +465,42 @@ performAction:grey_tapAtPoint(CGPointMake(0, 0))]; // Verify the window is not visible. - [[EarlGrey selectElementWithMatcher:windowMatcher] + ConditionBlock condition = ^{ + NSError* error = nil; + [[EarlGrey selectElementWithMatcher:windowMatcher] + assertWithMatcher:grey_notVisible() + error:&error]; + return !error; + }; + GREYAssert(base::test::ios::WaitUntilConditionOrTimeout( + kWaitForUIElementTimeout, condition), + @"Popover was not dismissed."); +} + +- (void)longPressElementOnWebView:(ElementSelector*)selector { + // Use triggers_context_menu = true as this is really "triggers_browser_menu". + [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()] + performAction:chrome_test_util::LongPressElementForContextMenu( + selector, true /* menu should appear */)]; +} + +- (void)triggerEditMenu:(ElementSelector*)selector { + [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] assertWithMatcher:grey_notVisible()]; + [self longPressElementOnWebView:selector]; + + NSError* error = nil; + [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] + assertWithMatcher:grey_sufficientlyVisible() + error:&error]; + if (error) { + // If edit is not visible, try to tap the element again. + // This is possible on inputs when the first long press just selects the + // input. + [self longPressElementOnWebView:selector]; + [[EarlGrey selectElementWithMatcher:[EditMenuAppInterface editMenuMatcher]] + assertWithMatcher:grey_sufficientlyVisible()]; + } } #pragma mark - Private
diff --git a/ios_internal b/ios_internal index eb65724..417fd86 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit eb657249ef39573d03dfd2f012057c2c69560e51 +Subproject commit 417fd8665cabc30f31cd42f4a8b21ce12cb42f9d
diff --git a/media/audio/mac/core_audio_util_mac.cc b/media/audio/mac/core_audio_util_mac.cc index 595d1d2..babc5d7 100644 --- a/media/audio/mac/core_audio_util_mac.cc +++ b/media/audio/mac/core_audio_util_mac.cc
@@ -18,6 +18,7 @@ #include "build/build_config.h" #include "media/audio/apple/scoped_audio_unit.h" #include "media/base/audio_timestamp_helper.h" +#include "media/base/media_switches.h" namespace media { namespace core_audio_mac { @@ -215,6 +216,25 @@ return ret; } +bool IsOutputTerminal(uint32_t terminal) { + // From IOAudioTypes.h + // + // // Output terminal types + // enum { + // OUTPUT_UNDEFINED = 0x0300, + // OUTPUT_SPEAKER = 0x0301, + // OUTPUT_HEADPHONES = 0x0302, + // OUTPUT_HEAD_MOUNTED_DISPLAY_AUDIO = 0x0303, + // OUTPUT_DESKTOP_SPEAKER = 0x0304, + // OUTPUT_ROOM_SPEAKER = 0x0305, + // OUTPUT_COMMUNICATION_SPEAKER = 0x0306, + // OUTPUT_LOW_FREQUENCY_EFFECTS_SPEAKER = 0x0307 + // }; + + return terminal >= OUTPUT_UNDEFINED && + terminal <= OUTPUT_LOW_FREQUENCY_EFFECTS_SPEAKER; +} + } // namespace std::vector<AudioObjectID> GetAllAudioDeviceIDs() { @@ -333,6 +353,7 @@ std::vector<AudioObjectID> streams = GetAudioObjectIDs(device_id, kAudioDevicePropertyStreams); + int num_voice_processing_input_streams = 0; int num_undefined_input_streams = 0; int num_defined_input_streams = 0; int num_output_streams = 0; @@ -348,22 +369,63 @@ if (direction == kDirectionOutput) { ++num_output_streams; } else if (direction == kDirectionInput) { - // Filter input streams based on what terminal it claims to be attached - // to. Note that INPUT_UNDEFINED comes from a set of terminals declared - // in IOKit. CoreAudio defines a number of terminals in - // AudioHardwareBase.h but none of them match any of the values I've - // seen used in practice, though I've only tested a few devices. + // Filter input streams based on the terminal they claim to be attached + // to. + // + // macOS adds input streams to all output devices if a VoiceProcessing + // AudioUnit is active. Without this filtering, output devices would be + // incorrectly classified as input devices due to these extra input + // streams. + // + // Testing has shown that VoiceProcessing-generated input streams have a + // terminal type of 0 or an Output terminal type. The previous code + // checked for terminal == INPUT_UNDEFINED, which I haven't observed. + // However, I've kept this check to maintain the original behavior, as it + // might be necessary for older macOS versions. auto terminal = GetDeviceUint32Property(stream_id, kAudioStreamPropertyTerminalType, kAudioObjectPropertyScopeGlobal); if (terminal.has_value() && terminal == INPUT_UNDEFINED) { ++num_undefined_input_streams; + } else if (terminal.has_value() && + (IsOutputTerminal(*terminal) || terminal == 0)) { + ++num_voice_processing_input_streams; + // TODO(crbug.com/392938088): Remove this increment when we see that + // the change is safe. See the TODO below for info. + ++num_defined_input_streams; } else { ++num_defined_input_streams; } } } + // TODO(crbug.com/392938088): The current filter will not remove all + // VoiceProcessing-generated input streams. To fully address + // crbug.com/392938088, we would also need to include + // num_voice_processing_input_streams in the filter (see details in the last + // section in this comment). + // + // Before we make that change, we're testing with UMA histogram to check for + // any unknown consequences, specifically whether it would ever + // exclude legitimate audio input devices. + // + // For now, we are just logging and maintaining the existing filter + // behavior. + // + // If the UMA histogram confirms that num_voice_processing_input_streams is + // always zero when VoiceProcessing AudioUnit is absent, then it is safe + // to include it in the filter (see details below). + // We will remove the `++num_defined_input_streams` increment under the TODO + // above, and treat the `num_voice_processing_input_streams` and + // `num_undefined_input_streams` the same in the return below, e.g. change + // `num_undefined_input_streams > 0` to + // `num_undefined_input_streams + num_voice_processing_input_streams > 0`. + if (!media::IsSystemEchoCancellationEnforced()) { + base::UmaHistogramBoolean( + "Media.Audio.Mac.VoiceProcessedInputStreamDetectedWithoutNativeAEC", + num_voice_processing_input_streams > 0); + } + // I've only seen INPUT_UNDEFINED introduced by the VoiceProcessing AudioUnit, // but to err on the side of caution, let's allow a device with only undefined // input streams and no output streams as well.
diff --git a/net/BUILD.gn b/net/BUILD.gn index 2f0069c..46a8062 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -201,6 +201,8 @@ "base/io_buffer.h", "base/ip_address.cc", "base/ip_address.h", + "base/ip_address_util.cc", + "base/ip_address_util.h", "base/ip_endpoint.cc", "base/ip_endpoint.h", "base/isolation_info.cc", @@ -2681,6 +2683,7 @@ "base/interval_test.cc", "base/io_buffer_unittest.cc", "base/ip_address_unittest.cc", + "base/ip_address_util_unittest.cc", "base/ip_endpoint_unittest.cc", "base/isolation_info_unittest.cc", "base/load_flags_to_string_unittest.cc",
diff --git a/net/base/ip_address.cc b/net/base/ip_address.cc index 57eb14f..0683452 100644 --- a/net/base/ip_address.cc +++ b/net/base/ip_address.cc
@@ -13,6 +13,7 @@ #include <string_view> #include "base/check_op.h" +#include "base/containers/span.h" #include "base/debug/alias.h" #include "base/debug/crash_logging.h" #include "base/logging.h" @@ -36,14 +37,13 @@ // * |ip_address| is at least |prefix_length_in_bits| (bits) long; // * |ip_prefix| is at least |prefix_length_in_bits| (bits) long. bool IPAddressPrefixCheck(const IPAddressBytes& ip_address, - const uint8_t* ip_prefix, + base::span<const uint8_t> ip_prefix, size_t prefix_length_in_bits) { // Compare all the bytes that fall entirely within the prefix. size_t num_entire_bytes_in_prefix = prefix_length_in_bits / 8; - for (size_t i = 0; i < num_entire_bytes_in_prefix; ++i) { - if (ip_address[i] != UNSAFE_TODO(ip_prefix[i])) { - return false; - } + if (ip_address.span().first(num_entire_bytes_in_prefix) != + ip_prefix.first(num_entire_bytes_in_prefix)) { + return false; } // In case the prefix was not a multiple of 8, there will be 1 byte @@ -52,7 +52,7 @@ if (remaining_bits != 0) { uint8_t mask = 0xFF << (8 - remaining_bits); size_t i = num_entire_bytes_in_prefix; - if ((ip_address[i] & mask) != UNSAFE_TODO((ip_prefix[i] & mask))) { + if ((ip_address[i] & mask) != (ip_prefix[i] & mask)) { return false; } } @@ -107,9 +107,9 @@ // Different IP versions have different range reservations. DCHECK_EQ(IPAddress::kIPv4AddressSize, ip_address.size()); struct { - const uint8_t address[4]; + uint8_t address[4]; size_t prefix_length_in_bits; - } static const kReservedIPv4Ranges[] = { + } static constexpr kReservedIPv4Ranges[] = { {{0, 0, 0, 0}, 8}, {{10, 0, 0, 0}, 8}, {{100, 64, 0, 0}, 10}, {{127, 0, 0, 0}, 8}, {{169, 254, 0, 0}, 16}, {{172, 16, 0, 0}, 12}, {{192, 0, 0, 0}, 24}, {{192, 0, 2, 0}, 24}, {{192, 88, 99, 0}, 24}, @@ -134,12 +134,12 @@ bool IsPubliclyRoutableIPv6(const IPAddressBytes& ip_address) { DCHECK_EQ(IPAddress::kIPv6AddressSize, ip_address.size()); struct { - const uint8_t address_prefix[2]; + uint8_t address_prefix[2]; size_t prefix_length_in_bits; - } static const kPublicIPv6Ranges[] = {// 2000::/3 -- Global Unicast - {{0x20, 0}, 3}, - // ff00::/8 -- Multicast - {{0xff, 0}, 8}}; + } static constexpr kPublicIPv6Ranges[] = {// 2000::/3 -- Global Unicast + {{0x20, 0}, 3}, + // ff00::/8 -- Multicast + {{0xff, 0}, 8}}; for (const auto& range : kPublicIPv6Ranges) { if (IPAddressPrefixCheck(ip_address, range.address_prefix, @@ -160,9 +160,12 @@ } // namespace bool IPAddressBytes::operator<(const IPAddressBytes& other) const { - if (size_ == other.size_) - return std::lexicographical_compare(begin(), end(), other.begin(), - other.end()); + // While `span() < other.span()` alone would be sufficient to give a + // consistent ordering, there's no need to sort lexicographically when sizes + // are different. + if (size_ == other.size_) { + return span() < other.span(); + } return size_ < other.size_; } @@ -335,9 +338,9 @@ url::StdStringCanonOutput output(&str); if (IsIPv4()) { - url::AppendIPv4Address(ip_address_.data(), &output); + url::AppendIPv4Address(ip_address_.span().data(), &output); } else if (IsIPv6()) { - url::AppendIPv6Address(ip_address_.data(), &output); + url::AppendIPv6Address(ip_address_.span().data(), &output); } output.Complete(); @@ -365,11 +368,6 @@ return base::StringPrintf("%s:%d", address_str.c_str(), port); } -std::string IPAddressToPackedString(const IPAddress& address) { - return std::string(reinterpret_cast<const char*>(address.bytes().data()), - address.size()); -} - IPAddress ConvertIPv4ToIPv4MappedIPv6(const IPAddress& address) { CHECK(address.IsIPv4()); // IPv4-mapped addresses are formed by: @@ -381,12 +379,10 @@ } IPAddress ConvertIPv4MappedIPv6ToIPv4(const IPAddress& address) { - DCHECK(address.IsIPv4MappedIPv6()); + CHECK(address.IsIPv4MappedIPv6()); - IPAddressBytes bytes; - bytes.Append( - base::span(address.bytes()).subspan(std::size(kIPv4MappedPrefix))); - return IPAddress(bytes); + return IPAddress( + address.bytes().span().subspan(std::size(kIPv4MappedPrefix))); } bool IPAddressMatchesPrefix(const IPAddress& ip_address, @@ -411,7 +407,7 @@ 96 + prefix_length_in_bits); } - return IPAddressPrefixCheck(ip_address.bytes(), ip_prefix.bytes().data(), + return IPAddressPrefixCheck(ip_address.bytes(), ip_prefix.bytes().span(), prefix_length_in_bits); } @@ -476,7 +472,7 @@ size_t MaskPrefixLength(const IPAddress& mask) { IPAddressBytes all_ones; all_ones.Resize(mask.size()); - std::fill(all_ones.begin(), all_ones.end(), 0xFF); + std::ranges::fill(all_ones.span(), 0xFF); return CommonPrefixLength(mask, IPAddress(all_ones)); }
diff --git a/net/base/ip_address.h b/net/base/ip_address.h index a62b110..798bc0f 100644 --- a/net/base/ip_address.h +++ b/net/base/ip_address.h
@@ -26,9 +26,15 @@ // Helper class to represent the sequence of bytes in an IP address. // A vector<uint8_t> would be simpler but incurs heap allocation, so -// IPAddressBytes uses a fixed size array. +// IPAddressBytes uses a fixed size std::array. class NET_EXPORT IPAddressBytes { public: + // Public solely for iterator types. + using IPAddressStorage = std::array<uint8_t, 16>; + + using iterator = IPAddressStorage::iterator; + using const_iterator = IPAddressStorage::const_iterator; + constexpr IPAddressBytes() : bytes_{}, size_(0) {} constexpr explicit IPAddressBytes(base::span<const uint8_t> data) { Assign(data); @@ -60,13 +66,21 @@ constexpr const uint8_t* data() const { return bytes_.data(); } constexpr uint8_t* data() { return bytes_.data(); } - // Returns a pointer to the first element. - constexpr const uint8_t* begin() const { return data(); } - constexpr uint8_t* begin() { return data(); } + // Returns an iterator to the first element. + constexpr const_iterator begin() const { return bytes_.begin(); } + constexpr iterator begin() { return bytes_.begin(); } - // Returns a pointer past the last element. - constexpr const uint8_t* end() const { return UNSAFE_TODO(data() + size_); } - constexpr uint8_t* end() { return UNSAFE_TODO(data() + size_); } + // Returns an iterator past the last element. + constexpr const_iterator end() const { return bytes_.begin() + size_; } + constexpr iterator end() { return bytes_.begin() + size_; } + + // Returns the address as a span. + constexpr base::span<const uint8_t> span() const { + return base::span(bytes_).first(size_); + } + constexpr base::span<uint8_t> span() { + return base::span(bytes_).first(size_); + } // Returns a reference to the last element. constexpr uint8_t& back() { @@ -104,8 +118,8 @@ size_t EstimateMemoryUsage() const; private: - // Underlying sequence of bytes - std::array<uint8_t, 16> bytes_; + // Underlying sequence of bytes. + IPAddressStorage bytes_; // Number of elements in |bytes_|. Should be either kIPv4AddressSize // or kIPv6AddressSize or 0. @@ -145,6 +159,11 @@ } // namespace internal +// Represent an IP address. Has built-in support for IPv4 and IPv6 addresses, +// though may also be used for Bluetooth addresses. +// +// See ip_address_util.h for helpers to convert an IPAddress to an in_addr or +// in6_addr. class NET_EXPORT IPAddress { public: enum : size_t { kIPv4AddressSize = 4, kIPv6AddressSize = 16 }; @@ -317,9 +336,6 @@ NET_EXPORT std::string IPAddressToStringWithPort(const IPAddress& address, uint16_t port); -// Returns the address as a sequence of bytes in network-byte-order. -NET_EXPORT std::string IPAddressToPackedString(const IPAddress& address); - // Converts an IPv4 address to an IPv4-mapped IPv6 address. // For example 192.168.0.1 would be converted to ::ffff:192.168.0.1. NET_EXPORT IPAddress ConvertIPv4ToIPv4MappedIPv6(const IPAddress& address);
diff --git a/net/base/ip_address_unittest.cc b/net/base/ip_address_unittest.cc index d4cfb7f..5242f4c5 100644 --- a/net/base/ip_address_unittest.cc +++ b/net/base/ip_address_unittest.cc
@@ -398,21 +398,6 @@ EXPECT_EQ("", IPAddressToStringWithPort(IPAddress(addr3), 8080)); } -TEST(IPAddressTest, IPAddressToPackedString) { - IPAddress ipv4_address; - EXPECT_TRUE(ipv4_address.AssignFromIPLiteral("4.31.198.44")); - std::string expected_ipv4_address("\x04\x1f\xc6\x2c", 4); - EXPECT_EQ(expected_ipv4_address, IPAddressToPackedString(ipv4_address)); - - IPAddress ipv6_address; - EXPECT_TRUE(ipv6_address.AssignFromIPLiteral("2001:0700:0300:1800::000f")); - std::string expected_ipv6_address( - "\x20\x01\x07\x00\x03\x00\x18\x00" - "\x00\x00\x00\x00\x00\x00\x00\x0f", - 16); - EXPECT_EQ(expected_ipv6_address, IPAddressToPackedString(ipv6_address)); -} - // Test that invalid IP literals fail to parse. TEST(IPAddressTest, AssignFromIPLiteral_FailParse) { IPAddress address; @@ -948,7 +933,7 @@ template <size_t N> constexpr bool VerifyIPBytes(const IPAddress& addr, const std::array<uint8_t, N> ip_bytes) { - return std::ranges::equal(addr.bytes(), ip_bytes); + return addr.bytes().span() == ip_bytes; } constexpr IPAddress CreateIPAddress(std::string_view ip_address) {
diff --git a/net/base/ip_address_util.cc b/net/base/ip_address_util.cc new file mode 100644 index 0000000..f83c6df --- /dev/null +++ b/net/base/ip_address_util.cc
@@ -0,0 +1,46 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/base/ip_address_util.h" + +#if BUILDFLAG(IS_WIN) +#include <winsock2.h> +#include <ws2tcpip.h> +#else +#include <netinet/in.h> +#endif + +#include <stdint.h> + +#include "base/check.h" +#include "base/containers/span.h" +#include "net/base/ip_address.h" + +namespace net { + +in_addr ToInAddr(const IPAddress& ip_address) { + static_assert(sizeof(in_addr) == IPAddress::kIPv4AddressSize, + "Address size mismatch"); + + auto span = ip_address.bytes().span(); + in_addr ret; + // This CHECKs size the span's size and the size of an in_addr aren't the + // same. + base::byte_span_from_ref(ret).copy_from(span); + return ret; +} + +in6_addr ToIn6Addr(const IPAddress& ip_address) { + static_assert(sizeof(in6_addr) == IPAddress::kIPv6AddressSize, + "Address size mismatch"); + + auto span = ip_address.bytes().span(); + in6_addr ret; + // This CHECKs size the span's size and the size of an in6_addr aren't the + // same. + base::byte_span_from_ref(ret).copy_from(span); + return ret; +} + +} // namespace net
diff --git a/net/base/ip_address_util.h b/net/base/ip_address_util.h new file mode 100644 index 0000000..9b71116 --- /dev/null +++ b/net/base/ip_address_util.h
@@ -0,0 +1,40 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_BASE_IP_ADDRESS_UTIL_H_ +#define NET_BASE_IP_ADDRESS_UTIL_H_ + +#include "build/build_config.h" + +#if BUILDFLAG(IS_WIN) +#include <winsock2.h> +#include <ws2tcpip.h> +#else +#include <netinet/in.h> +#endif + +#include <stdint.h> + +#include "net/base/net_export.h" + +// This file contains helpers to convert a net::IPAddress to an in_addr or +// in6_addr. This is a separate file because using in_addr or in6_addr requires +// including winsock2.h on Windows, which brings in a massive number of +// dependencies. As a result, this file should not be included in any header +// files - it should only be used in CC files.. + +namespace net { + +class IPAddress; + +// Converts `ip_address` to an in_addr or in6_addr, respectively. CHECKs if +// `ip_address` is not of the requested type. Does not do IPv4/IPv6 conversions. +// Since in_addr values are arrays of bytes, rather than representing the entire +// address as a single value, there is no need to convert to network byte order. +NET_EXPORT in_addr ToInAddr(const IPAddress& ip_address); +NET_EXPORT in6_addr ToIn6Addr(const IPAddress& ip_address); + +} // namespace net + +#endif // NET_BASE_IP_ADDRESS_UTIL_H_
diff --git a/net/base/ip_address_util_unittest.cc b/net/base/ip_address_util_unittest.cc new file mode 100644 index 0000000..d0ffc3e6 --- /dev/null +++ b/net/base/ip_address_util_unittest.cc
@@ -0,0 +1,46 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/base/ip_address_util.h" + +#if BUILDFLAG(IS_WIN) +#include <winsock2.h> +#include <ws2tcpip.h> +#else +#include <netinet/in.h> +#endif + +#include <stdint.h> + +#include <array> + +#include "net/base/ip_address.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace net { + +TEST(IpAddressUtil, ToInAddr) { + auto raw_ip_address = std::to_array<uint8_t>({1, 2, 3, 4}); + IPAddress ip_address(raw_ip_address); + in_addr addr = ToInAddr(ip_address); + + // Since the fields within in_addr vary by platform (but not the struct size), + // have to convert it to a common type to perform a comparison. + auto addr_as_span = base::byte_span_from_ref(addr); + EXPECT_EQ(addr_as_span, raw_ip_address); +} + +TEST(IpAddressUtil, ToIn6Addr) { + auto raw_ip_address = std::to_array<uint8_t>( + {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}); + IPAddress ip_address(raw_ip_address); + in6_addr addr = ToIn6Addr(ip_address); + + // Since the fields within in6_addr vary by platform (but not the struct + // size), have to convert it to a common type to perform a comparison. + auto addr_as_span = base::byte_span_from_ref(addr); + EXPECT_EQ(addr_as_span, raw_ip_address); +} + +} // namespace net
diff --git a/net/base/ip_endpoint.cc b/net/base/ip_endpoint.cc index 2ae43a23..369b1e4 100644 --- a/net/base/ip_endpoint.cc +++ b/net/base/ip_endpoint.cc
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/390223051): Remove C-library calls to fix the errors. -#pragma allow_unsafe_libc_calls -#endif - #include "net/base/ip_endpoint.h" #include <string.h> @@ -26,6 +21,7 @@ #include "base/values.h" #include "build/build_config.h" #include "net/base/ip_address.h" +#include "net/base/ip_address_util.h" #include "net/base/sys_addrinfo.h" #if BUILDFLAG(IS_WIN) @@ -91,8 +87,7 @@ } char* name = nullptr; - char buf[IF_NAMESIZE + 1]; - memset(buf, 0, sizeof(buf)); + char buf[IF_NAMESIZE + 1] = {0}; if (index_to_name_func_for_testing_) { name = index_to_name_func_for_testing_(scope_id.value(), buf); } else { @@ -198,11 +193,11 @@ return false; *address_length = kSockaddrInSize; struct sockaddr_in* addr = reinterpret_cast<struct sockaddr_in*>(address); - memset(addr, 0, sizeof(struct sockaddr_in)); + // Zero out address struct. + *addr = {}; addr->sin_family = AF_INET; addr->sin_port = base::HostToNet16(port_); - memcpy(&addr->sin_addr, address_.bytes().data(), - IPAddress::kIPv4AddressSize); + addr->sin_addr = ToInAddr(address_); break; } case IPAddress::kIPv6AddressSize: { @@ -211,11 +206,11 @@ *address_length = kSockaddrIn6Size; struct sockaddr_in6* addr6 = reinterpret_cast<struct sockaddr_in6*>(address); - memset(addr6, 0, sizeof(struct sockaddr_in6)); + // Zero out address struct. + *addr6 = {}; addr6->sin6_family = AF_INET6; addr6->sin6_port = base::HostToNet16(port_); - memcpy(&addr6->sin6_addr, address_.bytes().data(), - IPAddress::kIPv6AddressSize); + addr6->sin6_addr = ToIn6Addr(address_); if (IsIPv6LinkLocal() && scope_id_) { addr6->sin6_scope_id = *scope_id_; }
diff --git a/net/data/ssl/chrome_root_store/root_store.certs b/net/data/ssl/chrome_root_store/root_store.certs index 72b2f50..9687960 100644 --- a/net/data/ssl/chrome_root_store/root_store.certs +++ b/net/data/ssl/chrome_root_store/root_store.certs
@@ -55,11 +55,11 @@ b5:9f:4b Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 52:D8:88:3A:C8:9F:78:66:ED:89:F3:7B:38:70:94:C9:02:02:36:D0 X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:52:D8:88:3A:C8:9F:78:66:ED:89:F3:7B:38:70:94:C9:02:02:36:D0 X509v3 Key Usage: critical @@ -156,7 +156,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: AB:B6:DB:D7:06:9E:37:AC:30:86:07:91:70:C7:9C:C4:19:B1:78:C0 Signature Algorithm: ecdsa-with-SHA256 30:46:02:21:00:e0:85:92:a3:17:b7:8d:f9:2b:06:a5:93:ac: @@ -233,7 +233,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: B0:0C:F0:4C:30:F4:05:58:02:48:FD:33:E5:52:AF:4B:84:E3:66:52 Signature Algorithm: sha384WithRSAEncryption aa:a8:80:8f:0e:78:a3:e0:a2:d4:cd:e6:f5:98:7a:3b:ea:00: @@ -337,7 +337,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 84:18:CC:85:34:EC:BC:0C:94:94:2E:08:59:9C:C7:B2:10:4E:0A:08 Signature Algorithm: sha256WithRSAEncryption 98:f2:37:5a:41:90:a1:1a:c5:76:51:28:20:36:23:0e:ae:e6: @@ -406,7 +406,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: D3:EC:C7:3A:65:6E:CC:E1:DA:76:9A:56:FB:9C:F3:86:6D:57:E5:81 Signature Algorithm: ecdsa-with-SHA384 30:65:02:30:3a:8b:21:f1:bd:7e:11:ad:d0:ef:58:96:2f:d6: @@ -466,7 +466,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 08:76:CD:CB:07:FF:24:F6:C5:CD:ED:BB:90:BC:E2:84:37:46:75:F7 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -564,7 +564,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: B6:A1:54:39:02:C3:A0:3F:8E:8A:BC:FA:D4:F8:1C:A6:D1:3A:0E:FD X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -668,14 +668,14 @@ 8c:07 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: A7:A5:06:B1:2C:A6:09:60:EE:D1:97:E9:70:AE:BC:3B:19:6C:DB:21 X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:A7:A5:06:B1:2C:A6:09:60:EE:D1:97:E9:70:AE:BC:3B:19:6C:DB:21 - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: 1.3.6.1.4.1.6189.3.4.1.1 X509v3 Key Usage: critical @@ -770,15 +770,15 @@ 92:30:bb Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 65:CD:EB:AB:35:1E:00:3E:7E:D5:74:C0:1C:B4:73:47:0E:1A:64:2F X509v3 Basic Constraints: critical CA:TRUE, pathlen:1 - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: X509v3 Any Policy CPS: http://www.firmaprofesional.com/cps User Notice: - Explicit Text: + Explicit Text: X509v3 Key Usage: critical Certificate Sign, CRL Sign Signature Algorithm: sha256WithRSAEncryption @@ -902,7 +902,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: C9:80:77:E0:62:92:82:F5:46:9C:F3:BA:F7:4C:C3:DE:B8:A3:AD:39 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -1022,7 +1022,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 47:B8:CD:FF:E5:6F:EE:F8:B2:EC:2F:4E:0E:F9:25:B0:8E:3C:6B:C3 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -1145,7 +1145,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 82:21:2D:66:C6:D7:A0:E0:15:EB:CE:4C:09:77:C4:60:9E:54:6E:03 Signature Algorithm: sha256WithRSAEncryption 60:de:1a:b8:e7:f2:60:82:d5:03:33:81:cb:06:8a:f1:22:49: @@ -1248,7 +1248,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Non Repudiation, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: E0:8C:9B:DB:25:49:B3:F1:7C:86:D6:B2:42:87:0B:D0:6B:A0:D9:E4 Signature Algorithm: sha1WithRSAEncryption 3e:d2:1c:89:2e:35:fc:f8:75:dd:e6:7f:65:88:f4:72:4c:c9: @@ -1339,14 +1339,14 @@ 96:05:8d Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:E3:FE:2D:FD:28:D0:0B:B5:BA:B6:A2:C4:BF:06:AA:05:8C:93:FB:2F X509v3 Basic Constraints: critical CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: E3:FE:2D:FD:28:D0:0B:B5:BA:B6:A2:C4:BF:06:AA:05:8C:93:FB:2F Signature Algorithm: sha256WithRSAEncryption 25:c6:ba:6b:eb:87:cb:de:82:39:96:3d:f0:44:a7:6b:84:73: @@ -1464,11 +1464,11 @@ 9d:54:31 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 1E:0C:F7:B6:67:F2:E1:92:26:09:45:C0:55:39:2E:77:3F:42:4A:A2 - X509v3 Basic Constraints: + X509v3 Basic Constraints: CA:TRUE - setCext-hashedRoot: + setCext-hashedRoot: 0/0-...0...+......0...g*.....E... V|.[x....S..... Signature Algorithm: sha1WithRSAEncryption @@ -1535,85 +1535,6 @@ hNQ+IIX3Sj0rnP0qCglN6oH4EZw= -----END CERTIFICATE----- -# bf0feefb9e3a581ad5f9e9db7589985743d261085c4d314f6f5d7259aa421612 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = JP, O = "Japan Certification Services, Inc.", CN = SecureSign RootCA11 - Validity - Not Before: Apr 8 04:56:47 2009 GMT - Not After : Apr 8 04:56:47 2029 GMT - Subject: C = JP, O = "Japan Certification Services, Inc.", CN = SecureSign RootCA11 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:fd:77:aa:a5:1c:90:05:3b:cb:4c:9b:33:8b:5a: - 14:45:a4:e7:90:16:d1:df:57:d2:21:10:a4:17:fd: - df:ac:d6:1f:a7:e4:db:7c:f7:ec:df:b8:03:da:94: - 58:fd:5d:72:7c:8c:3f:5f:01:67:74:15:96:e3:02: - 3c:87:db:ae:cb:01:8e:c2:f3:66:c6:85:45:f4:02: - c6:3a:b5:62:b2:af:fa:9c:bf:a4:e6:d4:80:30:98: - f3:0d:b6:93:8f:a9:d4:d8:36:f2:b0:fc:8a:ca:2c: - a1:15:33:95:31:da:c0:1b:f2:ee:62:99:86:63:3f: - bf:dd:93:2a:83:a8:76:b9:13:1f:b7:ce:4e:42:85: - 8f:22:e7:2e:1a:f2:95:09:b2:05:b5:44:4e:77:a1: - 20:bd:a9:f2:4e:0a:7d:50:ad:f5:05:0d:45:4f:46: - 71:fd:28:3e:53:fb:04:d8:2d:d7:65:1d:4a:1b:fa: - cf:3b:b0:31:9a:35:6e:c8:8b:06:d3:00:91:f2:94: - 08:65:4c:b1:34:06:00:7a:89:e2:f0:c7:03:59:cf: - d5:d6:e8:a7:32:b3:e6:98:40:86:c5:cd:27:12:8b: - cc:7b:ce:b7:11:3c:62:60:07:23:3e:2b:40:6e:94: - 80:09:6d:b6:b3:6f:77:6f:35:08:50:fb:02:87:c5: - 3e:89 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - 5B:F8:4D:4F:B2:A5:86:D4:3A:D2:F1:63:9A:A0:BE:09:F6:57:B7:DE - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: sha1WithRSAEncryption - a0:a1:38:16:66:2e:a7:56:1f:21:9c:06:fa:1d:ed:b9:22:c5: - 38:26:d8:4e:4f:ec:a3:7f:79:de:46:21:a1:87:77:8f:07:08: - 9a:b2:a4:c5:af:0f:32:98:0b:7c:66:29:b6:9b:7d:25:52:49: - 43:ab:4c:2e:2b:6e:7a:70:af:16:0e:e3:02:6c:fb:42:e6:18: - 9d:45:d8:55:c8:e8:3b:dd:e7:e1:f4:2e:0b:1c:34:5c:6c:58: - 4a:fb:8c:88:50:5f:95:1c:bf:ed:ab:22:b5:65:b3:85:ba:9e: - 0f:b8:ad:e5:7a:1b:8a:50:3a:1d:bd:0d:bc:7b:54:50:0b:b9: - 42:af:55:a0:18:81:ad:65:99:ef:be:e4:9c:bf:c4:85:ab:41: - b2:54:6f:dc:25:cd:ed:78:e2:8e:0c:8d:09:49:dd:63:7b:5a: - 69:96:02:21:a8:bd:52:59:e9:7d:35:cb:c8:52:ca:7f:81:fe: - d9:6b:d3:f7:11:ed:25:df:f8:e7:f9:a4:fa:72:97:84:53:0d: - a5:d0:32:18:51:76:59:14:6c:0f:eb:ec:5f:80:8c:75:43:83: - c3:85:98:ff:4c:9e:2d:0d:e4:77:83:93:4e:b5:96:07:8b:28: - 13:9b:8c:19:8d:41:27:49:40:ee:de:e6:23:44:39:dc:a1:22: - d6:ba:03:f2 ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr -MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG -A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0 -MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp -Y2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD -QTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz -i1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8 -h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV -MdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9 -UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni -8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC -h8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD -VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB -AKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm -KbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ -X5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr -QbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5 -pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN -QSdJQO7e5iNEOdyhIta6A/I= ------END CERTIFICATE----- - # 49e7a442acf0ea6287050054b52564b650e4f49e42e348d6aa38e039e957b1c1 Certificate: Data: @@ -1651,11 +1572,11 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: FD:DA:14:C4:9F:30:DE:21:BD:1E:42:39:FC:AB:63:23:49:E0:F1:84 X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: Full Name: URI:ldap://directory.d-trust.net/CN=D-TRUST%20Root%20Class%203%20CA%202%202009,O=D-Trust%20GmbH,C=DE?certificaterevocationlist @@ -1742,11 +1663,11 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: D3:94:8A:4C:62:13:2A:19:2E:CC:AF:72:8A:7D:36:D7:9A:1C:DC:67 X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: Full Name: URI:ldap://directory.d-trust.net/CN=D-TRUST%20Root%20Class%203%20CA%202%20EV%202009,O=D-Trust%20GmbH,C=DE?certificaterevocationlist @@ -1835,7 +1756,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: BF:59:20:36:00:79:A0:A0:22:6B:8C:D5:F2:61:D2:B8:2C:CB:82:4A Signature Algorithm: sha256WithRSAEncryption 31:03:a2:61:0b:1f:74:e8:72:36:c6:6d:f9:4d:9e:fa:22:a8: @@ -1916,7 +1837,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: B5:03:F7:76:3B:61:82:6A:12:AA:18:53:EB:03:21:94:BF:FE:CE:CA Signature Algorithm: sha256WithRSAEncryption 56:3d:ef:94:d5:bd:da:73:b2:58:be:ae:90:ad:98:27:97:fe: @@ -2015,16 +1936,16 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 18:87:56:E0:6E:77:EE:24:35:3C:4E:73:9A:1F:D6:E1:E2:79:7E:2B - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:18:87:56:E0:6E:77:EE:24:35:3C:4E:73:9A:1F:D6:E1:E2:79:7E:2B - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: X509v3 Any Policy CPS: https://wwww.certigna.fr/autorites/ - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: Full Name: URI:http://crl.certigna.fr/certignarootca.crl @@ -2137,16 +2058,16 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 1A:ED:FE:41:39:90:B4:24:59:BE:01:F2:52:D5:45:F6:5A:39:DC:11 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:1A:ED:FE:41:39:90:B4:24:59:BE:01:F2:52:D5:45:F6:5A:39:DC:11 DirName:/C=FR/O=Dhimyotis/CN=Certigna serial:FE:DC:E3:01:0F:C9:48:FF X509v3 Key Usage: critical Certificate Sign, CRL Sign - Netscape Cert Type: + Netscape Cert Type: SSL CA, S/MIME CA, Object Signing CA Signature Algorithm: sha1WithRSAEncryption 85:03:1e:92:71:f6:42:af:e1:a3:61:9e:eb:f3:c0:0f:f2:a5: @@ -2187,85 +2108,6 @@ WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== -----END CERTIFICATE----- -# 16af57a9f676b0ab126095aa5ebadef22ab31119d644ac95cd4b93dbf3f26aeb -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 33554617 (0x20000b9) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = IE, O = Baltimore, OU = CyberTrust, CN = Baltimore CyberTrust Root - Validity - Not Before: May 12 18:46:00 2000 GMT - Not After : May 12 23:59:00 2025 GMT - Subject: C = IE, O = Baltimore, OU = CyberTrust, CN = Baltimore CyberTrust Root - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:a3:04:bb:22:ab:98:3d:57:e8:26:72:9a:b5:79: - d4:29:e2:e1:e8:95:80:b1:b0:e3:5b:8e:2b:29:9a: - 64:df:a1:5d:ed:b0:09:05:6d:db:28:2e:ce:62:a2: - 62:fe:b4:88:da:12:eb:38:eb:21:9d:c0:41:2b:01: - 52:7b:88:77:d3:1c:8f:c7:ba:b9:88:b5:6a:09:e7: - 73:e8:11:40:a7:d1:cc:ca:62:8d:2d:e5:8f:0b:a6: - 50:d2:a8:50:c3:28:ea:f5:ab:25:87:8a:9a:96:1c: - a9:67:b8:3f:0c:d5:f7:f9:52:13:2f:c2:1b:d5:70: - 70:f0:8f:c0:12:ca:06:cb:9a:e1:d9:ca:33:7a:77: - d6:f8:ec:b9:f1:68:44:42:48:13:d2:c0:c2:a4:ae: - 5e:60:fe:b6:a6:05:fc:b4:dd:07:59:02:d4:59:18: - 98:63:f5:a5:63:e0:90:0c:7d:5d:b2:06:7a:f3:85: - ea:eb:d4:03:ae:5e:84:3e:5f:ff:15:ed:69:bc:f9: - 39:36:72:75:cf:77:52:4d:f3:c9:90:2c:b9:3d:e5: - c9:23:53:3f:1f:24:98:21:5c:07:99:29:bd:c6:3a: - ec:e7:6e:86:3a:6b:97:74:63:33:bd:68:18:31:f0: - 78:8d:76:bf:fc:9e:8e:5d:2a:86:a7:4d:90:dc:27: - 1a:39 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - E5:9D:59:30:82:47:58:CC:AC:FA:08:54:36:86:7B:3A:B5:04:4D:F0 - X509v3 Basic Constraints: critical - CA:TRUE, pathlen:3 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - Signature Algorithm: sha1WithRSAEncryption - 85:0c:5d:8e:e4:6f:51:68:42:05:a0:dd:bb:4f:27:25:84:03: - bd:f7:64:fd:2d:d7:30:e3:a4:10:17:eb:da:29:29:b6:79:3f: - 76:f6:19:13:23:b8:10:0a:f9:58:a4:d4:61:70:bd:04:61:6a: - 12:8a:17:d5:0a:bd:c5:bc:30:7c:d6:e9:0c:25:8d:86:40:4f: - ec:cc:a3:7e:38:c6:37:11:4f:ed:dd:68:31:8e:4c:d2:b3:01: - 74:ee:be:75:5e:07:48:1a:7f:70:ff:16:5c:84:c0:79:85:b8: - 05:fd:7f:be:65:11:a3:0f:c0:02:b4:f8:52:37:39:04:d5:a9: - 31:7a:18:bf:a0:2a:f4:12:99:f7:a3:45:82:e3:3c:5e:f5:9d: - 9e:b5:c8:9e:7c:2e:c8:a4:9e:4e:08:14:4b:6d:fd:70:6d:6b: - 1a:63:bd:64:e6:1f:b7:ce:f0:f2:9f:2e:bb:1b:b7:f2:50:88: - 73:92:c2:e2:e3:16:8d:9a:32:02:ab:8e:18:dd:e9:10:11:ee: - 7e:35:ab:90:af:3e:30:94:7a:d0:33:3d:a7:65:0f:f5:fc:8e: - 9e:62:cf:47:44:2c:01:5d:bb:1d:b5:32:d2:47:d2:38:2e:d0: - fe:81:dc:32:6a:1e:b5:ee:3c:d5:fc:e7:81:1d:19:c3:24:42: - ea:63:39:a9 ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ -RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD -VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX -DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y -ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy -VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr -mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr -IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK -mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu -XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy -dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye -jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 -BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 -DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 -9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx -jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 -Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz -ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS -R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- - # 31ad6648f8104138c738f39ea4320133393e3a18cc02296ef97c2ac9ef6731d0 Certificate: Data: @@ -2296,7 +2138,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: B3:DB:48:A4:F9:A1:C5:D8:AE:36:41:CC:11:63:69:62:29:BC:4B:C6 Signature Algorithm: ecdsa-with-SHA384 30:65:02:31:00:ad:bc:f2:6c:3f:12:4a:d1:2d:39:c3:0a:09: @@ -2361,9 +2203,9 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 45:EB:A2:AF:F4:92:CB:82:31:2D:51:8B:A7:A7:21:9D:F3:6D:C8:0F - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:45:EB:A2:AF:F4:92:CB:82:31:2D:51:8B:A7:A7:21:9D:F3:6D:C8:0F Signature Algorithm: sha1WithRSAEncryption @@ -2445,9 +2287,9 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 03:DE:50:35:56:D1:4C:BB:66:F0:A3:E2:1B:1B:C3:97:B2:3D:D1:55 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:03:DE:50:35:56:D1:4C:BB:66:F0:A3:E2:1B:1B:C3:97:B2:3D:D1:55 Signature Algorithm: sha1WithRSAEncryption @@ -2546,7 +2388,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: EC:D7:E3:82:D2:71:5D:64:4C:DF:2E:67:3F:E7:BA:98:AE:1C:0F:4F Signature Algorithm: sha384WithRSAEncryption bb:61:d9:7d:a9:6c:be:17:c4:91:1b:c3:a1:a2:00:8d:e3:64: @@ -2651,9 +2493,9 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: B1:3E:C3:69:03:F8:BF:47:01:D4:98:26:1A:08:02:EF:63:64:2B:C3 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:B1:3E:C3:69:03:F8:BF:47:01:D4:98:26:1A:08:02:EF:63:64:2B:C3 Signature Algorithm: sha1WithRSAEncryption @@ -2736,7 +2578,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: CE:C3:4A:B9:99:55:F2:B8:DB:60:BF:A9:7E:BD:56:B5:97:36:A7:D6 Signature Algorithm: sha256WithRSAEncryption ca:a5:55:8c:e3:c8:41:6e:69:27:a7:75:11:ef:3c:86:36:6f: @@ -2807,7 +2649,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: CB:D0:BD:A9:E1:98:05:51:A1:4D:37:A2:83:79:CE:8D:1D:2A:E4:84 Signature Algorithm: ecdsa-with-SHA384 30:64:02:30:25:a4:81:45:02:6b:12:4b:75:74:4f:c8:23:e3: @@ -2872,7 +2714,7 @@ CA:TRUE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 4E:22:54:20:18:95:E6:E3:6E:E6:0F:FA:FA:B9:12:ED:06:17:8F:39 Signature Algorithm: sha256WithRSAEncryption 60:67:28:94:6f:0e:48:63:eb:31:dd:ea:67:18:d5:89:7d:3c: @@ -2970,7 +2812,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: B5:99:F8:AF:B0:94:F5:E3:20:D6:0A:AD:CE:4E:56:A4:2E:6E:42:ED Signature Algorithm: sha256WithRSAEncryption 26:06:5e:70:e7:65:33:c8:82:6e:d9:9c:17:3a:1b:7a:66:b2: @@ -3034,86 +2876,6 @@ L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL -----END CERTIFICATE----- -# 125609aa301da0a249b97a8239cb6a34216f44dcac9f3954b14292f2e8c8608f -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - ae:cf:00:ba:c4:cf:32:f8:43:b2 - Signature Algorithm: sha256WithRSAEncryption - Issuer: C = US, OU = emSign PKI, O = eMudhra Inc, CN = emSign Root CA - C1 - Validity - Not Before: Feb 18 18:30:00 2018 GMT - Not After : Feb 18 18:30:00 2043 GMT - Subject: C = US, OU = emSign PKI, O = eMudhra Inc, CN = emSign Root CA - C1 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:cf:eb:a9:b9:f1:99:05:cc:d8:28:21:4a:f3:73: - 34:51:84:56:10:f5:a0:4f:2c:12:e3:fa:13:9a:27: - d0:cf:f9:79:1a:74:5f:1d:79:39:fc:5b:f8:70:8e: - e0:92:52:f7:e4:25:f9:54:83:d9:1d:d3:c8:5a:85: - 3f:5e:c7:b6:07:ee:3e:c0:ce:9a:af:ac:56:42:2a: - 39:25:70:d6:bf:b5:7b:36:ad:ac:f6:73:dc:cd:d7: - 1d:8a:83:a5:fb:2b:90:15:37:6b:1c:26:47:dc:3b: - 29:56:93:6a:b3:c1:6a:3a:9d:3d:f5:c1:97:38:58: - 05:8b:1c:11:e3:e4:b4:b8:5d:85:1d:83:fe:78:5f: - 0b:45:68:18:48:a5:46:73:34:3b:fe:0f:c8:76:bb: - c7:18:f3:05:d1:86:f3:85:ed:e7:b9:d9:32:ad:55: - 88:ce:a6:b6:91:b0:4f:ac:7e:15:23:96:f6:3f:f0: - 20:34:16:de:0a:c6:c4:04:45:79:7f:a7:fd:be:d2: - a9:a5:af:9c:c5:23:2a:f7:3c:21:6c:bd:af:8f:4e: - c5:3a:b2:f3:34:12:fc:df:80:1a:49:a4:d4:a9:95: - f7:9e:89:5e:a2:89:ac:94:cb:a8:68:9b:af:8a:65: - 27:cd:89:ee:dd:8c:b5:6b:29:70:43:a0:69:0b:e4: - b9:0f - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - FE:A1:E0:70:1E:2A:03:39:52:5A:42:BE:5C:91:85:7A:18:AA:4D:B5 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: sha256WithRSAEncryption - c2:4a:56:fa:15:21:7b:28:a2:e9:e5:1d:fb:f8:2d:c4:39:96: - 41:4c:3b:27:2c:c4:6c:18:15:80:c6:ac:af:47:59:2f:26:0b: - e3:36:b0:ef:3b:fe:43:97:49:32:99:12:15:5b:df:11:29:ff: - ab:53:f8:bb:c1:78:0f:ac:9c:53:af:57:bd:68:8c:3d:69:33: - f0:a3:a0:23:63:3b:64:67:22:44:ad:d5:71:cb:56:2a:78:92: - a3:4f:12:31:36:36:e2:de:fe:00:c4:a3:60:0f:27:ad:a0:b0: - 8a:b5:36:7a:52:a1:bd:27:f4:20:27:62:e8:4d:94:24:13:e4: - 0a:04:e9:3c:ab:2e:c8:43:09:4a:c6:61:04:e5:49:34:7e:d3: - c4:c8:f5:0f:c0:aa:e9:ba:54:5e:f3:63:2b:4f:4f:50:d4:fe: - b9:7b:99:8c:3d:c0:2e:bc:02:2b:d3:c4:40:e4:8a:07:31:1e: - 9b:ce:26:99:13:fb:11:ea:9a:22:0c:11:19:c7:5e:1b:81:50: - 30:c8:96:12:6e:e7:cb:41:7f:91:3b:a2:47:b7:54:80:1b:dc: - 00:cc:9a:90:ea:c3:c3:50:06:62:0c:30:c0:15:48:a7:a8:59: - 7c:e1:ae:22:a2:e2:0a:7a:0f:fa:62:ab:52:4c:e1:f1:df:ca: - be:83:0d:42 ------BEGIN CERTIFICATE----- -MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkG -A1UEBhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEg -SW5jMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEMxMB4XDTE4MDIxODE4MzAw -MFoXDTQzMDIxODE4MzAwMFowVjELMAkGA1UEBhMCVVMxEzARBgNVBAsTCmVtU2ln -biBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQDExNlbVNpZ24gUm9v -dCBDQSAtIEMxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+upufGZ -BczYKCFK83M0UYRWEPWgTywS4/oTmifQz/l5GnRfHXk5/Fv4cI7gklL35CX5VIPZ -HdPIWoU/Xse2B+4+wM6ar6xWQio5JXDWv7V7Nq2s9nPczdcdioOl+yuQFTdrHCZH -3DspVpNqs8FqOp099cGXOFgFixwR4+S0uF2FHYP+eF8LRWgYSKVGczQ7/g/IdrvH -GPMF0Ybzhe3nudkyrVWIzqa2kbBPrH4VI5b2P/AgNBbeCsbEBEV5f6f9vtKppa+c -xSMq9zwhbL2vj07FOrLzNBL834AaSaTUqZX3noleoomslMuoaJuvimUnzYnu3Yy1 -aylwQ6BpC+S5DwIDAQABo0IwQDAdBgNVHQ4EFgQU/qHgcB4qAzlSWkK+XJGFehiq -TbUwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL -BQADggEBAMJKVvoVIXsoounlHfv4LcQ5lkFMOycsxGwYFYDGrK9HWS8mC+M2sO87 -/kOXSTKZEhVb3xEp/6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4 -kqNPEjE2NuLe/gDEo2APJ62gsIq1NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrG -YQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9wC68AivTxEDkigcxHpvOJpkT -+xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQBmIMMMAVSKeo -WXzhriKi4gp6D/piq1JM4fHfyr6DDUI= ------END CERTIFICATE----- - # 40f6af0346a99aa1cd1d555a4e9cce62c7f9634603ee406615833dc8c8d00367 Certificate: Data: @@ -3150,7 +2912,7 @@ c7:85 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: FB:EF:0D:86:9E:B0:E3:DD:A9:B9:F1:21:17:7F:3E:FC:F0:77:2B:1A X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -3221,7 +2983,7 @@ ASN1 OID: secp384r1 NIST CURVE: P-384 X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 7C:5D:02:84:13:D4:CC:8A:9B:81:CE:17:1C:2E:29:1E:9C:48:63:42 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -3250,60 +3012,6 @@ +JbNR6iC8hZVdyR+EhCVBCyj -----END CERTIFICATE----- -# bc4d809b15189d78db3e1d8cf4f9726a795da1643ca5f1358e1ddb0edc0d7eb3 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - 7b:71:b6:82:56:b8:12:7c:9c:a8 - Signature Algorithm: ecdsa-with-SHA384 - Issuer: C = US, OU = emSign PKI, O = eMudhra Inc, CN = emSign ECC Root CA - C3 - Validity - Not Before: Feb 18 18:30:00 2018 GMT - Not After : Feb 18 18:30:00 2043 GMT - Subject: C = US, OU = emSign PKI, O = eMudhra Inc, CN = emSign ECC Root CA - C3 - Subject Public Key Info: - Public Key Algorithm: id-ecPublicKey - Public-Key: (384 bit) - pub: - 04:fd:a5:61:ae:7b:26:10:1d:e9:b7:22:30:ae:06: - f4:81:b3:b1:42:71:95:39:bc:d3:52:e3:af:af:f9: - f2:97:35:92:36:46:0e:87:95:8d:b9:39:5a:e9:bb: - df:d0:fe:c8:07:41:3c:bb:55:6f:83:a3:6a:fb:62: - b0:81:89:02:70:7d:48:c5:4a:e3:e9:22:54:22:4d: - 93:bb:42:0c:af:77:9c:23:a6:7d:d7:61:11:ce:65: - c7:f8:7f:fe:f5:f2:a9 - ASN1 OID: secp384r1 - NIST CURVE: P-384 - X509v3 extensions: - X509v3 Subject Key Identifier: - FB:5A:48:D0:80:20:40:F2:A8:E9:00:07:69:19:77:A7:E6:C3:F4:CF - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - Signature Algorithm: ecdsa-with-SHA384 - 30:65:02:31:00:b4:d8:2f:02:89:fd:b6:4c:62:ba:43:4e:13: - 84:72:b5:ae:dd:1c:de:d6:b5:dc:56:8f:58:40:5a:2d:de:20: - 4c:22:83:ca:93:a8:7e:ee:12:40:c7:d6:87:4f:f8:df:85:02: - 30:1c:14:64:e4:7c:96:83:11:9c:b0:d1:5a:61:4b:a6:0f:49: - d3:00:fc:a1:fc:e4:a5:ff:7f:ad:d7:30:d0:c7:77:7f:be:81: - 07:55:30:50:20:14:f5:57:38:0a:a8:31:51 ------BEGIN CERTIFICATE----- -MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQG -EwJVUzETMBEGA1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMx -IDAeBgNVBAMTF2VtU2lnbiBFQ0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAw -MFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UEBhMCVVMxEzARBgNVBAsTCmVtU2ln -biBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQDExdlbVNpZ24gRUND -IFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd6bci -MK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4Ojavti -sIGJAnB9SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0O -BBYEFPtaSNCAIEDyqOkAB2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB -Af8EBTADAQH/MAoGCCqGSM49BAMDA2gAMGUCMQC02C8Cif22TGK6Q04ThHK1rt0c -3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwUZOR8loMRnLDRWmFLpg9J -0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== ------END CERTIFICATE----- - # 02ed0eb28c14da45165c566791700d6451d7fb56f0b2ab1d3b8eb070e56edff5 Certificate: Data: @@ -3334,7 +3042,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: B7:63:E7:1A:DD:8D:E9:08:A6:55:83:A4:E0:6A:50:41:65:11:42:49 Signature Algorithm: ecdsa-with-SHA384 30:64:02:30:61:79:d8:e5:42:47:df:1c:ae:53:99:17:b6:6f: @@ -3397,7 +3105,7 @@ 79:31 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 9D:93:C6:53:8B:5E:CA:AF:3F:9F:1E:0F:E5:99:95:BC:24:F6:94:8F X509v3 Basic Constraints: critical CA:TRUE @@ -3475,7 +3183,7 @@ b4:15 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 07:1F:D2:E7:9C:DA:C2:6E:A2:40:B4:B0:7A:50:10:50:74:C4:C8:BD X509v3 Basic Constraints: critical CA:TRUE @@ -3557,7 +3265,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 6A:72:26:7A:D0:1E:EF:7D:E7:3B:69:51:D4:6C:8D:9F:90:12:66:AB Signature Algorithm: sha256WithRSAEncryption 79:9f:1d:96:c6:b6:79:3f:22:8d:87:d3:87:03:04:60:6a:6b: @@ -3601,89 +3309,6 @@ VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9g== -----END CERTIFICATE----- -# 6dc47172e01cbcb0bf62580d895fe2b8ac9ad4f873801e0c10b9c837d21eb177 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 946069240 (0x3863def8) - Signature Algorithm: sha1WithRSAEncryption - Issuer: O = Entrust.net, OU = www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), OU = (c) 1999 Entrust.net Limited, CN = Entrust.net Certification Authority (2048) - Validity - Not Before: Dec 24 17:50:51 1999 GMT - Not After : Jul 24 14:15:12 2029 GMT - Subject: O = Entrust.net, OU = www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), OU = (c) 1999 Entrust.net Limited, CN = Entrust.net Certification Authority (2048) - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:ad:4d:4b:a9:12:86:b2:ea:a3:20:07:15:16:64: - 2a:2b:4b:d1:bf:0b:4a:4d:8e:ed:80:76:a5:67:b7: - 78:40:c0:73:42:c8:68:c0:db:53:2b:dd:5e:b8:76: - 98:35:93:8b:1a:9d:7c:13:3a:0e:1f:5b:b7:1e:cf: - e5:24:14:1e:b1:81:a9:8d:7d:b8:cc:6b:4b:03:f1: - 02:0c:dc:ab:a5:40:24:00:7f:74:94:a1:9d:08:29: - b3:88:0b:f5:87:77:9d:55:cd:e4:c3:7e:d7:6a:64: - ab:85:14:86:95:5b:97:32:50:6f:3d:c8:ba:66:0c: - e3:fc:bd:b8:49:c1:76:89:49:19:fd:c0:a8:bd:89: - a3:67:2f:c6:9f:bc:71:19:60:b8:2d:e9:2c:c9:90: - 76:66:7b:94:e2:af:78:d6:65:53:5d:3c:d6:9c:b2: - cf:29:03:f9:2f:a4:50:b2:d4:48:ce:05:32:55:8a: - fd:b2:64:4c:0e:e4:98:07:75:db:7f:df:b9:08:55: - 60:85:30:29:f9:7b:48:a4:69:86:e3:35:3f:1e:86: - 5d:7a:7a:15:bd:ef:00:8e:15:22:54:17:00:90:26: - 93:bc:0e:49:68:91:bf:f8:47:d3:9d:95:42:c1:0e: - 4d:df:6f:26:cf:c3:18:21:62:66:43:70:d6:d5:c0: - 07:e1 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - 55:E4:81:D1:11:80:BE:D8:89:B9:08:A3:31:F9:A1:24:09:16:B9:70 - Signature Algorithm: sha1WithRSAEncryption - 3b:9b:8f:56:9b:30:e7:53:99:7c:7a:79:a7:4d:97:d7:19:95: - 90:fb:06:1f:ca:33:7c:46:63:8f:96:66:24:fa:40:1b:21:27: - ca:e6:72:73:f2:4f:fe:31:99:fd:c8:0c:4c:68:53:c6:80:82: - 13:98:fa:b6:ad:da:5d:3d:f1:ce:6e:f6:15:11:94:82:0c:ee: - 3f:95:af:11:ab:0f:d7:2f:de:1f:03:8f:57:2c:1e:c9:bb:9a: - 1a:44:95:eb:18:4f:a6:1f:cd:7d:57:10:2f:9b:04:09:5a:84: - b5:6e:d8:1d:3a:e1:d6:9e:d1:6c:79:5e:79:1c:14:c5:e3:d0: - 4c:93:3b:65:3c:ed:df:3d:be:a6:e5:95:1a:c3:b5:19:c3:bd: - 5e:5b:bb:ff:23:ef:68:19:cb:12:93:27:5c:03:2d:6f:30:d0: - 1e:b6:1a:ac:de:5a:f7:d1:aa:a8:27:a6:fe:79:81:c4:79:99: - 33:57:ba:12:b0:a9:e0:42:6c:93:ca:56:de:fe:6d:84:0b:08: - 8b:7e:8d:ea:d7:98:21:c6:f3:e7:3c:79:2f:5e:9c:d1:4c:15: - 8d:e1:ec:22:37:cc:9a:43:0b:97:dc:80:90:8d:b3:67:9b:6f: - 48:08:15:56:cf:bf:f1:2b:7c:5e:9a:76:e9:59:90:c5:7c:83: - 35:11:65:51 ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML -RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp -bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 -IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3 -MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 -LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp -YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG -A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq -K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe -sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX -MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT -XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ -HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH -4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV -HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub -j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo -U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf -zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b -u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+ -bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er -fF6adulZkMV8gzURZVE= ------END CERTIFICATE----- - # 70a73f7f376b60074248904534b11482d5bf0e698ecc498df52577ebf2e93b9a Certificate: Data: @@ -3736,7 +3361,7 @@ 8a:b6:67 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 9D:C0:67:A6:0C:22:D9:26:F5:45:AB:A6:65:52:11:27:D8:45:AC:63 X509v3 Basic Constraints: critical CA:TRUE @@ -3843,14 +3468,14 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Private Key Usage Period: + X509v3 Private Key Usage Period: Not Before: Nov 27 20:23:42 2006 GMT, Not After: Nov 27 20:53:42 2026 GMT - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:68:90:E4:67:A4:A6:53:80:C7:86:66:A4:F1:F7:4B:43:FB:84:BD:6D - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 68:90:E4:67:A4:A6:53:80:C7:86:66:A4:F1:F7:4B:43:FB:84:BD:6D - 1.2.840.113533.7.65.0: + 1.2.840.113533.7.65.0: 0...V7.1:4.0.... Signature Algorithm: sha1WithRSAEncryption 93:d4:30:b0:d7:03:20:2a:d0:f9:63:e8:91:0c:05:20:a9:5f: @@ -3921,7 +3546,7 @@ ASN1 OID: secp384r1 NIST CURVE: P-384 X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 9A:AF:29:7A:C0:11:35:35:26:51:30:00:C3:6A:FE:40:D5:AE:D6:3C X509v3 Basic Constraints: critical CA:TRUE @@ -4005,7 +3630,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 9F:38:C4:56:23:C3:39:E8:A0:71:6C:E8:54:4C:E4:E8:3A:B1:BF:67 Signature Algorithm: sha256WithRSAEncryption 12:e5:42:a6:7b:8b:0f:0c:e4:46:a5:b6:60:40:87:8c:25:7e: @@ -4126,7 +3751,7 @@ aa:82:79 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: E2:C9:40:9F:4D:CE:E8:9A:A1:7C:CF:0E:3F:65:C5:29:88:6A:19:51 X509v3 Basic Constraints: critical CA:TRUE @@ -4225,7 +3850,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 3D:E6:29:48:9B:EA:07:CA:21:44:4A:26:DE:6E:DE:D2:83:D0:9F:59 Signature Algorithm: ecdsa-with-SHA384 30:65:02:31:00:e5:69:12:c9:6e:db:c6:31:ba:09:41:e1:97: @@ -4306,9 +3931,9 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: AE:6C:05:A3:93:13:E2:A2:E7:E2:D7:1C:D6:C7:F0:7F:C8:67:53:A0 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:AE:6C:05:A3:93:13:E2:A2:E7:E2:D7:1C:D6:C7:F0:7F:C8:67:53:A0 Signature Algorithm: sha384WithRSAEncryption @@ -4414,7 +4039,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 8F:F0:4B:7F:A8:2E:45:24:AE:4D:50:FA:63:9A:8B:DE:E2:DD:1B:BC Signature Algorithm: sha256WithRSAEncryption 4b:40:db:c0:50:aa:fe:c8:0c:ef:f7:96:54:45:49:bb:96:00: @@ -4454,171 +4079,6 @@ WD9f -----END CERTIFICATE----- -# ebd41040e4bb3ec742c9e381d31ef2a41a48b6685c96e7cef3c1df6cd4331c99 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - 04:00:00:00:00:01:15:4b:5a:c3:94 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA - Validity - Not Before: Sep 1 12:00:00 1998 GMT - Not After : Jan 28 12:00:00 2028 GMT - Subject: C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:da:0e:e6:99:8d:ce:a3:e3:4f:8a:7e:fb:f1:8b: - 83:25:6b:ea:48:1f:f1:2a:b0:b9:95:11:04:bd:f0: - 63:d1:e2:67:66:cf:1c:dd:cf:1b:48:2b:ee:8d:89: - 8e:9a:af:29:80:65:ab:e9:c7:2d:12:cb:ab:1c:4c: - 70:07:a1:3d:0a:30:cd:15:8d:4f:f8:dd:d4:8c:50: - 15:1c:ef:50:ee:c4:2e:f7:fc:e9:52:f2:91:7d:e0: - 6d:d5:35:30:8e:5e:43:73:f2:41:e9:d5:6a:e3:b2: - 89:3a:56:39:38:6f:06:3c:88:69:5b:2a:4d:c5:a7: - 54:b8:6c:89:cc:9b:f9:3c:ca:e5:fd:89:f5:12:3c: - 92:78:96:d6:dc:74:6e:93:44:61:d1:8d:c7:46:b2: - 75:0e:86:e8:19:8a:d5:6d:6c:d5:78:16:95:a2:e9: - c8:0a:38:eb:f2:24:13:4f:73:54:93:13:85:3a:1b: - bc:1e:34:b5:8b:05:8c:b9:77:8b:b1:db:1f:20:91: - ab:09:53:6e:90:ce:7b:37:74:b9:70:47:91:22:51: - 63:16:79:ae:b1:ae:41:26:08:c8:19:2b:d1:46:aa: - 48:d6:64:2a:d7:83:34:ff:2c:2a:c1:6c:19:43:4a: - 07:85:e7:d3:7c:f6:21:68:ef:ea:f2:52:9f:7f:93: - 90:cf - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - 60:7B:66:1A:45:0D:97:CA:89:50:2F:7D:04:CD:34:A8:FF:FC:FD:4B - Signature Algorithm: sha1WithRSAEncryption - d6:73:e7:7c:4f:76:d0:8d:bf:ec:ba:a2:be:34:c5:28:32:b5: - 7c:fc:6c:9c:2c:2b:bd:09:9e:53:bf:6b:5e:aa:11:48:b6:e5: - 08:a3:b3:ca:3d:61:4d:d3:46:09:b3:3e:c3:a0:e3:63:55:1b: - f2:ba:ef:ad:39:e1:43:b9:38:a3:e6:2f:8a:26:3b:ef:a0:50: - 56:f9:c6:0a:fd:38:cd:c4:0b:70:51:94:97:98:04:df:c3:5f: - 94:d5:15:c9:14:41:9c:c4:5d:75:64:15:0d:ff:55:30:ec:86: - 8f:ff:0d:ef:2c:b9:63:46:f6:aa:fc:df:bc:69:fd:2e:12:48: - 64:9a:e0:95:f0:a6:ef:29:8f:01:b1:15:b5:0c:1d:a5:fe:69: - 2c:69:24:78:1e:b3:a7:1c:71:62:ee:ca:c8:97:ac:17:5d:8a: - c2:f8:47:86:6e:2a:c4:56:31:95:d0:67:89:85:2b:f9:6c:a6: - 5d:46:9d:0c:aa:82:e4:99:51:dd:70:b7:db:56:3d:61:e4:6a: - e1:5c:d6:f6:fe:3d:de:41:cc:07:ae:63:52:bf:53:53:f4:2b: - e9:c7:fd:b6:f7:82:5f:85:d2:41:18:db:81:b3:04:1c:c5:1f: - a4:80:6f:15:20:c9:de:0c:88:0a:1d:d6:66:55:e2:fc:48:c9: - 29:26:69:e0 ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG -A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv -b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw -MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i -YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT -aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ -jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp -xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp -1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG -snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ -U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 -9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E -BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B -AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz -yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE -38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP -AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad -DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME -HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- - -# 1465fa205397b876faa6f0a9958e5590e40fcc7faa4fb7c2c8677521fb5fb658 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = US, O = "Starfield Technologies, Inc.", OU = Starfield Class 2 Certification Authority - Validity - Not Before: Jun 29 17:39:16 2004 GMT - Not After : Jun 29 17:39:16 2034 GMT - Subject: C = US, O = "Starfield Technologies, Inc.", OU = Starfield Class 2 Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:b7:32:c8:fe:e9:71:a6:04:85:ad:0c:11:64:df: - ce:4d:ef:c8:03:18:87:3f:a1:ab:fb:3c:a6:9f:f0: - c3:a1:da:d4:d8:6e:2b:53:90:fb:24:a4:3e:84:f0: - 9e:e8:5f:ec:e5:27:44:f5:28:a6:3f:7b:de:e0:2a: - f0:c8:af:53:2f:9e:ca:05:01:93:1e:8f:66:1c:39: - a7:4d:fa:5a:b6:73:04:25:66:eb:77:7f:e7:59:c6: - 4a:99:25:14:54:eb:26:c7:f3:7f:19:d5:30:70:8f: - af:b0:46:2a:ff:ad:eb:29:ed:d7:9f:aa:04:87:a3: - d4:f9:89:a5:34:5f:db:43:91:82:36:d9:66:3c:b1: - b8:b9:82:fd:9c:3a:3e:10:c8:3b:ef:06:65:66:7a: - 9b:19:18:3d:ff:71:51:3c:30:2e:5f:be:3d:77:73: - b2:5d:06:6c:c3:23:56:9a:2b:85:26:92:1c:a7:02: - b3:e4:3f:0d:af:08:79:82:b8:36:3d:ea:9c:d3:35: - b3:bc:69:ca:f5:cc:9d:e8:fd:64:8d:17:80:33:6e: - 5e:4a:5d:99:c9:1e:87:b4:9d:1a:c0:d5:6e:13:35: - 23:5e:df:9b:5f:3d:ef:d6:f7:76:c2:ea:3e:bb:78: - 0d:1c:42:67:6b:04:d8:f8:d6:da:6f:8b:f2:44:a0: - 01:ab - Exponent: 3 (0x3) - X509v3 extensions: - X509v3 Subject Key Identifier: - BF:5F:B7:D1:CE:DD:1F:86:F4:5B:55:AC:DC:D7:10:C2:0E:A9:88:E7 - X509v3 Authority Key Identifier: - keyid:BF:5F:B7:D1:CE:DD:1F:86:F4:5B:55:AC:DC:D7:10:C2:0E:A9:88:E7 - DirName:/C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 Certification Authority - serial:00 - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: sha1WithRSAEncryption - 05:9d:3f:88:9d:d1:c9:1a:55:a1:ac:69:f3:f3:59:da:9b:01: - 87:1a:4f:57:a9:a1:79:09:2a:db:f7:2f:b2:1e:cc:c7:5e:6a: - d8:83:87:a1:97:ef:49:35:3e:77:06:41:58:62:bf:8e:58:b8: - 0a:67:3f:ec:b3:dd:21:66:1f:c9:54:fa:72:cc:3d:4c:40:d8: - 81:af:77:9e:83:7a:bb:a2:c7:f5:34:17:8e:d9:11:40:f4:fc: - 2c:2a:4d:15:7f:a7:62:5d:2e:25:d3:00:0b:20:1a:1d:68:f9: - 17:b8:f4:bd:8b:ed:28:59:dd:4d:16:8b:17:83:c8:b2:65:c7: - 2d:7a:a5:aa:bc:53:86:6d:dd:57:a4:ca:f8:20:41:0b:68:f0: - f4:fb:74:be:56:5d:7a:79:f5:f9:1d:85:e3:2d:95:be:f5:71: - 90:43:cc:8d:1f:9a:00:0a:87:29:e9:55:22:58:00:23:ea:e3: - 12:43:29:5b:47:08:dd:8c:41:6a:65:06:a8:e5:21:aa:41:b4: - 95:21:95:b9:7d:d1:34:ab:13:d6:ad:bc:dc:e2:3d:39:cd:bd: - 3e:75:70:a1:18:59:03:c9:22:b4:8f:9c:d5:5e:2a:d7:a5:b6: - d4:0a:6d:f8:b7:40:11:46:9a:1f:79:0e:62:bf:0f:97:ec:e0: - 2f:1f:17:94 ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl -MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp -U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw -NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE -ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp -ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 -DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf -8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN -+lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 -X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa -K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA -1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G -A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR -zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 -YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD -bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w -DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 -L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D -eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp -VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY -WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- - # 2ce1cb0bf9d2f9e102993fbe215152c3b2dd0cabde1c68e5319b839154dbb7f5 Certificate: Data: @@ -4658,7 +4118,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 7C:0C:32:1F:A7:D9:30:7F:C4:7D:68:A3:62:A8:A1:CE:AB:07:5B:27 Signature Algorithm: sha256WithRSAEncryption 11:59:fa:25:4f:03:6f:94:99:3b:9a:1f:82:85:39:d4:76:05: @@ -4739,7 +4199,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 3A:9A:85:07:10:67:28:B6:EF:F6:BD:05:41:6E:20:C1:94:DA:0F:DE Signature Algorithm: sha256WithRSAEncryption 99:db:5d:79:d5:f9:97:59:67:03:61:f1:7e:3b:06:31:75:2d: @@ -4781,91 +4241,6 @@ 4uJEvlz36hz1 -----END CERTIFICATE----- -# c3846bf24b9e93ca64274c0ec67c1ecc5e024ffcacd2d74019350e81fe546ae4 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = US, O = "The Go Daddy Group, Inc.", OU = Go Daddy Class 2 Certification Authority - Validity - Not Before: Jun 29 17:06:20 2004 GMT - Not After : Jun 29 17:06:20 2034 GMT - Subject: C = US, O = "The Go Daddy Group, Inc.", OU = Go Daddy Class 2 Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:de:9d:d7:ea:57:18:49:a1:5b:eb:d7:5f:48:86: - ea:be:dd:ff:e4:ef:67:1c:f4:65:68:b3:57:71:a0: - 5e:77:bb:ed:9b:49:e9:70:80:3d:56:18:63:08:6f: - da:f2:cc:d0:3f:7f:02:54:22:54:10:d8:b2:81:d4: - c0:75:3d:4b:7f:c7:77:c3:3e:78:ab:1a:03:b5:20: - 6b:2f:6a:2b:b1:c5:88:7e:c4:bb:1e:b0:c1:d8:45: - 27:6f:aa:37:58:f7:87:26:d7:d8:2d:f6:a9:17:b7: - 1f:72:36:4e:a6:17:3f:65:98:92:db:2a:6e:5d:a2: - fe:88:e0:0b:de:7f:e5:8d:15:e1:eb:cb:3a:d5:e2: - 12:a2:13:2d:d8:8e:af:5f:12:3d:a0:08:05:08:b6: - 5c:a5:65:38:04:45:99:1e:a3:60:60:74:c5:41:a5: - 72:62:1b:62:c5:1f:6f:5f:1a:42:be:02:51:65:a8: - ae:23:18:6a:fc:78:03:a9:4d:7f:80:c3:fa:ab:5a: - fc:a1:40:a4:ca:19:16:fe:b2:c8:ef:5e:73:0d:ee: - 77:bd:9a:f6:79:98:bc:b1:07:67:a2:15:0d:dd:a0: - 58:c6:44:7b:0a:3e:62:28:5f:ba:41:07:53:58:cf: - 11:7e:38:74:c5:f8:ff:b5:69:90:8f:84:74:ea:97: - 1b:af - Exponent: 3 (0x3) - X509v3 extensions: - X509v3 Subject Key Identifier: - D2:C4:B0:D2:91:D4:4C:11:71:B3:61:CB:3D:A1:FE:DD:A8:6A:D4:E3 - X509v3 Authority Key Identifier: - keyid:D2:C4:B0:D2:91:D4:4C:11:71:B3:61:CB:3D:A1:FE:DD:A8:6A:D4:E3 - DirName:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority - serial:00 - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: sha1WithRSAEncryption - 32:4b:f3:b2:ca:3e:91:fc:12:c6:a1:07:8c:8e:77:a0:33:06: - 14:5c:90:1e:18:f7:08:a6:3d:0a:19:f9:87:80:11:6e:69:e4: - 96:17:30:ff:34:91:63:72:38:ee:cc:1c:01:a3:1d:94:28:a4: - 31:f6:7a:c4:54:d7:f6:e5:31:58:03:a2:cc:ce:62:db:94:45: - 73:b5:bf:45:c9:24:b5:d5:82:02:ad:23:79:69:8d:b8:b6:4d: - ce:cf:4c:ca:33:23:e8:1c:88:aa:9d:8b:41:6e:16:c9:20:e5: - 89:9e:cd:3b:da:70:f7:7e:99:26:20:14:54:25:ab:6e:73:85: - e6:9b:21:9d:0a:6c:82:0e:a8:f8:c2:0c:fa:10:1e:6c:96:ef: - 87:0d:c4:0f:61:8b:ad:ee:83:2b:95:f8:8e:92:84:72:39:eb: - 20:ea:83:ed:83:cd:97:6e:08:bc:eb:4e:26:b6:73:2b:e4:d3: - f6:4c:fe:26:71:e2:61:11:74:4a:ff:57:1a:87:0f:75:48:2e: - cf:51:69:17:a0:02:12:61:95:d5:d1:40:b2:10:4c:ee:c4:ac: - 10:43:a6:a5:9e:0a:d5:95:62:9a:0d:cf:88:82:c5:32:0c:e4: - 2b:9f:45:e6:0d:9f:28:9c:b1:b9:2a:5a:57:ad:37:0f:af:1d: - 7f:db:bd:9f ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh -MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE -YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 -MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo -ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg -MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN -ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA -PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w -wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi -EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY -avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ -YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE -sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h -/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 -IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD -ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy -OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P -TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER -dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf -ReYNnyicsbkqWletNw+vHX/bvZ8= ------END CERTIFICATE----- - # 34d8a73ee208d9bcdb0d956520934b4e40e69482596e8b6f73c8426b010a6f48 Certificate: Data: @@ -4896,7 +4271,7 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: C1:F1:26:BA:A0:2D:AE:85:81:CF:D3:F1:2A:12:BD:B8:0A:67:FD:BC Signature Algorithm: ecdsa-with-SHA384 30:66:02:31:00:f6:e1:20:95:14:7b:54:a3:90:16:11:bf:84: @@ -4976,7 +4351,7 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: E4:AF:2B:26:71:1A:2B:48:27:85:2F:52:66:2C:EF:F0:89:13:71:3E Signature Algorithm: sha384WithRSAEncryption 9f:aa:42:26:db:0b:9b:be:ff:1e:96:92:2e:3e:a2:65:4a:6a: @@ -5070,7 +4445,7 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 80:4C:D6:EB:74:FF:49:36:A3:D5:D8:FC:B5:3E:C5:6A:F0:94:1D:8C Signature Algorithm: ecdsa-with-SHA384 30:66:02:31:00:e8:40:ff:83:de:03:f4:9f:ae:1d:7a:a7:2e: @@ -5121,7 +4496,7 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 54:B0:7B:AD:45:B8:E2:40:7F:FB:0A:6E:FB:BE:33:C9:3C:A3:84:D5 Signature Algorithm: ecdsa-with-SHA256 Signature Value: @@ -5199,7 +4574,7 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: BB:FF:CA:8E:23:9F:4F:99:CA:DB:E2:68:A6:A5:15:27:17:1E:D9:0E Signature Algorithm: sha384WithRSAEncryption 1f:ca:ce:dd:c7:be:a1:9f:d9:27:4c:0b:dc:17:98:11:6a:88: @@ -5320,10 +4695,10 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:17:9D:CD:1E:8B:D6:39:2B:70:D3:5C:D4:A0:B8:1F:B0:00:FC:C5:61 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 17:9D:CD:1E:8B:D6:39:2B:70:D3:5C:D4:A0:B8:1F:B0:00:FC:C5:61 Signature Algorithm: sha256WithRSAEncryption 56:d5:7b:6e:e6:22:01:d2:42:9b:18:d5:0e:d7:66:23:5c:e3: @@ -5442,31 +4817,31 @@ 0a:c0:65 Exponent: 65537 (0x10001) X509v3 extensions: - Authority Information Access: + Authority Information Access: CA Issuers - URI:http://www.accv.es/fileadmin/Archivos/certificados/raizaccv1.crt OCSP - URI:http://ocsp.accv.es - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: D2:87:B4:E3:DF:37:27:93:55:F6:56:EA:81:E5:36:CC:8C:1E:3F:BD X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:D2:87:B4:E3:DF:37:27:93:55:F6:56:EA:81:E5:36:CC:8C:1E:3F:BD - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: X509v3 Any Policy User Notice: - Explicit Text: + Explicit Text: CPS: http://www.accv.es/legislacion_c.htm - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: Full Name: URI:http://www.accv.es/fileadmin/Archivos/certificados/raizaccv1_der.crl X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Alternative Name: + X509v3 Subject Alternative Name: email:accv@accv.es Signature Algorithm: sha1WithRSAEncryption 97:31:02:9f:e7:fd:43:67:48:44:14:e4:29:87:ed:4c:28:66: @@ -5600,9 +4975,9 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: F7:7D:C5:FD:C4:E8:9A:1B:77:64:A7:F5:1D:A0:CC:BF:87:60:9A:6D - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: X509v3 Any Policy CPS: http://www.cert.fnmt.es/dpcs/ @@ -5704,7 +5079,7 @@ 4f:17 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 65:3F:C7:8A:86:C6:3C:DD:3C:54:5C:35:F8:3A:ED:52:0C:47:57:C8 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -5753,307 +5128,6 @@ lo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= -----END CERTIFICATE----- -# 44b545aa8a25e65a73ca15dc27fc36d24c1cb9953a066539b11582dc487b4833 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: ecdsa-with-SHA256 - Issuer: C = GR, L = Athens, O = Hellenic Academic and Research Institutions Cert. Authority, CN = Hellenic Academic and Research Institutions ECC RootCA 2015 - Validity - Not Before: Jul 7 10:37:12 2015 GMT - Not After : Jun 30 10:37:12 2040 GMT - Subject: C = GR, L = Athens, O = Hellenic Academic and Research Institutions Cert. Authority, CN = Hellenic Academic and Research Institutions ECC RootCA 2015 - Subject Public Key Info: - Public Key Algorithm: id-ecPublicKey - Public-Key: (384 bit) - pub: - 04:92:a0:41:e8:4b:82:84:5c:e2:f8:31:11:99:86: - 64:4e:09:25:2f:9d:41:2f:0a:ae:35:4f:74:95:b2: - 51:64:6b:8d:6b:e6:3f:70:95:f0:05:44:47:a6:72: - 38:50:76:95:02:5a:8e:ae:28:9e:f9:2d:4e:99:ef: - 2c:48:6f:4c:25:29:e8:d1:71:5b:df:1d:c1:75:37: - b4:d7:fa:7b:7a:42:9c:6a:0a:56:5a:7c:69:0b:aa: - 80:09:24:6c:7e:c1:46 - ASN1 OID: secp384r1 - NIST CURVE: P-384 - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - B4:22:0B:82:99:24:01:0E:9C:BB:E4:0E:FD:BF:FB:97:20:93:99:2A - Signature Algorithm: ecdsa-with-SHA256 - 30:64:02:30:67:ce:16:62:38:a2:ac:62:45:a7:a9:95:24:c0: - 1a:27:9c:32:3b:c0:c0:d5:ba:a9:e7:f8:04:43:53:85:ee:52: - 21:de:9d:f5:25:83:3e:9e:58:4b:2f:d7:67:13:0e:21:02:30: - 05:e1:75:01:de:68:ed:2a:1f:4d:4c:09:08:0d:ec:4b:ad:64: - 17:28:e7:75:ce:45:65:72:21:17:cb:22:41:0e:8c:13:98:38: - 9a:54:6d:9b:ca:e2:7c:ea:02:58:22:91 ------BEGIN CERTIFICATE----- -MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzAN -BgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl -c2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hl -bGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgRUNDIFJv -b3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEwMzcxMlowgaoxCzAJ -BgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmljIEFj -YWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5 -MUQwQgYDVQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0 -dXRpb25zIEVDQyBSb290Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKg -QehLgoRc4vgxEZmGZE4JJS+dQS8KrjVPdJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJa -jq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoKVlp8aQuqgAkkbH7BRqNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLQi -C4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaep -lSTAGiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7Sof -TUwJCA3sS61kFyjndc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR ------END CERTIFICATE----- - -# a040929a02ce53b4acf4f2ffc6981ce4496f755e6d45fe0b2a692bcd52523f36 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C = GR, L = Athens, O = Hellenic Academic and Research Institutions Cert. Authority, CN = Hellenic Academic and Research Institutions RootCA 2015 - Validity - Not Before: Jul 7 10:11:21 2015 GMT - Not After : Jun 30 10:11:21 2040 GMT - Subject: C = GR, L = Athens, O = Hellenic Academic and Research Institutions Cert. Authority, CN = Hellenic Academic and Research Institutions RootCA 2015 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (4096 bit) - Modulus: - 00:c2:f8:a9:3f:1b:89:fc:3c:3c:04:5d:3d:90:36: - b0:91:3a:79:3c:66:5a:ef:6d:39:01:49:1a:b4:b7: - cf:7f:4d:23:53:b7:90:00:e3:13:2a:28:a6:31:f1: - 91:00:e3:28:ec:ae:21:41:ce:1f:da:fd:7d:12:5b: - 01:83:0f:b9:b0:5f:99:e1:f2:12:83:80:4d:06:3e: - df:ac:af:e7:a1:88:6b:31:af:f0:8b:d0:18:33:b8: - db:45:6a:34:f4:02:80:24:28:0a:02:15:95:5e:76: - 2a:0d:99:3a:14:5b:f6:cb:cb:53:bc:13:4d:01:88: - 37:94:25:1b:42:bc:22:d8:8e:a3:96:5e:3a:d9:32: - db:3e:e8:f0:10:65:ed:74:e1:2f:a7:7c:af:27:34: - bb:29:7d:9b:b6:cf:09:c8:e5:d3:0a:fc:88:65:65: - 74:0a:dc:73:1c:5c:cd:40:b1:1c:d4:b6:84:8c:4c: - 50:cf:68:8e:a8:59:ae:c2:27:4e:82:a2:35:dd:14: - f4:1f:ff:b2:77:d5:87:2f:aa:6e:7d:24:27:e7:c6: - cb:26:e6:e5:fe:67:07:63:d8:45:0d:dd:3a:59:65: - 39:58:7a:92:99:72:3d:9c:84:5e:88:21:b8:d5:f4: - 2c:fc:d9:70:52:4f:78:b8:bd:3c:2b:8b:95:98:f5: - b3:d1:68:cf:20:14:7e:4c:5c:5f:e7:8b:e5:f5:35: - 81:19:37:d7:11:08:b7:66:be:d3:4a:ce:83:57:00: - 3a:c3:81:f8:17:cb:92:36:5d:d1:a3:d8:75:1b:e1: - 8b:27:ea:7a:48:41:fd:45:19:06:ad:27:99:4e:c1: - 70:47:dd:b5:9f:81:53:12:e5:b1:8c:48:5d:31:43: - 17:e3:8c:c6:7a:63:96:4b:29:30:4e:84:4e:62:19: - 5e:3c:ce:97:90:a5:7f:01:eb:9d:e0:f8:8b:89:dd: - 25:98:3d:92:b6:7e:ef:d9:f1:51:51:7d:2d:26:c8: - 69:59:61:e0:ac:6a:b8:2a:36:11:04:7a:50:bd:32: - 84:be:2f:dc:72:d5:d7:1d:16:47:e4:47:66:20:3f: - f4:96:c5:af:8e:01:7a:a5:0f:7a:64:f5:0d:18:87: - d9:ae:88:d5:fa:84:c1:3a:c0:69:28:2d:f2:0d:68: - 51:aa:e3:a5:77:c6:a4:90:0e:a1:37:8b:31:23:47: - c1:09:08:eb:6e:f7:78:9b:d7:82:fc:84:20:99:49: - 19:b6:12:46:b1:fb:45:55:16:a9:a3:65:ac:9c:07: - 0f:ea:6b:dc:1f:2e:06:72:ec:86:88:12:e4:2d:db: - 5f:05:2f:e4:f0:03:d3:26:33:e7:80:c2:cd:42:a1: - 17:34:0b - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - 71:15:67:C8:C8:C9:BD:75:5D:72:D0:38:18:6A:9D:F3:71:24:54:0B - Signature Algorithm: sha256WithRSAEncryption - 75:bb:6d:54:4b:aa:10:58:46:34:f2:62:d7:16:36:5d:08:5e: - d5:6c:c8:87:bd:b4:2e:46:f2:31:f8:7c:ea:42:b5:93:16:55: - dc:a1:0c:12:a0:da:61:7e:0f:58:58:73:64:72:c7:e8:45:8e: - dc:a9:f2:26:3f:c6:79:8c:b1:53:08:33:81:b0:56:13:be:e6: - 51:5c:d8:9b:0a:4f:4b:9c:56:53:02:e9:4f:f6:0d:60:ea:4d: - 42:55:e8:7c:1b:21:21:d3:1b:3a:cc:77:f2:b8:90:f1:68:c7: - f9:5a:fe:fa:2d:f4:bf:c9:f5:45:1b:ce:38:10:2a:37:8a:79: - a3:b4:e3:09:6c:85:86:93:ff:89:96:27:78:81:8f:67:e3:46: - 74:54:8e:d9:0d:69:e2:4a:f4:4d:74:03:ff:b2:77:ed:95:67: - 97:e4:b1:c5:ab:bf:6a:23:e8:d4:94:e2:44:28:62:c4:4b:e2: - f0:d8:e2:29:6b:1a:70:7e:24:61:93:7b:4f:03:32:25:0d:45: - 24:2b:96:b4:46:6a:bf:4a:0b:f7:9a:8f:c1:ac:1a:c5:67:f3: - 6f:34:d2:fa:73:63:8c:ef:16:b0:a8:a4:46:2a:f8:eb:12:ec: - 72:b4:ef:f8:2b:7e:8c:52:c0:8b:84:54:f9:2f:3e:e3:55:a8: - dc:66:b1:d9:e1:5f:d8:b3:8c:59:34:59:a4:ab:4f:6c:bb:1f: - 18:db:75:ab:d8:cb:92:cd:94:38:61:0e:07:06:1f:4b:46:10: - f1:15:be:8d:85:5c:3b:4a:2b:81:79:0f:b4:69:9f:49:50:97: - 4d:f7:0e:56:5d:c0:95:6a:c2:36:c3:1b:68:c9:f5:2a:dc:47: - 9a:be:b2:ce:c5:25:e8:fa:03:b9:da:f9:16:6e:91:84:f5:1c: - 28:c8:fc:26:cc:d7:1c:90:56:a7:5f:6f:3a:04:bc:cd:78:89: - 0b:8e:0f:2f:a3:aa:4f:a2:1b:12:3d:16:08:40:0f:f1:46:4c: - d7:aa:7b:08:c1:0a:f5:6d:27:de:02:8f:ca:c3:b5:2b:ca:e9: - eb:c8:21:53:38:a5:cc:3b:d8:77:37:30:a2:4f:d9:6f:d1:f2: - 40:ad:41:7a:17:c5:d6:4a:35:89:b7:41:d5:7c:86:7f:55:4d: - 83:4a:a5:73:20:c0:3a:af:90:f1:9a:24:8e:d9:8e:71:ca:7b: - b8:86:da:b2:8f:99:3e:1d:13:0d:12:11:ee:d4:ab:f0:e9:15: - 76:02:e4:e0:df:aa:20:1e:5b:61:85:64:40:a9:90:97:0d:ad: - 53:d2:5a:1d:87:6a:00:97:65:62:b4:be:6f:6a:a7:f5:2c:42: - ed:32:ad:b6:21:9e:be:bc ------BEGIN CERTIFICATE----- -MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1Ix -DzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5k -IFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMT -N0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9v -dENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAxMTIxWjCBpjELMAkG -A1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNh -ZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkx -QDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 -dGlvbnMgUm9vdENBIDIwMTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQDC+Kk/G4n8PDwEXT2QNrCROnk8ZlrvbTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA -4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+ehiGsxr/CL0BgzuNtFajT0 -AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+6PAQZe10 -4S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06C -ojXdFPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV -9Cz82XBST3i4vTwri5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrD -gfgXy5I2XdGj2HUb4Ysn6npIQf1FGQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjMZ6 -Y5ZLKTBOhE5iGV48zpeQpX8B653g+IuJ3SWYPZK2fu/Z8VFRfS0myGlZYeCsargq -NhEEelC9MoS+L9xy1dcdFkfkR2YgP/SWxa+OAXqlD3pk9Q0Yh9muiNX6hME6wGko -LfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc -Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNV -HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVd -ctA4GGqd83EkVAswDQYJKoZIhvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0I -XtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+D1hYc2Ryx+hFjtyp8iY/xnmMsVMI -M4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrMd/K4kPFox/la/vot -9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+yd+2V -Z5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/ea -j8GsGsVn82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnh -X9izjFk0WaSrT2y7HxjbdavYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQ -l033DlZdwJVqwjbDG2jJ9SrcR5q+ss7FJej6A7na+RZukYT1HCjI/CbM1xyQVqdf -bzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVtJ94Cj8rDtSvK6evIIVM4 -pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGaJI7ZjnHK -e7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0 -vm9qp/UsQu0yrbYhnr68 ------END CERTIFICATE----- - -# 30d0895a9a448a262091635522d1f52010b5867acae12c78ef958fd4f4389f2f -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - 0a:01:42:80:00:00:01:45:23:cf:46:7c:00:00:00:02 - Signature Algorithm: sha256WithRSAEncryption - Issuer: C = US, O = IdenTrust, CN = IdenTrust Public Sector Root CA 1 - Validity - Not Before: Jan 16 17:53:32 2014 GMT - Not After : Jan 16 17:53:32 2034 GMT - Subject: C = US, O = IdenTrust, CN = IdenTrust Public Sector Root CA 1 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (4096 bit) - Modulus: - 00:b6:22:94:fc:a4:48:af:e8:47:6b:0a:fb:27:76: - e4:f2:3f:8a:3b:7a:4a:2c:31:2a:8c:8d:b0:a9:c3: - 31:6b:a8:77:76:84:26:b6:ac:81:42:0d:08:eb:55: - 58:bb:7a:f8:bc:65:7d:f2:a0:6d:8b:a8:47:e9:62: - 76:1e:11:ee:08:14:d1:b2:44:16:f4:ea:d0:fa:1e: - 2f:5e:db:cb:73:41:ae:bc:00:b0:4a:2b:40:b2:ac: - e1:3b:4b:c2:2d:9d:e4:a1:9b:ec:1a:3a:1e:f0:08: - b3:d0:e4:24:35:07:9f:9c:b4:c9:52:6d:db:07:ca: - 8f:b5:5b:f0:83:f3:4f:c7:2d:a5:c8:ad:cb:95:20: - a4:31:28:57:58:5a:e4:8d:1b:9a:ab:9e:0d:0c:f2: - 0a:33:39:22:39:0a:97:2e:f3:53:77:b9:44:45:fd: - 84:cb:36:20:81:59:2d:9a:6f:6d:48:48:61:ca:4c: - df:53:d1:af:52:bc:44:9f:ab:2f:6b:83:72:ef:75: - 80:da:06:33:1b:5d:c8:da:63:c6:4d:cd:ac:66:31: - cd:d1:de:3e:87:10:36:e1:b9:a4:7a:ef:60:50:b2: - cb:ca:a6:56:e0:37:af:ab:34:13:39:25:e8:39:66: - e4:98:7a:aa:12:98:9c:59:66:86:3e:ad:f1:b0:ca: - 3e:06:0f:7b:f0:11:4b:37:a0:44:6d:7b:cb:a8:8c: - 71:f4:d5:b5:91:36:cc:f0:15:c6:2b:de:51:17:b1: - 97:4c:50:3d:b1:95:59:7c:05:7d:2d:21:d5:00:bf: - 01:67:a2:5e:7b:a6:5c:f2:f7:22:f1:90:0d:93:db: - aa:44:51:66:cc:7d:76:03:eb:6a:a8:2a:38:19:97: - 76:0d:6b:8a:61:f9:bc:f6:ee:76:fd:70:2b:dd:29: - 3c:f8:0a:1e:5b:42:1c:8b:56:2f:55:1b:1c:a1:2e: - b5:c7:16:e6:f8:aa:3c:92:8e:69:b6:01:c1:b5:86: - 9d:89:0f:0b:38:94:54:e8:ea:dc:9e:3d:25:bc:53: - 26:ed:d5:ab:39:aa:c5:40:4c:54:ab:b2:b4:d9:d9: - f8:d7:72:db:1c:bc:6d:bd:65:5f:ef:88:35:2a:66: - 2f:ee:f6:b3:65:f0:33:8d:7c:98:41:69:46:0f:43: - 1c:69:fa:9b:b5:d0:61:6a:cd:ca:4b:d9:4c:90:46: - ab:15:59:a1:47:54:29:2e:83:28:5f:1c:c2:a2:ab: - 72:17:00:06:8e:45:ec:8b:e2:33:3d:7f:da:19:44: - e4:62:72:c3:df:22:c6:f2:56:d4:dd:5f:95:72:ed: - 6d:5f:f7:48:03:5b:fd:c5:2a:a0:f6:73:23:84:10: - 1b:01:e7 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - E3:71:E0:9E:D8:A7:42:D9:DB:71:91:6B:94:93:EB:C3:A3:D1:14:A3 - Signature Algorithm: sha256WithRSAEncryption - 47:fa:dd:0a:b0:11:91:38:ad:4d:5d:f7:e5:0e:97:54:19:82: - 48:87:54:8c:aa:64:99:d8:5a:fe:88:01:c5:58:a5:99:b1:23: - 54:23:b7:6a:1d:20:57:e5:01:62:41:17:d3:09:db:75:cb:6e: - 54:90:75:fe:1a:9f:81:0a:c2:dd:d7:f7:09:d0:5b:72:15:e4: - 1e:09:6a:3d:33:f3:21:9a:e6:15:7e:ad:51:d5:0d:10:ed:7d: - 42:c0:8f:ee:c0:9a:08:d5:41:d6:5c:0e:21:69:6e:80:61:0e: - 15:c0:b8:cf:c5:49:12:52:cc:be:3a:cc:d4:2e:38:05:de:35: - fd:1f:6f:b8:80:68:98:3d:4d:a0:ca:40:65:d2:73:7c:f5:8b: - d9:0a:95:3f:d8:3f:23:6d:1a:d1:2a:24:19:d9:85:b3:17:ef: - 78:6e:a9:58:d1:23:d3:c7:13:ed:72:25:7f:5d:b1:73:70:d0: - 7f:06:97:09:84:29:80:61:1d:fa:5e:ff:73:ac:a0:e3:89:b8: - 1c:71:15:c6:de:31:7f:12:dc:e1:6d:9b:af:e7:e8:9f:75:78: - 4c:ab:46:3b:9a:ce:bf:05:18:5d:4d:15:3c:16:9a:19:50:04: - 9a:b2:9a:6f:65:8b:52:5f:3c:58:04:28:25:c0:66:61:31:7e: - b9:e0:75:b9:1a:a8:81:d6:72:17:b3:c5:03:31:35:11:78:78: - a2:e0:e9:30:8c:7f:80:df:58:df:3c:ba:27:96:e2:80:34:6d: - e3:98:d3:64:27:ac:48:7e:28:77:5c:c6:25:61:25:f8:85:0c: - 65:fa:c4:32:2f:a5:98:05:e4:f8:0b:67:16:16:c6:82:b8:32: - 19:f9:f9:b9:79:dc:1f:cd:eb:af:ab:0e:dd:1b:db:45:e4:7a: - e7:02:e2:95:5d:fc:69:f0:53:69:61:95:75:79:0b:5e:55:e6: - 38:1c:94:a9:59:33:9e:c8:71:74:79:7f:51:89:b6:c8:6a:b8: - 30:c8:6a:38:c3:6e:9e:e1:37:16:ea:05:62:4c:5b:12:47:ed: - a7:b4:b3:58:56:c7:49:f3:7f:12:68:09:31:71:f0:6d:f8:4e: - 47:fb:d6:85:ee:c5:58:40:19:a4:1d:a7:f9:4b:43:37:dc:68: - 5a:4f:cf:eb:c2:64:74:de:b4:15:d9:f4:54:54:1a:2f:1c:d7: - 97:71:54:90:8e:d9:20:9d:53:2b:7f:ab:8f:e2:ea:30:bc:50: - 37:ef:f1:47:b5:7d:7c:2c:04:ec:68:9d:b4:49:44:10:f4:72: - 4b:1c:64:e7:fc:e6:6b:90:dd:69:7d:69:fd:00:56:a5:b7:ac: - b6:ad:b7:ca:3e:01:ef:9c ------BEGIN CERTIFICATE----- -MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBN -MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVu -VHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcN -MzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0 -MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTyP4o7 -ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGy -RBb06tD6Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlS -bdsHyo+1W/CD80/HLaXIrcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF -/YTLNiCBWS2ab21ISGHKTN9T0a9SvESfqy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R -3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoSmJxZZoY+rfGwyj4GD3vw -EUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFnol57plzy -9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9V -GxyhLrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ -2fjXctscvG29ZV/viDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsV -WaFHVCkugyhfHMKiq3IXAAaOReyL4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gD -W/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMwDQYJKoZIhvcN -AQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj -t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHV -DRDtfULAj+7AmgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9 -TaDKQGXSc3z1i9kKlT/YPyNtGtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8G -lwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFtm6/n6J91eEyrRjuazr8FGF1NFTwW -mhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMxNRF4eKLg6TCMf4Df -WN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4Mhn5 -+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJ -tshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA -GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv -8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c ------END CERTIFICATE----- - # 5d56499be4d2e08bcfcad08a3e38723d50503bde706948e42f55603019e528ae Certificate: Data: @@ -6111,7 +5185,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: ED:44:19:C0:D3:F0:06:8B:EE:A4:7B:BE:42:E7:26:54:C8:8E:36:76 Signature Algorithm: sha256WithRSAEncryption 0d:ae:90:32:f6:a6:4b:7c:44:76:19:61:1e:27:28:cd:5e:54: @@ -6232,7 +5306,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 79:B4:59:E6:7B:B6:E5:E4:01:73:80:08:88:C8:1A:58:F6:E9:9B:6E Signature Algorithm: sha256WithRSAEncryption 55:1f:58:a9:bc:b2:a8:50:d0:0c:b1:d8:1a:69:20:27:29:08: @@ -6349,13 +5423,13 @@ 47:a4:17 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Alternative Name: + X509v3 Subject Alternative Name: email:info@izenpe.com, DirName:/O=IZENPE S.A. - CIF A01337260-RMerc.Vitoria-Gasteiz T1055 F62 S8/street=Avda del Mediterraneo Etorbidea 14 - 01010 Vitoria-Gasteiz X509v3 Basic Constraints: critical CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 1D:1C:65:0E:A8:F2:25:7B:B4:91:CF:E4:B1:B1:E6:BD:55:74:6C:05 Signature Algorithm: sha256WithRSAEncryption 78:a6:0c:16:4a:9f:4c:88:3a:c0:cb:0e:a5:16:7d:9f:b9:48: @@ -6462,7 +5536,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 2E:16:A9:4A:18:B5:CB:CC:F5:6F:50:F3:23:5F:F8:5D:E7:AC:F0:C8 Signature Algorithm: sha256WithRSAEncryption b5:73:f8:03:dc:59:5b:1d:76:e9:a3:2a:7b:90:28:b2:4d:c0: @@ -6542,12 +5616,12 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: CB:0F:C6:DF:42:43:CC:3D:CB:B5:48:23:A1:1A:7A:A6:2A:BB:34:68 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:CB:0F:C6:DF:42:43:CC:3D:CB:B5:48:23:A1:1A:7A:A6:2A:BB:34:68 - X509v3 Subject Alternative Name: + X509v3 Subject Alternative Name: email:info@e-szigno.hu Signature Algorithm: sha256WithRSAEncryption c9:d1:0e:5e:2e:d5:cc:b3:7c:3e:cb:fc:3d:ff:0d:28:95:93: @@ -6618,9 +5692,9 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 87:11:15:08:D1:AA:C1:78:0C:B1:AF:CE:C6:C9:90:EF:BF:30:04:C0 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:87:11:15:08:D1:AA:C1:78:0C:B1:AF:CE:C6:C9:90:EF:BF:30:04:C0 Signature Algorithm: ecdsa-with-SHA256 @@ -6674,9 +5748,9 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: C8:CB:99:72:70:52:0C:F8:E6:BE:B2:04:57:29:2A:CF:42:10:ED:35 - 1.3.6.1.4.1.311.21.1: + 1.3.6.1.4.1.311.21.1: ... Signature Algorithm: ecdsa-with-SHA384 30:65:02:30:58:f2:4d:ea:0c:f9:5f:5e:ee:60:29:cb:3a:f2: @@ -6758,9 +5832,9 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 09:CB:59:7F:86:B2:70:8F:1A:C3:39:E3:C0:D9:E9:BF:BB:4D:B2:23 - 1.3.6.1.4.1.311.21.1: + 1.3.6.1.4.1.311.21.1: ... Signature Algorithm: sha384WithRSAEncryption ac:af:3e:5d:c2:11:96:89:8e:a3:e7:92:d6:97:15:b8:13:a2: @@ -6865,7 +5939,7 @@ CA:TRUE, pathlen:4 X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: CC:FA:67:93:F0:B6:B8:D0:A5:C0:1E:F3:53:FD:8C:53:DF:83:D7:96 Signature Algorithm: sha256WithRSAEncryption ab:7f:ee:1c:16:a9:9c:3c:51:00:a0:c0:11:08:05:a7:99:e6: @@ -6944,13 +6018,13 @@ 48:c7 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Key Usage: + X509v3 Key Usage: Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 35:0F:C8:36:63:5E:E2:A3:EC:F9:3B:66:15:CE:51:52:E3:91:9A:3D - 1.3.6.1.4.1.311.21.1: + 1.3.6.1.4.1.311.21.1: ... Signature Algorithm: sha256WithRSAEncryption 40:4c:fb:87:b2:99:81:90:7e:9d:c5:b0:b0:26:cd:88:7b:2b: @@ -7021,9 +6095,9 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 48:87:14:AC:E3:C3:9E:90:60:3A:D7:CA:89:EE:D3:AD:8C:B4:50:66 - 1.3.6.1.4.1.311.21.1: + 1.3.6.1.4.1.311.21.1: ... Signature Algorithm: ecdsa-with-SHA384 30:65:02:30:26:c7:69:5b:dc:d5:e7:b2:e7:c8:0c:8c:8c:c3: @@ -7048,144 +6122,6 @@ Mgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9 -----END CERTIFICATE----- -# 18f1fc7f205df8adddeb7fe007dd57e3af375a9c4d8d73546bf4f1fed1e18d35 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1478 (0x5c6) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = BM, O = QuoVadis Limited, CN = QuoVadis Root CA 3 - Validity - Not Before: Nov 24 19:11:23 2006 GMT - Not After : Nov 24 19:06:44 2031 GMT - Subject: C = BM, O = QuoVadis Limited, CN = QuoVadis Root CA 3 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (4096 bit) - Modulus: - 00:cc:57:42:16:54:9c:e6:98:d3:d3:4d:ee:fe:ed: - c7:9f:43:39:4a:65:b3:e8:16:88:34:db:0d:59:91: - 74:cf:92:b8:04:40:ad:02:4b:31:ab:bc:8d:91:68: - d8:20:0e:1a:01:e2:1a:7b:4e:17:5d:e2:8a:b7:3f: - 99:1a:cd:eb:61:ab:c2:65:a6:1f:b7:b7:bd:b7:8f: - fc:fd:70:8f:0b:a0:67:be:01:a2:59:cf:71:e6:0f: - 29:76:ff:b1:56:79:45:2b:1f:9e:7a:54:e8:a3:29: - 35:68:a4:01:4f:0f:a4:2e:37:ef:1b:bf:e3:8f:10: - a8:72:ab:58:57:e7:54:86:c8:c9:f3:5b:da:2c:da: - 5d:8e:6e:3c:a3:3e:da:fb:82:e5:dd:f2:5c:b2:05: - 33:6f:8a:36:ce:d0:13:4e:ff:bf:4a:0c:34:4c:a6: - c3:21:bd:50:04:55:eb:b1:bb:9d:fb:45:1e:64:15: - de:55:01:8c:02:76:b5:cb:a1:3f:42:69:bc:2f:bd: - 68:43:16:56:89:2a:37:61:91:fd:a6:ae:4e:c0:cb: - 14:65:94:37:4b:92:06:ef:04:d0:c8:9c:88:db:0b: - 7b:81:af:b1:3d:2a:c4:65:3a:78:b6:ee:dc:80:b1: - d2:d3:99:9c:3a:ee:6b:5a:6b:b3:8d:b7:d5:ce:9c: - c2:be:a5:4b:2f:16:b1:9e:68:3b:06:6f:ae:7d:9f: - f8:de:ec:cc:29:a7:98:a3:25:43:2f:ef:f1:5f:26: - e1:88:4d:f8:5e:6e:d7:d9:14:6e:19:33:69:a7:3b: - 84:89:93:c4:53:55:13:a1:51:78:40:f8:b8:c9:a2: - ee:7b:ba:52:42:83:9e:14:ed:05:52:5a:59:56:a7: - 97:fc:9d:3f:0a:29:d8:dc:4f:91:0e:13:bc:de:95: - a4:df:8b:99:be:ac:9b:33:88:ef:b5:81:af:1b:c6: - 22:53:c8:f6:c7:ee:97:14:b0:c5:7c:78:52:c8:f0: - ce:6e:77:60:84:a6:e9:2a:76:20:ed:58:01:17:30: - 93:e9:1a:8b:e0:73:63:d9:6a:92:94:49:4e:b4:ad: - 4a:85:c4:a3:22:30:fc:09:ed:68:22:73:a6:88:0c: - 55:21:58:c5:e1:3a:9f:2a:dd:ca:e1:90:e0:d9:73: - ab:6c:80:b8:e8:0b:64:93:a0:9c:8c:19:ff:b3:d2: - 0c:ec:91:26:87:8a:b3:a2:e1:70:8f:2c:0a:e5:cd: - 6d:68:51:eb:da:3f:05:7f:8b:32:e6:13:5c:6b:fe: - 5f:40:e2:22:c8:b4:b4:64:4f:d6:ba:7d:48:3e:a8: - 69:0c:d7:bb:86:71:c9:73:b8:3f:3b:9d:25:4b:da: - ff:40:eb - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Certificate Policies: - Policy: 1.3.6.1.4.1.8024.0.3 - User Notice: - Explicit Text: Any use of this Certificate constitutes acceptance of the QuoVadis Root CA 3 Certificate Policy / Certification Practice Statement. - CPS: http://www.quovadisglobal.com/cps - - X509v3 Key Usage: - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - F2:C0:13:E0:82:43:3E:FB:EE:2F:67:32:96:35:5C:DB:B8:CB:02:D0 - X509v3 Authority Key Identifier: - keyid:F2:C0:13:E0:82:43:3E:FB:EE:2F:67:32:96:35:5C:DB:B8:CB:02:D0 - DirName:/C=BM/O=QuoVadis Limited/CN=QuoVadis Root CA 3 - serial:05:C6 - - Signature Algorithm: sha1WithRSAEncryption - 4f:ad:a0:2c:4c:fa:c0:f2:6f:f7:66:55:ab:23:34:ee:e7:29: - da:c3:5b:b6:b0:83:d9:d0:d0:e2:21:fb:f3:60:a7:3b:5d:60: - 53:27:a2:9b:f6:08:22:2a:e7:bf:a0:72:e5:9c:24:6a:31:b1: - 90:7a:27:db:84:11:89:27:a6:77:5a:38:d7:bf:ac:86:fc:ee: - 5d:83:bc:06:c6:d1:77:6b:0f:6d:24:2f:4b:7a:6c:a7:07:96: - ca:e3:84:9f:ad:88:8b:1d:ab:16:8d:5b:66:17:d9:16:f4:8b: - 80:d2:dd:f8:b2:76:c3:fc:38:13:aa:0c:de:42:69:2b:6e:f3: - 3c:eb:80:27:db:f5:a6:44:0d:9f:5a:55:59:0b:d5:0d:52:48: - c5:ae:9f:f2:2f:80:c5:ea:32:50:35:12:97:2e:c1:e1:ff:f1: - 23:88:51:38:9f:f2:66:56:76:e7:0f:51:97:a5:52:0c:4d:49: - 51:95:36:3d:bf:a2:4b:0c:10:1d:86:99:4c:aa:f3:72:11:93: - e4:ea:f6:9b:da:a8:5d:a7:4d:b7:9e:02:ae:73:00:c8:da:23: - 03:e8:f9:ea:19:74:62:00:94:cb:22:20:be:94:a7:59:b5:82: - 6a:be:99:79:7a:a9:f2:4a:24:52:f7:74:fd:ba:4e:e6:a8:1d: - 02:6e:b1:0d:80:44:c1:ae:d3:23:37:5f:bb:85:7c:2b:92:2e: - e8:7e:a5:8b:dd:99:e1:bf:27:6f:2d:5d:aa:7b:87:fe:0a:dd: - 4b:fc:8e:f5:26:e4:6e:70:42:6e:33:ec:31:9e:7b:93:c1:e4: - c9:69:1a:3d:c0:6b:4e:22:6d:ee:ab:58:4d:c6:d0:41:c1:2b: - ea:4f:12:87:5e:eb:45:d8:6c:f5:98:02:d3:a0:d8:55:8a:06: - 99:19:a2:a0:77:d1:30:9e:ac:cc:75:ee:83:f5:b0:62:39:cf: - 6c:57:e2:4c:d2:91:0b:0e:75:28:1b:9a:bf:fd:1a:43:f1:ca: - 77:fb:3b:8f:61:b8:69:28:16:42:04:5e:70:2a:1c:21:d8:8f: - e1:bd:23:5b:2d:74:40:92:d9:63:19:0d:73:dd:69:bc:62:47: - bc:e0:74:2b:b2:eb:7d:be:41:1b:b5:c0:46:c5:a1:22:cb:5f: - 4e:c1:28:92:de:18:ba:d5:2a:28:bb:11:8b:17:93:98:99:60: - 94:5c:23:cf:5a:27:97:5e:0b:05:06:93:37:1e:3b:69:36:eb: - a9:9e:61:1d:8f:32:da:8e:0c:d6:74:3e:7b:09:24:da:01:77: - 47:c4:3b:cd:34:8c:99:f5:ca:e1:25:61:33:b2:59:1b:e2:6e: - d7:37:57:b6:0d:a9:12:da ------BEGIN CERTIFICATE----- -MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x -GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv -b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV -BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W -YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM -V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB -4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr -H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd -8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv -vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT -mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe -btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc -T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt -WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ -c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A -4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD -VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG -CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0 -aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 -aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu -dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw -czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G -A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC -TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg -Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0 -7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem -d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd -+LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B -4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN -t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x -DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57 -k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s -zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j -Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT -mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK -4SVhM7JZG+Ju1zdXtg2pEto= ------END CERTIFICATE----- - # 85a0dd7dd720adb7ff05f83d542b209dc7ff4528f7d677b18389fea5e5c49e86 Certificate: Data: @@ -7240,11 +6176,11 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 1A:84:62:BC:48:4C:33:25:04:D4:EE:D0:F6:03:C4:19:46:D1:94:6B - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:1A:84:62:BC:48:4C:33:25:04:D4:EE:D0:F6:03:C4:19:46:D1:94:6B DirName:/C=BM/O=QuoVadis Limited/CN=QuoVadis Root CA 2 serial:05:09 @@ -7370,7 +6306,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: C6:17:D0:BC:A8:EA:02:43:F2:1B:06:99:5D:2B:90:20:B9:D7:9C:E4 Signature Algorithm: sha256WithRSAEncryption 34:61:d9:56:b5:12:87:55:4d:dd:a3:35:31:46:bb:a4:07:72: @@ -7434,127 +6370,6 @@ ywaZWWDYWGWVjUTR939+J399roD1B0y2PpxxVJkES/1Y+Zj0 -----END CERTIFICATE----- -# 8a866fd1b276b57e578e921c65828a2bed58e9f2f288054134b7f1f4bfc9cc74 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - 78:58:5f:2e:ad:2c:19:4b:e3:37:07:35:34:13:28:b5:96:d4:65:93 - Signature Algorithm: sha256WithRSAEncryption - Issuer: C = BM, O = QuoVadis Limited, CN = QuoVadis Root CA 1 G3 - Validity - Not Before: Jan 12 17:27:44 2012 GMT - Not After : Jan 12 17:27:44 2042 GMT - Subject: C = BM, O = QuoVadis Limited, CN = QuoVadis Root CA 1 G3 - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (4096 bit) - Modulus: - 00:a0:be:50:10:8e:e9:f2:6c:40:b4:04:9c:85:b9: - 31:ca:dc:2d:e4:11:a9:04:3c:1b:55:c1:e7:58:30: - 1d:24:b4:c3:ef:85:de:8c:2c:e1:c1:3d:df:82:e6: - 4f:ad:47:87:6c:ec:5b:49:c1:4a:d5:bb:8f:ec:87: - ac:7f:82:9a:86:ec:3d:03:99:52:01:d2:35:9e:ac: - da:f0:53:c9:66:3c:d4:ac:02:01:da:24:d3:3b:a8: - 02:46:af:a4:1c:e3:f8:73:58:76:b7:f6:0e:90:0d: - b5:f0:cf:cc:fa:f9:c6:4c:e5:c3:86:30:0a:8d:17: - 7e:35:eb:c5:df:bb:0e:9c:c0:8d:87:e3:88:38:85: - 67:fa:3e:c7:ab:e0:13:9c:05:18:98:cf:93:f5:b1: - 92:b4:fc:23:d3:cf:d5:c4:27:49:e0:9e:3c:9b:08: - a3:8b:5d:2a:21:e0:fc:39:aa:53:da:7d:7e:cf:1a: - 09:53:bc:5d:05:04:cf:a1:4a:8f:8b:76:82:0d:a1: - f8:d2:c7:14:77:5b:90:36:07:81:9b:3e:06:fa:52: - 5e:63:c5:a6:00:fe:a5:e9:52:1b:52:b5:92:39:72: - 03:09:62:bd:b0:60:16:6e:a6:dd:25:c2:03:66:dd: - f3:04:d1:40:e2:4e:8b:86:f4:6f:e5:83:a0:27:84: - 5e:04:c1:f5:90:bd:30:3d:c4:ef:a8:69:bc:38:9b: - a4:a4:96:d1:62:da:69:c0:01:96:ae:cb:c4:51:34: - ea:0c:aa:ff:21:8e:59:8f:4a:5c:e4:61:9a:a7:d2: - e9:2a:78:8d:51:3d:3a:15:ee:a2:59:8e:a9:5c:de: - c5:f9:90:22:e5:88:45:71:dd:91:99:6c:7a:9f:3d: - 3d:98:7c:5e:f6:be:16:68:a0:5e:ae:0b:23:fc:5a: - 0f:aa:22:76:2d:c9:a1:10:1d:e4:d3:44:23:90:88: - 9f:c6:2a:e6:d7:f5:9a:b3:58:1e:2f:30:89:08:1b: - 54:a2:b5:98:23:ec:08:77:1c:95:5d:61:d1:cb:89: - 9c:5f:a2:4a:91:9a:ef:21:aa:49:16:08:a8:bd:61: - 28:31:c9:74:ad:85:f6:d9:c5:b1:8b:d1:e5:10:32: - 4d:5f:8b:20:3a:3c:49:1f:33:85:59:0d:db:cb:09: - 75:43:69:73:fb:6b:71:7d:f0:df:c4:4c:7d:c6:a3: - 2e:c8:95:79:cb:73:a2:8e:4e:4d:24:fb:5e:e4:04: - be:72:1b:a6:27:2d:49:5a:99:7a:d7:5c:09:20:b7: - 7f:94:b9:4f:f1:0d:1c:5e:88:42:1b:11:b7:e7:91: - db:9e:6c:f4:6a:df:8c:06:98:03:ad:cc:28:ef:a5: - 47:f3:53 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: - A3:97:D6:F3:5E:A2:10:E1:AB:45:9F:3C:17:64:3C:EE:01:70:9C:CC - Signature Algorithm: sha256WithRSAEncryption - 18:fa:5b:75:fc:3e:7a:c7:5f:77:c7:ca:df:cf:5f:c3:12:c4: - 40:5d:d4:32:aa:b8:6a:d7:d5:15:15:46:98:23:a5:e6:90:5b: - 18:99:4c:e3:ad:42:a3:82:31:36:88:cd:e9:fb:c4:04:96:48: - 8b:01:c7:8d:01:cf:5b:33:06:96:46:66:74:1d:4f:ed:c1:b6: - b9:b4:0d:61:cc:63:7e:d7:2e:77:8c:96:1c:2a:23:68:6b:85: - 57:76:70:33:13:fe:e1:4f:a6:23:77:18:fa:1a:8c:e8:bd:65: - c9:cf:3f:f4:c9:17:dc:eb:c7:bc:c0:04:2e:2d:46:2f:69:66: - c3:1b:8f:fe:ec:3e:d3:ca:94:bf:76:0a:25:0d:a9:7b:02:1c: - a9:d0:3b:5f:0b:c0:81:3a:3d:64:e1:bf:a7:2d:4e:bd:4d:c4: - d8:29:c6:22:18:d0:c5:ac:72:02:82:3f:aa:3a:a2:3a:22:97: - 31:dd:08:63:c3:75:14:b9:60:28:2d:5b:68:e0:16:a9:66:82: - 23:51:f5:eb:53:d8:31:9b:7b:e9:b7:9d:4b:eb:88:16:cf:f9: - 5d:38:8a:49:30:8f:ed:f1:eb:19:f4:77:1a:31:18:4d:67:54: - 6c:2f:6f:65:f9:db:3d:ec:21:ec:5e:f4:f4:8b:ca:60:65:54: - d1:71:64:f4:f9:a6:a3:81:33:36:33:71:f0:a4:78:5f:4e:ad: - 83:21:de:34:49:8d:e8:59:ac:9d:f2:76:5a:36:f2:13:f4:af: - e0:09:c7:61:2a:6c:f7:e0:9d:ae:bb:86:4a:28:6f:2e:ee:b4: - 79:cd:90:33:c3:b3:76:fa:f5:f0:6c:9d:01:90:fa:9e:90:f6: - 9c:72:cf:47:da:c3:1f:e4:35:20:53:f2:54:d1:df:61:83:a6: - 02:e2:25:38:de:85:32:2d:5e:73:90:52:5d:42:c4:ce:3d:4b: - e1:f9:19:84:1d:d5:a2:50:cc:41:fb:41:14:c3:bd:d6:c9:5a: - a3:63:66:02:80:bd:05:3a:3b:47:9c:ec:00:26:4c:f5:88:51: - bf:a8:23:7f:18:07:b0:0b:ed:8b:26:a1:64:d3:61:4a:eb:5c: - 9f:de:b3:af:67:03:b3:1f:dd:6d:5d:69:68:69:ab:5e:3a:ec: - 7c:69:bc:c7:3b:85:4e:9e:15:b9:b4:15:4f:c3:95:7a:58:d7: - c9:6c:e9:6c:b9:f3:29:63:5e:b4:2c:f0:2d:3d:ed:5a:65:e0: - a9:5b:40:c2:48:99:81:6d:9e:1f:06:2a:3c:12:b4:8b:0f:9b: - a2:24:f0:a6:8d:d6:7a:e0:4b:b6:64:96:63:95:84:c2:4a:cd: - 1c:2e:24:87:33:60:e5:c3 ------BEGIN CERTIFICATE----- -MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQEL -BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc -BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00 -MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEgRzMwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakEPBtV -wedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWe -rNrwU8lmPNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF341 -68Xfuw6cwI2H44g4hWf6Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh -4Pw5qlPafX7PGglTvF0FBM+hSo+LdoINofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXp -UhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/lg6AnhF4EwfWQvTA9xO+o -abw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV7qJZjqlc -3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/G -KubX9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSt -hfbZxbGL0eUQMk1fiyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KO -Tk0k+17kBL5yG6YnLUlamXrXXAkgt3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOt -zCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB -BjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZIhvcNAQELBQAD -ggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC -MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2 -cDMT/uFPpiN3GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUN -qXsCHKnQO18LwIE6PWThv6ctTr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5 -YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP+V04ikkwj+3x6xn0dxoxGE1nVGwv -b2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh3jRJjehZrJ3ydlo2 -8hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fawx/k -NSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNj -ZgKAvQU6O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhp -q1467HxpvMc7hU6eFbm0FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFt -nh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOVhMJKzRwuJIczYOXD ------END CERTIFICATE----- - # 8fe4fb0af93a4d0d67db0bebb23e37c71bf325dcbcdd240ea04daf58b47e1840 Certificate: Data: @@ -7612,7 +6427,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: ED:E7:6F:76:5A:BF:60:EC:49:5B:C6:A5:77:BB:72:16:71:9B:C4:3D Signature Algorithm: sha256WithRSAEncryption 91:df:80:3f:43:09:7e:71:c2:f7:eb:b3:88:8f:e1:51:b2:bc: @@ -7711,7 +6526,7 @@ 75:fb Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 0A:85:A9:77:65:05:98:7C:40:81:F8:0F:97:2C:38:F1:0A:EC:3C:CF X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -7791,7 +6606,7 @@ 26:f7 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 0B:58:E5:8B:C6:4C:15:37:A4:40:A9:30:A9:21:BE:47:36:5A:56:FF X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -7863,7 +6678,7 @@ ASN1 OID: secp384r1 NIST CURVE: P-384 X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 75:71:A7:19:48:19:BC:9D:9D:EA:41:47:DF:94:C4:48:77:99:D3:79 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -7919,7 +6734,7 @@ ASN1 OID: secp384r1 NIST CURVE: P-384 X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 3A:E1:09:86:D4:CF:19:C2:96:76:74:49:76:DC:E0:35:C6:63:63:9A X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -8002,7 +6817,7 @@ e5:84:53 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: BB:AF:7E:02:3D:FA:A6:F1:3C:84:8E:AD:EE:38:98:EC:D9:32:32:D4 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -8073,97 +6888,6 @@ NVOFBkpdn627G190 -----END CERTIFICATE----- -# d7a7a0fb5d7e2731d771e9484ebcdef71d5f0c3e0a2948782bc83ee0ea699ef4 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = GB, ST = Greater Manchester, L = Salford, O = Comodo CA Limited, CN = AAA Certificate Services - Validity - Not Before: Jan 1 00:00:00 2004 GMT - Not After : Dec 31 23:59:59 2028 GMT - Subject: C = GB, ST = Greater Manchester, L = Salford, O = Comodo CA Limited, CN = AAA Certificate Services - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:be:40:9d:f4:6e:e1:ea:76:87:1c:4d:45:44:8e: - be:46:c8:83:06:9d:c1:2a:fe:18:1f:8e:e4:02:fa: - f3:ab:5d:50:8a:16:31:0b:9a:06:d0:c5:70:22:cd: - 49:2d:54:63:cc:b6:6e:68:46:0b:53:ea:cb:4c:24: - c0:bc:72:4e:ea:f1:15:ae:f4:54:9a:12:0a:c3:7a: - b2:33:60:e2:da:89:55:f3:22:58:f3:de:dc:cf:ef: - 83:86:a2:8c:94:4f:9f:68:f2:98:90:46:84:27:c7: - 76:bf:e3:cc:35:2c:8b:5e:07:64:65:82:c0:48:b0: - a8:91:f9:61:9f:76:20:50:a8:91:c7:66:b5:eb:78: - 62:03:56:f0:8a:1a:13:ea:31:a3:1e:a0:99:fd:38: - f6:f6:27:32:58:6f:07:f5:6b:b8:fb:14:2b:af:b7: - aa:cc:d6:63:5f:73:8c:da:05:99:a8:38:a8:cb:17: - 78:36:51:ac:e9:9e:f4:78:3a:8d:cf:0f:d9:42:e2: - 98:0c:ab:2f:9f:0e:01:de:ef:9f:99:49:f1:2d:df: - ac:74:4d:1b:98:b5:47:c5:e5:29:d1:f9:90:18:c7: - 62:9c:be:83:c7:26:7b:3e:8a:25:c7:c0:dd:9d:e6: - 35:68:10:20:9d:8f:d8:de:d2:c3:84:9c:0d:5e:e8: - 2f:c9 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - A0:11:0A:23:3E:96:F1:07:EC:E2:AF:29:EF:82:A5:7F:D0:30:A4:B4 - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 CRL Distribution Points: - - Full Name: - URI:http://crl.comodoca.com/AAACertificateServices.crl - - Full Name: - URI:http://crl.comodo.net/AAACertificateServices.crl - - Signature Algorithm: sha1WithRSAEncryption - 08:56:fc:02:f0:9b:e8:ff:a4:fa:d6:7b:c6:44:80:ce:4f:c4: - c5:f6:00:58:cc:a6:b6:bc:14:49:68:04:76:e8:e6:ee:5d:ec: - 02:0f:60:d6:8d:50:18:4f:26:4e:01:e3:e6:b0:a5:ee:bf:bc: - 74:54:41:bf:fd:fc:12:b8:c7:4f:5a:f4:89:60:05:7f:60:b7: - 05:4a:f3:f6:f1:c2:bf:c4:b9:74:86:b6:2d:7d:6b:cc:d2:f3: - 46:dd:2f:c6:e0:6a:c3:c3:34:03:2c:7d:96:dd:5a:c2:0e:a7: - 0a:99:c1:05:8b:ab:0c:2f:f3:5c:3a:cf:6c:37:55:09:87:de: - 53:40:6c:58:ef:fc:b6:ab:65:6e:04:f6:1b:dc:3c:e0:5a:15: - c6:9e:d9:f1:59:48:30:21:65:03:6c:ec:e9:21:73:ec:9b:03: - a1:e0:37:ad:a0:15:18:8f:fa:ba:02:ce:a7:2c:a9:10:13:2c: - d4:e5:08:26:ab:22:97:60:f8:90:5e:74:d4:a2:9a:53:bd:f2: - a9:68:e0:a2:6e:c2:d7:6c:b1:a3:0f:9e:bf:eb:68:e7:56:f2: - ae:f2:e3:2b:38:3a:09:81:b5:6b:85:d7:be:2d:ed:3f:1a:b7: - b2:63:e2:f5:62:2c:82:d4:6a:00:41:50:f1:39:83:9f:95:e9: - 36:96:98:6e ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb -MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow -GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj -YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL -MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE -BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM -GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua -BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe -3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 -YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR -rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm -ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU -oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF -MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v -QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t -b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF -AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q -GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 -G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi -l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 -smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- - # e793c9b02fd8aa13e21c31228accb08119643b749c898964b1746d46c3d4cbd2 Certificate: Data: @@ -8217,7 +6941,7 @@ 2f:82:0f Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 53:79:BF:5A:AA:2B:4A:CF:54:80:E1:D8:9B:C0:9D:F2:B2:03:66:CB X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -8288,96 +7012,6 @@ jjxDah2nGN59PRbxYvnKkKj9 -----END CERTIFICATE----- -# 4200f5043ac8590ebb527d209ed1503029fbcbd41ca1b506ec27f15ade7dac69 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - 07:56:22:a4:e8:d4:8a:89:4d:f4:13:c8:f0:f8:ea:a5 - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = US, O = SecureTrust Corporation, CN = Secure Global CA - Validity - Not Before: Nov 7 19:42:28 2006 GMT - Not After : Dec 31 19:52:06 2029 GMT - Subject: C = US, O = SecureTrust Corporation, CN = Secure Global CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:af:35:2e:d8:ac:6c:55:69:06:71:e5:13:68:24: - b3:4f:d8:cc:21:47:f8:f1:60:38:89:89:03:e9:bd: - ea:5e:46:53:09:dc:5c:f5:5a:e8:f7:45:2a:02:eb: - 31:61:d7:29:33:4c:ce:c7:7c:0a:37:7e:0f:ba:32: - 98:e1:1d:97:af:8f:c7:dc:c9:38:96:f3:db:1a:fc: - 51:ed:68:c6:d0:6e:a4:7c:24:d1:ae:42:c8:96:50: - 63:2e:e0:fe:75:fe:98:a7:5f:49:2e:95:e3:39:33: - 64:8e:1e:a4:5f:90:d2:67:3c:b2:d9:fe:41:b9:55: - a7:09:8e:72:05:1e:8b:dd:44:85:82:42:d0:49:c0: - 1d:60:f0:d1:17:2c:95:eb:f6:a5:c1:92:a3:c5:c2: - a7:08:60:0d:60:04:10:96:79:9e:16:34:e6:a9:b6: - fa:25:45:39:c8:1e:65:f9:93:f5:aa:f1:52:dc:99: - 98:3d:a5:86:1a:0c:35:33:fa:4b:a5:04:06:15:1c: - 31:80:ef:aa:18:6b:c2:7b:d7:da:ce:f9:33:20:d5: - f5:bd:6a:33:2d:81:04:fb:b0:5c:d4:9c:a3:e2:5c: - 1d:e3:a9:42:75:5e:7b:d4:77:ef:39:54:ba:c9:0a: - 18:1b:12:99:49:2f:88:4b:fd:50:62:d1:73:e7:8f: - 7a:43 - Exponent: 65537 (0x10001) - X509v3 extensions: - 1.3.6.1.4.1.311.20.2: - ...C.A - X509v3 Key Usage: - Digital Signature, Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - AF:44:04:C2:41:7E:48:83:DB:4E:39:02:EC:EC:84:7A:E6:CE:C9:A4 - X509v3 CRL Distribution Points: - - Full Name: - URI:http://crl.securetrust.com/SGCA.crl - - 1.3.6.1.4.1.311.21.1: - ... - Signature Algorithm: sha1WithRSAEncryption - 63:1a:08:40:7d:a4:5e:53:0d:77:d8:7a:ae:1f:0d:0b:51:16: - 03:ef:18:7c:c8:e3:af:6a:58:93:14:60:91:b2:84:dc:88:4e: - be:39:8a:3a:f3:e6:82:89:5d:01:37:b3:ab:24:a4:15:0e:92: - 35:5a:4a:44:5e:4e:57:fa:75:ce:1f:48:ce:66:f4:3c:40:26: - 92:98:6c:1b:ee:24:46:0c:17:b3:52:a5:db:a5:91:91:cf:37: - d3:6f:e7:27:08:3a:4e:19:1f:3a:a7:58:5c:17:cf:79:3f:8b: - e4:a7:d3:26:23:9d:26:0f:58:69:fc:47:7e:b2:d0:8d:8b:93: - bf:29:4f:43:69:74:76:67:4b:cf:07:8c:e6:02:f7:b5:e1:b4: - 43:b5:4b:2d:14:9f:f9:dc:26:0d:bf:a6:47:74:06:d8:88:d1: - 3a:29:30:84:ce:d2:39:80:62:1b:a8:c7:57:49:bc:6a:55:51: - 67:15:4a:be:35:07:e4:d5:75:98:37:79:30:14:db:29:9d:6c: - c5:69:cc:47:55:a2:30:f7:cc:5c:7f:c2:c3:98:1c:6b:4e:16: - 80:eb:7a:78:65:45:a2:00:1a:af:0c:0d:55:64:34:48:b8:92: - b9:f1:b4:50:29:f2:4f:23:1f:da:6c:ac:1f:44:e1:dd:23:78: - 51:5b:c7:16 ------BEGIN CERTIFICATE----- -MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK -MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x -GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx -MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg -Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ -iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa -/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ -jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI -HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7 -sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w -gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw -KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG -AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L -URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO -H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm -I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY -iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc -f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW ------END CERTIFICATE----- - # 55903859c8c0c3ebb8759ece4e2557225ff5758bbd38ebd48276601e1bd58097 Certificate: Data: @@ -8408,7 +7042,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 55:A9:84:89:D2:C1:32:BD:18:CB:6C:A6:07:4E:C8:E7:9D:BE:82:90 Signature Algorithm: ecdsa-with-SHA384 30:64:02:30:37:01:92:97:45:12:7e:a0:f3:3e:ad:19:3a:72: @@ -8463,7 +7097,7 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: A3:41:06:AC:90:6D:D1:4A:EB:75:A5:4A:10:99:B3:B1:A1:8B:4A:F7 Signature Algorithm: ecdsa-with-SHA256 30:44:02:20:07:e6:54:da:0e:a0:5a:b2:ae:11:9f:87:c5:b6: @@ -8541,7 +7175,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 99:E0:19:67:0D:62:DB:76:B3:DA:3D:B8:5B:E8:FD:42:D2:31:0E:87 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -8610,99 +7244,6 @@ yeC2nOnOcXHebD8WpHk= -----END CERTIFICATE----- -# cecddc905099d8dadfc5b1d209b737cbe2c18cfb2c10c0ff0bcf0d3286fc1aa2 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: - 50:94:6c:ec:18:ea:d5:9c:4d:d5:97:ef:75:8f:a0:ad - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = US, OU = www.xrampsecurity.com, O = XRamp Security Services Inc, CN = XRamp Global Certification Authority - Validity - Not Before: Nov 1 17:14:04 2004 GMT - Not After : Jan 1 05:37:19 2035 GMT - Subject: C = US, OU = www.xrampsecurity.com, O = XRamp Security Services Inc, CN = XRamp Global Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:98:24:1e:bd:15:b4:ba:df:c7:8c:a5:27:b6:38: - 0b:69:f3:b6:4e:a8:2c:2e:21:1d:5c:44:df:21:5d: - 7e:23:74:fe:5e:7e:b4:4a:b7:a6:ad:1f:ae:e0:06: - 16:e2:9b:5b:d9:67:74:6b:5d:80:8f:29:9d:86:1b: - d9:9c:0d:98:6d:76:10:28:58:e4:65:b0:7f:4a:98: - 79:9f:e0:c3:31:7e:80:2b:b5:8c:c0:40:3b:11:86: - d0:cb:a2:86:36:60:a4:d5:30:82:6d:d9:6e:d0:0f: - 12:04:33:97:5f:4f:61:5a:f0:e4:f9:91:ab:e7:1d: - 3b:bc:e8:cf:f4:6b:2d:34:7c:e2:48:61:1c:8e:f3: - 61:44:cc:6f:a0:4a:a9:94:b0:4d:da:e7:a9:34:7a: - 72:38:a8:41:cc:3c:94:11:7d:eb:c8:a6:8c:b7:86: - cb:ca:33:3b:d9:3d:37:8b:fb:7a:3e:86:2c:e7:73: - d7:0a:57:ac:64:9b:19:eb:f4:0f:04:08:8a:ac:03: - 17:19:64:f4:5a:25:22:8d:34:2c:b2:f6:68:1d:12: - 6d:d3:8a:1e:14:da:c4:8f:a6:e2:23:85:d5:7a:0d: - bd:6a:e0:e9:ec:ec:17:bb:42:1b:67:aa:25:ed:45: - 83:21:fc:c1:c9:7c:d5:62:3e:fa:f2:c5:2d:d3:fd: - d4:65 - Exponent: 65537 (0x10001) - X509v3 extensions: - 1.3.6.1.4.1.311.20.2: - ...C.A - X509v3 Key Usage: - Digital Signature, Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - C6:4F:A2:3D:06:63:84:09:9C:CE:62:E4:04:AC:8D:5C:B5:E9:B6:1B - X509v3 CRL Distribution Points: - - Full Name: - URI:http://crl.xrampsecurity.com/XGCA.crl - - 1.3.6.1.4.1.311.21.1: - ... - Signature Algorithm: sha1WithRSAEncryption - 91:15:39:03:01:1b:67:fb:4a:1c:f9:0a:60:5b:a1:da:4d:97: - 62:f9:24:53:27:d7:82:64:4e:90:2e:c3:49:1b:2b:9a:dc:fc: - a8:78:67:35:f1:1d:f0:11:bd:b7:48:e3:10:f6:0d:df:3f:d2: - c9:b6:aa:55:a4:48:ba:02:db:de:59:2e:15:5b:3b:9d:16:7d: - 47:d7:37:ea:5f:4d:76:12:36:bb:1f:d7:a1:81:04:46:20:a3: - 2c:6d:a9:9e:01:7e:3f:29:ce:00:93:df:fd:c9:92:73:89:89: - 64:9e:e7:2b:e4:1c:91:2c:d2:b9:ce:7d:ce:6f:31:99:d3:e6: - be:d2:1e:90:f0:09:14:79:5c:23:ab:4d:d2:da:21:1f:4d:99: - 79:9d:e1:cf:27:9f:10:9b:1c:88:0d:b0:8a:64:41:31:b8:0e: - 6c:90:24:a4:9b:5c:71:8f:ba:bb:7e:1c:1b:db:6a:80:0f:21: - bc:e9:db:a6:b7:40:f4:b2:8b:a9:b1:e4:ef:9a:1a:d0:3d:69: - 99:ee:a8:28:a3:e1:3c:b3:f0:b2:11:9c:cf:7c:40:e6:dd:e7: - 43:7d:a2:d8:3a:b5:a9:8d:f2:34:99:c4:d4:10:e1:06:fd:09: - 84:10:3b:ee:c4:4c:f4:ec:27:7c:42:c2:74:7c:82:8a:09:c9: - b4:03:25:bc ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB -gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk -MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY -UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx -NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 -dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy -dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 -38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP -KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q -DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 -qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa -JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi -PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P -BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs -jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 -eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD -ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR -vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa -IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy -i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ -O+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- - # f1c1b50ae5a20dd8030ec9f6bc24823dd367b5255759b4e71b61fce9f7375d73 Certificate: Data: @@ -8739,20 +7280,20 @@ ba:bb Exponent: 65537 (0x10001) X509v3 extensions: - 1.3.6.1.4.1.311.20.2: + 1.3.6.1.4.1.311.20.2: ...C.A - X509v3 Key Usage: + X509v3 Key Usage: Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 42:32:B6:16:FA:04:FD:FE:5D:4B:7A:C3:FD:F7:4C:40:1D:5A:43:AF - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: Full Name: URI:http://crl.securetrust.com/STCA.crl - 1.3.6.1.4.1.311.21.1: + 1.3.6.1.4.1.311.21.1: ... Signature Algorithm: sha1WithRSAEncryption 30:ed:4f:4a:e1:58:3a:52:72:5b:b5:a6:a3:65:18:a6:bb:51: @@ -8850,7 +7391,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 81:C4:8C:CC:F5:E4:30:FF:A5:0C:08:5F:8C:15:67:21:74:01:DF:DF Signature Algorithm: sha256WithRSAEncryption 13:65:22:f5:8e:2b:ad:44:e4:cb:ff:b9:68:e6:c3:80:48:3d: @@ -8967,7 +7508,7 @@ b4:03:7f Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: D9:74:3A:E4:30:3D:0D:F7:12:DC:7E:5A:05:9F:1E:34:9A:F7:E1:14 X509v3 Basic Constraints: critical CA:TRUE @@ -9060,11 +7601,11 @@ ASN1 OID: secp384r1 NIST CURVE: P-384 X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 5B:CA:5E:E5:DE:D2:81:AA:CD:A8:2D:64:51:B6:D9:72:9B:97:E6:4F X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:5B:CA:5E:E5:DE:D2:81:AA:CD:A8:2D:64:51:B6:D9:72:9B:97:E6:4F X509v3 Key Usage: critical @@ -9147,10 +7688,10 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:F9:60:BB:D4:E3:D5:34:F6:B8:F5:06:80:25:A7:73:DB:46:69:A8:9E - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: F9:60:BB:D4:E3:D5:34:F6:B8:F5:06:80:25:A7:73:DB:46:69:A8:9E X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -9244,11 +7785,11 @@ ASN1 OID: secp384r1 NIST CURVE: P-384 X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 82:D1:85:73:30:E7:35:04:D3:8E:02:92:FB:E5:A4:D1:C4:21:E8:CD X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:82:D1:85:73:30:E7:35:04:D3:8E:02:92:FB:E5:A4:D1:C4:21:E8:CD X509v3 Key Usage: critical @@ -9329,11 +7870,11 @@ 33:ed:87 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: DD:04:09:07:A2:F5:7A:7D:52:53:12:92:95:EE:38:80:25:0D:A6:59 X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:DD:04:09:07:A2:F5:7A:7D:52:53:12:92:95:EE:38:80:25:0D:A6:59 X509v3 Key Usage: critical @@ -9460,12 +8001,12 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 5B:25:7B:96:A4:65:51:7E:B8:39:F3:C0:78:66:5E:E8:3A:E7:F0:EE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:5B:25:7B:96:A4:65:51:7E:B8:39:F3:C0:78:66:5E:E8:3A:E7:F0:EE - X509v3 Certificate Policies: + X509v3 Certificate Policies: Policy: 2.16.756.1.89.1.2.1.1 CPS: http://repository.swisssign.com/ @@ -9651,85 +8192,6 @@ KwbQBM0= -----END CERTIFICATE----- -# bfd88fe1101c41ae3e801bf8be56350ee9bad1a6b9bd515edc5c6d5b8711ac44 -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 1 (0x1) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C = TW, O = TAIWAN-CA, OU = Root CA, CN = TWCA Root Certification Authority - Validity - Not Before: Aug 28 07:24:33 2008 GMT - Not After : Dec 31 15:59:59 2030 GMT - Subject: C = TW, O = TAIWAN-CA, OU = Root CA, CN = TWCA Root Certification Authority - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public-Key: (2048 bit) - Modulus: - 00:b0:7e:72:b8:a4:03:94:e6:a7:de:09:38:91:4a: - 11:40:87:a7:7c:59:64:14:7b:b5:11:10:dd:fe:bf: - d5:c0:bb:56:e2:85:25:f4:35:72:0f:f8:53:d0:41: - e1:44:01:c2:b4:1c:c3:31:42:16:47:85:33:22:76: - b2:0a:6f:0f:e5:25:50:4f:85:86:be:bf:98:2e:10: - 67:1e:be:11:05:86:05:90:c4:59:d0:7c:78:10:b0: - 80:5c:b7:e1:c7:2b:75:cb:7c:9f:ae:b5:d1:9d:23: - 37:63:a7:dc:42:a2:2d:92:04:1b:50:c1:7b:b8:3e: - 1b:c9:56:04:8b:2f:52:9b:ad:a9:56:e9:c1:ff:ad: - a9:58:87:30:b6:81:f7:97:45:fc:19:57:3b:2b:6f: - e4:47:f4:99:45:fe:1d:f1:f8:97:a3:88:1d:37:1c: - 5c:8f:e0:76:25:9a:50:f8:a0:54:ff:44:90:76:23: - d2:32:c6:c3:ab:06:bf:fc:fb:bf:f3:ad:7d:92:62: - 02:5b:29:d3:35:a3:93:9a:43:64:60:5d:b2:fa:32: - ff:3b:04:af:4d:40:6a:f9:c7:e3:ef:23:fd:6b:cb: - e5:0f:8b:38:0d:ee:0a:fc:fe:0f:98:9f:30:31:dd: - 6c:52:65:f9:8b:81:be:22:e1:1c:58:03:ba:91:1b: - 89:07 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Key Usage: critical - Certificate Sign, CRL Sign - X509v3 Basic Constraints: critical - CA:TRUE - X509v3 Subject Key Identifier: - 6A:38:5B:26:8D:DE:8B:5A:F2:4F:7A:54:83:19:18:E3:08:35:A6:BA - Signature Algorithm: sha1WithRSAEncryption - 3c:d5:77:3d:da:df:89:ba:87:0c:08:54:6a:20:50:92:be:b0: - 41:3d:b9:26:64:83:0a:2f:e8:40:c0:97:28:27:82:30:4a:c9: - 93:ff:6a:e7:a6:00:7f:89:42:9a:d6:11:e5:53:ce:2f:cc:f2: - da:05:c4:fe:e2:50:c4:3a:86:7d:cc:da:7e:10:09:3b:92:35: - 2a:53:b2:fe:eb:2b:05:d9:6c:5d:e6:d0:ef:d3:6a:66:9e:15: - 28:85:7a:e8:82:00:ac:1e:a7:09:69:56:42:d3:68:51:18:be: - 54:9a:bf:44:41:ba:49:be:20:ba:69:5c:ee:b8:77:cd:ce:6c: - 1f:ad:83:96:18:7d:0e:b5:14:39:84:f1:28:e9:2d:a3:9e:7b: - 1e:7a:72:5a:83:b3:79:6f:ef:b4:fc:d0:0a:a5:58:4f:46:df: - fb:6d:79:59:f2:84:22:52:ae:0f:cc:fb:7c:3b:e7:6a:ca:47: - 61:c3:7a:f8:d3:92:04:1f:b8:20:84:e1:36:54:16:c7:40:de: - 3b:8a:73:dc:df:c6:09:4c:df:ec:da:ff:d4:53:42:a1:c9:f2: - 62:1d:22:83:3c:97:c5:f9:19:62:27:ac:65:22:d7:d3:3c:c6: - e5:8e:b2:53:cc:49:ce:bc:30:fe:7b:0e:33:90:fb:ed:d2:14: - 91:1f:07:af ------BEGIN CERTIFICATE----- -MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES -MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU -V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz -WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO -LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm -aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE -AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH -K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX -RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z -rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx -3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq -hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC -MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls -XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D -lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn -aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ -YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== ------END CERTIFICATE----- - # dd6936fe21f8f077c123a1a521c12224f72255b73e03a7260693e8a24b0fa389 Certificate: Data: @@ -9785,9 +8247,9 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Key Usage: + X509v3 Key Usage: Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: F0:8F:59:38:00:B3:F5:8F:9A:96:0C:D5:EB:FA:7B:AA:17:E8:13:12 Signature Algorithm: sha1WithRSAEncryption be:e4:5c:62:4e:24:f4:0c:08:ff:f0:d3:0c:68:e4:93:49:22: @@ -9878,7 +8340,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 8D:06:66:74:24:76:3A:F3:89:F7:BC:D6:BD:47:7D:2F:BC:10:5F:4B X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -9960,7 +8422,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 8C:FB:1C:75:BC:02:D3:9F:4E:2E:48:D9:F9:60:54:AA:C4:B3:4F:FA X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -10056,11 +8518,11 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 73:91:10:AB:FF:55:B3:5A:7C:09:25:D5:B2:BA:08:A0:6B:AB:1F:6D X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: Full Name: URI:http://crl.d-trust.net/crl/d-trust_br_root_ca_1_2020.crl @@ -10122,11 +8584,11 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 7F:10:01:16:37:3A:A4:28:E4:50:F8:A4:F7:EC:6B:32:B6:FE:E9:8B X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 CRL Distribution Points: + X509v3 CRL Distribution Points: Full Name: URI:http://crl.d-trust.net/crl/d-trust_ev_root_ca_1_2020.crl @@ -10190,7 +8652,7 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 31:0A:90:8F:B6:C6:9D:D2:44:4B:80:B5:A2:E6:1F:B1:12:4F:1B:95 Signature Algorithm: ecdsa-with-SHA384 30:65:02:31:00:df:54:90:ed:9b:ef:8b:94:02:93:17:82:99: @@ -10270,7 +8732,7 @@ Digital Signature, Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 03:5C:AB:73:81:87:A8:CC:B0:A6:D5:94:E2:36:96:49:FF:05:99:2C Signature Algorithm: sha384WithRSAEncryption 7c:78:ec:f6:02:2c:bb:5b:7e:92:2b:5d:39:dc:be:d8:1d:a2: @@ -10391,9 +8853,9 @@ CA:TRUE X509v3 Key Usage: critical Certificate Sign, CRL Sign - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: DC:2E:1F:D1:61:37:79:E4:AB:D5:D5:B3:12:71:68:3D:6A:68:9C:22 - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:DC:2E:1F:D1:61:37:79:E4:AB:D5:D5:B3:12:71:68:3D:6A:68:9C:22 Signature Algorithm: sha256WithRSAEncryption @@ -10487,7 +8949,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: C9:1B:53:81:12:FE:04:D5:16:D1:AA:BC:9A:6F:B7:A0:95:19:6E:CA X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -10569,7 +9031,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 0A:48:23:A6:60:A4:92:0A:33:EA:93:5B:C5:57:EA:25:4D:BD:12:EE X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -10692,7 +9154,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: F2:77:17:FA:5E:A8:FE:F6:3D:71:D5:68:BA:C9:46:0C:38:D8:AF:B0 X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -10788,7 +9250,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 7C:42:96:AE:DE:4B:48:3B:FA:92:F8:9E:8C:CF:6D:8B:A9:72:37:95 Signature Algorithm: ecdsa-with-SHA384 30:65:02:30:7b:79:4e:46:50:84:c2:44:87:46:1b:45:70:ff: @@ -10865,7 +9327,7 @@ 4d:46:2d Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: D2:9F:88:DF:A1:CD:2C:BD:EC:F5:3B:01:01:93:33:27:B2:EB:60:4B X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -10988,10 +9450,10 @@ ca:42:d5 Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: keyid:72:AC:E4:33:79:AA:45:87:F6:FD:AC:1D:9E:D6:C7:2F:86:D8:24:39 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 72:AC:E4:33:79:AA:45:87:F6:FD:AC:1D:9E:D6:C7:2F:86:D8:24:39 X509v3 Key Usage: critical Certificate Sign, CRL Sign @@ -11086,7 +9548,7 @@ ASN1 OID: secp384r1 NIST CURVE: P-384 X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: C1:51:45:50:59:AB:3E:E7:2C:5A:FA:20:22:12:07:80:88:7C:11:6A X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -11167,7 +9629,7 @@ 9e:cf:eb Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 51:33:1C:ED:36:40:AF:17:D3:25:CD:69:68:F2:AF:4E:23:3E:B3:41 X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -11347,7 +9809,7 @@ Certificate Sign, CRL Sign X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: E0:AA:3F:25:8D:9F:44:5C:C1:3A:E8:2E:AE:77:4C:84:3E:67:0C:F4 Signature Algorithm: sha256WithRSAEncryption b9:57:af:b8:12:da:57:83:8f:68:0b:33:1d:03:53:55:f4:95: @@ -11980,7 +10442,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 76:28:25:D6:7D:E0:66:9A:7A:09:B2:6A:3B:8E:33:D7:36:D3:4F:A2 X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -12062,7 +10524,7 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 74:49:99:D1:FF:B4:7A:68:45:75:C3:7E:B4:DC:CC:CE:39:33:DA:08 X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -12155,7 +10617,7 @@ ASN1 OID: secp384r1 NIST CURVE: P-384 X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: D1:22:DA:4C:59:F1:4B:5F:26:38:AA:9D:D6:EE:EB:0D:C3:FB:A9:61 X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -12237,7 +10699,7 @@ 7c:6d:cf Exponent: 65537 (0x10001) X509v3 extensions: - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 56:73:58:64:95:F9:92:1A:B0:12:2A:04:62:79:A1:40:15:88:21:49 X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -12335,9 +10797,9 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: 89:8F:2F:A3:E8:2B:A0:14:54:7B:F3:56:B8:26:5F:67:38:0B:9C:D0 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: 89:8F:2F:A3:E8:2B:A0:14:54:7B:F3:56:B8:26:5F:67:38:0B:9C:D0 X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -12419,9 +10881,9 @@ X509v3 extensions: X509v3 Basic Constraints: critical CA:TRUE - X509v3 Authority Key Identifier: + X509v3 Authority Key Identifier: FB:2E:37:EE:E3:84:7A:27:2E:CD:19:35:B1:33:7C:FF:D4:44:42:B9 - X509v3 Subject Key Identifier: + X509v3 Subject Key Identifier: FB:2E:37:EE:E3:84:7A:27:2E:CD:19:35:B1:33:7C:FF:D4:44:42:B9 X509v3 Key Usage: critical Digital Signature, Certificate Sign, CRL Sign @@ -12488,3 +10950,128 @@ Mho6/4UIyYOf8kpIEFR3N+2ivEC+5BB09+Rbu7nzifmPQdjH5FCQNYA+HLhNkNPU 98OwoX6EyneSMSy4kLGCenROmxMmtNVQZlR4rmA= -----END CERTIFICATE----- + +# 3f63bb2814be174ec8b6439cf08d6d56f0b7c405883a5648a334424d6b3ec558 +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 40:01:34:8c:c2:00:00:00:00:00:00:00:01:3c:f2:c6 + Signature Algorithm: sha384WithRSAEncryption + Issuer: C=TW, O=TAIWAN-CA, OU=Root CA, CN=TWCA CYBER Root CA + Validity + Not Before: Nov 22 06:54:29 2022 GMT + Not After : Nov 22 15:59:59 2047 GMT + Subject: C=TW, O=TAIWAN-CA, OU=Root CA, CN=TWCA CYBER Root CA + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (4096 bit) + Modulus: + 00:c6:f8:ca:1e:d9:09:20:7e:1d:6c:4e:ce:8f:e3: + 47:33:44:9c:c7:c9:69:aa:3a:5b:78:ee:70:d2:92: + f8:04:b3:52:52:1d:67:72:28:a1:df:8b:5d:95:0a: + fe:ea:cd:ed:f7:29:ce:f0:6f:7f:ac:cd:3d:ef:b3: + 1c:45:6a:f7:28:90:f1:61:57:c5:0c:c4:a3:50:5d: + de:d4:b5:cb:19:ca:80:b9:75:ce:29:ce:d2:85:22: + ec:02:63:cc:44:30:20:da:ea:91:5b:56:e6:1d:1c: + d5:9d:66:c7:3f:df:86:ca:4b:53:c4:d9:8d:b2:1d: + ea:f8:dc:27:53:a3:47:e1:61:cc:7d:b5:b0:f8:ee: + 73:91:c5:ce:73:6f:ce:ee:10:1f:1a:06:cf:e9:27: + 60:c5:4f:19:e4:eb:ce:22:26:45:d7:60:99:dd:ce: + 4f:37:e0:7f:e7:63:ad:b0:b8:59:b8:d0:06:68:35: + 60:d3:36:ae:71:43:04:f1:69:65:78:7c:f3:1f:f3: + ca:28:9f:5a:20:95:66:b4:cd:b7:ee:8f:78:a4:45: + 18:e9:26:2f:8d:9b:29:28:b1:a4:b7:3a:6d:b9:d4: + 1c:38:72:45:58:b1:5e:eb:f0:28:9b:b7:82:ca:fd: + cf:d6:33:0f:9f:fb:97:9e:b1:1c:9c:9e:ea:5f:5e: + db:aa:dd:54:e9:30:21:28:6d:8e:79:f3:75:92:8c: + 26:fe:dc:c5:f6:c3:b0:df:44:59:43:a3:b6:03:28: + f6:08:30:aa:0d:33:e1:ef:9c:a9:07:22:e3:59:5b: + 40:8f:da:88:b7:69:08:a8:b7:23:2e:44:09:59:37: + 5b:c7:e3:17:f2:22:eb:6e:39:52:c5:de:54:a7:98: + c9:4b:20:95:dc:46:89:5f:b4:12:f9:85:29:8e:eb: + c8:27:15:20:c0:4b:d4:cc:7c:0c:6c:34:0c:26:9b: + 26:31:a6:3c:a7:f6:d9:d0:4b:a2:64:ff:3b:99:41: + 72:c1:e0:70:97:f1:24:bb:2b:c4:74:22:b1:ac:6b: + 22:32:24:d3:78:2a:c0:c0:a1:2f:f1:52:05:c9:3f: + ef:76:66:e2:45:d8:0d:3d:ad:95:c8:c7:89:26:c8: + 0f:ae:a7:03:2e:fb:c1:5f:fa:20:e1:70:ad:b0:65: + 20:37:33:60:b0:d5:af:d7:0c:1c:c2:90:70:d7:4a: + 18:bc:7e:01:b0:b0:eb:15:1e:44:06:cd:a4:4f:e8: + 0c:d1:c3:20:10:e1:54:65:9e:b6:51:d0:1a:76:6b: + 42:5a:58:76:34:ea:b7:37:19:ae:2e:75:f9:96:e5: + c1:59:f7:94:57:29:25:8d:3a:4c:ab:4d:9a:41:d0: + 5f:26:03 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Key Usage: critical + Certificate Sign, CRL Sign + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Authority Key Identifier: + 9D:85:61:14:7C:C1:62:6F:97:68:E4:4F:37:40:E1:AD:E0:0D:56:37 + X509v3 Subject Key Identifier: + 9D:85:61:14:7C:C1:62:6F:97:68:E4:4F:37:40:E1:AD:E0:0D:56:37 + Signature Algorithm: sha384WithRSAEncryption + Signature Value: + 64:8f:7a:c4:62:0e:b5:88:cc:b8:c7:86:0e:a1:4a:16:cd:70: + 0b:b7:a7:85:0b:b3:76:b6:0f:a7:ff:08:8b:0b:25:cf:a8:d4: + 83:75:2a:b8:96:88:b6:fb:df:2d:2d:b4:69:53:21:35:57:d6: + 89:4d:73:bf:69:8f:70:a3:61:cc:9a:db:1e:9a:e0:20:f8:6c: + bb:9b:22:9d:5d:84:31:9a:2c:8a:dd:6a:a1:d7:28:69:ca:fe: + 76:55:7a:46:67:eb:cc:43:88:16:a2:03:d6:b9:17:f8:19:6c: + 6d:23:02:7f:f1:5f:d0:0a:29:23:3b:d1:aa:0a:ed:a9:17:26: + 54:0a:4d:c2:a5:4d:f8:c5:fd:b8:81:cf:2b:2c:78:a3:67:4c: + a9:07:9a:f3:df:5e:fb:7c:f5:89:cd:74:97:61:10:6a:07:2b: + 81:5a:d2:8e:b7:e7:20:d1:20:6e:24:a8:84:27:a1:57:ac:aa: + 55:58:2f:dc:d9:ca:fa:68:04:9e:ed:44:24:f9:74:40:3b:23: + 33:ab:83:5a:18:26:42:b6:6d:54:b5:16:60:30:6c:b1:a0:f8: + b8:41:a0:5d:49:49:d2:65:05:3a:ea:fe:9d:61:bc:86:d9:bf: + de:d3:ba:3a:b1:7f:7e:92:34:8e:c9:00:6e:dc:98:bd:dc:ec: + 80:05:ad:02:3d:df:65:ed:0b:03:f7:f7:16:84:04:31:ba:93: + 94:d8:f2:12:f8:8a:e3:bf:42:af:a7:d4:cd:11:17:16:c8:42: + 1d:14:a8:42:f6:d2:40:86:a0:4f:23:ca:96:45:56:60:06:cd: + b7:55:01:a6:01:94:65:fe:6e:05:09:ba:b4:a4:aa:e2:ef:58: + be:bd:27:56:d8:ef:73:71:5b:44:33:f2:9a:72:ea:b0:5e:3e: + 6e:a9:52:5b:ec:70:6d:b5:87:8f:37:5e:3c:8c:9c:ce:e4:f0: + ce:0c:67:41:cc:ce:f6:80:ab:4e:cc:4c:56:f5:c1:61:59:93: + b4:3e:a6:da:b8:37:12:9f:2a:32:e3:8b:b8:21:ec:c3:2b:65: + 0c:ef:22:de:88:29:3b:4c:d7:fa:fe:b7:e1:47:be:9c:3e:3e: + 83:fb:51:5d:f5:68:f7:2e:21:85:dc:bf:f1:5a:e2:7c:d7:c5: + e4:83:c1:6a:eb:ba:80:5a:de:5c:2d:70:76:f8:c8:e5:87:87: + ca:a0:9d:a1:e5:22:12:27:0f:44:3d:1d:6c:ea:d4:c2:8b:2f: + 6f:79:ab:7f:50:a6:c4:19:a7:a1:7a:b7:96:f9:c1:1f:62:5a: + a2:43:07:40:5e:26:c6:ac:ed:ae:70:16:c5:aa:ca:72:8a:4d: + b0:cf:01:8b:03:3f:6e:d7 +-----BEGIN CERTIFICATE----- +MIIFjTCCA3WgAwIBAgIQQAE0jMIAAAAAAAAAATzyxjANBgkqhkiG9w0BAQwFADBQ +MQswCQYDVQQGEwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRAwDgYDVQQLEwdSb290 +IENBMRswGQYDVQQDExJUV0NBIENZQkVSIFJvb3QgQ0EwHhcNMjIxMTIyMDY1NDI5 +WhcNNDcxMTIyMTU1OTU5WjBQMQswCQYDVQQGEwJUVzESMBAGA1UEChMJVEFJV0FO +LUNBMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJUV0NBIENZQkVSIFJvb3Qg +Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDG+Moe2Qkgfh1sTs6P +40czRJzHyWmqOlt47nDSkvgEs1JSHWdyKKHfi12VCv7qze33Kc7wb3+szT3vsxxF +avcokPFhV8UMxKNQXd7UtcsZyoC5dc4pztKFIuwCY8xEMCDa6pFbVuYdHNWdZsc/ +34bKS1PE2Y2yHer43CdTo0fhYcx9tbD47nORxc5zb87uEB8aBs/pJ2DFTxnk684i +JkXXYJndzk834H/nY62wuFm40AZoNWDTNq5xQwTxaWV4fPMf88oon1oglWa0zbfu +j3ikRRjpJi+NmykosaS3Om251Bw4ckVYsV7r8Cibt4LK/c/WMw+f+5eesRycnupf +Xtuq3VTpMCEobY5583WSjCb+3MX2w7DfRFlDo7YDKPYIMKoNM+HvnKkHIuNZW0CP +2oi3aQiotyMuRAlZN1vH4xfyIutuOVLF3lSnmMlLIJXcRolftBL5hSmO68gnFSDA +S9TMfAxsNAwmmyYxpjyn9tnQS6Jk/zuZQXLB4HCX8SS7K8R0IrGsayIyJNN4KsDA +oS/xUgXJP+92ZuJF2A09rZXIx4kmyA+upwMu+8Ff+iDhcK2wZSA3M2Cw1a/XDBzC +kHDXShi8fgGwsOsVHkQGzaRP6AzRwyAQ4VRlnrZR0Bp2a0JaWHY06rc3Ga4udfmW +5cFZ95RXKSWNOkyrTZpB0F8mAwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBSdhWEUfMFib5do5E83QOGt4A1WNzAd +BgNVHQ4EFgQUnYVhFHzBYm+XaORPN0DhreANVjcwDQYJKoZIhvcNAQEMBQADggIB +AGSPesRiDrWIzLjHhg6hShbNcAu3p4ULs3a2D6f/CIsLJc+o1IN1KriWiLb73y0t +tGlTITVX1olNc79pj3CjYcya2x6a4CD4bLubIp1dhDGaLIrdaqHXKGnK/nZVekZn +68xDiBaiA9a5F/gZbG0jAn/xX9AKKSM70aoK7akXJlQKTcKlTfjF/biBzysseKNn +TKkHmvPfXvt89YnNdJdhEGoHK4Fa0o635yDRIG4kqIQnoVesqlVYL9zZyvpoBJ7t +RCT5dEA7IzOrg1oYJkK2bVS1FmAwbLGg+LhBoF1JSdJlBTrq/p1hvIbZv97Tujqx +f36SNI7JAG7cmL3c7IAFrQI932XtCwP39xaEBDG6k5TY8hL4iuO/Qq+n1M0RFxbI +Qh0UqEL20kCGoE8jypZFVmAGzbdVAaYBlGX+bgUJurSkquLvWL69J1bY73NxW0Qz +8ppy6rBePm6pUlvscG21h483XjyMnM7k8M4MZ0HMzvaAq07MTFb1wWFZk7Q+ptq4 +NxKfKjLji7gh7MMrZQzvIt6IKTtM1/r+t+FHvpw+PoP7UV31aPcuIYXcv/Fa4nzX +xeSDwWrruoBa3lwtcHb4yOWHh8qgnaHlIhInD0Q9HWzq1MKLL295q39QpsQZp6F6 +t5b5wR9iWqJDB0BeJsas7a5wFsWqynKKTbDPAYsDP27X +-----END CERTIFICATE-----
diff --git a/net/data/ssl/chrome_root_store/root_store.md b/net/data/ssl/chrome_root_store/root_store.md index 154a7b2..83a99a2 100644 --- a/net/data/ssl/chrome_root_store/root_store.md +++ b/net/data/ssl/chrome_root_store/root_store.md
@@ -1,7 +1,7 @@ <!-- mdformat off(generated) --> <!-- mdlint off(generated) --> # Chrome Root Store -Version: 18 +Version: 19 [TOC] @@ -22,15 +22,12 @@ 657cfe2fa73faa38462571f332a2363a46fce7020951710702cdfbb6eeda3305 | OU=certSIGN ROOT CA G2,O=CERTSIGN SA,C=RO | 2017-02-06 | 2042-02-06 eaa962c4fa4a6bafebe415196d351ccd888d4f53f3fa8ae6d7c466a94e6042bb | OU=certSIGN ROOT CA,O=certSIGN,C=RO | 2006-07-04 | 2031-07-04 5cc3d78e4e1d5e45547a04e6873e64f90cf9536d1ccc2ef800f355c4c5fd70fd | CN=CFCA EV ROOT,O=China Financial Certification Authority,C=CN | 2012-08-08 | 2029-12-31 -c0a6f4dc63a24bfdcf54ef2a6a082a0a72de35803e2ff5ff527ae5d87206dfd5 | OU=ePKI Root Certification Authority,O=Chunghwa Telecom Co.\, Ltd.,C=TW | 2004-12-20 | 2034-12-20 -bf0feefb9e3a581ad5f9e9db7589985743d261085c4d314f6f5d7259aa421612 | CN=SecureSign RootCA11,O=Japan Certification Services\, Inc.,C=JP | 2009-04-08 | 2029-04-08 49e7a442acf0ea6287050054b52564b650e4f49e42e348d6aa38e039e957b1c1 | CN=D-TRUST Root Class 3 CA 2 2009,O=D-Trust GmbH,C=DE | 2009-11-05 | 2029-11-05 eec5496b988ce98625b934092eec2908bed0b0f316c2d4730c84eaf1f3d34881 | CN=D-TRUST Root Class 3 CA 2 EV 2009,O=D-Trust GmbH,C=DE | 2009-11-05 | 2029-11-05 91e2f5788d5810eba7ba58737de1548a8ecacd014598bc0b143e041b17052552 | CN=T-TeleSec GlobalRoot Class 2,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE | 2008-10-01 | 2033-10-01 fd73dad31c644ff1b43bef0ccdda96710b9cd9875eca7e31707af3e96d522bbd | CN=T-TeleSec GlobalRoot Class 3,OU=T-Systems Trust Center,O=T-Systems Enterprise Services GmbH,C=DE | 2008-10-01 | 2033-10-01 d48d3d23eedb50a459e55197601c27774b9d7b18c94d5a059511a10250b93168 | CN=Certigna Root CA,OU=0002 48146308100036,O=Dhimyotis,C=FR | 2013-10-01 | 2033-10-01 e3b6a2db2ed7ce48842f7ac53241c7b71d54144bfb40c11f3f1d0b42f5eea12d | CN=Certigna,O=Dhimyotis,C=FR | 2007-06-29 | 2027-06-29 -16af57a9f676b0ab126095aa5ebadef22ab31119d644ac95cd4b93dbf3f26aeb | CN=Baltimore CyberTrust Root,OU=CyberTrust,O=Baltimore,C=IE | 2000-05-12 | 2025-05-12 31ad6648f8104138c738f39ea4320133393e3a18cc02296ef97c2ac9ef6731d0 | CN=DigiCert Global Root G3,OU=www.digicert.com,O=DigiCert Inc,C=US | 2013-08-01 | 2038-01-15 3e9099b5015e8f486c00bcea9d111ee721faba355a89bcf1df69561e3dc6325c | CN=DigiCert Assured ID Root CA,OU=www.digicert.com,O=DigiCert Inc,C=US | 2006-11-10 | 2031-11-10 4348a0e9444c78cb265e058d5e8944b4d84f9662bd26db257f8934a443c70161 | CN=DigiCert Global Root CA,OU=www.digicert.com,O=DigiCert Inc,C=US | 2006-11-10 | 2031-11-10 @@ -40,19 +37,14 @@ 7e37cb8b4c47090cab36551ba6f45db840680fba166a952db100717f43053fc2 | CN=DigiCert Assured ID Root G3,OU=www.digicert.com,O=DigiCert Inc,C=US | 2013-08-01 | 2038-01-15 cb3ccbb76031e5e0138f8dd39a23f9de47ffc35e43c1144cea27d46a5ab1cb5f | CN=DigiCert Global Root G2,OU=www.digicert.com,O=DigiCert Inc,C=US | 2013-08-01 | 2038-01-15 e23d4a036d7b70e9f595b1422079d2b91edfbb1fb651a0633eaa8a9dc5f80703 | CN=CA Disig Root R2,O=Disig a.s.,L=Bratislava,C=SK | 2012-07-19 | 2042-07-19 -125609aa301da0a249b97a8239cb6a34216f44dcac9f3954b14292f2e8c8608f | CN=emSign Root CA - C1,OU=emSign PKI,O=eMudhra Inc,C=US | 2018-02-18 | 2043-02-18 40f6af0346a99aa1cd1d555a4e9cce62c7f9634603ee406615833dc8c8d00367 | CN=emSign Root CA - G1,OU=emSign PKI,O=eMudhra Technologies Limited,C=IN | 2018-02-18 | 2043-02-18 86a1ecba089c4a8d3bbe2734c612ba341d813e043cf9e8a862cd5c57a36bbe6b | CN=emSign ECC Root CA - G3,OU=emSign PKI,O=eMudhra Technologies Limited,C=IN | 2018-02-18 | 2043-02-18 -bc4d809b15189d78db3e1d8cf4f9726a795da1643ca5f1358e1ddb0edc0d7eb3 | CN=emSign ECC Root CA - C3,OU=emSign PKI,O=eMudhra Inc,C=US | 2018-02-18 | 2043-02-18 bfff8fd04433487d6a8aa60c1a29767a9fc2bbb05e420f713a13b992891d3893 | CN=GDCA TrustAUTH R5 ROOT,O=GUANG DONG CERTIFICATE AUTHORITY CO.\,LTD.,C=CN | 2014-11-26 | 2040-12-31 179fbc148a3dd00fd24ea13458cc43bfa7f59c8182d783a513f6ebec100c8924 | CN=GlobalSign,OU=GlobalSign ECC Root CA - R5,O=GlobalSign | 2012-11-13 | 2038-01-19 2cabeafe37d06ca22aba7391c0033d25982952c453647349763a3ab5ad6ccf69 | CN=GlobalSign,OU=GlobalSign Root CA - R6,O=GlobalSign | 2014-12-10 | 2034-12-10 cbb522d7b7f127ad6a0113865bdf1cd4102e7d0759af635a7cf4720dc963c53b | CN=GlobalSign,OU=GlobalSign Root CA - R3,O=GlobalSign | 2009-03-18 | 2029-03-18 -ebd41040e4bb3ec742c9e381d31ef2a41a48b6685c96e7cef3c1df6cd4331c99 | CN=GlobalSign Root CA,OU=Root CA,O=GlobalSign nv-sa,C=BE | 1998-09-01 | 2028-01-28 -1465fa205397b876faa6f0a9958e5590e40fcc7faa4fb7c2c8677521fb5fb658 | OU=Starfield Class 2 Certification Authority,O=Starfield Technologies\, Inc.,C=US | 2004-06-29 | 2034-06-29 2ce1cb0bf9d2f9e102993fbe215152c3b2dd0cabde1c68e5319b839154dbb7f5 | CN=Starfield Root Certificate Authority - G2,O=Starfield Technologies\, Inc.,L=Scottsdale,ST=Arizona,C=US | 2009-09-01 | 2037-12-31 45140b3247eb9cc8c5b4f0d7b53091f73292089e6e5a63e2749dd3aca9198eda | CN=Go Daddy Root Certificate Authority - G2,O=GoDaddy.com\, Inc.,L=Scottsdale,ST=Arizona,C=US | 2009-09-01 | 2037-12-31 -c3846bf24b9e93ca64274c0ec67c1ecc5e024ffcacd2d74019350e81fe546ae4 | OU=Go Daddy Class 2 Certification Authority,O=The Go Daddy Group\, Inc.,C=US | 2004-06-29 | 2034-06-29 34d8a73ee208d9bcdb0d956520934b4e40e69482596e8b6f73c8426b010a6f48 | CN=GTS Root R3,O=Google Trust Services LLC,C=US | 2016-06-22 | 2036-06-22 d947432abde7b7fa90fc2e6b59101b1280e0e1c7e4e40fa3c6887fff57a7f4cf | CN=GTS Root R1,O=Google Trust Services LLC,C=US | 2016-06-22 | 2036-06-22 349dfa4058c5e263123b398ae795573c4e1313c83fe68f93556cd5e8031b3c7d | CN=GTS Root R4,O=Google Trust Services LLC,C=US | 2016-06-22 | 2036-06-22 @@ -62,9 +54,6 @@ 9a6ec012e1a7da9dbe34194d478ad7c0db1822fb071df12981496ed104384113 | CN=ACCVRAIZ1,OU=PKIACCV,O=ACCV,C=ES | 2011-05-05 | 2030-12-31 ebc5570c29018c4d67b1aa127baf12f703b4611ebc17b7dab5573894179b93fa | OU=AC RAIZ FNMT-RCM,O=FNMT-RCM,C=ES | 2008-10-29 | 2030-01-01 46edc3689046d53a453fb3104ab80dcaec658b2660ea1629dd7e867990648716 | CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1,OU=Kamu Sertifikasyon Merkezi - Kamu SM,O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK,L=Gebze - Kocaeli,C=TR | 2013-11-25 | 2043-10-25 -44b545aa8a25e65a73ca15dc27fc36d24c1cb9953a066539b11582dc487b4833 | CN=Hellenic Academic and Research Institutions ECC RootCA 2015,O=Hellenic Academic and Research Institutions Cert. Authority,L=Athens,C=GR | 2015-07-07 | 2040-06-30 -a040929a02ce53b4acf4f2ffc6981ce4496f755e6d45fe0b2a692bcd52523f36 | CN=Hellenic Academic and Research Institutions RootCA 2015,O=Hellenic Academic and Research Institutions Cert. Authority,L=Athens,C=GR | 2015-07-07 | 2040-06-30 -30d0895a9a448a262091635522d1f52010b5867acae12c78ef958fd4f4389f2f | CN=IdenTrust Public Sector Root CA 1,O=IdenTrust,C=US | 2014-01-16 | 2034-01-16 5d56499be4d2e08bcfcad08a3e38723d50503bde706948e42f55603019e528ae | CN=IdenTrust Commercial Root CA 1,O=IdenTrust,C=US | 2014-01-16 | 2034-01-16 96bcec06264976f37460779acf28c5a7cfe8a3c0aae11a8ffcee05c0bddf08c6 | CN=ISRG Root X1,O=Internet Security Research Group,C=US | 2015-06-04 | 2035-06-04 2530cc8e98321502bad96f9b1fba1b099e2d299e0f4548bb914f363bc0d4531f | CN=Izenpe.com,O=IZENPE S.A.,C=ES | 2007-12-13 | 2037-12-13 @@ -76,23 +65,18 @@ 6c61dac3a2def031506be036d2a6fe401994fbd13df9c8d466599274c446ec98 | CN=NetLock Arany (Class Gold) FÅ‘tanúsítvány,OU=Tanúsítványkiadók (Certification Services),O=NetLock Kft.,L=Budapest,C=HU | 2008-12-11 | 2028-12-06 6b9c08e86eb0f767cfad65cd98b62149e5494a67f5845e7bd1ed019f27b86bd6 | CN=OISTE WISeKey Global Root GB CA,OU=OISTE Foundation Endorsed,O=WISeKey,C=CH | 2014-12-01 | 2039-12-01 8560f91c3624daba9570b5fea0dbe36ff11a8323be9486854fb3f34a5571198d | CN=OISTE WISeKey Global Root GC CA,OU=OISTE Foundation Endorsed,O=WISeKey,C=CH | 2017-05-09 | 2042-05-09 -18f1fc7f205df8adddeb7fe007dd57e3af375a9c4d8d73546bf4f1fed1e18d35 | CN=QuoVadis Root CA 3,O=QuoVadis Limited,C=BM | 2006-11-24 | 2031-11-24 85a0dd7dd720adb7ff05f83d542b209dc7ff4528f7d677b18389fea5e5c49e86 | CN=QuoVadis Root CA 2,O=QuoVadis Limited,C=BM | 2006-11-24 | 2031-11-24 88ef81de202eb018452e43f864725cea5fbd1fc2d9d205730709c5d8b8690f46 | CN=QuoVadis Root CA 3 G3,O=QuoVadis Limited,C=BM | 2012-01-12 | 2042-01-12 -8a866fd1b276b57e578e921c65828a2bed58e9f2f288054134b7f1f4bfc9cc74 | CN=QuoVadis Root CA 1 G3,O=QuoVadis Limited,C=BM | 2012-01-12 | 2042-01-12 8fe4fb0af93a4d0d67db0bebb23e37c71bf325dcbcdd240ea04daf58b47e1840 | CN=QuoVadis Root CA 2 G3,O=QuoVadis Limited,C=BM | 2012-01-12 | 2042-01-12 513b2cecb810d4cde5dd85391adfc6c2dd60d87bb736d2b521484aa47a0ebef6 | OU=Security Communication RootCA2,O=SECOM Trust Systems CO.\,LTD.,C=JP | 2009-05-29 | 2029-05-29 1a0d20445de5ba1862d19ef880858cbce50102b36e8f0a040c3c69e74522fe6e | CN=COMODO Certification Authority,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB | 2011-01-01 | 2030-12-31 1793927a0614549789adce2f8f34f7f0b66d0f3ae3a3b84d21ec15dbba4fadc7 | CN=COMODO ECC Certification Authority,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB | 2008-03-06 | 2038-01-18 4ff460d54b9c86dabfbcfc5712e0400d2bed3fbc4d4fbdaa86e06adcd2a9ad7a | CN=USERTrust ECC Certification Authority,O=The USERTRUST Network,L=Jersey City,ST=New Jersey,C=US | 2010-02-01 | 2038-01-18 52f0e1c4e58ec629291b60317f074671b85d7ea80d5b07273463534b32b40234 | CN=COMODO RSA Certification Authority,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB | 2010-01-19 | 2038-01-18 -d7a7a0fb5d7e2731d771e9484ebcdef71d5f0c3e0a2948782bc83ee0ea699ef4 | CN=AAA Certificate Services,O=Comodo CA Limited,L=Salford,ST=Greater Manchester,C=GB | 2004-01-01 | 2028-12-31 e793c9b02fd8aa13e21c31228accb08119643b749c898964b1746d46c3d4cbd2 | CN=USERTrust RSA Certification Authority,O=The USERTRUST Network,L=Jersey City,ST=New Jersey,C=US | 2010-02-01 | 2038-01-18 -4200f5043ac8590ebb527d209ed1503029fbcbd41ca1b506ec27f15ade7dac69 | CN=Secure Global CA,O=SecureTrust Corporation,C=US | 2006-11-07 | 2029-12-31 55903859c8c0c3ebb8759ece4e2557225ff5758bbd38ebd48276601e1bd58097 | CN=Trustwave Global ECC P384 Certification Authority,O=Trustwave Holdings\, Inc.,L=Chicago,ST=Illinois,C=US | 2017-08-23 | 2042-08-23 945bbc825ea554f489d1fd51a73ddf2ea624ac7019a05205225c22a78ccfa8b4 | CN=Trustwave Global ECC P256 Certification Authority,O=Trustwave Holdings\, Inc.,L=Chicago,ST=Illinois,C=US | 2017-08-23 | 2042-08-23 97552015f5ddfc3c8788c006944555408894450084f100867086bc1a2bb58dc8 | CN=Trustwave Global Certification Authority,O=Trustwave Holdings\, Inc.,L=Chicago,ST=Illinois,C=US | 2017-08-23 | 2042-08-23 -cecddc905099d8dadfc5b1d209b737cbe2c18cfb2c10c0ff0bcf0d3286fc1aa2 | CN=XRamp Global Certification Authority,OU=www.xrampsecurity.com,O=XRamp Security Services Inc,C=US | 2004-11-01 | 2035-01-01 f1c1b50ae5a20dd8030ec9f6bc24823dd367b5255759b4e71b61fce9f7375d73 | CN=SecureTrust CA,O=SecureTrust Corporation,C=US | 2006-11-07 | 2029-12-31 9bea11c976fe014764c1be56a6f914b5a560317abd9988393382e5161aa0493c | CN=UCA Global G2 Root,O=UniTrust,C=CN | 2016-03-11 | 2040-12-31 d43af9b35473755c9684fc06d7d8cb70ee5c28e773fb294eb41ee71722924d24 | CN=UCA Extended Validation Root,O=UniTrust,C=CN | 2015-03-13 | 2038-12-31 @@ -102,7 +86,6 @@ 85666a562ee0be5ce925c1d8890a6f76a87ec16d4d7d5f29ea7419cf20123b69 | CN=SSL.com Root Certification Authority RSA,O=SSL Corporation,L=Houston,ST=Texas,C=US | 2016-02-12 | 2041-02-12 62dd0be9b9f50a163ea0f8e75c053b1eca57ea55c8688f647c6881f2c8357b95 | CN=SwissSign Gold CA - G2,O=SwissSign AG,C=CH | 2006-10-25 | 2036-10-25 59769007f7685d0fcd50872f9f95d5755a5b2b457d81f3692b610a98672f0e1b | CN=TWCA Global Root CA,OU=Root CA,O=TAIWAN-CA,C=TW | 2012-06-27 | 2030-12-31 -bfd88fe1101c41ae3e801bf8be56350ee9bad1a6b9bd515edc5c6d5b8711ac44 | CN=TWCA Root Certification Authority,OU=Root CA,O=TAIWAN-CA,C=TW | 2008-08-28 | 2030-12-31 dd6936fe21f8f077c123a1a521c12224f72255b73e03a7260693e8a24b0fa389 | CN=TeliaSonera Root CA v1,O=TeliaSonera | 2007-10-18 | 2032-10-18 6b328085625318aa50d173c98d8bda09d57e27413d114cf787a0f5d06c030cf6 | CN=Certum EC-384 CA,OU=Certum Certification Authority,O=Asseco Data Systems S.A.,C=PL | 2018-03-26 | 2043-03-26 fe7696573855773e37a95e7ad4d9cc96c30157c15d31765ba9b15704e1ae78fd | CN=Certum Trusted Root CA,OU=Certum Certification Authority,O=Asseco Data Systems S.A.,C=PL | 2018-03-16 | 2043-03-16 @@ -132,16 +115,17 @@ 7bb647a62aeeac88bf257aa522d01ffea395e0ab45c73f93f65654ec38f25a06 | CN=Sectigo Public Server Authentication Root R46,O=Sectigo Limited,C=GB | 2021-03-22 | 2046-03-21 c32ffd9f46f936d16c3673990959434b9ad60aafbb9e7cf33654f144cc1ba143 | CN=SSL.com TLS ECC Root CA 2022,O=SSL Corporation,C=US | 2022-08-25 | 2046-08-19 8faf7d2e2cb4709bb8e0b33666bf75a5dd45b5de480f8ea8d4bfe6bebc17f2ed | CN=SSL.com TLS RSA Root CA 2022,O=SSL Corporation,C=US | 2022-08-25 | 2046-08-19 +3f63bb2814be174ec8b6439cf08d6d56f0b7c405883a5648a334424d6b3ec558 | CN=TWCA CYBER Root CA,OU=Root CA,O=TAIWAN-CA,C=TW | 2022-11-22 | 2047-11-22 ## Constrained Roots To learn more about constraints applied to certificates included in the Chrome Root Store, click [here](https://chromium.googlesource.com/chromium/src/+/main/net/data/ssl/chrome_root_store/faq.md). SHA 256 Hash | Subject | NotBefore | NotAfter ---|---|---|--- +c0a6f4dc63a24bfdcf54ef2a6a082a0a72de35803e2ff5ff527ae5d87206dfd5 | OU=ePKI Root Certification Authority,O=Chunghwa Telecom Co.\, Ltd.,C=TW | 2004-12-20 | 2034-12-20 02ed0eb28c14da45165c566791700d6451d7fb56f0b2ab1d3b8eb070e56edff5 | CN=Entrust Root Certification Authority - EC1,OU=See www.entrust.net/legal-terms+OU=(c) 2012 Entrust\, Inc. - for authorized use only,O=Entrust\, Inc.,C=US | 2012-12-18 | 2037-12-18 0376ab1d54c5f9803ce4b2e201a0ee7eef7b57b636e8a93c9b8d4860c96f5fa7 | CN=AffirmTrust Commercial,O=AffirmTrust,C=US | 2010-01-29 | 2030-12-31 0a81ec5a929777f145904af38d5d509f66b5e2c58fcdb531058b0e17f3f0b41b | CN=AffirmTrust Networking,O=AffirmTrust,C=US | 2010-01-29 | 2030-12-31 43df5774b03e7fef5fe40d931a7bedf1bb2e6b42738c4e6d3841103d3aa7f339 | CN=Entrust Root Certification Authority - G2,OU=See www.entrust.net/legal-terms+OU=(c) 2009 Entrust\, Inc. - for authorized use only,O=Entrust\, Inc.,C=US | 2009-07-07 | 2030-12-07 -6dc47172e01cbcb0bf62580d895fe2b8ac9ad4f873801e0c10b9c837d21eb177 | CN=Entrust.net Certification Authority (2048),OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)+OU=(c) 1999 Entrust.net Limited,O=Entrust.net | 1999-12-24 | 2029-07-24 70a73f7f376b60074248904534b11482d5bf0e698ecc498df52577ebf2e93b9a | CN=AffirmTrust Premium,O=AffirmTrust,C=US | 2010-01-29 | 2040-12-31 73c176434f1bc6d5adf45b0e76e727287c8de57616c1e6e6141a2b2cbc7d8e4c | CN=Entrust Root Certification Authority,OU=www.entrust.net/CPS is incorporated by reference+OU=(c) 2006 Entrust\, Inc.,O=Entrust\, Inc.,C=US | 2006-11-27 | 2026-11-27 bd71fdf6da97e4cf62d1647add2581b07d79adf8397eb4ecba9c5e8488821423 | CN=AffirmTrust Premium ECC,O=AffirmTrust,C=US | 2010-01-29 | 2040-12-31
diff --git a/net/data/ssl/chrome_root_store/root_store.textproto b/net/data/ssl/chrome_root_store/root_store.textproto index 5c6ff80..3ff97fa 100644 --- a/net/data/ssl/chrome_root_store/root_store.textproto +++ b/net/data/ssl/chrome_root_store/root_store.textproto
@@ -8,7 +8,7 @@ # Version # should always be incremented up whenever this (or any pem file that # it references) is changed. -version_major: 18 +version_major: 19 # CN=Actalis Authentication Root CA, O=Actalis S.p.A./03358520967, L=Milan, C=IT # https://ssltest-a.actalis.it:8443 @@ -102,13 +102,16 @@ } # OU=ePKI Root Certification Authority, O=Chunghwa Telecom Co., Ltd., C=TW +# Constraint date: Thu Jul 31 2025 23:59:59 GMT+0000 trust_anchors { sha256_hex: "c0a6f4dc63a24bfdcf54ef2a6a082a0a72de35803e2ff5ff527ae5d87206dfd5" -} - -# CN=SecureSign RootCA11, O=Japan Certification Services, Inc., C=JP -trust_anchors { - sha256_hex: "bf0feefb9e3a581ad5f9e9db7589985743d261085c4d314f6f5d7259aa421612" + constraints: { + sct_not_after_sec: 1754006399 + min_version: "135" + } + constraints: { + max_version_exclusive: "135" + } } # CN=D-TRUST Root Class 3 CA 2 2009, O=D-Trust GmbH, C=DE @@ -147,11 +150,6 @@ sha256_hex: "e3b6a2db2ed7ce48842f7ac53241c7b71d54144bfb40c11f3f1d0b42f5eea12d" } -# CN=Baltimore CyberTrust Root, OU=CyberTrust, O=Baltimore, C=IE -trust_anchors { - sha256_hex: "16af57a9f676b0ab126095aa5ebadef22ab31119d644ac95cd4b93dbf3f26aeb" -} - # CN=DigiCert Global Root G3, OU=www.digicert.com, O=DigiCert Inc, C=US # https://global-root-g3.chain-demos.digicert.com/ trust_anchors { @@ -209,11 +207,6 @@ sha256_hex: "e23d4a036d7b70e9f595b1422079d2b91edfbb1fb651a0633eaa8a9dc5f80703" } -# CN=emSign Root CA - C1, O=eMudhra Inc, OU=emSign PKI, C=US -trust_anchors { - sha256_hex: "125609aa301da0a249b97a8239cb6a34216f44dcac9f3954b14292f2e8c8608f" -} - # CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN # https://testevg1.emsign.com/ trust_anchors { @@ -226,13 +219,9 @@ sha256_hex: "86a1ecba089c4a8d3bbe2734c612ba341d813e043cf9e8a862cd5c57a36bbe6b" } -# CN=emSign ECC Root CA - C3, O=eMudhra Inc, OU=emSign PKI, C=US -trust_anchors { - sha256_hex: "bc4d809b15189d78db3e1d8cf4f9726a795da1643ca5f1358e1ddb0edc0d7eb3" -} - # CN=Entrust Root Certification Authority - EC1, OU=(c) 2012 Entrust, Inc. - for authorized use only, OU=See www.entrust.net/legal-terms, O=Entrust, Inc., C=US # https://validec.entrust.net +# Constraint date: Mon Nov 11, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "02ed0eb28c14da45165c566791700d6451d7fb56f0b2ab1d3b8eb070e56edff5" ev_policy_oids: "2.23.140.1.1" @@ -247,6 +236,7 @@ # CN=AffirmTrust Commercial, O=AffirmTrust, C=US # https://commercial.affirmtrust.com/ +# Constraint date: Mon Nov 11, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "0376ab1d54c5f9803ce4b2e201a0ee7eef7b57b636e8a93c9b8d4860c96f5fa7" ev_policy_oids: "2.23.140.1.1" @@ -261,6 +251,7 @@ # CN=AffirmTrust Networking, O=AffirmTrust, C=US # https://networking.affirmtrust.com:4431 +# Constraint date: Mon Nov 11, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "0a81ec5a929777f145904af38d5d509f66b5e2c58fcdb531058b0e17f3f0b41b" ev_policy_oids: "2.23.140.1.1" @@ -275,6 +266,7 @@ # CN=Entrust Root Certification Authority - G2, OU=(c) 2009 Entrust, Inc. - for authorized use only, OU=See www.entrust.net/legal-terms, O=Entrust, Inc., C=US # https://validg2.entrust.net +# Constraint date: Mon Nov 11, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "43df5774b03e7fef5fe40d931a7bedf1bb2e6b42738c4e6d3841103d3aa7f339" ev_policy_oids: "2.23.140.1.1" @@ -287,20 +279,9 @@ } } -# CN=Entrust.net Certification Authority (2048), OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), O=Entrust.net -trust_anchors { - sha256_hex: "6dc47172e01cbcb0bf62580d895fe2b8ac9ad4f873801e0c10b9c837d21eb177" - constraints: { - sct_not_after_sec: 1731369599 - min_version: "131" - } - constraints: { - max_version_exclusive: "131" - } -} - # CN=AffirmTrust Premium, O=AffirmTrust, C=US # https://premium.affirmtrust.com:4432/ +# Constraint date: Mon Nov 11, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "70a73f7f376b60074248904534b11482d5bf0e698ecc498df52577ebf2e93b9a" ev_policy_oids: "2.23.140.1.1" @@ -315,6 +296,7 @@ # CN=Entrust Root Certification Authority, OU=(c) 2006 Entrust, Inc., OU=www.entrust.net/CPS is incorporated by reference, O=Entrust, Inc., C=US # https://www.entrust.net/ +# Constraint date: Mon Nov 11, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "73c176434f1bc6d5adf45b0e76e727287c8de57616c1e6e6141a2b2cbc7d8e4c" ev_policy_oids: "2.23.140.1.1" @@ -329,6 +311,7 @@ # CN=AffirmTrust Premium ECC, O=AffirmTrust, C=US # https://premiumecc.affirmtrust.com:4433/ +# Constraint date: Mon Nov 11, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "bd71fdf6da97e4cf62d1647add2581b07d79adf8397eb4ecba9c5e8488821423" ev_policy_oids: "2.23.140.1.1" @@ -343,6 +326,7 @@ # CN=Entrust Root Certification Authority - G4, OU=(c) 2015 Entrust, Inc. - for authorized use only, OU=See www.entrust.net/legal-terms, O=Entrust, Inc., C=US # https://validg4.entrust.net +# Constraint date: Mon Nov 11, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "db3517d1f6732a2d5ab97c533ec70779ee3270a62fb4ac4238372460e6f01e88" ev_policy_oids: "2.23.140.1.1" @@ -380,20 +364,6 @@ ev_policy_oids: "2.23.140.1.1" } -# CN=GlobalSign Root CA, OU=Root CA, O=GlobalSign nv-sa, C=BE -# GlobalSign Root CA -trust_anchors { - sha256_hex: "ebd41040e4bb3ec742c9e381d31ef2a41a48b6685c96e7cef3c1df6cd4331c99" - ev_policy_oids: "2.23.140.1.1" -} - -# OU=Starfield Class 2 Certification Authority, O=Starfield Technologies, Inc., C=US -# https://www.starfieldtech.com/ -trust_anchors { - sha256_hex: "1465fa205397b876faa6f0a9958e5590e40fcc7faa4fb7c2c8677521fb5fb658" - ev_policy_oids: "2.23.140.1.1" -} - # CN=Starfield Root Certificate Authority - G2, O=Starfield Technologies, Inc., L=Scottsdale, ST=Arizona, C=US # https://valid.sfig2.catest.starfieldtech.com/ trust_anchors { @@ -408,13 +378,6 @@ ev_policy_oids: "2.23.140.1.1" } -# OU=Go Daddy Class 2 Certification Authority, O=The Go Daddy Group, Inc., C=US -# https://www.godaddy.com/ -trust_anchors { - sha256_hex: "c3846bf24b9e93ca64274c0ec67c1ecc5e024ffcacd2d74019350e81fe546ae4" - ev_policy_oids: "2.23.140.1.1" -} - # CN=GTS Root R3, O=Google Trust Services LLC, C=US trust_anchors { sha256_hex: "34d8a73ee208d9bcdb0d956520934b4e40e69482596e8b6f73c8426b010a6f48" @@ -462,25 +425,6 @@ sha256_hex: "46edc3689046d53a453fb3104ab80dcaec658b2660ea1629dd7e867990648716" } -# CN=Hellenic Academic and Research Institutions ECC RootCA 2015, O=Hellenic Academic and Research Institutions Cert. Authority, L=Athens, C=GR -# https://haricaeccrootca2015-valid-ev.harica.gr -trust_anchors { - sha256_hex: "44b545aa8a25e65a73ca15dc27fc36d24c1cb9953a066539b11582dc487b4833" - ev_policy_oids: "2.23.140.1.1" -} - -# CN=Hellenic Academic and Research Institutions RootCA 2015, O=Hellenic Academic and Research Institutions Cert. Authority, L=Athens, C=GR -# https://haricarootca2015-valid-ev.harica.gr -trust_anchors { - sha256_hex: "a040929a02ce53b4acf4f2ffc6981ce4496f755e6d45fe0b2a692bcd52523f36" - ev_policy_oids: "2.23.140.1.1" -} - -# CN=IdenTrust Public Sector Root CA 1, O=IdenTrust, C=US -trust_anchors { - sha256_hex: "30d0895a9a448a262091635522d1f52010b5867acae12c78ef958fd4f4389f2f" -} - # CN=IdenTrust Commercial Root CA 1, O=IdenTrust, C=US # https://identrust-commercial-ev-valid.identrustssl.com/ trust_anchors { @@ -547,11 +491,6 @@ sha256_hex: "8560f91c3624daba9570b5fea0dbe36ff11a8323be9486854fb3f34a5571198d" } -# CN=QuoVadis Root CA 3, O=QuoVadis Limited, C=BM -trust_anchors { - sha256_hex: "18f1fc7f205df8adddeb7fe007dd57e3af375a9c4d8d73546bf4f1fed1e18d35" -} - # CN=QuoVadis Root CA 2, O=QuoVadis Limited, C=BM # https://www.quovadis.bm/ trust_anchors { @@ -564,11 +503,6 @@ sha256_hex: "88ef81de202eb018452e43f864725cea5fbd1fc2d9d205730709c5d8b8690f46" } -# CN=QuoVadis Root CA 1 G3, O=QuoVadis Limited, C=BM -trust_anchors { - sha256_hex: "8a866fd1b276b57e578e921c65828a2bed58e9f2f288054134b7f1f4bfc9cc74" -} - # CN=QuoVadis Root CA 2 G3, O=QuoVadis Limited, C=BM # https://evsslicag3-v.quovadisglobal.com/ trust_anchors { @@ -613,11 +547,6 @@ ev_policy_oids: "2.23.140.1.1" } -# CN=AAA Certificate Services, O=Comodo CA Limited, L=Salford, ST=Greater Manchester, C=GB -trust_anchors { - sha256_hex: "d7a7a0fb5d7e2731d771e9484ebcdef71d5f0c3e0a2948782bc83ee0ea699ef4" -} - # CN=USERTrust RSA Certification Authority, O=The USERTRUST Network, L=Jersey City, ST=New Jersey, C=US # https://usertrustrsacertificationauthority-ev.comodoca.com/ trust_anchors { @@ -625,12 +554,6 @@ ev_policy_oids: "2.23.140.1.1" } -# CN=Secure Global CA, O=SecureTrust Corporation, C=US -trust_anchors { - sha256_hex: "4200f5043ac8590ebb527d209ed1503029fbcbd41ca1b506ec27f15ade7dac69" - ev_policy_oids: "2.23.140.1.1" -} - # CN=Trustwave Global ECC P384 Certification Authority, O=Trustwave Holdings, Inc., L=Chicago, ST=Illinois, C=US trust_anchors { sha256_hex: "55903859c8c0c3ebb8759ece4e2557225ff5758bbd38ebd48276601e1bd58097" @@ -649,12 +572,6 @@ ev_policy_oids: "2.23.140.1.1" } -# CN=XRamp Global Certification Authority, O=XRamp Security Services Inc, OU=www.xrampsecurity.com, C=US -trust_anchors { - sha256_hex: "cecddc905099d8dadfc5b1d209b737cbe2c18cfb2c10c0ff0bcf0d3286fc1aa2" - ev_policy_oids: "2.23.140.1.1" -} - # CN=SecureTrust CA, O=SecureTrust Corporation, C=US # https://www.securetrust.com # https://www.trustwave.com/ @@ -713,13 +630,6 @@ ev_policy_oids: "2.23.140.1.1" } -# CN=TWCA Root Certification Authority, OU=Root CA, O=TAIWAN-CA, C=TW -# https://evssldemo.twca.com.tw/index.html -trust_anchors { - sha256_hex: "bfd88fe1101c41ae3e801bf8be56350ee9bad1a6b9bd515edc5c6d5b8711ac44" - ev_policy_oids: "2.23.140.1.1" -} - # CN=TeliaSonera Root CA v1, O=TeliaSonera trust_anchors { sha256_hex: "dd6936fe21f8f077c123a1a521c12224f72255b73e03a7260693e8a24b0fa389" @@ -759,6 +669,7 @@ # CN=GLOBALTRUST 2020, O=e-commerce monitoring GmbH, C=AT # https://testok-2020-server-qualified-ev-1.e-monitoring.at/ +# Constraint date: Sun Jun 30, 2024 23:59:59 GMT+0000 trust_anchors { sha256_hex: "9a296a5182d1d451a2e37f439b74daafa267523329f90f9a0d2007c334e23c9a" ev_policy_oids: "2.23.140.1.1" @@ -842,13 +753,17 @@ } # CN=vTrus ECC Root CA, O=iTrusChina Co.,Ltd., C=CN +# https://eccevtest.itrus.cn/ trust_anchors { sha256_hex: "30fbba2c32238e2a98547af97931e550428b9b3f1c8eeb6633dcfa86c5b27dd3" + ev_policy_oids: "2.23.140.1.1" } # CN=vTrus Root CA, O=iTrusChina Co.,Ltd., C=CN +# https://evtest.itrus.cn/ trust_anchors { sha256_hex: "8a71de6559336f426c26e53880d00d88a18da4c6a91f0dcb6194e206c5c96387" + ev_policy_oids: "2.23.140.1.1" } # C=DE, O=Atos, CN=Atos TrustedRoot Root CA ECC TLS 2021 @@ -889,6 +804,12 @@ ev_policy_oids: "2.23.140.1.1" } +# CN=TWCA CYBER Root CA, OU=Root CA, O=TAIWAN-CA, C=TW +trust_anchors { + sha256_hex: "3f63bb2814be174ec8b6439cf08d6d56f0b7c405883a5648a334424d6b3ec558" + ev_policy_oids: "2.23.140.1.1" +} + # BEGIN additional certs: # "CN=Qualified e-Szigno TLS CA 2018,O=Microsec Ltd.,L=Budapest,C=HU,2.5.4.97=#130e56415448552d3233353834343937"
diff --git a/net/dns/dns_response_result_extractor.cc b/net/dns/dns_response_result_extractor.cc index 4e14f79..ba2ec0a 100644 --- a/net/dns/dns_response_result_extractor.cc +++ b/net/dns/dns_response_result_extractor.cc
@@ -385,6 +385,9 @@ for (const auto& record : txt_records.value()) { const TxtRecordRdata* rdata = record->rdata<net::TxtRecordRdata>(); DCHECK(rdata); + // TXT invalid without at least one string. If none, should be rejected by + // parser. + CHECK(!rdata->texts().empty()); strings.insert(strings.end(), rdata->texts().begin(), rdata->texts().end()); base::TimeDelta ttl = base::Seconds(record->ttl());
diff --git a/net/dns/dns_response_result_extractor_unittest.cc b/net/dns/dns_response_result_extractor_unittest.cc index c4937bde..d0701f3 100644 --- a/net/dns/dns_response_result_extractor_unittest.cc +++ b/net/dns/dns_response_result_extractor_unittest.cc
@@ -466,6 +466,24 @@ ExtractionError::kMalformedRecord); } +TEST_F(DnsResponseResultExtractorTest, RejectsMalformedEmptyTxtRecord) { + constexpr char kName[] = "name.test"; + + DnsResponse response = + BuildTestDnsResponse(kName, dns_protocol::kTypeTXT, + /*answers=*/ + {BuildTestDnsRecord(kName, dns_protocol::kTypeTXT, + /*rdata=*/{})}); + DnsResponseResultExtractor extractor(response, clock_, tick_clock_); + + EXPECT_EQ(extractor + .ExtractDnsResults(DnsQueryType::TXT, + /*original_domain_name=*/kName, + /*request_port=*/0) + .error_or(ExtractionError::kOk), + ExtractionError::kMalformedRecord); +} + TEST_F(DnsResponseResultExtractorTest, RejectsWrongNameTxtRecord) { constexpr char kName[] = "name.test";
diff --git a/net/dns/host_resolver_mdns_task.cc b/net/dns/host_resolver_mdns_task.cc index 4f4a0c7..7a07e97 100644 --- a/net/dns/host_resolver_mdns_task.cc +++ b/net/dns/host_resolver_mdns_task.cc
@@ -271,6 +271,9 @@ /*strings=*/std::vector<std::string>{}, /*hosts=*/std::vector<HostPortPair>{}); case DnsQueryType::TXT: + // TXT invalid without at least one string. If none, should be rejected by + // parser. + CHECK(!parsed->rdata<net::TxtRecordRdata>()->texts().empty()); return std::make_unique<HostResolverInternalDataResult>( std::move(query_hostname), query_type, /*expiration=*/base::TimeTicks::Now(),
diff --git a/net/dns/record_rdata.cc b/net/dns/record_rdata.cc index d29612f..2d62861 100644 --- a/net/dns/record_rdata.cc +++ b/net/dns/record_rdata.cc
@@ -233,6 +233,11 @@ const DnsRecordParser& parser) { auto rdata = TxtRecordRdata::CreateInstance(); + if (data.empty()) { + // Per RFC1035-3.3.14, a TXT record must contain at least one string entry. + return nullptr; + } + for (size_t i = 0; i < data.size();) { uint8_t length = data[i];
diff --git a/net/dns/record_rdata_unittest.cc b/net/dns/record_rdata_unittest.cc index 959a83d..268e17f9 100644 --- a/net/dns/record_rdata_unittest.cc +++ b/net/dns/record_rdata_unittest.cc
@@ -173,6 +173,14 @@ ASSERT_TRUE(record_obj->IsEqual(record_obj.get())); } +TEST(RecordRdataTest, EmptyTxtRecordIsInvalid) { + // Create a record parser for an empty packet. Good enough for this test since + // the TXT record parser doesn't make use of `parser`. + DnsRecordParser parser(/*packet=*/{}, /*offset=*/0, /*num_records=*/0); + + EXPECT_FALSE(TxtRecordRdata::Create(/*data=*/{}, parser)); +} + TEST(RecordRdataTest, ParseNsecRecord) { // These are just the rdata portions of the DNS records, rather than complete // records, but it works well enough for this test.
diff --git a/net/http/transport_security_state_static.pins b/net/http/transport_security_state_static.pins index 1c59ca1..15dcfe07 100644 --- a/net/http/transport_security_state_static.pins +++ b/net/http/transport_security_state_static.pins
@@ -43,9 +43,9 @@ # hash function for preloaded entries again (we have already done so once). # -# Last updated: 2025-04-23 12:55 UTC +# Last updated: 2025-04-24 12:54 UTC PinsListTimestamp -1745412920 +1745499266 TestSPKI sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
diff --git a/net/http/transport_security_state_static_pins.json b/net/http/transport_security_state_static_pins.json index 50d0d05..8e13d7a 100644 --- a/net/http/transport_security_state_static_pins.json +++ b/net/http/transport_security_state_static_pins.json
@@ -31,7 +31,7 @@ // the 'static_spki_hashes' and 'bad_static_spki_hashes' fields in 'pinsets' // refer to, and the timestamp at which the pins list was last updated. // -// Last updated: 2025-04-23 12:55 UTC +// Last updated: 2025-04-24 12:54 UTC // { "pinsets": [
diff --git a/net/quic/address_utils.h b/net/quic/address_utils.h index c17c87f..3c2fc8b 100644 --- a/net/quic/address_utils.h +++ b/net/quic/address_utils.h
@@ -2,18 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifdef UNSAFE_BUFFERS_BUILD -// TODO(crbug.com/390223051): Remove C-library calls to fix the errors. -#pragma allow_unsafe_libc_calls -#endif - #ifndef NET_QUIC_ADDRESS_UTILS_H_ #define NET_QUIC_ADDRESS_UTILS_H_ -#include <string.h> - #include "base/containers/span.h" #include "net/base/ip_address.h" +#include "net/base/ip_address_util.h" #include "net/base/ip_endpoint.h" #include "net/third_party/quiche/src/quiche/common/quiche_ip_address.h" #include "net/third_party/quiche/src/quiche/common/quiche_ip_address_family.h" @@ -70,18 +64,10 @@ inline quiche::QuicheIpAddress ToQuicheIpAddress(net::IPAddress address) { if (address.IsIPv4()) { - in_addr result; - static_assert(sizeof(result) == IPAddress::kIPv4AddressSize, - "Address size mismatch"); - memcpy(&result, address.bytes().data(), IPAddress::kIPv4AddressSize); - return quiche::QuicheIpAddress(result); + return quiche::QuicheIpAddress(ToInAddr(address)); } if (address.IsIPv6()) { - in6_addr result; - static_assert(sizeof(result) == IPAddress::kIPv6AddressSize, - "Address size mismatch"); - memcpy(&result, address.bytes().data(), IPAddress::kIPv6AddressSize); - return quiche::QuicheIpAddress(result); + return quiche::QuicheIpAddress(ToIn6Addr(address)); } DCHECK(address.empty());
diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc index 814a93f..2f236f2 100644 --- a/net/socket/udp_socket_posix.cc +++ b/net/socket/udp_socket_posix.cc
@@ -43,6 +43,7 @@ #include "net/base/cronet_buildflags.h" #include "net/base/io_buffer.h" #include "net/base/ip_address.h" +#include "net/base/ip_address_util.h" #include "net/base/ip_endpoint.h" #include "net/base/net_errors.h" #include "net/base/network_activity_monitor.h" @@ -924,8 +925,7 @@ ip_mreqn mreq = {}; mreq.imr_ifindex = multicast_interface_; mreq.imr_address.s_addr = htonl(INADDR_ANY); - memcpy(&mreq.imr_multiaddr, group_address.bytes().data(), - IPAddress::kIPv4AddressSize); + mreq.imr_multiaddr = ToInAddr(group_address); int rv = setsockopt(socket_, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); if (rv < 0) @@ -937,8 +937,7 @@ return ERR_ADDRESS_INVALID; ipv6_mreq mreq; mreq.ipv6mr_interface = multicast_interface_; - memcpy(&mreq.ipv6mr_multiaddr, group_address.bytes().data(), - IPAddress::kIPv6AddressSize); + mreq.ipv6mr_multiaddr = ToIn6Addr(group_address); int rv = setsockopt(socket_, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)); if (rv < 0) @@ -963,8 +962,7 @@ ip_mreqn mreq = {}; mreq.imr_ifindex = multicast_interface_; mreq.imr_address.s_addr = INADDR_ANY; - memcpy(&mreq.imr_multiaddr, group_address.bytes().data(), - IPAddress::kIPv4AddressSize); + mreq.imr_multiaddr = ToInAddr(group_address); int rv = setsockopt(socket_, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)); if (rv < 0) @@ -980,8 +978,7 @@ #else // BUILDFLAG(IS_FUCHSIA) mreq.ipv6mr_interface = 0; // 0 indicates default multicast interface. #endif // !BUILDFLAG(IS_FUCHSIA) - memcpy(&mreq.ipv6mr_multiaddr, group_address.bytes().data(), - IPAddress::kIPv6AddressSize); + mreq.ipv6mr_multiaddr = ToIn6Addr(group_address); int rv = setsockopt(socket_, IPPROTO_IPV6, IPV6_LEAVE_GROUP, &mreq, sizeof(mreq)); if (rv < 0)
diff --git a/net/socket/udp_socket_win.cc b/net/socket/udp_socket_win.cc index 33102a6..374e68c 100644 --- a/net/socket/udp_socket_win.cc +++ b/net/socket/udp_socket_win.cc
@@ -28,6 +28,7 @@ #include "base/task/thread_pool.h" #include "net/base/io_buffer.h" #include "net/base/ip_address.h" +#include "net/base/ip_address_util.h" #include "net/base/ip_endpoint.h" #include "net/base/net_errors.h" #include "net/base/network_activity_monitor.h" @@ -1269,8 +1270,7 @@ } ip_mreq mreq; mreq.imr_interface.s_addr = htonl(multicast_interface_); - memcpy(&mreq.imr_multiaddr, group_address.bytes().data(), - IPAddress::kIPv4AddressSize); + mreq.imr_multiaddr = ToInAddr(group_address); int rv = setsockopt(socket_, IPPROTO_IP, IP_ADD_MEMBERSHIP, reinterpret_cast<const char*>(&mreq), sizeof(mreq)); if (rv) { @@ -1284,8 +1284,7 @@ } ipv6_mreq mreq; mreq.ipv6mr_interface = multicast_interface_; - memcpy(&mreq.ipv6mr_multiaddr, group_address.bytes().data(), - IPAddress::kIPv6AddressSize); + mreq.ipv6mr_multiaddr = ToIn6Addr(group_address); int rv = setsockopt(socket_, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, reinterpret_cast<const char*>(&mreq), sizeof(mreq)); if (rv) { @@ -1311,8 +1310,7 @@ } ip_mreq mreq; mreq.imr_interface.s_addr = htonl(multicast_interface_); - memcpy(&mreq.imr_multiaddr, group_address.bytes().data(), - IPAddress::kIPv4AddressSize); + mreq.imr_multiaddr = ToInAddr(group_address); int rv = setsockopt(socket_, IPPROTO_IP, IP_DROP_MEMBERSHIP, reinterpret_cast<const char*>(&mreq), sizeof(mreq)); if (rv) { @@ -1326,8 +1324,7 @@ } ipv6_mreq mreq; mreq.ipv6mr_interface = multicast_interface_; - memcpy(&mreq.ipv6mr_multiaddr, group_address.bytes().data(), - IPAddress::kIPv6AddressSize); + mreq.ipv6mr_multiaddr = ToIn6Addr(group_address); int rv = setsockopt(socket_, IPPROTO_IPV6, IP_DROP_MEMBERSHIP, reinterpret_cast<const char*>(&mreq), sizeof(mreq)); if (rv) {
diff --git a/remoting/build/config/remoting_build.gni b/remoting/build/config/remoting_build.gni index 5360cb4..87086e72 100644 --- a/remoting/build/config/remoting_build.gni +++ b/remoting/build/config/remoting_build.gni
@@ -8,10 +8,13 @@ import("//remoting/remoting_enable.gni") import("//remoting/remoting_locales.gni") import("//remoting/remoting_options.gni") -import("//remoting/remoting_version.gni") import("//remoting/tools/build/remoting_localize.gni") import("//testing/test.gni") +if (!is_android) { + import("//remoting/remoting_version.gni") +} + if (is_win) { import("//build/config/win/manifest.gni") import("//remoting/host/predefines_win.gni")
diff --git a/remoting/remoting_version.gni b/remoting/remoting_version.gni index 680169b25..afad49b 100644 --- a/remoting/remoting_version.gni +++ b/remoting/remoting_version.gni
@@ -5,6 +5,8 @@ import("//build/config/chrome_build.gni") import("//chrome/version.gni") +assert(!is_android) # Not needed on Android + remoting_version_file = "//remoting/VERSION" _version_py_abspath = "//build/util/version.py"
diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn index 78331806..dc53a43 100644 --- a/services/network/public/cpp/BUILD.gn +++ b/services/network/public/cpp/BUILD.gn
@@ -229,6 +229,23 @@ defines = [ "IS_NETWORK_CPP_HOST_RESOLVER_IMPL" ] } +component("integrity_policy") { + sources = [ + "integrity_policy.cc", + "integrity_policy.h", + "integrity_policy_mojom_traits.cc", + "integrity_policy_mojom_traits.h", + "integrity_policy_parser.cc", + "integrity_policy_parser.h", + ] + deps = [ + ":flags_and_switches", + "//net", + "//services/network/public/mojom:mojom_integrity_policy_shared", + ] + defines = [ "IS_NETWORK_CPP_INTEGRITY_POLICY_IMPL" ] +} + component("cookies_mojom_support") { sources = [ "cookie_manager_shared_mojom_traits.cc", @@ -578,6 +595,7 @@ ":crash_keys", ":cross_origin_embedder_policy", ":document_isolation_policy", + ":integrity_policy", ":ip_address_mojom_support", ":network_param_mojom_support", ":proxy_config_mojom_support", @@ -694,6 +712,7 @@ "header_util_unittest.cc", "host_resolver_mojom_traits_unittest.cc", "initiator_lock_compatibility_unittest.cc", + "integrity_policy_parser_unittest.cc", "ip_address_mojom_traits_unittest.cc", "ip_address_space_util_unittest.cc", "is_potentially_trustworthy_unittest.cc",
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc index 50eef03..9ef26a1 100644 --- a/services/network/public/cpp/features.cc +++ b/services/network/public/cpp/features.cc
@@ -292,6 +292,13 @@ "PreloadedDictionaryConditionalUse", base::FEATURE_DISABLED_BY_DEFAULT); +// Enables support for the `Integrity-Policy` header with script destinations, +// which enables developers to ensure all their external scripts have their +// integrity enforced. +BASE_FEATURE(kIntegrityPolicyScript, + "IntegrityPolicyScript", + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kVisibilityAwareResourceScheduler, "VisibilityAwareResourceScheduler", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h index 8a9b7da..fb2a936 100644 --- a/services/network/public/cpp/features.h +++ b/services/network/public/cpp/features.h
@@ -112,6 +112,9 @@ COMPONENT_EXPORT(NETWORK_CPP_FLAGS_AND_SWITCHES) BASE_DECLARE_FEATURE(kPreloadedDictionaryConditionalUse); +COMPONENT_EXPORT(NETWORK_CPP_FLAGS_AND_SWITCHES) +BASE_DECLARE_FEATURE(kIntegrityPolicyScript); + // Enables visibility aware network service resource scheduler. When enabled, // request may be prioritized or de-prioritized based on the visibility of // requestors.
diff --git a/services/network/public/cpp/integrity_policy.cc b/services/network/public/cpp/integrity_policy.cc new file mode 100644 index 0000000..7a0298a --- /dev/null +++ b/services/network/public/cpp/integrity_policy.cc
@@ -0,0 +1,18 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/network/public/cpp/integrity_policy.h" + +namespace network { + +IntegrityPolicy::IntegrityPolicy() = default; +IntegrityPolicy::~IntegrityPolicy() = default; + +IntegrityPolicy::IntegrityPolicy(IntegrityPolicy&&) = default; +IntegrityPolicy& IntegrityPolicy::operator=(IntegrityPolicy&&) = default; + +IntegrityPolicy::IntegrityPolicy(const IntegrityPolicy&) = default; +IntegrityPolicy& IntegrityPolicy::operator=(const IntegrityPolicy&) = default; + +} // namespace network
diff --git a/services/network/public/cpp/integrity_policy.h b/services/network/public/cpp/integrity_policy.h new file mode 100644 index 0000000..c00413a --- /dev/null +++ b/services/network/public/cpp/integrity_policy.h
@@ -0,0 +1,40 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_H_ +#define SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_H_ + +#include <string> +#include <vector> + +#include "base/component_export.h" +#include "services/network/public/mojom/integrity_policy.mojom-shared.h" + +namespace network { + +// This implements a data structure holding information from a parsed +// `Integrity-Policy` or `Integrity-Policy-Report-Only` header. +// +// This struct is needed as we can't use the mojom generated struct directly +// from the blink public API, given that we cannot include .mojo.h there due to +// DEPS rules. +struct COMPONENT_EXPORT(NETWORK_CPP_INTEGRITY_POLICY) IntegrityPolicy { + IntegrityPolicy(); + ~IntegrityPolicy(); + + IntegrityPolicy(IntegrityPolicy&&); + IntegrityPolicy& operator=(IntegrityPolicy&&); + + IntegrityPolicy(const IntegrityPolicy&); + IntegrityPolicy& operator=(const IntegrityPolicy&); + + std::vector<mojom::IntegrityPolicy_Destination> blocked_destinations; + std::vector<mojom::IntegrityPolicy_Source> sources; + std::vector<std::string> endpoints; + std::vector<std::string> parsing_errors; +}; + +} // namespace network + +#endif // SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_H_
diff --git a/services/network/public/cpp/integrity_policy_mojom_traits.cc b/services/network/public/cpp/integrity_policy_mojom_traits.cc new file mode 100644 index 0000000..3aa7af11 --- /dev/null +++ b/services/network/public/cpp/integrity_policy_mojom_traits.cc
@@ -0,0 +1,23 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/network/public/cpp/integrity_policy_mojom_traits.h" + +#include <vector> + +#include "services/network/public/cpp/integrity_policy.h" + +namespace mojo { + +// static +bool StructTraits<network::mojom::IntegrityPolicyDataView, + network::IntegrityPolicy>:: + Read(network::mojom::IntegrityPolicyDataView data, IntegrityPolicy* out) { + return data.ReadBlockedDestinations(&out->blocked_destinations) && + data.ReadSources(&out->sources) && + data.ReadEndpoints(&out->endpoints) && + data.ReadParsingErrors(&out->parsing_errors); +} + +} // namespace mojo
diff --git a/services/network/public/cpp/integrity_policy_mojom_traits.h b/services/network/public/cpp/integrity_policy_mojom_traits.h new file mode 100644 index 0000000..b0a41f1b --- /dev/null +++ b/services/network/public/cpp/integrity_policy_mojom_traits.h
@@ -0,0 +1,43 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_MOJOM_TRAITS_H_ +#define SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_MOJOM_TRAITS_H_ + +#include "base/component_export.h" +#include "mojo/public/cpp/bindings/struct_traits.h" +#include "services/network/public/cpp/integrity_policy.h" +#include "services/network/public/mojom/integrity_policy.mojom-shared.h" + +namespace mojo { + +template <> +struct COMPONENT_EXPORT(NETWORK_CPP_INTEGRITY_POLICY) + StructTraits<network::mojom::IntegrityPolicyDataView, + network::IntegrityPolicy> { + using IntegrityPolicy = network::IntegrityPolicy; + + static const std::vector<network::mojom::IntegrityPolicy_Destination>& + blocked_destinations(const IntegrityPolicy& policy) { + return policy.blocked_destinations; + } + static const std::vector<network::mojom::IntegrityPolicy_Source>& sources( + const IntegrityPolicy& policy) { + return policy.sources; + } + static const std::vector<std::string>& endpoints( + const IntegrityPolicy& policy) { + return policy.endpoints; + } + static const std::vector<std::string>& parsing_errors( + const IntegrityPolicy& policy) { + return policy.parsing_errors; + } + static bool Read(network::mojom::IntegrityPolicyDataView data, + network::IntegrityPolicy* out); +}; + +} // namespace mojo + +#endif // SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_MOJOM_TRAITS_H_
diff --git a/services/network/public/cpp/integrity_policy_parser.cc b/services/network/public/cpp/integrity_policy_parser.cc new file mode 100644 index 0000000..e6b0f50 --- /dev/null +++ b/services/network/public/cpp/integrity_policy_parser.cc
@@ -0,0 +1,109 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/network/public/cpp/integrity_policy_parser.h" + +#include "base/strings/stringprintf.h" +#include "net/http/http_response_headers.h" +#include "net/http/structured_headers.h" +#include "services/network/public/cpp/features.h" +#include "services/network/public/cpp/integrity_policy.h" + +namespace network { +namespace { + +void HandleKeyValue(base::cstring_view key, + const net::structured_headers::ParameterizedMember& value, + base::cstring_view header_name, + IntegrityPolicy& policy) { + if (!value.member_is_inner_list) { + policy.parsing_errors.emplace_back( + base::StringPrintf("The %s value is not a list.", header_name.c_str())); + return; + } + for (const auto& parameter : value.member) { + if (!parameter.item.is_token()) { + policy.parsing_errors.emplace_back(base::StringPrintf( + "The %s item '%s' is not a token. " + "Did you accidentally add it as a string?", + header_name.c_str(), parameter.item.GetString().c_str())); + continue; + } + const base::cstring_view parameter_value = parameter.item.GetString(); + if (key == "blocked-destinations") { + if (parameter_value == "script") { + policy.blocked_destinations.emplace_back( + mojom::IntegrityPolicy_Destination::kScript); + } else { + policy.parsing_errors.emplace_back( + base::StringPrintf("The %s destination '%s' is not supported.", + header_name.c_str(), parameter_value.c_str())); + } + } else if (key == "sources") { + if (parameter_value == "inline") { + policy.sources.emplace_back(mojom::IntegrityPolicy_Source::kInline); + } else { + policy.parsing_errors.emplace_back( + base::StringPrintf("The %s source '%s' is not supported.", + header_name.c_str(), parameter_value.c_str())); + } + } else if (key == "endpoints") { + policy.endpoints.emplace_back(parameter_value); + } else { + policy.parsing_errors.emplace_back(base::StringPrintf( + "Unrecognized %s in %s header.", key.c_str(), header_name.c_str())); + } + } +} + +} // namespace + +IntegrityPolicy ParseIntegrityPolicyFromHeaders( + const net::HttpResponseHeaders& headers, + IntegrityPolicyHeaderType type) { + CHECK( + base::FeatureList::IsEnabled(network::features::kIntegrityPolicyScript)); + IntegrityPolicy parsed_policy; + const std::string header_name = (type == IntegrityPolicyHeaderType::kEnforce) + ? "Integrity-Policy" + : "Integrity-Policy-Report-Only"; + + const std::string integrity_policy_header = + headers.GetNormalizedHeader(header_name).value_or(""); + if (integrity_policy_header.empty()) { + return parsed_policy; + } + + std::optional<net::structured_headers::Dictionary> + integrity_policy_dictionary = + net::structured_headers::ParseDictionary(integrity_policy_header); + if (!integrity_policy_dictionary) { + parsed_policy.parsing_errors.emplace_back(base::StringPrintf( + "The %s value is not a dictionary.", header_name.c_str())); + return parsed_policy; + } + + bool has_sources_key = false; + // Loop through the policy dictionary + // + // https://datatracker.ietf.org/doc/html/rfc9421#section-4-4 + for (const net::structured_headers::DictionaryMember& policy_entry : + integrity_policy_dictionary.value()) { + if (policy_entry.first == "sources") { + has_sources_key = true; + } + HandleKeyValue(policy_entry.first, policy_entry.second, header_name, + parsed_policy); + } + if (!has_sources_key) { + // If the `sources` key is missing from the header, add "inline" as the + // default. That would enable us to add future integrity metadata sources, + // without forcing developers to explicitly add the source today, when only + // one integrity metadata source exists. + parsed_policy.sources.emplace_back(mojom::IntegrityPolicy_Source::kInline); + } + return parsed_policy; +} + +} // namespace network
diff --git a/services/network/public/cpp/integrity_policy_parser.h b/services/network/public/cpp/integrity_policy_parser.h new file mode 100644 index 0000000..61c367f --- /dev/null +++ b/services/network/public/cpp/integrity_policy_parser.h
@@ -0,0 +1,33 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_PARSER_H_ +#define SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_PARSER_H_ + +#include <string_view> + +#include "base/component_export.h" + +namespace net { +class HttpResponseHeaders; +} + +namespace network { +struct IntegrityPolicy; + +enum class IntegrityPolicyHeaderType { kEnforce, kReportOnly }; + +// Parses the Integrity-Policy and the Integrity-Policy-Report-Only headers. +// These headers enable develoeprs to enforce that SubresourceIntegrity is used +// in their documents when loading resources of certain destinations. Currently +// the only supported destination is "script". +// https://github.com/w3c/webappsec-subresource-integrity/pull/133 +COMPONENT_EXPORT(NETWORK_CPP_INTEGRITY_POLICY) +IntegrityPolicy ParseIntegrityPolicyFromHeaders( + const net::HttpResponseHeaders& headers, + IntegrityPolicyHeaderType header_type); + +} // namespace network + +#endif // SERVICES_NETWORK_PUBLIC_CPP_INTEGRITY_POLICY_PARSER_H_
diff --git a/services/network/public/cpp/integrity_policy_parser_unittest.cc b/services/network/public/cpp/integrity_policy_parser_unittest.cc new file mode 100644 index 0000000..aefc2824 --- /dev/null +++ b/services/network/public/cpp/integrity_policy_parser_unittest.cc
@@ -0,0 +1,163 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/network/public/cpp/integrity_policy_parser.h" + +#include <optional> +#include <string> +#include <vector> + +#include "base/test/scoped_feature_list.h" +#include "net/http/http_response_headers.h" +#include "services/network/public/cpp/features.h" +#include "services/network/public/cpp/integrity_policy.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace network { + +namespace { + +struct TestCase { + std::optional<std::string> integrity_policy_header; + + std::vector<mojom::IntegrityPolicy_Destination> blocked_destinations; + std::vector<mojom::IntegrityPolicy_Source> sources; + std::vector<std::string> endpoints; + std::vector<std::string> parsing_errors; + IntegrityPolicyHeaderType type = IntegrityPolicyHeaderType::kEnforce; +}; + +} // namespace + +TEST(IntegrityPolicyParserTest, Parse) { + base::test::ScopedFeatureList scoped_feature; + scoped_feature.InitAndEnableFeature(features::kIntegrityPolicyScript); + const auto kNoHeader = std::optional<std::string>(); + const auto kEmptyHeader = std::string(); + const auto kEmptyDestination = + std::vector<mojom::IntegrityPolicy_Destination>(); + const auto kScriptDestination = + std::vector<mojom::IntegrityPolicy_Destination>( + {mojom::IntegrityPolicy_Destination::kScript}); + const auto kEmptySource = std::vector<mojom::IntegrityPolicy_Source>(); + const auto kInlineSource = std::vector<mojom::IntegrityPolicy_Source>( + {mojom::IntegrityPolicy_Source::kInline}); + const auto kEmptyVectorString = std::vector<std::string>(); + + TestCase test_cases[] = { + {kNoHeader, kEmptyDestination, kEmptySource, kEmptyVectorString, + kEmptyVectorString}, + {kEmptyHeader, kEmptyDestination, kEmptySource, kEmptyVectorString, + kEmptyVectorString}, + {"not a dictionary", + kEmptyDestination, + kEmptySource, + kEmptyVectorString, + {"The Integrity-Policy value is not a dictionary."}}, + {"not a dictionary", + kEmptyDestination, + kEmptySource, + kEmptyVectorString, + {"The Integrity-Policy-Report-Only value is not a dictionary."}, + IntegrityPolicyHeaderType::kReportOnly}, + {"wrongkey=(something)", + kEmptyDestination, + kInlineSource, + kEmptyVectorString, + {"Unrecognized wrongkey in Integrity-Policy header."}}, + {"wrongkey=(something), blocked-destinations=(script)", + kScriptDestination, + kInlineSource, + kEmptyVectorString, + {"Unrecognized wrongkey in Integrity-Policy header."}}, + {"wrongkey=(something), blocked-destinations=(wrongdestination script)", + kScriptDestination, + kInlineSource, + kEmptyVectorString, + {"Unrecognized wrongkey in Integrity-Policy header.", + "The Integrity-Policy destination 'wrongdestination' is not " + "supported."}}, + {"blocked-destinations=(unsupported)", + kEmptyDestination, + kInlineSource, + kEmptyVectorString, + {"The Integrity-Policy destination 'unsupported' is not supported."}}, + {"sources=(inline)", kEmptyDestination, kInlineSource, kEmptyVectorString, + kEmptyVectorString}, + {"blocked-destinations=(script)", kScriptDestination, kInlineSource, + kEmptyVectorString, kEmptyVectorString}, + {"blocked-destinations=(script), sources=(inline)", kScriptDestination, + kInlineSource, kEmptyVectorString, kEmptyVectorString}, + {"blocked-destinations=(script), sources=(inline other)", + kScriptDestination, + kInlineSource, + kEmptyVectorString, + {"The Integrity-Policy source 'other' is not supported."}}, + {"blocked-destinations=(script), sources=(other)", + kScriptDestination, + kEmptySource, + kEmptyVectorString, + {"The Integrity-Policy source 'other' is not supported."}}, + {"endpoints=(https://example.com/api)", + kEmptyDestination, + kInlineSource, + {"https://example.com/api"}, + kEmptyVectorString}, + {"sources=(inline), blocked-destinations=(script), " + "endpoints=(https://example.com/api)", + kScriptDestination, + kInlineSource, + {"https://example.com/api"}, + kEmptyVectorString}, + {"blocked-destinations=(script), endpoints=(endpoint1 endpoint2)", + kScriptDestination, + kInlineSource, + {"endpoint1", "endpoint2"}, + kEmptyVectorString}, + {"blocked-destinations=(script), endpoints=(invalid1, invalid2)", + kEmptyDestination, + kEmptySource, + kEmptyVectorString, + {"The Integrity-Policy value is not a dictionary."}}, + {"sources=(other), blocked-destinations=(script)", + kScriptDestination, + kEmptySource, + kEmptyVectorString, + {"The Integrity-Policy source 'other' is not supported."}}, + {"sources=(inline), blocked-destinations=[], endpoints=[]", + kEmptyDestination, + kEmptySource, + kEmptyVectorString, + {"The Integrity-Policy value is not a dictionary."}}, + + }; + + for (const TestCase& test_case : test_cases) { + auto headers = + base::MakeRefCounted<net::HttpResponseHeaders>("HTTP/1.1 200 OK\n"); + std::string header_value; + if (test_case.integrity_policy_header) { + if (test_case.type == IntegrityPolicyHeaderType::kEnforce) { + headers->AddHeader("Integrity-Policy", + *test_case.integrity_policy_header); + } else { + headers->AddHeader("Integrity-Policy-Report-Only", + *test_case.integrity_policy_header); + } + header_value += *test_case.integrity_policy_header; + } + auto message = testing::Message() << "header: " << header_value; + + SCOPED_TRACE(message); + const auto policy = + ParseIntegrityPolicyFromHeaders(*headers, test_case.type); + + EXPECT_EQ(policy.blocked_destinations, test_case.blocked_destinations); + EXPECT_EQ(policy.sources, test_case.sources); + EXPECT_EQ(policy.endpoints, test_case.endpoints); + EXPECT_EQ(policy.parsing_errors, test_case.parsing_errors); + } +} + +} // namespace network
diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn index ddc20c1..378bbd2 100644 --- a/services/network/public/mojom/BUILD.gn +++ b/services/network/public/mojom/BUILD.gn
@@ -652,6 +652,7 @@ ":mojom_attribution", ":mojom_content_security_policy", ":mojom_integrity_algorithm", + ":mojom_integrity_policy", ":mojom_ip_address", ":mojom_network_isolation_partition", ":mojom_network_param", @@ -1613,6 +1614,34 @@ blink_cpp_typemaps = shared_cpp_typemaps } +mojom("mojom_integrity_policy") { + generate_java = true + sources = [ "integrity_policy.mojom" ] + + public_deps = [] + if (!is_ios) { + export_class_attribute_blink = "BLINK_PLATFORM_EXPORT" + export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" + export_header_blink = "third_party/blink/public/platform/web_common.h" + } + + shared_cpp_typemaps = [ + { + types = [ + { + mojom = "network.mojom.IntegrityPolicy" + cpp = "::network::IntegrityPolicy" + }, + ] + traits_headers = + [ "//services/network/public/cpp/integrity_policy_mojom_traits.h" ] + }, + ] + + cpp_typemaps = shared_cpp_typemaps + blink_cpp_typemaps = shared_cpp_typemaps +} + mojom("mojom_permissions_policy") { generate_java = true sources = [
diff --git a/services/network/public/mojom/integrity_policy.mojom b/services/network/public/mojom/integrity_policy.mojom new file mode 100644 index 0000000..8c553821 --- /dev/null +++ b/services/network/public/mojom/integrity_policy.mojom
@@ -0,0 +1,31 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module network.mojom; + +// The Integrity-Policy header enables developers to enforce Subresource +// Integrity on certain request destinations, to ensure their documents do not +// load any assets of that type without integrity guaranties. +struct IntegrityPolicy { + // The request destinations on which integrity will be enforced. + enum Destination { + kScript, + }; + // The source of integrity information. + // Inline - represents the `integrity` attribute inlined in the HTML (or DOM). + enum Source { + kInline, + }; + + // An array of destinations to be blocked without integrity metadata. + array<Destination> blocked_destinations; + // An array of possible sources for integrity metadata. + array<Source> sources; + // An array of Reporting API endpoints to which policy violations will be + // reported. + array<string> endpoints; + // An array of parsing errors, to be communicated from the browser to the + // renderer, so that they can be reported to the developer console. + array<string> parsing_errors; +};
diff --git a/testing/buildbot/filters/ios.content_browsertests.filter b/testing/buildbot/filters/ios.content_browsertests.filter index 36b1c15..262121b 100644 --- a/testing/buildbot/filters/ios.content_browsertests.filter +++ b/testing/buildbot/filters/ios.content_browsertests.filter
@@ -53,7 +53,6 @@ -ContentSecurityPolicyIsolatedAppWebSocketBrowserTest.CheckCsp/Wss -DataDecoderBrowserTest.DecodeImage -DataDecoderBrowserTest.DecodeImageIsolated --Default/MediaTest.VideoBear12DepthVP9/0 -DevToolsProtocolDeviceEmulationPrerenderTest.DeviceSize -DevToolsProtocolDeviceEmulationTest.DeviceSize -DohHttpsProtocolUpgradeBrowserTest.HttpsProtocolUpgrade @@ -117,15 +116,6 @@ -WebRtcGetUserMediaBrowserTest.TestGetUserMediaAspectRatio4To3 # TODO(crbug.com/40276544): cannot create shared image. --Default/MediaTest.VideoBearMp4/1 --Default/MediaTest.VideoBearMp4Hevc10bit/1 --Default/MediaTest.VideoBearMp4Hevc10bit422/1 --Default/MediaTest.VideoBearMp4Hevc10bit444/1 --Default/MediaTest.VideoBearRotated0/1 --Default/MediaTest.VideoBearRotated180/1 --Default/MediaTest.VideoBearRotated270/1 --Default/MediaTest.VideoBearRotated90/1 --Default/MediaTest.VideoBearSilentMp4/1 -MediaColorTest.Yuv420pH264 -MediaColorTest.Yuv420pHighBitDepth -MediaColorTest.Yuv420pRec709H264 @@ -198,51 +188,6 @@ -AudioContextManagerTest.AudioContextPlaybackRecorded -AudioContextManagerTest.AudioContextPlaybackTimeUkm -BackForwardCacheBrowserTest.VideoSuspendAndResume --Default/MediaTest.AudioBearFlac/0 --Default/MediaTest.AudioBearFlac/1 --Default/MediaTest.AudioBearFlac192kHzMp4/0 --Default/MediaTest.AudioBearFlac192kHzMp4/1 --Default/MediaTest.AudioBearFlacMp4/0 --Default/MediaTest.AudioBearFlacMp4/1 --Default/MediaTest.AudioBearFlacOgg/0 --Default/MediaTest.AudioBearFlacOgg/1 --Default/MediaTest.AudioBearOpusMp4/0 --Default/MediaTest.AudioBearOpusMp4/1 --Default/MediaTest.AudioBearOpusOgg/0 --Default/MediaTest.AudioBearOpusOgg/1 --Default/MediaTest.AudioBearOpusOgg_FileProtocol/0 --Default/MediaTest.AudioBearOpusOgg_FileProtocol/1 --Default/MediaTest.AudioBearOpusWebm/0 --Default/MediaTest.AudioBearOpusWebm/1 --Default/MediaTest.Navigate/0 --Default/MediaTest.Navigate/1 --Default/MediaTest.VideoBear3gpAacH264/0 --Default/MediaTest.VideoBear3gpAacH264/1 --Default/MediaTest.VideoBearHighBitDepthMp4/0 --Default/MediaTest.VideoBearHighBitDepthMp4/1 --Default/MediaTest.VideoBearMovPcmS16be/0 --Default/MediaTest.VideoBearMovPcmS16be/1 --Default/MediaTest.VideoBearMovPcmS24be/0 --Default/MediaTest.VideoBearMovPcmS24be/1 --Default/MediaTest.VideoBearMp4/0 --Default/MediaTest.VideoBearTheora/0 --Default/MediaTest.VideoBearTheora/1 --Default/MediaTest.VideoBearWavAlaw/0 --Default/MediaTest.VideoBearWavAlaw/1 --Default/MediaTest.VideoBearWavMulaw/0 --Default/MediaTest.VideoBearWavMulaw/1 --Default/MediaTest.VideoBearWavPcm/0 --Default/MediaTest.VideoBearWavPcm/1 --Default/MediaTest.VideoBearWavPcm192kHz/0 --Default/MediaTest.VideoBearWavPcm192kHz/1 --Default/MediaTest.VideoBearWavPcm3kHz/0 --Default/MediaTest.VideoBearWavPcm3kHz/1 --Default/MediaTest.VideoBearWebm/0 --Default/MediaTest.VideoBearWebm/1 --Default/MediaTest.VideoBearWebm_FileProtocol/0 --Default/MediaTest.VideoBearWebm_FileProtocol/1 --Default/MediaTest.VideoTulipWebm/0 --Default/MediaTest.VideoTulipWebm/1 -MSE_ClearKey/EncryptedMediaTest.ConfigChangeVideo_ClearToClear/0 -MSE_ClearKey/EncryptedMediaTest.Playback_Encryption_CENC/0 -MediaRedirectTest.CanPlayHiddenWebm @@ -753,10 +698,12 @@ -All/DumpAccessibilityTreeTest.AccessibilityInputDateWithPopupOpen/blink -All/DumpAccessibilityTreeTest.AccessibilityInputTypes/blink -All/DumpAccessibilityTreeTest.AccessibilityInputTypes/blink +-All/DumpAccessibilityTreeTest.AccessibilityMultiSelectable/blink -All/DumpAccessibilityTreeTest.AccessibilityOptgroupMenulist/blink -All/DumpAccessibilityTreeTest.AccessibilityOptgroupMenulist/blink -All/DumpAccessibilityTreeTest.AccessibilitySelectOpen/blink -All/DumpAccessibilityTreeTest.AccessibilitySelectOpen/blink +-All/OnScreenModeDumpAccessibilityTreeTest.ContentWith3ViewPortScrollsForOnScreenMode/blink # TODO(crbug.com/368335261): These tests have been failing since # https://crrev.com/c/5464569.
diff --git a/testing/scripts/check_static_initializers.py b/testing/scripts/check_static_initializers.py index 462cba35..0433827 100755 --- a/testing/scripts/check_static_initializers.py +++ b/testing/scripts/check_static_initializers.py
@@ -33,9 +33,9 @@ 'iostream\\.cpp : _GLOBAL__I_000100', # TODO(crbug.com/40268361): Rust stdlib argv handling. - # https://github.com/rust-lang/rust/blob/b08148f6a76010ea3d4e91d61245aa7aac59e4b4/library/std/src/sys/unix/args.rs#L107-L127 + # https://github.com/rust-lang/rust/blob/6bc57c6bf7d0024ad9ea5a2c112f3fc9c383c8a4/library/std/src/sys/args/unix.rs#L124 # https://github.com/rust-lang/rust/issues/111921 - '.* : std::sys::pal::unix::args::imp::ARGV_INIT_ARRAY::init_wrapper', + '.* : std::sys::args::unix::imp::ARGV_INIT_ARRAY::init_wrapper', # Added by libgcc due to USE_EH_FRAME_REGISTRY. 'crtstuff\\.c : frame_dummy',
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index bb010591..9edde23 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -16179,6 +16179,34 @@ ] } ], + "OmniboxOnFocusZPS": [ + { + "platforms": [ + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled_6_Suggestions", + "params": { + "OnFocusMaxSearchSuggestions": "3", + "OnFocusMaxUrlSuggestions": "3", + "OnFocusMostVisitedMaxSuggestions": "6" + }, + "enable_features": [ + "HappinessTrackingSurveyForOmniboxOnFocusZps", + "OmniboxFocusTriggersWebAndSRPZeroSuggest", + "OmniboxHideSuggestionGroupHeaders", + "OmniboxUrlSuggestionsOnFocus", + "ZeroSuggestPrefetchingOnWeb" + ] + } + ] + } + ], "OmniboxPrerender": [ { "platforms": [ @@ -25876,7 +25904,10 @@ ], "experiments": [ { - "name": "Enabled", + "name": "Enabled_for_all_frames", + "params": { + "Target": "AllFrames" + }, "enable_features": [ "VSyncAlignedPresent" ]
diff --git a/third_party/.gitignore b/third_party/.gitignore index 3e117f79..ad591b3 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore
@@ -44,6 +44,7 @@ /data_sharing_sdk /devserver /directxsdk +/dragonbox/src /edk2 /elfutils/src /espresso/lib/
diff --git a/third_party/abseil-cpp/CMake/AbseilDll.cmake b/third_party/abseil-cpp/CMake/AbseilDll.cmake index 5e92258..1a1898d2 100644 --- a/third_party/abseil-cpp/CMake/AbseilDll.cmake +++ b/third_party/abseil-cpp/CMake/AbseilDll.cmake
@@ -24,7 +24,7 @@ "base/internal/low_level_alloc.cc" "base/internal/low_level_alloc.h" "base/internal/low_level_scheduling.h" - "base/internal/nullability_impl.h" + "base/internal/nullability_deprecated.h" "base/internal/per_thread_tls.h" "base/internal/poison.cc" "base/internal/poison.h" @@ -161,6 +161,7 @@ "hash/internal/spy_hash_state.h" "hash/internal/low_level_hash.h" "hash/internal/low_level_hash.cc" + "hash/internal/weakly_mixed_integer.h" "log/absl_check.h" "log/absl_log.h" "log/absl_vlog_is_on.h"
diff --git a/third_party/abseil-cpp/MODULE.bazel b/third_party/abseil-cpp/MODULE.bazel index f8f7458..405d2c6 100644 --- a/third_party/abseil-cpp/MODULE.bazel +++ b/third_party/abseil-cpp/MODULE.bazel
@@ -25,13 +25,13 @@ dev_dependency = True) use_repo(cc_configure, "local_config_cc") -bazel_dep(name = "rules_cc", version = "0.0.17") +bazel_dep(name = "rules_cc", version = "0.1.1") bazel_dep(name = "bazel_skylib", version = "1.7.1") -bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "platforms", version = "0.0.11") bazel_dep( name = "google_benchmark", - version = "1.8.5", + version = "1.9.2", dev_dependency = True, ) @@ -39,5 +39,5 @@ # intended to be used by Abseil users depend on GoogleTest. bazel_dep( name = "googletest", - version = "1.16.0", + version = "1.16.0.bcr.1", )
diff --git a/third_party/abseil-cpp/README.chromium b/third_party/abseil-cpp/README.chromium index dfb97047..7c65eac 100644 --- a/third_party/abseil-cpp/README.chromium +++ b/third_party/abseil-cpp/README.chromium
@@ -4,7 +4,7 @@ License: Apache-2.0 License File: LICENSE Version: N/A -Revision: 300fafa291ed6ffb802fce9bb58f82cdb3e3a001 +Revision: e5e2a9de560c8190042bcf7a2425b2213c0a020f Security Critical: yes Shipped: yes
diff --git a/third_party/abseil-cpp/absl/base/BUILD.bazel b/third_party/abseil-cpp/absl/base/BUILD.bazel index 6c2a699..ed75fed 100644 --- a/third_party/abseil-cpp/absl/base/BUILD.bazel +++ b/third_party/abseil-cpp/absl/base/BUILD.bazel
@@ -82,14 +82,13 @@ cc_library( name = "nullability", - srcs = ["internal/nullability_impl.h"], + srcs = ["internal/nullability_deprecated.h"], hdrs = ["nullability.h"], copts = ABSL_DEFAULT_COPTS, linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":config", ":core_headers", - "//absl/meta:type_traits", ], )
diff --git a/third_party/abseil-cpp/absl/base/BUILD.gn b/third_party/abseil-cpp/absl/base/BUILD.gn index d1db41ba..6f581bf 100644 --- a/third_party/abseil-cpp/absl/base/BUILD.gn +++ b/third_party/abseil-cpp/absl/base/BUILD.gn
@@ -37,12 +37,11 @@ } absl_source_set("nullability") { - sources = [ "internal/nullability_impl.h" ] + sources = [ "internal/nullability_deprecated.h" ] public = [ "nullability.h" ] deps = [ ":config", ":core_headers", - "//third_party/abseil-cpp/absl/meta:type_traits", ] }
diff --git a/third_party/abseil-cpp/absl/base/CMakeLists.txt b/third_party/abseil-cpp/absl/base/CMakeLists.txt index 0198e63f..74df271 100644 --- a/third_party/abseil-cpp/absl/base/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/base/CMakeLists.txt
@@ -73,11 +73,10 @@ HDRS "nullability.h" SRCS - "internal/nullability_impl.h" + "internal/nullability_deprecated.h" DEPS absl::config absl::core_headers - absl::type_traits COPTS ${ABSL_DEFAULT_COPTS} )
diff --git a/third_party/abseil-cpp/absl/base/attributes.h b/third_party/abseil-cpp/absl/base/attributes.h index 300a138..d009f6d 100644 --- a/third_party/abseil-cpp/absl/base/attributes.h +++ b/third_party/abseil-cpp/absl/base/attributes.h
@@ -339,9 +339,9 @@ #ifndef ABSL_ATTRIBUTE_SECTION_VARIABLE #ifdef _AIX // __attribute__((section(#name))) on AIX is achieved by using the `.csect` -// psudo op which includes an additional integer as part of its syntax indcating -// alignment. If data fall under different alignments then you might get a -// compilation error indicating a `Section type conflict`. +// pseudo op which includes an additional integer as part of its syntax +// indicating alignment. If data fall under different alignments then you might +// get a compilation error indicating a `Section type conflict`. #define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) #else #define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) __attribute__((section(#name)))
diff --git a/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h b/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h new file mode 100644 index 0000000..b6405f1 --- /dev/null +++ b/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h
@@ -0,0 +1,106 @@ +// Copyright 2023 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef ABSL_BASE_INTERNAL_NULLABILITY_DEPRECATED_H_ +#define ABSL_BASE_INTERNAL_NULLABILITY_DEPRECATED_H_ + +#include "absl/base/attributes.h" +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace nullability_internal { + +template <typename T> +using NullableImpl +#if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) + [[clang::annotate("Nullable")]] +#endif +// Don't add the _Nullable attribute in Objective-C compiles. Many Objective-C +// projects enable the `-Wnullable-to-nonnull-conversion warning`, which is +// liable to produce false positives. +#if ABSL_HAVE_FEATURE(nullability_on_classes) && !defined(__OBJC__) + = T _Nullable; +#else + = T; +#endif + +template <typename T> +using NonnullImpl +#if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) + [[clang::annotate("Nonnull")]] +#endif +#if ABSL_HAVE_FEATURE(nullability_on_classes) && !defined(__OBJC__) + = T _Nonnull; +#else + = T; +#endif + +template <typename T> +using NullabilityUnknownImpl +#if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) + [[clang::annotate("Nullability_Unspecified")]] +#endif +#if ABSL_HAVE_FEATURE(nullability_on_classes) && !defined(__OBJC__) + = T _Null_unspecified; +#else + = T; +#endif + +} // namespace nullability_internal + +// The following template aliases are deprecated forms of nullability +// annotations. They have some limitations, for example, an incompatibility with +// `auto*` pointers, as `auto` cannot be used in a template argument. +// +// It is important to note that these annotations are not distinct strong +// *types*. They are alias templates defined to be equal to the underlying +// pointer type. A pointer annotated `Nonnull<T*>`, for example, is simply a +// pointer of type `T*`. +// +// Prefer the macro style annotations in `absl/base/nullability.h` instead. + +// absl::Nonnull, analogous to absl_nonnull +// +// Example: +// absl::Nonnull<int*> foo; +// Is equivalent to: +// int* absl_nonnull foo; +template <typename T> +using Nonnull = + nullability_internal::NonnullImpl<T>; + +// absl::Nullable, analogous to absl_nullable +// +// Example: +// absl::Nullable<int*> foo; +// Is equivalent to: +// int* absl_nullable foo; +template <typename T> +using Nullable = + nullability_internal::NullableImpl<T>; + +// absl::NullabilityUnknown, analogous to absl_nullability_unknown +// +// Example: +// absl::NullabilityUnknown<int*> foo; +// Is equivalent to: +// int* absl_nullability_unknown foo; +template <typename T> +using NullabilityUnknown = + nullability_internal::NullabilityUnknownImpl<T>; + +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_BASE_INTERNAL_NULLABILITY_DEPRECATED_H_
diff --git a/third_party/abseil-cpp/absl/base/internal/nullability_impl.h b/third_party/abseil-cpp/absl/base/internal/nullability_impl.h deleted file mode 100644 index b601fc4ce..0000000 --- a/third_party/abseil-cpp/absl/base/internal/nullability_impl.h +++ /dev/null
@@ -1,69 +0,0 @@ -// Copyright 2023 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_BASE_INTERNAL_NULLABILITY_IMPL_H_ -#define ABSL_BASE_INTERNAL_NULLABILITY_IMPL_H_ - -#include <memory> -#include <type_traits> - -#include "absl/base/attributes.h" -#include "absl/base/config.h" -#include "absl/meta/type_traits.h" - -namespace absl { -ABSL_NAMESPACE_BEGIN -namespace nullability_internal { - -template <typename T> -using NullableImpl -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) - [[clang::annotate("Nullable")]] -#endif -// Don't add the _Nullable attribute in Objective-C compiles. Many Objective-C -// projects enable the `-Wnullable-to-nonnull-conversion warning`, which is -// liable to produce false positives. -#if ABSL_HAVE_FEATURE(nullability_on_classes) && !defined(__OBJC__) - = T _Nullable; -#else - = T; -#endif - -template <typename T> -using NonnullImpl -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) - [[clang::annotate("Nonnull")]] -#endif -#if ABSL_HAVE_FEATURE(nullability_on_classes) && !defined(__OBJC__) - = T _Nonnull; -#else - = T; -#endif - -template <typename T> -using NullabilityUnknownImpl -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) - [[clang::annotate("Nullability_Unspecified")]] -#endif -#if ABSL_HAVE_FEATURE(nullability_on_classes) && !defined(__OBJC__) - = T _Null_unspecified; -#else - = T; -#endif - -} // namespace nullability_internal -ABSL_NAMESPACE_END -} // namespace absl - -#endif // ABSL_BASE_INTERNAL_NULLABILITY_IMPL_H_
diff --git a/third_party/abseil-cpp/absl/base/internal/sysinfo_test.cc b/third_party/abseil-cpp/absl/base/internal/sysinfo_test.cc index f305b6c..c2b59aa 100644 --- a/third_party/abseil-cpp/absl/base/internal/sysinfo_test.cc +++ b/third_party/abseil-cpp/absl/base/internal/sysinfo_test.cc
@@ -41,7 +41,7 @@ EXPECT_EQ(GetTID(), GetTID()); // Basic compile and equality test. #ifdef __native_client__ // Native Client has a race condition bug that leads to memory - // exaustion when repeatedly creating and joining threads. + // exhaustion when repeatedly creating and joining threads. // https://bugs.chromium.org/p/nativeclient/issues/detail?id=1027 return; #endif
diff --git a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h index 965c42d..bfd9887 100644 --- a/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +++ b/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
@@ -88,9 +88,14 @@ #elif defined(__aarch64__) // System timer of ARMv8 runs at a different frequency than the CPU's. -// The frequency is fixed, typically in the range 1-50MHz. It can be -// read at CNTFRQ special register. We assume the OS has set up -// the virtual timer properly. +// +// Frequency is fixed. From Armv8.6-A and Armv9.1-A on, the frequency is 1GHz. +// Pre-Armv8.6-A, the frequency was a system design choice, typically in the +// range of 1MHz to 50MHz. See also: +// https://developer.arm.com/documentation/102379/0101/What-is-the-Generic-Timer- +// +// It can be read at CNTFRQ special register. We assume the OS has set up the +// virtual timer properly. inline int64_t UnscaledCycleClock::Now() { int64_t virtual_timer_value; asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
diff --git a/third_party/abseil-cpp/absl/base/nullability.h b/third_party/abseil-cpp/absl/base/nullability.h index d11da57..3a5d6e8 100644 --- a/third_party/abseil-cpp/absl/base/nullability.h +++ b/third_party/abseil-cpp/absl/base/nullability.h
@@ -86,6 +86,9 @@ // // A non-null function pointer. // void (*absl_nonnull func)(int, double); // +// // A non-null array of `Employee`s as a parameter. +// void func(Employee employees[absl_nonnull]); +// // // A non-null std::unique_ptr to an `Employee`. // // As with `const`, it is possible to place the annotation on either side of // // a named type not ending in `*`, but placing it before the type it @@ -181,7 +184,7 @@ #define ABSL_BASE_NULLABILITY_H_ #include "absl/base/config.h" -#include "absl/base/internal/nullability_impl.h" +#include "absl/base/internal/nullability_deprecated.h" // ABSL_POINTERS_DEFAULT_NONNULL // @@ -312,46 +315,4 @@ #define ABSL_NULLABILITY_COMPATIBLE #endif -namespace absl { -ABSL_NAMESPACE_BEGIN - -// The following template aliases are alternate forms of the macro annotations -// above. They have some limitations, for example, an incompatibility with -// `auto*` pointers, as `auto` cannot be used in a template argument. -// -// It is important to note that these annotations are not distinct strong -// *types*. They are alias templates defined to be equal to the underlying -// pointer type. A pointer annotated `Nonnull<T*>`, for example, is simply a -// pointer of type `T*`. - -// absl::Nonnull, analogous to absl_nonnull -// -// Example: -// absl::Nonnull<int*> foo; -// Is equivalent to: -// int* absl_nonnull foo; -template <typename T> -using Nonnull = nullability_internal::NonnullImpl<T>; - -// absl::Nullable, analogous to absl_nullable -// -// Example: -// absl::Nullable<int*> foo; -// Is equivalent to: -// int* absl_nullable foo; -template <typename T> -using Nullable = nullability_internal::NullableImpl<T>; - -// absl::NullabilityUnknown, analogous to absl_nullability_unknown -// -// Example: -// absl::NullabilityUnknown<int*> foo; -// Is equivalent to: -// int* absl_nullability_unknown foo; -template <typename T> -using NullabilityUnknown = nullability_internal::NullabilityUnknownImpl<T>; - -ABSL_NAMESPACE_END -} // namespace absl - #endif // ABSL_BASE_NULLABILITY_H_
diff --git a/third_party/abseil-cpp/absl/base/nullability_test.cc b/third_party/abseil-cpp/absl/base/nullability_test.cc index b4a22e8..bccc388 100644 --- a/third_party/abseil-cpp/absl/base/nullability_test.cc +++ b/third_party/abseil-cpp/absl/base/nullability_test.cc
@@ -20,6 +20,7 @@ #include <utility> #include "gtest/gtest.h" +#include "absl/base/attributes.h" namespace { namespace macro_annotations { @@ -91,6 +92,9 @@ } } // namespace macro_annotations +// Allow testing of the deprecated type alias annotations. +ABSL_INTERNAL_DISABLE_DEPRECATED_DECLARATION_WARNING + using ::absl::Nonnull; using ::absl::NullabilityUnknown; using ::absl::Nullable; @@ -197,4 +201,6 @@ EXPECT_TRUE(DidAdlWin((util::MakeAdlWin*)nullptr)); EXPECT_TRUE(DidAdlWin((Nullable<util::MakeAdlWin*>)nullptr)); } + +ABSL_INTERNAL_RESTORE_DEPRECATED_DECLARATION_WARNING } // namespace
diff --git a/third_party/abseil-cpp/absl/base/raw_logging_test.cc b/third_party/abseil-cpp/absl/base/raw_logging_test.cc index 03a88ff..f4f3445d 100644 --- a/third_party/abseil-cpp/absl/base/raw_logging_test.cc +++ b/third_party/abseil-cpp/absl/base/raw_logging_test.cc
@@ -43,12 +43,27 @@ ABSL_RAW_CHECK(true, "RAW CHECK"); } +TEST(RawLoggingCompilationTest, DebugLog) { + ABSL_RAW_DLOG(INFO, "RAW DLOG: %d", 1); +} + +TEST(RawLoggingCompilationTest, PassingDebugCheck) { + ABSL_RAW_DCHECK(true, "failure message"); +} + // Not all platforms support output from raw log, so we don't verify any // particular output for RAW check failures (expecting the empty string // accomplishes this). This test is primarily a compilation test, but we // are verifying process death when EXPECT_DEATH works for a platform. const char kExpectedDeathOutput[] = ""; +#if !defined(NDEBUG) // if debug build +TEST(RawLoggingDeathTest, FailingDebugCheck) { + EXPECT_DEATH_IF_SUPPORTED(ABSL_RAW_DCHECK(1 == 0, "explanation"), + kExpectedDeathOutput); +} +#endif // if debug build + TEST(RawLoggingDeathTest, FailingCheck) { EXPECT_DEATH_IF_SUPPORTED(ABSL_RAW_CHECK(1 == 0, "explanation"), kExpectedDeathOutput);
diff --git a/third_party/abseil-cpp/absl/container/BUILD.bazel b/third_party/abseil-cpp/absl/container/BUILD.bazel index 768b8ab..91f930a 100644 --- a/third_party/abseil-cpp/absl/container/BUILD.bazel +++ b/third_party/abseil-cpp/absl/container/BUILD.bazel
@@ -72,6 +72,7 @@ "//absl/base:dynamic_annotations", "//absl/base:iterator_traits_internal", "//absl/base:throw_delegate", + "//absl/hash:weakly_mixed_integer", "//absl/memory", ], ) @@ -148,6 +149,7 @@ "//absl/base:core_headers", "//absl/base:iterator_traits_internal", "//absl/base:throw_delegate", + "//absl/hash:weakly_mixed_integer", "//absl/memory", "//absl/meta:type_traits", ], @@ -740,6 +742,7 @@ "//absl/base:raw_logging_internal", "//absl/functional:function_ref", "//absl/hash", + "//absl/hash:weakly_mixed_integer", "//absl/memory", "//absl/meta:type_traits", "//absl/numeric:bits", @@ -1086,6 +1089,7 @@ "//absl/base:core_headers", "//absl/base:raw_logging_internal", "//absl/base:throw_delegate", + "//absl/hash:weakly_mixed_integer", "//absl/memory", "//absl/meta:type_traits", "//absl/strings",
diff --git a/third_party/abseil-cpp/absl/container/BUILD.gn b/third_party/abseil-cpp/absl/container/BUILD.gn index e4132352..8702f4d 100644 --- a/third_party/abseil-cpp/absl/container/BUILD.gn +++ b/third_party/abseil-cpp/absl/container/BUILD.gn
@@ -19,6 +19,7 @@ "//third_party/abseil-cpp/absl/base:dynamic_annotations", "//third_party/abseil-cpp/absl/base:iterator_traits_internal", "//third_party/abseil-cpp/absl/base:throw_delegate", + "//third_party/abseil-cpp/absl/hash:weakly_mixed_integer", "//third_party/abseil-cpp/absl/memory", ] } @@ -58,6 +59,7 @@ "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/base:iterator_traits_internal", "//third_party/abseil-cpp/absl/base:throw_delegate", + "//third_party/abseil-cpp/absl/hash:weakly_mixed_integer", "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/meta:type_traits", ] @@ -434,6 +436,7 @@ "//third_party/abseil-cpp/absl/base:raw_logging_internal", "//third_party/abseil-cpp/absl/functional:function_ref", "//third_party/abseil-cpp/absl/hash", + "//third_party/abseil-cpp/absl/hash:weakly_mixed_integer", "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/numeric:bits", @@ -592,6 +595,7 @@ "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/base:raw_logging_internal", "//third_party/abseil-cpp/absl/base:throw_delegate", + "//third_party/abseil-cpp/absl/hash:weakly_mixed_integer", "//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/strings:cord",
diff --git a/third_party/abseil-cpp/absl/container/CMakeLists.txt b/third_party/abseil-cpp/absl/container/CMakeLists.txt index 66fe405..70f78c4 100644 --- a/third_party/abseil-cpp/absl/container/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/container/CMakeLists.txt
@@ -41,6 +41,7 @@ absl::strings absl::throw_delegate absl::type_traits + absl::weakly_mixed_integer ) # Internal-only target, do not depend on directly. @@ -134,6 +135,7 @@ absl::iterator_traits_internal absl::throw_delegate absl::memory + absl::weakly_mixed_integer PUBLIC ) @@ -202,6 +204,7 @@ absl::throw_delegate absl::memory absl::type_traits + absl::weakly_mixed_integer PUBLIC ) @@ -790,6 +793,7 @@ absl::prefetch absl::raw_logging_internal absl::utility + absl::weakly_mixed_integer PUBLIC )
diff --git a/third_party/abseil-cpp/absl/container/fixed_array.h b/third_party/abseil-cpp/absl/container/fixed_array.h index 8bf8e6c..6c238fc 100644 --- a/third_party/abseil-cpp/absl/container/fixed_array.h +++ b/third_party/abseil-cpp/absl/container/fixed_array.h
@@ -50,6 +50,7 @@ #include "absl/base/optimization.h" #include "absl/base/port.h" #include "absl/container/internal/compressed_tuple.h" +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/memory/memory.h" namespace absl { @@ -392,7 +393,7 @@ template <typename H> friend H AbslHashValue(H h, const FixedArray& v) { return H::combine(H::combine_contiguous(std::move(h), v.data(), v.size()), - v.size()); + hash_internal::WeaklyMixedInteger{v.size()}); } private:
diff --git a/third_party/abseil-cpp/absl/container/inlined_vector.h b/third_party/abseil-cpp/absl/container/inlined_vector.h index 318d654d..f871b349 100644 --- a/third_party/abseil-cpp/absl/container/inlined_vector.h +++ b/third_party/abseil-cpp/absl/container/inlined_vector.h
@@ -53,6 +53,7 @@ #include "absl/base/optimization.h" #include "absl/base/port.h" #include "absl/container/internal/inlined_vector.h" +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/memory/memory.h" #include "absl/meta/type_traits.h" @@ -1008,7 +1009,8 @@ template <typename H, typename T, size_t N, typename A> H AbslHashValue(H h, const absl::InlinedVector<T, N, A>& a) { auto size = a.size(); - return H::combine(H::combine_contiguous(std::move(h), a.data(), size), size); + return H::combine(H::combine_contiguous(std::move(h), a.data(), size), + hash_internal::WeaklyMixedInteger{size}); } ABSL_NAMESPACE_END
diff --git a/third_party/abseil-cpp/absl/container/internal/btree_container.h b/third_party/abseil-cpp/absl/container/internal/btree_container.h index 5e2abb2..21f00ae 100644 --- a/third_party/abseil-cpp/absl/container/internal/btree_container.h +++ b/third_party/abseil-cpp/absl/container/internal/btree_container.h
@@ -25,6 +25,7 @@ #include "absl/base/internal/throw_delegate.h" #include "absl/container/internal/btree.h" // IWYU pragma: export #include "absl/container/internal/common.h" +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/memory/memory.h" #include "absl/meta/type_traits.h" @@ -267,7 +268,8 @@ for (const auto &v : b) { h = State::combine(std::move(h), v); } - return State::combine(std::move(h), b.size()); + return State::combine(std::move(h), + hash_internal::WeaklyMixedInteger{b.size()}); } protected:
diff --git a/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc b/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc index 6d61872..adba8b17 100644 --- a/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc +++ b/third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc
@@ -466,7 +466,7 @@ // Initializes control bytes for growing after SOO to the next capacity. // `soo_ctrl` is placed in the position `SooSlotIndex()`. -// `new_hash` is placed in the postion `new_offset`. +// `new_hash` is placed in the position `new_offset`. // The table must be non-empty SOO. ABSL_ATTRIBUTE_ALWAYS_INLINE inline void InitializeThreeElementsControlBytesAfterSoo(ctrl_t soo_ctrl, size_t new_hash,
diff --git a/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h b/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h index 2ca8fba..b22f817 100644 --- a/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h +++ b/third_party/abseil-cpp/absl/container/internal/raw_hash_set.h
@@ -214,6 +214,7 @@ #include "absl/container/internal/hashtablez_sampler.h" #include "absl/functional/function_ref.h" #include "absl/hash/hash.h" +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/memory/memory.h" #include "absl/meta/type_traits.h" #include "absl/numeric/bits.h" @@ -2985,7 +2986,7 @@ H>::type AbslHashValue(H h, const raw_hash_set& s) { return H::combine(H::combine_unordered(std::move(h), s.begin(), s.end()), - s.size()); + hash_internal::WeaklyMixedInteger{s.size()}); } friend void swap(raw_hash_set& a,
diff --git a/third_party/abseil-cpp/absl/container/internal/raw_hash_set_probe_benchmark.cc b/third_party/abseil-cpp/absl/container/internal/raw_hash_set_probe_benchmark.cc index 8f36305..e56648f3 100644 --- a/third_party/abseil-cpp/absl/container/internal/raw_hash_set_probe_benchmark.cc +++ b/third_party/abseil-cpp/absl/container/internal/raw_hash_set_probe_benchmark.cc
@@ -245,13 +245,28 @@ } }; -constexpr char kStringFormat[] = "/path/to/file/name-%07d-of-9999999.txt"; +enum class StringSize { kSmall, kMedium, kLarge, kExtraLarge }; +constexpr char kStringFormat[] = "%s/name-%07d-of-9999999.txt"; -template <bool small> +template <StringSize size> struct String { std::string value; static std::string Make(uint32_t v) { - return {small ? absl::StrCat(v) : absl::StrFormat(kStringFormat, v)}; + switch (size) { + case StringSize::kSmall: + return absl::StrCat(v); + case StringSize::kMedium: // < 32 bytes + return absl::StrFormat(kStringFormat, "/path", v); + case StringSize::kLarge: // 33-64 bytes + return absl::StrFormat(kStringFormat, "/path/to/file", v); + case StringSize::kExtraLarge: // > 64 bytes + return absl::StrFormat(kStringFormat, + "/path/to/a/very/long/file/name/so/that/total/" + "length/is/larger/than/64/bytes", + v); + default: + return ""; + } } }; @@ -285,10 +300,9 @@ mutable uintptr_t current = PointerForAlignment<Align>(); }; - -template <bool small> -struct Sequential<String<small>> { - std::string operator()() const { return String<small>::Make(current++); } +template <StringSize size> +struct Sequential<String<size>> { + std::string operator()() const { return String<size>::Make(current++); } mutable uint32_t current = 0; }; @@ -389,10 +403,10 @@ } }; -template <class Dist, bool small> -struct Random<String<small>, Dist> { +template <class Dist, StringSize size> +struct Random<String<size>, Dist> { std::string operator()() const { - return String<small>::Make(Random<uint32_t, Dist>{}()); + return String<size>::Make(Random<uint32_t, Dist>{}()); } }; @@ -421,9 +435,20 @@ return absl::StrCat("PtrIdentity", Align); } -template <bool small> -std::string Name(String<small>*) { - return small ? "StrS" : "StrL"; +template <StringSize size> +std::string Name(String<size>*) { + switch (size) { + case StringSize::kSmall: + return "StrS"; + case StringSize::kMedium: + return "StrM"; + case StringSize::kLarge: + return "StrL"; + case StringSize::kExtraLarge: + return "StrXL"; + default: + return ""; + } } template <class T, class U> @@ -543,12 +568,18 @@ RunForType<PtrIdentity<32>>(results); RunForType<PtrIdentity<64>>(results); RunForType<std::pair<uint32_t, uint32_t>>(results); - RunForType<String<true>>(results); - RunForType<String<false>>(results); - RunForType<std::pair<uint64_t, String<true>>>(results); - RunForType<std::pair<String<true>, uint64_t>>(results); - RunForType<std::pair<uint64_t, String<false>>>(results); - RunForType<std::pair<String<false>, uint64_t>>(results); + RunForType<String<StringSize::kSmall>>(results); + RunForType<String<StringSize::kMedium>>(results); + RunForType<String<StringSize::kLarge>>(results); + RunForType<String<StringSize::kExtraLarge>>(results); + RunForType<std::pair<uint64_t, String<StringSize::kSmall>>>(results); + RunForType<std::pair<String<StringSize::kSmall>, uint64_t>>(results); + RunForType<std::pair<uint64_t, String<StringSize::kMedium>>>(results); + RunForType<std::pair<String<StringSize::kMedium>, uint64_t>>(results); + RunForType<std::pair<uint64_t, String<StringSize::kLarge>>>(results); + RunForType<std::pair<String<StringSize::kLarge>, uint64_t>>(results); + RunForType<std::pair<uint64_t, String<StringSize::kExtraLarge>>>(results); + RunForType<std::pair<String<StringSize::kExtraLarge>, uint64_t>>(results); switch (output()) { case OutputStyle::kRegular:
diff --git a/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc b/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc index a98ca81..9836c93 100644 --- a/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc +++ b/third_party/abseil-cpp/absl/debugging/symbolize_elf.inc
@@ -125,12 +125,20 @@ // Some platforms use a special .opd section to store function pointers. const char kOpdSectionName[] = ".opd"; -#if (defined(__powerpc__) && !(_CALL_ELF > 1)) || defined(__ia64) +#if defined(__powerpc64__) && defined(_CALL_ELF) +#if _CALL_ELF <= 1 +#define ABSL_INTERNAL_HAVE_PPC64_ELFV1_ABI 1 +#endif +#endif +#if defined(ABSL_INTERNAL_HAVE_PPC64_ELFV1_ABI) || defined(__ia64) // Use opd section for function descriptors on these platforms, the function // address is the first word of the descriptor. -enum { kPlatformUsesOPDSections = 1 }; -#else // not PPC or IA64 -enum { kPlatformUsesOPDSections = 0 }; +// +// https://maskray.me/blog/2023-02-26-linker-notes-on-power-isa notes that +// opd sections are used on 64-bit PowerPC with the ELFv1 ABI. +inline constexpr bool kPlatformUsesOPDSections = true; +#else +inline constexpr bool kPlatformUsesOPDSections = false; #endif // This works for PowerPC & IA64 only. A function descriptor consist of two @@ -1451,11 +1459,11 @@ } phoff += phentsize; -#if defined(__powerpc__) && !(_CALL_ELF > 1) - // On the PowerPC ELF v1 ABI, function pointers actually point to function - // descriptors. These descriptors are stored in an .opd section, which is - // mapped read-only. We thus need to look at all readable segments, not - // just the executable ones. +#ifdef ABSL_INTERNAL_HAVE_PPC64_ELFV1_ABI + // On the PowerPC 64-bit ELFv1 ABI, function pointers actually point to + // function descriptors. These descriptors are stored in an .opd section, + // which is mapped read-only. We thus need to look at all readable + // segments, not just the executable ones. constexpr int interesting = PF_R; #else constexpr int interesting = PF_X | PF_R; @@ -1762,3 +1770,5 @@ return absl::debugging_internal::GetFileMappingHint(start, end, offset, filename); } + +#undef ABSL_INTERNAL_HAVE_PPC64_ELFV1_ABI
diff --git a/third_party/abseil-cpp/absl/functional/function_ref.h b/third_party/abseil-cpp/absl/functional/function_ref.h index 0b8c402..f1d087a 100644 --- a/third_party/abseil-cpp/absl/functional/function_ref.h +++ b/third_party/abseil-cpp/absl/functional/function_ref.h
@@ -82,10 +82,6 @@ // // replaced by an `absl::FunctionRef`: // bool Visitor(absl::FunctionRef<void(my_proto&, absl::string_view)> // callback); -// -// Note: the assignment operator within an `absl::FunctionRef` is intentionally -// deleted to prevent misuse; because the `absl::FunctionRef` does not own the -// underlying type, assignment likely indicates misuse. template <typename R, typename... Args> class FunctionRef<R(Args...)> { private: @@ -121,9 +117,7 @@ ptr_.fun = reinterpret_cast<decltype(ptr_.fun)>(f); } - // To help prevent subtle lifetime bugs, FunctionRef is not assignable. - // Typically, it should only be used as an argument type. - FunctionRef& operator=(const FunctionRef& rhs) = delete; + FunctionRef& operator=(const FunctionRef& rhs) = default; FunctionRef(const FunctionRef& rhs) = default; // Call the underlying object.
diff --git a/third_party/abseil-cpp/absl/functional/function_ref_test.cc b/third_party/abseil-cpp/absl/functional/function_ref_test.cc index c0211135..98d11f7 100644 --- a/third_party/abseil-cpp/absl/functional/function_ref_test.cc +++ b/third_party/abseil-cpp/absl/functional/function_ref_test.cc
@@ -52,6 +52,16 @@ EXPECT_EQ(1337, ref()); } +TEST(FunctionRefTest, CopyAssignment) { + FunctionRef<int()> a = +[]() -> int { + ADD_FAILURE() << "Unexpectedly called"; + return 0; + }; + FunctionRef<int()> b = +[] { return 1337; }; + a = b; + EXPECT_EQ(1337, a()); +} + int NoExceptFunction() noexcept { return 1337; } // TODO(jdennett): Add a test for noexcept member functions.
diff --git a/third_party/abseil-cpp/absl/hash/BUILD.bazel b/third_party/abseil-cpp/absl/hash/BUILD.bazel index 30f78d4..b2ffcd08 100644 --- a/third_party/abseil-cpp/absl/hash/BUILD.bazel +++ b/third_party/abseil-cpp/absl/hash/BUILD.bazel
@@ -44,6 +44,7 @@ deps = [ ":city", ":low_level_hash", + ":weakly_mixed_integer", "//absl/base:config", "//absl/base:core_headers", "//absl/base:endian", @@ -151,6 +152,7 @@ visibility = ["//visibility:private"], deps = [ ":hash", + ":weakly_mixed_integer", "//absl/strings", "//absl/strings:str_format", ], @@ -199,6 +201,21 @@ ], ) +cc_library( + name = "weakly_mixed_integer", + hdrs = ["internal/weakly_mixed_integer.h"], + copts = ABSL_DEFAULT_COPTS, + linkopts = ABSL_DEFAULT_LINKOPTS, + visibility = [ + "//absl/container:__pkg__", + "//absl/strings:__pkg__", + "//absl/types:__pkg__", + ], + deps = [ + "//absl/base:config", + ], +) + cc_test( name = "low_level_hash_test", srcs = ["internal/low_level_hash_test.cc"],
diff --git a/third_party/abseil-cpp/absl/hash/BUILD.gn b/third_party/abseil-cpp/absl/hash/BUILD.gn index 83d469c..d160370 100644 --- a/third_party/abseil-cpp/absl/hash/BUILD.gn +++ b/third_party/abseil-cpp/absl/hash/BUILD.gn
@@ -14,6 +14,7 @@ deps = [ ":city", ":low_level_hash", + ":weakly_mixed_integer", "//third_party/abseil-cpp/absl/base:config", "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/base:endian", @@ -85,6 +86,7 @@ public = [ "internal/spy_hash_state.h" ] deps = [ ":hash", + ":weakly_mixed_integer", "//third_party/abseil-cpp/absl/strings", "//third_party/abseil-cpp/absl/strings:str_format", ] @@ -114,6 +116,12 @@ visibility = [ ":*" ] } +absl_source_set("weakly_mixed_integer") { + public = [ "internal/weakly_mixed_integer.h" ] + visibility = [ "//third_party/abseil-cpp/absl/*" ] + deps = [ "//third_party/abseil-cpp/absl/base:config" ] +} + absl_test("low_level_hash_test") { sources = [ "internal/low_level_hash_test.cc" ] deps = [
diff --git a/third_party/abseil-cpp/absl/hash/CMakeLists.txt b/third_party/abseil-cpp/absl/hash/CMakeLists.txt index cc46aab1..6996d930 100644 --- a/third_party/abseil-cpp/absl/hash/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/hash/CMakeLists.txt
@@ -39,6 +39,7 @@ absl::variant absl::utility absl::low_level_hash + absl::weakly_mixed_integer PUBLIC ) @@ -119,6 +120,7 @@ absl::hash absl::strings absl::str_format + absl::weakly_mixed_integer TESTONLY PUBLIC ) @@ -169,6 +171,18 @@ absl::prefetch ) +# Internal-only target, do not depend on directly. +absl_cc_library( + NAME + weakly_mixed_integer + HDRS + "internal/weakly_mixed_integer.h" + COPTS + ${ABSL_DEFAULT_COPTS} + DEPS + absl::config +) + absl_cc_test( NAME low_level_hash_test
diff --git a/third_party/abseil-cpp/absl/hash/hash.h b/third_party/abseil-cpp/absl/hash/hash.h index 479b17b..23f4e9d3 100644 --- a/third_party/abseil-cpp/absl/hash/hash.h +++ b/third_party/abseil-cpp/absl/hash/hash.h
@@ -87,6 +87,7 @@ #include "absl/base/config.h" #include "absl/functional/function_ref.h" #include "absl/hash/internal/hash.h" +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/meta/type_traits.h" namespace absl { @@ -356,6 +357,12 @@ hash_state.combine_contiguous_(hash_state.state_, first, size); return hash_state; } + + static HashState combine_weakly_mixed_integer( + HashState hash_state, hash_internal::WeaklyMixedInteger value) { + hash_state.combine_weakly_mixed_integer_(hash_state.state_, value); + return hash_state; + } using HashState::HashStateBase::combine_contiguous; private: @@ -371,6 +378,13 @@ state = T::combine_contiguous(std::move(state), first, size); } + template <typename T> + static void CombineWeaklyMixedIntegerImpl( + void* p, hash_internal::WeaklyMixedInteger value) { + T& state = *static_cast<T*>(p); + state = T::combine_weakly_mixed_integer(std::move(state), value); + } + static HashState combine_raw(HashState hash_state, uint64_t value) { hash_state.combine_raw_(hash_state.state_, value); return hash_state; @@ -385,6 +399,7 @@ template <typename T> void Init(T* state) { state_ = state; + combine_weakly_mixed_integer_ = &CombineWeaklyMixedIntegerImpl<T>; combine_contiguous_ = &CombineContiguousImpl<T>; combine_raw_ = &CombineRawImpl<T>; run_combine_unordered_ = &RunCombineUnorderedImpl<T>; @@ -424,6 +439,7 @@ // Do not erase an already erased state. void Init(HashState* state) { state_ = state->state_; + combine_weakly_mixed_integer_ = state->combine_weakly_mixed_integer_; combine_contiguous_ = state->combine_contiguous_; combine_raw_ = state->combine_raw_; run_combine_unordered_ = state->run_combine_unordered_; @@ -435,6 +451,8 @@ } void* state_; + void (*combine_weakly_mixed_integer_)( + void*, absl::hash_internal::WeaklyMixedInteger); void (*combine_contiguous_)(void*, const unsigned char*, size_t); void (*combine_raw_)(void*, uint64_t); HashState (*run_combine_unordered_)(
diff --git a/third_party/abseil-cpp/absl/hash/hash_instantiated_test.cc b/third_party/abseil-cpp/absl/hash/hash_instantiated_test.cc index e65de9c..f0df86f 100644 --- a/third_party/abseil-cpp/absl/hash/hash_instantiated_test.cc +++ b/third_party/abseil-cpp/absl/hash/hash_instantiated_test.cc
@@ -51,7 +51,7 @@ // Dummy type with unordered equality and hashing semantics. This preserves // input order internally, and is used below to ensure we get test coverage -// for equal sequences with different iteraton orders. +// for equal sequences with different iteration orders. template <typename T> class UnorderedSequence { public:
diff --git a/third_party/abseil-cpp/absl/hash/hash_test.cc b/third_party/abseil-cpp/absl/hash/hash_test.cc index b751a16..c3182f1 100644 --- a/third_party/abseil-cpp/absl/hash/hash_test.cc +++ b/third_party/abseil-cpp/absl/hash/hash_test.cc
@@ -191,9 +191,8 @@ // Limit the scope to the bits we would be using for Swisstable. constexpr size_t kMask = (1 << (kLog2NumValues + 7)) - 1; size_t stuck_bits = (~bits_or | bits_and) & kMask; - // Test that there are at most 2 stuck bits. Sometimes we see stuck_bits - // of 0x3. - EXPECT_LE(absl::popcount(stuck_bits), 2) << "0x" << std::hex << stuck_bits; + // Test that there are at most 3 stuck bits. + EXPECT_LE(absl::popcount(stuck_bits), 3) << "0x" << std::hex << stuck_bits; } } @@ -1224,4 +1223,20 @@ TypeErasedHashStateUser{1, s})); } +struct AutoReturnTypeUser { + int a; + std::string b; + + template <typename H> + friend auto AbslHashValue(H state, const AutoReturnTypeUser& value) { + return H::combine(std::move(state), value.a, value.b); + } +}; + +TEST(HashOf, AutoReturnTypeUser) { + std::string s = "s"; + EXPECT_EQ(absl::HashOf(1, s), + absl::Hash<AutoReturnTypeUser>{}(AutoReturnTypeUser{1, s})); +} + } // namespace
diff --git a/third_party/abseil-cpp/absl/hash/hash_testing.h b/third_party/abseil-cpp/absl/hash/hash_testing.h index 207dfaf..817a40d 100644 --- a/third_party/abseil-cpp/absl/hash/hash_testing.h +++ b/third_party/abseil-cpp/absl/hash/hash_testing.h
@@ -15,7 +15,9 @@ #ifndef ABSL_HASH_HASH_TESTING_H_ #define ABSL_HASH_HASH_TESTING_H_ +#include <cstddef> #include <initializer_list> +#include <string> #include <tuple> #include <type_traits> #include <vector>
diff --git a/third_party/abseil-cpp/absl/hash/internal/hash.h b/third_party/abseil-cpp/absl/hash/internal/hash.h index 3a34bde..c1b1f66 100644 --- a/third_party/abseil-cpp/absl/hash/internal/hash.h +++ b/third_party/abseil-cpp/absl/hash/internal/hash.h
@@ -24,6 +24,8 @@ #include <TargetConditionals.h> #endif +// We include config.h here to make sure that ABSL_INTERNAL_CPLUSPLUS_LANG is +// defined. #include "absl/base/config.h" // For feature testing and determining which headers can be included. @@ -65,7 +67,7 @@ #include "absl/base/port.h" #include "absl/container/fixed_array.h" #include "absl/hash/internal/city.h" -#include "absl/hash/internal/low_level_hash.h" +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/meta/type_traits.h" #include "absl/numeric/bits.h" #include "absl/numeric/int128.h" @@ -394,6 +396,11 @@ return H::combine_contiguous(std::move(hash_state), start, sizeof(value)); } +template <typename H> +H hash_weakly_mixed_integer(H hash_state, WeaklyMixedInteger value) { + return H::combine_weakly_mixed_integer(std::move(hash_state), value); +} + // ----------------------------------------------------------------------------- // AbslHashValue for Basic Types // ----------------------------------------------------------------------------- @@ -609,7 +616,7 @@ H AbslHashValue(H hash_state, absl::string_view str) { return H::combine( H::combine_contiguous(std::move(hash_state), str.data(), str.size()), - str.size()); + WeaklyMixedInteger{str.size()}); } // Support std::wstring, std::u16string and std::u32string. @@ -622,7 +629,7 @@ const std::basic_string<Char, std::char_traits<Char>, Alloc>& str) { return H::combine( H::combine_contiguous(std::move(hash_state), str.data(), str.size()), - str.size()); + WeaklyMixedInteger{str.size()}); } #ifdef ABSL_HAVE_STD_STRING_VIEW @@ -635,7 +642,7 @@ H AbslHashValue(H hash_state, std::basic_string_view<Char> str) { return H::combine( H::combine_contiguous(std::move(hash_state), str.data(), str.size()), - str.size()); + WeaklyMixedInteger{str.size()}); } #endif // ABSL_HAVE_STD_STRING_VIEW @@ -685,7 +692,7 @@ for (const auto& t : deque) { hash_state = H::combine(std::move(hash_state), t); } - return H::combine(std::move(hash_state), deque.size()); + return H::combine(std::move(hash_state), WeaklyMixedInteger{deque.size()}); } // AbslHashValue for hashing std::forward_list @@ -697,7 +704,7 @@ hash_state = H::combine(std::move(hash_state), t); ++size; } - return H::combine(std::move(hash_state), size); + return H::combine(std::move(hash_state), WeaklyMixedInteger{size}); } // AbslHashValue for hashing std::list @@ -707,7 +714,7 @@ for (const auto& t : list) { hash_state = H::combine(std::move(hash_state), t); } - return H::combine(std::move(hash_state), list.size()); + return H::combine(std::move(hash_state), WeaklyMixedInteger{list.size()}); } // AbslHashValue for hashing std::vector @@ -721,7 +728,7 @@ AbslHashValue(H hash_state, const std::vector<T, Allocator>& vector) { return H::combine(H::combine_contiguous(std::move(hash_state), vector.data(), vector.size()), - vector.size()); + WeaklyMixedInteger{vector.size()}); } // AbslHashValue special cases for hashing std::vector<bool> @@ -742,7 +749,8 @@ unsigned char c = static_cast<unsigned char>(i); hash_state = combiner.add_buffer(std::move(hash_state), &c, sizeof(c)); } - return H::combine(combiner.finalize(std::move(hash_state)), vector.size()); + return H::combine(combiner.finalize(std::move(hash_state)), + WeaklyMixedInteger{vector.size()}); } #else // When not working around the libstdc++ bug above, we still have to contend @@ -758,7 +766,7 @@ AbslHashValue(H hash_state, const std::vector<T, Allocator>& vector) { return H::combine(std::move(hash_state), std::hash<std::vector<T, Allocator>>{}(vector), - vector.size()); + WeaklyMixedInteger{vector.size()}); } #endif @@ -775,7 +783,7 @@ for (const auto& t : map) { hash_state = H::combine(std::move(hash_state), t); } - return H::combine(std::move(hash_state), map.size()); + return H::combine(std::move(hash_state), WeaklyMixedInteger{map.size()}); } // AbslHashValue for hashing std::multimap @@ -788,7 +796,7 @@ for (const auto& t : map) { hash_state = H::combine(std::move(hash_state), t); } - return H::combine(std::move(hash_state), map.size()); + return H::combine(std::move(hash_state), WeaklyMixedInteger{map.size()}); } // AbslHashValue for hashing std::set @@ -798,7 +806,7 @@ for (const auto& t : set) { hash_state = H::combine(std::move(hash_state), t); } - return H::combine(std::move(hash_state), set.size()); + return H::combine(std::move(hash_state), WeaklyMixedInteger{set.size()}); } // AbslHashValue for hashing std::multiset @@ -808,7 +816,7 @@ for (const auto& t : set) { hash_state = H::combine(std::move(hash_state), t); } - return H::combine(std::move(hash_state), set.size()); + return H::combine(std::move(hash_state), WeaklyMixedInteger{set.size()}); } // ----------------------------------------------------------------------------- @@ -822,7 +830,7 @@ H hash_state, const std::unordered_set<Key, Hash, KeyEqual, Alloc>& s) { return H::combine( H::combine_unordered(std::move(hash_state), s.begin(), s.end()), - s.size()); + WeaklyMixedInteger{s.size()}); } // AbslHashValue for hashing std::unordered_multiset @@ -833,7 +841,7 @@ const std::unordered_multiset<Key, Hash, KeyEqual, Alloc>& s) { return H::combine( H::combine_unordered(std::move(hash_state), s.begin(), s.end()), - s.size()); + WeaklyMixedInteger{s.size()}); } // AbslHashValue for hashing std::unordered_set @@ -845,7 +853,7 @@ const std::unordered_map<Key, T, Hash, KeyEqual, Alloc>& s) { return H::combine( H::combine_unordered(std::move(hash_state), s.begin(), s.end()), - s.size()); + WeaklyMixedInteger{s.size()}); } // AbslHashValue for hashing std::unordered_multiset @@ -857,7 +865,7 @@ const std::unordered_multimap<Key, T, Hash, KeyEqual, Alloc>& s) { return H::combine( H::combine_unordered(std::move(hash_state), s.begin(), s.end()), - s.size()); + WeaklyMixedInteger{s.size()}); } // ----------------------------------------------------------------------------- @@ -968,11 +976,20 @@ // `false`. struct HashSelect { private: + struct WeaklyMixedIntegerProbe { + template <typename H> + static H Invoke(H state, WeaklyMixedInteger value) { + return hash_internal::hash_weakly_mixed_integer(std::move(state), value); + } + }; + struct State : HashStateBase<State> { static State combine_contiguous(State hash_state, const unsigned char*, size_t); using State::HashStateBase::combine_contiguous; static State combine_raw(State state, uint64_t value); + static State combine_weakly_mixed_integer(State hash_state, + WeaklyMixedInteger value); }; struct UniquelyRepresentedProbe { @@ -1034,6 +1051,7 @@ // disjunction provides short circuiting wrt instantiation. template <typename T> using Apply = absl::disjunction< // + Probe<WeaklyMixedIntegerProbe, T>, // Probe<UniquelyRepresentedProbe, T>, // Probe<HashValueProbe, T>, // Probe<LegacyHashProbe, T>, // @@ -1114,6 +1132,19 @@ MixingHashState() : state_(Seed()) {} friend class MixingHashState::HashStateBase; + template <typename H> + friend H absl::hash_internal::hash_weakly_mixed_integer(H, + WeaklyMixedInteger); + + static MixingHashState combine_weakly_mixed_integer( + MixingHashState hash_state, WeaklyMixedInteger value) { + // Some transformation for the value is needed to make an empty + // string/container change the mixing hash state. + // Seed() is most likely already in a register. + // TODO(b/384509507): experiment with using kMul or last 31 bits of kMul. + // See https://godbolt.org/z/6cM77s3PW for ideas. + return MixingHashState{hash_state.state_ + (Seed() + value.value)}; + } template <typename CombinerT> static MixingHashState RunCombineUnordered(MixingHashState state, @@ -1286,13 +1317,16 @@ } ABSL_ATTRIBUTE_ALWAYS_INLINE static uint64_t Mix(uint64_t lhs, uint64_t rhs) { + // For 32 bit platforms we are trying to use all 64 lower bits. + if constexpr (sizeof(size_t) < 8) { + uint64_t m = lhs * rhs; + return m ^ (m >> 32); + } // Though the 128-bit product on AArch64 needs two instructions, it is // still a good balance between speed and hash quality. - using MultType = - absl::conditional_t<sizeof(size_t) == 4, uint64_t, uint128>; - MultType m = lhs; + uint128 m = lhs; m *= rhs; - return static_cast<uint64_t>(m ^ (m >> (sizeof(m) * 8 / 2))); + return Uint128High64(m) ^ Uint128Low64(m); } // Slightly lower latency than Mix, but with lower quality. The byte swap @@ -1302,13 +1336,7 @@ const uint64_t n = lhs ^ rhs; // WeakMix doesn't work well on 32-bit platforms so just use Mix. if constexpr (sizeof(size_t) < 8) return Mix(n, kMul); -#ifdef __ARM_ACLE - // gbswap_64 compiles to `rev` on ARM, but `rbit` is better because it - // reverses bits rather than reversing bytes. - return __rbitll(n * kMul); -#else return absl::gbswap_64(n * kMul); -#endif } // An extern to avoid bloat on a direct call to LowLevelHash() with fixed
diff --git a/third_party/abseil-cpp/absl/hash/internal/spy_hash_state.h b/third_party/abseil-cpp/absl/hash/internal/spy_hash_state.h index 92490b1a..e403113 100644 --- a/third_party/abseil-cpp/absl/hash/internal/spy_hash_state.h +++ b/third_party/abseil-cpp/absl/hash/internal/spy_hash_state.h
@@ -16,12 +16,14 @@ #define ABSL_HASH_INTERNAL_SPY_HASH_STATE_H_ #include <algorithm> +#include <cstddef> #include <cstdint> #include <ostream> #include <string> #include <vector> #include "absl/hash/hash.h" +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/strings/match.h" #include "absl/strings/str_format.h" #include "absl/strings/str_join.h" @@ -167,6 +169,11 @@ return hash_state; } + static SpyHashStateImpl combine_weakly_mixed_integer( + SpyHashStateImpl hash_state, WeaklyMixedInteger value) { + return combine(std::move(hash_state), value.value); + } + using SpyHashStateImpl::HashStateBase::combine_contiguous; template <typename CombinerT>
diff --git a/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h b/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h new file mode 100644 index 0000000..55754366 --- /dev/null +++ b/third_party/abseil-cpp/absl/hash/internal/weakly_mixed_integer.h
@@ -0,0 +1,38 @@ +// Copyright 2025 The Abseil Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef ABSL_HASH_INTERNAL_WEAKLY_MIXED_INTEGER_H_ +#define ABSL_HASH_INTERNAL_WEAKLY_MIXED_INTEGER_H_ + +#include <cstddef> + +#include "absl/base/config.h" + +namespace absl { +ABSL_NAMESPACE_BEGIN +namespace hash_internal { + +// Contains an integer that will be mixed into a hash state more weakly than +// regular integers. It is useful for cases in which an integer is a part of a +// larger object and needs to be mixed as a supplement. E.g., absl::string_view +// and absl::Span are mixing their size wrapped with WeaklyMixedInteger. +struct WeaklyMixedInteger { + size_t value; +}; + +} // namespace hash_internal +ABSL_NAMESPACE_END +} // namespace absl + +#endif // ABSL_HASH_INTERNAL_WEAKLY_MIXED_INTEGER_H_
diff --git a/third_party/abseil-cpp/absl/random/gaussian_distribution.h b/third_party/abseil-cpp/absl/random/gaussian_distribution.h index ce84d4a..eb75bfee 100644 --- a/third_party/abseil-cpp/absl/random/gaussian_distribution.h +++ b/third_party/abseil-cpp/absl/random/gaussian_distribution.h
@@ -244,7 +244,7 @@ bits); // U(-1, 1) const double x = j * zg_.x[i]; - // Retangular box. Handles >97% of all cases. + // Rectangular box. Handles >97% of all cases. // For any given box, this handles between 75% and 99% of values. // Equivalent to U(01) < (x[i+1] / x[i]), and when i == 0, ~93.5% if (std::abs(x) < zg_.x[i + 1]) {
diff --git a/third_party/abseil-cpp/absl/random/internal/entropy_pool.cc b/third_party/abseil-cpp/absl/random/internal/entropy_pool.cc index 092730d..fa47d0d 100644 --- a/third_party/abseil-cpp/absl/random/internal/entropy_pool.cc +++ b/third_party/abseil-cpp/absl/random/internal/entropy_pool.cc
@@ -44,9 +44,11 @@ // single generator within a RandenPool<T>. It is an internal implementation // detail, and does not aim to conform to [rand.req.urng]. // -// NOTE: There are alignment issues when used on ARM, for instance. -// See the allocation code in PoolAlignedAlloc(). -class RandenPoolEntry { +// At least 32-byte alignment is required for the state_ array on some ARM +// platforms. We also want this aligned to a cacheline to eliminate false +// sharing. +class alignas(std::max(size_t{ABSL_CACHELINE_SIZE}, size_t{32})) + RandenPoolEntry { public: static constexpr size_t kState = RandenTraits::kStateBytes / sizeof(uint32_t); static constexpr size_t kCapacity = @@ -74,7 +76,8 @@ private: // Randen URBG state. - uint32_t state_[kState] ABSL_GUARDED_BY(mu_); // First to satisfy alignment. + // At least 32-byte alignment is required by ARM platform code. + alignas(32) uint32_t state_[kState] ABSL_GUARDED_BY(mu_); SpinLock mu_; const Randen impl_; size_t next_ ABSL_GUARDED_BY(mu_); @@ -148,22 +151,6 @@ #endif } -// Allocate a RandenPoolEntry with at least 32-byte alignment, which is required -// by ARM platform code. -RandenPoolEntry* PoolAlignedAlloc() { - constexpr size_t kAlignment = - ABSL_CACHELINE_SIZE > 32 ? ABSL_CACHELINE_SIZE : 32; - - // Not all the platforms that we build for have std::aligned_alloc, however - // since we never free these objects, we can over allocate and munge the - // pointers to the correct alignment. - uintptr_t x = reinterpret_cast<uintptr_t>( - new char[sizeof(RandenPoolEntry) + kAlignment]); - auto y = x % kAlignment; - void* aligned = reinterpret_cast<void*>(y == 0 ? x : (x + kAlignment - y)); - return new (aligned) RandenPoolEntry(); -} - // Allocate and initialize kPoolSize objects of type RandenPoolEntry. void InitPoolURBG() { static constexpr size_t kSeedSize = @@ -174,7 +161,7 @@ ThrowSeedGenException(); } for (size_t i = 0; i < kPoolSize; i++) { - shared_pools[i] = PoolAlignedAlloc(); + shared_pools[i] = new RandenPoolEntry(); shared_pools[i]->Init( absl::MakeSpan(&seed_material[i * kSeedSize], kSeedSize)); }
diff --git a/third_party/abseil-cpp/absl/status/statusor_test.cc b/third_party/abseil-cpp/absl/status/statusor_test.cc index 8341040..17a33842 100644 --- a/third_party/abseil-cpp/absl/status/statusor_test.cc +++ b/third_party/abseil-cpp/absl/status/statusor_test.cc
@@ -459,7 +459,7 @@ EXPECT_EQ(p, *source); } - // Move asssignment + // Move assignment { const auto p = std::make_shared<int>(17); absl::StatusOr<std::shared_ptr<int>> source(p);
diff --git a/third_party/abseil-cpp/absl/strings/BUILD.bazel b/third_party/abseil-cpp/absl/strings/BUILD.bazel index ddc115dc..3b0aab5 100644 --- a/third_party/abseil-cpp/absl/strings/BUILD.bazel +++ b/third_party/abseil-cpp/absl/strings/BUILD.bazel
@@ -606,6 +606,7 @@ "//absl/crc:crc32c", "//absl/crc:crc_cord_state", "//absl/functional:function_ref", + "//absl/hash:weakly_mixed_integer", "//absl/meta:type_traits", "//absl/numeric:bits", "//absl/types:compare",
diff --git a/third_party/abseil-cpp/absl/strings/BUILD.gn b/third_party/abseil-cpp/absl/strings/BUILD.gn index bb4e68f..30c6708 100644 --- a/third_party/abseil-cpp/absl/strings/BUILD.gn +++ b/third_party/abseil-cpp/absl/strings/BUILD.gn
@@ -375,6 +375,7 @@ "//third_party/abseil-cpp/absl/crc:crc32c", "//third_party/abseil-cpp/absl/crc:crc_cord_state", "//third_party/abseil-cpp/absl/functional:function_ref", + "//third_party/abseil-cpp/absl/hash:weakly_mixed_integer", "//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/numeric:bits", "//third_party/abseil-cpp/absl/types:compare",
diff --git a/third_party/abseil-cpp/absl/strings/CMakeLists.txt b/third_party/abseil-cpp/absl/strings/CMakeLists.txt index 40c57f6d..ec731d8 100644 --- a/third_party/abseil-cpp/absl/strings/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/strings/CMakeLists.txt
@@ -998,6 +998,7 @@ absl::span absl::strings absl::type_traits + absl::weakly_mixed_integer PUBLIC )
diff --git a/third_party/abseil-cpp/absl/strings/cord.h b/third_party/abseil-cpp/absl/strings/cord.h index b50150f..7afa419 100644 --- a/third_party/abseil-cpp/absl/strings/cord.h +++ b/third_party/abseil-cpp/absl/strings/cord.h
@@ -79,6 +79,7 @@ #include "absl/base/optimization.h" #include "absl/crc/internal/crc_cord_state.h" #include "absl/functional/function_ref.h" +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/meta/type_traits.h" #include "absl/strings/cord_analysis.h" #include "absl/strings/cord_buffer.h" @@ -1097,7 +1098,8 @@ hash_state = combiner.add_buffer(std::move(hash_state), chunk.data(), chunk.size()); }); - return H::combine(combiner.finalize(std::move(hash_state)), size()); + return H::combine(combiner.finalize(std::move(hash_state)), + hash_internal::WeaklyMixedInteger{size()}); } friend class CrcCord;
diff --git a/third_party/abseil-cpp/absl/strings/internal/charconv_bigint_test.cc b/third_party/abseil-cpp/absl/strings/internal/charconv_bigint_test.cc index a8b99458..7bbf16d 100644 --- a/third_party/abseil-cpp/absl/strings/internal/charconv_bigint_test.cc +++ b/third_party/abseil-cpp/absl/strings/internal/charconv_bigint_test.cc
@@ -176,7 +176,7 @@ TEST(BigUnsigned, MultiplyByOverflow) { { - // Check that multiplcation overflow predictably truncates. + // Check that multiplication overflow predictably truncates. // A big int with all bits on. BigUnsigned<4> all_bits_on("340282366920938463463374607431768211455");
diff --git a/third_party/abseil-cpp/absl/strings/str_format.h b/third_party/abseil-cpp/absl/strings/str_format.h index 1d863055..ffa7f11 100644 --- a/third_party/abseil-cpp/absl/strings/str_format.h +++ b/third_party/abseil-cpp/absl/strings/str_format.h
@@ -609,7 +609,7 @@ // // Note that unlike with AbslFormatConvert(), AbslStringify() does not allow // customization of allowed conversion characters. AbslStringify() uses `%v` as -// the underlying conversion specififer. Additionally, AbslStringify() supports +// the underlying conversion specifier. Additionally, AbslStringify() supports // use with absl::StrCat while AbslFormatConvert() does not. // // Example:
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h b/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h index b2b0cf6..5b232f51 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h +++ b/third_party/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h
@@ -200,7 +200,7 @@ // version() and description() provide additional information about the // time zone. The content of each of the returned strings is unspecified, // however, when the IANA Time Zone Database is the underlying data source - // the version() string will be in the familar form (e.g, "2018e") or + // the version() string will be in the familiar form (e.g, "2018e") or // empty when unavailable. // // Note: These functions are for informational or testing purposes only.
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc b/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc index 4a5ac1b..ba7e1496 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc +++ b/third_party/abseil-cpp/absl/time/internal/cctz/src/cctz_benchmark.cc
@@ -199,6 +199,7 @@ "America/Ciudad_Juarez", "America/Coral_Harbour", "America/Costa_Rica", + "America/Coyhaique", "America/Creston", "America/Cuiaba", "America/Curacao", @@ -215,7 +216,6 @@ "America/Fort_Nelson", "America/Fortaleza", "America/Glace_Bay", - "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada",
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc b/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc index 22c0eb660..e1bea28 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc +++ b/third_party/abseil-cpp/absl/time/internal/cctz/src/time_zone_lookup_test.cc
@@ -134,6 +134,7 @@ "America/Ciudad_Juarez", "America/Coral_Harbour", "America/Costa_Rica", + "America/Coyhaique", "America/Creston", "America/Cuiaba", "America/Curacao", @@ -150,7 +151,6 @@ "America/Fort_Nelson", "America/Fortaleza", "America/Glace_Bay", - "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada",
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/version b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/version index 0846b7f..ef468ad 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/version +++ b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/version
@@ -1 +1 @@ -2025a +2025b
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Coyhaique b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Coyhaique new file mode 100644 index 0000000..26354e8 --- /dev/null +++ b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/America/Coyhaique Binary files differ
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tehran b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tehran index 824acb0..6fd31e0 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tehran +++ b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Asia/Tehran Binary files differ
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Iran b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Iran index 824acb0..6fd31e0 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Iran +++ b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/Iran Binary files differ
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab index 5ded0565..36535bd 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab +++ b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab
@@ -124,7 +124,8 @@ CI,BF,GH,GM,GN,IS,ML,MR,SH,SL,SN,TG +0519-00402 Africa/Abidjan CK -2114-15946 Pacific/Rarotonga CL -3327-07040 America/Santiago most of Chile -CL -5309-07055 America/Punta_Arenas Region of Magallanes +CL -4534-07204 America/Coyhaique Aysén Region +CL -5309-07055 America/Punta_Arenas Magallanes Region CL -2709-10926 Pacific/Easter Easter Island CN +3114+12128 Asia/Shanghai Beijing Time CN +4348+08735 Asia/Urumqi Xinjiang Time
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zonenow.tab b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zonenow.tab index d2c1e485..093f0a0 100644 --- a/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zonenow.tab +++ b/third_party/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo/zonenow.tab
@@ -104,7 +104,7 @@ XX +4734-05243 America/St_Johns Newfoundland ("NST/NDT") # # -03 -XX -2332-04637 America/Sao_Paulo eastern South America +XX -2332-04637 America/Sao_Paulo eastern and southern South America # # -03/-02 (North America DST) XX +4703-05620 America/Miquelon St Pierre & Miquelon
diff --git a/third_party/abseil-cpp/absl/types/BUILD.bazel b/third_party/abseil-cpp/absl/types/BUILD.bazel index febc9e5..0668a2e 100644 --- a/third_party/abseil-cpp/absl/types/BUILD.bazel +++ b/third_party/abseil-cpp/absl/types/BUILD.bazel
@@ -64,6 +64,7 @@ "//absl/base:core_headers", "//absl/base:nullability", "//absl/base:throw_delegate", + "//absl/hash:weakly_mixed_integer", "//absl/meta:type_traits", ], ) @@ -81,6 +82,7 @@ "//absl/base:exception_testing", "//absl/container:fixed_array", "//absl/container:inlined_vector", + "//absl/hash", "//absl/hash:hash_testing", "//absl/meta:type_traits", "//absl/strings",
diff --git a/third_party/abseil-cpp/absl/types/BUILD.gn b/third_party/abseil-cpp/absl/types/BUILD.gn index 48b25ea..bd139b80 100644 --- a/third_party/abseil-cpp/absl/types/BUILD.gn +++ b/third_party/abseil-cpp/absl/types/BUILD.gn
@@ -23,6 +23,7 @@ "//third_party/abseil-cpp/absl/base:core_headers", "//third_party/abseil-cpp/absl/base:nullability", "//third_party/abseil-cpp/absl/base:throw_delegate", + "//third_party/abseil-cpp/absl/hash:weakly_mixed_integer", "//third_party/abseil-cpp/absl/meta:type_traits", ] } @@ -36,6 +37,7 @@ "//third_party/abseil-cpp/absl/base:exception_testing", "//third_party/abseil-cpp/absl/container:fixed_array", "//third_party/abseil-cpp/absl/container:inlined_vector", + "//third_party/abseil-cpp/absl/hash", "//third_party/abseil-cpp/absl/hash:hash_testing", "//third_party/abseil-cpp/absl/meta:type_traits", "//third_party/abseil-cpp/absl/strings", @@ -69,7 +71,5 @@ absl_test("variant_test") { sources = [ "variant_test.cc" ] - deps = [ - ":variant", - ] + deps = [ ":variant" ] }
diff --git a/third_party/abseil-cpp/absl/types/CMakeLists.txt b/third_party/abseil-cpp/absl/types/CMakeLists.txt index f48accf..20a7e90e 100644 --- a/third_party/abseil-cpp/absl/types/CMakeLists.txt +++ b/third_party/abseil-cpp/absl/types/CMakeLists.txt
@@ -43,6 +43,7 @@ absl::nullability absl::throw_delegate absl::type_traits + absl::weakly_mixed_integer PUBLIC ) @@ -60,6 +61,7 @@ absl::core_headers absl::exception_testing absl::fixed_array + absl::hash absl::inlined_vector absl::hash_testing absl::strings
diff --git a/third_party/abseil-cpp/absl/types/span.h b/third_party/abseil-cpp/absl/types/span.h index 9d164960..444b2ae6 100644 --- a/third_party/abseil-cpp/absl/types/span.h +++ b/third_party/abseil-cpp/absl/types/span.h
@@ -66,7 +66,8 @@ #include "absl/base/macros.h" #include "absl/base/nullability.h" #include "absl/base/optimization.h" -#include "absl/base/port.h" // TODO(strel): remove this include +#include "absl/base/port.h" // TODO(strel): remove this include +#include "absl/hash/internal/weakly_mixed_integer.h" #include "absl/meta/type_traits.h" #include "absl/types/internal/span.h" @@ -498,7 +499,7 @@ template <typename H> friend H AbslHashValue(H h, Span v) { return H::combine(H::combine_contiguous(std::move(h), v.data(), v.size()), - v.size()); + hash_internal::WeaklyMixedInteger{v.size()}); } private:
diff --git a/third_party/abseil-cpp/absl/types/span_test.cc b/third_party/abseil-cpp/absl/types/span_test.cc index a1a207f..6700b81 100644 --- a/third_party/abseil-cpp/absl/types/span_test.cc +++ b/third_party/abseil-cpp/absl/types/span_test.cc
@@ -30,6 +30,7 @@ #include "absl/base/options.h" #include "absl/container/fixed_array.h" #include "absl/container/inlined_vector.h" +#include "absl/hash/hash.h" #include "absl/hash/hash_testing.h" #include "absl/meta/type_traits.h" #include "absl/strings/str_cat.h" @@ -885,4 +886,16 @@ T(array + 1, 2), T(array + 2, 2)})); } +// std::vector is implicitly convertible to absl::Span. +// There are real life cases where clients rely on this consistency in order to +// implement heterogeneous lookup. +TEST(Span, HashConsistentWithVectorLike) { + EXPECT_EQ(absl::HashOf(absl::Span<const int>({1, 2, 3})), + absl::HashOf(std::vector<int>{1, 2, 3})); + EXPECT_EQ(absl::HashOf(absl::Span<const int>({1, 2, 3})), + absl::HashOf(absl::InlinedVector<int, 2>{1, 2, 3})); + EXPECT_EQ(absl::HashOf(absl::Span<const int>({1, 2, 3})), + absl::HashOf(absl::FixedArray<int>{1, 2, 3})); +} + } // namespace
diff --git a/third_party/abseil-cpp/patches/0004-undeprecate-nullability-types.patch b/third_party/abseil-cpp/patches/0004-undeprecate-nullability-types.patch new file mode 100644 index 0000000..29da7d46 --- /dev/null +++ b/third_party/abseil-cpp/patches/0004-undeprecate-nullability-types.patch
@@ -0,0 +1,33 @@ +TODO: crbug.com/412943761 - Remove when all libraries migrate to attribute-like nullability annotations. +--- +diff --git a/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h b/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h +index 1174a96eaa3e0..b6405f1d9b269 100644 +--- a/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h ++++ b/third_party/abseil-cpp/absl/base/internal/nullability_deprecated.h +@@ -77,7 +77,7 @@ using NullabilityUnknownImpl + // Is equivalent to: + // int* absl_nonnull foo; + template <typename T> +-using Nonnull [[deprecated("Use `absl_nonnull`.")]] = ++using Nonnull = + nullability_internal::NonnullImpl<T>; + + // absl::Nullable, analogous to absl_nullable +@@ -87,7 +87,7 @@ using Nonnull [[deprecated("Use `absl_nonnull`.")]] = + // Is equivalent to: + // int* absl_nullable foo; + template <typename T> +-using Nullable [[deprecated("Use `absl_nullable`.")]] = ++using Nullable = + nullability_internal::NullableImpl<T>; + + // absl::NullabilityUnknown, analogous to absl_nullability_unknown +@@ -97,7 +97,7 @@ using Nullable [[deprecated("Use `absl_nullable`.")]] = + // Is equivalent to: + // int* absl_nullability_unknown foo; + template <typename T> +-using NullabilityUnknown [[deprecated("Use `absl_nullability_unknown`.")]] = ++using NullabilityUnknown = + nullability_internal::NullabilityUnknownImpl<T>; + + ABSL_NAMESPACE_END
diff --git a/third_party/abseil-cpp/symbols_arm64_dbg.def b/third_party/abseil-cpp/symbols_arm64_dbg.def index d16a620..e6ad8819 100644 --- a/third_party/abseil-cpp/symbols_arm64_dbg.def +++ b/third_party/abseil-cpp/symbols_arm64_dbg.def
@@ -569,6 +569,7 @@ ??$IntegerToString@K@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@K@Z ??$IntegerToString@_J@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@_J@Z ??$IntegerToString@_K@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@_K@Z + ??$Invoke@VMixingHashState@hash_internal@absl@@@WeaklyMixedIntegerProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@UWeaklyMixedInteger@23@@Z ??$Invoke@VMixingHashState@hash_internal@absl@@H@UniquelyRepresentedProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@AEBH@Z ??$Invoke@VMixingHashState@hash_internal@absl@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@HashValueProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ??$Invoke@VMixingHashState@hash_internal@absl@@V?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@@HashValueProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@AEBV?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@@Z @@ -1290,6 +1291,7 @@ ??$call_once@A6AXXZ$$V@absl@@YAXAEAVonce_flag@0@A6AXXZ@Z ??$call_once@P8FlagImpl@flags_internal@absl@@EAAXXZPEAV123@@absl@@YAXAEAVonce_flag@0@$$QEAP8FlagImpl@flags_internal@0@EAAXXZ$$QEAPEAV230@@Z ??$combine@H$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBH@Z + ??$combine@UWeaklyMixedInteger@hash_internal@absl@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBUWeaklyMixedInteger@12@@Z ??$combine@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ??$combine@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@H@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@Z ??$combine@V?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBV?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@@Z @@ -1511,6 +1513,7 @@ ??$hash_range_or_bytes@VMixingHashState@hash_internal@absl@@D@hash_internal@absl@@YA?AVMixingHashState@01@V201@PEBD_K@Z ??$hash_tuple@VMixingHashState@hash_internal@absl@@V?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@$0A@$00@hash_internal@absl@@YA?AVMixingHashState@01@V201@AEBV?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@U?$integer_sequence@_K$0A@$00@45@@Z ??$hash_tuple@VMixingHashState@hash_internal@absl@@V?$tuple@AEB_K@__Cr@std@@$0A@@hash_internal@absl@@YA?AVMixingHashState@01@V201@AEBV?$tuple@AEB_K@__Cr@std@@U?$integer_sequence@_K$0A@@45@@Z + ??$hash_weakly_mixed_integer@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@YA?AVMixingHashState@01@V201@UWeaklyMixedInteger@01@@Z ??$insert@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@$0A@@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@QEAA?AU?$pair@Viterator@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@_N@__Cr@std@@$$QEAU?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@45@@Z ??$insert@V?$__wrap_iter@PEAUraw_view@?1???R?$ConvertToContainer@V?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@23@$0A@@?$Splitter@VByChar@absl@@UAllowEmpty@2@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@strings_internal@absl@@QEBA?AV?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@AEBV345@@Z@@__Cr@std@@$0A@@?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@QEAA?AV?$__wrap_iter@PEAV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@12@V?$__wrap_iter@PEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@12@V?$__wrap_iter@PEAUraw_view@?1???R?$ConvertToContainer@V?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@23@$0A@@?$Splitter@VByChar@absl@@UAllowEmpty@2@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@strings_internal@absl@@QEBA?AV?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@AEBV345@@Z@@12@1@Z ??$invoke@P8FlagImpl@flags_internal@absl@@EAAXXZPEAV123@@__Cr@std@@YAX$$QEAP8FlagImpl@flags_internal@absl@@EAAXXZ$$QEAPEAV234@@Z @@ -4775,6 +4778,7 @@ ?combine@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@23@V423@@Z ?combine_contiguous@MixingHashState@hash_internal@absl@@SA?AV123@V123@PEBE_K@Z ?combine_raw@MixingHashState@hash_internal@absl@@CA?AV123@V123@_K@Z + ?combine_weakly_mixed_integer@MixingHashState@hash_internal@absl@@CA?AV123@V123@UWeaklyMixedInteger@23@@Z ?common@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@AEAAAEAVCommonFields@23@XZ ?common@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@AEBAAEBVCommonFields@23@XZ ?compare_exchange_strong@?$__atomic_base@PEAVTimeZone@absl@@$0A@@__Cr@std@@QEAA_NAEAPEAVTimeZone@absl@@PEAV45@W4memory_order@23@2@Z
diff --git a/third_party/abseil-cpp/symbols_x64_dbg.def b/third_party/abseil-cpp/symbols_x64_dbg.def index 24dbf62..671dcf3 100644 --- a/third_party/abseil-cpp/symbols_x64_dbg.def +++ b/third_party/abseil-cpp/symbols_x64_dbg.def
@@ -569,6 +569,7 @@ ??$IntegerToString@K@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@K@Z ??$IntegerToString@_J@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@_J@Z ??$IntegerToString@_K@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@_K@Z + ??$Invoke@VMixingHashState@hash_internal@absl@@@WeaklyMixedIntegerProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@UWeaklyMixedInteger@23@@Z ??$Invoke@VMixingHashState@hash_internal@absl@@H@UniquelyRepresentedProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@AEBH@Z ??$Invoke@VMixingHashState@hash_internal@absl@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@HashValueProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ??$Invoke@VMixingHashState@hash_internal@absl@@V?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@@HashValueProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@AEBV?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@@Z @@ -1291,6 +1292,7 @@ ??$call_once@A6AXXZ$$V@absl@@YAXAEAVonce_flag@0@A6AXXZ@Z ??$call_once@P8FlagImpl@flags_internal@absl@@EAAXXZPEAV123@@absl@@YAXAEAVonce_flag@0@$$QEAP8FlagImpl@flags_internal@0@EAAXXZ$$QEAPEAV230@@Z ??$combine@H$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBH@Z + ??$combine@UWeaklyMixedInteger@hash_internal@absl@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBUWeaklyMixedInteger@12@@Z ??$combine@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ??$combine@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@H@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@Z ??$combine@V?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@AEBV?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@@Z @@ -1512,6 +1514,7 @@ ??$hash_range_or_bytes@VMixingHashState@hash_internal@absl@@D@hash_internal@absl@@YA?AVMixingHashState@01@V201@PEBD_K@Z ??$hash_tuple@VMixingHashState@hash_internal@absl@@V?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@$0A@$00@hash_internal@absl@@YA?AVMixingHashState@01@V201@AEBV?$tuple@AEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@AEBH@__Cr@std@@U?$integer_sequence@_K$0A@$00@45@@Z ??$hash_tuple@VMixingHashState@hash_internal@absl@@V?$tuple@AEB_K@__Cr@std@@$0A@@hash_internal@absl@@YA?AVMixingHashState@01@V201@AEBV?$tuple@AEB_K@__Cr@std@@U?$integer_sequence@_K$0A@@45@@Z + ??$hash_weakly_mixed_integer@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@YA?AVMixingHashState@01@V201@UWeaklyMixedInteger@01@@Z ??$insert@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@$0A@@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@QEAA?AU?$pair@Viterator@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@_N@__Cr@std@@$$QEAU?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@45@@Z ??$insert@V?$__wrap_iter@PEAUraw_view@?1???R?$ConvertToContainer@V?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@23@$0A@@?$Splitter@VByChar@absl@@UAllowEmpty@2@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@strings_internal@absl@@QEBA?AV?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@AEBV345@@Z@@__Cr@std@@$0A@@?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@QEAA?AV?$__wrap_iter@PEAV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@12@V?$__wrap_iter@PEBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@12@V?$__wrap_iter@PEAUraw_view@?1???R?$ConvertToContainer@V?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@23@$0A@@?$Splitter@VByChar@absl@@UAllowEmpty@2@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@strings_internal@absl@@QEBA?AV?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@AEBV345@@Z@@12@1@Z ??$invoke@P8FlagImpl@flags_internal@absl@@EAAXXZPEAV123@@__Cr@std@@YAX$$QEAP8FlagImpl@flags_internal@absl@@EAAXXZ$$QEAPEAV234@@Z @@ -4780,6 +4783,7 @@ ?combine@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@23@V423@@Z ?combine_contiguous@MixingHashState@hash_internal@absl@@SA?AV123@V123@PEBE_K@Z ?combine_raw@MixingHashState@hash_internal@absl@@CA?AV123@V123@_K@Z + ?combine_weakly_mixed_integer@MixingHashState@hash_internal@absl@@CA?AV123@V123@UWeaklyMixedInteger@23@@Z ?common@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@AEAAAEAVCommonFields@23@XZ ?common@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PEAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@AEBAAEBVCommonFields@23@XZ ?compare_exchange_strong@?$__atomic_base@PEAVTimeZone@absl@@$0A@@__Cr@std@@QEAA_NAEAPEAVTimeZone@absl@@PEAV45@W4memory_order@23@2@Z
diff --git a/third_party/abseil-cpp/symbols_x86_dbg.def b/third_party/abseil-cpp/symbols_x86_dbg.def index c400a3bc..f09c4f7 100644 --- a/third_party/abseil-cpp/symbols_x86_dbg.def +++ b/third_party/abseil-cpp/symbols_x86_dbg.def
@@ -568,6 +568,7 @@ ??$IntegerToString@K@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@K@Z ??$IntegerToString@_J@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@_J@Z ??$IntegerToString@_K@strings_internal@absl@@YA?AV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@_K@Z + ??$Invoke@VMixingHashState@hash_internal@absl@@@WeaklyMixedIntegerProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@UWeaklyMixedInteger@23@@Z ??$Invoke@VMixingHashState@hash_internal@absl@@H@UniquelyRepresentedProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@ABH@Z ??$Invoke@VMixingHashState@hash_internal@absl@@I@UniquelyRepresentedProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@ABI@Z ??$Invoke@VMixingHashState@hash_internal@absl@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@HashValueProbe@HashSelect@hash_internal@absl@@SA?AVMixingHashState@23@V423@ABV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z @@ -1290,6 +1291,7 @@ ??$call_once@P8FlagImpl@flags_internal@absl@@AEXXZPAV123@@absl@@YAXAAVonce_flag@0@$$QAP8FlagImpl@flags_internal@0@AEXXZ$$QAPAV230@@Z ??$combine@H$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@ABH@Z ??$combine@I$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@ABI@Z + ??$combine@UWeaklyMixedInteger@hash_internal@absl@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@ABUWeaklyMixedInteger@12@@Z ??$combine@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@ABV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ??$combine@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@H@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@ABV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@ABH@Z ??$combine@V?$tuple@ABI@__Cr@std@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@ABV?$tuple@ABI@__Cr@std@@@Z @@ -1510,6 +1512,7 @@ ??$hash_range_or_bytes@VMixingHashState@hash_internal@absl@@D@hash_internal@absl@@YA?AVMixingHashState@01@V201@PBDI@Z ??$hash_tuple@VMixingHashState@hash_internal@absl@@V?$tuple@ABI@__Cr@std@@$0A@@hash_internal@absl@@YA?AVMixingHashState@01@V201@ABV?$tuple@ABI@__Cr@std@@U?$integer_sequence@I$0A@@45@@Z ??$hash_tuple@VMixingHashState@hash_internal@absl@@V?$tuple@ABV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@ABH@__Cr@std@@$0A@$00@hash_internal@absl@@YA?AVMixingHashState@01@V201@ABV?$tuple@ABV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@ABH@__Cr@std@@U?$integer_sequence@I$0A@$00@45@@Z + ??$hash_weakly_mixed_integer@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@YA?AVMixingHashState@01@V201@UWeaklyMixedInteger@01@@Z ??$insert@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@$0A@@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@QAE?AU?$pair@Viterator@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@_N@__Cr@std@@$$QAU?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@45@@Z ??$insert@V?$__wrap_iter@PAUraw_view@?1???R?$ConvertToContainer@V?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@23@$0A@@?$Splitter@VByChar@absl@@UAllowEmpty@2@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@strings_internal@absl@@QBE?AV?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@ABV345@@Z@@__Cr@std@@$0A@@?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@QAE?AV?$__wrap_iter@PAV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@12@V?$__wrap_iter@PBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@12@V?$__wrap_iter@PAUraw_view@?1???R?$ConvertToContainer@V?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@23@$0A@@?$Splitter@VByChar@absl@@UAllowEmpty@2@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@strings_internal@absl@@QBE?AV?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@ABV345@@Z@@12@1@Z ??$invoke@P8FlagImpl@flags_internal@absl@@AEXXZPAV123@@__Cr@std@@YAX$$QAP8FlagImpl@flags_internal@absl@@AEXXZ$$QAPAV234@@Z @@ -4778,6 +4781,7 @@ ?combine@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@23@V423@@Z ?combine_contiguous@MixingHashState@hash_internal@absl@@SA?AV123@V123@PBEI@Z ?combine_raw@MixingHashState@hash_internal@absl@@CA?AV123@V123@_K@Z + ?combine_weakly_mixed_integer@MixingHashState@hash_internal@absl@@CA?AV123@V123@UWeaklyMixedInteger@23@@Z ?common@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@AAEAAVCommonFields@23@XZ ?common@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@ABEABVCommonFields@23@XZ ?compare_exchange_strong@?$__atomic_base@PAVTimeZone@absl@@$0A@@__Cr@std@@QAE_NAAPAVTimeZone@absl@@PAV45@W4memory_order@23@2@Z
diff --git a/third_party/abseil-cpp/symbols_x86_rel.def b/third_party/abseil-cpp/symbols_x86_rel.def index 058e268..8b38fe01 100644 --- a/third_party/abseil-cpp/symbols_x86_rel.def +++ b/third_party/abseil-cpp/symbols_x86_rel.def
@@ -62,6 +62,7 @@ ??$CopyToEncodedBufferWithStructuredProtoField@$00@LogMessage@log_internal@absl@@AAEXUStructuredProtoField@12@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ??$CopyToEncodedBufferWithStructuredProtoField@$0A@@LogMessage@log_internal@absl@@AAEXUStructuredProtoField@12@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z ??$DeallocateBackingArray@$03V?$allocator@D@__Cr@std@@@container_internal@absl@@YAXPAXIPAW4ctrl_t@01@II_N@Z + ??$DecomposePair@UHashElement@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@container_internal@absl@@AAU?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@@container_internal@absl@@YAI$$QAUHashElement@?$raw_hash_set@U?$FlatHashMapPolicy@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@container_internal@absl@@UStringHash@23@UStringEq@23@V?$allocator@U?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@@__Cr@std@@@01@AAU?$pair@$$CBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@PAVCommandLineFlag@absl@@@__Cr@std@@@Z ??$Dispatch@C@FormatArgImpl@str_format_internal@absl@@CA_NTData@012@VFormatConversionSpecImpl@12@PAX@Z ??$Dispatch@D@FormatArgImpl@str_format_internal@absl@@CA_NTData@012@VFormatConversionSpecImpl@12@PAX@Z ??$Dispatch@E@FormatArgImpl@str_format_internal@absl@@CA_NTData@012@VFormatConversionSpecImpl@12@PAX@Z @@ -171,8 +172,6 @@ ??$__emplace_unique_key_args@V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@ABUpiecewise_construct_t@23@V?$tuple@ABV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@23@V?$tuple@$$V@23@@?$__tree@U?$__value_type@V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$vector@PBVCommandLineFlag@absl@@V?$allocator@PBVCommandLineFlag@absl@@@__Cr@std@@@23@@__Cr@std@@V?$__map_value_compare@V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@U?$__value_type@V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$vector@PBVCommandLineFlag@absl@@V?$allocator@PBVCommandLineFlag@absl@@@__Cr@std@@@23@@23@U?$less@V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@23@$00@23@V?$allocator@U?$__value_type@V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$vector@PBVCommandLineFlag@absl@@V?$allocator@PBVCommandLineFlag@absl@@@__Cr@std@@@23@@__Cr@std@@@23@@__Cr@std@@QAE?AU?$pair@V?$__tree_iterator@U?$__value_type@V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$vector@PBVCommandLineFlag@absl@@V?$allocator@PBVCommandLineFlag@absl@@@__Cr@std@@@23@@__Cr@std@@PAV?$__tree_node@U?$__value_type@V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@V?$vector@PBVCommandLineFlag@absl@@V?$allocator@PBVCommandLineFlag@absl@@@__Cr@std@@@23@@__Cr@std@@PAX@23@H@__Cr@std@@_N@12@ABV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@12@ABUpiecewise_construct_t@12@$$QAV?$tuple@ABV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@12@$$QAV?$tuple@$$V@12@@Z ??$__for_each_segment@V?$__deque_iterator@UPrefixCrc@CrcCordState@crc_internal@absl@@PBU1234@ABU1234@PBQBU1234@H$0A@@__Cr@std@@U?$_CopySegment@V?$__deque_iterator@UPrefixCrc@CrcCordState@crc_internal@absl@@PBU1234@ABU1234@PBQBU1234@H$0A@@__Cr@std@@V?$__deque_iterator@UPrefixCrc@CrcCordState@crc_internal@absl@@PAU1234@AAU1234@PAPAU1234@H$0A@@23@@__copy_impl@23@@__Cr@std@@YAXV?$__deque_iterator@UPrefixCrc@CrcCordState@crc_internal@absl@@PBU1234@ABU1234@PBQBU1234@H$0A@@01@0U?$_CopySegment@V?$__deque_iterator@UPrefixCrc@CrcCordState@crc_internal@absl@@PBU1234@ABU1234@PBQBU1234@H$0A@@__Cr@std@@V?$__deque_iterator@UPrefixCrc@CrcCordState@crc_internal@absl@@PAU1234@AAU1234@PAPAU1234@H$0A@@23@@__copy_impl@01@@Z ??$__insert_with_size@V?$__wrap_iter@PAUraw_view@?1???R?$ConvertToContainer@V?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@23@$0A@@?$Splitter@VByChar@absl@@UAllowEmpty@2@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@strings_internal@absl@@QBE?AV?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@ABV345@@Z@@__Cr@std@@V123@@?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@AAE?AV?$__wrap_iter@PAV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@12@V?$__wrap_iter@PBV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@12@V?$__wrap_iter@PAUraw_view@?1???R?$ConvertToContainer@V?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@23@$0A@@?$Splitter@VByChar@absl@@UAllowEmpty@2@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@strings_internal@absl@@QBE?AV?$vector@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@V?$allocator@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@23@@__Cr@std@@ABV345@@Z@@12@1H@Z - ??$combine@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@$$V@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@ABV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@@Z - ??$combine@V?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@H@?$HashStateBase@VMixingHashState@hash_internal@absl@@@hash_internal@absl@@SA?AVMixingHashState@12@V312@ABV?$basic_string_view@DU?$char_traits@D@__Cr@std@@@__Cr@std@@ABH@Z ??$emplace@$$V@?$vector@UTransition@cctz@time_internal@absl@@V?$allocator@UTransition@cctz@time_internal@absl@@@__Cr@std@@@__Cr@std@@QAE?AV?$__wrap_iter@PAUTransition@cctz@time_internal@absl@@@12@V?$__wrap_iter@PBUTransition@cctz@time_internal@absl@@@12@@Z ??$emplace@$$V@?$vector@UTransitionType@cctz@time_internal@absl@@V?$allocator@UTransitionType@cctz@time_internal@absl@@@__Cr@std@@@__Cr@std@@QAE?AV?$__wrap_iter@PAUTransitionType@cctz@time_internal@absl@@@12@V?$__wrap_iter@PBUTransitionType@cctz@time_internal@absl@@@12@@Z ??$emplace_back@$$V@?$__split_buffer@UTransition@cctz@time_internal@absl@@AAV?$allocator@UTransition@cctz@time_internal@absl@@@__Cr@std@@@__Cr@std@@QAEXXZ
diff --git a/third_party/angle b/third_party/angle index 1e4ad68..88710dc 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit 1e4ad682f1e283b0774f08e4da6c5d05381ddb3f +Subproject commit 88710dc139338240b0efd7fdc691d2c69555ed32
diff --git a/third_party/blink/public/devtools_protocol/browser_protocol.pdl b/third_party/blink/public/devtools_protocol/browser_protocol.pdl index e9062166..a3edd26 100644 --- a/third_party/blink/public/devtools_protocol/browser_protocol.pdl +++ b/third_party/blink/public/devtools_protocol/browser_protocol.pdl
@@ -9186,13 +9186,15 @@ # Recommendation for manifest's id attribute to match current id computed from start_url optional string recommendedId - experimental command getAdScriptId + experimental command getAdScriptAncestryIds parameters FrameId frameId returns - # Identifies the bottom-most script which caused the frame to be labelled - # as an ad. Only sent if frame is labelled as an ad and id is available. - optional AdScriptId adScriptId + # The ancestry chain of ad script identifiers leading to this frame's + # creation, ordered from the most immediate script (in the frame creation + # stack) to more distant ancestors (that created the immediately preceding + # script). Only sent if frame is labelled as an ad and ids are available. + array of AdScriptId adScriptAncestryIds # Returns present frame tree structure. command getFrameTree @@ -9804,6 +9806,8 @@ # closed. event javascriptDialogClosed parameters + # Frame id. + experimental FrameId frameId # Whether dialog was confirmed. boolean result # User input in case of prompt. @@ -9815,6 +9819,8 @@ parameters # Frame url. string url + # Frame id. + experimental FrameId frameId # Message that will be displayed by the dialog. string message # Dialog type.
diff --git a/third_party/blink/public/mojom/content_extraction/ai_page_content.mojom b/third_party/blink/public/mojom/content_extraction/ai_page_content.mojom index 5f672be0..747d863 100644 --- a/third_party/blink/public/mojom/content_extraction/ai_page_content.mojom +++ b/third_party/blink/public/mojom/content_extraction/ai_page_content.mojom
@@ -116,11 +116,9 @@ }; struct AIPageContentNodeInteractionInfo { - // Whether the content node can scroll in the x direction. - bool scrolls_overflow_x; - - // Whether the content node can scroll in the y direction. - bool scrolls_overflow_y; + // If this node supports scrolling, provides information about its current + // state. + AIPageContentScrollerInfo? scroller_info; // Whether the content node is selectable. bool is_selectable; @@ -151,6 +149,25 @@ int32 for_dom_node_id; }; +// The coordinate space for the dimensions here is physical coordinates (not +// logical coordinates). This means it's the same irrespective of the writing +// mode. +// The dimensions also exclude non-overlay scrollbars. +struct AIPageContentScrollerInfo { + // The complete layout dimensions of the scroller. This is the total area + // that can be revealed through a scroll operation. + gfx.mojom.Size scrolling_bounds; + + // The subset of this scroller's content which is currently scrolled to. This + // is relative to the origin of `scrolling_bounds`. + gfx.mojom.Rect visible_area; + + // Indicates whether this can be scrolled by the user in horizontal or + // vertical directions. + bool user_scrollable_horizontal; + bool user_scrollable_vertical; +}; + enum AIPageContentTextSize { kXS, kS,
diff --git a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom index f1c74bc..cf0994f 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
@@ -4849,6 +4849,7 @@ kRoleAttributeTreeitem = 5545, kInputParsedParentSelect = 5546, kInputParsedAncestorSelect = 5547, + kCSSSelectorPseudoHasSlotted = 5548, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots. Also don't add extra
diff --git a/third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom b/third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom index 6bcd5b0..0863cd37 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom
@@ -373,6 +373,9 @@ kCompressionDictionaryTransport = 315, kHttp3 = 316, kSpeculationRules = 317, + kTextBox = 318, + kScrollInitialTarget = 319, + kHasSlotted = 320, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/renderer/bindings/core/v8/active_script_wrappable_creation_key.h b/third_party/blink/renderer/bindings/core/v8/active_script_wrappable_creation_key.h index f438368..49275ae 100644 --- a/third_party/blink/renderer/bindings/core/v8/active_script_wrappable_creation_key.h +++ b/third_party/blink/renderer/bindings/core/v8/active_script_wrappable_creation_key.h
@@ -66,6 +66,7 @@ friend class MediaSource; friend class MediaRecorder; friend class MediaStream; + friend class MediaStreamAudioDestinationNode; friend class MediaStreamAudioSourceNode; friend class MediaStreamTrack; friend class MessagePort;
diff --git a/third_party/blink/renderer/bindings/core/v8/script_iterator.cc b/third_party/blink/renderer/bindings/core/v8/script_iterator.cc index 8d8b9e9..ebdcfdfc 100644 --- a/third_party/blink/renderer/bindings/core/v8/script_iterator.cc +++ b/third_party/blink/renderer/bindings/core/v8/script_iterator.cc
@@ -263,6 +263,13 @@ return ScriptValue(); } + // 4. If innerResult is a normal completion, then + // a. Let return be innerResult.[[Value]]. + // b. If return is undefined, return ? completion. + if (return_method->IsNullOrUndefined()) { + return ScriptValue(); + } + // 7.3.10 GetMethod(V, P): // // 3. If IsCallable(func) is false, throw a TypeError exception. @@ -271,13 +278,6 @@ return ScriptValue(); } - // 4. If innerResult is a normal completion, then - // a. Let return be innerResult.[[Value]]. - // b. If return is undefined, return ? completion. - if (return_method->IsNullOrUndefined()) { - return ScriptValue(); - } - // 4.c. Set innerResult to Completion(Call(return, iterator)). v8::Local<v8::Value> return_value; if (!V8ScriptRunner::CallFunction(return_method.As<v8::Function>(),
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_compile_hints_producer.cc b/third_party/blink/renderer/bindings/core/v8/v8_compile_hints_producer.cc index 6c46330..ef400f6 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_compile_hints_producer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_compile_hints_producer.cc
@@ -218,1032 +218,1033 @@ // Send the data to UKM. DCHECK_NE(execution_context->UkmSourceID(), ukm::kInvalidSourceId); ukm::UkmRecorder* ukm_recorder = execution_context->UkmRecorder(); - ukm::builders::V8CompileHints_Version5(execution_context->UkmSourceID()) - .SetData0(static_cast<int64_t>(raw_data[1]) << 32 | raw_data[0]) - .SetData1(static_cast<int64_t>(raw_data[3]) << 32 | raw_data[2]) - .SetData2(static_cast<int64_t>(raw_data[5]) << 32 | raw_data[4]) - .SetData3(static_cast<int64_t>(raw_data[7]) << 32 | raw_data[6]) - .SetData4(static_cast<int64_t>(raw_data[9]) << 32 | raw_data[8]) - .SetData5(static_cast<int64_t>(raw_data[11]) << 32 | raw_data[10]) - .SetData6(static_cast<int64_t>(raw_data[13]) << 32 | raw_data[12]) - .SetData7(static_cast<int64_t>(raw_data[15]) << 32 | raw_data[14]) - .SetData8(static_cast<int64_t>(raw_data[17]) << 32 | raw_data[16]) - .SetData9(static_cast<int64_t>(raw_data[19]) << 32 | raw_data[18]) - .SetData10(static_cast<int64_t>(raw_data[21]) << 32 | raw_data[20]) - .SetData11(static_cast<int64_t>(raw_data[23]) << 32 | raw_data[22]) - .SetData12(static_cast<int64_t>(raw_data[25]) << 32 | raw_data[24]) - .SetData13(static_cast<int64_t>(raw_data[27]) << 32 | raw_data[26]) - .SetData14(static_cast<int64_t>(raw_data[29]) << 32 | raw_data[28]) - .SetData15(static_cast<int64_t>(raw_data[31]) << 32 | raw_data[30]) - .SetData16(static_cast<int64_t>(raw_data[33]) << 32 | raw_data[32]) - .SetData17(static_cast<int64_t>(raw_data[35]) << 32 | raw_data[34]) - .SetData18(static_cast<int64_t>(raw_data[37]) << 32 | raw_data[36]) - .SetData19(static_cast<int64_t>(raw_data[39]) << 32 | raw_data[38]) - .SetData20(static_cast<int64_t>(raw_data[41]) << 32 | raw_data[40]) - .SetData21(static_cast<int64_t>(raw_data[43]) << 32 | raw_data[42]) - .SetData22(static_cast<int64_t>(raw_data[45]) << 32 | raw_data[44]) - .SetData23(static_cast<int64_t>(raw_data[47]) << 32 | raw_data[46]) - .SetData24(static_cast<int64_t>(raw_data[49]) << 32 | raw_data[48]) - .SetData25(static_cast<int64_t>(raw_data[51]) << 32 | raw_data[50]) - .SetData26(static_cast<int64_t>(raw_data[53]) << 32 | raw_data[52]) - .SetData27(static_cast<int64_t>(raw_data[55]) << 32 | raw_data[54]) - .SetData28(static_cast<int64_t>(raw_data[57]) << 32 | raw_data[56]) - .SetData29(static_cast<int64_t>(raw_data[59]) << 32 | raw_data[58]) - .SetData30(static_cast<int64_t>(raw_data[61]) << 32 | raw_data[60]) - .SetData31(static_cast<int64_t>(raw_data[63]) << 32 | raw_data[62]) - .SetData32(static_cast<int64_t>(raw_data[65]) << 32 | raw_data[64]) - .SetData33(static_cast<int64_t>(raw_data[67]) << 32 | raw_data[66]) - .SetData34(static_cast<int64_t>(raw_data[69]) << 32 | raw_data[68]) - .SetData35(static_cast<int64_t>(raw_data[71]) << 32 | raw_data[70]) - .SetData36(static_cast<int64_t>(raw_data[73]) << 32 | raw_data[72]) - .SetData37(static_cast<int64_t>(raw_data[75]) << 32 | raw_data[74]) - .SetData38(static_cast<int64_t>(raw_data[77]) << 32 | raw_data[76]) - .SetData39(static_cast<int64_t>(raw_data[79]) << 32 | raw_data[78]) - .SetData40(static_cast<int64_t>(raw_data[81]) << 32 | raw_data[80]) - .SetData41(static_cast<int64_t>(raw_data[83]) << 32 | raw_data[82]) - .SetData42(static_cast<int64_t>(raw_data[85]) << 32 | raw_data[84]) - .SetData43(static_cast<int64_t>(raw_data[87]) << 32 | raw_data[86]) - .SetData44(static_cast<int64_t>(raw_data[89]) << 32 | raw_data[88]) - .SetData45(static_cast<int64_t>(raw_data[91]) << 32 | raw_data[90]) - .SetData46(static_cast<int64_t>(raw_data[93]) << 32 | raw_data[92]) - .SetData47(static_cast<int64_t>(raw_data[95]) << 32 | raw_data[94]) - .SetData48(static_cast<int64_t>(raw_data[97]) << 32 | raw_data[96]) - .SetData49(static_cast<int64_t>(raw_data[99]) << 32 | raw_data[98]) - .SetData50(static_cast<int64_t>(raw_data[101]) << 32 | raw_data[100]) - .SetData51(static_cast<int64_t>(raw_data[103]) << 32 | raw_data[102]) - .SetData52(static_cast<int64_t>(raw_data[105]) << 32 | raw_data[104]) - .SetData53(static_cast<int64_t>(raw_data[107]) << 32 | raw_data[106]) - .SetData54(static_cast<int64_t>(raw_data[109]) << 32 | raw_data[108]) - .SetData55(static_cast<int64_t>(raw_data[111]) << 32 | raw_data[110]) - .SetData56(static_cast<int64_t>(raw_data[113]) << 32 | raw_data[112]) - .SetData57(static_cast<int64_t>(raw_data[115]) << 32 | raw_data[114]) - .SetData58(static_cast<int64_t>(raw_data[117]) << 32 | raw_data[116]) - .SetData59(static_cast<int64_t>(raw_data[119]) << 32 | raw_data[118]) - .SetData60(static_cast<int64_t>(raw_data[121]) << 32 | raw_data[120]) - .SetData61(static_cast<int64_t>(raw_data[123]) << 32 | raw_data[122]) - .SetData62(static_cast<int64_t>(raw_data[125]) << 32 | raw_data[124]) - .SetData63(static_cast<int64_t>(raw_data[127]) << 32 | raw_data[126]) - .SetData64(static_cast<int64_t>(raw_data[129]) << 32 | raw_data[128]) - .SetData65(static_cast<int64_t>(raw_data[131]) << 32 | raw_data[130]) - .SetData66(static_cast<int64_t>(raw_data[133]) << 32 | raw_data[132]) - .SetData67(static_cast<int64_t>(raw_data[135]) << 32 | raw_data[134]) - .SetData68(static_cast<int64_t>(raw_data[137]) << 32 | raw_data[136]) - .SetData69(static_cast<int64_t>(raw_data[139]) << 32 | raw_data[138]) - .SetData70(static_cast<int64_t>(raw_data[141]) << 32 | raw_data[140]) - .SetData71(static_cast<int64_t>(raw_data[143]) << 32 | raw_data[142]) - .SetData72(static_cast<int64_t>(raw_data[145]) << 32 | raw_data[144]) - .SetData73(static_cast<int64_t>(raw_data[147]) << 32 | raw_data[146]) - .SetData74(static_cast<int64_t>(raw_data[149]) << 32 | raw_data[148]) - .SetData75(static_cast<int64_t>(raw_data[151]) << 32 | raw_data[150]) - .SetData76(static_cast<int64_t>(raw_data[153]) << 32 | raw_data[152]) - .SetData77(static_cast<int64_t>(raw_data[155]) << 32 | raw_data[154]) - .SetData78(static_cast<int64_t>(raw_data[157]) << 32 | raw_data[156]) - .SetData79(static_cast<int64_t>(raw_data[159]) << 32 | raw_data[158]) - .SetData80(static_cast<int64_t>(raw_data[161]) << 32 | raw_data[160]) - .SetData81(static_cast<int64_t>(raw_data[163]) << 32 | raw_data[162]) - .SetData82(static_cast<int64_t>(raw_data[165]) << 32 | raw_data[164]) - .SetData83(static_cast<int64_t>(raw_data[167]) << 32 | raw_data[166]) - .SetData84(static_cast<int64_t>(raw_data[169]) << 32 | raw_data[168]) - .SetData85(static_cast<int64_t>(raw_data[171]) << 32 | raw_data[170]) - .SetData86(static_cast<int64_t>(raw_data[173]) << 32 | raw_data[172]) - .SetData87(static_cast<int64_t>(raw_data[175]) << 32 | raw_data[174]) - .SetData88(static_cast<int64_t>(raw_data[177]) << 32 | raw_data[176]) - .SetData89(static_cast<int64_t>(raw_data[179]) << 32 | raw_data[178]) - .SetData90(static_cast<int64_t>(raw_data[181]) << 32 | raw_data[180]) - .SetData91(static_cast<int64_t>(raw_data[183]) << 32 | raw_data[182]) - .SetData92(static_cast<int64_t>(raw_data[185]) << 32 | raw_data[184]) - .SetData93(static_cast<int64_t>(raw_data[187]) << 32 | raw_data[186]) - .SetData94(static_cast<int64_t>(raw_data[189]) << 32 | raw_data[188]) - .SetData95(static_cast<int64_t>(raw_data[191]) << 32 | raw_data[190]) - .SetData96(static_cast<int64_t>(raw_data[193]) << 32 | raw_data[192]) - .SetData97(static_cast<int64_t>(raw_data[195]) << 32 | raw_data[194]) - .SetData98(static_cast<int64_t>(raw_data[197]) << 32 | raw_data[196]) - .SetData99(static_cast<int64_t>(raw_data[199]) << 32 | raw_data[198]) - .SetData100(static_cast<int64_t>(raw_data[201]) << 32 | raw_data[200]) - .SetData101(static_cast<int64_t>(raw_data[203]) << 32 | raw_data[202]) - .SetData102(static_cast<int64_t>(raw_data[205]) << 32 | raw_data[204]) - .SetData103(static_cast<int64_t>(raw_data[207]) << 32 | raw_data[206]) - .SetData104(static_cast<int64_t>(raw_data[209]) << 32 | raw_data[208]) - .SetData105(static_cast<int64_t>(raw_data[211]) << 32 | raw_data[210]) - .SetData106(static_cast<int64_t>(raw_data[213]) << 32 | raw_data[212]) - .SetData107(static_cast<int64_t>(raw_data[215]) << 32 | raw_data[214]) - .SetData108(static_cast<int64_t>(raw_data[217]) << 32 | raw_data[216]) - .SetData109(static_cast<int64_t>(raw_data[219]) << 32 | raw_data[218]) - .SetData110(static_cast<int64_t>(raw_data[221]) << 32 | raw_data[220]) - .SetData111(static_cast<int64_t>(raw_data[223]) << 32 | raw_data[222]) - .SetData112(static_cast<int64_t>(raw_data[225]) << 32 | raw_data[224]) - .SetData113(static_cast<int64_t>(raw_data[227]) << 32 | raw_data[226]) - .SetData114(static_cast<int64_t>(raw_data[229]) << 32 | raw_data[228]) - .SetData115(static_cast<int64_t>(raw_data[231]) << 32 | raw_data[230]) - .SetData116(static_cast<int64_t>(raw_data[233]) << 32 | raw_data[232]) - .SetData117(static_cast<int64_t>(raw_data[235]) << 32 | raw_data[234]) - .SetData118(static_cast<int64_t>(raw_data[237]) << 32 | raw_data[236]) - .SetData119(static_cast<int64_t>(raw_data[239]) << 32 | raw_data[238]) - .SetData120(static_cast<int64_t>(raw_data[241]) << 32 | raw_data[240]) - .SetData121(static_cast<int64_t>(raw_data[243]) << 32 | raw_data[242]) - .SetData122(static_cast<int64_t>(raw_data[245]) << 32 | raw_data[244]) - .SetData123(static_cast<int64_t>(raw_data[247]) << 32 | raw_data[246]) - .SetData124(static_cast<int64_t>(raw_data[249]) << 32 | raw_data[248]) - .SetData125(static_cast<int64_t>(raw_data[251]) << 32 | raw_data[250]) - .SetData126(static_cast<int64_t>(raw_data[253]) << 32 | raw_data[252]) - .SetData127(static_cast<int64_t>(raw_data[255]) << 32 | raw_data[254]) - .SetData128(static_cast<int64_t>(raw_data[257]) << 32 | raw_data[256]) - .SetData129(static_cast<int64_t>(raw_data[259]) << 32 | raw_data[258]) - .SetData130(static_cast<int64_t>(raw_data[261]) << 32 | raw_data[260]) - .SetData131(static_cast<int64_t>(raw_data[263]) << 32 | raw_data[262]) - .SetData132(static_cast<int64_t>(raw_data[265]) << 32 | raw_data[264]) - .SetData133(static_cast<int64_t>(raw_data[267]) << 32 | raw_data[266]) - .SetData134(static_cast<int64_t>(raw_data[269]) << 32 | raw_data[268]) - .SetData135(static_cast<int64_t>(raw_data[271]) << 32 | raw_data[270]) - .SetData136(static_cast<int64_t>(raw_data[273]) << 32 | raw_data[272]) - .SetData137(static_cast<int64_t>(raw_data[275]) << 32 | raw_data[274]) - .SetData138(static_cast<int64_t>(raw_data[277]) << 32 | raw_data[276]) - .SetData139(static_cast<int64_t>(raw_data[279]) << 32 | raw_data[278]) - .SetData140(static_cast<int64_t>(raw_data[281]) << 32 | raw_data[280]) - .SetData141(static_cast<int64_t>(raw_data[283]) << 32 | raw_data[282]) - .SetData142(static_cast<int64_t>(raw_data[285]) << 32 | raw_data[284]) - .SetData143(static_cast<int64_t>(raw_data[287]) << 32 | raw_data[286]) - .SetData144(static_cast<int64_t>(raw_data[289]) << 32 | raw_data[288]) - .SetData145(static_cast<int64_t>(raw_data[291]) << 32 | raw_data[290]) - .SetData146(static_cast<int64_t>(raw_data[293]) << 32 | raw_data[292]) - .SetData147(static_cast<int64_t>(raw_data[295]) << 32 | raw_data[294]) - .SetData148(static_cast<int64_t>(raw_data[297]) << 32 | raw_data[296]) - .SetData149(static_cast<int64_t>(raw_data[299]) << 32 | raw_data[298]) - .SetData150(static_cast<int64_t>(raw_data[301]) << 32 | raw_data[300]) - .SetData151(static_cast<int64_t>(raw_data[303]) << 32 | raw_data[302]) - .SetData152(static_cast<int64_t>(raw_data[305]) << 32 | raw_data[304]) - .SetData153(static_cast<int64_t>(raw_data[307]) << 32 | raw_data[306]) - .SetData154(static_cast<int64_t>(raw_data[309]) << 32 | raw_data[308]) - .SetData155(static_cast<int64_t>(raw_data[311]) << 32 | raw_data[310]) - .SetData156(static_cast<int64_t>(raw_data[313]) << 32 | raw_data[312]) - .SetData157(static_cast<int64_t>(raw_data[315]) << 32 | raw_data[314]) - .SetData158(static_cast<int64_t>(raw_data[317]) << 32 | raw_data[316]) - .SetData159(static_cast<int64_t>(raw_data[319]) << 32 | raw_data[318]) - .SetData160(static_cast<int64_t>(raw_data[321]) << 32 | raw_data[320]) - .SetData161(static_cast<int64_t>(raw_data[323]) << 32 | raw_data[322]) - .SetData162(static_cast<int64_t>(raw_data[325]) << 32 | raw_data[324]) - .SetData163(static_cast<int64_t>(raw_data[327]) << 32 | raw_data[326]) - .SetData164(static_cast<int64_t>(raw_data[329]) << 32 | raw_data[328]) - .SetData165(static_cast<int64_t>(raw_data[331]) << 32 | raw_data[330]) - .SetData166(static_cast<int64_t>(raw_data[333]) << 32 | raw_data[332]) - .SetData167(static_cast<int64_t>(raw_data[335]) << 32 | raw_data[334]) - .SetData168(static_cast<int64_t>(raw_data[337]) << 32 | raw_data[336]) - .SetData169(static_cast<int64_t>(raw_data[339]) << 32 | raw_data[338]) - .SetData170(static_cast<int64_t>(raw_data[341]) << 32 | raw_data[340]) - .SetData171(static_cast<int64_t>(raw_data[343]) << 32 | raw_data[342]) - .SetData172(static_cast<int64_t>(raw_data[345]) << 32 | raw_data[344]) - .SetData173(static_cast<int64_t>(raw_data[347]) << 32 | raw_data[346]) - .SetData174(static_cast<int64_t>(raw_data[349]) << 32 | raw_data[348]) - .SetData175(static_cast<int64_t>(raw_data[351]) << 32 | raw_data[350]) - .SetData176(static_cast<int64_t>(raw_data[353]) << 32 | raw_data[352]) - .SetData177(static_cast<int64_t>(raw_data[355]) << 32 | raw_data[354]) - .SetData178(static_cast<int64_t>(raw_data[357]) << 32 | raw_data[356]) - .SetData179(static_cast<int64_t>(raw_data[359]) << 32 | raw_data[358]) - .SetData180(static_cast<int64_t>(raw_data[361]) << 32 | raw_data[360]) - .SetData181(static_cast<int64_t>(raw_data[363]) << 32 | raw_data[362]) - .SetData182(static_cast<int64_t>(raw_data[365]) << 32 | raw_data[364]) - .SetData183(static_cast<int64_t>(raw_data[367]) << 32 | raw_data[366]) - .SetData184(static_cast<int64_t>(raw_data[369]) << 32 | raw_data[368]) - .SetData185(static_cast<int64_t>(raw_data[371]) << 32 | raw_data[370]) - .SetData186(static_cast<int64_t>(raw_data[373]) << 32 | raw_data[372]) - .SetData187(static_cast<int64_t>(raw_data[375]) << 32 | raw_data[374]) - .SetData188(static_cast<int64_t>(raw_data[377]) << 32 | raw_data[376]) - .SetData189(static_cast<int64_t>(raw_data[379]) << 32 | raw_data[378]) - .SetData190(static_cast<int64_t>(raw_data[381]) << 32 | raw_data[380]) - .SetData191(static_cast<int64_t>(raw_data[383]) << 32 | raw_data[382]) - .SetData192(static_cast<int64_t>(raw_data[385]) << 32 | raw_data[384]) - .SetData193(static_cast<int64_t>(raw_data[387]) << 32 | raw_data[386]) - .SetData194(static_cast<int64_t>(raw_data[389]) << 32 | raw_data[388]) - .SetData195(static_cast<int64_t>(raw_data[391]) << 32 | raw_data[390]) - .SetData196(static_cast<int64_t>(raw_data[393]) << 32 | raw_data[392]) - .SetData197(static_cast<int64_t>(raw_data[395]) << 32 | raw_data[394]) - .SetData198(static_cast<int64_t>(raw_data[397]) << 32 | raw_data[396]) - .SetData199(static_cast<int64_t>(raw_data[399]) << 32 | raw_data[398]) - .SetData200(static_cast<int64_t>(raw_data[401]) << 32 | raw_data[400]) - .SetData201(static_cast<int64_t>(raw_data[403]) << 32 | raw_data[402]) - .SetData202(static_cast<int64_t>(raw_data[405]) << 32 | raw_data[404]) - .SetData203(static_cast<int64_t>(raw_data[407]) << 32 | raw_data[406]) - .SetData204(static_cast<int64_t>(raw_data[409]) << 32 | raw_data[408]) - .SetData205(static_cast<int64_t>(raw_data[411]) << 32 | raw_data[410]) - .SetData206(static_cast<int64_t>(raw_data[413]) << 32 | raw_data[412]) - .SetData207(static_cast<int64_t>(raw_data[415]) << 32 | raw_data[414]) - .SetData208(static_cast<int64_t>(raw_data[417]) << 32 | raw_data[416]) - .SetData209(static_cast<int64_t>(raw_data[419]) << 32 | raw_data[418]) - .SetData210(static_cast<int64_t>(raw_data[421]) << 32 | raw_data[420]) - .SetData211(static_cast<int64_t>(raw_data[423]) << 32 | raw_data[422]) - .SetData212(static_cast<int64_t>(raw_data[425]) << 32 | raw_data[424]) - .SetData213(static_cast<int64_t>(raw_data[427]) << 32 | raw_data[426]) - .SetData214(static_cast<int64_t>(raw_data[429]) << 32 | raw_data[428]) - .SetData215(static_cast<int64_t>(raw_data[431]) << 32 | raw_data[430]) - .SetData216(static_cast<int64_t>(raw_data[433]) << 32 | raw_data[432]) - .SetData217(static_cast<int64_t>(raw_data[435]) << 32 | raw_data[434]) - .SetData218(static_cast<int64_t>(raw_data[437]) << 32 | raw_data[436]) - .SetData219(static_cast<int64_t>(raw_data[439]) << 32 | raw_data[438]) - .SetData220(static_cast<int64_t>(raw_data[441]) << 32 | raw_data[440]) - .SetData221(static_cast<int64_t>(raw_data[443]) << 32 | raw_data[442]) - .SetData222(static_cast<int64_t>(raw_data[445]) << 32 | raw_data[444]) - .SetData223(static_cast<int64_t>(raw_data[447]) << 32 | raw_data[446]) - .SetData224(static_cast<int64_t>(raw_data[449]) << 32 | raw_data[448]) - .SetData225(static_cast<int64_t>(raw_data[451]) << 32 | raw_data[450]) - .SetData226(static_cast<int64_t>(raw_data[453]) << 32 | raw_data[452]) - .SetData227(static_cast<int64_t>(raw_data[455]) << 32 | raw_data[454]) - .SetData228(static_cast<int64_t>(raw_data[457]) << 32 | raw_data[456]) - .SetData229(static_cast<int64_t>(raw_data[459]) << 32 | raw_data[458]) - .SetData230(static_cast<int64_t>(raw_data[461]) << 32 | raw_data[460]) - .SetData231(static_cast<int64_t>(raw_data[463]) << 32 | raw_data[462]) - .SetData232(static_cast<int64_t>(raw_data[465]) << 32 | raw_data[464]) - .SetData233(static_cast<int64_t>(raw_data[467]) << 32 | raw_data[466]) - .SetData234(static_cast<int64_t>(raw_data[469]) << 32 | raw_data[468]) - .SetData235(static_cast<int64_t>(raw_data[471]) << 32 | raw_data[470]) - .SetData236(static_cast<int64_t>(raw_data[473]) << 32 | raw_data[472]) - .SetData237(static_cast<int64_t>(raw_data[475]) << 32 | raw_data[474]) - .SetData238(static_cast<int64_t>(raw_data[477]) << 32 | raw_data[476]) - .SetData239(static_cast<int64_t>(raw_data[479]) << 32 | raw_data[478]) - .SetData240(static_cast<int64_t>(raw_data[481]) << 32 | raw_data[480]) - .SetData241(static_cast<int64_t>(raw_data[483]) << 32 | raw_data[482]) - .SetData242(static_cast<int64_t>(raw_data[485]) << 32 | raw_data[484]) - .SetData243(static_cast<int64_t>(raw_data[487]) << 32 | raw_data[486]) - .SetData244(static_cast<int64_t>(raw_data[489]) << 32 | raw_data[488]) - .SetData245(static_cast<int64_t>(raw_data[491]) << 32 | raw_data[490]) - .SetData246(static_cast<int64_t>(raw_data[493]) << 32 | raw_data[492]) - .SetData247(static_cast<int64_t>(raw_data[495]) << 32 | raw_data[494]) - .SetData248(static_cast<int64_t>(raw_data[497]) << 32 | raw_data[496]) - .SetData249(static_cast<int64_t>(raw_data[499]) << 32 | raw_data[498]) - .SetData250(static_cast<int64_t>(raw_data[501]) << 32 | raw_data[500]) - .SetData251(static_cast<int64_t>(raw_data[503]) << 32 | raw_data[502]) - .SetData252(static_cast<int64_t>(raw_data[505]) << 32 | raw_data[504]) - .SetData253(static_cast<int64_t>(raw_data[507]) << 32 | raw_data[506]) - .SetData254(static_cast<int64_t>(raw_data[509]) << 32 | raw_data[508]) - .SetData255(static_cast<int64_t>(raw_data[511]) << 32 | raw_data[510]) - .SetData256(static_cast<int64_t>(raw_data[513]) << 32 | raw_data[512]) - .SetData257(static_cast<int64_t>(raw_data[515]) << 32 | raw_data[514]) - .SetData258(static_cast<int64_t>(raw_data[517]) << 32 | raw_data[516]) - .SetData259(static_cast<int64_t>(raw_data[519]) << 32 | raw_data[518]) - .SetData260(static_cast<int64_t>(raw_data[521]) << 32 | raw_data[520]) - .SetData261(static_cast<int64_t>(raw_data[523]) << 32 | raw_data[522]) - .SetData262(static_cast<int64_t>(raw_data[525]) << 32 | raw_data[524]) - .SetData263(static_cast<int64_t>(raw_data[527]) << 32 | raw_data[526]) - .SetData264(static_cast<int64_t>(raw_data[529]) << 32 | raw_data[528]) - .SetData265(static_cast<int64_t>(raw_data[531]) << 32 | raw_data[530]) - .SetData266(static_cast<int64_t>(raw_data[533]) << 32 | raw_data[532]) - .SetData267(static_cast<int64_t>(raw_data[535]) << 32 | raw_data[534]) - .SetData268(static_cast<int64_t>(raw_data[537]) << 32 | raw_data[536]) - .SetData269(static_cast<int64_t>(raw_data[539]) << 32 | raw_data[538]) - .SetData270(static_cast<int64_t>(raw_data[541]) << 32 | raw_data[540]) - .SetData271(static_cast<int64_t>(raw_data[543]) << 32 | raw_data[542]) - .SetData272(static_cast<int64_t>(raw_data[545]) << 32 | raw_data[544]) - .SetData273(static_cast<int64_t>(raw_data[547]) << 32 | raw_data[546]) - .SetData274(static_cast<int64_t>(raw_data[549]) << 32 | raw_data[548]) - .SetData275(static_cast<int64_t>(raw_data[551]) << 32 | raw_data[550]) - .SetData276(static_cast<int64_t>(raw_data[553]) << 32 | raw_data[552]) - .SetData277(static_cast<int64_t>(raw_data[555]) << 32 | raw_data[554]) - .SetData278(static_cast<int64_t>(raw_data[557]) << 32 | raw_data[556]) - .SetData279(static_cast<int64_t>(raw_data[559]) << 32 | raw_data[558]) - .SetData280(static_cast<int64_t>(raw_data[561]) << 32 | raw_data[560]) - .SetData281(static_cast<int64_t>(raw_data[563]) << 32 | raw_data[562]) - .SetData282(static_cast<int64_t>(raw_data[565]) << 32 | raw_data[564]) - .SetData283(static_cast<int64_t>(raw_data[567]) << 32 | raw_data[566]) - .SetData284(static_cast<int64_t>(raw_data[569]) << 32 | raw_data[568]) - .SetData285(static_cast<int64_t>(raw_data[571]) << 32 | raw_data[570]) - .SetData286(static_cast<int64_t>(raw_data[573]) << 32 | raw_data[572]) - .SetData287(static_cast<int64_t>(raw_data[575]) << 32 | raw_data[574]) - .SetData288(static_cast<int64_t>(raw_data[577]) << 32 | raw_data[576]) - .SetData289(static_cast<int64_t>(raw_data[579]) << 32 | raw_data[578]) - .SetData290(static_cast<int64_t>(raw_data[581]) << 32 | raw_data[580]) - .SetData291(static_cast<int64_t>(raw_data[583]) << 32 | raw_data[582]) - .SetData292(static_cast<int64_t>(raw_data[585]) << 32 | raw_data[584]) - .SetData293(static_cast<int64_t>(raw_data[587]) << 32 | raw_data[586]) - .SetData294(static_cast<int64_t>(raw_data[589]) << 32 | raw_data[588]) - .SetData295(static_cast<int64_t>(raw_data[591]) << 32 | raw_data[590]) - .SetData296(static_cast<int64_t>(raw_data[593]) << 32 | raw_data[592]) - .SetData297(static_cast<int64_t>(raw_data[595]) << 32 | raw_data[594]) - .SetData298(static_cast<int64_t>(raw_data[597]) << 32 | raw_data[596]) - .SetData299(static_cast<int64_t>(raw_data[599]) << 32 | raw_data[598]) - .SetData300(static_cast<int64_t>(raw_data[601]) << 32 | raw_data[600]) - .SetData301(static_cast<int64_t>(raw_data[603]) << 32 | raw_data[602]) - .SetData302(static_cast<int64_t>(raw_data[605]) << 32 | raw_data[604]) - .SetData303(static_cast<int64_t>(raw_data[607]) << 32 | raw_data[606]) - .SetData304(static_cast<int64_t>(raw_data[609]) << 32 | raw_data[608]) - .SetData305(static_cast<int64_t>(raw_data[611]) << 32 | raw_data[610]) - .SetData306(static_cast<int64_t>(raw_data[613]) << 32 | raw_data[612]) - .SetData307(static_cast<int64_t>(raw_data[615]) << 32 | raw_data[614]) - .SetData308(static_cast<int64_t>(raw_data[617]) << 32 | raw_data[616]) - .SetData309(static_cast<int64_t>(raw_data[619]) << 32 | raw_data[618]) - .SetData310(static_cast<int64_t>(raw_data[621]) << 32 | raw_data[620]) - .SetData311(static_cast<int64_t>(raw_data[623]) << 32 | raw_data[622]) - .SetData312(static_cast<int64_t>(raw_data[625]) << 32 | raw_data[624]) - .SetData313(static_cast<int64_t>(raw_data[627]) << 32 | raw_data[626]) - .SetData314(static_cast<int64_t>(raw_data[629]) << 32 | raw_data[628]) - .SetData315(static_cast<int64_t>(raw_data[631]) << 32 | raw_data[630]) - .SetData316(static_cast<int64_t>(raw_data[633]) << 32 | raw_data[632]) - .SetData317(static_cast<int64_t>(raw_data[635]) << 32 | raw_data[634]) - .SetData318(static_cast<int64_t>(raw_data[637]) << 32 | raw_data[636]) - .SetData319(static_cast<int64_t>(raw_data[639]) << 32 | raw_data[638]) - .SetData320(static_cast<int64_t>(raw_data[641]) << 32 | raw_data[640]) - .SetData321(static_cast<int64_t>(raw_data[643]) << 32 | raw_data[642]) - .SetData322(static_cast<int64_t>(raw_data[645]) << 32 | raw_data[644]) - .SetData323(static_cast<int64_t>(raw_data[647]) << 32 | raw_data[646]) - .SetData324(static_cast<int64_t>(raw_data[649]) << 32 | raw_data[648]) - .SetData325(static_cast<int64_t>(raw_data[651]) << 32 | raw_data[650]) - .SetData326(static_cast<int64_t>(raw_data[653]) << 32 | raw_data[652]) - .SetData327(static_cast<int64_t>(raw_data[655]) << 32 | raw_data[654]) - .SetData328(static_cast<int64_t>(raw_data[657]) << 32 | raw_data[656]) - .SetData329(static_cast<int64_t>(raw_data[659]) << 32 | raw_data[658]) - .SetData330(static_cast<int64_t>(raw_data[661]) << 32 | raw_data[660]) - .SetData331(static_cast<int64_t>(raw_data[663]) << 32 | raw_data[662]) - .SetData332(static_cast<int64_t>(raw_data[665]) << 32 | raw_data[664]) - .SetData333(static_cast<int64_t>(raw_data[667]) << 32 | raw_data[666]) - .SetData334(static_cast<int64_t>(raw_data[669]) << 32 | raw_data[668]) - .SetData335(static_cast<int64_t>(raw_data[671]) << 32 | raw_data[670]) - .SetData336(static_cast<int64_t>(raw_data[673]) << 32 | raw_data[672]) - .SetData337(static_cast<int64_t>(raw_data[675]) << 32 | raw_data[674]) - .SetData338(static_cast<int64_t>(raw_data[677]) << 32 | raw_data[676]) - .SetData339(static_cast<int64_t>(raw_data[679]) << 32 | raw_data[678]) - .SetData340(static_cast<int64_t>(raw_data[681]) << 32 | raw_data[680]) - .SetData341(static_cast<int64_t>(raw_data[683]) << 32 | raw_data[682]) - .SetData342(static_cast<int64_t>(raw_data[685]) << 32 | raw_data[684]) - .SetData343(static_cast<int64_t>(raw_data[687]) << 32 | raw_data[686]) - .SetData344(static_cast<int64_t>(raw_data[689]) << 32 | raw_data[688]) - .SetData345(static_cast<int64_t>(raw_data[691]) << 32 | raw_data[690]) - .SetData346(static_cast<int64_t>(raw_data[693]) << 32 | raw_data[692]) - .SetData347(static_cast<int64_t>(raw_data[695]) << 32 | raw_data[694]) - .SetData348(static_cast<int64_t>(raw_data[697]) << 32 | raw_data[696]) - .SetData349(static_cast<int64_t>(raw_data[699]) << 32 | raw_data[698]) - .SetData350(static_cast<int64_t>(raw_data[701]) << 32 | raw_data[700]) - .SetData351(static_cast<int64_t>(raw_data[703]) << 32 | raw_data[702]) - .SetData352(static_cast<int64_t>(raw_data[705]) << 32 | raw_data[704]) - .SetData353(static_cast<int64_t>(raw_data[707]) << 32 | raw_data[706]) - .SetData354(static_cast<int64_t>(raw_data[709]) << 32 | raw_data[708]) - .SetData355(static_cast<int64_t>(raw_data[711]) << 32 | raw_data[710]) - .SetData356(static_cast<int64_t>(raw_data[713]) << 32 | raw_data[712]) - .SetData357(static_cast<int64_t>(raw_data[715]) << 32 | raw_data[714]) - .SetData358(static_cast<int64_t>(raw_data[717]) << 32 | raw_data[716]) - .SetData359(static_cast<int64_t>(raw_data[719]) << 32 | raw_data[718]) - .SetData360(static_cast<int64_t>(raw_data[721]) << 32 | raw_data[720]) - .SetData361(static_cast<int64_t>(raw_data[723]) << 32 | raw_data[722]) - .SetData362(static_cast<int64_t>(raw_data[725]) << 32 | raw_data[724]) - .SetData363(static_cast<int64_t>(raw_data[727]) << 32 | raw_data[726]) - .SetData364(static_cast<int64_t>(raw_data[729]) << 32 | raw_data[728]) - .SetData365(static_cast<int64_t>(raw_data[731]) << 32 | raw_data[730]) - .SetData366(static_cast<int64_t>(raw_data[733]) << 32 | raw_data[732]) - .SetData367(static_cast<int64_t>(raw_data[735]) << 32 | raw_data[734]) - .SetData368(static_cast<int64_t>(raw_data[737]) << 32 | raw_data[736]) - .SetData369(static_cast<int64_t>(raw_data[739]) << 32 | raw_data[738]) - .SetData370(static_cast<int64_t>(raw_data[741]) << 32 | raw_data[740]) - .SetData371(static_cast<int64_t>(raw_data[743]) << 32 | raw_data[742]) - .SetData372(static_cast<int64_t>(raw_data[745]) << 32 | raw_data[744]) - .SetData373(static_cast<int64_t>(raw_data[747]) << 32 | raw_data[746]) - .SetData374(static_cast<int64_t>(raw_data[749]) << 32 | raw_data[748]) - .SetData375(static_cast<int64_t>(raw_data[751]) << 32 | raw_data[750]) - .SetData376(static_cast<int64_t>(raw_data[753]) << 32 | raw_data[752]) - .SetData377(static_cast<int64_t>(raw_data[755]) << 32 | raw_data[754]) - .SetData378(static_cast<int64_t>(raw_data[757]) << 32 | raw_data[756]) - .SetData379(static_cast<int64_t>(raw_data[759]) << 32 | raw_data[758]) - .SetData380(static_cast<int64_t>(raw_data[761]) << 32 | raw_data[760]) - .SetData381(static_cast<int64_t>(raw_data[763]) << 32 | raw_data[762]) - .SetData382(static_cast<int64_t>(raw_data[765]) << 32 | raw_data[764]) - .SetData383(static_cast<int64_t>(raw_data[767]) << 32 | raw_data[766]) - .SetData384(static_cast<int64_t>(raw_data[769]) << 32 | raw_data[768]) - .SetData385(static_cast<int64_t>(raw_data[771]) << 32 | raw_data[770]) - .SetData386(static_cast<int64_t>(raw_data[773]) << 32 | raw_data[772]) - .SetData387(static_cast<int64_t>(raw_data[775]) << 32 | raw_data[774]) - .SetData388(static_cast<int64_t>(raw_data[777]) << 32 | raw_data[776]) - .SetData389(static_cast<int64_t>(raw_data[779]) << 32 | raw_data[778]) - .SetData390(static_cast<int64_t>(raw_data[781]) << 32 | raw_data[780]) - .SetData391(static_cast<int64_t>(raw_data[783]) << 32 | raw_data[782]) - .SetData392(static_cast<int64_t>(raw_data[785]) << 32 | raw_data[784]) - .SetData393(static_cast<int64_t>(raw_data[787]) << 32 | raw_data[786]) - .SetData394(static_cast<int64_t>(raw_data[789]) << 32 | raw_data[788]) - .SetData395(static_cast<int64_t>(raw_data[791]) << 32 | raw_data[790]) - .SetData396(static_cast<int64_t>(raw_data[793]) << 32 | raw_data[792]) - .SetData397(static_cast<int64_t>(raw_data[795]) << 32 | raw_data[794]) - .SetData398(static_cast<int64_t>(raw_data[797]) << 32 | raw_data[796]) - .SetData399(static_cast<int64_t>(raw_data[799]) << 32 | raw_data[798]) - .SetData400(static_cast<int64_t>(raw_data[801]) << 32 | raw_data[800]) - .SetData401(static_cast<int64_t>(raw_data[803]) << 32 | raw_data[802]) - .SetData402(static_cast<int64_t>(raw_data[805]) << 32 | raw_data[804]) - .SetData403(static_cast<int64_t>(raw_data[807]) << 32 | raw_data[806]) - .SetData404(static_cast<int64_t>(raw_data[809]) << 32 | raw_data[808]) - .SetData405(static_cast<int64_t>(raw_data[811]) << 32 | raw_data[810]) - .SetData406(static_cast<int64_t>(raw_data[813]) << 32 | raw_data[812]) - .SetData407(static_cast<int64_t>(raw_data[815]) << 32 | raw_data[814]) - .SetData408(static_cast<int64_t>(raw_data[817]) << 32 | raw_data[816]) - .SetData409(static_cast<int64_t>(raw_data[819]) << 32 | raw_data[818]) - .SetData410(static_cast<int64_t>(raw_data[821]) << 32 | raw_data[820]) - .SetData411(static_cast<int64_t>(raw_data[823]) << 32 | raw_data[822]) - .SetData412(static_cast<int64_t>(raw_data[825]) << 32 | raw_data[824]) - .SetData413(static_cast<int64_t>(raw_data[827]) << 32 | raw_data[826]) - .SetData414(static_cast<int64_t>(raw_data[829]) << 32 | raw_data[828]) - .SetData415(static_cast<int64_t>(raw_data[831]) << 32 | raw_data[830]) - .SetData416(static_cast<int64_t>(raw_data[833]) << 32 | raw_data[832]) - .SetData417(static_cast<int64_t>(raw_data[835]) << 32 | raw_data[834]) - .SetData418(static_cast<int64_t>(raw_data[837]) << 32 | raw_data[836]) - .SetData419(static_cast<int64_t>(raw_data[839]) << 32 | raw_data[838]) - .SetData420(static_cast<int64_t>(raw_data[841]) << 32 | raw_data[840]) - .SetData421(static_cast<int64_t>(raw_data[843]) << 32 | raw_data[842]) - .SetData422(static_cast<int64_t>(raw_data[845]) << 32 | raw_data[844]) - .SetData423(static_cast<int64_t>(raw_data[847]) << 32 | raw_data[846]) - .SetData424(static_cast<int64_t>(raw_data[849]) << 32 | raw_data[848]) - .SetData425(static_cast<int64_t>(raw_data[851]) << 32 | raw_data[850]) - .SetData426(static_cast<int64_t>(raw_data[853]) << 32 | raw_data[852]) - .SetData427(static_cast<int64_t>(raw_data[855]) << 32 | raw_data[854]) - .SetData428(static_cast<int64_t>(raw_data[857]) << 32 | raw_data[856]) - .SetData429(static_cast<int64_t>(raw_data[859]) << 32 | raw_data[858]) - .SetData430(static_cast<int64_t>(raw_data[861]) << 32 | raw_data[860]) - .SetData431(static_cast<int64_t>(raw_data[863]) << 32 | raw_data[862]) - .SetData432(static_cast<int64_t>(raw_data[865]) << 32 | raw_data[864]) - .SetData433(static_cast<int64_t>(raw_data[867]) << 32 | raw_data[866]) - .SetData434(static_cast<int64_t>(raw_data[869]) << 32 | raw_data[868]) - .SetData435(static_cast<int64_t>(raw_data[871]) << 32 | raw_data[870]) - .SetData436(static_cast<int64_t>(raw_data[873]) << 32 | raw_data[872]) - .SetData437(static_cast<int64_t>(raw_data[875]) << 32 | raw_data[874]) - .SetData438(static_cast<int64_t>(raw_data[877]) << 32 | raw_data[876]) - .SetData439(static_cast<int64_t>(raw_data[879]) << 32 | raw_data[878]) - .SetData440(static_cast<int64_t>(raw_data[881]) << 32 | raw_data[880]) - .SetData441(static_cast<int64_t>(raw_data[883]) << 32 | raw_data[882]) - .SetData442(static_cast<int64_t>(raw_data[885]) << 32 | raw_data[884]) - .SetData443(static_cast<int64_t>(raw_data[887]) << 32 | raw_data[886]) - .SetData444(static_cast<int64_t>(raw_data[889]) << 32 | raw_data[888]) - .SetData445(static_cast<int64_t>(raw_data[891]) << 32 | raw_data[890]) - .SetData446(static_cast<int64_t>(raw_data[893]) << 32 | raw_data[892]) - .SetData447(static_cast<int64_t>(raw_data[895]) << 32 | raw_data[894]) - .SetData448(static_cast<int64_t>(raw_data[897]) << 32 | raw_data[896]) - .SetData449(static_cast<int64_t>(raw_data[899]) << 32 | raw_data[898]) - .SetData450(static_cast<int64_t>(raw_data[901]) << 32 | raw_data[900]) - .SetData451(static_cast<int64_t>(raw_data[903]) << 32 | raw_data[902]) - .SetData452(static_cast<int64_t>(raw_data[905]) << 32 | raw_data[904]) - .SetData453(static_cast<int64_t>(raw_data[907]) << 32 | raw_data[906]) - .SetData454(static_cast<int64_t>(raw_data[909]) << 32 | raw_data[908]) - .SetData455(static_cast<int64_t>(raw_data[911]) << 32 | raw_data[910]) - .SetData456(static_cast<int64_t>(raw_data[913]) << 32 | raw_data[912]) - .SetData457(static_cast<int64_t>(raw_data[915]) << 32 | raw_data[914]) - .SetData458(static_cast<int64_t>(raw_data[917]) << 32 | raw_data[916]) - .SetData459(static_cast<int64_t>(raw_data[919]) << 32 | raw_data[918]) - .SetData460(static_cast<int64_t>(raw_data[921]) << 32 | raw_data[920]) - .SetData461(static_cast<int64_t>(raw_data[923]) << 32 | raw_data[922]) - .SetData462(static_cast<int64_t>(raw_data[925]) << 32 | raw_data[924]) - .SetData463(static_cast<int64_t>(raw_data[927]) << 32 | raw_data[926]) - .SetData464(static_cast<int64_t>(raw_data[929]) << 32 | raw_data[928]) - .SetData465(static_cast<int64_t>(raw_data[931]) << 32 | raw_data[930]) - .SetData466(static_cast<int64_t>(raw_data[933]) << 32 | raw_data[932]) - .SetData467(static_cast<int64_t>(raw_data[935]) << 32 | raw_data[934]) - .SetData468(static_cast<int64_t>(raw_data[937]) << 32 | raw_data[936]) - .SetData469(static_cast<int64_t>(raw_data[939]) << 32 | raw_data[938]) - .SetData470(static_cast<int64_t>(raw_data[941]) << 32 | raw_data[940]) - .SetData471(static_cast<int64_t>(raw_data[943]) << 32 | raw_data[942]) - .SetData472(static_cast<int64_t>(raw_data[945]) << 32 | raw_data[944]) - .SetData473(static_cast<int64_t>(raw_data[947]) << 32 | raw_data[946]) - .SetData474(static_cast<int64_t>(raw_data[949]) << 32 | raw_data[948]) - .SetData475(static_cast<int64_t>(raw_data[951]) << 32 | raw_data[950]) - .SetData476(static_cast<int64_t>(raw_data[953]) << 32 | raw_data[952]) - .SetData477(static_cast<int64_t>(raw_data[955]) << 32 | raw_data[954]) - .SetData478(static_cast<int64_t>(raw_data[957]) << 32 | raw_data[956]) - .SetData479(static_cast<int64_t>(raw_data[959]) << 32 | raw_data[958]) - .SetData480(static_cast<int64_t>(raw_data[961]) << 32 | raw_data[960]) - .SetData481(static_cast<int64_t>(raw_data[963]) << 32 | raw_data[962]) - .SetData482(static_cast<int64_t>(raw_data[965]) << 32 | raw_data[964]) - .SetData483(static_cast<int64_t>(raw_data[967]) << 32 | raw_data[966]) - .SetData484(static_cast<int64_t>(raw_data[969]) << 32 | raw_data[968]) - .SetData485(static_cast<int64_t>(raw_data[971]) << 32 | raw_data[970]) - .SetData486(static_cast<int64_t>(raw_data[973]) << 32 | raw_data[972]) - .SetData487(static_cast<int64_t>(raw_data[975]) << 32 | raw_data[974]) - .SetData488(static_cast<int64_t>(raw_data[977]) << 32 | raw_data[976]) - .SetData489(static_cast<int64_t>(raw_data[979]) << 32 | raw_data[978]) - .SetData490(static_cast<int64_t>(raw_data[981]) << 32 | raw_data[980]) - .SetData491(static_cast<int64_t>(raw_data[983]) << 32 | raw_data[982]) - .SetData492(static_cast<int64_t>(raw_data[985]) << 32 | raw_data[984]) - .SetData493(static_cast<int64_t>(raw_data[987]) << 32 | raw_data[986]) - .SetData494(static_cast<int64_t>(raw_data[989]) << 32 | raw_data[988]) - .SetData495(static_cast<int64_t>(raw_data[991]) << 32 | raw_data[990]) - .SetData496(static_cast<int64_t>(raw_data[993]) << 32 | raw_data[992]) - .SetData497(static_cast<int64_t>(raw_data[995]) << 32 | raw_data[994]) - .SetData498(static_cast<int64_t>(raw_data[997]) << 32 | raw_data[996]) - .SetData499(static_cast<int64_t>(raw_data[999]) << 32 | raw_data[998]) - .SetData500(static_cast<int64_t>(raw_data[1001]) << 32 | raw_data[1000]) - .SetData501(static_cast<int64_t>(raw_data[1003]) << 32 | raw_data[1002]) - .SetData502(static_cast<int64_t>(raw_data[1005]) << 32 | raw_data[1004]) - .SetData503(static_cast<int64_t>(raw_data[1007]) << 32 | raw_data[1006]) - .SetData504(static_cast<int64_t>(raw_data[1009]) << 32 | raw_data[1008]) - .SetData505(static_cast<int64_t>(raw_data[1011]) << 32 | raw_data[1010]) - .SetData506(static_cast<int64_t>(raw_data[1013]) << 32 | raw_data[1012]) - .SetData507(static_cast<int64_t>(raw_data[1015]) << 32 | raw_data[1014]) - .SetData508(static_cast<int64_t>(raw_data[1017]) << 32 | raw_data[1016]) - .SetData509(static_cast<int64_t>(raw_data[1019]) << 32 | raw_data[1018]) - .SetData510(static_cast<int64_t>(raw_data[1021]) << 32 | raw_data[1020]) - .SetData511(static_cast<int64_t>(raw_data[1023]) << 32 | raw_data[1022]) - .SetData512(static_cast<int64_t>(raw_data[1025]) << 32 | raw_data[1024]) - .SetData513(static_cast<int64_t>(raw_data[1027]) << 32 | raw_data[1026]) - .SetData514(static_cast<int64_t>(raw_data[1029]) << 32 | raw_data[1028]) - .SetData515(static_cast<int64_t>(raw_data[1031]) << 32 | raw_data[1030]) - .SetData516(static_cast<int64_t>(raw_data[1033]) << 32 | raw_data[1032]) - .SetData517(static_cast<int64_t>(raw_data[1035]) << 32 | raw_data[1034]) - .SetData518(static_cast<int64_t>(raw_data[1037]) << 32 | raw_data[1036]) - .SetData519(static_cast<int64_t>(raw_data[1039]) << 32 | raw_data[1038]) - .SetData520(static_cast<int64_t>(raw_data[1041]) << 32 | raw_data[1040]) - .SetData521(static_cast<int64_t>(raw_data[1043]) << 32 | raw_data[1042]) - .SetData522(static_cast<int64_t>(raw_data[1045]) << 32 | raw_data[1044]) - .SetData523(static_cast<int64_t>(raw_data[1047]) << 32 | raw_data[1046]) - .SetData524(static_cast<int64_t>(raw_data[1049]) << 32 | raw_data[1048]) - .SetData525(static_cast<int64_t>(raw_data[1051]) << 32 | raw_data[1050]) - .SetData526(static_cast<int64_t>(raw_data[1053]) << 32 | raw_data[1052]) - .SetData527(static_cast<int64_t>(raw_data[1055]) << 32 | raw_data[1054]) - .SetData528(static_cast<int64_t>(raw_data[1057]) << 32 | raw_data[1056]) - .SetData529(static_cast<int64_t>(raw_data[1059]) << 32 | raw_data[1058]) - .SetData530(static_cast<int64_t>(raw_data[1061]) << 32 | raw_data[1060]) - .SetData531(static_cast<int64_t>(raw_data[1063]) << 32 | raw_data[1062]) - .SetData532(static_cast<int64_t>(raw_data[1065]) << 32 | raw_data[1064]) - .SetData533(static_cast<int64_t>(raw_data[1067]) << 32 | raw_data[1066]) - .SetData534(static_cast<int64_t>(raw_data[1069]) << 32 | raw_data[1068]) - .SetData535(static_cast<int64_t>(raw_data[1071]) << 32 | raw_data[1070]) - .SetData536(static_cast<int64_t>(raw_data[1073]) << 32 | raw_data[1072]) - .SetData537(static_cast<int64_t>(raw_data[1075]) << 32 | raw_data[1074]) - .SetData538(static_cast<int64_t>(raw_data[1077]) << 32 | raw_data[1076]) - .SetData539(static_cast<int64_t>(raw_data[1079]) << 32 | raw_data[1078]) - .SetData540(static_cast<int64_t>(raw_data[1081]) << 32 | raw_data[1080]) - .SetData541(static_cast<int64_t>(raw_data[1083]) << 32 | raw_data[1082]) - .SetData542(static_cast<int64_t>(raw_data[1085]) << 32 | raw_data[1084]) - .SetData543(static_cast<int64_t>(raw_data[1087]) << 32 | raw_data[1086]) - .SetData544(static_cast<int64_t>(raw_data[1089]) << 32 | raw_data[1088]) - .SetData545(static_cast<int64_t>(raw_data[1091]) << 32 | raw_data[1090]) - .SetData546(static_cast<int64_t>(raw_data[1093]) << 32 | raw_data[1092]) - .SetData547(static_cast<int64_t>(raw_data[1095]) << 32 | raw_data[1094]) - .SetData548(static_cast<int64_t>(raw_data[1097]) << 32 | raw_data[1096]) - .SetData549(static_cast<int64_t>(raw_data[1099]) << 32 | raw_data[1098]) - .SetData550(static_cast<int64_t>(raw_data[1101]) << 32 | raw_data[1100]) - .SetData551(static_cast<int64_t>(raw_data[1103]) << 32 | raw_data[1102]) - .SetData552(static_cast<int64_t>(raw_data[1105]) << 32 | raw_data[1104]) - .SetData553(static_cast<int64_t>(raw_data[1107]) << 32 | raw_data[1106]) - .SetData554(static_cast<int64_t>(raw_data[1109]) << 32 | raw_data[1108]) - .SetData555(static_cast<int64_t>(raw_data[1111]) << 32 | raw_data[1110]) - .SetData556(static_cast<int64_t>(raw_data[1113]) << 32 | raw_data[1112]) - .SetData557(static_cast<int64_t>(raw_data[1115]) << 32 | raw_data[1114]) - .SetData558(static_cast<int64_t>(raw_data[1117]) << 32 | raw_data[1116]) - .SetData559(static_cast<int64_t>(raw_data[1119]) << 32 | raw_data[1118]) - .SetData560(static_cast<int64_t>(raw_data[1121]) << 32 | raw_data[1120]) - .SetData561(static_cast<int64_t>(raw_data[1123]) << 32 | raw_data[1122]) - .SetData562(static_cast<int64_t>(raw_data[1125]) << 32 | raw_data[1124]) - .SetData563(static_cast<int64_t>(raw_data[1127]) << 32 | raw_data[1126]) - .SetData564(static_cast<int64_t>(raw_data[1129]) << 32 | raw_data[1128]) - .SetData565(static_cast<int64_t>(raw_data[1131]) << 32 | raw_data[1130]) - .SetData566(static_cast<int64_t>(raw_data[1133]) << 32 | raw_data[1132]) - .SetData567(static_cast<int64_t>(raw_data[1135]) << 32 | raw_data[1134]) - .SetData568(static_cast<int64_t>(raw_data[1137]) << 32 | raw_data[1136]) - .SetData569(static_cast<int64_t>(raw_data[1139]) << 32 | raw_data[1138]) - .SetData570(static_cast<int64_t>(raw_data[1141]) << 32 | raw_data[1140]) - .SetData571(static_cast<int64_t>(raw_data[1143]) << 32 | raw_data[1142]) - .SetData572(static_cast<int64_t>(raw_data[1145]) << 32 | raw_data[1144]) - .SetData573(static_cast<int64_t>(raw_data[1147]) << 32 | raw_data[1146]) - .SetData574(static_cast<int64_t>(raw_data[1149]) << 32 | raw_data[1148]) - .SetData575(static_cast<int64_t>(raw_data[1151]) << 32 | raw_data[1150]) - .SetData576(static_cast<int64_t>(raw_data[1153]) << 32 | raw_data[1152]) - .SetData577(static_cast<int64_t>(raw_data[1155]) << 32 | raw_data[1154]) - .SetData578(static_cast<int64_t>(raw_data[1157]) << 32 | raw_data[1156]) - .SetData579(static_cast<int64_t>(raw_data[1159]) << 32 | raw_data[1158]) - .SetData580(static_cast<int64_t>(raw_data[1161]) << 32 | raw_data[1160]) - .SetData581(static_cast<int64_t>(raw_data[1163]) << 32 | raw_data[1162]) - .SetData582(static_cast<int64_t>(raw_data[1165]) << 32 | raw_data[1164]) - .SetData583(static_cast<int64_t>(raw_data[1167]) << 32 | raw_data[1166]) - .SetData584(static_cast<int64_t>(raw_data[1169]) << 32 | raw_data[1168]) - .SetData585(static_cast<int64_t>(raw_data[1171]) << 32 | raw_data[1170]) - .SetData586(static_cast<int64_t>(raw_data[1173]) << 32 | raw_data[1172]) - .SetData587(static_cast<int64_t>(raw_data[1175]) << 32 | raw_data[1174]) - .SetData588(static_cast<int64_t>(raw_data[1177]) << 32 | raw_data[1176]) - .SetData589(static_cast<int64_t>(raw_data[1179]) << 32 | raw_data[1178]) - .SetData590(static_cast<int64_t>(raw_data[1181]) << 32 | raw_data[1180]) - .SetData591(static_cast<int64_t>(raw_data[1183]) << 32 | raw_data[1182]) - .SetData592(static_cast<int64_t>(raw_data[1185]) << 32 | raw_data[1184]) - .SetData593(static_cast<int64_t>(raw_data[1187]) << 32 | raw_data[1186]) - .SetData594(static_cast<int64_t>(raw_data[1189]) << 32 | raw_data[1188]) - .SetData595(static_cast<int64_t>(raw_data[1191]) << 32 | raw_data[1190]) - .SetData596(static_cast<int64_t>(raw_data[1193]) << 32 | raw_data[1192]) - .SetData597(static_cast<int64_t>(raw_data[1195]) << 32 | raw_data[1194]) - .SetData598(static_cast<int64_t>(raw_data[1197]) << 32 | raw_data[1196]) - .SetData599(static_cast<int64_t>(raw_data[1199]) << 32 | raw_data[1198]) - .SetData600(static_cast<int64_t>(raw_data[1201]) << 32 | raw_data[1200]) - .SetData601(static_cast<int64_t>(raw_data[1203]) << 32 | raw_data[1202]) - .SetData602(static_cast<int64_t>(raw_data[1205]) << 32 | raw_data[1204]) - .SetData603(static_cast<int64_t>(raw_data[1207]) << 32 | raw_data[1206]) - .SetData604(static_cast<int64_t>(raw_data[1209]) << 32 | raw_data[1208]) - .SetData605(static_cast<int64_t>(raw_data[1211]) << 32 | raw_data[1210]) - .SetData606(static_cast<int64_t>(raw_data[1213]) << 32 | raw_data[1212]) - .SetData607(static_cast<int64_t>(raw_data[1215]) << 32 | raw_data[1214]) - .SetData608(static_cast<int64_t>(raw_data[1217]) << 32 | raw_data[1216]) - .SetData609(static_cast<int64_t>(raw_data[1219]) << 32 | raw_data[1218]) - .SetData610(static_cast<int64_t>(raw_data[1221]) << 32 | raw_data[1220]) - .SetData611(static_cast<int64_t>(raw_data[1223]) << 32 | raw_data[1222]) - .SetData612(static_cast<int64_t>(raw_data[1225]) << 32 | raw_data[1224]) - .SetData613(static_cast<int64_t>(raw_data[1227]) << 32 | raw_data[1226]) - .SetData614(static_cast<int64_t>(raw_data[1229]) << 32 | raw_data[1228]) - .SetData615(static_cast<int64_t>(raw_data[1231]) << 32 | raw_data[1230]) - .SetData616(static_cast<int64_t>(raw_data[1233]) << 32 | raw_data[1232]) - .SetData617(static_cast<int64_t>(raw_data[1235]) << 32 | raw_data[1234]) - .SetData618(static_cast<int64_t>(raw_data[1237]) << 32 | raw_data[1236]) - .SetData619(static_cast<int64_t>(raw_data[1239]) << 32 | raw_data[1238]) - .SetData620(static_cast<int64_t>(raw_data[1241]) << 32 | raw_data[1240]) - .SetData621(static_cast<int64_t>(raw_data[1243]) << 32 | raw_data[1242]) - .SetData622(static_cast<int64_t>(raw_data[1245]) << 32 | raw_data[1244]) - .SetData623(static_cast<int64_t>(raw_data[1247]) << 32 | raw_data[1246]) - .SetData624(static_cast<int64_t>(raw_data[1249]) << 32 | raw_data[1248]) - .SetData625(static_cast<int64_t>(raw_data[1251]) << 32 | raw_data[1250]) - .SetData626(static_cast<int64_t>(raw_data[1253]) << 32 | raw_data[1252]) - .SetData627(static_cast<int64_t>(raw_data[1255]) << 32 | raw_data[1254]) - .SetData628(static_cast<int64_t>(raw_data[1257]) << 32 | raw_data[1256]) - .SetData629(static_cast<int64_t>(raw_data[1259]) << 32 | raw_data[1258]) - .SetData630(static_cast<int64_t>(raw_data[1261]) << 32 | raw_data[1260]) - .SetData631(static_cast<int64_t>(raw_data[1263]) << 32 | raw_data[1262]) - .SetData632(static_cast<int64_t>(raw_data[1265]) << 32 | raw_data[1264]) - .SetData633(static_cast<int64_t>(raw_data[1267]) << 32 | raw_data[1266]) - .SetData634(static_cast<int64_t>(raw_data[1269]) << 32 | raw_data[1268]) - .SetData635(static_cast<int64_t>(raw_data[1271]) << 32 | raw_data[1270]) - .SetData636(static_cast<int64_t>(raw_data[1273]) << 32 | raw_data[1272]) - .SetData637(static_cast<int64_t>(raw_data[1275]) << 32 | raw_data[1274]) - .SetData638(static_cast<int64_t>(raw_data[1277]) << 32 | raw_data[1276]) - .SetData639(static_cast<int64_t>(raw_data[1279]) << 32 | raw_data[1278]) - .SetData640(static_cast<int64_t>(raw_data[1281]) << 32 | raw_data[1280]) - .SetData641(static_cast<int64_t>(raw_data[1283]) << 32 | raw_data[1282]) - .SetData642(static_cast<int64_t>(raw_data[1285]) << 32 | raw_data[1284]) - .SetData643(static_cast<int64_t>(raw_data[1287]) << 32 | raw_data[1286]) - .SetData644(static_cast<int64_t>(raw_data[1289]) << 32 | raw_data[1288]) - .SetData645(static_cast<int64_t>(raw_data[1291]) << 32 | raw_data[1290]) - .SetData646(static_cast<int64_t>(raw_data[1293]) << 32 | raw_data[1292]) - .SetData647(static_cast<int64_t>(raw_data[1295]) << 32 | raw_data[1294]) - .SetData648(static_cast<int64_t>(raw_data[1297]) << 32 | raw_data[1296]) - .SetData649(static_cast<int64_t>(raw_data[1299]) << 32 | raw_data[1298]) - .SetData650(static_cast<int64_t>(raw_data[1301]) << 32 | raw_data[1300]) - .SetData651(static_cast<int64_t>(raw_data[1303]) << 32 | raw_data[1302]) - .SetData652(static_cast<int64_t>(raw_data[1305]) << 32 | raw_data[1304]) - .SetData653(static_cast<int64_t>(raw_data[1307]) << 32 | raw_data[1306]) - .SetData654(static_cast<int64_t>(raw_data[1309]) << 32 | raw_data[1308]) - .SetData655(static_cast<int64_t>(raw_data[1311]) << 32 | raw_data[1310]) - .SetData656(static_cast<int64_t>(raw_data[1313]) << 32 | raw_data[1312]) - .SetData657(static_cast<int64_t>(raw_data[1315]) << 32 | raw_data[1314]) - .SetData658(static_cast<int64_t>(raw_data[1317]) << 32 | raw_data[1316]) - .SetData659(static_cast<int64_t>(raw_data[1319]) << 32 | raw_data[1318]) - .SetData660(static_cast<int64_t>(raw_data[1321]) << 32 | raw_data[1320]) - .SetData661(static_cast<int64_t>(raw_data[1323]) << 32 | raw_data[1322]) - .SetData662(static_cast<int64_t>(raw_data[1325]) << 32 | raw_data[1324]) - .SetData663(static_cast<int64_t>(raw_data[1327]) << 32 | raw_data[1326]) - .SetData664(static_cast<int64_t>(raw_data[1329]) << 32 | raw_data[1328]) - .SetData665(static_cast<int64_t>(raw_data[1331]) << 32 | raw_data[1330]) - .SetData666(static_cast<int64_t>(raw_data[1333]) << 32 | raw_data[1332]) - .SetData667(static_cast<int64_t>(raw_data[1335]) << 32 | raw_data[1334]) - .SetData668(static_cast<int64_t>(raw_data[1337]) << 32 | raw_data[1336]) - .SetData669(static_cast<int64_t>(raw_data[1339]) << 32 | raw_data[1338]) - .SetData670(static_cast<int64_t>(raw_data[1341]) << 32 | raw_data[1340]) - .SetData671(static_cast<int64_t>(raw_data[1343]) << 32 | raw_data[1342]) - .SetData672(static_cast<int64_t>(raw_data[1345]) << 32 | raw_data[1344]) - .SetData673(static_cast<int64_t>(raw_data[1347]) << 32 | raw_data[1346]) - .SetData674(static_cast<int64_t>(raw_data[1349]) << 32 | raw_data[1348]) - .SetData675(static_cast<int64_t>(raw_data[1351]) << 32 | raw_data[1350]) - .SetData676(static_cast<int64_t>(raw_data[1353]) << 32 | raw_data[1352]) - .SetData677(static_cast<int64_t>(raw_data[1355]) << 32 | raw_data[1354]) - .SetData678(static_cast<int64_t>(raw_data[1357]) << 32 | raw_data[1356]) - .SetData679(static_cast<int64_t>(raw_data[1359]) << 32 | raw_data[1358]) - .SetData680(static_cast<int64_t>(raw_data[1361]) << 32 | raw_data[1360]) - .SetData681(static_cast<int64_t>(raw_data[1363]) << 32 | raw_data[1362]) - .SetData682(static_cast<int64_t>(raw_data[1365]) << 32 | raw_data[1364]) - .SetData683(static_cast<int64_t>(raw_data[1367]) << 32 | raw_data[1366]) - .SetData684(static_cast<int64_t>(raw_data[1369]) << 32 | raw_data[1368]) - .SetData685(static_cast<int64_t>(raw_data[1371]) << 32 | raw_data[1370]) - .SetData686(static_cast<int64_t>(raw_data[1373]) << 32 | raw_data[1372]) - .SetData687(static_cast<int64_t>(raw_data[1375]) << 32 | raw_data[1374]) - .SetData688(static_cast<int64_t>(raw_data[1377]) << 32 | raw_data[1376]) - .SetData689(static_cast<int64_t>(raw_data[1379]) << 32 | raw_data[1378]) - .SetData690(static_cast<int64_t>(raw_data[1381]) << 32 | raw_data[1380]) - .SetData691(static_cast<int64_t>(raw_data[1383]) << 32 | raw_data[1382]) - .SetData692(static_cast<int64_t>(raw_data[1385]) << 32 | raw_data[1384]) - .SetData693(static_cast<int64_t>(raw_data[1387]) << 32 | raw_data[1386]) - .SetData694(static_cast<int64_t>(raw_data[1389]) << 32 | raw_data[1388]) - .SetData695(static_cast<int64_t>(raw_data[1391]) << 32 | raw_data[1390]) - .SetData696(static_cast<int64_t>(raw_data[1393]) << 32 | raw_data[1392]) - .SetData697(static_cast<int64_t>(raw_data[1395]) << 32 | raw_data[1394]) - .SetData698(static_cast<int64_t>(raw_data[1397]) << 32 | raw_data[1396]) - .SetData699(static_cast<int64_t>(raw_data[1399]) << 32 | raw_data[1398]) - .SetData700(static_cast<int64_t>(raw_data[1401]) << 32 | raw_data[1400]) - .SetData701(static_cast<int64_t>(raw_data[1403]) << 32 | raw_data[1402]) - .SetData702(static_cast<int64_t>(raw_data[1405]) << 32 | raw_data[1404]) - .SetData703(static_cast<int64_t>(raw_data[1407]) << 32 | raw_data[1406]) - .SetData704(static_cast<int64_t>(raw_data[1409]) << 32 | raw_data[1408]) - .SetData705(static_cast<int64_t>(raw_data[1411]) << 32 | raw_data[1410]) - .SetData706(static_cast<int64_t>(raw_data[1413]) << 32 | raw_data[1412]) - .SetData707(static_cast<int64_t>(raw_data[1415]) << 32 | raw_data[1414]) - .SetData708(static_cast<int64_t>(raw_data[1417]) << 32 | raw_data[1416]) - .SetData709(static_cast<int64_t>(raw_data[1419]) << 32 | raw_data[1418]) - .SetData710(static_cast<int64_t>(raw_data[1421]) << 32 | raw_data[1420]) - .SetData711(static_cast<int64_t>(raw_data[1423]) << 32 | raw_data[1422]) - .SetData712(static_cast<int64_t>(raw_data[1425]) << 32 | raw_data[1424]) - .SetData713(static_cast<int64_t>(raw_data[1427]) << 32 | raw_data[1426]) - .SetData714(static_cast<int64_t>(raw_data[1429]) << 32 | raw_data[1428]) - .SetData715(static_cast<int64_t>(raw_data[1431]) << 32 | raw_data[1430]) - .SetData716(static_cast<int64_t>(raw_data[1433]) << 32 | raw_data[1432]) - .SetData717(static_cast<int64_t>(raw_data[1435]) << 32 | raw_data[1434]) - .SetData718(static_cast<int64_t>(raw_data[1437]) << 32 | raw_data[1436]) - .SetData719(static_cast<int64_t>(raw_data[1439]) << 32 | raw_data[1438]) - .SetData720(static_cast<int64_t>(raw_data[1441]) << 32 | raw_data[1440]) - .SetData721(static_cast<int64_t>(raw_data[1443]) << 32 | raw_data[1442]) - .SetData722(static_cast<int64_t>(raw_data[1445]) << 32 | raw_data[1444]) - .SetData723(static_cast<int64_t>(raw_data[1447]) << 32 | raw_data[1446]) - .SetData724(static_cast<int64_t>(raw_data[1449]) << 32 | raw_data[1448]) - .SetData725(static_cast<int64_t>(raw_data[1451]) << 32 | raw_data[1450]) - .SetData726(static_cast<int64_t>(raw_data[1453]) << 32 | raw_data[1452]) - .SetData727(static_cast<int64_t>(raw_data[1455]) << 32 | raw_data[1454]) - .SetData728(static_cast<int64_t>(raw_data[1457]) << 32 | raw_data[1456]) - .SetData729(static_cast<int64_t>(raw_data[1459]) << 32 | raw_data[1458]) - .SetData730(static_cast<int64_t>(raw_data[1461]) << 32 | raw_data[1460]) - .SetData731(static_cast<int64_t>(raw_data[1463]) << 32 | raw_data[1462]) - .SetData732(static_cast<int64_t>(raw_data[1465]) << 32 | raw_data[1464]) - .SetData733(static_cast<int64_t>(raw_data[1467]) << 32 | raw_data[1466]) - .SetData734(static_cast<int64_t>(raw_data[1469]) << 32 | raw_data[1468]) - .SetData735(static_cast<int64_t>(raw_data[1471]) << 32 | raw_data[1470]) - .SetData736(static_cast<int64_t>(raw_data[1473]) << 32 | raw_data[1472]) - .SetData737(static_cast<int64_t>(raw_data[1475]) << 32 | raw_data[1474]) - .SetData738(static_cast<int64_t>(raw_data[1477]) << 32 | raw_data[1476]) - .SetData739(static_cast<int64_t>(raw_data[1479]) << 32 | raw_data[1478]) - .SetData740(static_cast<int64_t>(raw_data[1481]) << 32 | raw_data[1480]) - .SetData741(static_cast<int64_t>(raw_data[1483]) << 32 | raw_data[1482]) - .SetData742(static_cast<int64_t>(raw_data[1485]) << 32 | raw_data[1484]) - .SetData743(static_cast<int64_t>(raw_data[1487]) << 32 | raw_data[1486]) - .SetData744(static_cast<int64_t>(raw_data[1489]) << 32 | raw_data[1488]) - .SetData745(static_cast<int64_t>(raw_data[1491]) << 32 | raw_data[1490]) - .SetData746(static_cast<int64_t>(raw_data[1493]) << 32 | raw_data[1492]) - .SetData747(static_cast<int64_t>(raw_data[1495]) << 32 | raw_data[1494]) - .SetData748(static_cast<int64_t>(raw_data[1497]) << 32 | raw_data[1496]) - .SetData749(static_cast<int64_t>(raw_data[1499]) << 32 | raw_data[1498]) - .SetData750(static_cast<int64_t>(raw_data[1501]) << 32 | raw_data[1500]) - .SetData751(static_cast<int64_t>(raw_data[1503]) << 32 | raw_data[1502]) - .SetData752(static_cast<int64_t>(raw_data[1505]) << 32 | raw_data[1504]) - .SetData753(static_cast<int64_t>(raw_data[1507]) << 32 | raw_data[1506]) - .SetData754(static_cast<int64_t>(raw_data[1509]) << 32 | raw_data[1508]) - .SetData755(static_cast<int64_t>(raw_data[1511]) << 32 | raw_data[1510]) - .SetData756(static_cast<int64_t>(raw_data[1513]) << 32 | raw_data[1512]) - .SetData757(static_cast<int64_t>(raw_data[1515]) << 32 | raw_data[1514]) - .SetData758(static_cast<int64_t>(raw_data[1517]) << 32 | raw_data[1516]) - .SetData759(static_cast<int64_t>(raw_data[1519]) << 32 | raw_data[1518]) - .SetData760(static_cast<int64_t>(raw_data[1521]) << 32 | raw_data[1520]) - .SetData761(static_cast<int64_t>(raw_data[1523]) << 32 | raw_data[1522]) - .SetData762(static_cast<int64_t>(raw_data[1525]) << 32 | raw_data[1524]) - .SetData763(static_cast<int64_t>(raw_data[1527]) << 32 | raw_data[1526]) - .SetData764(static_cast<int64_t>(raw_data[1529]) << 32 | raw_data[1528]) - .SetData765(static_cast<int64_t>(raw_data[1531]) << 32 | raw_data[1530]) - .SetData766(static_cast<int64_t>(raw_data[1533]) << 32 | raw_data[1532]) - .SetData767(static_cast<int64_t>(raw_data[1535]) << 32 | raw_data[1534]) - .SetData768(static_cast<int64_t>(raw_data[1537]) << 32 | raw_data[1536]) - .SetData769(static_cast<int64_t>(raw_data[1539]) << 32 | raw_data[1538]) - .SetData770(static_cast<int64_t>(raw_data[1541]) << 32 | raw_data[1540]) - .SetData771(static_cast<int64_t>(raw_data[1543]) << 32 | raw_data[1542]) - .SetData772(static_cast<int64_t>(raw_data[1545]) << 32 | raw_data[1544]) - .SetData773(static_cast<int64_t>(raw_data[1547]) << 32 | raw_data[1546]) - .SetData774(static_cast<int64_t>(raw_data[1549]) << 32 | raw_data[1548]) - .SetData775(static_cast<int64_t>(raw_data[1551]) << 32 | raw_data[1550]) - .SetData776(static_cast<int64_t>(raw_data[1553]) << 32 | raw_data[1552]) - .SetData777(static_cast<int64_t>(raw_data[1555]) << 32 | raw_data[1554]) - .SetData778(static_cast<int64_t>(raw_data[1557]) << 32 | raw_data[1556]) - .SetData779(static_cast<int64_t>(raw_data[1559]) << 32 | raw_data[1558]) - .SetData780(static_cast<int64_t>(raw_data[1561]) << 32 | raw_data[1560]) - .SetData781(static_cast<int64_t>(raw_data[1563]) << 32 | raw_data[1562]) - .SetData782(static_cast<int64_t>(raw_data[1565]) << 32 | raw_data[1564]) - .SetData783(static_cast<int64_t>(raw_data[1567]) << 32 | raw_data[1566]) - .SetData784(static_cast<int64_t>(raw_data[1569]) << 32 | raw_data[1568]) - .SetData785(static_cast<int64_t>(raw_data[1571]) << 32 | raw_data[1570]) - .SetData786(static_cast<int64_t>(raw_data[1573]) << 32 | raw_data[1572]) - .SetData787(static_cast<int64_t>(raw_data[1575]) << 32 | raw_data[1574]) - .SetData788(static_cast<int64_t>(raw_data[1577]) << 32 | raw_data[1576]) - .SetData789(static_cast<int64_t>(raw_data[1579]) << 32 | raw_data[1578]) - .SetData790(static_cast<int64_t>(raw_data[1581]) << 32 | raw_data[1580]) - .SetData791(static_cast<int64_t>(raw_data[1583]) << 32 | raw_data[1582]) - .SetData792(static_cast<int64_t>(raw_data[1585]) << 32 | raw_data[1584]) - .SetData793(static_cast<int64_t>(raw_data[1587]) << 32 | raw_data[1586]) - .SetData794(static_cast<int64_t>(raw_data[1589]) << 32 | raw_data[1588]) - .SetData795(static_cast<int64_t>(raw_data[1591]) << 32 | raw_data[1590]) - .SetData796(static_cast<int64_t>(raw_data[1593]) << 32 | raw_data[1592]) - .SetData797(static_cast<int64_t>(raw_data[1595]) << 32 | raw_data[1594]) - .SetData798(static_cast<int64_t>(raw_data[1597]) << 32 | raw_data[1596]) - .SetData799(static_cast<int64_t>(raw_data[1599]) << 32 | raw_data[1598]) - .SetData800(static_cast<int64_t>(raw_data[1601]) << 32 | raw_data[1600]) - .SetData801(static_cast<int64_t>(raw_data[1603]) << 32 | raw_data[1602]) - .SetData802(static_cast<int64_t>(raw_data[1605]) << 32 | raw_data[1604]) - .SetData803(static_cast<int64_t>(raw_data[1607]) << 32 | raw_data[1606]) - .SetData804(static_cast<int64_t>(raw_data[1609]) << 32 | raw_data[1608]) - .SetData805(static_cast<int64_t>(raw_data[1611]) << 32 | raw_data[1610]) - .SetData806(static_cast<int64_t>(raw_data[1613]) << 32 | raw_data[1612]) - .SetData807(static_cast<int64_t>(raw_data[1615]) << 32 | raw_data[1614]) - .SetData808(static_cast<int64_t>(raw_data[1617]) << 32 | raw_data[1616]) - .SetData809(static_cast<int64_t>(raw_data[1619]) << 32 | raw_data[1618]) - .SetData810(static_cast<int64_t>(raw_data[1621]) << 32 | raw_data[1620]) - .SetData811(static_cast<int64_t>(raw_data[1623]) << 32 | raw_data[1622]) - .SetData812(static_cast<int64_t>(raw_data[1625]) << 32 | raw_data[1624]) - .SetData813(static_cast<int64_t>(raw_data[1627]) << 32 | raw_data[1626]) - .SetData814(static_cast<int64_t>(raw_data[1629]) << 32 | raw_data[1628]) - .SetData815(static_cast<int64_t>(raw_data[1631]) << 32 | raw_data[1630]) - .SetData816(static_cast<int64_t>(raw_data[1633]) << 32 | raw_data[1632]) - .SetData817(static_cast<int64_t>(raw_data[1635]) << 32 | raw_data[1634]) - .SetData818(static_cast<int64_t>(raw_data[1637]) << 32 | raw_data[1636]) - .SetData819(static_cast<int64_t>(raw_data[1639]) << 32 | raw_data[1638]) - .SetData820(static_cast<int64_t>(raw_data[1641]) << 32 | raw_data[1640]) - .SetData821(static_cast<int64_t>(raw_data[1643]) << 32 | raw_data[1642]) - .SetData822(static_cast<int64_t>(raw_data[1645]) << 32 | raw_data[1644]) - .SetData823(static_cast<int64_t>(raw_data[1647]) << 32 | raw_data[1646]) - .SetData824(static_cast<int64_t>(raw_data[1649]) << 32 | raw_data[1648]) - .SetData825(static_cast<int64_t>(raw_data[1651]) << 32 | raw_data[1650]) - .SetData826(static_cast<int64_t>(raw_data[1653]) << 32 | raw_data[1652]) - .SetData827(static_cast<int64_t>(raw_data[1655]) << 32 | raw_data[1654]) - .SetData828(static_cast<int64_t>(raw_data[1657]) << 32 | raw_data[1656]) - .SetData829(static_cast<int64_t>(raw_data[1659]) << 32 | raw_data[1658]) - .SetData830(static_cast<int64_t>(raw_data[1661]) << 32 | raw_data[1660]) - .SetData831(static_cast<int64_t>(raw_data[1663]) << 32 | raw_data[1662]) - .SetData832(static_cast<int64_t>(raw_data[1665]) << 32 | raw_data[1664]) - .SetData833(static_cast<int64_t>(raw_data[1667]) << 32 | raw_data[1666]) - .SetData834(static_cast<int64_t>(raw_data[1669]) << 32 | raw_data[1668]) - .SetData835(static_cast<int64_t>(raw_data[1671]) << 32 | raw_data[1670]) - .SetData836(static_cast<int64_t>(raw_data[1673]) << 32 | raw_data[1672]) - .SetData837(static_cast<int64_t>(raw_data[1675]) << 32 | raw_data[1674]) - .SetData838(static_cast<int64_t>(raw_data[1677]) << 32 | raw_data[1676]) - .SetData839(static_cast<int64_t>(raw_data[1679]) << 32 | raw_data[1678]) - .SetData840(static_cast<int64_t>(raw_data[1681]) << 32 | raw_data[1680]) - .SetData841(static_cast<int64_t>(raw_data[1683]) << 32 | raw_data[1682]) - .SetData842(static_cast<int64_t>(raw_data[1685]) << 32 | raw_data[1684]) - .SetData843(static_cast<int64_t>(raw_data[1687]) << 32 | raw_data[1686]) - .SetData844(static_cast<int64_t>(raw_data[1689]) << 32 | raw_data[1688]) - .SetData845(static_cast<int64_t>(raw_data[1691]) << 32 | raw_data[1690]) - .SetData846(static_cast<int64_t>(raw_data[1693]) << 32 | raw_data[1692]) - .SetData847(static_cast<int64_t>(raw_data[1695]) << 32 | raw_data[1694]) - .SetData848(static_cast<int64_t>(raw_data[1697]) << 32 | raw_data[1696]) - .SetData849(static_cast<int64_t>(raw_data[1699]) << 32 | raw_data[1698]) - .SetData850(static_cast<int64_t>(raw_data[1701]) << 32 | raw_data[1700]) - .SetData851(static_cast<int64_t>(raw_data[1703]) << 32 | raw_data[1702]) - .SetData852(static_cast<int64_t>(raw_data[1705]) << 32 | raw_data[1704]) - .SetData853(static_cast<int64_t>(raw_data[1707]) << 32 | raw_data[1706]) - .SetData854(static_cast<int64_t>(raw_data[1709]) << 32 | raw_data[1708]) - .SetData855(static_cast<int64_t>(raw_data[1711]) << 32 | raw_data[1710]) - .SetData856(static_cast<int64_t>(raw_data[1713]) << 32 | raw_data[1712]) - .SetData857(static_cast<int64_t>(raw_data[1715]) << 32 | raw_data[1714]) - .SetData858(static_cast<int64_t>(raw_data[1717]) << 32 | raw_data[1716]) - .SetData859(static_cast<int64_t>(raw_data[1719]) << 32 | raw_data[1718]) - .SetData860(static_cast<int64_t>(raw_data[1721]) << 32 | raw_data[1720]) - .SetData861(static_cast<int64_t>(raw_data[1723]) << 32 | raw_data[1722]) - .SetData862(static_cast<int64_t>(raw_data[1725]) << 32 | raw_data[1724]) - .SetData863(static_cast<int64_t>(raw_data[1727]) << 32 | raw_data[1726]) - .SetData864(static_cast<int64_t>(raw_data[1729]) << 32 | raw_data[1728]) - .SetData865(static_cast<int64_t>(raw_data[1731]) << 32 | raw_data[1730]) - .SetData866(static_cast<int64_t>(raw_data[1733]) << 32 | raw_data[1732]) - .SetData867(static_cast<int64_t>(raw_data[1735]) << 32 | raw_data[1734]) - .SetData868(static_cast<int64_t>(raw_data[1737]) << 32 | raw_data[1736]) - .SetData869(static_cast<int64_t>(raw_data[1739]) << 32 | raw_data[1738]) - .SetData870(static_cast<int64_t>(raw_data[1741]) << 32 | raw_data[1740]) - .SetData871(static_cast<int64_t>(raw_data[1743]) << 32 | raw_data[1742]) - .SetData872(static_cast<int64_t>(raw_data[1745]) << 32 | raw_data[1744]) - .SetData873(static_cast<int64_t>(raw_data[1747]) << 32 | raw_data[1746]) - .SetData874(static_cast<int64_t>(raw_data[1749]) << 32 | raw_data[1748]) - .SetData875(static_cast<int64_t>(raw_data[1751]) << 32 | raw_data[1750]) - .SetData876(static_cast<int64_t>(raw_data[1753]) << 32 | raw_data[1752]) - .SetData877(static_cast<int64_t>(raw_data[1755]) << 32 | raw_data[1754]) - .SetData878(static_cast<int64_t>(raw_data[1757]) << 32 | raw_data[1756]) - .SetData879(static_cast<int64_t>(raw_data[1759]) << 32 | raw_data[1758]) - .SetData880(static_cast<int64_t>(raw_data[1761]) << 32 | raw_data[1760]) - .SetData881(static_cast<int64_t>(raw_data[1763]) << 32 | raw_data[1762]) - .SetData882(static_cast<int64_t>(raw_data[1765]) << 32 | raw_data[1764]) - .SetData883(static_cast<int64_t>(raw_data[1767]) << 32 | raw_data[1766]) - .SetData884(static_cast<int64_t>(raw_data[1769]) << 32 | raw_data[1768]) - .SetData885(static_cast<int64_t>(raw_data[1771]) << 32 | raw_data[1770]) - .SetData886(static_cast<int64_t>(raw_data[1773]) << 32 | raw_data[1772]) - .SetData887(static_cast<int64_t>(raw_data[1775]) << 32 | raw_data[1774]) - .SetData888(static_cast<int64_t>(raw_data[1777]) << 32 | raw_data[1776]) - .SetData889(static_cast<int64_t>(raw_data[1779]) << 32 | raw_data[1778]) - .SetData890(static_cast<int64_t>(raw_data[1781]) << 32 | raw_data[1780]) - .SetData891(static_cast<int64_t>(raw_data[1783]) << 32 | raw_data[1782]) - .SetData892(static_cast<int64_t>(raw_data[1785]) << 32 | raw_data[1784]) - .SetData893(static_cast<int64_t>(raw_data[1787]) << 32 | raw_data[1786]) - .SetData894(static_cast<int64_t>(raw_data[1789]) << 32 | raw_data[1788]) - .SetData895(static_cast<int64_t>(raw_data[1791]) << 32 | raw_data[1790]) - .SetData896(static_cast<int64_t>(raw_data[1793]) << 32 | raw_data[1792]) - .SetData897(static_cast<int64_t>(raw_data[1795]) << 32 | raw_data[1794]) - .SetData898(static_cast<int64_t>(raw_data[1797]) << 32 | raw_data[1796]) - .SetData899(static_cast<int64_t>(raw_data[1799]) << 32 | raw_data[1798]) - .SetData900(static_cast<int64_t>(raw_data[1801]) << 32 | raw_data[1800]) - .SetData901(static_cast<int64_t>(raw_data[1803]) << 32 | raw_data[1802]) - .SetData902(static_cast<int64_t>(raw_data[1805]) << 32 | raw_data[1804]) - .SetData903(static_cast<int64_t>(raw_data[1807]) << 32 | raw_data[1806]) - .SetData904(static_cast<int64_t>(raw_data[1809]) << 32 | raw_data[1808]) - .SetData905(static_cast<int64_t>(raw_data[1811]) << 32 | raw_data[1810]) - .SetData906(static_cast<int64_t>(raw_data[1813]) << 32 | raw_data[1812]) - .SetData907(static_cast<int64_t>(raw_data[1815]) << 32 | raw_data[1814]) - .SetData908(static_cast<int64_t>(raw_data[1817]) << 32 | raw_data[1816]) - .SetData909(static_cast<int64_t>(raw_data[1819]) << 32 | raw_data[1818]) - .SetData910(static_cast<int64_t>(raw_data[1821]) << 32 | raw_data[1820]) - .SetData911(static_cast<int64_t>(raw_data[1823]) << 32 | raw_data[1822]) - .SetData912(static_cast<int64_t>(raw_data[1825]) << 32 | raw_data[1824]) - .SetData913(static_cast<int64_t>(raw_data[1827]) << 32 | raw_data[1826]) - .SetData914(static_cast<int64_t>(raw_data[1829]) << 32 | raw_data[1828]) - .SetData915(static_cast<int64_t>(raw_data[1831]) << 32 | raw_data[1830]) - .SetData916(static_cast<int64_t>(raw_data[1833]) << 32 | raw_data[1832]) - .SetData917(static_cast<int64_t>(raw_data[1835]) << 32 | raw_data[1834]) - .SetData918(static_cast<int64_t>(raw_data[1837]) << 32 | raw_data[1836]) - .SetData919(static_cast<int64_t>(raw_data[1839]) << 32 | raw_data[1838]) - .SetData920(static_cast<int64_t>(raw_data[1841]) << 32 | raw_data[1840]) - .SetData921(static_cast<int64_t>(raw_data[1843]) << 32 | raw_data[1842]) - .SetData922(static_cast<int64_t>(raw_data[1845]) << 32 | raw_data[1844]) - .SetData923(static_cast<int64_t>(raw_data[1847]) << 32 | raw_data[1846]) - .SetData924(static_cast<int64_t>(raw_data[1849]) << 32 | raw_data[1848]) - .SetData925(static_cast<int64_t>(raw_data[1851]) << 32 | raw_data[1850]) - .SetData926(static_cast<int64_t>(raw_data[1853]) << 32 | raw_data[1852]) - .SetData927(static_cast<int64_t>(raw_data[1855]) << 32 | raw_data[1854]) - .SetData928(static_cast<int64_t>(raw_data[1857]) << 32 | raw_data[1856]) - .SetData929(static_cast<int64_t>(raw_data[1859]) << 32 | raw_data[1858]) - .SetData930(static_cast<int64_t>(raw_data[1861]) << 32 | raw_data[1860]) - .SetData931(static_cast<int64_t>(raw_data[1863]) << 32 | raw_data[1862]) - .SetData932(static_cast<int64_t>(raw_data[1865]) << 32 | raw_data[1864]) - .SetData933(static_cast<int64_t>(raw_data[1867]) << 32 | raw_data[1866]) - .SetData934(static_cast<int64_t>(raw_data[1869]) << 32 | raw_data[1868]) - .SetData935(static_cast<int64_t>(raw_data[1871]) << 32 | raw_data[1870]) - .SetData936(static_cast<int64_t>(raw_data[1873]) << 32 | raw_data[1872]) - .SetData937(static_cast<int64_t>(raw_data[1875]) << 32 | raw_data[1874]) - .SetData938(static_cast<int64_t>(raw_data[1877]) << 32 | raw_data[1876]) - .SetData939(static_cast<int64_t>(raw_data[1879]) << 32 | raw_data[1878]) - .SetData940(static_cast<int64_t>(raw_data[1881]) << 32 | raw_data[1880]) - .SetData941(static_cast<int64_t>(raw_data[1883]) << 32 | raw_data[1882]) - .SetData942(static_cast<int64_t>(raw_data[1885]) << 32 | raw_data[1884]) - .SetData943(static_cast<int64_t>(raw_data[1887]) << 32 | raw_data[1886]) - .SetData944(static_cast<int64_t>(raw_data[1889]) << 32 | raw_data[1888]) - .SetData945(static_cast<int64_t>(raw_data[1891]) << 32 | raw_data[1890]) - .SetData946(static_cast<int64_t>(raw_data[1893]) << 32 | raw_data[1892]) - .SetData947(static_cast<int64_t>(raw_data[1895]) << 32 | raw_data[1894]) - .SetData948(static_cast<int64_t>(raw_data[1897]) << 32 | raw_data[1896]) - .SetData949(static_cast<int64_t>(raw_data[1899]) << 32 | raw_data[1898]) - .SetData950(static_cast<int64_t>(raw_data[1901]) << 32 | raw_data[1900]) - .SetData951(static_cast<int64_t>(raw_data[1903]) << 32 | raw_data[1902]) - .SetData952(static_cast<int64_t>(raw_data[1905]) << 32 | raw_data[1904]) - .SetData953(static_cast<int64_t>(raw_data[1907]) << 32 | raw_data[1906]) - .SetData954(static_cast<int64_t>(raw_data[1909]) << 32 | raw_data[1908]) - .SetData955(static_cast<int64_t>(raw_data[1911]) << 32 | raw_data[1910]) - .SetData956(static_cast<int64_t>(raw_data[1913]) << 32 | raw_data[1912]) - .SetData957(static_cast<int64_t>(raw_data[1915]) << 32 | raw_data[1914]) - .SetData958(static_cast<int64_t>(raw_data[1917]) << 32 | raw_data[1916]) - .SetData959(static_cast<int64_t>(raw_data[1919]) << 32 | raw_data[1918]) - .SetData960(static_cast<int64_t>(raw_data[1921]) << 32 | raw_data[1920]) - .SetData961(static_cast<int64_t>(raw_data[1923]) << 32 | raw_data[1922]) - .SetData962(static_cast<int64_t>(raw_data[1925]) << 32 | raw_data[1924]) - .SetData963(static_cast<int64_t>(raw_data[1927]) << 32 | raw_data[1926]) - .SetData964(static_cast<int64_t>(raw_data[1929]) << 32 | raw_data[1928]) - .SetData965(static_cast<int64_t>(raw_data[1931]) << 32 | raw_data[1930]) - .SetData966(static_cast<int64_t>(raw_data[1933]) << 32 | raw_data[1932]) - .SetData967(static_cast<int64_t>(raw_data[1935]) << 32 | raw_data[1934]) - .SetData968(static_cast<int64_t>(raw_data[1937]) << 32 | raw_data[1936]) - .SetData969(static_cast<int64_t>(raw_data[1939]) << 32 | raw_data[1938]) - .SetData970(static_cast<int64_t>(raw_data[1941]) << 32 | raw_data[1940]) - .SetData971(static_cast<int64_t>(raw_data[1943]) << 32 | raw_data[1942]) - .SetData972(static_cast<int64_t>(raw_data[1945]) << 32 | raw_data[1944]) - .SetData973(static_cast<int64_t>(raw_data[1947]) << 32 | raw_data[1946]) - .SetData974(static_cast<int64_t>(raw_data[1949]) << 32 | raw_data[1948]) - .SetData975(static_cast<int64_t>(raw_data[1951]) << 32 | raw_data[1950]) - .SetData976(static_cast<int64_t>(raw_data[1953]) << 32 | raw_data[1952]) - .SetData977(static_cast<int64_t>(raw_data[1955]) << 32 | raw_data[1954]) - .SetData978(static_cast<int64_t>(raw_data[1957]) << 32 | raw_data[1956]) - .SetData979(static_cast<int64_t>(raw_data[1959]) << 32 | raw_data[1958]) - .SetData980(static_cast<int64_t>(raw_data[1961]) << 32 | raw_data[1960]) - .SetData981(static_cast<int64_t>(raw_data[1963]) << 32 | raw_data[1962]) - .SetData982(static_cast<int64_t>(raw_data[1965]) << 32 | raw_data[1964]) - .SetData983(static_cast<int64_t>(raw_data[1967]) << 32 | raw_data[1966]) - .SetData984(static_cast<int64_t>(raw_data[1969]) << 32 | raw_data[1968]) - .SetData985(static_cast<int64_t>(raw_data[1971]) << 32 | raw_data[1970]) - .SetData986(static_cast<int64_t>(raw_data[1973]) << 32 | raw_data[1972]) - .SetData987(static_cast<int64_t>(raw_data[1975]) << 32 | raw_data[1974]) - .SetData988(static_cast<int64_t>(raw_data[1977]) << 32 | raw_data[1976]) - .SetData989(static_cast<int64_t>(raw_data[1979]) << 32 | raw_data[1978]) - .SetData990(static_cast<int64_t>(raw_data[1981]) << 32 | raw_data[1980]) - .SetData991(static_cast<int64_t>(raw_data[1983]) << 32 | raw_data[1982]) - .SetData992(static_cast<int64_t>(raw_data[1985]) << 32 | raw_data[1984]) - .SetData993(static_cast<int64_t>(raw_data[1987]) << 32 | raw_data[1986]) - .SetData994(static_cast<int64_t>(raw_data[1989]) << 32 | raw_data[1988]) - .SetData995(static_cast<int64_t>(raw_data[1991]) << 32 | raw_data[1990]) - .SetData996(static_cast<int64_t>(raw_data[1993]) << 32 | raw_data[1992]) - .SetData997(static_cast<int64_t>(raw_data[1995]) << 32 | raw_data[1994]) - .SetData998(static_cast<int64_t>(raw_data[1997]) << 32 | raw_data[1996]) - .SetData999(static_cast<int64_t>(raw_data[1999]) << 32 | raw_data[1998]) - .SetData1000(static_cast<int64_t>(raw_data[2001]) << 32 | raw_data[2000]) - .SetData1001(static_cast<int64_t>(raw_data[2003]) << 32 | raw_data[2002]) - .SetData1002(static_cast<int64_t>(raw_data[2005]) << 32 | raw_data[2004]) - .SetData1003(static_cast<int64_t>(raw_data[2007]) << 32 | raw_data[2006]) - .SetData1004(static_cast<int64_t>(raw_data[2009]) << 32 | raw_data[2008]) - .SetData1005(static_cast<int64_t>(raw_data[2011]) << 32 | raw_data[2010]) - .SetData1006(static_cast<int64_t>(raw_data[2013]) << 32 | raw_data[2012]) - .SetData1007(static_cast<int64_t>(raw_data[2015]) << 32 | raw_data[2014]) - .SetData1008(static_cast<int64_t>(raw_data[2017]) << 32 | raw_data[2016]) - .SetData1009(static_cast<int64_t>(raw_data[2019]) << 32 | raw_data[2018]) - .SetData1010(static_cast<int64_t>(raw_data[2021]) << 32 | raw_data[2020]) - .SetData1011(static_cast<int64_t>(raw_data[2023]) << 32 | raw_data[2022]) - .SetData1012(static_cast<int64_t>(raw_data[2025]) << 32 | raw_data[2024]) - .SetData1013(static_cast<int64_t>(raw_data[2027]) << 32 | raw_data[2026]) - .SetData1014(static_cast<int64_t>(raw_data[2029]) << 32 | raw_data[2028]) - .SetData1015(static_cast<int64_t>(raw_data[2031]) << 32 | raw_data[2030]) - .SetData1016(static_cast<int64_t>(raw_data[2033]) << 32 | raw_data[2032]) - .SetData1017(static_cast<int64_t>(raw_data[2035]) << 32 | raw_data[2034]) - .SetData1018(static_cast<int64_t>(raw_data[2037]) << 32 | raw_data[2036]) - .SetData1019(static_cast<int64_t>(raw_data[2039]) << 32 | raw_data[2038]) - .SetData1020(static_cast<int64_t>(raw_data[2041]) << 32 | raw_data[2040]) - .SetData1021(static_cast<int64_t>(raw_data[2043]) << 32 | raw_data[2042]) - .SetData1022(static_cast<int64_t>(raw_data[2045]) << 32 | raw_data[2044]) - .SetData1023(static_cast<int64_t>(raw_data[2047]) << 32 | raw_data[2046]) - .Record(ukm_recorder); + + ukm::builders::V8CompileHints_Version5 ch(execution_context->UkmSourceID()); + ch.SetData0(static_cast<int64_t>(raw_data[1]) << 32 | raw_data[0]); + ch.SetData1(static_cast<int64_t>(raw_data[3]) << 32 | raw_data[2]); + ch.SetData2(static_cast<int64_t>(raw_data[5]) << 32 | raw_data[4]); + ch.SetData3(static_cast<int64_t>(raw_data[7]) << 32 | raw_data[6]); + ch.SetData4(static_cast<int64_t>(raw_data[9]) << 32 | raw_data[8]); + ch.SetData5(static_cast<int64_t>(raw_data[11]) << 32 | raw_data[10]); + ch.SetData6(static_cast<int64_t>(raw_data[13]) << 32 | raw_data[12]); + ch.SetData7(static_cast<int64_t>(raw_data[15]) << 32 | raw_data[14]); + ch.SetData8(static_cast<int64_t>(raw_data[17]) << 32 | raw_data[16]); + ch.SetData9(static_cast<int64_t>(raw_data[19]) << 32 | raw_data[18]); + ch.SetData10(static_cast<int64_t>(raw_data[21]) << 32 | raw_data[20]); + ch.SetData11(static_cast<int64_t>(raw_data[23]) << 32 | raw_data[22]); + ch.SetData12(static_cast<int64_t>(raw_data[25]) << 32 | raw_data[24]); + ch.SetData13(static_cast<int64_t>(raw_data[27]) << 32 | raw_data[26]); + ch.SetData14(static_cast<int64_t>(raw_data[29]) << 32 | raw_data[28]); + ch.SetData15(static_cast<int64_t>(raw_data[31]) << 32 | raw_data[30]); + ch.SetData16(static_cast<int64_t>(raw_data[33]) << 32 | raw_data[32]); + ch.SetData17(static_cast<int64_t>(raw_data[35]) << 32 | raw_data[34]); + ch.SetData18(static_cast<int64_t>(raw_data[37]) << 32 | raw_data[36]); + ch.SetData19(static_cast<int64_t>(raw_data[39]) << 32 | raw_data[38]); + ch.SetData20(static_cast<int64_t>(raw_data[41]) << 32 | raw_data[40]); + ch.SetData21(static_cast<int64_t>(raw_data[43]) << 32 | raw_data[42]); + ch.SetData22(static_cast<int64_t>(raw_data[45]) << 32 | raw_data[44]); + ch.SetData23(static_cast<int64_t>(raw_data[47]) << 32 | raw_data[46]); + ch.SetData24(static_cast<int64_t>(raw_data[49]) << 32 | raw_data[48]); + ch.SetData25(static_cast<int64_t>(raw_data[51]) << 32 | raw_data[50]); + ch.SetData26(static_cast<int64_t>(raw_data[53]) << 32 | raw_data[52]); + ch.SetData27(static_cast<int64_t>(raw_data[55]) << 32 | raw_data[54]); + ch.SetData28(static_cast<int64_t>(raw_data[57]) << 32 | raw_data[56]); + ch.SetData29(static_cast<int64_t>(raw_data[59]) << 32 | raw_data[58]); + ch.SetData30(static_cast<int64_t>(raw_data[61]) << 32 | raw_data[60]); + ch.SetData31(static_cast<int64_t>(raw_data[63]) << 32 | raw_data[62]); + ch.SetData32(static_cast<int64_t>(raw_data[65]) << 32 | raw_data[64]); + ch.SetData33(static_cast<int64_t>(raw_data[67]) << 32 | raw_data[66]); + ch.SetData34(static_cast<int64_t>(raw_data[69]) << 32 | raw_data[68]); + ch.SetData35(static_cast<int64_t>(raw_data[71]) << 32 | raw_data[70]); + ch.SetData36(static_cast<int64_t>(raw_data[73]) << 32 | raw_data[72]); + ch.SetData37(static_cast<int64_t>(raw_data[75]) << 32 | raw_data[74]); + ch.SetData38(static_cast<int64_t>(raw_data[77]) << 32 | raw_data[76]); + ch.SetData39(static_cast<int64_t>(raw_data[79]) << 32 | raw_data[78]); + ch.SetData40(static_cast<int64_t>(raw_data[81]) << 32 | raw_data[80]); + ch.SetData41(static_cast<int64_t>(raw_data[83]) << 32 | raw_data[82]); + ch.SetData42(static_cast<int64_t>(raw_data[85]) << 32 | raw_data[84]); + ch.SetData43(static_cast<int64_t>(raw_data[87]) << 32 | raw_data[86]); + ch.SetData44(static_cast<int64_t>(raw_data[89]) << 32 | raw_data[88]); + ch.SetData45(static_cast<int64_t>(raw_data[91]) << 32 | raw_data[90]); + ch.SetData46(static_cast<int64_t>(raw_data[93]) << 32 | raw_data[92]); + ch.SetData47(static_cast<int64_t>(raw_data[95]) << 32 | raw_data[94]); + ch.SetData48(static_cast<int64_t>(raw_data[97]) << 32 | raw_data[96]); + ch.SetData49(static_cast<int64_t>(raw_data[99]) << 32 | raw_data[98]); + ch.SetData50(static_cast<int64_t>(raw_data[101]) << 32 | raw_data[100]); + ch.SetData51(static_cast<int64_t>(raw_data[103]) << 32 | raw_data[102]); + ch.SetData52(static_cast<int64_t>(raw_data[105]) << 32 | raw_data[104]); + ch.SetData53(static_cast<int64_t>(raw_data[107]) << 32 | raw_data[106]); + ch.SetData54(static_cast<int64_t>(raw_data[109]) << 32 | raw_data[108]); + ch.SetData55(static_cast<int64_t>(raw_data[111]) << 32 | raw_data[110]); + ch.SetData56(static_cast<int64_t>(raw_data[113]) << 32 | raw_data[112]); + ch.SetData57(static_cast<int64_t>(raw_data[115]) << 32 | raw_data[114]); + ch.SetData58(static_cast<int64_t>(raw_data[117]) << 32 | raw_data[116]); + ch.SetData59(static_cast<int64_t>(raw_data[119]) << 32 | raw_data[118]); + ch.SetData60(static_cast<int64_t>(raw_data[121]) << 32 | raw_data[120]); + ch.SetData61(static_cast<int64_t>(raw_data[123]) << 32 | raw_data[122]); + ch.SetData62(static_cast<int64_t>(raw_data[125]) << 32 | raw_data[124]); + ch.SetData63(static_cast<int64_t>(raw_data[127]) << 32 | raw_data[126]); + ch.SetData64(static_cast<int64_t>(raw_data[129]) << 32 | raw_data[128]); + ch.SetData65(static_cast<int64_t>(raw_data[131]) << 32 | raw_data[130]); + ch.SetData66(static_cast<int64_t>(raw_data[133]) << 32 | raw_data[132]); + ch.SetData67(static_cast<int64_t>(raw_data[135]) << 32 | raw_data[134]); + ch.SetData68(static_cast<int64_t>(raw_data[137]) << 32 | raw_data[136]); + ch.SetData69(static_cast<int64_t>(raw_data[139]) << 32 | raw_data[138]); + ch.SetData70(static_cast<int64_t>(raw_data[141]) << 32 | raw_data[140]); + ch.SetData71(static_cast<int64_t>(raw_data[143]) << 32 | raw_data[142]); + ch.SetData72(static_cast<int64_t>(raw_data[145]) << 32 | raw_data[144]); + ch.SetData73(static_cast<int64_t>(raw_data[147]) << 32 | raw_data[146]); + ch.SetData74(static_cast<int64_t>(raw_data[149]) << 32 | raw_data[148]); + ch.SetData75(static_cast<int64_t>(raw_data[151]) << 32 | raw_data[150]); + ch.SetData76(static_cast<int64_t>(raw_data[153]) << 32 | raw_data[152]); + ch.SetData77(static_cast<int64_t>(raw_data[155]) << 32 | raw_data[154]); + ch.SetData78(static_cast<int64_t>(raw_data[157]) << 32 | raw_data[156]); + ch.SetData79(static_cast<int64_t>(raw_data[159]) << 32 | raw_data[158]); + ch.SetData80(static_cast<int64_t>(raw_data[161]) << 32 | raw_data[160]); + ch.SetData81(static_cast<int64_t>(raw_data[163]) << 32 | raw_data[162]); + ch.SetData82(static_cast<int64_t>(raw_data[165]) << 32 | raw_data[164]); + ch.SetData83(static_cast<int64_t>(raw_data[167]) << 32 | raw_data[166]); + ch.SetData84(static_cast<int64_t>(raw_data[169]) << 32 | raw_data[168]); + ch.SetData85(static_cast<int64_t>(raw_data[171]) << 32 | raw_data[170]); + ch.SetData86(static_cast<int64_t>(raw_data[173]) << 32 | raw_data[172]); + ch.SetData87(static_cast<int64_t>(raw_data[175]) << 32 | raw_data[174]); + ch.SetData88(static_cast<int64_t>(raw_data[177]) << 32 | raw_data[176]); + ch.SetData89(static_cast<int64_t>(raw_data[179]) << 32 | raw_data[178]); + ch.SetData90(static_cast<int64_t>(raw_data[181]) << 32 | raw_data[180]); + ch.SetData91(static_cast<int64_t>(raw_data[183]) << 32 | raw_data[182]); + ch.SetData92(static_cast<int64_t>(raw_data[185]) << 32 | raw_data[184]); + ch.SetData93(static_cast<int64_t>(raw_data[187]) << 32 | raw_data[186]); + ch.SetData94(static_cast<int64_t>(raw_data[189]) << 32 | raw_data[188]); + ch.SetData95(static_cast<int64_t>(raw_data[191]) << 32 | raw_data[190]); + ch.SetData96(static_cast<int64_t>(raw_data[193]) << 32 | raw_data[192]); + ch.SetData97(static_cast<int64_t>(raw_data[195]) << 32 | raw_data[194]); + ch.SetData98(static_cast<int64_t>(raw_data[197]) << 32 | raw_data[196]); + ch.SetData99(static_cast<int64_t>(raw_data[199]) << 32 | raw_data[198]); + ch.SetData100(static_cast<int64_t>(raw_data[201]) << 32 | raw_data[200]); + ch.SetData101(static_cast<int64_t>(raw_data[203]) << 32 | raw_data[202]); + ch.SetData102(static_cast<int64_t>(raw_data[205]) << 32 | raw_data[204]); + ch.SetData103(static_cast<int64_t>(raw_data[207]) << 32 | raw_data[206]); + ch.SetData104(static_cast<int64_t>(raw_data[209]) << 32 | raw_data[208]); + ch.SetData105(static_cast<int64_t>(raw_data[211]) << 32 | raw_data[210]); + ch.SetData106(static_cast<int64_t>(raw_data[213]) << 32 | raw_data[212]); + ch.SetData107(static_cast<int64_t>(raw_data[215]) << 32 | raw_data[214]); + ch.SetData108(static_cast<int64_t>(raw_data[217]) << 32 | raw_data[216]); + ch.SetData109(static_cast<int64_t>(raw_data[219]) << 32 | raw_data[218]); + ch.SetData110(static_cast<int64_t>(raw_data[221]) << 32 | raw_data[220]); + ch.SetData111(static_cast<int64_t>(raw_data[223]) << 32 | raw_data[222]); + ch.SetData112(static_cast<int64_t>(raw_data[225]) << 32 | raw_data[224]); + ch.SetData113(static_cast<int64_t>(raw_data[227]) << 32 | raw_data[226]); + ch.SetData114(static_cast<int64_t>(raw_data[229]) << 32 | raw_data[228]); + ch.SetData115(static_cast<int64_t>(raw_data[231]) << 32 | raw_data[230]); + ch.SetData116(static_cast<int64_t>(raw_data[233]) << 32 | raw_data[232]); + ch.SetData117(static_cast<int64_t>(raw_data[235]) << 32 | raw_data[234]); + ch.SetData118(static_cast<int64_t>(raw_data[237]) << 32 | raw_data[236]); + ch.SetData119(static_cast<int64_t>(raw_data[239]) << 32 | raw_data[238]); + ch.SetData120(static_cast<int64_t>(raw_data[241]) << 32 | raw_data[240]); + ch.SetData121(static_cast<int64_t>(raw_data[243]) << 32 | raw_data[242]); + ch.SetData122(static_cast<int64_t>(raw_data[245]) << 32 | raw_data[244]); + ch.SetData123(static_cast<int64_t>(raw_data[247]) << 32 | raw_data[246]); + ch.SetData124(static_cast<int64_t>(raw_data[249]) << 32 | raw_data[248]); + ch.SetData125(static_cast<int64_t>(raw_data[251]) << 32 | raw_data[250]); + ch.SetData126(static_cast<int64_t>(raw_data[253]) << 32 | raw_data[252]); + ch.SetData127(static_cast<int64_t>(raw_data[255]) << 32 | raw_data[254]); + ch.SetData128(static_cast<int64_t>(raw_data[257]) << 32 | raw_data[256]); + ch.SetData129(static_cast<int64_t>(raw_data[259]) << 32 | raw_data[258]); + ch.SetData130(static_cast<int64_t>(raw_data[261]) << 32 | raw_data[260]); + ch.SetData131(static_cast<int64_t>(raw_data[263]) << 32 | raw_data[262]); + ch.SetData132(static_cast<int64_t>(raw_data[265]) << 32 | raw_data[264]); + ch.SetData133(static_cast<int64_t>(raw_data[267]) << 32 | raw_data[266]); + ch.SetData134(static_cast<int64_t>(raw_data[269]) << 32 | raw_data[268]); + ch.SetData135(static_cast<int64_t>(raw_data[271]) << 32 | raw_data[270]); + ch.SetData136(static_cast<int64_t>(raw_data[273]) << 32 | raw_data[272]); + ch.SetData137(static_cast<int64_t>(raw_data[275]) << 32 | raw_data[274]); + ch.SetData138(static_cast<int64_t>(raw_data[277]) << 32 | raw_data[276]); + ch.SetData139(static_cast<int64_t>(raw_data[279]) << 32 | raw_data[278]); + ch.SetData140(static_cast<int64_t>(raw_data[281]) << 32 | raw_data[280]); + ch.SetData141(static_cast<int64_t>(raw_data[283]) << 32 | raw_data[282]); + ch.SetData142(static_cast<int64_t>(raw_data[285]) << 32 | raw_data[284]); + ch.SetData143(static_cast<int64_t>(raw_data[287]) << 32 | raw_data[286]); + ch.SetData144(static_cast<int64_t>(raw_data[289]) << 32 | raw_data[288]); + ch.SetData145(static_cast<int64_t>(raw_data[291]) << 32 | raw_data[290]); + ch.SetData146(static_cast<int64_t>(raw_data[293]) << 32 | raw_data[292]); + ch.SetData147(static_cast<int64_t>(raw_data[295]) << 32 | raw_data[294]); + ch.SetData148(static_cast<int64_t>(raw_data[297]) << 32 | raw_data[296]); + ch.SetData149(static_cast<int64_t>(raw_data[299]) << 32 | raw_data[298]); + ch.SetData150(static_cast<int64_t>(raw_data[301]) << 32 | raw_data[300]); + ch.SetData151(static_cast<int64_t>(raw_data[303]) << 32 | raw_data[302]); + ch.SetData152(static_cast<int64_t>(raw_data[305]) << 32 | raw_data[304]); + ch.SetData153(static_cast<int64_t>(raw_data[307]) << 32 | raw_data[306]); + ch.SetData154(static_cast<int64_t>(raw_data[309]) << 32 | raw_data[308]); + ch.SetData155(static_cast<int64_t>(raw_data[311]) << 32 | raw_data[310]); + ch.SetData156(static_cast<int64_t>(raw_data[313]) << 32 | raw_data[312]); + ch.SetData157(static_cast<int64_t>(raw_data[315]) << 32 | raw_data[314]); + ch.SetData158(static_cast<int64_t>(raw_data[317]) << 32 | raw_data[316]); + ch.SetData159(static_cast<int64_t>(raw_data[319]) << 32 | raw_data[318]); + ch.SetData160(static_cast<int64_t>(raw_data[321]) << 32 | raw_data[320]); + ch.SetData161(static_cast<int64_t>(raw_data[323]) << 32 | raw_data[322]); + ch.SetData162(static_cast<int64_t>(raw_data[325]) << 32 | raw_data[324]); + ch.SetData163(static_cast<int64_t>(raw_data[327]) << 32 | raw_data[326]); + ch.SetData164(static_cast<int64_t>(raw_data[329]) << 32 | raw_data[328]); + ch.SetData165(static_cast<int64_t>(raw_data[331]) << 32 | raw_data[330]); + ch.SetData166(static_cast<int64_t>(raw_data[333]) << 32 | raw_data[332]); + ch.SetData167(static_cast<int64_t>(raw_data[335]) << 32 | raw_data[334]); + ch.SetData168(static_cast<int64_t>(raw_data[337]) << 32 | raw_data[336]); + ch.SetData169(static_cast<int64_t>(raw_data[339]) << 32 | raw_data[338]); + ch.SetData170(static_cast<int64_t>(raw_data[341]) << 32 | raw_data[340]); + ch.SetData171(static_cast<int64_t>(raw_data[343]) << 32 | raw_data[342]); + ch.SetData172(static_cast<int64_t>(raw_data[345]) << 32 | raw_data[344]); + ch.SetData173(static_cast<int64_t>(raw_data[347]) << 32 | raw_data[346]); + ch.SetData174(static_cast<int64_t>(raw_data[349]) << 32 | raw_data[348]); + ch.SetData175(static_cast<int64_t>(raw_data[351]) << 32 | raw_data[350]); + ch.SetData176(static_cast<int64_t>(raw_data[353]) << 32 | raw_data[352]); + ch.SetData177(static_cast<int64_t>(raw_data[355]) << 32 | raw_data[354]); + ch.SetData178(static_cast<int64_t>(raw_data[357]) << 32 | raw_data[356]); + ch.SetData179(static_cast<int64_t>(raw_data[359]) << 32 | raw_data[358]); + ch.SetData180(static_cast<int64_t>(raw_data[361]) << 32 | raw_data[360]); + ch.SetData181(static_cast<int64_t>(raw_data[363]) << 32 | raw_data[362]); + ch.SetData182(static_cast<int64_t>(raw_data[365]) << 32 | raw_data[364]); + ch.SetData183(static_cast<int64_t>(raw_data[367]) << 32 | raw_data[366]); + ch.SetData184(static_cast<int64_t>(raw_data[369]) << 32 | raw_data[368]); + ch.SetData185(static_cast<int64_t>(raw_data[371]) << 32 | raw_data[370]); + ch.SetData186(static_cast<int64_t>(raw_data[373]) << 32 | raw_data[372]); + ch.SetData187(static_cast<int64_t>(raw_data[375]) << 32 | raw_data[374]); + ch.SetData188(static_cast<int64_t>(raw_data[377]) << 32 | raw_data[376]); + ch.SetData189(static_cast<int64_t>(raw_data[379]) << 32 | raw_data[378]); + ch.SetData190(static_cast<int64_t>(raw_data[381]) << 32 | raw_data[380]); + ch.SetData191(static_cast<int64_t>(raw_data[383]) << 32 | raw_data[382]); + ch.SetData192(static_cast<int64_t>(raw_data[385]) << 32 | raw_data[384]); + ch.SetData193(static_cast<int64_t>(raw_data[387]) << 32 | raw_data[386]); + ch.SetData194(static_cast<int64_t>(raw_data[389]) << 32 | raw_data[388]); + ch.SetData195(static_cast<int64_t>(raw_data[391]) << 32 | raw_data[390]); + ch.SetData196(static_cast<int64_t>(raw_data[393]) << 32 | raw_data[392]); + ch.SetData197(static_cast<int64_t>(raw_data[395]) << 32 | raw_data[394]); + ch.SetData198(static_cast<int64_t>(raw_data[397]) << 32 | raw_data[396]); + ch.SetData199(static_cast<int64_t>(raw_data[399]) << 32 | raw_data[398]); + ch.SetData200(static_cast<int64_t>(raw_data[401]) << 32 | raw_data[400]); + ch.SetData201(static_cast<int64_t>(raw_data[403]) << 32 | raw_data[402]); + ch.SetData202(static_cast<int64_t>(raw_data[405]) << 32 | raw_data[404]); + ch.SetData203(static_cast<int64_t>(raw_data[407]) << 32 | raw_data[406]); + ch.SetData204(static_cast<int64_t>(raw_data[409]) << 32 | raw_data[408]); + ch.SetData205(static_cast<int64_t>(raw_data[411]) << 32 | raw_data[410]); + ch.SetData206(static_cast<int64_t>(raw_data[413]) << 32 | raw_data[412]); + ch.SetData207(static_cast<int64_t>(raw_data[415]) << 32 | raw_data[414]); + ch.SetData208(static_cast<int64_t>(raw_data[417]) << 32 | raw_data[416]); + ch.SetData209(static_cast<int64_t>(raw_data[419]) << 32 | raw_data[418]); + ch.SetData210(static_cast<int64_t>(raw_data[421]) << 32 | raw_data[420]); + ch.SetData211(static_cast<int64_t>(raw_data[423]) << 32 | raw_data[422]); + ch.SetData212(static_cast<int64_t>(raw_data[425]) << 32 | raw_data[424]); + ch.SetData213(static_cast<int64_t>(raw_data[427]) << 32 | raw_data[426]); + ch.SetData214(static_cast<int64_t>(raw_data[429]) << 32 | raw_data[428]); + ch.SetData215(static_cast<int64_t>(raw_data[431]) << 32 | raw_data[430]); + ch.SetData216(static_cast<int64_t>(raw_data[433]) << 32 | raw_data[432]); + ch.SetData217(static_cast<int64_t>(raw_data[435]) << 32 | raw_data[434]); + ch.SetData218(static_cast<int64_t>(raw_data[437]) << 32 | raw_data[436]); + ch.SetData219(static_cast<int64_t>(raw_data[439]) << 32 | raw_data[438]); + ch.SetData220(static_cast<int64_t>(raw_data[441]) << 32 | raw_data[440]); + ch.SetData221(static_cast<int64_t>(raw_data[443]) << 32 | raw_data[442]); + ch.SetData222(static_cast<int64_t>(raw_data[445]) << 32 | raw_data[444]); + ch.SetData223(static_cast<int64_t>(raw_data[447]) << 32 | raw_data[446]); + ch.SetData224(static_cast<int64_t>(raw_data[449]) << 32 | raw_data[448]); + ch.SetData225(static_cast<int64_t>(raw_data[451]) << 32 | raw_data[450]); + ch.SetData226(static_cast<int64_t>(raw_data[453]) << 32 | raw_data[452]); + ch.SetData227(static_cast<int64_t>(raw_data[455]) << 32 | raw_data[454]); + ch.SetData228(static_cast<int64_t>(raw_data[457]) << 32 | raw_data[456]); + ch.SetData229(static_cast<int64_t>(raw_data[459]) << 32 | raw_data[458]); + ch.SetData230(static_cast<int64_t>(raw_data[461]) << 32 | raw_data[460]); + ch.SetData231(static_cast<int64_t>(raw_data[463]) << 32 | raw_data[462]); + ch.SetData232(static_cast<int64_t>(raw_data[465]) << 32 | raw_data[464]); + ch.SetData233(static_cast<int64_t>(raw_data[467]) << 32 | raw_data[466]); + ch.SetData234(static_cast<int64_t>(raw_data[469]) << 32 | raw_data[468]); + ch.SetData235(static_cast<int64_t>(raw_data[471]) << 32 | raw_data[470]); + ch.SetData236(static_cast<int64_t>(raw_data[473]) << 32 | raw_data[472]); + ch.SetData237(static_cast<int64_t>(raw_data[475]) << 32 | raw_data[474]); + ch.SetData238(static_cast<int64_t>(raw_data[477]) << 32 | raw_data[476]); + ch.SetData239(static_cast<int64_t>(raw_data[479]) << 32 | raw_data[478]); + ch.SetData240(static_cast<int64_t>(raw_data[481]) << 32 | raw_data[480]); + ch.SetData241(static_cast<int64_t>(raw_data[483]) << 32 | raw_data[482]); + ch.SetData242(static_cast<int64_t>(raw_data[485]) << 32 | raw_data[484]); + ch.SetData243(static_cast<int64_t>(raw_data[487]) << 32 | raw_data[486]); + ch.SetData244(static_cast<int64_t>(raw_data[489]) << 32 | raw_data[488]); + ch.SetData245(static_cast<int64_t>(raw_data[491]) << 32 | raw_data[490]); + ch.SetData246(static_cast<int64_t>(raw_data[493]) << 32 | raw_data[492]); + ch.SetData247(static_cast<int64_t>(raw_data[495]) << 32 | raw_data[494]); + ch.SetData248(static_cast<int64_t>(raw_data[497]) << 32 | raw_data[496]); + ch.SetData249(static_cast<int64_t>(raw_data[499]) << 32 | raw_data[498]); + ch.SetData250(static_cast<int64_t>(raw_data[501]) << 32 | raw_data[500]); + ch.SetData251(static_cast<int64_t>(raw_data[503]) << 32 | raw_data[502]); + ch.SetData252(static_cast<int64_t>(raw_data[505]) << 32 | raw_data[504]); + ch.SetData253(static_cast<int64_t>(raw_data[507]) << 32 | raw_data[506]); + ch.SetData254(static_cast<int64_t>(raw_data[509]) << 32 | raw_data[508]); + ch.SetData255(static_cast<int64_t>(raw_data[511]) << 32 | raw_data[510]); + ch.SetData256(static_cast<int64_t>(raw_data[513]) << 32 | raw_data[512]); + ch.SetData257(static_cast<int64_t>(raw_data[515]) << 32 | raw_data[514]); + ch.SetData258(static_cast<int64_t>(raw_data[517]) << 32 | raw_data[516]); + ch.SetData259(static_cast<int64_t>(raw_data[519]) << 32 | raw_data[518]); + ch.SetData260(static_cast<int64_t>(raw_data[521]) << 32 | raw_data[520]); + ch.SetData261(static_cast<int64_t>(raw_data[523]) << 32 | raw_data[522]); + ch.SetData262(static_cast<int64_t>(raw_data[525]) << 32 | raw_data[524]); + ch.SetData263(static_cast<int64_t>(raw_data[527]) << 32 | raw_data[526]); + ch.SetData264(static_cast<int64_t>(raw_data[529]) << 32 | raw_data[528]); + ch.SetData265(static_cast<int64_t>(raw_data[531]) << 32 | raw_data[530]); + ch.SetData266(static_cast<int64_t>(raw_data[533]) << 32 | raw_data[532]); + ch.SetData267(static_cast<int64_t>(raw_data[535]) << 32 | raw_data[534]); + ch.SetData268(static_cast<int64_t>(raw_data[537]) << 32 | raw_data[536]); + ch.SetData269(static_cast<int64_t>(raw_data[539]) << 32 | raw_data[538]); + ch.SetData270(static_cast<int64_t>(raw_data[541]) << 32 | raw_data[540]); + ch.SetData271(static_cast<int64_t>(raw_data[543]) << 32 | raw_data[542]); + ch.SetData272(static_cast<int64_t>(raw_data[545]) << 32 | raw_data[544]); + ch.SetData273(static_cast<int64_t>(raw_data[547]) << 32 | raw_data[546]); + ch.SetData274(static_cast<int64_t>(raw_data[549]) << 32 | raw_data[548]); + ch.SetData275(static_cast<int64_t>(raw_data[551]) << 32 | raw_data[550]); + ch.SetData276(static_cast<int64_t>(raw_data[553]) << 32 | raw_data[552]); + ch.SetData277(static_cast<int64_t>(raw_data[555]) << 32 | raw_data[554]); + ch.SetData278(static_cast<int64_t>(raw_data[557]) << 32 | raw_data[556]); + ch.SetData279(static_cast<int64_t>(raw_data[559]) << 32 | raw_data[558]); + ch.SetData280(static_cast<int64_t>(raw_data[561]) << 32 | raw_data[560]); + ch.SetData281(static_cast<int64_t>(raw_data[563]) << 32 | raw_data[562]); + ch.SetData282(static_cast<int64_t>(raw_data[565]) << 32 | raw_data[564]); + ch.SetData283(static_cast<int64_t>(raw_data[567]) << 32 | raw_data[566]); + ch.SetData284(static_cast<int64_t>(raw_data[569]) << 32 | raw_data[568]); + ch.SetData285(static_cast<int64_t>(raw_data[571]) << 32 | raw_data[570]); + ch.SetData286(static_cast<int64_t>(raw_data[573]) << 32 | raw_data[572]); + ch.SetData287(static_cast<int64_t>(raw_data[575]) << 32 | raw_data[574]); + ch.SetData288(static_cast<int64_t>(raw_data[577]) << 32 | raw_data[576]); + ch.SetData289(static_cast<int64_t>(raw_data[579]) << 32 | raw_data[578]); + ch.SetData290(static_cast<int64_t>(raw_data[581]) << 32 | raw_data[580]); + ch.SetData291(static_cast<int64_t>(raw_data[583]) << 32 | raw_data[582]); + ch.SetData292(static_cast<int64_t>(raw_data[585]) << 32 | raw_data[584]); + ch.SetData293(static_cast<int64_t>(raw_data[587]) << 32 | raw_data[586]); + ch.SetData294(static_cast<int64_t>(raw_data[589]) << 32 | raw_data[588]); + ch.SetData295(static_cast<int64_t>(raw_data[591]) << 32 | raw_data[590]); + ch.SetData296(static_cast<int64_t>(raw_data[593]) << 32 | raw_data[592]); + ch.SetData297(static_cast<int64_t>(raw_data[595]) << 32 | raw_data[594]); + ch.SetData298(static_cast<int64_t>(raw_data[597]) << 32 | raw_data[596]); + ch.SetData299(static_cast<int64_t>(raw_data[599]) << 32 | raw_data[598]); + ch.SetData300(static_cast<int64_t>(raw_data[601]) << 32 | raw_data[600]); + ch.SetData301(static_cast<int64_t>(raw_data[603]) << 32 | raw_data[602]); + ch.SetData302(static_cast<int64_t>(raw_data[605]) << 32 | raw_data[604]); + ch.SetData303(static_cast<int64_t>(raw_data[607]) << 32 | raw_data[606]); + ch.SetData304(static_cast<int64_t>(raw_data[609]) << 32 | raw_data[608]); + ch.SetData305(static_cast<int64_t>(raw_data[611]) << 32 | raw_data[610]); + ch.SetData306(static_cast<int64_t>(raw_data[613]) << 32 | raw_data[612]); + ch.SetData307(static_cast<int64_t>(raw_data[615]) << 32 | raw_data[614]); + ch.SetData308(static_cast<int64_t>(raw_data[617]) << 32 | raw_data[616]); + ch.SetData309(static_cast<int64_t>(raw_data[619]) << 32 | raw_data[618]); + ch.SetData310(static_cast<int64_t>(raw_data[621]) << 32 | raw_data[620]); + ch.SetData311(static_cast<int64_t>(raw_data[623]) << 32 | raw_data[622]); + ch.SetData312(static_cast<int64_t>(raw_data[625]) << 32 | raw_data[624]); + ch.SetData313(static_cast<int64_t>(raw_data[627]) << 32 | raw_data[626]); + ch.SetData314(static_cast<int64_t>(raw_data[629]) << 32 | raw_data[628]); + ch.SetData315(static_cast<int64_t>(raw_data[631]) << 32 | raw_data[630]); + ch.SetData316(static_cast<int64_t>(raw_data[633]) << 32 | raw_data[632]); + ch.SetData317(static_cast<int64_t>(raw_data[635]) << 32 | raw_data[634]); + ch.SetData318(static_cast<int64_t>(raw_data[637]) << 32 | raw_data[636]); + ch.SetData319(static_cast<int64_t>(raw_data[639]) << 32 | raw_data[638]); + ch.SetData320(static_cast<int64_t>(raw_data[641]) << 32 | raw_data[640]); + ch.SetData321(static_cast<int64_t>(raw_data[643]) << 32 | raw_data[642]); + ch.SetData322(static_cast<int64_t>(raw_data[645]) << 32 | raw_data[644]); + ch.SetData323(static_cast<int64_t>(raw_data[647]) << 32 | raw_data[646]); + ch.SetData324(static_cast<int64_t>(raw_data[649]) << 32 | raw_data[648]); + ch.SetData325(static_cast<int64_t>(raw_data[651]) << 32 | raw_data[650]); + ch.SetData326(static_cast<int64_t>(raw_data[653]) << 32 | raw_data[652]); + ch.SetData327(static_cast<int64_t>(raw_data[655]) << 32 | raw_data[654]); + ch.SetData328(static_cast<int64_t>(raw_data[657]) << 32 | raw_data[656]); + ch.SetData329(static_cast<int64_t>(raw_data[659]) << 32 | raw_data[658]); + ch.SetData330(static_cast<int64_t>(raw_data[661]) << 32 | raw_data[660]); + ch.SetData331(static_cast<int64_t>(raw_data[663]) << 32 | raw_data[662]); + ch.SetData332(static_cast<int64_t>(raw_data[665]) << 32 | raw_data[664]); + ch.SetData333(static_cast<int64_t>(raw_data[667]) << 32 | raw_data[666]); + ch.SetData334(static_cast<int64_t>(raw_data[669]) << 32 | raw_data[668]); + ch.SetData335(static_cast<int64_t>(raw_data[671]) << 32 | raw_data[670]); + ch.SetData336(static_cast<int64_t>(raw_data[673]) << 32 | raw_data[672]); + ch.SetData337(static_cast<int64_t>(raw_data[675]) << 32 | raw_data[674]); + ch.SetData338(static_cast<int64_t>(raw_data[677]) << 32 | raw_data[676]); + ch.SetData339(static_cast<int64_t>(raw_data[679]) << 32 | raw_data[678]); + ch.SetData340(static_cast<int64_t>(raw_data[681]) << 32 | raw_data[680]); + ch.SetData341(static_cast<int64_t>(raw_data[683]) << 32 | raw_data[682]); + ch.SetData342(static_cast<int64_t>(raw_data[685]) << 32 | raw_data[684]); + ch.SetData343(static_cast<int64_t>(raw_data[687]) << 32 | raw_data[686]); + ch.SetData344(static_cast<int64_t>(raw_data[689]) << 32 | raw_data[688]); + ch.SetData345(static_cast<int64_t>(raw_data[691]) << 32 | raw_data[690]); + ch.SetData346(static_cast<int64_t>(raw_data[693]) << 32 | raw_data[692]); + ch.SetData347(static_cast<int64_t>(raw_data[695]) << 32 | raw_data[694]); + ch.SetData348(static_cast<int64_t>(raw_data[697]) << 32 | raw_data[696]); + ch.SetData349(static_cast<int64_t>(raw_data[699]) << 32 | raw_data[698]); + ch.SetData350(static_cast<int64_t>(raw_data[701]) << 32 | raw_data[700]); + ch.SetData351(static_cast<int64_t>(raw_data[703]) << 32 | raw_data[702]); + ch.SetData352(static_cast<int64_t>(raw_data[705]) << 32 | raw_data[704]); + ch.SetData353(static_cast<int64_t>(raw_data[707]) << 32 | raw_data[706]); + ch.SetData354(static_cast<int64_t>(raw_data[709]) << 32 | raw_data[708]); + ch.SetData355(static_cast<int64_t>(raw_data[711]) << 32 | raw_data[710]); + ch.SetData356(static_cast<int64_t>(raw_data[713]) << 32 | raw_data[712]); + ch.SetData357(static_cast<int64_t>(raw_data[715]) << 32 | raw_data[714]); + ch.SetData358(static_cast<int64_t>(raw_data[717]) << 32 | raw_data[716]); + ch.SetData359(static_cast<int64_t>(raw_data[719]) << 32 | raw_data[718]); + ch.SetData360(static_cast<int64_t>(raw_data[721]) << 32 | raw_data[720]); + ch.SetData361(static_cast<int64_t>(raw_data[723]) << 32 | raw_data[722]); + ch.SetData362(static_cast<int64_t>(raw_data[725]) << 32 | raw_data[724]); + ch.SetData363(static_cast<int64_t>(raw_data[727]) << 32 | raw_data[726]); + ch.SetData364(static_cast<int64_t>(raw_data[729]) << 32 | raw_data[728]); + ch.SetData365(static_cast<int64_t>(raw_data[731]) << 32 | raw_data[730]); + ch.SetData366(static_cast<int64_t>(raw_data[733]) << 32 | raw_data[732]); + ch.SetData367(static_cast<int64_t>(raw_data[735]) << 32 | raw_data[734]); + ch.SetData368(static_cast<int64_t>(raw_data[737]) << 32 | raw_data[736]); + ch.SetData369(static_cast<int64_t>(raw_data[739]) << 32 | raw_data[738]); + ch.SetData370(static_cast<int64_t>(raw_data[741]) << 32 | raw_data[740]); + ch.SetData371(static_cast<int64_t>(raw_data[743]) << 32 | raw_data[742]); + ch.SetData372(static_cast<int64_t>(raw_data[745]) << 32 | raw_data[744]); + ch.SetData373(static_cast<int64_t>(raw_data[747]) << 32 | raw_data[746]); + ch.SetData374(static_cast<int64_t>(raw_data[749]) << 32 | raw_data[748]); + ch.SetData375(static_cast<int64_t>(raw_data[751]) << 32 | raw_data[750]); + ch.SetData376(static_cast<int64_t>(raw_data[753]) << 32 | raw_data[752]); + ch.SetData377(static_cast<int64_t>(raw_data[755]) << 32 | raw_data[754]); + ch.SetData378(static_cast<int64_t>(raw_data[757]) << 32 | raw_data[756]); + ch.SetData379(static_cast<int64_t>(raw_data[759]) << 32 | raw_data[758]); + ch.SetData380(static_cast<int64_t>(raw_data[761]) << 32 | raw_data[760]); + ch.SetData381(static_cast<int64_t>(raw_data[763]) << 32 | raw_data[762]); + ch.SetData382(static_cast<int64_t>(raw_data[765]) << 32 | raw_data[764]); + ch.SetData383(static_cast<int64_t>(raw_data[767]) << 32 | raw_data[766]); + ch.SetData384(static_cast<int64_t>(raw_data[769]) << 32 | raw_data[768]); + ch.SetData385(static_cast<int64_t>(raw_data[771]) << 32 | raw_data[770]); + ch.SetData386(static_cast<int64_t>(raw_data[773]) << 32 | raw_data[772]); + ch.SetData387(static_cast<int64_t>(raw_data[775]) << 32 | raw_data[774]); + ch.SetData388(static_cast<int64_t>(raw_data[777]) << 32 | raw_data[776]); + ch.SetData389(static_cast<int64_t>(raw_data[779]) << 32 | raw_data[778]); + ch.SetData390(static_cast<int64_t>(raw_data[781]) << 32 | raw_data[780]); + ch.SetData391(static_cast<int64_t>(raw_data[783]) << 32 | raw_data[782]); + ch.SetData392(static_cast<int64_t>(raw_data[785]) << 32 | raw_data[784]); + ch.SetData393(static_cast<int64_t>(raw_data[787]) << 32 | raw_data[786]); + ch.SetData394(static_cast<int64_t>(raw_data[789]) << 32 | raw_data[788]); + ch.SetData395(static_cast<int64_t>(raw_data[791]) << 32 | raw_data[790]); + ch.SetData396(static_cast<int64_t>(raw_data[793]) << 32 | raw_data[792]); + ch.SetData397(static_cast<int64_t>(raw_data[795]) << 32 | raw_data[794]); + ch.SetData398(static_cast<int64_t>(raw_data[797]) << 32 | raw_data[796]); + ch.SetData399(static_cast<int64_t>(raw_data[799]) << 32 | raw_data[798]); + ch.SetData400(static_cast<int64_t>(raw_data[801]) << 32 | raw_data[800]); + ch.SetData401(static_cast<int64_t>(raw_data[803]) << 32 | raw_data[802]); + ch.SetData402(static_cast<int64_t>(raw_data[805]) << 32 | raw_data[804]); + ch.SetData403(static_cast<int64_t>(raw_data[807]) << 32 | raw_data[806]); + ch.SetData404(static_cast<int64_t>(raw_data[809]) << 32 | raw_data[808]); + ch.SetData405(static_cast<int64_t>(raw_data[811]) << 32 | raw_data[810]); + ch.SetData406(static_cast<int64_t>(raw_data[813]) << 32 | raw_data[812]); + ch.SetData407(static_cast<int64_t>(raw_data[815]) << 32 | raw_data[814]); + ch.SetData408(static_cast<int64_t>(raw_data[817]) << 32 | raw_data[816]); + ch.SetData409(static_cast<int64_t>(raw_data[819]) << 32 | raw_data[818]); + ch.SetData410(static_cast<int64_t>(raw_data[821]) << 32 | raw_data[820]); + ch.SetData411(static_cast<int64_t>(raw_data[823]) << 32 | raw_data[822]); + ch.SetData412(static_cast<int64_t>(raw_data[825]) << 32 | raw_data[824]); + ch.SetData413(static_cast<int64_t>(raw_data[827]) << 32 | raw_data[826]); + ch.SetData414(static_cast<int64_t>(raw_data[829]) << 32 | raw_data[828]); + ch.SetData415(static_cast<int64_t>(raw_data[831]) << 32 | raw_data[830]); + ch.SetData416(static_cast<int64_t>(raw_data[833]) << 32 | raw_data[832]); + ch.SetData417(static_cast<int64_t>(raw_data[835]) << 32 | raw_data[834]); + ch.SetData418(static_cast<int64_t>(raw_data[837]) << 32 | raw_data[836]); + ch.SetData419(static_cast<int64_t>(raw_data[839]) << 32 | raw_data[838]); + ch.SetData420(static_cast<int64_t>(raw_data[841]) << 32 | raw_data[840]); + ch.SetData421(static_cast<int64_t>(raw_data[843]) << 32 | raw_data[842]); + ch.SetData422(static_cast<int64_t>(raw_data[845]) << 32 | raw_data[844]); + ch.SetData423(static_cast<int64_t>(raw_data[847]) << 32 | raw_data[846]); + ch.SetData424(static_cast<int64_t>(raw_data[849]) << 32 | raw_data[848]); + ch.SetData425(static_cast<int64_t>(raw_data[851]) << 32 | raw_data[850]); + ch.SetData426(static_cast<int64_t>(raw_data[853]) << 32 | raw_data[852]); + ch.SetData427(static_cast<int64_t>(raw_data[855]) << 32 | raw_data[854]); + ch.SetData428(static_cast<int64_t>(raw_data[857]) << 32 | raw_data[856]); + ch.SetData429(static_cast<int64_t>(raw_data[859]) << 32 | raw_data[858]); + ch.SetData430(static_cast<int64_t>(raw_data[861]) << 32 | raw_data[860]); + ch.SetData431(static_cast<int64_t>(raw_data[863]) << 32 | raw_data[862]); + ch.SetData432(static_cast<int64_t>(raw_data[865]) << 32 | raw_data[864]); + ch.SetData433(static_cast<int64_t>(raw_data[867]) << 32 | raw_data[866]); + ch.SetData434(static_cast<int64_t>(raw_data[869]) << 32 | raw_data[868]); + ch.SetData435(static_cast<int64_t>(raw_data[871]) << 32 | raw_data[870]); + ch.SetData436(static_cast<int64_t>(raw_data[873]) << 32 | raw_data[872]); + ch.SetData437(static_cast<int64_t>(raw_data[875]) << 32 | raw_data[874]); + ch.SetData438(static_cast<int64_t>(raw_data[877]) << 32 | raw_data[876]); + ch.SetData439(static_cast<int64_t>(raw_data[879]) << 32 | raw_data[878]); + ch.SetData440(static_cast<int64_t>(raw_data[881]) << 32 | raw_data[880]); + ch.SetData441(static_cast<int64_t>(raw_data[883]) << 32 | raw_data[882]); + ch.SetData442(static_cast<int64_t>(raw_data[885]) << 32 | raw_data[884]); + ch.SetData443(static_cast<int64_t>(raw_data[887]) << 32 | raw_data[886]); + ch.SetData444(static_cast<int64_t>(raw_data[889]) << 32 | raw_data[888]); + ch.SetData445(static_cast<int64_t>(raw_data[891]) << 32 | raw_data[890]); + ch.SetData446(static_cast<int64_t>(raw_data[893]) << 32 | raw_data[892]); + ch.SetData447(static_cast<int64_t>(raw_data[895]) << 32 | raw_data[894]); + ch.SetData448(static_cast<int64_t>(raw_data[897]) << 32 | raw_data[896]); + ch.SetData449(static_cast<int64_t>(raw_data[899]) << 32 | raw_data[898]); + ch.SetData450(static_cast<int64_t>(raw_data[901]) << 32 | raw_data[900]); + ch.SetData451(static_cast<int64_t>(raw_data[903]) << 32 | raw_data[902]); + ch.SetData452(static_cast<int64_t>(raw_data[905]) << 32 | raw_data[904]); + ch.SetData453(static_cast<int64_t>(raw_data[907]) << 32 | raw_data[906]); + ch.SetData454(static_cast<int64_t>(raw_data[909]) << 32 | raw_data[908]); + ch.SetData455(static_cast<int64_t>(raw_data[911]) << 32 | raw_data[910]); + ch.SetData456(static_cast<int64_t>(raw_data[913]) << 32 | raw_data[912]); + ch.SetData457(static_cast<int64_t>(raw_data[915]) << 32 | raw_data[914]); + ch.SetData458(static_cast<int64_t>(raw_data[917]) << 32 | raw_data[916]); + ch.SetData459(static_cast<int64_t>(raw_data[919]) << 32 | raw_data[918]); + ch.SetData460(static_cast<int64_t>(raw_data[921]) << 32 | raw_data[920]); + ch.SetData461(static_cast<int64_t>(raw_data[923]) << 32 | raw_data[922]); + ch.SetData462(static_cast<int64_t>(raw_data[925]) << 32 | raw_data[924]); + ch.SetData463(static_cast<int64_t>(raw_data[927]) << 32 | raw_data[926]); + ch.SetData464(static_cast<int64_t>(raw_data[929]) << 32 | raw_data[928]); + ch.SetData465(static_cast<int64_t>(raw_data[931]) << 32 | raw_data[930]); + ch.SetData466(static_cast<int64_t>(raw_data[933]) << 32 | raw_data[932]); + ch.SetData467(static_cast<int64_t>(raw_data[935]) << 32 | raw_data[934]); + ch.SetData468(static_cast<int64_t>(raw_data[937]) << 32 | raw_data[936]); + ch.SetData469(static_cast<int64_t>(raw_data[939]) << 32 | raw_data[938]); + ch.SetData470(static_cast<int64_t>(raw_data[941]) << 32 | raw_data[940]); + ch.SetData471(static_cast<int64_t>(raw_data[943]) << 32 | raw_data[942]); + ch.SetData472(static_cast<int64_t>(raw_data[945]) << 32 | raw_data[944]); + ch.SetData473(static_cast<int64_t>(raw_data[947]) << 32 | raw_data[946]); + ch.SetData474(static_cast<int64_t>(raw_data[949]) << 32 | raw_data[948]); + ch.SetData475(static_cast<int64_t>(raw_data[951]) << 32 | raw_data[950]); + ch.SetData476(static_cast<int64_t>(raw_data[953]) << 32 | raw_data[952]); + ch.SetData477(static_cast<int64_t>(raw_data[955]) << 32 | raw_data[954]); + ch.SetData478(static_cast<int64_t>(raw_data[957]) << 32 | raw_data[956]); + ch.SetData479(static_cast<int64_t>(raw_data[959]) << 32 | raw_data[958]); + ch.SetData480(static_cast<int64_t>(raw_data[961]) << 32 | raw_data[960]); + ch.SetData481(static_cast<int64_t>(raw_data[963]) << 32 | raw_data[962]); + ch.SetData482(static_cast<int64_t>(raw_data[965]) << 32 | raw_data[964]); + ch.SetData483(static_cast<int64_t>(raw_data[967]) << 32 | raw_data[966]); + ch.SetData484(static_cast<int64_t>(raw_data[969]) << 32 | raw_data[968]); + ch.SetData485(static_cast<int64_t>(raw_data[971]) << 32 | raw_data[970]); + ch.SetData486(static_cast<int64_t>(raw_data[973]) << 32 | raw_data[972]); + ch.SetData487(static_cast<int64_t>(raw_data[975]) << 32 | raw_data[974]); + ch.SetData488(static_cast<int64_t>(raw_data[977]) << 32 | raw_data[976]); + ch.SetData489(static_cast<int64_t>(raw_data[979]) << 32 | raw_data[978]); + ch.SetData490(static_cast<int64_t>(raw_data[981]) << 32 | raw_data[980]); + ch.SetData491(static_cast<int64_t>(raw_data[983]) << 32 | raw_data[982]); + ch.SetData492(static_cast<int64_t>(raw_data[985]) << 32 | raw_data[984]); + ch.SetData493(static_cast<int64_t>(raw_data[987]) << 32 | raw_data[986]); + ch.SetData494(static_cast<int64_t>(raw_data[989]) << 32 | raw_data[988]); + ch.SetData495(static_cast<int64_t>(raw_data[991]) << 32 | raw_data[990]); + ch.SetData496(static_cast<int64_t>(raw_data[993]) << 32 | raw_data[992]); + ch.SetData497(static_cast<int64_t>(raw_data[995]) << 32 | raw_data[994]); + ch.SetData498(static_cast<int64_t>(raw_data[997]) << 32 | raw_data[996]); + ch.SetData499(static_cast<int64_t>(raw_data[999]) << 32 | raw_data[998]); + ch.SetData500(static_cast<int64_t>(raw_data[1001]) << 32 | raw_data[1000]); + ch.SetData501(static_cast<int64_t>(raw_data[1003]) << 32 | raw_data[1002]); + ch.SetData502(static_cast<int64_t>(raw_data[1005]) << 32 | raw_data[1004]); + ch.SetData503(static_cast<int64_t>(raw_data[1007]) << 32 | raw_data[1006]); + ch.SetData504(static_cast<int64_t>(raw_data[1009]) << 32 | raw_data[1008]); + ch.SetData505(static_cast<int64_t>(raw_data[1011]) << 32 | raw_data[1010]); + ch.SetData506(static_cast<int64_t>(raw_data[1013]) << 32 | raw_data[1012]); + ch.SetData507(static_cast<int64_t>(raw_data[1015]) << 32 | raw_data[1014]); + ch.SetData508(static_cast<int64_t>(raw_data[1017]) << 32 | raw_data[1016]); + ch.SetData509(static_cast<int64_t>(raw_data[1019]) << 32 | raw_data[1018]); + ch.SetData510(static_cast<int64_t>(raw_data[1021]) << 32 | raw_data[1020]); + ch.SetData511(static_cast<int64_t>(raw_data[1023]) << 32 | raw_data[1022]); + ch.SetData512(static_cast<int64_t>(raw_data[1025]) << 32 | raw_data[1024]); + ch.SetData513(static_cast<int64_t>(raw_data[1027]) << 32 | raw_data[1026]); + ch.SetData514(static_cast<int64_t>(raw_data[1029]) << 32 | raw_data[1028]); + ch.SetData515(static_cast<int64_t>(raw_data[1031]) << 32 | raw_data[1030]); + ch.SetData516(static_cast<int64_t>(raw_data[1033]) << 32 | raw_data[1032]); + ch.SetData517(static_cast<int64_t>(raw_data[1035]) << 32 | raw_data[1034]); + ch.SetData518(static_cast<int64_t>(raw_data[1037]) << 32 | raw_data[1036]); + ch.SetData519(static_cast<int64_t>(raw_data[1039]) << 32 | raw_data[1038]); + ch.SetData520(static_cast<int64_t>(raw_data[1041]) << 32 | raw_data[1040]); + ch.SetData521(static_cast<int64_t>(raw_data[1043]) << 32 | raw_data[1042]); + ch.SetData522(static_cast<int64_t>(raw_data[1045]) << 32 | raw_data[1044]); + ch.SetData523(static_cast<int64_t>(raw_data[1047]) << 32 | raw_data[1046]); + ch.SetData524(static_cast<int64_t>(raw_data[1049]) << 32 | raw_data[1048]); + ch.SetData525(static_cast<int64_t>(raw_data[1051]) << 32 | raw_data[1050]); + ch.SetData526(static_cast<int64_t>(raw_data[1053]) << 32 | raw_data[1052]); + ch.SetData527(static_cast<int64_t>(raw_data[1055]) << 32 | raw_data[1054]); + ch.SetData528(static_cast<int64_t>(raw_data[1057]) << 32 | raw_data[1056]); + ch.SetData529(static_cast<int64_t>(raw_data[1059]) << 32 | raw_data[1058]); + ch.SetData530(static_cast<int64_t>(raw_data[1061]) << 32 | raw_data[1060]); + ch.SetData531(static_cast<int64_t>(raw_data[1063]) << 32 | raw_data[1062]); + ch.SetData532(static_cast<int64_t>(raw_data[1065]) << 32 | raw_data[1064]); + ch.SetData533(static_cast<int64_t>(raw_data[1067]) << 32 | raw_data[1066]); + ch.SetData534(static_cast<int64_t>(raw_data[1069]) << 32 | raw_data[1068]); + ch.SetData535(static_cast<int64_t>(raw_data[1071]) << 32 | raw_data[1070]); + ch.SetData536(static_cast<int64_t>(raw_data[1073]) << 32 | raw_data[1072]); + ch.SetData537(static_cast<int64_t>(raw_data[1075]) << 32 | raw_data[1074]); + ch.SetData538(static_cast<int64_t>(raw_data[1077]) << 32 | raw_data[1076]); + ch.SetData539(static_cast<int64_t>(raw_data[1079]) << 32 | raw_data[1078]); + ch.SetData540(static_cast<int64_t>(raw_data[1081]) << 32 | raw_data[1080]); + ch.SetData541(static_cast<int64_t>(raw_data[1083]) << 32 | raw_data[1082]); + ch.SetData542(static_cast<int64_t>(raw_data[1085]) << 32 | raw_data[1084]); + ch.SetData543(static_cast<int64_t>(raw_data[1087]) << 32 | raw_data[1086]); + ch.SetData544(static_cast<int64_t>(raw_data[1089]) << 32 | raw_data[1088]); + ch.SetData545(static_cast<int64_t>(raw_data[1091]) << 32 | raw_data[1090]); + ch.SetData546(static_cast<int64_t>(raw_data[1093]) << 32 | raw_data[1092]); + ch.SetData547(static_cast<int64_t>(raw_data[1095]) << 32 | raw_data[1094]); + ch.SetData548(static_cast<int64_t>(raw_data[1097]) << 32 | raw_data[1096]); + ch.SetData549(static_cast<int64_t>(raw_data[1099]) << 32 | raw_data[1098]); + ch.SetData550(static_cast<int64_t>(raw_data[1101]) << 32 | raw_data[1100]); + ch.SetData551(static_cast<int64_t>(raw_data[1103]) << 32 | raw_data[1102]); + ch.SetData552(static_cast<int64_t>(raw_data[1105]) << 32 | raw_data[1104]); + ch.SetData553(static_cast<int64_t>(raw_data[1107]) << 32 | raw_data[1106]); + ch.SetData554(static_cast<int64_t>(raw_data[1109]) << 32 | raw_data[1108]); + ch.SetData555(static_cast<int64_t>(raw_data[1111]) << 32 | raw_data[1110]); + ch.SetData556(static_cast<int64_t>(raw_data[1113]) << 32 | raw_data[1112]); + ch.SetData557(static_cast<int64_t>(raw_data[1115]) << 32 | raw_data[1114]); + ch.SetData558(static_cast<int64_t>(raw_data[1117]) << 32 | raw_data[1116]); + ch.SetData559(static_cast<int64_t>(raw_data[1119]) << 32 | raw_data[1118]); + ch.SetData560(static_cast<int64_t>(raw_data[1121]) << 32 | raw_data[1120]); + ch.SetData561(static_cast<int64_t>(raw_data[1123]) << 32 | raw_data[1122]); + ch.SetData562(static_cast<int64_t>(raw_data[1125]) << 32 | raw_data[1124]); + ch.SetData563(static_cast<int64_t>(raw_data[1127]) << 32 | raw_data[1126]); + ch.SetData564(static_cast<int64_t>(raw_data[1129]) << 32 | raw_data[1128]); + ch.SetData565(static_cast<int64_t>(raw_data[1131]) << 32 | raw_data[1130]); + ch.SetData566(static_cast<int64_t>(raw_data[1133]) << 32 | raw_data[1132]); + ch.SetData567(static_cast<int64_t>(raw_data[1135]) << 32 | raw_data[1134]); + ch.SetData568(static_cast<int64_t>(raw_data[1137]) << 32 | raw_data[1136]); + ch.SetData569(static_cast<int64_t>(raw_data[1139]) << 32 | raw_data[1138]); + ch.SetData570(static_cast<int64_t>(raw_data[1141]) << 32 | raw_data[1140]); + ch.SetData571(static_cast<int64_t>(raw_data[1143]) << 32 | raw_data[1142]); + ch.SetData572(static_cast<int64_t>(raw_data[1145]) << 32 | raw_data[1144]); + ch.SetData573(static_cast<int64_t>(raw_data[1147]) << 32 | raw_data[1146]); + ch.SetData574(static_cast<int64_t>(raw_data[1149]) << 32 | raw_data[1148]); + ch.SetData575(static_cast<int64_t>(raw_data[1151]) << 32 | raw_data[1150]); + ch.SetData576(static_cast<int64_t>(raw_data[1153]) << 32 | raw_data[1152]); + ch.SetData577(static_cast<int64_t>(raw_data[1155]) << 32 | raw_data[1154]); + ch.SetData578(static_cast<int64_t>(raw_data[1157]) << 32 | raw_data[1156]); + ch.SetData579(static_cast<int64_t>(raw_data[1159]) << 32 | raw_data[1158]); + ch.SetData580(static_cast<int64_t>(raw_data[1161]) << 32 | raw_data[1160]); + ch.SetData581(static_cast<int64_t>(raw_data[1163]) << 32 | raw_data[1162]); + ch.SetData582(static_cast<int64_t>(raw_data[1165]) << 32 | raw_data[1164]); + ch.SetData583(static_cast<int64_t>(raw_data[1167]) << 32 | raw_data[1166]); + ch.SetData584(static_cast<int64_t>(raw_data[1169]) << 32 | raw_data[1168]); + ch.SetData585(static_cast<int64_t>(raw_data[1171]) << 32 | raw_data[1170]); + ch.SetData586(static_cast<int64_t>(raw_data[1173]) << 32 | raw_data[1172]); + ch.SetData587(static_cast<int64_t>(raw_data[1175]) << 32 | raw_data[1174]); + ch.SetData588(static_cast<int64_t>(raw_data[1177]) << 32 | raw_data[1176]); + ch.SetData589(static_cast<int64_t>(raw_data[1179]) << 32 | raw_data[1178]); + ch.SetData590(static_cast<int64_t>(raw_data[1181]) << 32 | raw_data[1180]); + ch.SetData591(static_cast<int64_t>(raw_data[1183]) << 32 | raw_data[1182]); + ch.SetData592(static_cast<int64_t>(raw_data[1185]) << 32 | raw_data[1184]); + ch.SetData593(static_cast<int64_t>(raw_data[1187]) << 32 | raw_data[1186]); + ch.SetData594(static_cast<int64_t>(raw_data[1189]) << 32 | raw_data[1188]); + ch.SetData595(static_cast<int64_t>(raw_data[1191]) << 32 | raw_data[1190]); + ch.SetData596(static_cast<int64_t>(raw_data[1193]) << 32 | raw_data[1192]); + ch.SetData597(static_cast<int64_t>(raw_data[1195]) << 32 | raw_data[1194]); + ch.SetData598(static_cast<int64_t>(raw_data[1197]) << 32 | raw_data[1196]); + ch.SetData599(static_cast<int64_t>(raw_data[1199]) << 32 | raw_data[1198]); + ch.SetData600(static_cast<int64_t>(raw_data[1201]) << 32 | raw_data[1200]); + ch.SetData601(static_cast<int64_t>(raw_data[1203]) << 32 | raw_data[1202]); + ch.SetData602(static_cast<int64_t>(raw_data[1205]) << 32 | raw_data[1204]); + ch.SetData603(static_cast<int64_t>(raw_data[1207]) << 32 | raw_data[1206]); + ch.SetData604(static_cast<int64_t>(raw_data[1209]) << 32 | raw_data[1208]); + ch.SetData605(static_cast<int64_t>(raw_data[1211]) << 32 | raw_data[1210]); + ch.SetData606(static_cast<int64_t>(raw_data[1213]) << 32 | raw_data[1212]); + ch.SetData607(static_cast<int64_t>(raw_data[1215]) << 32 | raw_data[1214]); + ch.SetData608(static_cast<int64_t>(raw_data[1217]) << 32 | raw_data[1216]); + ch.SetData609(static_cast<int64_t>(raw_data[1219]) << 32 | raw_data[1218]); + ch.SetData610(static_cast<int64_t>(raw_data[1221]) << 32 | raw_data[1220]); + ch.SetData611(static_cast<int64_t>(raw_data[1223]) << 32 | raw_data[1222]); + ch.SetData612(static_cast<int64_t>(raw_data[1225]) << 32 | raw_data[1224]); + ch.SetData613(static_cast<int64_t>(raw_data[1227]) << 32 | raw_data[1226]); + ch.SetData614(static_cast<int64_t>(raw_data[1229]) << 32 | raw_data[1228]); + ch.SetData615(static_cast<int64_t>(raw_data[1231]) << 32 | raw_data[1230]); + ch.SetData616(static_cast<int64_t>(raw_data[1233]) << 32 | raw_data[1232]); + ch.SetData617(static_cast<int64_t>(raw_data[1235]) << 32 | raw_data[1234]); + ch.SetData618(static_cast<int64_t>(raw_data[1237]) << 32 | raw_data[1236]); + ch.SetData619(static_cast<int64_t>(raw_data[1239]) << 32 | raw_data[1238]); + ch.SetData620(static_cast<int64_t>(raw_data[1241]) << 32 | raw_data[1240]); + ch.SetData621(static_cast<int64_t>(raw_data[1243]) << 32 | raw_data[1242]); + ch.SetData622(static_cast<int64_t>(raw_data[1245]) << 32 | raw_data[1244]); + ch.SetData623(static_cast<int64_t>(raw_data[1247]) << 32 | raw_data[1246]); + ch.SetData624(static_cast<int64_t>(raw_data[1249]) << 32 | raw_data[1248]); + ch.SetData625(static_cast<int64_t>(raw_data[1251]) << 32 | raw_data[1250]); + ch.SetData626(static_cast<int64_t>(raw_data[1253]) << 32 | raw_data[1252]); + ch.SetData627(static_cast<int64_t>(raw_data[1255]) << 32 | raw_data[1254]); + ch.SetData628(static_cast<int64_t>(raw_data[1257]) << 32 | raw_data[1256]); + ch.SetData629(static_cast<int64_t>(raw_data[1259]) << 32 | raw_data[1258]); + ch.SetData630(static_cast<int64_t>(raw_data[1261]) << 32 | raw_data[1260]); + ch.SetData631(static_cast<int64_t>(raw_data[1263]) << 32 | raw_data[1262]); + ch.SetData632(static_cast<int64_t>(raw_data[1265]) << 32 | raw_data[1264]); + ch.SetData633(static_cast<int64_t>(raw_data[1267]) << 32 | raw_data[1266]); + ch.SetData634(static_cast<int64_t>(raw_data[1269]) << 32 | raw_data[1268]); + ch.SetData635(static_cast<int64_t>(raw_data[1271]) << 32 | raw_data[1270]); + ch.SetData636(static_cast<int64_t>(raw_data[1273]) << 32 | raw_data[1272]); + ch.SetData637(static_cast<int64_t>(raw_data[1275]) << 32 | raw_data[1274]); + ch.SetData638(static_cast<int64_t>(raw_data[1277]) << 32 | raw_data[1276]); + ch.SetData639(static_cast<int64_t>(raw_data[1279]) << 32 | raw_data[1278]); + ch.SetData640(static_cast<int64_t>(raw_data[1281]) << 32 | raw_data[1280]); + ch.SetData641(static_cast<int64_t>(raw_data[1283]) << 32 | raw_data[1282]); + ch.SetData642(static_cast<int64_t>(raw_data[1285]) << 32 | raw_data[1284]); + ch.SetData643(static_cast<int64_t>(raw_data[1287]) << 32 | raw_data[1286]); + ch.SetData644(static_cast<int64_t>(raw_data[1289]) << 32 | raw_data[1288]); + ch.SetData645(static_cast<int64_t>(raw_data[1291]) << 32 | raw_data[1290]); + ch.SetData646(static_cast<int64_t>(raw_data[1293]) << 32 | raw_data[1292]); + ch.SetData647(static_cast<int64_t>(raw_data[1295]) << 32 | raw_data[1294]); + ch.SetData648(static_cast<int64_t>(raw_data[1297]) << 32 | raw_data[1296]); + ch.SetData649(static_cast<int64_t>(raw_data[1299]) << 32 | raw_data[1298]); + ch.SetData650(static_cast<int64_t>(raw_data[1301]) << 32 | raw_data[1300]); + ch.SetData651(static_cast<int64_t>(raw_data[1303]) << 32 | raw_data[1302]); + ch.SetData652(static_cast<int64_t>(raw_data[1305]) << 32 | raw_data[1304]); + ch.SetData653(static_cast<int64_t>(raw_data[1307]) << 32 | raw_data[1306]); + ch.SetData654(static_cast<int64_t>(raw_data[1309]) << 32 | raw_data[1308]); + ch.SetData655(static_cast<int64_t>(raw_data[1311]) << 32 | raw_data[1310]); + ch.SetData656(static_cast<int64_t>(raw_data[1313]) << 32 | raw_data[1312]); + ch.SetData657(static_cast<int64_t>(raw_data[1315]) << 32 | raw_data[1314]); + ch.SetData658(static_cast<int64_t>(raw_data[1317]) << 32 | raw_data[1316]); + ch.SetData659(static_cast<int64_t>(raw_data[1319]) << 32 | raw_data[1318]); + ch.SetData660(static_cast<int64_t>(raw_data[1321]) << 32 | raw_data[1320]); + ch.SetData661(static_cast<int64_t>(raw_data[1323]) << 32 | raw_data[1322]); + ch.SetData662(static_cast<int64_t>(raw_data[1325]) << 32 | raw_data[1324]); + ch.SetData663(static_cast<int64_t>(raw_data[1327]) << 32 | raw_data[1326]); + ch.SetData664(static_cast<int64_t>(raw_data[1329]) << 32 | raw_data[1328]); + ch.SetData665(static_cast<int64_t>(raw_data[1331]) << 32 | raw_data[1330]); + ch.SetData666(static_cast<int64_t>(raw_data[1333]) << 32 | raw_data[1332]); + ch.SetData667(static_cast<int64_t>(raw_data[1335]) << 32 | raw_data[1334]); + ch.SetData668(static_cast<int64_t>(raw_data[1337]) << 32 | raw_data[1336]); + ch.SetData669(static_cast<int64_t>(raw_data[1339]) << 32 | raw_data[1338]); + ch.SetData670(static_cast<int64_t>(raw_data[1341]) << 32 | raw_data[1340]); + ch.SetData671(static_cast<int64_t>(raw_data[1343]) << 32 | raw_data[1342]); + ch.SetData672(static_cast<int64_t>(raw_data[1345]) << 32 | raw_data[1344]); + ch.SetData673(static_cast<int64_t>(raw_data[1347]) << 32 | raw_data[1346]); + ch.SetData674(static_cast<int64_t>(raw_data[1349]) << 32 | raw_data[1348]); + ch.SetData675(static_cast<int64_t>(raw_data[1351]) << 32 | raw_data[1350]); + ch.SetData676(static_cast<int64_t>(raw_data[1353]) << 32 | raw_data[1352]); + ch.SetData677(static_cast<int64_t>(raw_data[1355]) << 32 | raw_data[1354]); + ch.SetData678(static_cast<int64_t>(raw_data[1357]) << 32 | raw_data[1356]); + ch.SetData679(static_cast<int64_t>(raw_data[1359]) << 32 | raw_data[1358]); + ch.SetData680(static_cast<int64_t>(raw_data[1361]) << 32 | raw_data[1360]); + ch.SetData681(static_cast<int64_t>(raw_data[1363]) << 32 | raw_data[1362]); + ch.SetData682(static_cast<int64_t>(raw_data[1365]) << 32 | raw_data[1364]); + ch.SetData683(static_cast<int64_t>(raw_data[1367]) << 32 | raw_data[1366]); + ch.SetData684(static_cast<int64_t>(raw_data[1369]) << 32 | raw_data[1368]); + ch.SetData685(static_cast<int64_t>(raw_data[1371]) << 32 | raw_data[1370]); + ch.SetData686(static_cast<int64_t>(raw_data[1373]) << 32 | raw_data[1372]); + ch.SetData687(static_cast<int64_t>(raw_data[1375]) << 32 | raw_data[1374]); + ch.SetData688(static_cast<int64_t>(raw_data[1377]) << 32 | raw_data[1376]); + ch.SetData689(static_cast<int64_t>(raw_data[1379]) << 32 | raw_data[1378]); + ch.SetData690(static_cast<int64_t>(raw_data[1381]) << 32 | raw_data[1380]); + ch.SetData691(static_cast<int64_t>(raw_data[1383]) << 32 | raw_data[1382]); + ch.SetData692(static_cast<int64_t>(raw_data[1385]) << 32 | raw_data[1384]); + ch.SetData693(static_cast<int64_t>(raw_data[1387]) << 32 | raw_data[1386]); + ch.SetData694(static_cast<int64_t>(raw_data[1389]) << 32 | raw_data[1388]); + ch.SetData695(static_cast<int64_t>(raw_data[1391]) << 32 | raw_data[1390]); + ch.SetData696(static_cast<int64_t>(raw_data[1393]) << 32 | raw_data[1392]); + ch.SetData697(static_cast<int64_t>(raw_data[1395]) << 32 | raw_data[1394]); + ch.SetData698(static_cast<int64_t>(raw_data[1397]) << 32 | raw_data[1396]); + ch.SetData699(static_cast<int64_t>(raw_data[1399]) << 32 | raw_data[1398]); + ch.SetData700(static_cast<int64_t>(raw_data[1401]) << 32 | raw_data[1400]); + ch.SetData701(static_cast<int64_t>(raw_data[1403]) << 32 | raw_data[1402]); + ch.SetData702(static_cast<int64_t>(raw_data[1405]) << 32 | raw_data[1404]); + ch.SetData703(static_cast<int64_t>(raw_data[1407]) << 32 | raw_data[1406]); + ch.SetData704(static_cast<int64_t>(raw_data[1409]) << 32 | raw_data[1408]); + ch.SetData705(static_cast<int64_t>(raw_data[1411]) << 32 | raw_data[1410]); + ch.SetData706(static_cast<int64_t>(raw_data[1413]) << 32 | raw_data[1412]); + ch.SetData707(static_cast<int64_t>(raw_data[1415]) << 32 | raw_data[1414]); + ch.SetData708(static_cast<int64_t>(raw_data[1417]) << 32 | raw_data[1416]); + ch.SetData709(static_cast<int64_t>(raw_data[1419]) << 32 | raw_data[1418]); + ch.SetData710(static_cast<int64_t>(raw_data[1421]) << 32 | raw_data[1420]); + ch.SetData711(static_cast<int64_t>(raw_data[1423]) << 32 | raw_data[1422]); + ch.SetData712(static_cast<int64_t>(raw_data[1425]) << 32 | raw_data[1424]); + ch.SetData713(static_cast<int64_t>(raw_data[1427]) << 32 | raw_data[1426]); + ch.SetData714(static_cast<int64_t>(raw_data[1429]) << 32 | raw_data[1428]); + ch.SetData715(static_cast<int64_t>(raw_data[1431]) << 32 | raw_data[1430]); + ch.SetData716(static_cast<int64_t>(raw_data[1433]) << 32 | raw_data[1432]); + ch.SetData717(static_cast<int64_t>(raw_data[1435]) << 32 | raw_data[1434]); + ch.SetData718(static_cast<int64_t>(raw_data[1437]) << 32 | raw_data[1436]); + ch.SetData719(static_cast<int64_t>(raw_data[1439]) << 32 | raw_data[1438]); + ch.SetData720(static_cast<int64_t>(raw_data[1441]) << 32 | raw_data[1440]); + ch.SetData721(static_cast<int64_t>(raw_data[1443]) << 32 | raw_data[1442]); + ch.SetData722(static_cast<int64_t>(raw_data[1445]) << 32 | raw_data[1444]); + ch.SetData723(static_cast<int64_t>(raw_data[1447]) << 32 | raw_data[1446]); + ch.SetData724(static_cast<int64_t>(raw_data[1449]) << 32 | raw_data[1448]); + ch.SetData725(static_cast<int64_t>(raw_data[1451]) << 32 | raw_data[1450]); + ch.SetData726(static_cast<int64_t>(raw_data[1453]) << 32 | raw_data[1452]); + ch.SetData727(static_cast<int64_t>(raw_data[1455]) << 32 | raw_data[1454]); + ch.SetData728(static_cast<int64_t>(raw_data[1457]) << 32 | raw_data[1456]); + ch.SetData729(static_cast<int64_t>(raw_data[1459]) << 32 | raw_data[1458]); + ch.SetData730(static_cast<int64_t>(raw_data[1461]) << 32 | raw_data[1460]); + ch.SetData731(static_cast<int64_t>(raw_data[1463]) << 32 | raw_data[1462]); + ch.SetData732(static_cast<int64_t>(raw_data[1465]) << 32 | raw_data[1464]); + ch.SetData733(static_cast<int64_t>(raw_data[1467]) << 32 | raw_data[1466]); + ch.SetData734(static_cast<int64_t>(raw_data[1469]) << 32 | raw_data[1468]); + ch.SetData735(static_cast<int64_t>(raw_data[1471]) << 32 | raw_data[1470]); + ch.SetData736(static_cast<int64_t>(raw_data[1473]) << 32 | raw_data[1472]); + ch.SetData737(static_cast<int64_t>(raw_data[1475]) << 32 | raw_data[1474]); + ch.SetData738(static_cast<int64_t>(raw_data[1477]) << 32 | raw_data[1476]); + ch.SetData739(static_cast<int64_t>(raw_data[1479]) << 32 | raw_data[1478]); + ch.SetData740(static_cast<int64_t>(raw_data[1481]) << 32 | raw_data[1480]); + ch.SetData741(static_cast<int64_t>(raw_data[1483]) << 32 | raw_data[1482]); + ch.SetData742(static_cast<int64_t>(raw_data[1485]) << 32 | raw_data[1484]); + ch.SetData743(static_cast<int64_t>(raw_data[1487]) << 32 | raw_data[1486]); + ch.SetData744(static_cast<int64_t>(raw_data[1489]) << 32 | raw_data[1488]); + ch.SetData745(static_cast<int64_t>(raw_data[1491]) << 32 | raw_data[1490]); + ch.SetData746(static_cast<int64_t>(raw_data[1493]) << 32 | raw_data[1492]); + ch.SetData747(static_cast<int64_t>(raw_data[1495]) << 32 | raw_data[1494]); + ch.SetData748(static_cast<int64_t>(raw_data[1497]) << 32 | raw_data[1496]); + ch.SetData749(static_cast<int64_t>(raw_data[1499]) << 32 | raw_data[1498]); + ch.SetData750(static_cast<int64_t>(raw_data[1501]) << 32 | raw_data[1500]); + ch.SetData751(static_cast<int64_t>(raw_data[1503]) << 32 | raw_data[1502]); + ch.SetData752(static_cast<int64_t>(raw_data[1505]) << 32 | raw_data[1504]); + ch.SetData753(static_cast<int64_t>(raw_data[1507]) << 32 | raw_data[1506]); + ch.SetData754(static_cast<int64_t>(raw_data[1509]) << 32 | raw_data[1508]); + ch.SetData755(static_cast<int64_t>(raw_data[1511]) << 32 | raw_data[1510]); + ch.SetData756(static_cast<int64_t>(raw_data[1513]) << 32 | raw_data[1512]); + ch.SetData757(static_cast<int64_t>(raw_data[1515]) << 32 | raw_data[1514]); + ch.SetData758(static_cast<int64_t>(raw_data[1517]) << 32 | raw_data[1516]); + ch.SetData759(static_cast<int64_t>(raw_data[1519]) << 32 | raw_data[1518]); + ch.SetData760(static_cast<int64_t>(raw_data[1521]) << 32 | raw_data[1520]); + ch.SetData761(static_cast<int64_t>(raw_data[1523]) << 32 | raw_data[1522]); + ch.SetData762(static_cast<int64_t>(raw_data[1525]) << 32 | raw_data[1524]); + ch.SetData763(static_cast<int64_t>(raw_data[1527]) << 32 | raw_data[1526]); + ch.SetData764(static_cast<int64_t>(raw_data[1529]) << 32 | raw_data[1528]); + ch.SetData765(static_cast<int64_t>(raw_data[1531]) << 32 | raw_data[1530]); + ch.SetData766(static_cast<int64_t>(raw_data[1533]) << 32 | raw_data[1532]); + ch.SetData767(static_cast<int64_t>(raw_data[1535]) << 32 | raw_data[1534]); + ch.SetData768(static_cast<int64_t>(raw_data[1537]) << 32 | raw_data[1536]); + ch.SetData769(static_cast<int64_t>(raw_data[1539]) << 32 | raw_data[1538]); + ch.SetData770(static_cast<int64_t>(raw_data[1541]) << 32 | raw_data[1540]); + ch.SetData771(static_cast<int64_t>(raw_data[1543]) << 32 | raw_data[1542]); + ch.SetData772(static_cast<int64_t>(raw_data[1545]) << 32 | raw_data[1544]); + ch.SetData773(static_cast<int64_t>(raw_data[1547]) << 32 | raw_data[1546]); + ch.SetData774(static_cast<int64_t>(raw_data[1549]) << 32 | raw_data[1548]); + ch.SetData775(static_cast<int64_t>(raw_data[1551]) << 32 | raw_data[1550]); + ch.SetData776(static_cast<int64_t>(raw_data[1553]) << 32 | raw_data[1552]); + ch.SetData777(static_cast<int64_t>(raw_data[1555]) << 32 | raw_data[1554]); + ch.SetData778(static_cast<int64_t>(raw_data[1557]) << 32 | raw_data[1556]); + ch.SetData779(static_cast<int64_t>(raw_data[1559]) << 32 | raw_data[1558]); + ch.SetData780(static_cast<int64_t>(raw_data[1561]) << 32 | raw_data[1560]); + ch.SetData781(static_cast<int64_t>(raw_data[1563]) << 32 | raw_data[1562]); + ch.SetData782(static_cast<int64_t>(raw_data[1565]) << 32 | raw_data[1564]); + ch.SetData783(static_cast<int64_t>(raw_data[1567]) << 32 | raw_data[1566]); + ch.SetData784(static_cast<int64_t>(raw_data[1569]) << 32 | raw_data[1568]); + ch.SetData785(static_cast<int64_t>(raw_data[1571]) << 32 | raw_data[1570]); + ch.SetData786(static_cast<int64_t>(raw_data[1573]) << 32 | raw_data[1572]); + ch.SetData787(static_cast<int64_t>(raw_data[1575]) << 32 | raw_data[1574]); + ch.SetData788(static_cast<int64_t>(raw_data[1577]) << 32 | raw_data[1576]); + ch.SetData789(static_cast<int64_t>(raw_data[1579]) << 32 | raw_data[1578]); + ch.SetData790(static_cast<int64_t>(raw_data[1581]) << 32 | raw_data[1580]); + ch.SetData791(static_cast<int64_t>(raw_data[1583]) << 32 | raw_data[1582]); + ch.SetData792(static_cast<int64_t>(raw_data[1585]) << 32 | raw_data[1584]); + ch.SetData793(static_cast<int64_t>(raw_data[1587]) << 32 | raw_data[1586]); + ch.SetData794(static_cast<int64_t>(raw_data[1589]) << 32 | raw_data[1588]); + ch.SetData795(static_cast<int64_t>(raw_data[1591]) << 32 | raw_data[1590]); + ch.SetData796(static_cast<int64_t>(raw_data[1593]) << 32 | raw_data[1592]); + ch.SetData797(static_cast<int64_t>(raw_data[1595]) << 32 | raw_data[1594]); + ch.SetData798(static_cast<int64_t>(raw_data[1597]) << 32 | raw_data[1596]); + ch.SetData799(static_cast<int64_t>(raw_data[1599]) << 32 | raw_data[1598]); + ch.SetData800(static_cast<int64_t>(raw_data[1601]) << 32 | raw_data[1600]); + ch.SetData801(static_cast<int64_t>(raw_data[1603]) << 32 | raw_data[1602]); + ch.SetData802(static_cast<int64_t>(raw_data[1605]) << 32 | raw_data[1604]); + ch.SetData803(static_cast<int64_t>(raw_data[1607]) << 32 | raw_data[1606]); + ch.SetData804(static_cast<int64_t>(raw_data[1609]) << 32 | raw_data[1608]); + ch.SetData805(static_cast<int64_t>(raw_data[1611]) << 32 | raw_data[1610]); + ch.SetData806(static_cast<int64_t>(raw_data[1613]) << 32 | raw_data[1612]); + ch.SetData807(static_cast<int64_t>(raw_data[1615]) << 32 | raw_data[1614]); + ch.SetData808(static_cast<int64_t>(raw_data[1617]) << 32 | raw_data[1616]); + ch.SetData809(static_cast<int64_t>(raw_data[1619]) << 32 | raw_data[1618]); + ch.SetData810(static_cast<int64_t>(raw_data[1621]) << 32 | raw_data[1620]); + ch.SetData811(static_cast<int64_t>(raw_data[1623]) << 32 | raw_data[1622]); + ch.SetData812(static_cast<int64_t>(raw_data[1625]) << 32 | raw_data[1624]); + ch.SetData813(static_cast<int64_t>(raw_data[1627]) << 32 | raw_data[1626]); + ch.SetData814(static_cast<int64_t>(raw_data[1629]) << 32 | raw_data[1628]); + ch.SetData815(static_cast<int64_t>(raw_data[1631]) << 32 | raw_data[1630]); + ch.SetData816(static_cast<int64_t>(raw_data[1633]) << 32 | raw_data[1632]); + ch.SetData817(static_cast<int64_t>(raw_data[1635]) << 32 | raw_data[1634]); + ch.SetData818(static_cast<int64_t>(raw_data[1637]) << 32 | raw_data[1636]); + ch.SetData819(static_cast<int64_t>(raw_data[1639]) << 32 | raw_data[1638]); + ch.SetData820(static_cast<int64_t>(raw_data[1641]) << 32 | raw_data[1640]); + ch.SetData821(static_cast<int64_t>(raw_data[1643]) << 32 | raw_data[1642]); + ch.SetData822(static_cast<int64_t>(raw_data[1645]) << 32 | raw_data[1644]); + ch.SetData823(static_cast<int64_t>(raw_data[1647]) << 32 | raw_data[1646]); + ch.SetData824(static_cast<int64_t>(raw_data[1649]) << 32 | raw_data[1648]); + ch.SetData825(static_cast<int64_t>(raw_data[1651]) << 32 | raw_data[1650]); + ch.SetData826(static_cast<int64_t>(raw_data[1653]) << 32 | raw_data[1652]); + ch.SetData827(static_cast<int64_t>(raw_data[1655]) << 32 | raw_data[1654]); + ch.SetData828(static_cast<int64_t>(raw_data[1657]) << 32 | raw_data[1656]); + ch.SetData829(static_cast<int64_t>(raw_data[1659]) << 32 | raw_data[1658]); + ch.SetData830(static_cast<int64_t>(raw_data[1661]) << 32 | raw_data[1660]); + ch.SetData831(static_cast<int64_t>(raw_data[1663]) << 32 | raw_data[1662]); + ch.SetData832(static_cast<int64_t>(raw_data[1665]) << 32 | raw_data[1664]); + ch.SetData833(static_cast<int64_t>(raw_data[1667]) << 32 | raw_data[1666]); + ch.SetData834(static_cast<int64_t>(raw_data[1669]) << 32 | raw_data[1668]); + ch.SetData835(static_cast<int64_t>(raw_data[1671]) << 32 | raw_data[1670]); + ch.SetData836(static_cast<int64_t>(raw_data[1673]) << 32 | raw_data[1672]); + ch.SetData837(static_cast<int64_t>(raw_data[1675]) << 32 | raw_data[1674]); + ch.SetData838(static_cast<int64_t>(raw_data[1677]) << 32 | raw_data[1676]); + ch.SetData839(static_cast<int64_t>(raw_data[1679]) << 32 | raw_data[1678]); + ch.SetData840(static_cast<int64_t>(raw_data[1681]) << 32 | raw_data[1680]); + ch.SetData841(static_cast<int64_t>(raw_data[1683]) << 32 | raw_data[1682]); + ch.SetData842(static_cast<int64_t>(raw_data[1685]) << 32 | raw_data[1684]); + ch.SetData843(static_cast<int64_t>(raw_data[1687]) << 32 | raw_data[1686]); + ch.SetData844(static_cast<int64_t>(raw_data[1689]) << 32 | raw_data[1688]); + ch.SetData845(static_cast<int64_t>(raw_data[1691]) << 32 | raw_data[1690]); + ch.SetData846(static_cast<int64_t>(raw_data[1693]) << 32 | raw_data[1692]); + ch.SetData847(static_cast<int64_t>(raw_data[1695]) << 32 | raw_data[1694]); + ch.SetData848(static_cast<int64_t>(raw_data[1697]) << 32 | raw_data[1696]); + ch.SetData849(static_cast<int64_t>(raw_data[1699]) << 32 | raw_data[1698]); + ch.SetData850(static_cast<int64_t>(raw_data[1701]) << 32 | raw_data[1700]); + ch.SetData851(static_cast<int64_t>(raw_data[1703]) << 32 | raw_data[1702]); + ch.SetData852(static_cast<int64_t>(raw_data[1705]) << 32 | raw_data[1704]); + ch.SetData853(static_cast<int64_t>(raw_data[1707]) << 32 | raw_data[1706]); + ch.SetData854(static_cast<int64_t>(raw_data[1709]) << 32 | raw_data[1708]); + ch.SetData855(static_cast<int64_t>(raw_data[1711]) << 32 | raw_data[1710]); + ch.SetData856(static_cast<int64_t>(raw_data[1713]) << 32 | raw_data[1712]); + ch.SetData857(static_cast<int64_t>(raw_data[1715]) << 32 | raw_data[1714]); + ch.SetData858(static_cast<int64_t>(raw_data[1717]) << 32 | raw_data[1716]); + ch.SetData859(static_cast<int64_t>(raw_data[1719]) << 32 | raw_data[1718]); + ch.SetData860(static_cast<int64_t>(raw_data[1721]) << 32 | raw_data[1720]); + ch.SetData861(static_cast<int64_t>(raw_data[1723]) << 32 | raw_data[1722]); + ch.SetData862(static_cast<int64_t>(raw_data[1725]) << 32 | raw_data[1724]); + ch.SetData863(static_cast<int64_t>(raw_data[1727]) << 32 | raw_data[1726]); + ch.SetData864(static_cast<int64_t>(raw_data[1729]) << 32 | raw_data[1728]); + ch.SetData865(static_cast<int64_t>(raw_data[1731]) << 32 | raw_data[1730]); + ch.SetData866(static_cast<int64_t>(raw_data[1733]) << 32 | raw_data[1732]); + ch.SetData867(static_cast<int64_t>(raw_data[1735]) << 32 | raw_data[1734]); + ch.SetData868(static_cast<int64_t>(raw_data[1737]) << 32 | raw_data[1736]); + ch.SetData869(static_cast<int64_t>(raw_data[1739]) << 32 | raw_data[1738]); + ch.SetData870(static_cast<int64_t>(raw_data[1741]) << 32 | raw_data[1740]); + ch.SetData871(static_cast<int64_t>(raw_data[1743]) << 32 | raw_data[1742]); + ch.SetData872(static_cast<int64_t>(raw_data[1745]) << 32 | raw_data[1744]); + ch.SetData873(static_cast<int64_t>(raw_data[1747]) << 32 | raw_data[1746]); + ch.SetData874(static_cast<int64_t>(raw_data[1749]) << 32 | raw_data[1748]); + ch.SetData875(static_cast<int64_t>(raw_data[1751]) << 32 | raw_data[1750]); + ch.SetData876(static_cast<int64_t>(raw_data[1753]) << 32 | raw_data[1752]); + ch.SetData877(static_cast<int64_t>(raw_data[1755]) << 32 | raw_data[1754]); + ch.SetData878(static_cast<int64_t>(raw_data[1757]) << 32 | raw_data[1756]); + ch.SetData879(static_cast<int64_t>(raw_data[1759]) << 32 | raw_data[1758]); + ch.SetData880(static_cast<int64_t>(raw_data[1761]) << 32 | raw_data[1760]); + ch.SetData881(static_cast<int64_t>(raw_data[1763]) << 32 | raw_data[1762]); + ch.SetData882(static_cast<int64_t>(raw_data[1765]) << 32 | raw_data[1764]); + ch.SetData883(static_cast<int64_t>(raw_data[1767]) << 32 | raw_data[1766]); + ch.SetData884(static_cast<int64_t>(raw_data[1769]) << 32 | raw_data[1768]); + ch.SetData885(static_cast<int64_t>(raw_data[1771]) << 32 | raw_data[1770]); + ch.SetData886(static_cast<int64_t>(raw_data[1773]) << 32 | raw_data[1772]); + ch.SetData887(static_cast<int64_t>(raw_data[1775]) << 32 | raw_data[1774]); + ch.SetData888(static_cast<int64_t>(raw_data[1777]) << 32 | raw_data[1776]); + ch.SetData889(static_cast<int64_t>(raw_data[1779]) << 32 | raw_data[1778]); + ch.SetData890(static_cast<int64_t>(raw_data[1781]) << 32 | raw_data[1780]); + ch.SetData891(static_cast<int64_t>(raw_data[1783]) << 32 | raw_data[1782]); + ch.SetData892(static_cast<int64_t>(raw_data[1785]) << 32 | raw_data[1784]); + ch.SetData893(static_cast<int64_t>(raw_data[1787]) << 32 | raw_data[1786]); + ch.SetData894(static_cast<int64_t>(raw_data[1789]) << 32 | raw_data[1788]); + ch.SetData895(static_cast<int64_t>(raw_data[1791]) << 32 | raw_data[1790]); + ch.SetData896(static_cast<int64_t>(raw_data[1793]) << 32 | raw_data[1792]); + ch.SetData897(static_cast<int64_t>(raw_data[1795]) << 32 | raw_data[1794]); + ch.SetData898(static_cast<int64_t>(raw_data[1797]) << 32 | raw_data[1796]); + ch.SetData899(static_cast<int64_t>(raw_data[1799]) << 32 | raw_data[1798]); + ch.SetData900(static_cast<int64_t>(raw_data[1801]) << 32 | raw_data[1800]); + ch.SetData901(static_cast<int64_t>(raw_data[1803]) << 32 | raw_data[1802]); + ch.SetData902(static_cast<int64_t>(raw_data[1805]) << 32 | raw_data[1804]); + ch.SetData903(static_cast<int64_t>(raw_data[1807]) << 32 | raw_data[1806]); + ch.SetData904(static_cast<int64_t>(raw_data[1809]) << 32 | raw_data[1808]); + ch.SetData905(static_cast<int64_t>(raw_data[1811]) << 32 | raw_data[1810]); + ch.SetData906(static_cast<int64_t>(raw_data[1813]) << 32 | raw_data[1812]); + ch.SetData907(static_cast<int64_t>(raw_data[1815]) << 32 | raw_data[1814]); + ch.SetData908(static_cast<int64_t>(raw_data[1817]) << 32 | raw_data[1816]); + ch.SetData909(static_cast<int64_t>(raw_data[1819]) << 32 | raw_data[1818]); + ch.SetData910(static_cast<int64_t>(raw_data[1821]) << 32 | raw_data[1820]); + ch.SetData911(static_cast<int64_t>(raw_data[1823]) << 32 | raw_data[1822]); + ch.SetData912(static_cast<int64_t>(raw_data[1825]) << 32 | raw_data[1824]); + ch.SetData913(static_cast<int64_t>(raw_data[1827]) << 32 | raw_data[1826]); + ch.SetData914(static_cast<int64_t>(raw_data[1829]) << 32 | raw_data[1828]); + ch.SetData915(static_cast<int64_t>(raw_data[1831]) << 32 | raw_data[1830]); + ch.SetData916(static_cast<int64_t>(raw_data[1833]) << 32 | raw_data[1832]); + ch.SetData917(static_cast<int64_t>(raw_data[1835]) << 32 | raw_data[1834]); + ch.SetData918(static_cast<int64_t>(raw_data[1837]) << 32 | raw_data[1836]); + ch.SetData919(static_cast<int64_t>(raw_data[1839]) << 32 | raw_data[1838]); + ch.SetData920(static_cast<int64_t>(raw_data[1841]) << 32 | raw_data[1840]); + ch.SetData921(static_cast<int64_t>(raw_data[1843]) << 32 | raw_data[1842]); + ch.SetData922(static_cast<int64_t>(raw_data[1845]) << 32 | raw_data[1844]); + ch.SetData923(static_cast<int64_t>(raw_data[1847]) << 32 | raw_data[1846]); + ch.SetData924(static_cast<int64_t>(raw_data[1849]) << 32 | raw_data[1848]); + ch.SetData925(static_cast<int64_t>(raw_data[1851]) << 32 | raw_data[1850]); + ch.SetData926(static_cast<int64_t>(raw_data[1853]) << 32 | raw_data[1852]); + ch.SetData927(static_cast<int64_t>(raw_data[1855]) << 32 | raw_data[1854]); + ch.SetData928(static_cast<int64_t>(raw_data[1857]) << 32 | raw_data[1856]); + ch.SetData929(static_cast<int64_t>(raw_data[1859]) << 32 | raw_data[1858]); + ch.SetData930(static_cast<int64_t>(raw_data[1861]) << 32 | raw_data[1860]); + ch.SetData931(static_cast<int64_t>(raw_data[1863]) << 32 | raw_data[1862]); + ch.SetData932(static_cast<int64_t>(raw_data[1865]) << 32 | raw_data[1864]); + ch.SetData933(static_cast<int64_t>(raw_data[1867]) << 32 | raw_data[1866]); + ch.SetData934(static_cast<int64_t>(raw_data[1869]) << 32 | raw_data[1868]); + ch.SetData935(static_cast<int64_t>(raw_data[1871]) << 32 | raw_data[1870]); + ch.SetData936(static_cast<int64_t>(raw_data[1873]) << 32 | raw_data[1872]); + ch.SetData937(static_cast<int64_t>(raw_data[1875]) << 32 | raw_data[1874]); + ch.SetData938(static_cast<int64_t>(raw_data[1877]) << 32 | raw_data[1876]); + ch.SetData939(static_cast<int64_t>(raw_data[1879]) << 32 | raw_data[1878]); + ch.SetData940(static_cast<int64_t>(raw_data[1881]) << 32 | raw_data[1880]); + ch.SetData941(static_cast<int64_t>(raw_data[1883]) << 32 | raw_data[1882]); + ch.SetData942(static_cast<int64_t>(raw_data[1885]) << 32 | raw_data[1884]); + ch.SetData943(static_cast<int64_t>(raw_data[1887]) << 32 | raw_data[1886]); + ch.SetData944(static_cast<int64_t>(raw_data[1889]) << 32 | raw_data[1888]); + ch.SetData945(static_cast<int64_t>(raw_data[1891]) << 32 | raw_data[1890]); + ch.SetData946(static_cast<int64_t>(raw_data[1893]) << 32 | raw_data[1892]); + ch.SetData947(static_cast<int64_t>(raw_data[1895]) << 32 | raw_data[1894]); + ch.SetData948(static_cast<int64_t>(raw_data[1897]) << 32 | raw_data[1896]); + ch.SetData949(static_cast<int64_t>(raw_data[1899]) << 32 | raw_data[1898]); + ch.SetData950(static_cast<int64_t>(raw_data[1901]) << 32 | raw_data[1900]); + ch.SetData951(static_cast<int64_t>(raw_data[1903]) << 32 | raw_data[1902]); + ch.SetData952(static_cast<int64_t>(raw_data[1905]) << 32 | raw_data[1904]); + ch.SetData953(static_cast<int64_t>(raw_data[1907]) << 32 | raw_data[1906]); + ch.SetData954(static_cast<int64_t>(raw_data[1909]) << 32 | raw_data[1908]); + ch.SetData955(static_cast<int64_t>(raw_data[1911]) << 32 | raw_data[1910]); + ch.SetData956(static_cast<int64_t>(raw_data[1913]) << 32 | raw_data[1912]); + ch.SetData957(static_cast<int64_t>(raw_data[1915]) << 32 | raw_data[1914]); + ch.SetData958(static_cast<int64_t>(raw_data[1917]) << 32 | raw_data[1916]); + ch.SetData959(static_cast<int64_t>(raw_data[1919]) << 32 | raw_data[1918]); + ch.SetData960(static_cast<int64_t>(raw_data[1921]) << 32 | raw_data[1920]); + ch.SetData961(static_cast<int64_t>(raw_data[1923]) << 32 | raw_data[1922]); + ch.SetData962(static_cast<int64_t>(raw_data[1925]) << 32 | raw_data[1924]); + ch.SetData963(static_cast<int64_t>(raw_data[1927]) << 32 | raw_data[1926]); + ch.SetData964(static_cast<int64_t>(raw_data[1929]) << 32 | raw_data[1928]); + ch.SetData965(static_cast<int64_t>(raw_data[1931]) << 32 | raw_data[1930]); + ch.SetData966(static_cast<int64_t>(raw_data[1933]) << 32 | raw_data[1932]); + ch.SetData967(static_cast<int64_t>(raw_data[1935]) << 32 | raw_data[1934]); + ch.SetData968(static_cast<int64_t>(raw_data[1937]) << 32 | raw_data[1936]); + ch.SetData969(static_cast<int64_t>(raw_data[1939]) << 32 | raw_data[1938]); + ch.SetData970(static_cast<int64_t>(raw_data[1941]) << 32 | raw_data[1940]); + ch.SetData971(static_cast<int64_t>(raw_data[1943]) << 32 | raw_data[1942]); + ch.SetData972(static_cast<int64_t>(raw_data[1945]) << 32 | raw_data[1944]); + ch.SetData973(static_cast<int64_t>(raw_data[1947]) << 32 | raw_data[1946]); + ch.SetData974(static_cast<int64_t>(raw_data[1949]) << 32 | raw_data[1948]); + ch.SetData975(static_cast<int64_t>(raw_data[1951]) << 32 | raw_data[1950]); + ch.SetData976(static_cast<int64_t>(raw_data[1953]) << 32 | raw_data[1952]); + ch.SetData977(static_cast<int64_t>(raw_data[1955]) << 32 | raw_data[1954]); + ch.SetData978(static_cast<int64_t>(raw_data[1957]) << 32 | raw_data[1956]); + ch.SetData979(static_cast<int64_t>(raw_data[1959]) << 32 | raw_data[1958]); + ch.SetData980(static_cast<int64_t>(raw_data[1961]) << 32 | raw_data[1960]); + ch.SetData981(static_cast<int64_t>(raw_data[1963]) << 32 | raw_data[1962]); + ch.SetData982(static_cast<int64_t>(raw_data[1965]) << 32 | raw_data[1964]); + ch.SetData983(static_cast<int64_t>(raw_data[1967]) << 32 | raw_data[1966]); + ch.SetData984(static_cast<int64_t>(raw_data[1969]) << 32 | raw_data[1968]); + ch.SetData985(static_cast<int64_t>(raw_data[1971]) << 32 | raw_data[1970]); + ch.SetData986(static_cast<int64_t>(raw_data[1973]) << 32 | raw_data[1972]); + ch.SetData987(static_cast<int64_t>(raw_data[1975]) << 32 | raw_data[1974]); + ch.SetData988(static_cast<int64_t>(raw_data[1977]) << 32 | raw_data[1976]); + ch.SetData989(static_cast<int64_t>(raw_data[1979]) << 32 | raw_data[1978]); + ch.SetData990(static_cast<int64_t>(raw_data[1981]) << 32 | raw_data[1980]); + ch.SetData991(static_cast<int64_t>(raw_data[1983]) << 32 | raw_data[1982]); + ch.SetData992(static_cast<int64_t>(raw_data[1985]) << 32 | raw_data[1984]); + ch.SetData993(static_cast<int64_t>(raw_data[1987]) << 32 | raw_data[1986]); + ch.SetData994(static_cast<int64_t>(raw_data[1989]) << 32 | raw_data[1988]); + ch.SetData995(static_cast<int64_t>(raw_data[1991]) << 32 | raw_data[1990]); + ch.SetData996(static_cast<int64_t>(raw_data[1993]) << 32 | raw_data[1992]); + ch.SetData997(static_cast<int64_t>(raw_data[1995]) << 32 | raw_data[1994]); + ch.SetData998(static_cast<int64_t>(raw_data[1997]) << 32 | raw_data[1996]); + ch.SetData999(static_cast<int64_t>(raw_data[1999]) << 32 | raw_data[1998]); + ch.SetData1000(static_cast<int64_t>(raw_data[2001]) << 32 | raw_data[2000]); + ch.SetData1001(static_cast<int64_t>(raw_data[2003]) << 32 | raw_data[2002]); + ch.SetData1002(static_cast<int64_t>(raw_data[2005]) << 32 | raw_data[2004]); + ch.SetData1003(static_cast<int64_t>(raw_data[2007]) << 32 | raw_data[2006]); + ch.SetData1004(static_cast<int64_t>(raw_data[2009]) << 32 | raw_data[2008]); + ch.SetData1005(static_cast<int64_t>(raw_data[2011]) << 32 | raw_data[2010]); + ch.SetData1006(static_cast<int64_t>(raw_data[2013]) << 32 | raw_data[2012]); + ch.SetData1007(static_cast<int64_t>(raw_data[2015]) << 32 | raw_data[2014]); + ch.SetData1008(static_cast<int64_t>(raw_data[2017]) << 32 | raw_data[2016]); + ch.SetData1009(static_cast<int64_t>(raw_data[2019]) << 32 | raw_data[2018]); + ch.SetData1010(static_cast<int64_t>(raw_data[2021]) << 32 | raw_data[2020]); + ch.SetData1011(static_cast<int64_t>(raw_data[2023]) << 32 | raw_data[2022]); + ch.SetData1012(static_cast<int64_t>(raw_data[2025]) << 32 | raw_data[2024]); + ch.SetData1013(static_cast<int64_t>(raw_data[2027]) << 32 | raw_data[2026]); + ch.SetData1014(static_cast<int64_t>(raw_data[2029]) << 32 | raw_data[2028]); + ch.SetData1015(static_cast<int64_t>(raw_data[2031]) << 32 | raw_data[2030]); + ch.SetData1016(static_cast<int64_t>(raw_data[2033]) << 32 | raw_data[2032]); + ch.SetData1017(static_cast<int64_t>(raw_data[2035]) << 32 | raw_data[2034]); + ch.SetData1018(static_cast<int64_t>(raw_data[2037]) << 32 | raw_data[2036]); + ch.SetData1019(static_cast<int64_t>(raw_data[2039]) << 32 | raw_data[2038]); + ch.SetData1020(static_cast<int64_t>(raw_data[2041]) << 32 | raw_data[2040]); + ch.SetData1021(static_cast<int64_t>(raw_data[2043]) << 32 | raw_data[2042]); + ch.SetData1022(static_cast<int64_t>(raw_data[2045]) << 32 | raw_data[2044]); + ch.SetData1023(static_cast<int64_t>(raw_data[2047]) << 32 | raw_data[2046]); + ch.Record(ukm_recorder); return true; }
diff --git a/third_party/blink/renderer/build/scripts/core/css/css_properties.py b/third_party/blink/renderer/build/scripts/core/css/css_properties.py index aa3a6b9..6e99165 100755 --- a/third_party/blink/renderer/build/scripts/core/css/css_properties.py +++ b/third_party/blink/renderer/build/scripts/core/css/css_properties.py
@@ -313,7 +313,10 @@ if name_without_leading_dash.startswith('-'): name_without_leading_dash = name_without_leading_dash[1:] internal_visited_order = 1 - if name_without_leading_dash.startswith('internal-visited-'): + if name_without_leading_dash.startswith( + 'internal-visited-' + ) or name_without_leading_dash.startswith( + 'internal-forced-visited-'): internal_visited_order = 0 property_.sorting_key = (-property_.priority, internal_visited_order,
diff --git a/third_party/blink/renderer/core/css/css_math_expression_node.cc b/third_party/blink/renderer/core/css/css_math_expression_node.cc index 25e515e..e218cb80 100644 --- a/third_party/blink/renderer/core/css/css_math_expression_node.cc +++ b/third_party/blink/renderer/core/css/css_math_expression_node.cc
@@ -655,8 +655,9 @@ final_node = MaybeNegateFirstNode(op, node)->Copy(); continue; } - final_node = MakeGarbageCollected<CSSMathExpressionOperation>( - final_node, node, op, root->Category()); + final_node = + CSSMathExpressionOperation::CreateArithmeticOperationSimplified( + final_node, node, op); } return final_node; }
diff --git a/third_party/blink/renderer/core/css/parser/css_selector_parser.cc b/third_party/blink/renderer/core/css/parser/css_selector_parser.cc index 2d042a23..eb02917 100644 --- a/third_party/blink/renderer/core/css/parser/css_selector_parser.cc +++ b/third_party/blink/renderer/core/css/parser/css_selector_parser.cc
@@ -2566,6 +2566,9 @@ case CSSSelector::kPseudoHas: feature = WebFeature::kCSSSelectorPseudoHas; break; + case CSSSelector::kPseudoHasSlotted: + feature = WebFeature::kCSSSelectorPseudoHasSlotted; + break; case CSSSelector::kPseudoState: feature = WebFeature::kCSSSelectorPseudoState; break;
diff --git a/third_party/blink/renderer/core/css/resolver/style_adjuster.cc b/third_party/blink/renderer/core/css/resolver/style_adjuster.cc index b9f84106..8c0539f 100644 --- a/third_party/blink/renderer/core/css/resolver/style_adjuster.cc +++ b/third_party/blink/renderer/core/css/resolver/style_adjuster.cc
@@ -57,7 +57,6 @@ #include "third_party/blink/renderer/core/html/forms/html_text_area_element.h" #include "third_party/blink/renderer/core/html/html_body_element.h" #include "third_party/blink/renderer/core/html/html_br_element.h" -#include "third_party/blink/renderer/core/html/html_dialog_element.h" #include "third_party/blink/renderer/core/html/html_frame_element.h" #include "third_party/blink/renderer/core/html/html_frame_set_element.h" #include "third_party/blink/renderer/core/html/html_html_element.h" @@ -974,60 +973,6 @@ } } -static void AdjustStyleForInert(ComputedStyleBuilder& builder, - Element* element) { - if (RuntimeEnabledFeatures::CSSInertEnabled()) { - if (builder.Interactivity() == EInteractivity::kInert && - !builder.InteractivityIsInherited()) { - // If the computed value of 'interactivity' is 'inert', set the internal - // inertness flag to true. With this flag set, it is not possible to - // escape the inertness in the subtree, even if 'interactivity' is set to - // 'auto' in a descendant. This is not in line with the current spec. - builder.SetIsInert(true); - builder.SetIsInertIsInherited(false); - return; - } - } - - if (!element) { - return; - } - - if (!RuntimeEnabledFeatures::CSSInertEnabled()) { - if (element->IsInertRoot()) { - builder.SetIsInert(true); - builder.SetIsInertIsInherited(false); - return; - } - } - - Document& document = element->GetDocument(); - const Element* modal_element = document.ActiveModalDialog(); - if (!modal_element) { - modal_element = Fullscreen::FullscreenElementFrom(document); - } - if (modal_element == element) { - builder.SetIsInert(false); - builder.SetIsInertIsInherited(false); - return; - } - if (modal_element && element == document.documentElement()) { - builder.SetIsInert(true); - builder.SetIsInertIsInherited(false); - return; - } - - if (StyleBaseData* base_data = builder.BaseData()) { - if (base_data->GetBaseComputedStyle()->Display() == EDisplay::kNone) { - // Elements which are transitioning to display:none should become inert: - // https://github.com/w3c/csswg-drafts/issues/8389 - builder.SetIsInert(true); - builder.SetIsInertIsInherited(false); - return; - } - } -} - void StyleAdjuster::AdjustForForcedColorsMode(ComputedStyleBuilder& builder, Document& document) { if (!builder.InForcedColorsMode() || @@ -1265,8 +1210,6 @@ LayoutTheme::GetTheme().AdjustStyle( element ? element : state.GetPseudoElement(), builder); - AdjustStyleForInert(builder, element); - AdjustStyleForEditing(builder, element); if (auto* svg_element = DynamicTo<SVGElement>(element); svg_element) {
diff --git a/third_party/blink/renderer/core/css/resolver/style_resolver.cc b/third_party/blink/renderer/core/css/resolver/style_resolver.cc index fef22f8..ee1bad7 100644 --- a/third_party/blink/renderer/core/css/resolver/style_resolver.cc +++ b/third_party/blink/renderer/core/css/resolver/style_resolver.cc
@@ -99,6 +99,7 @@ #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/fullscreen/fullscreen.h" #include "third_party/blink/renderer/core/html/html_body_element.h" +#include "third_party/blink/renderer/core/html/html_dialog_element.h" #include "third_party/blink/renderer/core/html/html_html_element.h" #include "third_party/blink/renderer/core/html/html_iframe_element.h" #include "third_party/blink/renderer/core/html/html_image_element.h" @@ -337,6 +338,15 @@ // RecalcOwnStyle, regardless of how ResolveStyle produces its result. exclusions.insert(DebugField::highlight_data_); + // IsCSSInert and IsHTMLInert flags are updated at the end of ResolveStyle, + // which means the freshly resolved style will not have these flags updated + // yet. Animations may affect inertness, yet they don't need to know whether + // inertness has been applied in the base style. + exclusions.insert(DebugField::is_css_inert_); + exclusions.insert(DebugField::is_css_inert_is_inherited_); + exclusions.insert(DebugField::is_html_inert_); + exclusions.insert(DebugField::is_html_inert_is_inherited_); + Vector<DebugDiff> diff = base_computed_style->DebugDiffFields(computed_style); StringBuilder builder; @@ -485,6 +495,66 @@ } } +void ApplyInertness(StyleResolverState& state) { + std::optional<bool> html_inert; + std::optional<bool> css_inert; + + if (RuntimeEnabledFeatures::CSSInertEnabled()) { + if (state.StyleBuilder().Interactivity() == EInteractivity::kInert && + !state.StyleBuilder().InteractivityIsInherited() && + !state.StyleBuilder().IsCSSInert()) { + // If the computed value of 'interactivity' is 'inert', set the internal + // CSS inertness flag to true. With this flag set, it is not possible to + // escape CSS inertness in the subtree with 'interactivity' set to 'auto' + // in a descendant. + // TODO(crbug.com/413291835): This is not in line with the current spec. + css_inert = true; + } + } else if (state.GetElement().IsInertRoot()) { + html_inert = true; + } + + const Element& element = state.GetElement(); + Document& document = element.GetDocument(); + const Element* modal_element = document.ActiveModalDialog(); + if (!modal_element) { + modal_element = Fullscreen::FullscreenElementFrom(document); + } + if (modal_element) { + if (modal_element == element) { + // Modal elements escape inertness unless the element itself is inerted by + // an inert attribute or interactivity style. + if (!html_inert.has_value()) { + html_inert = false; + } + if (!css_inert.has_value()) { + css_inert = false; + } + } else if (element == document.documentElement()) { + // The rest of the document is inerted by modal dialogs and fullscreen'ed + // elements. + html_inert = true; + } + } + + if (StyleBaseData* base_data = state.StyleBuilder().BaseData()) { + if (base_data->GetBaseComputedStyle()->Display() == EDisplay::kNone) { + // Elements which are transitioning to display:none should become inert: + // https://github.com/w3c/csswg-drafts/issues/8389 + html_inert = true; + } + } + + if (html_inert.has_value()) { + state.StyleBuilder().SetIsHTMLInert(html_inert.value()); + state.StyleBuilder().SetIsHTMLInertIsInherited(false); + } + if (css_inert.has_value()) { + state.StyleBuilder().SetIsCSSInert(css_inert.value()); + state.StyleBuilder().SetIsCSSInertIsInherited(false); + } +} + } // namespace static CSSPropertyValueSet* LeftToRightDeclaration() { @@ -1319,6 +1389,7 @@ } ApplyAnchorData(state); + ApplyInertness(state); IncrementResolvedStyleCounters(style_request, GetDocument());
diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc index 6ec7e054..e795816 100644 --- a/third_party/blink/renderer/core/css/style_engine.cc +++ b/third_party/blink/renderer/core/css/style_engine.cc
@@ -3855,32 +3855,14 @@ ViewTransitionUtils::ForEachTransition( *document_, [&](ViewTransition& transition) { - Element* scope = transition.Scope(); - if (!scope) { - scope = document_->documentElement(); - } - if (!scope || !scope->InActiveDocument()) { - return; - } - - // TODO(crbug.com/405117185): Use only the v-t-names inside the scope. - scope->RecalcTransitionPseudoTreeStyle(view_transition_names_); + transition.RecalcTransitionPseudoTreeStyle(); }); } void StyleEngine::RebuildTransitionPseudoLayoutTrees() { ViewTransitionUtils::ForEachTransition( *document_, [&](ViewTransition& transition) { - Element* scope = transition.Scope(); - if (!scope) { - scope = document_->documentElement(); - } - if (!scope || !scope->InActiveDocument()) { - return; - } - - // TODO(crbug.com/405117185): Use only the v-t-names inside the scope. - scope->RebuildTransitionPseudoLayoutTree(view_transition_names_); + transition.RebuildTransitionPseudoLayoutTree(); }); }
diff --git a/third_party/blink/renderer/core/css/style_engine.h b/third_party/blink/renderer/core/css/style_engine.h index 66bbfd2..1b8e240 100644 --- a/third_party/blink/renderer/core/css/style_engine.h +++ b/third_party/blink/renderer/core/css/style_engine.h
@@ -749,13 +749,6 @@ Color ForcedBackgroundColor() const { return forced_background_color_; } Color ColorAdjustBackgroundColor() const; - void SetViewTransitionNames(const Vector<AtomicString>& names) { - view_transition_names_ = names; - } - const Vector<AtomicString>& ViewTransitionTags() const { - return view_transition_names_; - } - ImageResourceContent* CacheImageContent(FetchParameters& params) { return style_image_cache_.CacheImageContent(GetDocument().Fetcher(), params); @@ -1192,10 +1185,6 @@ // re-attachment after the removal. Member<LayoutObject> parent_for_detached_subtree_; - // The set of IDs for which ::view-transition-group pseudo elements are - // generated during a ViewTransition. - Vector<AtomicString> view_transition_names_; - // The @view-transition rule currently applying to the document. Member<StyleRuleViewTransition> view_transition_rule_;
diff --git a/third_party/blink/renderer/core/dom/layout_tree_builder_traversal.cc b/third_party/blink/renderer/core/dom/layout_tree_builder_traversal.cc index f151690..c0dbf0f 100644 --- a/third_party/blink/renderer/core/dom/layout_tree_builder_traversal.cc +++ b/third_party/blink/renderer/core/dom/layout_tree_builder_traversal.cc
@@ -34,6 +34,7 @@ #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h" +#include "third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.h" namespace blink { @@ -214,15 +215,14 @@ case kPseudoIdViewTransition: return nullptr; case kPseudoIdViewTransitionGroup: { - auto* pseudo_element = DynamicTo<PseudoElement>(node); + auto* pseudo_element = DynamicTo<ViewTransitionPseudoElementBase>(node); DCHECK(pseudo_element); // Iterate the list of IDs until we hit the entry for |node's| ID. The // sibling is the next ID in the list which generates a pseudo element. bool found = false; - for (const auto& view_transition_name : parent_element->GetDocument() - .GetStyleEngine() - .ViewTransitionTags()) { + for (const auto& view_transition_name : + pseudo_element->GetViewTransitionNames()) { if (!found) { if (view_transition_name == pseudo_element->view_transition_name()) found = true;
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index 136f310..36b22659 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -501,7 +501,7 @@ To<PseudoElement>(this)->view_transition_name()); case kPseudoIdViewTransitionGroup: { const Vector<AtomicString>& names = - GetDocument().GetStyleEngine().ViewTransitionTags(); + To<ViewTransitionPseudoElementBase>(this)->GetViewTransitionNames(); wtf_size_t found_index = names.Find(To<PseudoElement>(this)->view_transition_name()); CHECK_NE(found_index, kNotFound); @@ -619,7 +619,7 @@ To<PseudoElement>(this)->view_transition_name()); case kPseudoIdViewTransitionGroup: { const Vector<AtomicString>& names = - GetDocument().GetStyleEngine().ViewTransitionTags(); + To<ViewTransitionPseudoElementBase>(this)->GetViewTransitionNames(); wtf_size_t found_index = names.Find(To<PseudoElement>(this)->view_transition_name()); CHECK_NE(found_index, kNotFound); @@ -645,7 +645,7 @@ // pseudo traversal. if (GetPseudoId() == kPseudoIdViewTransition) { const Vector<AtomicString>& names = - GetDocument().GetStyleEngine().ViewTransitionTags(); + To<ViewTransitionPseudoElementBase>(this)->GetViewTransitionNames(); if (names.empty()) { return nullptr; } @@ -730,7 +730,7 @@ // pseudo traversal. if (GetPseudoId() == kPseudoIdViewTransition) { const Vector<AtomicString>& names = - GetDocument().GetStyleEngine().ViewTransitionTags(); + To<ViewTransitionPseudoElementBase>(this)->GetViewTransitionNames(); if (names.empty()) { return nullptr; }
diff --git a/third_party/blink/renderer/core/dom/pseudo_element.cc b/third_party/blink/renderer/core/dom/pseudo_element.cc index f2f64ef..87cfbc9e 100644 --- a/third_party/blink/renderer/core/dom/pseudo_element.cc +++ b/third_party/blink/renderer/core/dom/pseudo_element.cc
@@ -366,13 +366,17 @@ // the originating element of the scroll marker. StyleAdjuster::AdjustStyleForDisplay(builder, layout_parent_style, this, &GetDocument()); - if (style.IsInertIsInherited() && - style.IsInert() != layout_parent_style.IsInert()) { + if (style.IsCSSInertIsInherited() && + style.IsCSSInert() != layout_parent_style.IsCSSInert()) { // A ::scroll-marker gets its inertness from its ::scroll-marker-group // instead of its originating element unless the inertness is applied // directly to the ::scroll-marker itself. - builder.SetIsInert(layout_parent_style.IsInert()); - builder.SetIsInertIsInherited(false); + builder.SetIsCSSInert(layout_parent_style.IsCSSInert()); + builder.SetIsCSSInertIsInherited(false); + } + if (style.IsHTMLInert() != layout_parent_style.IsHTMLInert()) { + builder.SetIsHTMLInert(layout_parent_style.IsHTMLInert()); + builder.SetIsHTMLInertIsInherited(false); } return builder.TakeStyle(); }
diff --git a/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc b/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc index 5b44a640..7dc3616 100644 --- a/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc +++ b/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc
@@ -1250,6 +1250,9 @@ CycleThreads(); EXPECT_TRUE(IsSuspended()); + // Wait until we reach the have current data state. + WaitForReadyStateHaveCurrentData(); + // The data source contains the entire file, so subtract it from the memory // usage to ensure there's no other memory usage. const int64_t data_source_size = GetDataSourceMemoryUsage();
diff --git a/third_party/blink/renderer/core/frame/ad_tracker.cc b/third_party/blink/renderer/core/frame/ad_tracker.cc index a9b2bf9..257907c 100644 --- a/third_party/blink/renderer/core/frame/ad_tracker.cc +++ b/third_party/blink/renderer/core/frame/ad_tracker.cc
@@ -308,7 +308,7 @@ bool AdTracker::IsAdScriptInStack( StackType stack_type, - std::vector<AdScriptIdentifier>* out_ad_script_ancestry) { + Vector<AdScriptIdentifier>* out_ad_script_ancestry) { std::optional<AdScriptIdentifier> out_ad_script; std::optional<AdScriptIdentifier>* out_ad_script_ptr = @@ -457,9 +457,9 @@ } } -std::vector<AdScriptIdentifier> AdTracker::GetAncestryChain( +Vector<AdScriptIdentifier> AdTracker::GetAncestryChain( const AdScriptIdentifier& ad_script) { - std::vector<AdScriptIdentifier> ancestry_chain = {ad_script}; + Vector<AdScriptIdentifier> ancestry_chain = {ad_script}; auto ancestor_it = ancestor_ad_scripts_.find(ancestry_chain.back()); while (ancestor_it != ancestor_ad_scripts_.end()) {
diff --git a/third_party/blink/renderer/core/frame/ad_tracker.h b/third_party/blink/renderer/core/frame/ad_tracker.h index e53b4f4..192140a67 100644 --- a/third_party/blink/renderer/core/frame/ad_tracker.h +++ b/third_party/blink/renderer/core/frame/ad_tracker.h
@@ -95,7 +95,7 @@ // flagged by the subresource filter. virtual bool IsAdScriptInStack( StackType stack_type, - std::vector<AdScriptIdentifier>* out_ad_script_ancestry = nullptr); + Vector<AdScriptIdentifier>* out_ad_script_ancestry = nullptr); virtual void Trace(Visitor*) const; @@ -164,7 +164,7 @@ // the script itself to the root script. The root script is guaranteed to be // subresource-filter-flagged, while all preceding scripts in the chain are // non-subresource-filter-flagged. - std::vector<AdScriptIdentifier> GetAncestryChain( + Vector<AdScriptIdentifier> GetAncestryChain( const AdScriptIdentifier& ad_script); Member<LocalFrame> local_root_;
diff --git a/third_party/blink/renderer/core/frame/ad_tracker_test.cc b/third_party/blink/renderer/core/frame/ad_tracker_test.cc index 84000a7..33cd220d 100644 --- a/third_party/blink/renderer/core/frame/ad_tracker_test.cc +++ b/third_party/blink/renderer/core/frame/ad_tracker_test.cc
@@ -129,9 +129,9 @@ // Intercepts `IsAdScriptInStack` to capture and store the ad script's // ancestry for frame creation scenario. - bool IsAdScriptInStack(StackType stack_type, - std::vector<AdScriptIdentifier>* - out_ad_script_ancestry = nullptr) override { + bool IsAdScriptInStack( + StackType stack_type, + Vector<AdScriptIdentifier>* out_ad_script_ancestry = nullptr) override { bool result = AdTracker::IsAdScriptInStack(stack_type, out_ad_script_ancestry); @@ -144,7 +144,7 @@ return result; } - const std::vector<AdScriptIdentifier>& last_ad_script_ancestry() const { + const Vector<AdScriptIdentifier>& last_ad_script_ancestry() const { return last_ad_script_ancestry_; } @@ -198,7 +198,7 @@ Member<ExecutionContext> execution_context_; String ad_suffix_; bool sim_test_ = false; - std::vector<AdScriptIdentifier> last_ad_script_ancestry_; + Vector<AdScriptIdentifier> last_ad_script_ancestry_; base::OnceClosure quit_closure_; String url_to_wait_for_; @@ -256,7 +256,7 @@ } std::optional<AdScriptIdentifier> BottommostAdScript() { - std::vector<AdScriptIdentifier> ad_script_ancestry; + Vector<AdScriptIdentifier> ad_script_ancestry; ad_tracker_->IsAdScriptInStack(AdTracker::StackType::kBottomOnly, /*out_ad_script=*/&ad_script_ancestry);
diff --git a/third_party/blink/renderer/core/frame/deprecation/deprecation.cc b/third_party/blink/renderer/core/frame/deprecation/deprecation.cc index 804eb6f..6f0b138e 100644 --- a/third_party/blink/renderer/core/frame/deprecation/deprecation.cc +++ b/third_party/blink/renderer/core/frame/deprecation/deprecation.cc
@@ -101,11 +101,6 @@ if (window->GetFrame()) deprecation = &window->GetFrame()->GetPage()->GetDeprecation(); } else if (auto* scope = DynamicTo<WorkerOrWorkletGlobalScope>(context)) { - // TODO(crbug.com/1146824): Remove this once PlzDedicatedWorker and - // PlzServiceWorker ship. - if (!scope->IsInitialized()) { - return; - } deprecation = &scope->GetDeprecation(); }
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc index c8eb035..ecaae5e 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -1968,22 +1968,18 @@ // See SubresourceFilterAgent::Initialize for why we don't set this here for // fenced frames. - std::vector<AdScriptIdentifier> ad_script_ancestry; is_frame_created_by_ad_script_ = !IsMainFrame() && ad_tracker_ && ad_tracker_->IsAdScriptInStack(AdTracker::StackType::kBottomAndTop, - &ad_script_ancestry); - if (!ad_script_ancestry.empty()) { - DCHECK(is_frame_created_by_ad_script_); - ad_script_from_frame_creation_stack_ = ad_script_ancestry[0]; - } + &provisional_ad_script_ancestry_); Initialize(); // Now that we know whether the frame is provisional, inherit the probe // sink from parent if appropriate. See comment above for more details. if (!IsLocalRoot() && !IsProvisional()) { probe_sink_ = LocalFrameRoot().probe_sink_; - probe::FrameAttachedToParent(this, ad_script_from_frame_creation_stack_); + probe::FrameAttachedToParent(this, provisional_ad_script_ancestry_); + provisional_ad_script_ancestry_.clear(); } } @@ -3077,7 +3073,8 @@ probe_sink_ = LocalFrameRoot().probe_sink_; // For remote -> local swap, Send a frameAttached event to keep the legacy // behavior where we fire the frameAttached event on cross-site navigations. - probe::FrameAttachedToParent(this, ad_script_from_frame_creation_stack_); + probe::FrameAttachedToParent(this, provisional_ad_script_ancestry_); + provisional_ad_script_ancestry_.clear(); } return client->SwapIn(WebFrame::FromCoreFrame(provisional_owner_frame));
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h index 89365bf..80c37508a9 100644 --- a/third_party/blink/renderer/core/frame/local_frame.h +++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -1203,9 +1203,12 @@ // SubresourceFilterAgent::Initialize. bool is_frame_created_by_ad_script_ = false; - // The identifier of the ad script at the time of frame creation. Kept to - // defer instrumentation probe call until the frame is committed. - std::optional<AdScriptIdentifier> ad_script_from_frame_creation_stack_; + // The ancestry chain of ad script identifiers leading to this frame's + // creation, ordered from the most immediate script (in the frame creation + // stack) to more distant ancestors (that created the immediately preceding + // script). Kept to defer instrumentation probe call until the frame is + // committed. + Vector<AdScriptIdentifier> provisional_ad_script_ancestry_; bool evict_cached_session_storage_on_freeze_or_unload_ = false;
diff --git a/third_party/blink/renderer/core/html/html_details_element.cc b/third_party/blink/renderer/core/html/html_details_element.cc index 95464fa7..df48883 100644 --- a/third_party/blink/renderer/core/html/html_details_element.cc +++ b/third_party/blink/renderer/core/html/html_details_element.cc
@@ -227,14 +227,17 @@ void HTMLDetailsElement::AttributeChanged( const AttributeModificationParams& params) { - const QualifiedName& name = params.name; - if (name == html_names::kNameAttr) { + if (params.name == html_names::kNameAttr) { if (!params.new_value.empty()) { UseCounter::Count(GetDocument(), WebFeature::kHTMLDetailsElementNameAttribute); } MaybeCloseForExclusivity(); } + if (params.name == html_names::kOpenAttr && + params.old_value != params.new_value) { + PseudoStateChanged(CSSSelector::kPseudoOpen); + } HTMLElement::AttributeChanged(params); }
diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc index 75efaec81..66d1ac7 100644 --- a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc
@@ -564,7 +564,7 @@ resource_content_loader_client_id_); requested_compilation_cache_.clear(); compilation_cache_.clear(); - ad_script_identifiers_.clear(); + frame_ad_script_ancestry_.clear(); stopScreencast(); return protocol::Response::Success(); @@ -795,18 +795,27 @@ WrapPersistent(this), frame_id, url, std::move(callback))); } -protocol::Response InspectorPageAgent::getAdScriptId( +protocol::Response InspectorPageAgent::getAdScriptAncestryIds( const String& frame_id, - std::unique_ptr<protocol::Page::AdScriptId>* ad_script_id) { - if (ad_script_identifiers_.Contains(frame_id)) { - AdScriptIdentifier* ad_script_identifier = - ad_script_identifiers_.at(frame_id); - *ad_script_id = - protocol::Page::AdScriptId::create() - .setScriptId(String::Number(ad_script_identifier->id)) - .setDebuggerId(ToCoreString( - ad_script_identifier->context_id.toString()->string())) - .build(); + std::unique_ptr<protocol::Array<protocol::Page::AdScriptId>>* + out_ad_script_ancestry) { + auto it = frame_ad_script_ancestry_.find(frame_id); + if (it != frame_ad_script_ancestry_.end()) { + const Vector<AdScriptIdentifier>& ad_script_ancestry = it->value; + + std::vector<std::unique_ptr<protocol::Page::AdScriptId>> results; + for (const auto& ad_script_identifier : ad_script_ancestry) { + results.push_back( + protocol::Page::AdScriptId::create() + .setScriptId(String::Number(ad_script_identifier.id)) + .setDebuggerId(ToCoreString( + ad_script_identifier.context_id.toString()->string())) + .build()); + } + + *out_ad_script_ancestry = + std::make_unique<protocol::Array<protocol::Page::AdScriptId>>( + std::move(results)); } return protocol::Response::Success(); @@ -1147,16 +1156,15 @@ void InspectorPageAgent::FrameAttachedToParent( LocalFrame* frame, - const std::optional<AdScriptIdentifier>& ad_script_on_stack) { + const Vector<AdScriptIdentifier>& ad_script_ancestry) { // TODO(crbug.com/1217041): If an ad script on the stack caused this frame to // be tagged as an ad, send the script's ID to the frontend. Frame* parent_frame = frame->Tree().Parent(); std::unique_ptr<SourceLocation> location = SourceLocation::CaptureWithFullStackTrace(); - if (ad_script_on_stack.has_value()) { - ad_script_identifiers_.Set( - IdentifiersFactory::FrameId(frame), - std::make_unique<AdScriptIdentifier>(ad_script_on_stack.value())); + if (!ad_script_ancestry.empty()) { + frame_ad_script_ancestry_.Set(IdentifiersFactory::FrameId(frame), + ad_script_ancestry); } GetFrontend()->frameAttached( IdentifiersFactory::FrameId(frame), @@ -1172,7 +1180,7 @@ FrameDetachType type) { // If the frame is swapped, we still maintain the ad script id for it. if (type == FrameDetachType::kRemove) { - ad_script_identifiers_.erase(IdentifiersFactory::FrameId(frame)); + frame_ad_script_ancestry_.erase(IdentifiersFactory::FrameId(frame)); } GetFrontend()->frameDetached(IdentifiersFactory::FrameId(frame),
diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.h b/third_party/blink/renderer/core/inspector/inspector_page_agent.h index f3d700bb..3d8a2b2 100644 --- a/third_party/blink/renderer/core/inspector/inspector_page_agent.h +++ b/third_party/blink/renderer/core/inspector/inspector_page_agent.h
@@ -144,9 +144,10 @@ void getResourceContent(const String& frame_id, const String& url, std::unique_ptr<GetResourceContentCallback>) override; - protocol::Response getAdScriptId( + protocol::Response getAdScriptAncestryIds( const String& frame_id, - std::unique_ptr<protocol::Page::AdScriptId>* ad_script_id) override; + std::unique_ptr<protocol::Array<protocol::Page::AdScriptId>>* + out_ad_script_ancestry) override; void searchInResource(const String& frame_id, const String& url, const String& query, @@ -216,7 +217,7 @@ void DidOpenDocument(LocalFrame*, DocumentLoader*); void FrameAttachedToParent( LocalFrame*, - const std::optional<AdScriptIdentifier>& ad_script_on_stack); + const Vector<AdScriptIdentifier>& ad_script_ancestry); void FrameDetachedFromParent(LocalFrame*, FrameDetachType); void FrameSubtreeWillBeDetached(Frame* frame); void FrameStoppedLoading(LocalFrame*); @@ -325,8 +326,7 @@ using FrameIsolatedWorlds = GCedHeapHashMap<String, Member<DOMWrapperWorld>>; HeapHashMap<WeakMember<LocalFrame>, Member<FrameIsolatedWorlds>> isolated_worlds_; - HashMap<String, std::unique_ptr<blink::AdScriptIdentifier>> - ad_script_identifiers_; + HashMap<String, Vector<AdScriptIdentifier>> frame_ad_script_ancestry_; v8_inspector::V8InspectorSession* v8_session_; Client* client_; Member<InspectorResourceContentLoader> inspector_resource_content_loader_;
diff --git a/third_party/blink/renderer/core/inspector/inspector_style_resolver.cc b/third_party/blink/renderer/core/inspector/inspector_style_resolver.cc index 5bea00c3..d4a8053 100644 --- a/third_party/blink/renderer/core/inspector/inspector_style_resolver.cc +++ b/third_party/blink/renderer/core/inspector/inspector_style_resolver.cc
@@ -14,6 +14,8 @@ #include "third_party/blink/renderer/core/dom/flat_tree_traversal.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h" +#include "third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.h" +#include "third_party/blink/renderer/core/view_transition/view_transition_utils.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/wtf/text/atomic_string.h" @@ -37,8 +39,6 @@ // to get this information without grabbing at internal style classes! StyleResolver& style_resolver = element_->GetDocument().GetStyleResolver(); - DCHECK(!IsTransitionPseudoElement(element_pseudo_id) || - element_->IsDocumentElement()); matched_rules_ = style_resolver.PseudoCSSRulesForElement( element_, element_pseudo_id, view_transition_name, StyleResolver::kAllCSSRules); @@ -72,16 +72,14 @@ } const bool has_active_view_transition = - element_->IsDocumentElement() && - !element_->GetDocument().GetStyleEngine().ViewTransitionTags().empty(); + !!ViewTransitionUtils::GetTransition(*element); + for (PseudoId pseudo_id = kFirstPublicPseudoId; pseudo_id < kAfterLastInternalPseudoId; pseudo_id = static_cast<PseudoId>(pseudo_id + 1)) { if (!PseudoElement::IsWebExposed(pseudo_id, element_)) continue; - // The ::view-transition* pseudo elements are only generated for the root - // element. if (IsTransitionPseudoElement(pseudo_id) && !has_active_view_transition) { continue; } @@ -94,9 +92,12 @@ continue; } - for (const auto& tag : - element_->GetDocument().GetStyleEngine().ViewTransitionTags()) { - AddPseudoElementRules(pseudo_id, tag); + if (auto* view_transition_pseudo = + DynamicTo<ViewTransitionPseudoElementBase>( + element_->GetPseudoElement(kPseudoIdViewTransition))) { + for (const auto& tag : view_transition_pseudo->GetViewTransitionNames()) { + AddPseudoElementRules(pseudo_id, tag); + } } }
diff --git a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc index e2bd6b26..cd201c8 100644 --- a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc +++ b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc
@@ -1544,7 +1544,7 @@ const gfx::RectF& src_rect, const gfx::RectF& dest_rect) { auto dict = std::move(context).WriteDictionary(); - SetGeneratingNodeInfo(dict, &layout_image, "nodeId"); + SetGeneratingNodeInfo(dict, &layout_image, "nodeId", "nodeName"); if (const ImageResourceContent* content = layout_image.CachedImage()) dict.Add("url", content->Url().ElidedString());
diff --git a/third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc b/third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc index d0d9724..c2b05f0 100644 --- a/third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc +++ b/third_party/blink/renderer/core/layout/out_of_flow_layout_part.cc
@@ -191,6 +191,14 @@ } } UpdateStyle(index); + + if (!style_) { + // The last successful fallback no longer exists. The rule may have been + // deleted. Performing ResizeObserver steps invalidates such last + // successful options (and then this won't be an issue), but we may + // perform layout before that has happened. Update to base style. + UpdateStyle(std::nullopt); + } } std::optional<const CSSPropertyValueSet*> TrySetFromFallback(
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_ellipse.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_ellipse.cc index 6c871fb..fff8c78 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_ellipse.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_ellipse.cc
@@ -59,12 +59,24 @@ } } +bool LayoutSVGEllipse::CalculateGeometryDependsOnViewport() const { + const ComputedStyle& style = StyleRef(); + if (style.Cx().HasPercent() || style.Cy().HasPercent()) { + return true; + } + if (IsA<SVGCircleElement>(*GetElement())) { + return style.R().HasPercent(); + } + return style.Rx().HasPercent() || style.Ry().HasPercent(); +} + gfx::RectF LayoutSVGEllipse::UpdateShapeFromElement() { NOT_DESTROYED(); // Reset shape state. ClearPath(); SetGeometryType(GeometryType::kEmpty); + SetGeometryDependsOnViewport(CalculateGeometryDependsOnViewport()); // This will always update/reset |center_| and |radii_|. CalculateRadiiAndCenter();
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_ellipse.h b/third_party/blink/renderer/core/layout/svg/layout_svg_ellipse.h index 97e92eb..5a36b91 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_ellipse.h +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_ellipse.h
@@ -49,6 +49,7 @@ bool ShapeDependentStrokeContains(const HitTestLocation&) override; bool ShapeDependentFillContains(const HitTestLocation&, const WindRule) const override; + bool CalculateGeometryDependsOnViewport() const; void CalculateRadiiAndCenter(); bool CanUseStrokeHitTestFastPath() const; bool HasContinuousStroke() const;
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_path.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_path.cc index 3fe5ec6..964853c 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_path.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_path.cc
@@ -30,6 +30,7 @@ #include "third_party/blink/renderer/core/layout/svg/layout_svg_resource_marker.h" #include "third_party/blink/renderer/core/layout/svg/svg_resources.h" #include "third_party/blink/renderer/core/svg/svg_geometry_element.h" +#include "third_party/blink/renderer/core/svg/svg_line_element.h" #include "third_party/blink/renderer/core/svg/svg_path_element.h" namespace blink { @@ -100,11 +101,19 @@ LayoutSVGShape::WillBeDestroyed(); } +bool LayoutSVGPath::CalculateGeometryDependsOnViewport() const { + if (auto* line = DynamicTo<SVGLineElement>(*GetElement())) { + return line->PathDependsOnViewport(); + } + return false; +} + gfx::RectF LayoutSVGPath::UpdateShapeFromElement() { NOT_DESTROYED(); CreatePath(); UpdateMarkerPositions(); SetGeometryType(DeterminePathGeometry(GetPath())); + SetGeometryDependsOnViewport(CalculateGeometryDependsOnViewport()); return GetPath().TightBoundingRect(); }
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_path.h b/third_party/blink/renderer/core/layout/svg/layout_svg_path.h index 008f9d4..07c4986 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_path.h +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_path.h
@@ -49,6 +49,7 @@ void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override; void WillBeDestroyed() override; + bool CalculateGeometryDependsOnViewport() const; gfx::RectF UpdateShapeFromElement() override; const StylePath* GetStylePath() const;
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_rect.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_rect.cc index b81882a3..399f7bee 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_rect.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_rect.cc
@@ -43,6 +43,12 @@ old_style.Rx() != new_style.Rx() || old_style.Ry() != new_style.Ry(); } +bool CalculateGeometryDependsOnViewport(const ComputedStyle& style) { + return style.Width().HasPercent() || style.Height().HasPercent() || + style.X().HasPercent() || style.Y().HasPercent() || + style.Rx().HasPercent() || style.Ry().HasPercent(); +} + } // namespace LayoutSVGRect::LayoutSVGRect(SVGRectElement* node) : LayoutSVGShape(node) {} @@ -66,8 +72,10 @@ ClearPath(); SetGeometryType(GeometryType::kEmpty); - const SVGViewportResolver viewport_resolver(*this); const ComputedStyle& style = StyleRef(); + SetGeometryDependsOnViewport(CalculateGeometryDependsOnViewport(style)); + + const SVGViewportResolver viewport_resolver(*this); const gfx::PointF origin = PointForLengthPair(style.X(), style.Y(), viewport_resolver, style); const gfx::Vector2dF size = VectorForLengthPair(style.Width(), style.Height(),
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_clipper.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_clipper.cc index 36d9bab1..dfc032e 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_resource_clipper.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_resource_clipper.cc
@@ -137,10 +137,6 @@ DCHECK_EQ(clip_content_path_validity_, kClipContentPathUnknown); clip_content_path_validity_ = kClipContentPathInvalid; - // If the current clip-path gets clipped itself, we have to fallback to - // masking. - if (StyleRef().HasClipPath()) - return std::nullopt; unsigned op_count = 0; std::optional<SkOpBuilder> clip_path_builder;
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_shape.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_shape.cc index 811a15d..27b4cc1 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_shape.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_shape.cc
@@ -57,9 +57,9 @@ bounds.set_height(ClampTo<float>(bounds.height())); } -// Returns true if style would make this object have relative lengths i.e. -// lengths as percentage of the viewport. -bool ComputeHasRelativeLengths(const ComputedStyle& style) { +// Returns true if the stroke style would make this object have relative +// lengths i.e. lengths as percentage of the viewport. +bool ComputeStrokeHasRelativeLengths(const ComputedStyle& style) { return style.StrokeWidth().length().HasPercent(); } @@ -337,9 +337,12 @@ SVGLayoutResult LayoutSVGShape::UpdateSVGLayout( const SVGLayoutInfo& layout_info) { NOT_DESTROYED(); - if (layout_info.viewport_changed && HasViewportDependence()) { - // TODO: Only invalidate the shape if it depends on the viewport. - SetNeedsShapeUpdate(); + if (layout_info.viewport_changed) { + if (geometry_depends_on_viewport_) { + SetNeedsShapeUpdate(); + } else if (ComputeStrokeHasRelativeLengths(StyleRef())) { + needs_boundaries_update_ = true; + } } // The cached stroke may be affected by the ancestor transform, and so needs @@ -371,8 +374,8 @@ } const bool has_viewport_dependence = - GetElement()->SelfHasRelativeLengths() || - ComputeHasRelativeLengths(StyleRef()) || + geometry_depends_on_viewport_ || + ComputeStrokeHasRelativeLengths(StyleRef()) || (transform_uses_reference_box_ && StyleRef().TransformBox() == ETransformBox::kViewBox); @@ -386,9 +389,6 @@ bool LayoutSVGShape::UpdateAfterSVGLayout(const SVGLayoutInfo& layout_info, bool bbox_changed) { bool needs_paint_invalidation = false; - if (layout_info.viewport_changed && ComputeHasRelativeLengths(StyleRef())) { - needs_paint_invalidation = true; - } if (bbox_changed) { needs_paint_invalidation = true; @@ -398,6 +398,11 @@ resource_invalidator.InvalidateEffects(); resource_invalidator.InvalidatePaints(); } + } else if (layout_info.viewport_changed) { + if (geometry_depends_on_viewport_ || + ComputeStrokeHasRelativeLengths(StyleRef())) { + needs_paint_invalidation = true; + } } if (needs_paint_invalidation) {
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_shape.h b/third_party/blink/renderer/core/layout/svg/layout_svg_shape.h index aea74ce3..d41d9a4 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_shape.h +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_shape.h
@@ -163,6 +163,11 @@ geometry_type_ = geometry_type; } + void SetGeometryDependsOnViewport(bool depends_on_viewport) { + NOT_DESTROYED(); + geometry_depends_on_viewport_ = depends_on_viewport; + } + // Update (cached) shape data and the (object) bounding box. virtual gfx::RectF UpdateShapeFromElement() = 0; virtual void UpdateMarkerBounds() { NOT_DESTROYED(); } @@ -234,6 +239,7 @@ std::unique_ptr<Path> stroke_path_cache_; GeometryType geometry_type_; + bool geometry_depends_on_viewport_ : 1 = false; bool needs_boundaries_update_ : 1; bool needs_shape_update_ : 1; bool needs_transform_update_ : 1;
diff --git a/third_party/blink/renderer/core/paint/clip_path_clipper.cc b/third_party/blink/renderer/core/paint/clip_path_clipper.cc index 4499c76..bf13fdc6 100644 --- a/third_party/blink/renderer/core/paint/clip_path_clipper.cc +++ b/third_party/blink/renderer/core/paint/clip_path_clipper.cc
@@ -554,6 +554,15 @@ const LayoutObject& reference_box_object, const gfx::Vector2dF& clip_offset) { const ClipPathOperation& clip_path = *clip_path_owner.StyleRef().ClipPath(); + if (const auto* shape = DynamicTo<ShapeClipPathOperation>(clip_path)) { + Path path = + GetPathWithObjectZoom(*shape, reference_box, reference_box_object); + if (!clip_offset.IsZero()) { + path = PathBuilder(path).Translate(clip_offset).Finalize(); + } + return path; + } + if (const auto* geometry_box_clip = DynamicTo<GeometryBoxClipPathOperation>(clip_path)) { auto box = RoundedReferenceBox(geometry_box_clip->GetGeometryBox(), @@ -562,38 +571,31 @@ return box.GetPath(); } - if (const auto* reference_clip = - DynamicTo<ReferenceClipPathOperation>(clip_path)) { - if (reference_clip->IsLoading()) { - return Path(); - } - LayoutSVGResourceClipper* resource_clipper = - ResolveElementReference(clip_path_owner, *reference_clip); - if (!resource_clipper) - return std::nullopt; - std::optional<Path> path = resource_clipper->AsPath(); - if (!path) - return path; - - const auto clip_transform = - AffineTransform::Translation(clip_offset.x(), clip_offset.y()) * - MaskToContentTransform(*resource_clipper, reference_box, - reference_box_object); - if (!clip_transform.IsIdentity()) { - path = PathBuilder(*path).Transform(clip_transform).Finalize(); - } - + const auto& reference_clip = To<ReferenceClipPathOperation>(clip_path); + if (reference_clip.IsLoading()) { + return Path(); + } + LayoutSVGResourceClipper* resource_clipper = + ResolveElementReference(clip_path_owner, reference_clip); + if (!resource_clipper) { + return std::nullopt; + } + // If the current clip-path gets clipped itself, we have to fallback to + // masking. + if (resource_clipper->StyleRef().HasClipPath()) { + return std::nullopt; + } + std::optional<Path> path = resource_clipper->AsPath(); + if (!path) { return path; } - - DCHECK_EQ(clip_path.GetType(), ClipPathOperation::kShape); - const auto& shape = To<ShapeClipPathOperation>(clip_path); - Path path = GetPathWithObjectZoom(shape, reference_box, reference_box_object); - - if (!clip_offset.IsZero()) { - path = PathBuilder(path).Translate(clip_offset).Finalize(); + const auto clip_transform = + AffineTransform::Translation(clip_offset.x(), clip_offset.y()) * + MaskToContentTransform(*resource_clipper, reference_box, + reference_box_object); + if (!clip_transform.IsIdentity()) { + path = PathBuilder(*path).Transform(clip_transform).Finalize(); } - return path; }
diff --git a/third_party/blink/renderer/core/probe/core_probes.pidl b/third_party/blink/renderer/core/probe/core_probes.pidl index d5ebdfe..ef981c9 100644 --- a/third_party/blink/renderer/core/probe/core_probes.pidl +++ b/third_party/blink/renderer/core/probe/core_probes.pidl
@@ -121,7 +121,7 @@ void DidReceiveScriptResponse(ExecutionContext*, uint64_t identifier); void DomContentLoadedEventFired([Keep] LocalFrame*); void LoadEventFired([Keep] LocalFrame*); - void FrameAttachedToParent([Keep] LocalFrame*, const std::optional<AdScriptIdentifier>& ad_script_on_stack); + void FrameAttachedToParent([Keep] LocalFrame*, const Vector<AdScriptIdentifier>& ad_script_ancestry); void FrameDetachedFromParent([Keep] LocalFrame*, FrameDetachType); void FrameSubtreeWillBeDetached(LocalFrame*, Frame*); void DidStartProvisionalLoad([Keep] LocalFrame*);
diff --git a/third_party/blink/renderer/core/style/computed_style.h b/third_party/blink/renderer/core/style/computed_style.h index 5140527..b84a159 100644 --- a/third_party/blink/renderer/core/style/computed_style.h +++ b/third_party/blink/renderer/core/style/computed_style.h
@@ -1892,6 +1892,10 @@ return ScrollsOverflowX() || ScrollsOverflowY(); } + // Returns true if the element is HTML inert, or if 'interactivity' computes + // to 'inert'. + bool IsInert() const { return IsHTMLInert() || IsCSSInert(); } + // Visibility utility functions. bool VisibleToHitTesting() const { return Visibility() == EVisibility::kVisible &&
diff --git a/third_party/blink/renderer/core/style/computed_style_extra_fields.json5 b/third_party/blink/renderer/core/style/computed_style_extra_fields.json5 index 40e4cae..e239f46 100644 --- a/third_party/blink/renderer/core/style/computed_style_extra_fields.json5 +++ b/third_party/blink/renderer/core/style/computed_style_extra_fields.json5
@@ -1213,7 +1213,18 @@ }, { // https://html.spec.whatwg.org/multipage/interaction.html#inert - name: "IsInert", + name: "IsHTMLInert", + inherited: true, + independent: true, + field_template: "primitive", + type_name: "bool", + default_value: "false", + }, + { + // https://drafts.csswg.org/css-ui-4/#inertness + // Bit that is set for interactivity:inert and is never reset in the + // subtree even if the interactivity is set back to auto. + name: "IsCSSInert", inherited: true, independent: true, field_template: "primitive",
diff --git a/third_party/blink/renderer/core/svg/svg_circle_element.cc b/third_party/blink/renderer/core/svg/svg_circle_element.cc index 17eb44de..4344b10 100644 --- a/third_party/blink/renderer/core/svg/svg_circle_element.cc +++ b/third_party/blink/renderer/core/svg/svg_circle_element.cc
@@ -89,11 +89,6 @@ SVGGeometryElement::SvgAttributeChanged(params); } -bool SVGCircleElement::SelfHasRelativeLengths() const { - return cx_->CurrentValue()->IsRelative() || - cy_->CurrentValue()->IsRelative() || r_->CurrentValue()->IsRelative(); -} - LayoutObject* SVGCircleElement::CreateLayoutObject(const ComputedStyle&) { return MakeGarbageCollected<LayoutSVGEllipse>(this); }
diff --git a/third_party/blink/renderer/core/svg/svg_circle_element.h b/third_party/blink/renderer/core/svg/svg_circle_element.h index c0f01cfd..4dbdf9e 100644 --- a/third_party/blink/renderer/core/svg/svg_circle_element.h +++ b/third_party/blink/renderer/core/svg/svg_circle_element.h
@@ -46,8 +46,6 @@ private: void SvgAttributeChanged(const SvgAttributeChangedParams&) override; - bool SelfHasRelativeLengths() const override; - LayoutObject* CreateLayoutObject(const ComputedStyle&) override; SVGAnimatedPropertyBase* PropertyFromAttribute(
diff --git a/third_party/blink/renderer/core/svg/svg_ellipse_element.cc b/third_party/blink/renderer/core/svg/svg_ellipse_element.cc index 414610f4..9258833 100644 --- a/third_party/blink/renderer/core/svg/svg_ellipse_element.cc +++ b/third_party/blink/renderer/core/svg/svg_ellipse_element.cc
@@ -102,12 +102,6 @@ SVGGeometryElement::SvgAttributeChanged(params); } -bool SVGEllipseElement::SelfHasRelativeLengths() const { - return cx_->CurrentValue()->IsRelative() || - cy_->CurrentValue()->IsRelative() || - rx_->CurrentValue()->IsRelative() || ry_->CurrentValue()->IsRelative(); -} - LayoutObject* SVGEllipseElement::CreateLayoutObject(const ComputedStyle&) { return MakeGarbageCollected<LayoutSVGEllipse>(this); }
diff --git a/third_party/blink/renderer/core/svg/svg_ellipse_element.h b/third_party/blink/renderer/core/svg/svg_ellipse_element.h index 38a0651..8bddb2da 100644 --- a/third_party/blink/renderer/core/svg/svg_ellipse_element.h +++ b/third_party/blink/renderer/core/svg/svg_ellipse_element.h
@@ -47,8 +47,6 @@ private: void SvgAttributeChanged(const SvgAttributeChangedParams&) override; - bool SelfHasRelativeLengths() const override; - LayoutObject* CreateLayoutObject(const ComputedStyle&) override; SVGAnimatedPropertyBase* PropertyFromAttribute(
diff --git a/third_party/blink/renderer/core/svg/svg_line_element.cc b/third_party/blink/renderer/core/svg/svg_line_element.cc index e6363328..2be05728 100644 --- a/third_party/blink/renderer/core/svg/svg_line_element.cc +++ b/third_party/blink/renderer/core/svg/svg_line_element.cc
@@ -78,6 +78,12 @@ return builder; } +bool SVGLineElement::PathDependsOnViewport() const { + return x1_->CurrentValue()->IsRelative() || + y1_->CurrentValue()->IsRelative() || + x2_->CurrentValue()->IsRelative() || y2_->CurrentValue()->IsRelative(); +} + void SVGLineElement::SvgAttributeChanged( const SvgAttributeChangedParams& params) { const QualifiedName& attr_name = params.name; @@ -90,12 +96,6 @@ SVGGeometryElement::SvgAttributeChanged(params); } -bool SVGLineElement::SelfHasRelativeLengths() const { - return x1_->CurrentValue()->IsRelative() || - y1_->CurrentValue()->IsRelative() || - x2_->CurrentValue()->IsRelative() || y2_->CurrentValue()->IsRelative(); -} - SVGAnimatedPropertyBase* SVGLineElement::PropertyFromAttribute( const QualifiedName& attribute_name) const { if (attribute_name == svg_names::kX1Attr) {
diff --git a/third_party/blink/renderer/core/svg/svg_line_element.h b/third_party/blink/renderer/core/svg/svg_line_element.h index 061414d..e9a4e7b 100644 --- a/third_party/blink/renderer/core/svg/svg_line_element.h +++ b/third_party/blink/renderer/core/svg/svg_line_element.h
@@ -36,6 +36,7 @@ Path AsPath() const override; PathBuilder AsMutablePath() const override; + bool PathDependsOnViewport() const; SVGAnimatedLength* x1() const { return x1_.Get(); } SVGAnimatedLength* y1() const { return y1_.Get(); } @@ -47,8 +48,6 @@ private: void SvgAttributeChanged(const SvgAttributeChangedParams&) override; - bool SelfHasRelativeLengths() const override; - SVGAnimatedPropertyBase* PropertyFromAttribute( const QualifiedName& attribute_name) const override; void SynchronizeAllSVGAttributes() const override;
diff --git a/third_party/blink/renderer/core/svg/svg_rect_element.cc b/third_party/blink/renderer/core/svg/svg_rect_element.cc index 34295b9..04bfb52 100644 --- a/third_party/blink/renderer/core/svg/svg_rect_element.cc +++ b/third_party/blink/renderer/core/svg/svg_rect_element.cc
@@ -134,13 +134,6 @@ SVGGeometryElement::SvgAttributeChanged(params); } -bool SVGRectElement::SelfHasRelativeLengths() const { - return x_->CurrentValue()->IsRelative() || y_->CurrentValue()->IsRelative() || - width_->CurrentValue()->IsRelative() || - height_->CurrentValue()->IsRelative() || - rx_->CurrentValue()->IsRelative() || ry_->CurrentValue()->IsRelative(); -} - LayoutObject* SVGRectElement::CreateLayoutObject(const ComputedStyle&) { return MakeGarbageCollected<LayoutSVGRect>(this); }
diff --git a/third_party/blink/renderer/core/svg/svg_rect_element.h b/third_party/blink/renderer/core/svg/svg_rect_element.h index 9c517f6..2f7c14f 100644 --- a/third_party/blink/renderer/core/svg/svg_rect_element.h +++ b/third_party/blink/renderer/core/svg/svg_rect_element.h
@@ -49,8 +49,6 @@ private: void SvgAttributeChanged(const SvgAttributeChangedParams&) override; - bool SelfHasRelativeLengths() const override; - LayoutObject* CreateLayoutObject(const ComputedStyle&) override; SVGAnimatedPropertyBase* PropertyFromAttribute(
diff --git a/third_party/blink/renderer/core/view_transition/view_transition.cc b/third_party/blink/renderer/core/view_transition/view_transition.cc index 5c7658e..223810b 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition.cc
@@ -1053,4 +1053,38 @@ return pending_dom_callback_; } +void ViewTransition::RecalcTransitionPseudoTreeStyle() const { + Element* scope = Scope(); + if (!scope) { + scope = document_->documentElement(); + } + if (!scope || !scope->InActiveDocument()) { + return; + } + + if (style_tracker_) { + scope->RecalcTransitionPseudoTreeStyle( + style_tracker_->GetViewTransitionNames()); + } else { + scope->RecalcTransitionPseudoTreeStyle({}); + } +} + +void ViewTransition::RebuildTransitionPseudoLayoutTree() const { + Element* scope = Scope(); + if (!scope) { + scope = document_->documentElement(); + } + if (!scope || !scope->InActiveDocument()) { + return; + } + + if (style_tracker_) { + scope->RebuildTransitionPseudoLayoutTree( + style_tracker_->GetViewTransitionNames()); + } else { + scope->RebuildTransitionPseudoLayoutTree({}); + } +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/view_transition/view_transition.h b/third_party/blink/renderer/core/view_transition/view_transition.h index 3c7d3c46..ca5c340 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition.h +++ b/third_party/blink/renderer/core/view_transition/view_transition.h
@@ -203,6 +203,10 @@ style_tracker_->IsTransitionElement(*document_->documentElement()); } + void RecalcTransitionPseudoTreeStyle() const; + + void RebuildTransitionPseudoLayoutTree() const; + // In physical pixels. See comments on equivalent methods in // ViewTransitionStyleTracker for info. gfx::Size GetSnapshotRootSize() const;
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.cc b/third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.cc index 67b682c9..75e6548 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.cc
@@ -81,4 +81,9 @@ return style_tracker_.Get() == tracker; } +const Vector<AtomicString>& +ViewTransitionPseudoElementBase::GetViewTransitionNames() const { + return style_tracker_->GetViewTransitionNames(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.h b/third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.h index ce88885..2b0ca44 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.h +++ b/third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.h
@@ -35,6 +35,8 @@ // `tracker`. bool IsBoundTo(const blink::ViewTransitionStyleTracker* tracker) const; + const Vector<AtomicString>& GetViewTransitionNames() const; + protected: Vector<AtomicString> view_transition_class_; Member<const ViewTransitionStyleTracker> style_tracker_;
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.cc b/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.cc index da21f31da..e5eae7f 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.cc
@@ -591,7 +591,7 @@ if (RuntimeEnabledFeatures::SerializeViewTransitionStateInSPAEnabled()) { InvalidateHitTestingCache(); InvalidateStyle(); - document_->GetStyleEngine().SetViewTransitionNames({}); + view_transition_names_.clear(); } } @@ -997,9 +997,7 @@ } #endif - // This informs the style engine the set of names we have, which will be used - // to create the pseudo element tree. - document_->GetStyleEngine().SetViewTransitionNames(transition_names); + view_transition_names_ = std::move(transition_names); // We need a style invalidation to generate the pseudo element tree. InvalidateStyle(); @@ -1149,7 +1147,7 @@ // If this tracker was created from serialized state, transition tags are // initialized with the style system in the start phase. if (deserialized_) { - DCHECK(document_->GetStyleEngine().ViewTransitionTags().empty()); + DCHECK(GetViewTransitionNames().empty()); found_new_names = true; } @@ -1232,7 +1230,7 @@ } #endif - document_->GetStyleEngine().SetViewTransitionNames(new_names); + view_transition_names_ = std::move(new_names); } DCHECK_GE(document_->Lifecycle().GetState(), @@ -1280,7 +1278,7 @@ element_data_map_.clear(); pending_transition_element_names_.clear(); set_element_sequence_id_ = 0; - document_->GetStyleEngine().SetViewTransitionNames({}); + view_transition_names_.clear(); is_root_transitioning_ = false; if (auto* page = document_->GetPage()) page->Animator().SetHasViewTransition(false);
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.h b/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.h index 6faadbf..9e352e9 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.h +++ b/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.h
@@ -222,6 +222,10 @@ const Vector<AtomicString>& GetViewTransitionClassList( const AtomicString& name) const; + const Vector<AtomicString>& GetViewTransitionNames() const { + return view_transition_names_; + } + // This returns the resolved containing group name for a given view transition // name. Note that this only works once the transition starts. AtomicString GetContainingGroupName(const AtomicString& name) const; @@ -450,6 +454,8 @@ base::Token token_; HashMap<AtomicString, AtomicString> id_to_auto_name_map_; + + Vector<AtomicString> view_transition_names_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_utils.cc b/third_party/blink/renderer/core/view_transition/view_transition_utils.cc index 52c3c8c..18a0b05 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_utils.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition_utils.cc
@@ -6,6 +6,8 @@ #include "third_party/blink/renderer/core/css/style_engine.h" #include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/dom/element.h" +#include "third_party/blink/renderer/core/dom/node.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" @@ -29,7 +31,8 @@ func(transition_pseudo); for (const auto& view_transition_name : - element.GetDocument().GetStyleEngine().ViewTransitionTags()) { + To<ViewTransitionPseudoElementBase>(transition_pseudo) + ->GetViewTransitionNames()) { auto* container_pseudo = To<ViewTransitionTransitionElement>(transition_pseudo) ->FindViewTransitionGroupPseudoElement(view_transition_name); @@ -71,7 +74,8 @@ } for (const auto& view_transition_name : - element.GetDocument().GetStyleEngine().ViewTransitionTags()) { + To<ViewTransitionPseudoElementBase>(transition_pseudo) + ->GetViewTransitionNames()) { auto* container_pseudo = To<ViewTransitionTransitionElement>(transition_pseudo) ->FindViewTransitionGroupPseudoElement(view_transition_name); @@ -123,8 +127,8 @@ switch (element->GetPseudoId()) { case kPseudoIdViewTransition: - for (auto name : - element->GetDocument().GetStyleEngine().ViewTransitionTags()) { + for (auto name : To<ViewTransitionPseudoElementBase>(element) + ->GetViewTransitionNames()) { if (auto* pseudo = element->GetPseudoElement(kPseudoIdViewTransitionGroup, name)) { func(pseudo); @@ -182,6 +186,13 @@ return transition; } +ViewTransition* ViewTransitionUtils::GetTransition(const Node& node) { + if (node.IsElementNode()) { + return GetTransition(To<Element>(node)); + } + return GetTransition(node.GetDocument()); +} + ViewTransition* ViewTransitionUtils::TransitionForTaggedElement( const LayoutObject& layout_object) { ViewTransition* result = nullptr;
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_utils.h b/third_party/blink/renderer/core/view_transition/view_transition_utils.h index 2327bbd..3b424ff 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_utils.h +++ b/third_party/blink/renderer/core/view_transition/view_transition_utils.h
@@ -16,6 +16,7 @@ class Document; class Element; class LayoutObject; +class Node; class PseudoElement; class ViewTransition; @@ -34,6 +35,8 @@ static ViewTransition* GetTransition(const Element& element); + static ViewTransition* GetTransition(const Node& node); + // Returns the view transition that the element associated with the specified // layout object is participating in, if one exists. static ViewTransition* TransitionForTaggedElement(const LayoutObject&);
diff --git a/third_party/blink/renderer/core/workers/worker_global_scope.h b/third_party/blink/renderer/core/workers/worker_global_scope.h index b7be9512..7b78c6c 100644 --- a/third_party/blink/renderer/core/workers/worker_global_scope.h +++ b/third_party/blink/renderer/core/workers/worker_global_scope.h
@@ -104,7 +104,6 @@ void Dispose() override; WorkerThread* GetThread() const final { return thread_; } const base::UnguessableToken& GetDevToolsToken() const override; - bool IsInitialized() const final { return !url_.IsNull(); } CodeCacheHost* GetCodeCacheHost() override; std::optional<mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>> FindRaceNetworkRequestURLLoaderFactory(
diff --git a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h index fe373a20..746b4d8b 100644 --- a/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h +++ b/third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h
@@ -171,10 +171,6 @@ virtual int GetOutstandingThrottledLimit() const; - // TODO(crbug.com/1146824): Remove this once PlzDedicatedWorker and - // PlzServiceWorker ship. - virtual bool IsInitialized() const = 0; - // TODO(crbug/964467): Currently all workers fetch cached code but only // services workers use them. Dedicated / Shared workers don't use the cached // code since we don't create a CachedMetadataHandler. We need to fix this by
diff --git a/third_party/blink/renderer/core/workers/worklet_global_scope.h b/third_party/blink/renderer/core/workers/worklet_global_scope.h index 3c9fe245..de5cda86 100644 --- a/third_party/blink/renderer/core/workers/worklet_global_scope.h +++ b/third_party/blink/renderer/core/workers/worklet_global_scope.h
@@ -77,7 +77,6 @@ void Dispose() override; WorkerThread* GetThread() const final; const base::UnguessableToken& GetDevToolsToken() const override; - bool IsInitialized() const final { return true; } CodeCacheHost* GetCodeCacheHost() override; std::optional<mojo::PendingRemote<network::mojom::blink::URLLoaderFactory>> FindRaceNetworkRequestURLLoaderFactory(
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc index 1ce1059..752882c 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -3969,7 +3969,7 @@ if (ignored_reasons) { if (!RuntimeEnabledFeatures::CSSInertEnabled()) { // With CSSInert disabled, the inert attribute causes the style to be - // IsInert. With CSSInert enabled, the inert attribute instead has + // IsHTMLInert. With CSSInert enabled, the inert attribute instead has // a UA style rule that sets the interactivity property, which // cascades along interactivity declarations from other sources, so it // does not make sense to look for InertRoot() separately. The @@ -3986,8 +3986,7 @@ return true; } } - if (style->IsInert() && - style->Interactivity() == EInteractivity::kAuto) { + if (style->IsHTMLInert()) { // HTML inertness is either forced by a modal dialog or a fullscreen // element (see AdjustStyleForInert). Document& document = GetNode()->GetDocument();
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_test.cc b/third_party/blink/renderer/modules/accessibility/ax_object_test.cc index 38007dc..faec884 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_test.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_test.cc
@@ -1649,66 +1649,66 @@ dialog1->showModal(exception_state); AssertInertReasons(body, kAXActiveModalDialog); - AssertInertReasons(div1, kAXInertStyle); - AssertInertReasons(div1_text, kAXInertStyle); + AssertInertReasons(div1, kAXActiveModalDialog); + AssertInertReasons(div1_text, kAXActiveModalDialog); AssertNotInert(dialog1); AssertNotInert(dialog1_text); AssertInertReasons(dialog2, kAXActiveModalDialog); AssertInertReasons(dialog2_text, kAXActiveModalDialog); AssertInertReasons(p1, kAXActiveModalDialog); AssertInertReasons(p1_text, kAXActiveModalDialog); - AssertInertReasons(p2, kAXInertStyle); - AssertInertReasons(p2_text, kAXInertStyle); + AssertInertReasons(p2, kAXActiveModalDialog); + AssertInertReasons(p2_text, kAXActiveModalDialog); dialog2->showModal(exception_state); AssertInertReasons(body, kAXActiveModalDialog); - AssertInertReasons(div1, kAXInertStyle); - AssertInertReasons(div1_text, kAXInertStyle); + AssertInertReasons(div1, kAXActiveModalDialog); + AssertInertReasons(div1_text, kAXActiveModalDialog); AssertInertReasons(dialog1, kAXActiveModalDialog); AssertInertReasons(dialog1_text, kAXActiveModalDialog); AssertInertReasons(dialog2, kAXInertStyle); AssertInertReasons(dialog2_text, kAXInertStyle); AssertInertReasons(p1, kAXActiveModalDialog); AssertInertReasons(p1_text, kAXActiveModalDialog); - AssertInertReasons(p2, kAXInertStyle); - AssertInertReasons(p2_text, kAXInertStyle); + AssertInertReasons(p2, kAXActiveModalDialog); + AssertInertReasons(p2_text, kAXActiveModalDialog); EnterFullscreen(p1); AssertInertReasons(body, kAXActiveModalDialog); - AssertInertReasons(div1, kAXInertStyle); - AssertInertReasons(div1_text, kAXInertStyle); + AssertInertReasons(div1, kAXActiveModalDialog); + AssertInertReasons(div1_text, kAXActiveModalDialog); AssertInertReasons(dialog1, kAXActiveModalDialog); AssertInertReasons(dialog1_text, kAXActiveModalDialog); AssertInertReasons(dialog2, kAXInertStyle); AssertInertReasons(dialog2_text, kAXInertStyle); AssertInertReasons(p1, kAXActiveModalDialog); AssertInertReasons(p1_text, kAXActiveModalDialog); - AssertInertReasons(p2, kAXInertStyle); - AssertInertReasons(p2_text, kAXInertStyle); + AssertInertReasons(p2, kAXActiveModalDialog); + AssertInertReasons(p2_text, kAXActiveModalDialog); dialog1->close(); dialog2->close(); AssertInertReasons(body, kAXActiveFullscreenElement); - AssertInertReasons(div1, kAXInertStyle); - AssertInertReasons(div1_text, kAXInertStyle); + AssertInertReasons(div1, kAXActiveFullscreenElement); + AssertInertReasons(div1_text, kAXActiveFullscreenElement); AssertInertReasons(dialog1, kAXActiveFullscreenElement); AssertInertReasons(dialog1_text, kAXActiveFullscreenElement); AssertInertReasons(dialog2, kAXActiveFullscreenElement); AssertInertReasons(dialog2_text, kAXActiveFullscreenElement); AssertNotInert(p1); AssertNotInert(p1_text); - AssertInertReasons(p2, kAXInertStyle); - AssertInertReasons(p2_text, kAXInertStyle); + AssertInertReasons(p2, kAXActiveFullscreenElement); + AssertInertReasons(p2_text, kAXActiveFullscreenElement); ExitFullscreen(); EnterFullscreen(p2); AssertInertReasons(body, kAXActiveFullscreenElement); - AssertInertReasons(div1, kAXInertStyle); - AssertInertReasons(div1_text, kAXInertStyle); + AssertInertReasons(div1, kAXActiveFullscreenElement); + AssertInertReasons(div1_text, kAXActiveFullscreenElement); AssertInertReasons(dialog1, kAXActiveFullscreenElement); AssertInertReasons(dialog1_text, kAXActiveFullscreenElement); AssertInertReasons(dialog2, kAXActiveFullscreenElement);
diff --git a/third_party/blink/renderer/modules/ai/language_model.cc b/third_party/blink/renderer/modules/ai/language_model.cc index 91e7953..40e2954 100644 --- a/third_party/blink/renderer/modules/ai/language_model.cc +++ b/third_party/blink/renderer/modules/ai/language_model.cc
@@ -209,8 +209,7 @@ ToMojo(base::span<uint8_t> audio_bytes, ExecutionContext* execution_context) { // TODO(crbug.com/401010825): Use the file sample rate. scoped_refptr<AudioBus> bus = AudioBus::CreateBusFromInMemoryAudioFile( - audio_bytes.data(), audio_bytes.size(), - /*mix_to_mono=*/true, /*sample_rate=*/48000); + audio_bytes, /*mix_to_mono=*/true, /*sample_rate=*/48000); if (!bus) { // TODO(crbug.com/409615288): This should throw a TypeError according to the // spec.
diff --git a/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc b/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc index 15877bd..7e0d0ba 100644 --- a/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc +++ b/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
@@ -83,6 +83,40 @@ return ToEnclosingRect(visible_bounding_box); } +void ComputeScrollerInfo( + const LayoutObject& object, + mojom::blink::AIPageContentNodeInteractionInfo& interaction_info) { + if (!object.IsBoxModelObject()) { + return; + } + + auto* scrollable_area = To<LayoutBoxModelObject>(object).GetScrollableArea(); + if (!scrollable_area) { + return; + } + + const auto scrolling_bounds = scrollable_area->ContentsSize(); + const auto visible_area = scrollable_area->VisibleContentRect(); + + // If the visible area covers the scrollable area, scrolling this node will be + // a no-op. + if (scrolling_bounds == visible_area.size()) { + DCHECK_EQ(visible_area.x(), 0); + DCHECK_EQ(visible_area.y(), 0); + + return; + } + + auto scroller_info = mojom::blink::AIPageContentScrollerInfo::New(); + scroller_info->scrolling_bounds = scrolling_bounds; + scroller_info->visible_area = visible_area; + scroller_info->user_scrollable_horizontal = + scrollable_area->UserInputScrollable(kHorizontalScrollbar); + scroller_info->user_scrollable_vertical = + scrollable_area->UserInputScrollable(kVerticalScrollbar); + interaction_info.scroller_info = std::move(scroller_info); +} + // TODO(crbug.com/383128653): This is duplicating logic from // UnsupportedTagTypeValueForNode, consider reusing it. bool IsHeadingTag(const HTMLElement& element) { @@ -1251,58 +1285,62 @@ void AIPageContentAgent::ContentBuilder::AddNodeInteractionInfo( const LayoutObject& object, mojom::blink::AIPageContentAttributes& attributes) const { + auto node_interaction_info = + mojom::blink::AIPageContentNodeInteractionInfo::New(); + ComputeScrollerInfo(object, *node_interaction_info); + + // If experimental data is disabled, only scrollable nodes are included. if (!options_->enable_experimental_actionable_data) { + if (node_interaction_info->scroller_info) { + attributes.node_interaction_info = std::move(node_interaction_info); + } + return; } - mojom::blink::AIPageContentNodeInteractionInfo node_interaction_info; - const ComputedStyle& style = *object.Style(); - node_interaction_info.scrolls_overflow_x = style.ScrollsOverflowX(); - node_interaction_info.scrolls_overflow_y = style.ScrollsOverflowY(); - - node_interaction_info.is_selectable = + node_interaction_info->is_selectable = style.UsedUserSelect() != EUserSelect::kNone; if (auto* node = object.GetNode()) { - node_interaction_info.is_editable = IsEditable(*node); + node_interaction_info->is_editable = IsEditable(*node); } if (auto* box = DynamicTo<LayoutBox>(object)) { if (box->CanResize()) { EResize resize = style.UsedResize(); - node_interaction_info.can_resize_vertical = + node_interaction_info->can_resize_vertical = resize == EResize::kVertical || resize == EResize::kBoth; - node_interaction_info.can_resize_horizontal = + node_interaction_info->can_resize_horizontal = resize == EResize::kHorizontal || resize == EResize::kBoth; } } if (auto* element = DynamicTo<HTMLElement>(object.GetNode())) { - node_interaction_info.is_focusable = element->IsFocusable(); - node_interaction_info.is_draggable = element->draggable(); - node_interaction_info.is_clickable = element->IsMaybeClickable(); + node_interaction_info->is_focusable = element->IsFocusable(); + node_interaction_info->is_draggable = element->draggable(); + node_interaction_info->is_clickable = element->IsMaybeClickable(); } const bool needs_interaction_info = - node_interaction_info.scrolls_overflow_x || - node_interaction_info.scrolls_overflow_y || + node_interaction_info->scroller_info || // The common case is for the content to be selectable. So assume that's // the default and only force a ContentNode if we need to indicate some // content is not selectable. - !node_interaction_info.is_selectable || - node_interaction_info.is_editable || - node_interaction_info.can_resize_horizontal || - node_interaction_info.can_resize_vertical || - node_interaction_info.is_focusable || - node_interaction_info.is_draggable || node_interaction_info.is_clickable; + !node_interaction_info->is_selectable || + node_interaction_info->is_editable || + node_interaction_info->can_resize_horizontal || + node_interaction_info->can_resize_vertical || + node_interaction_info->is_focusable || + node_interaction_info->is_draggable || + node_interaction_info->is_clickable; - if (needs_interaction_info) { - attributes.node_interaction_info = - mojom::blink::AIPageContentNodeInteractionInfo::New(); - *attributes.node_interaction_info = node_interaction_info; - AddForDomNodeId(object, *attributes.node_interaction_info); + if (!needs_interaction_info) { + return; } + + attributes.node_interaction_info = std::move(node_interaction_info); + AddForDomNodeId(object, *attributes.node_interaction_info); } } // namespace blink
diff --git a/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc b/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc index 916b8d4a..fc1e1a07 100644 --- a/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc +++ b/third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc
@@ -1163,125 +1163,169 @@ "This element flows naturally with the document."); } -TEST_F(AIPageContentAgentTest, ScrollContainer) { +TEST_F(AIPageContentAgentTest, RootScroller) { frame_test_helpers::LoadHTMLString( helper_.LocalMainFrame(), - " <body>" - " <style>" - " .scrollable-x {" - " width: 100px;" - " height: 50px;" - " overflow-x: scroll;" - " overflow-y: clip;" - " }" - " .scrollable-y {" - " width: 300px;" - " height: 50px;" - " overflow-x: clip;" - " overflow-y: scroll;" - " }" - " .auto-scroll-x {" - " width: 100px;" - " height: 50px;" - " overflow-x: auto;" - " overflow-y: clip;" - " }" - " .auto-scroll-y {" - " width: 300px;" - " height: 50px;" - " overflow-x: clip;" - " overflow-y: auto;" - " }" - " .normal {" - " width: 250px;" - " height: 80px;" - " margin-top: 20px;" - " }" - " </style>" - " <div " - "class='scrollable-x'>" - "ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVW" - "XYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRST" - "UVWXYZ</div>" - " <div class='scrollable-y'>Some long text to make it scrollable. " - "Some long text to make it scrollable. Some long text to make it " - "scrollable. Some long text to make it scrollable.</div>" - " <div " - "class='auto-scroll-x'>" - "ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVW" - "XYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRST" - "UVWXYZ</div>" - " <div class='auto-scroll-y'>Some long text to make it scrollable. " - "Some long text to make it scrollable. Some long text to make it " - "scrollable. Some long text to make it scrollable.</div>" - " </body>", + R"HTML( + <body style='margin: 0px;'> + <div style='width: 200vw; height: 300vh; background: grey;'></div> + <script> + document.scrollingElement.scrollTop=100; + document.scrollingElement.scrollLeft=200; + </script> + </body> + )HTML", url_test_helpers::ToKURL("http://foobar.com")); - auto content = GetAIPageContentWithActionableElements(); - ASSERT_TRUE(content); + auto content = GetAIPageContent(); ASSERT_TRUE(content->root_node); const auto& root = *content->root_node; - ASSERT_EQ(root.children_nodes.size(), 4u); + ASSERT_TRUE(root.content_attributes->node_interaction_info); + ASSERT_TRUE(root.content_attributes->node_interaction_info->scroller_info); - EXPECT_TRUE( - root.content_attributes->node_interaction_info->scrolls_overflow_x); - EXPECT_TRUE( - root.content_attributes->node_interaction_info->scrolls_overflow_y); + const auto& root_scroller = + *root.content_attributes->node_interaction_info->scroller_info; + EXPECT_EQ(root_scroller.scrolling_bounds.width(), 2 * kWindowSize.width()); + EXPECT_EQ(root_scroller.scrolling_bounds.height(), 3 * kWindowSize.height()); - const auto& scrollable_x_element = *root.children_nodes[0]; - CheckContainerNode(scrollable_x_element); - EXPECT_FALSE(scrollable_x_element.content_attributes->geometry - ->is_fixed_or_sticky_position); - EXPECT_TRUE(scrollable_x_element.content_attributes->node_interaction_info - ->scrolls_overflow_x); - EXPECT_FALSE(scrollable_x_element.content_attributes->node_interaction_info - ->scrolls_overflow_y); - CheckTextNode( - *scrollable_x_element.children_nodes[0], - "ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVW" - "XYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRST" - "UVWXYZ"); + EXPECT_EQ(root_scroller.visible_area, + gfx::Rect(200, 100, kWindowSize.width(), kWindowSize.height())); +} - const auto& scrollable_y_element = *root.children_nodes[1]; - CheckContainerNode(scrollable_y_element); - EXPECT_FALSE(scrollable_y_element.content_attributes->geometry - ->is_fixed_or_sticky_position); - EXPECT_FALSE(scrollable_y_element.content_attributes->node_interaction_info - ->scrolls_overflow_x); - EXPECT_TRUE(scrollable_y_element.content_attributes->node_interaction_info - ->scrolls_overflow_y); - CheckTextNode(*scrollable_y_element.children_nodes[0], - "Some long text to make it scrollable. Some long text to make " - "it scrollable. Some long text to make it scrollable. Some " - "long text to make it scrollable."); +class AIPageContentAgentTestWithSubScroller + : public AIPageContentAgentTest, + public testing::WithParamInterface<std::string> {}; - const auto& auto_scroll_x_element = *root.children_nodes[2]; - CheckContainerNode(auto_scroll_x_element); - EXPECT_FALSE(auto_scroll_x_element.content_attributes->geometry - ->is_fixed_or_sticky_position); - EXPECT_TRUE(auto_scroll_x_element.content_attributes->node_interaction_info - ->scrolls_overflow_x); - EXPECT_FALSE(auto_scroll_x_element.content_attributes->node_interaction_info - ->scrolls_overflow_y); - CheckTextNode( - *auto_scroll_x_element.children_nodes[0], - "ABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVW" - "XYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRSTUVWXYZABCDEFGHIJKLMOPQRST" - "UVWXYZ"); +TEST_P(AIPageContentAgentTestWithSubScroller, Overflow) { + frame_test_helpers::LoadHTMLString( + helper_.LocalMainFrame(), + base::StringPrintf( + R"HTML( + <body style='margin: 0px;'> + <style> + #scroller { + overflow:%s; width: 100vw; height:100vh; + position:relative; top: 30px; left:50px; + } + </style> + <div id='scroller'> + <div style='width: 200vw; height: 300vh; background: grey;'></div> + </div> + <script> + let scroller = document.getElementById('scroller'); + scroller.scrollTop=100; + scroller.scrollLeft=200; + </script> + </body> + )HTML", + GetParam()), + url_test_helpers::ToKURL("http://foobar.com")); - const auto& auto_scroll_y_element = *root.children_nodes[3]; - CheckContainerNode(auto_scroll_y_element); - EXPECT_FALSE(auto_scroll_y_element.content_attributes->geometry - ->is_fixed_or_sticky_position); - EXPECT_FALSE(auto_scroll_y_element.content_attributes->node_interaction_info - ->scrolls_overflow_x); - EXPECT_TRUE(auto_scroll_y_element.content_attributes->node_interaction_info - ->scrolls_overflow_y); - CheckTextNode(*auto_scroll_y_element.children_nodes[0], - "Some long text to make it scrollable. Some long text to make " - "it scrollable. Some long text to make it scrollable. Some " - "long text to make it scrollable."); + SCOPED_TRACE(GetParam()); + auto content = GetAIPageContent(); + ASSERT_TRUE(content->root_node); + + const auto& root = *content->root_node; + ASSERT_TRUE(root.content_attributes->node_interaction_info); + ASSERT_TRUE(root.content_attributes->node_interaction_info->scroller_info); + + const auto& root_scroller = + *root.content_attributes->node_interaction_info->scroller_info; + EXPECT_EQ(root_scroller.scrolling_bounds.width(), kWindowSize.width() + 50); + EXPECT_EQ(root_scroller.scrolling_bounds.height(), kWindowSize.height() + 30); + EXPECT_EQ(root_scroller.visible_area, gfx::Rect(kWindowSize)); + + ASSERT_EQ(root.children_nodes.size(), 1u); + const auto& child = *root.children_nodes.at(0); + ASSERT_TRUE(child.content_attributes->node_interaction_info); + ASSERT_TRUE(child.content_attributes->node_interaction_info->scroller_info); + + const auto& sub_scroller = + *child.content_attributes->node_interaction_info->scroller_info; + EXPECT_EQ(sub_scroller.scrolling_bounds.width(), 2 * kWindowSize.width()); + EXPECT_EQ(sub_scroller.scrolling_bounds.height(), 3 * kWindowSize.height()); + + EXPECT_EQ(sub_scroller.visible_area, + gfx::Rect(200, 100, kWindowSize.width(), kWindowSize.height())); + + bool user_scrollable = GetParam() != "hidden"; + EXPECT_EQ(sub_scroller.user_scrollable_horizontal, user_scrollable); + EXPECT_EQ(sub_scroller.user_scrollable_vertical, user_scrollable); +} + +INSTANTIATE_TEST_SUITE_P(AIPageContentAgentTestWithSubScroller, + AIPageContentAgentTestWithSubScroller, + ::testing::Values("auto", "scroll", "hidden")); + +TEST_F(AIPageContentAgentTest, OverflowVisible) { + frame_test_helpers::LoadHTMLString( + helper_.LocalMainFrame(), + R"HTML( + <body style='margin: 0px;'> + <style> + #scroller { + overflow:visible; width: 100vw; height:100vh; + position:relative; top: 30px; left:50px; + } + </style> + <div id='scroller'> + <div style='width: 200vw; height: 300vh; background: grey;'></div> + </div> + </body> + )HTML", + url_test_helpers::ToKURL("http://foobar.com")); + + auto content = GetAIPageContent(); + ASSERT_TRUE(content->root_node); + + const auto& root = *content->root_node; + ASSERT_TRUE(root.content_attributes->node_interaction_info); + ASSERT_TRUE(root.content_attributes->node_interaction_info->scroller_info); + + const auto& root_scroller = + *root.content_attributes->node_interaction_info->scroller_info; + EXPECT_EQ(root_scroller.scrolling_bounds.width(), + kWindowSize.width() * 2 + 50); + EXPECT_EQ(root_scroller.scrolling_bounds.height(), + kWindowSize.height() * 3 + 30); + EXPECT_EQ(root_scroller.visible_area, gfx::Rect(kWindowSize)); + + EXPECT_EQ(root.children_nodes.size(), 0u); +} + +TEST_F(AIPageContentAgentTest, OverflowClip) { + frame_test_helpers::LoadHTMLString( + helper_.LocalMainFrame(), + R"HTML( + <body style='margin: 0px;'> + <style> + #scroller { + overflow:clip; width: 100vw; height:100vh; + position:relative; top: 30px; left:50px; + } + </style> + <div id='scroller'> + <div style='width: 200vw; height: 300vh; background: grey;'></div> + </div> + </body> + )HTML", + url_test_helpers::ToKURL("http://foobar.com")); + + auto content = GetAIPageContent(); + ASSERT_TRUE(content->root_node); + + const auto& root = *content->root_node; + ASSERT_TRUE(root.content_attributes->node_interaction_info); + ASSERT_TRUE(root.content_attributes->node_interaction_info->scroller_info); + + const auto& root_scroller = + *root.content_attributes->node_interaction_info->scroller_info; + EXPECT_EQ(root_scroller.scrolling_bounds.width(), kWindowSize.width() + 50); + EXPECT_EQ(root_scroller.scrolling_bounds.height(), kWindowSize.height() + 30); + EXPECT_EQ(root_scroller.visible_area, gfx::Rect(kWindowSize)); + + EXPECT_EQ(root.children_nodes.size(), 0u); } TEST_F(AIPageContentAgentTest, Anchors) { @@ -2127,6 +2171,8 @@ const auto& resize = *content->root_node->children_nodes[0]; CheckContainerNode(resize); + ASSERT_TRUE(resize.content_attributes->node_interaction_info); + EXPECT_FALSE(resize.content_attributes->node_interaction_info->scroller_info); EXPECT_TRUE(resize.content_attributes->node_interaction_info->is_selectable); EXPECT_FALSE(resize.content_attributes->node_interaction_info->is_editable); EXPECT_FALSE(resize.content_attributes->node_interaction_info->is_focusable); @@ -2137,27 +2183,10 @@ EXPECT_TRUE( resize.content_attributes->node_interaction_info->can_resize_horizontal); - EXPECT_EQ(resize.children_nodes.size(), 1u); + ASSERT_EQ(resize.children_nodes.size(), 1u); const auto& resize_text = *resize.children_nodes[0]; CheckTextNode(resize_text, "resize"); - EXPECT_TRUE( - resize_text.content_attributes->node_interaction_info->is_selectable); - EXPECT_FALSE( - resize_text.content_attributes->node_interaction_info->is_editable); - EXPECT_FALSE( - resize_text.content_attributes->node_interaction_info->is_focusable); - EXPECT_FALSE( - resize_text.content_attributes->node_interaction_info->is_draggable); - EXPECT_FALSE( - resize_text.content_attributes->node_interaction_info->is_clickable); - EXPECT_FALSE(resize_text.content_attributes->node_interaction_info - ->can_resize_vertical); - EXPECT_FALSE(resize_text.content_attributes->node_interaction_info - ->can_resize_horizontal); - EXPECT_TRUE(resize_text.content_attributes->node_interaction_info - ->scrolls_overflow_x); - EXPECT_TRUE(resize_text.content_attributes->node_interaction_info - ->scrolls_overflow_y); + EXPECT_FALSE(resize_text.content_attributes->node_interaction_info); } TEST_F(AIPageContentAgentTest, Selection) {
diff --git a/third_party/blink/renderer/modules/imagecapture/image_capture.cc b/third_party/blink/renderer/modules/imagecapture/image_capture.cc index 1406061..7f71201 100644 --- a/third_party/blink/renderer/modules/imagecapture/image_capture.cc +++ b/third_party/blink/renderer/modules/imagecapture/image_capture.cc
@@ -1909,14 +1909,21 @@ void ImageCapture::SetVideoTrackDeviceSettingsFromTrack( base::OnceClosure initialized_callback, media::mojom::blink::PhotoStatePtr photo_state) { - UpdateMediaTrackSettingsAndCapabilities(base::DoNothing(), - std::move(photo_state)); - auto* video_track = MediaStreamVideoTrack::From(stream_track_->Component()); DCHECK(video_track); const auto& device_settings = video_track->image_capture_device_settings(); + if (device_settings && + device_settings->expose_pan_tilt_zoom_support.has_value() && + !*device_settings->expose_pan_tilt_zoom_support) { + pan_tilt_zoom_permission_ = mojom::blink::PermissionStatus::ASK; + permission_observer_receiver_.reset(); + } + + UpdateMediaTrackSettingsAndCapabilities(base::DoNothing(), + std::move(photo_state)); + if (device_settings) { ExecutionContext* context = GetExecutionContext(); if (device_settings->exposure_compensation.has_value()) { @@ -2159,13 +2166,15 @@ context, permission_service_.BindNewPipeAndPassReceiver( context->GetTaskRunner(TaskType::kMiscPlatformAPI))); - mojo::PendingRemote<mojom::blink::PermissionObserver> observer; - permission_observer_receiver_.Bind( - observer.InitWithNewPipeAndPassReceiver(), - context->GetTaskRunner(TaskType::kMiscPlatformAPI)); - permission_service_->AddPermissionObserver( - CreateVideoCapturePermissionDescriptor(/*pan_tilt_zoom=*/true), - pan_tilt_zoom_permission_, std::move(observer)); + if (pan_tilt_zoom_allowed) { + mojo::PendingRemote<mojom::blink::PermissionObserver> observer; + permission_observer_receiver_.Bind( + observer.InitWithNewPipeAndPassReceiver(), + context->GetTaskRunner(TaskType::kMiscPlatformAPI)); + permission_service_->AddPermissionObserver( + CreateVideoCapturePermissionDescriptor(/*pan_tilt_zoom=*/true), + pan_tilt_zoom_permission_, std::move(observer)); + } } // TODO(crbug.com/708723): Integrate image capture constraints processing with
diff --git a/third_party/blink/renderer/modules/webaudio/async_audio_decoder.cc b/third_party/blink/renderer/modules/webaudio/async_audio_decoder.cc index ee99ffbb..4ea99223 100644 --- a/third_party/blink/renderer/modules/webaudio/async_audio_decoder.cc +++ b/third_party/blink/renderer/modules/webaudio/async_audio_decoder.cc
@@ -85,8 +85,7 @@ const ExceptionContext& exception_context) { DCHECK(!IsMainThread()); scoped_refptr<AudioBus> bus = AudioBus::CreateBusFromInMemoryAudioFile( - audio_data_contents.Data(), audio_data_contents.DataLength(), false, - sample_rate); + audio_data_contents.ByteSpan(), false, sample_rate); // A reference to `bus` is retained by base::OnceCallback and will be removed // after `NotifyComplete()` is done.
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.cc index e35e4d1..0eb2440 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.cc
@@ -76,8 +76,6 @@ v8::MicrotasksScope microtasks_scope( isolate, ToMicrotaskQueue(script_state), v8::MicrotasksScope::kDoNotRunMicrotasks); - AudioWorkletProcessorDefinition* definition = - global_scope_->FindDefinition(Name()); // 1st JS arg `inputs_`. Compare `inputs` and `inputs_`. Then allocates the // data container if necessary. @@ -148,14 +146,25 @@ TRACE_EVENT0( TRACE_DISABLED_BY_DEFAULT("audio-worklet"), "AudioWorkletProcessor::Process (author script execution)"); - auto* process_function = definition->ProcessFunction(); - if (!process_function) { + + v8::Local<v8::Value> processor_v8 = + ToV8Traits<AudioWorkletProcessor>::ToV8(script_state, this); + v8::Local<v8::Value> process_v8_value; + if (!processor_v8.As<v8::Object>() + ->Get(context, V8AtomicString(isolate, "process")) + .ToLocal(&process_v8_value) || + !process_v8_value->IsFunction()) { SetErrorState( AudioWorkletProcessorErrorState::kProcessMethodUndefinedError); return false; } - - if (!process_function + if (!cached_process_callback_ || + cached_process_callback_->CallbackObject() != process_v8_value) + [[unlikely]] { + cached_process_callback_ = V8BlinkAudioWorkletProcessCallback::Create( + process_v8_value.As<v8::Function>()); + } + if (!cached_process_callback_ ->Invoke(this, ScriptValue(isolate, inputs_.Get(isolate)), ScriptValue(isolate, outputs_.Get(isolate)), ScriptValue(isolate, params_.Get(isolate))) @@ -194,6 +203,7 @@ void AudioWorkletProcessor::Trace(Visitor* visitor) const { visitor->Trace(global_scope_); visitor->Trace(processor_port_); + visitor->Trace(cached_process_callback_); visitor->Trace(inputs_); visitor->Trace(outputs_); visitor->Trace(params_);
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.h b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.h index 2a1156f..840c3fa 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.h +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.h
@@ -23,6 +23,7 @@ class AudioWorkletProcessorDefinition; class MessagePort; class ExecutionContext; +class V8BlinkAudioWorkletProcessCallback; // AudioWorkletProcessor class represents the active instance created from // AudioWorkletProcessorDefinition. AudioWorkletNodeHandler invokes `.process()` @@ -139,6 +140,7 @@ Member<AudioWorkletGlobalScope> global_scope_; Member<MessagePort> processor_port_; + Member<V8BlinkAudioWorkletProcessCallback> cached_process_callback_; const String name_;
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.cc b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.cc index 2b54c20..0b0f8b59 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.cc
@@ -52,35 +52,8 @@ return nullptr; } -V8BlinkAudioWorkletProcessCallback* -AudioWorkletProcessorDefinition::ProcessFunction() { - if (!process_function_) { - v8::Isolate* isolate = constructor_->GetIsolate(); - ExceptionState exception_state(isolate); - - CallbackMethodRetriever retriever(constructor_); - retriever.GetPrototypeObject(exception_state); - if (exception_state.HadException()) { - return nullptr; - } - - v8::Local<v8::Value> v8_value = - retriever.GetMethodOrUndefined("process", exception_state); - if (exception_state.HadException() || v8_value->IsUndefined()) { - return nullptr; - } - - CHECK(v8_value->IsFunction()); - process_function_ = - V8BlinkAudioWorkletProcessCallback::Create(v8_value.As<v8::Function>()); - } - - return process_function_; -} - void AudioWorkletProcessorDefinition::Trace(Visitor* visitor) const { visitor->Trace(constructor_); - visitor->Trace(process_function_); visitor->Trace(audio_param_descriptors_); }
diff --git a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h index 2e30211..f368087 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h +++ b/third_party/blink/renderer/modules/webaudio/audio_worklet_processor_definition.h
@@ -15,7 +15,6 @@ namespace blink { -class V8BlinkAudioWorkletProcessCallback; class V8BlinkAudioWorkletProcessorConstructor; // Represents a JavaScript class definition registered in the @@ -42,7 +41,6 @@ V8BlinkAudioWorkletProcessorConstructor* ConstructorFunction() const { return constructor_.Get(); } - V8BlinkAudioWorkletProcessCallback* ProcessFunction(); void SetAudioParamDescriptors( const HeapVector<Member<AudioParamDescriptor>>&); @@ -67,7 +65,6 @@ // The definition is per global scope. The active instance of // AudioProcessorWorklet should be passed into these to perform JS function. Member<V8BlinkAudioWorkletProcessorConstructor> constructor_; - Member<V8BlinkAudioWorkletProcessCallback> process_function_; HeapVector<Member<AudioParamDescriptor>> audio_param_descriptors_; };
diff --git a/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.cc b/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.cc index fbee7333..dc1b514 100644 --- a/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.cc +++ b/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.cc
@@ -50,7 +50,8 @@ MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode( AudioContext& context, uint32_t number_of_channels) - : AudioNode(context) { + : AudioNode(context), + ActiveScriptWrappable<MediaStreamAudioDestinationNode>({}) { DVLOG(1) << "Creating WebAudio media stream source."; auto audio_source = std::make_unique<WebAudioMediaStreamSource>( context.GetExecutionContext()->GetTaskRunner(TaskType::kInternalMedia)); @@ -135,6 +136,10 @@ return node; } +bool MediaStreamAudioDestinationNode::HasPendingActivity() const { + return context()->ContextState() == V8AudioContextState::Enum::kRunning; +} + void MediaStreamAudioDestinationNode::Trace(Visitor* visitor) const { visitor->Trace(stream_); visitor->Trace(source_);
diff --git a/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.h b/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.h index 300e981..4a2b948 100644 --- a/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.h +++ b/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.h
@@ -42,7 +42,9 @@ // MediaStreamAudioDestinationNode is an AudioNode that represents an endpoint // in the Web Audio graph and also functions as an audio stream source for // MediaStream ecosystem. (e.g., WebRTC, MediaRecorder) -class MODULES_EXPORT MediaStreamAudioDestinationNode final : public AudioNode { +class MODULES_EXPORT MediaStreamAudioDestinationNode final + : public AudioNode, + public ActiveScriptWrappable<MediaStreamAudioDestinationNode> { DEFINE_WRAPPERTYPEINFO(); USING_PRE_FINALIZER(MediaStreamAudioDestinationNode, Dispose); @@ -59,6 +61,7 @@ MediaStream* stream() const { return stream_.Get(); } MediaStreamSource* source() const { return source_.Get(); } + bool HasPendingActivity() const final; void Trace(Visitor*) const final; void Dispose();
diff --git a/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.idl b/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.idl index 833a9b4..981688bc 100644 --- a/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.idl +++ b/third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.idl
@@ -25,6 +25,7 @@ // https://webaudio.github.io/web-audio-api/#mediastreamaudiodestinationnode [ + ActiveScriptWrappable, Exposed=Window ] interface MediaStreamAudioDestinationNode : AudioNode { [RaisesException, Measure] constructor(AudioContext context, optional AudioNodeOptions options = {});
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index d419aae..6718aad4a 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -138,6 +138,7 @@ "text/character_property.h", "text/character_property_data.h", "text/character_property_data_generator.cc", + "text/east_asian_spacing_type.h", "text/han_kerning_char_type.h", "wtf/text/character_names.h", "wtf/text/wtf_uchar.h", @@ -1484,6 +1485,7 @@ "text/date_time_format.cc", "text/date_time_format.h", "text/decode_escape_sequences.h", + "text/east_asian_spacing_type.h", "text/emoji_segmentation_category.h", "text/emoji_segmentation_category_inline_header.h", "text/han_kerning_char_type.h",
diff --git a/third_party/blink/renderer/platform/audio/audio_bus.cc b/third_party/blink/renderer/platform/audio/audio_bus.cc index 87edd3a0..abf5abe 100644 --- a/third_party/blink/renderer/platform/audio/audio_bus.cc +++ b/third_party/blink/renderer/platform/audio/audio_bus.cc
@@ -705,9 +705,10 @@ } } -scoped_refptr<AudioBus> DecodeAudioFileData(const char* data, size_t size) { +scoped_refptr<AudioBus> DecodeAudioFileData(base::span<const char> data) { WebAudioBus web_audio_bus; - if (Platform::Current()->DecodeAudioFileData(&web_audio_bus, data, size)) { + if (Platform::Current()->DecodeAudioFileData(&web_audio_bus, data.data(), + data.size())) { return web_audio_bus.Release(); } return nullptr; @@ -726,8 +727,7 @@ // to take WebData and use segmented access. SegmentedBuffer::DeprecatedFlatData flat_data( resource.operator scoped_refptr<SharedBuffer>().get()); - scoped_refptr<AudioBus> audio_bus = - DecodeAudioFileData(flat_data.data(), flat_data.size()); + scoped_refptr<AudioBus> audio_bus = DecodeAudioFileData(flat_data); if (!audio_bus.get()) { return nullptr; @@ -743,12 +743,10 @@ } scoped_refptr<AudioBus> AudioBus::CreateBusFromInMemoryAudioFile( - const void* data, - size_t data_size, + base::span<const uint8_t> data, bool mix_to_mono, float sample_rate) { - scoped_refptr<AudioBus> audio_bus = - DecodeAudioFileData(static_cast<const char*>(data), data_size); + scoped_refptr<AudioBus> audio_bus = DecodeAudioFileData(base::as_chars(data)); if (!audio_bus.get()) { return nullptr; }
diff --git a/third_party/blink/renderer/platform/audio/audio_bus.h b/third_party/blink/renderer/platform/audio/audio_bus.h index bfc6432..d749e61c 100644 --- a/third_party/blink/renderer/platform/audio/audio_bus.h +++ b/third_party/blink/renderer/platform/audio/audio_bus.h
@@ -29,6 +29,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_AUDIO_AUDIO_BUS_H_ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_AUDIO_AUDIO_BUS_H_ +#include "base/containers/span.h" #include "third_party/blink/renderer/platform/audio/audio_channel.h" #include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" @@ -75,8 +76,7 @@ // doesn't already match the file's sample-rate). The created buffer will // have its sample-rate set correctly to the result. static scoped_refptr<AudioBus> CreateBusFromInMemoryAudioFile( - const void* data, - size_t data_size, + base::span<const uint8_t> data, bool mix_to_mono, float sample_rate);
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index e72e626..47330ddb 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -734,6 +734,12 @@ status: "test", }, { + // https://github.com/WICG/canvas-place-element/blob/main/README.md + name: "CanvasElementDrawImage", + status: "experimental", + implied_by: ["CanvasPlaceElement"], + }, + { name: "CanvasFloatingPoint", status: "stable", }, @@ -4459,7 +4465,7 @@ }, { name: "SvgTransformOnNestedSvgElement", - status: "experimental", + status: "stable", }, { name: "SynthesizedKeyboardEventsForAccessibilityActions",
diff --git a/third_party/blink/renderer/platform/text/character.cc b/third_party/blink/renderer/platform/text/character.cc index c65cc3f..021ef7d 100644 --- a/third_party/blink/renderer/platform/text/character.cc +++ b/third_party/blink/renderer/platform/text/character.cc
@@ -107,12 +107,20 @@ return GetProperty(character, CharacterProperty::kIsHangul); } +// static HanKerningCharType Character::GetHanKerningCharType(UChar32 character) { return static_cast<HanKerningCharType>( GetProperty(character, CharacterProperty::kHanKerningShiftedMask) >> static_cast<unsigned>(CharacterProperty::kHanKerningShift)); } +// static +EastAsianSpacingType Character::GetEastAsianSpacingType(UChar32 character) { + return static_cast<EastAsianSpacingType>( + GetProperty(character, CharacterProperty::kEastAsianSpacingShiftedMask) >> + static_cast<unsigned>(CharacterProperty::kEastAsianSpacingShift)); +} + bool Character::MaybeHanKerningOpenSlow(UChar32 ch) { // See `HanKerning::GetCharType`. const HanKerningCharType type = Character::GetHanKerningCharType(ch);
diff --git a/third_party/blink/renderer/platform/text/character.h b/third_party/blink/renderer/platform/text/character.h index 4a693c7..240a825a 100644 --- a/third_party/blink/renderer/platform/text/character.h +++ b/third_party/blink/renderer/platform/text/character.h
@@ -38,6 +38,7 @@ #include "base/gtest_prod_util.h" #include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/text/character_property.h" +#include "third_party/blink/renderer/platform/text/east_asian_spacing_type.h" #include "third_party/blink/renderer/platform/text/han_kerning_char_type.h" #include "third_party/blink/renderer/platform/text/text_direction.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -126,6 +127,7 @@ static bool MaybeBidiRtl(const String&); static HanKerningCharType GetHanKerningCharType(UChar32 character); + static EastAsianSpacingType GetEastAsianSpacingType(UChar32 character); // Check the `HanKerningCharType` of a character without knowing the font. // It depends on fonts, so it may not be `kOpen` or `kClose` even when this // function returns `true`. See `HanKerning::GetCharType`.
diff --git a/third_party/blink/renderer/platform/text/character_property.h b/third_party/blink/renderer/platform/text/character_property.h index 567768f..085c1f7 100644 --- a/third_party/blink/renderer/platform/text/character_property.h +++ b/third_party/blink/renderer/platform/text/character_property.h
@@ -9,8 +9,11 @@ namespace blink { -using CharacterPropertyType = uint8_t; +using CharacterPropertyType = uint16_t; +// TODO(lingqi): Some values are never used. e.g., a char that is Hangul should +// always be kIsCJKIdeographOrSymbol, os 0b1000 is never used. Attempt to +// compress the Property. enum class CharacterProperty : CharacterPropertyType { kIsCJKIdeographOrSymbol = 1 << 0, kIsPotentialCustomElementNameChar = 1 << 1, @@ -23,8 +26,14 @@ kHanKerningMask = ((1 << kHanKerningSize) - 1), kHanKerningShiftedMask = kHanKerningMask << kHanKerningShift, - kNumBits = kHanKerningShift + kHanKerningSize, + // Bits to store `EastAsianSpacingType`. + kEastAsianSpacingShift = 8, + kEastAsianSpacingSize = 2, + kEastAsianSpacingShiftedMask = ((1 << kEastAsianSpacingSize) - 1) + << kEastAsianSpacingShift, + kNumBits = kEastAsianSpacingShift + kEastAsianSpacingSize, }; + static_assert(static_cast<unsigned>(CharacterProperty::kNumBits) <= sizeof(CharacterPropertyType) * 8);
diff --git a/third_party/blink/renderer/platform/text/character_property_data_generator.cc b/third_party/blink/renderer/platform/text/character_property_data_generator.cc index a4278b0..ec4b09cb 100644 --- a/third_party/blink/renderer/platform/text/character_property_data_generator.cc +++ b/third_party/blink/renderer/platform/text/character_property_data_generator.cc
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/platform/text/character_property_data.h" - #include <stdio.h> #include <unicode/brkiter.h> #include <unicode/locid.h> @@ -26,6 +24,8 @@ #include "base/containers/heap_array.h" #include "base/containers/span.h" #include "third_party/blink/renderer/platform/text/character_property.h" +#include "third_party/blink/renderer/platform/text/character_property_data.h" +#include "third_party/blink/renderer/platform/text/east_asian_spacing_type.h" #include "third_party/blink/renderer/platform/text/han_kerning_char_type.h" #include "third_party/blink/renderer/platform/wtf/text/character_names.h" @@ -101,6 +101,7 @@ SetForRanges(kIsHangulRanges, std::size(kIsHangulRanges), CharacterProperty::kIsHangul); SetHanKerning(); + SetEastAsianSpacing(); } // Set all characters that have the `UCHAR_EMOJI_PRESENTATION` property as CJK @@ -136,6 +137,117 @@ HanKerningCharType::kCloseNarrow); } + void SetEastAsianSpacing() { + // Set based on https://www.unicode.org/reports/tr59/#data. + UErrorCode error = U_ZERO_ERROR; + + icu::UnicodeSet unassigned(icu::UnicodeString("[:General_Category=Cn:]"), + error); + CHECK_EQ(error, U_ZERO_ERROR); + + // 1. Set for the "Wide" property + // + // 1.1 Include if the Script property is one of the following values: + // Bopomofo (Bopo) Han (Hani) Hangul (Hang) Hiragana (Hira) Katakana (Kana) + // Khitan_Small_Script (Kits) Nushu (Nshu) Tangut (Tang) Yi (Yiii) + icu::UnicodeSet ideographs( + icu::UnicodeString( + "[[:sc=Bopomofo:][:sc=Han:][:sc=Hangul:][:sc=Hiragana:][:sc=" + "Katakana:][:sc=Khitan_Small_Script:][:sc=Nushu:][:sc=Tangut:][:sc=" + "Yi:]]"), + error); + CHECK_EQ(error, U_ZERO_ERROR); + + { + // 1.2. Include if the Script_Extensions property is one of the values + // above, except when the East_Asian_Width property is “Neutral (N)” or + // “Narrow (Na)”. + icu::UnicodeSet temp_set( + icu::UnicodeString( + "[[[:scx=Bopo:][:scx=Hani:][:scx=Hang:][:scx=Hira:][" + ":scx=Kana:][:scx=Kits:][:scx=Nshu:][:scx=Tang:][:" + "scx=Yiii:]]-[:East_Asian_Width=Narrow:]-[:East_" + "Asian_Width=Neutral:]]"), + error); + CHECK_EQ(error, U_ZERO_ERROR); + ideographs.addAll(temp_set); + } + { + // 1.3 Exclude if the East_Asian_Width property is “East Asian Halfwidth + // (H)”. + // 1.4 Exclude if the General_Category property is “Punctuation (P)” or + // “Other_Number (No)”. + // 1.5 Exclude if the General_Category property is “Symbol (S)” except + // “Modifier_Symbol (Sk)”. + icu::UnicodeSet temp_set( + icu::UnicodeString( + "[[:East_Asian_Width=H:][:General_Category=P:][:" + "General_Category=No:]" + "[[:General_Category=S:]-[:General_Category=Sk:]]]"), + error); + CHECK_EQ(error, U_ZERO_ERROR); + ideographs.removeAll(temp_set); + } + // 1.6 Include the following code point: U+3013 GETA MARK + ideographs.add(0x3013); + ideographs.removeAll(unassigned); + SetForUnicodeSet(ideographs, + ToCharacterProperty(EastAsianSpacingType::kWide), + CharacterProperty::kEastAsianSpacingShiftedMask); + + // 2. Set for the Conditional property + // + // 2.1 Include if the General_Category property is “Other_Punctuation (Po)”. + // 2.2 Exclude if the East_Asian_Width property is “East Asian Fullwidth + // (F)”, “East Asian Halfwidth (H)”, or “East Asian Wide (W)”. + icu::UnicodeSet conditional( + icu::UnicodeString("[[:General_Category=Po:]-[:East_Asian_Width=F:]-[:" + "East_Asian_Width=H:]-[:East_Asian_Width=W:]]"), + error); + CHECK_EQ(error, U_ZERO_ERROR); + // 2.3 Exclude the following code points: U+0022 QUOTATION MARK U+0027 + // APOSTROPHE U+002A ASTERISK U+002F SOLIDUS U+00B7 MIDDLE DOT U+2020 DAGGER + // U+2021 DOUBLE DAGGER U+2026 HORIZONTAL ELLIPSIS + conditional.remove(0x0022); // QUOTATION MARK + conditional.remove(0x0027); // APOSTROPHE + conditional.remove(0x002A); // ASTERISK + conditional.remove(0x002F); // SOLIDUS + conditional.remove(0x00B7); // MIDDLE DOT + conditional.remove(0x2020); // DAGGER + conditional.remove(0x2021); // DOUBLE DAGGER + conditional.remove(0x2026); // HORIZONTAL ELLIPSIS + + conditional.removeAll(unassigned); + SetForUnicodeSet(conditional, + ToCharacterProperty(EastAsianSpacingType::kConditional), + CharacterProperty::kEastAsianSpacingShiftedMask); + + // 3. Set for the Narrow property + // 3.1 Include if the General_Category property is “Letter (L)”, “Mark (M)”, + // or “Decimal_Number (Nd)”. + // 3.2 xclude if the East_Asian_Width property is “East Asian Fullwidth + // (F)", “East Asian Halfwidth (H)”, or “East Asian Wide (W)”. + icu::UnicodeSet narrow( + icu::UnicodeString( + "[[:General_Category=Letter:][:General_Category=M:][:" + "General_Category=Nd:]-[:East_Asian_Width=F:]-[:" + "East_Asian_Width=H:]-[:East_Asian_Width=W:]]"), + error); + CHECK_EQ(error, U_ZERO_ERROR); + // The intersection set of kWide and kConditional is not empty, so remove + // the chars which have been assigned the kWide property from narrow. + narrow.removeAll(ideographs); + + // The remaining assigned codes are kOther. + icu::UnicodeSet all(0, kMaxCodepoint); + all.removeAll(unassigned); + all.removeAll(narrow); + all.removeAll(ideographs); + all.removeAll(conditional); + SetForUnicodeSet(all, ToCharacterProperty(EastAsianSpacingType::kOther), + CharacterProperty::kEastAsianSpacingShiftedMask); + } + static CharacterProperty ToCharacterProperty(HanKerningCharType value) { CHECK_EQ((static_cast<unsigned>(value) & ~static_cast<unsigned>(CharacterProperty::kHanKerningMask)), @@ -144,6 +256,25 @@ static_cast<unsigned>(value) << static_cast<unsigned>(CharacterProperty::kHanKerningShift)); } + static CharacterProperty ToCharacterProperty(EastAsianSpacingType value) { + return static_cast<CharacterProperty>( + static_cast<unsigned>(value) + << static_cast<unsigned>(CharacterProperty::kEastAsianSpacingShift)); + } + + void SetForUnicodeSet(const icu::UnicodeSet& unicode_set, + CharacterProperty value, + CharacterProperty mask) { + const int32_t range_count = unicode_set.getRangeCount(); + for (int32_t i = 0; i < range_count; ++i) { + const UChar32 end = unicode_set.getRangeEnd(i); + CHECK_LE(end, kMaxCodepoint); + for (UChar32 ch = unicode_set.getRangeStart(i); ch <= end; ++ch) { + CHECK_EQ(static_cast<unsigned>(values_[ch] & mask), 0u) << ch; + values_[ch] |= value; + } + } + } void SetForUnicodePattern(const char* pattern, HanKerningCharType type) { SetForUnicodePattern(pattern, ToCharacterProperty(type), @@ -162,15 +293,7 @@ UErrorCode error = U_ZERO_ERROR; icu::UnicodeSet set(icu::UnicodeString(pattern), error); CHECK_EQ(error, U_ZERO_ERROR); - const int32_t range_count = set.getRangeCount(); - for (int32_t i = 0; i < range_count; ++i) { - const UChar32 end = set.getRangeEnd(i); - CHECK_LE(end, kMaxCodepoint); - for (UChar32 ch = set.getRangeStart(i); ch <= end; ++ch) { - CHECK_EQ(static_cast<unsigned>(values_[ch] & mask), 0u); - values_[ch] |= value; - } - } + SetForUnicodeSet(set, value, mask); } void SetForRanges(const UChar32* ranges,
diff --git a/third_party/blink/renderer/platform/text/character_test.cc b/third_party/blink/renderer/platform/text/character_test.cc index 9208a40..620d872 100644 --- a/third_party/blink/renderer/platform/text/character_test.cc +++ b/third_party/blink/renderer/platform/text/character_test.cc
@@ -5,7 +5,10 @@ #include "third_party/blink/renderer/platform/text/character.h" #include <ubidi_props.h> +#include <unicode/uscript.h> +#include <unicode/utypes.h> +#include "base/containers/contains.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/platform/text/emoji_segmentation_category.h" #include "third_party/blink/renderer/platform/text/emoji_segmentation_category_inline_header.h" @@ -564,4 +567,170 @@ EXPECT_FALSE(Character::IsIdeographicVariationSequence(0x0041, 0xe0100)); } +// The test data are sampled from the ground truth. +TEST(CharacterTest, TestEastAsianSpacingPropertySampling) { + // MICRO SIGN + EXPECT_EQ(Character::GetEastAsianSpacingType(0x00B5), + EastAsianSpacingType::kNarrow); + // WAVY DASH + EXPECT_EQ(Character::GetEastAsianSpacingType(0x3030), + EastAsianSpacingType::kOther); + // KAWI DANDA + EXPECT_EQ(Character::GetEastAsianSpacingType(0x11F43), + EastAsianSpacingType::kConditional); + // KATAKANA LETTER SMALL KO + EXPECT_EQ(Character::GetEastAsianSpacingType(0x1B155), + EastAsianSpacingType::kWide); +} + +namespace { + +// https://www.unicode.org/reports/tr59/#UTR59-D2. +static std::vector<UScriptCode> east_asian_script_codes{ + USCRIPT_BOPOMOFO, USCRIPT_HAN, USCRIPT_HANGUL, + USCRIPT_HIRAGANA, USCRIPT_KATAKANA, USCRIPT_KHITAN_SMALL_SCRIPT, + USCRIPT_NUSHU, USCRIPT_TANGUT, USCRIPT_YI}; + +// returns true if the script code is in the above list. +bool IsEastAsianScript(const UScriptCode& script_code) { + return base::Contains(east_asian_script_codes, script_code); +} + +// returns true if any of script_extension is in the above list. +bool HasEastAsianScriptExtention( + const std::vector<UScriptCode>& script_extension) { + for (const UScriptCode& east_asian_script_extension_code : + east_asian_script_codes) { + if (base::Contains(script_extension, east_asian_script_extension_code)) { + return true; + } + } + return false; +} + +bool ShouldBeWidth(UChar32 test_char, + UScriptCode script_code, + UEastAsianWidth east_asian_width, + const std::vector<UScriptCode>& script_extension) { + // Include the following code point: U+3013 GETA MARK + if (test_char == 0x3013) { + return true; + } + // Exclude if the East_Asian_Width property is “East Asian Halfwidth (H)”. + if (east_asian_width == UEastAsianWidth::U_EA_HALFWIDTH) { + return false; + } + // Exclude if the General_Category property is “Punctuation (P)” or + // “Other_Number (No)”. + const uint32_t gc_mask = U_GET_GC_MASK(test_char); + if (gc_mask & U_GC_P_MASK) { + return false; + } + if (gc_mask & U_GC_NO_MASK) { + return false; + } + // Exclude if the General_Category property is “Symbol (S)” except + // “Modifier_Symbol (Sk)”. + if ((gc_mask & U_GC_S_MASK) && !(gc_mask & U_GC_SK_MASK)) { + return false; + } + // Include if the Script property is one of the East Asian scripts. + // Include if the Script_Extensions property is one of the East Asian scripts, + // except when the East_Asian_Width property is “Neutral (N)” or “Narrow + // (Na)”. + return IsEastAsianScript(script_code) || + (HasEastAsianScriptExtention(script_extension) && + east_asian_width != UEastAsianWidth::U_EA_NEUTRAL && + east_asian_width != UEastAsianWidth::U_EA_NARROW); +} + +bool ShouldBeConditional(UChar32 test_char, UEastAsianWidth east_asian_width) { + // Exclude the following code points: U+0022 QUOTATION MARK U+0027 APOSTROPHE + // U+002A ASTERISK U+002F SOLIDUS U+00B7 MIDDLE DOT U+2020 DAGGER U+2021 + // DOUBLE DAGGER U+2026 HORIZONTAL ELLIPSIS + static std::vector<UChar32> not_conditional{0x0022, 0x0027, 0x002A, 0x002F, + 0x00B7, 0x2020, 0x2021, 0x2026}; + if (base::Contains(not_conditional, test_char)) { + return false; + } + // Exclude if the East_Asian_Width property is “East Asian Fullwidth (F)”, + // “East Asian Halfwidth (H)”, or “East Asian Wide (W)”. + if (east_asian_width == UEastAsianWidth::U_EA_FULLWIDTH || + east_asian_width == UEastAsianWidth::U_EA_HALFWIDTH || + east_asian_width == UEastAsianWidth::U_EA_WIDE) { + return false; + } + // Include if the General_Category property is “Other_Punctuation (Po)”. + const uint32_t gc_mask = U_GET_GC_MASK(test_char); + return gc_mask & U_GC_PO_MASK; +} + +bool ShouldBeNarrow(UChar32 test_char, UEastAsianWidth east_asian_width) { + // Exclude if the East_Asian_Width property is “East Asian Fullwidth (F)”, + // “East Asian Halfwidth (H)”, or “East Asian Wide (W)”. + if (east_asian_width == UEastAsianWidth::U_EA_FULLWIDTH || + east_asian_width == UEastAsianWidth::U_EA_HALFWIDTH || + east_asian_width == UEastAsianWidth::U_EA_WIDE) { + return false; + } + const uint32_t gc_mask = U_GET_GC_MASK(test_char); + // Exclude if the East_Asian_Width property is “East Asian Fullwidth (F)", + // “East Asian Halfwidth (H)”, or “East Asian Wide (W)”. + return (gc_mask & U_GC_L_MASK) || (gc_mask & U_GC_M_MASK) || + (gc_mask & U_GC_ND_MASK); +} + +} // namespace + +// Check the property based on https://www.unicode.org/reports/tr59/#data. +TEST(CharacterTest, TestEastAsianSpacingPropertyRule) { + for (UChar32 test_char = 0; test_char < kMaxCodepoint; test_char++) { + if (U_GC_CN_MASK & U_GET_GC_MASK(test_char)) { + continue; + } + UErrorCode error_code = U_ZERO_ERROR; + UScriptCode script = uscript_getScript(test_char, &error_code); + ASSERT_TRUE(U_SUCCESS(error_code)); + std::vector<UScriptCode> script_list(32); + int32_t required_capacity = uscript_getScriptExtensions( + test_char, script_list.data(), script_list.size(), &error_code); + ASSERT_TRUE(U_SUCCESS(error_code)) + << error_code << "\t" << required_capacity; + UEastAsianWidth east_asian_width = Character::EastAsianWidth(test_char); + + switch (Character::GetEastAsianSpacingType(test_char)) { + case EastAsianSpacingType::kWide: + EXPECT_TRUE( + ShouldBeWidth(test_char, script, east_asian_width, script_list)) + << test_char << "should not be Wide"; + break; + case EastAsianSpacingType::kConditional: + EXPECT_FALSE( + ShouldBeWidth(test_char, script, east_asian_width, script_list)) + << test_char << "should not be wide"; + EXPECT_TRUE(ShouldBeConditional(test_char, east_asian_width)) + << test_char << "should be conditional"; + break; + case EastAsianSpacingType::kNarrow: + EXPECT_FALSE( + ShouldBeWidth(test_char, script, east_asian_width, script_list)) + << test_char << "should not be wide"; + EXPECT_FALSE(ShouldBeConditional(test_char, east_asian_width)) + << test_char << "should not be conditional"; + EXPECT_TRUE(ShouldBeNarrow(test_char, east_asian_width)) + << test_char << "should be narrow"; + break; + case EastAsianSpacingType::kOther: + ASSERT_FALSE( + ShouldBeWidth(test_char, script, east_asian_width, script_list)) + << test_char << "should not be wide"; + EXPECT_FALSE(ShouldBeConditional(test_char, east_asian_width)) + << test_char << "should not be conditional"; + EXPECT_FALSE(ShouldBeNarrow(test_char, east_asian_width)) + << test_char << "should be narrow"; + break; + } + } +} + } // namespace blink
diff --git a/third_party/blink/renderer/platform/text/east_asian_spacing_type.h b/third_party/blink/renderer/platform/text/east_asian_spacing_type.h new file mode 100644 index 0000000..eeba00b --- /dev/null +++ b/third_party/blink/renderer/platform/text/east_asian_spacing_type.h
@@ -0,0 +1,24 @@ +// Copyright 2025 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_EAST_ASIAN_SPACING_TYPE_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_EAST_ASIAN_SPACING_TYPE_H_ + +#include <stdint.h> + +namespace blink { + +// Represents the East Asian Spacing property, as defined in +// https://unicode.org/reports/tr59/. +enum class EastAsianSpacingType : uint16_t { + kNarrow, + kOther, + kConditional, + kWide, + // When adding values, ensure `CharacterProperty` has enough storage. +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_TEXT_EAST_ASIAN_SPACING_TYPE_H_
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 69828bc..dedcdcd 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -2636,8 +2636,6 @@ crbug.com/411574366 external/wpt/css/css-values/urls/referrer-policy/unsafe-url/url-image-referrerpolicy-cross-origin.sub.html [ Failure ] crbug.com/411574366 external/wpt/css/css-values/urls/referrer-policy/unsafe-url/url-image-referrerpolicy-same-origin.sub.html [ Failure ] crbug.com/411723253 [ Win10.20h2 ] external/wpt/speech-api/SpeechRecognition-installOnDevice.https.html [ Timeout ] -crbug.com/411723254 [ Win10.20h2 ] external/wpt/svg/coordinate-systems/viewBox-synthesized-in-img-001.tentative.html [ Crash Timeout ] -crbug.com/411723254 [ Linux ] external/wpt/svg/coordinate-systems/viewBox-synthesized-in-img-001.tentative.html [ Crash Timeout ] crbug.com/411576891 [ Linux ] external/wpt/webdriver/tests/classic/minimize_window/minimize.py [ Failure ] crbug.com/411723253 [ Win10.20h2 ] virtual/speech-with-unified-autoplay/external/wpt/speech-api/SpeechRecognition-installOnDevice.https.html [ Timeout ] crbug.com/409809138 [ Win11 ] external/wpt/custom-elements/revamped-scoped-registry/ShadowRoot-init-customElementRegistry.tentative.html [ Pass Timeout ] @@ -8961,9 +8959,6 @@ # Gardener 2025-02-04 crbug.com/389946963 [ Mac13 ] external/wpt/mediacapture-fromelement/capture.html [ Failure Pass ] -# Test failed on WebAudio that timeout occurs in the getter process() test. -crbug.com/395670634 external/wpt/webaudio/the-audio-api/the-audioworklet-interface/process-getter.https.html [ Timeout ] - # Test failed on WebAudio that timeout occurs in the 'Singleton AudioWorkletProcessor' test. crbug.com/40116479 external/wpt/webaudio/the-audio-api/the-audioworklet-interface/processor-construction-port.https.html [ Timeout ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 75c9daac..1977ed18 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -1476,7 +1476,7 @@ ], "args": [ "--enable-privacy-sandbox-ads-apis", - "--enable-features=FencedFramesDefaultMode,AggregationServiceMultipleCloudProviders:allowlist/https%3A%2F%2Fweb-platform.test%3A8444,FencedFramesEnforceFocus,PrivateAggregationApiContributionMerging,PrivateAggregationApiMaxContributions" + "--enable-features=FencedFramesDefaultMode,AggregationServiceMultipleCloudProviders:allowlist/https%3A%2F%2Fweb-platform.test%3A8444,FencedFramesEnforceFocus,PrivateAggregationApiContributionMerging,PrivateAggregationApiMaxContributions,PrivateAggregationApiErrorReporting" ], "owners": ["alexmt@chromium.org", "dmcardle@chromium.org"], "expires": "Jul 1, 2025" @@ -1495,7 +1495,7 @@ "args": [ "--enable-privacy-sandbox-ads-apis", "--private-aggregation-developer-mode", - "--enable-features=FencedFramesDefaultMode,AggregationServiceMultipleCloudProviders:allowlist/https%3A%2F%2Fweb-platform%2Etest%3A8444%2Chttps%3A%2F%2Fwww1%2Eweb-platform%2Etest%3A8444%2Chttps%3A%2F%2F127.0.0.1%3A8443,PrivateAggregationApiBundledEnhancements,PrivateAggregationApiMultipleCloudProviders,PrivateAggregationApiContributionMerging,PrivateAggregationApiMaxContributions,FencedFramesLocalUnpartitionedDataAccess,ExemptUrlFromNetworkRevocationForTesting" + "--enable-features=FencedFramesDefaultMode,AggregationServiceMultipleCloudProviders:allowlist/https%3A%2F%2Fweb-platform%2Etest%3A8444%2Chttps%3A%2F%2Fwww1%2Eweb-platform%2Etest%3A8444%2Chttps%3A%2F%2F127.0.0.1%3A8443,PrivateAggregationApiBundledEnhancements,PrivateAggregationApiMultipleCloudProviders,PrivateAggregationApiContributionMerging,PrivateAggregationApiMaxContributions,PrivateAggregationApiErrorReporting,FencedFramesLocalUnpartitionedDataAccess,ExemptUrlFromNetworkRevocationForTesting" ], "owners": ["alexmt@chromium.org", "dmcardle@chromium.org"], "expires": "Jul 1, 2025"
diff --git a/third_party/blink/web_tests/external/wpt/css/css-anchor-position/remove-position-try-rules-001.html b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/remove-position-try-rules-001.html new file mode 100644 index 0000000..56ad5cf --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-anchor-position/remove-position-try-rules-001.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<title>Remove current fallback @position-try rules</title> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://issues.chromium.org/issues/411170230"> +<style id="removeme"> + @position-try --pf1 { + left: auto; + right: anchor(left); + top: 200px; + } +</style> +<style id="removemetoo"> + @position-try --pf2 { + left: auto; + right: anchor(left); + top: 300px; + } +</style> +<style> + #anchor { + anchor-name: --a; + margin-left: 100px; + height: 100px; + background: hotpink; + } + #box { + position: absolute; + position-anchor: --a; + top: 100px; + left: anchor(right); + position-try-fallbacks: --pf1,--pf2; + width: 50px; + height: 50px; + background: cyan; + } +</style> +<div id="anchor"></div> +<div id="box"></div> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support/test-common.js"></script> +<script> +promise_test(async () => { + // The base style option doesn't fit. The two others do fit. + // Remove them one by one. + await waitUntilNextAnimationFrame(); + await waitUntilNextAnimationFrame(); + assert_equals(box.offsetTop, 200); + removeme.remove(); + await waitUntilNextAnimationFrame(); + await waitUntilNextAnimationFrame(); + assert_equals(box.offsetTop, 300); + removemetoo.remove(); + await waitUntilNextAnimationFrame(); + await waitUntilNextAnimationFrame(); + assert_equals(box.offsetTop, 100); +}, "Remove fallback rules"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-multicol/resize-multicol-with-fixed-size-children-002.html b/third_party/blink/web_tests/external/wpt/css/css-multicol/resize-multicol-with-fixed-size-children-002.html new file mode 100644 index 0000000..9a582bf --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-multicol/resize-multicol-with-fixed-size-children-002.html
@@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html class="reftest-wait"> + <link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> + <link rel="help" href="https://www.w3.org/TR/css-multicol-1/#columns"> + <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> + <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> + <div style="width:100px; height:100px; background:red;"> + <div id="multicol" style="columns:2; gap:0; column-fill:auto; width:60px; height:100px;"> + <div style="width:50px;"> + <div> + <div> + <div style="height:200px; background:green;"></div> + </div> + </div> + </div> + </div> + </div> + + <script> + requestAnimationFrame(()=> { + requestAnimationFrame(()=> { + multicol.style.width = "100px"; + document.documentElement.classList.remove("reftest-wait"); + }); + }); + </script> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-multicol/resize-multicol-with-fixed-size-children-003.html b/third_party/blink/web_tests/external/wpt/css/css-multicol/resize-multicol-with-fixed-size-children-003.html new file mode 100644 index 0000000..7e73c83 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-multicol/resize-multicol-with-fixed-size-children-003.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<title>Resize multicol with fixed-width child</title> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-multicol-1/#columns"> +<div id="multicol" style="position:relative; columns:2; column-fill:auto; gap:20px; width:220px; height:100px;"> + <div style="width:50px;"> + <div> + <div> + <div style="height:150px;"></div> + <div id="target"></div> + </div> + </div> + </div> +</div> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + test(() => { + document.body.offsetTop; + + // Increasing multicol width won't affect the layout of anything inside (the + // child has a fixed width), except for the columns themselves, which will + // become wider. + multicol.style.width = "320px"; + + // Check something in the second column. + assert_equals(target.offsetLeft, 170); + assert_equals(target.offsetTop, 50); + }, "Resize multicol with fixed-width child"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/interactivity-inert-animated.html b/third_party/blink/web_tests/external/wpt/css/css-ui/interactivity-inert-animated.html new file mode 100644 index 0000000..8fc86da --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/interactivity-inert-animated.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<title>CSS Basic User Interface Test: animated interactivity:auto should not block click events</title> +<link rel="help" href="https://drafts.csswg.org/css-ui-4/#inertness"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<style> + @keyframes --anim { + 0% { interactivity: auto; } + } + #inert { + animation: --anim 10000s step-end; + interactivity: inert; + width: 100px; + height: 100px; + background: lime; + } +</style> +<div id="inert"></div> +<script> + let clicked = false; + inert.addEventListener('click', () => clicked = true); + + promise_test(async () => { + await test_driver.click(inert); + assert_true(clicked); + }, "Click event should work for interactivity:auto animation"); + +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-values/minmax-length-serialize.html b/third_party/blink/web_tests/external/wpt/css/css-values/minmax-length-serialize.html index bd00ee05..1ab6f84 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-values/minmax-length-serialize.html +++ b/third_party/blink/web_tests/external/wpt/css/css-values/minmax-length-serialize.html
@@ -70,6 +70,12 @@ 'calc(2px + max(1em + 100px, 106px))', '118px'); +// https://crbug.com/411359798 +test_serialization( + 'calc(2 * (.2 * min(1em, 1px)) + 1px)', + 'calc(1px + (0.4 * min(1em, 1px)))', + '1.4px'); + // Can't test that min()/max() are preserved in computed values with just lengths; // see minmax-length-percentage-serialize for tests of that. </script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/scoped/capture.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/scoped/capture.html new file mode 100644 index 0000000..06f848d2 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/scoped/capture.html
@@ -0,0 +1,168 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <!-- TODO update link --> + <link rel="help" href="https://www.w3.org/TR/css-view-transitions-2/"> + <title>Scope view transition capture</title> +</head> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style type="text/css"> + .parent { + background-color: lightblue; + height: 200px; + width: 200px; + view-transition-name: parent; + position: relative; + } + + .child { + background-color: blue; + height: 100px; + width: 100px; + view-transition-name: child; + position: absolute; + left: 50px; + top: 50px; + } + + .sibling { + background-color: gray; + margin-top: 20px; + height: 200px; + width: 200px; + view-transition-name: sibling; + } + + /* view transition pseudos */ + ::view-transition-group(*), + ::view-transition-image-pair(*) { + animation: unset; + } + + ::view-transition-old(*) { + animation: -ua-view-transition-fade-out 1s paused; + } + + ::view-transition-new(*) { + animation: -ua-view-transition-fade-in 1s paused; + } + +</style> +<body> + <div id="container"></div> +</body> +<script> + function createDiv(test, id, className) { + const element = document.createElement('div'); + element.id = id; + element.className = className; + test.add_cleanup(() => { + element.remove(); + }); + return element; + } + + function setupCaptureTest(test) { + const container = document.getElementById('container'); + container.innerHTML = ''; + const target1 = createDiv(test, 'target1', 'parent'); + const target2 = createDiv(test, 'target2', 'child'); + const target3 = createDiv(test, 'target3', 'sibling'); + container.appendChild(target1); + target1.appendChild(target2); + container.appendChild(target3); + test.add_cleanup(() => { + document.getAnimations().forEach(a => a.cancel()); + }); + } + + function assert_animations(target, filterFn, mappingFn, expected, message) { + const values = document.getAnimations() + .filter(filterFn) + .map(mappingFn) + .sort(); + + const format = entries => entries.join(", "); + assert_equals(format(values), format(expected), message); + } + + function assert_animation_pseudos(element, expected, message) { + const filterFn = a => a.effect.target == element; + const mappingFn = a => a.effect.pseudoElement; + return assert_animations(element, filterFn, mappingFn, expected, message); + } + + function assert_animation_names(target, expected, message) { + const filterFn = a => a.effect.pseudoElement == target; + const mappingFn = a => a.animationName; + return assert_animations(target, filterFn, mappingFn, expected, message); + } + + promise_test(async t => { + setupCaptureTest(t); + const target = document.querySelector('.parent'); + assert_true(!!target.startViewTransition, + 'Missing scoped view transition support'); + + await target.startViewTransition({}).ready; + + const expected_pseudos = [ + '::view-transition-new(child)', + '::view-transition-new(parent)', + '::view-transition-old(child)', + '::view-transition-old(parent)' + ]; + assert_animation_pseudos(target, expected_pseudos, + 'animations on target element pseudos'); + assert_animation_pseudos(document.documentElement, [], + 'no animations targeting pseudos on root'); + assert_animation_pseudos(document.querySelector('.sibling'), [], + 'no animations targetting pseudos on sibling'); + assert_animation_pseudos(document.querySelector('.child'), [], + 'no animations targetting pseudos on child'); + + assert_animation_names('::view-transition-old(child)', + ['-ua-view-transition-fade-out'], + 'fade out animation on old child'); + assert_animation_names('::view-transition-old(parent)', + ['-ua-view-transition-fade-out'], + 'fade out animation on old parent'); + assert_animation_names('::view-transition-new(child)', + ['-ua-view-transition-fade-in'], + 'fade in animation on new child'); + assert_animation_names('::view-transition-new(parent)', + ['-ua-view-transition-fade-in'], + 'fade in animation on new parent'); + }, 'View-transition pseudo elements created for correct element'); + + promise_test(async t => { + setupCaptureTest(t); + const parent = document.querySelector('.parent'); + const sibling = document.querySelector('.sibling'); + assert_true(!!parent.startViewTransition, + 'Missing scoped view transition support'); + + await parent.startViewTransition({}).ready; + await sibling.startViewTransition({}).ready; + + const expected_parent_pseudos = [ + '::view-transition-new(child)', + '::view-transition-new(parent)', + '::view-transition-old(child)', + '::view-transition-old(parent)' + ]; + const expected_sibling_pseudos = [ + '::view-transition-new(sibling)', + '::view-transition-old(sibling)' + ]; + assert_animation_pseudos(parent, expected_parent_pseudos, + 'animations on parent element pseudos'); + assert_animation_pseudos(sibling, expected_sibling_pseudos, + 'animations on sibling element pseudos'); + }, 'Capture with concurrent scoped view-transitions'); + +</script> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/selectors/open-pseudo.html b/third_party/blink/web_tests/external/wpt/css/selectors/open-pseudo.html index 0f3b9f3..c215bf1 100644 --- a/third_party/blink/web_tests/external/wpt/css/selectors/open-pseudo.html +++ b/third_party/blink/web_tests/external/wpt/css/selectors/open-pseudo.html
@@ -5,51 +5,85 @@ <script src="/resources/testharnessreport.js"></script> <script src="/resources/testdriver.js"></script> <script src="/resources/testdriver-vendor.js"></script> +<style> + +dialog:open + #afterdialog, +details:open + #afterdetails, +select:open + #afterselect { + will-change: text-decoration; +} + +</style> <dialog>dialog</dialog> +<p id="afterdialog"></p> <details>details</details> +<p id="afterdetails"></p> <select> <option>one</option> </select> +<p id="afterselect"></p> <script> test(() => { const dialog = document.querySelector('dialog'); + const after = document.getElementById("afterdialog"); assert_false(dialog.matches(':open'), ':open should not match when the dialog is closed.'); + assert_equals(getComputedStyle(after).willChange, "auto", + ":open style should not be applied when the dialog is closed"); dialog.show(); assert_true(dialog.matches(':open'), - ':open should match after dialog.open().'); + ':open should match after dialog.show().'); + assert_equals(getComputedStyle(after).willChange, "text-decoration", + ":open style should be applied after dialog.show()"); dialog.close(); + assert_equals(getComputedStyle(after).willChange, "auto", + ":open style should not be applied when the dialog is closed (2)"); + dialog.showModal(); assert_true(dialog.matches(':open'), ':open should match after dialog.showModal().'); + assert_equals(getComputedStyle(after).willChange, "text-decoration", + ":open style should be applied after dialog.showModal()"); dialog.close(); + assert_equals(getComputedStyle(after).willChange, "auto", + ":open style should not be applied when the dialog is closed (3)"); }, 'The dialog element should support :open.'); test(() => { const details = document.querySelector('details'); + const after = document.getElementById("afterdetails"); assert_false(details.matches(':open'), ':open should not match when the details is closed.'); + assert_equals(getComputedStyle(after).willChange, "auto", + ":open style should not be applied when the details is closed"); details.open = true; assert_true(details.matches(':open'), ':open should match when the details is open.'); + assert_equals(getComputedStyle(after).willChange, "text-decoration", + ":open style should be applied when the details is open"); }, 'The details element should support :open.'); promise_test(async () => { const select = document.querySelector('select'); + const after = document.getElementById("afterselect"); assert_false(select.matches(':open'), ':open should not match when the select is closed.'); + assert_equals(getComputedStyle(after).willChange, "auto", + ":open style should not be applied when the select is closed"); await test_driver.click(select); await new Promise(requestAnimationFrame); assert_true(select.matches(':open'), ':open should match when the select is open.'); + assert_equals(getComputedStyle(after).willChange, "text-decoration", + ":open style should be applied when the select is open"); }, 'The select element should support :open.'); </script>
diff --git a/third_party/blink/web_tests/external/wpt/dom/observable/tentative/observable-from.any.js b/third_party/blink/web_tests/external/wpt/dom/observable/tentative/observable-from.any.js index 3caf9905..20b2c80 100644 --- a/third_party/blink/web_tests/external/wpt/dom/observable/tentative/observable-from.any.js +++ b/third_party/blink/web_tests/external/wpt/dom/observable/tentative/observable-from.any.js
@@ -1728,3 +1728,14 @@ assert_not_equals(reportedError, null, "Protocol error is reported to the global"); assert_true(reportedError instanceof TypeError); }, "Invalid iterator protocol error is surfaced before Subscriber#signal is consulted"); + +// Regression test for https://github.com/WICG/observable/issues/208. +promise_test(async () => { + let errorReported = false; + self.onerror = e => errorReported = true; + + // `first()` aborts the subscription after the first item is encountered. + const value = await Observable.from([1, 2, 3]).first(); + assert_false(errorReported); +}, "No error is reported when aborting a subscription to a sync iterator " + + "that has no `return()` implementation");
diff --git a/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/circle-calc-dynamic-viewport-ref.html b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/circle-calc-dynamic-viewport-ref.html new file mode 100644 index 0000000..dfd1f609 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/circle-calc-dynamic-viewport-ref.html
@@ -0,0 +1,18 @@ +<!doctype html> +<title>Changing container size of SVG with calc() cx/cy/r on <circle> (reference)</title> +<div id="hcontainer" style="width: 100px; height: 100px; position: absolute"> + <svg width="100" height="100"> + <circle cy="50" r="100"/> + </svg> + <svg width="100" height="100"> + <circle cx="50" cy="50" r="50"/> + </svg> +</div> +<div id="vcontainer" style="width: 100px; height: 100px; position: absolute; left: 116px"> + <svg width="100" height="100"> + <circle cx="50" r="100"/> + </svg> + <svg width="100" height="100"> + <circle cy="50" cy="50" r="50"/> + </svg> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/circle-calc-dynamic-viewport.html b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/circle-calc-dynamic-viewport.html new file mode 100644 index 0000000..cff8915d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/circle-calc-dynamic-viewport.html
@@ -0,0 +1,29 @@ +<!doctype html> +<html class="reftest-wait"> +<title>Changing container size of SVG with calc() cx/cy/r on <circle></title> +<link rel="match" href="circle-calc-dynamic-viewport-ref.html"> +<script src="/common/rendering-utils.js"></script> +<script src="/common/reftest-wait.js"></script> +<div id="hcontainer" style="width: 50px; height: 100px; position: absolute"> + <svg width="100%" height="100%"> + <circle cy="50" style="r: calc(50% + 50px)"/> + </svg> + <svg width="100%" height="100%"> + <circle style="cx: calc(25% + 25px)" cy="50" r="50"/> + </svg> +</div> +<div id="vcontainer" style="width: 100px; height: 50px; position: absolute; left: 116px"> + <svg width="100%" height="100%"> + <circle cx="50" style="r: calc(50% + 50px)"/> + </svg> + <svg width="100%" height="100%"> + <circle cy="50" style="cy: calc(25% + 25px)" r="50"/> + </svg> +</div> +<script> + waitForAtLeastOneFrame().then(() => { + document.getElementById('hcontainer').style.width = '100px'; + document.getElementById('vcontainer').style.height = '100px'; + takeScreenshot(); + }); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/ellipse-calc-dynamic-viewport-ref.html b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/ellipse-calc-dynamic-viewport-ref.html new file mode 100644 index 0000000..7057634 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/ellipse-calc-dynamic-viewport-ref.html
@@ -0,0 +1,18 @@ +<!doctype html> +<title>Changing container size of SVG with calc() cx/cy/rx/ry on <ellipse> (reference)</title> +<div id="hcontainer" style="width: 100px; height: 100px; position: absolute"> + <svg width="100" height="100"> + <ellipse cy="50" rx="100" ry="50"/> + </svg> + <svg width="100" height="100"> + <ellipse cx="50" cy="50" rx="50" ry="50"/> + </svg> +</div> +<div id="vcontainer" style="width: 100px; height: 100px; position: absolute; left: 116px"> + <svg width="100" height="100"> + <ellipse cx="50" rx="50" ry="100"/> + </svg> + <svg width="100%" height="100%"> + <ellipse cx="50" cy="50" rx="50" ry="50"/> + </svg> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/ellipse-calc-dynamic-viewport.html b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/ellipse-calc-dynamic-viewport.html new file mode 100644 index 0000000..d817b78 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/ellipse-calc-dynamic-viewport.html
@@ -0,0 +1,29 @@ +<!doctype html> +<html class="reftest-wait"> +<title>Changing container size of SVG with calc() cx/cy/rx/ry on <ellipse></title> +<link rel="match" href="ellipse-calc-dynamic-viewport-ref.html"> +<script src="/common/rendering-utils.js"></script> +<script src="/common/reftest-wait.js"></script> +<div id="hcontainer" style="width: 50px; height: 100px; position: absolute"> + <svg width="100%" height="100%"> + <ellipse cy="50" style="rx: calc(50% + 50px)" ry="50"/> + </svg> + <svg width="100%" height="100%"> + <ellipse style="cx: calc(25% + 25px)" cy="50" rx="50" ry="50"/> + </svg> +</div> +<div id="vcontainer" style="width: 100px; height: 50px; position: absolute; left: 116px"> + <svg width="100%" height="100%"> + <ellipse cx="50" rx="50" style="ry: calc(50% + 50px)"/> + </svg> + <svg width="100%" height="100%"> + <ellipse cx="50" style="cy: calc(25% + 25px)" rx="50" ry="50"/> + </svg> +</div> +<script> + waitForAtLeastOneFrame().then(() => { + document.getElementById('hcontainer').style.width = '100px'; + document.getElementById('vcontainer').style.height = '100px'; + takeScreenshot(); + }); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/rect-calc-dynamic-viewport-ref.html b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/rect-calc-dynamic-viewport-ref.html new file mode 100644 index 0000000..84971d4b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/rect-calc-dynamic-viewport-ref.html
@@ -0,0 +1,24 @@ +<!doctype html> +<title>Changing container size of SVG with calc() width/height/x/y/rx/ry on <rect> (reference)</title> +<div id="hcontainer" style="width: 100px; height: 100px; position: absolute"> + <svg width="100" height="100"> + <rect width="100" height="100"/> + </svg> + <svg width="100" height="100"> + <rect width="100" height="100" x="50"/> + </svg> + <svg width="100" height="100"> + <rect width="100" height="100" rx="50"/> + </svg> +</div> +<div id="vcontainer" style="width: 100px; height: 100px; position: absolute; left: 116px"> + <svg width="100" height="100"> + <rect width="100" height="100"/> + </svg> + <svg width="100" height="100"> + <rect width="100" height="100" y="50"/> + </svg> + <svg width="100" height="100"> + <rect width="100" height="100" ry="50"/> + </svg> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/rect-calc-dynamic-viewport.html b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/rect-calc-dynamic-viewport.html new file mode 100644 index 0000000..6fe39012 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/geometry/reftests/rect-calc-dynamic-viewport.html
@@ -0,0 +1,35 @@ +<!doctype html> +<html class="reftest-wait"> +<title>Changing container size of SVG with calc() width/height/x/y/rx/ry on <rect></title> +<link rel="match" href="rect-calc-dynamic-viewport-ref.html"> +<script src="/common/rendering-utils.js"></script> +<script src="/common/reftest-wait.js"></script> +<div id="hcontainer" style="width: 50px; height: 100px; position: absolute"> + <svg width="100%" height="100%"> + <rect style="width: calc(50% + 50px)" height="100"/> + </svg> + <svg width="100%" height="100%"> + <rect width="100" height="100" style="x: calc(25% + 25px)"/> + </svg> + <svg width="100%" height="100%"> + <rect width="100" height="100" style="rx: calc(25% + 25px)"/> + </svg> +</div> +<div id="vcontainer" style="width: 100px; height: 50px; position: absolute; left: 116px"> + <svg width="100%" height="100%"> + <rect width="100" style="height: calc(50% + 50px)"/> + </svg> + <svg width="100%" height="100%"> + <rect width="100" height="100" style="y: calc(25% + 25px)"/> + </svg> + <svg width="100%" height="100%"> + <rect width="100" height="100" style="ry: calc(25% + 25px)"/> + </svg> +</div> +<script> + waitForAtLeastOneFrame().then(() => { + document.getElementById('hcontainer').style.width = '100px'; + document.getElementById('vcontainer').style.height = '100px'; + takeScreenshot(); + }); +</script>
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-ancestry-ids-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-ancestry-ids-expected.txt new file mode 100644 index 0000000..678dbf9 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-ancestry-ids-expected.txt
@@ -0,0 +1,5 @@ +Tests that the script ancestry which caused the frame to be labelled as an ad is reported via Page.getAdScriptAncestryIds + +has adScriptAncestryIds via getAdScriptAncestryIds: true +length: 2 +
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-ancestry-ids.js b/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-ancestry-ids.js new file mode 100644 index 0000000..1e32c8b --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-ancestry-ids.js
@@ -0,0 +1,32 @@ +(async function(/** @type {import('test_runner').TestRunner} */ testRunner) { + const {page, session, dp} = await testRunner.startBlank( + `Tests that the script ancestry which caused the frame to be labelled as an ad is reported via Page.getAdScriptAncestryIds\n`); + + await dp.Page.enable(); + + const adScriptUrl = testRunner.url('resources/ad-script.js'); + const transitiveAdScriptUrl = testRunner.url('resources/transitive-script.js'); + + const transitiveAdFrameAttached = dp.Page.onceFrameAttached(); + + session.evaluate(` + testRunner.setDisallowedSubresourcePathSuffixes(["ad-script.js"], false /* block_subresources */); + + const adScriptUrl = "${adScriptUrl}"; + const transitiveAdScriptUrl = "${transitiveAdScriptUrl}"; + + const adScript = document.createElement('script'); + adScript.src = adScriptUrl; + document.body.appendChild(adScript); + `); + + await transitiveAdFrameAttached; + + const {params} = await transitiveAdFrameAttached; + + const {result} = await dp.Page.getAdScriptAncestryIds({ frameId: params.frameId }); + + testRunner.log('has adScriptAncestryIds via getAdScriptAncestryIds: ' + !!result.adScriptAncestryIds); + testRunner.log('length: ' + result.adScriptAncestryIds.length); + testRunner.completeTest(); +})
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-id-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-id-expected.txt deleted file mode 100644 index 99ef1a1..0000000 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-id-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -Tests that the script which caused the frame to be labelled as an ad is reported via Page.getAdScriptId - -has adScriptId via getAdScriptId: true -
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-id.js b/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-id.js deleted file mode 100644 index 9a4dac1..0000000 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/page/get-ad-script-id.js +++ /dev/null
@@ -1,22 +0,0 @@ -(async function(/** @type {import('test_runner').TestRunner} */ testRunner) { - const {page, session, dp} = await testRunner.startBlank( - `Tests that the script which caused the frame to be labelled as an ad is reported via Page.getAdScriptId\n`); - await dp.Page.enable(); - const firstFrameAttached = dp.Page.onceFrameAttached(); - session.evaluate(` - ad_frame = document.createElement('iframe'); - document.body.appendChild(ad_frame); - internals.setIsAdFrame(ad_frame.contentDocument); - `); - - await firstFrameAttached; - const secondFrameAttached = dp.Page.onceFrameAttached(); - session.evaluate(` - ad_frame.src = 'javascript:document.body.appendChild(document.createElement("iframe"))' - `); - const {params} = await secondFrameAttached; - - const { result } = await dp.Page.getAdScriptId({ frameId: params.frameId }); - testRunner.log('has adScriptId via getAdScriptId: ' + !!result.adScriptId); - testRunner.completeTest(); -})
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/page/page-javascript-dialog-events-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/page/page-javascript-dialog-events-expected.txt new file mode 100644 index 0000000..a47d9c2 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/page/page-javascript-dialog-events-expected.txt
@@ -0,0 +1,26 @@ +ALERT: Hello World +Tests Page.javascriptDialogOpening event +Page.javascriptDialogOpening: { + method : Page.javascriptDialogOpening + params : { + defaultPrompt : + frameId : <string> + hasBrowserHandler : true + message : Hello World + type : alert + url : http://127.0.0.1:8000/inspector-protocol/resources/inspector-protocol-page.html + } + sessionId : <string> +} +Page.javascriptDialogOpening has expected frameId +Page.javascriptDialogClosed: { + method : Page.javascriptDialogClosed + params : { + frameId : <string> + result : true + userInput : + } + sessionId : <string> +} +Page.javascriptDialogClosed has expected frameId +
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/page/page-javascript-dialog-events.js b/third_party/blink/web_tests/http/tests/inspector-protocol/page/page-javascript-dialog-events.js new file mode 100644 index 0000000..0a73be2 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/page/page-javascript-dialog-events.js
@@ -0,0 +1,29 @@ +(async function(/** @type {import('test_runner').TestRunner} */ testRunner) { + var {page, session, dp} = await testRunner.startBlank( + 'Tests Page.javascriptDialogOpening event'); + + await dp.Page.enable(); + + dp.Runtime.evaluate({expression: 'alert("Hello World")'}); + + // FrameId is the same as targetId for the main frame. + const expectedFrameId = page.targetId(); + + const openingEvent = await dp.Page.onceJavascriptDialogOpening(); + testRunner.log(openingEvent, 'Page.javascriptDialogOpening: '); + if (openingEvent.params.frameId === expectedFrameId) { + testRunner.log('Page.javascriptDialogOpening has expected frameId'); + } else { + testRunner.log('ERROR!!! Page.javascriptDialogOpening has unexpected frameId'); + } + + const closingEvent = await dp.Page.onceJavascriptDialogClosed(); + testRunner.log(closingEvent, 'Page.javascriptDialogClosed: '); + if (closingEvent.params.frameId === expectedFrameId) { + testRunner.log('Page.javascriptDialogClosed has expected frameId'); + } else { + testRunner.log('ERROR!!! Page.javascriptDialogClosed has unexpected frameId'); + } + + testRunner.completeTest(); +})
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/page/resources/ad-script.js b/third_party/blink/web_tests/http/tests/inspector-protocol/page/resources/ad-script.js new file mode 100644 index 0000000..bcc79dd --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/page/resources/ad-script.js
@@ -0,0 +1,3 @@ +const script = document.createElement('script'); +script.src = transitiveAdScriptUrl; +document.body.appendChild(script);
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/page/resources/transitive-script.js b/third_party/blink/web_tests/http/tests/inspector-protocol/page/resources/transitive-script.js new file mode 100644 index 0000000..c687614 --- /dev/null +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/page/resources/transitive-script.js
@@ -0,0 +1,2 @@ +const iframe = document.createElement('iframe'); +document.body.appendChild(iframe);
diff --git a/third_party/blink/web_tests/http/tests/inspector-protocol/tracing/rendering-expected.txt b/third_party/blink/web_tests/http/tests/inspector-protocol/tracing/rendering-expected.txt index 6cbce33..e47eff4 100644 --- a/third_party/blink/web_tests/http/tests/inspector-protocol/tracing/rendering-expected.txt +++ b/third_party/blink/web_tests/http/tests/inspector-protocol/tracing/rendering-expected.txt
@@ -131,6 +131,7 @@ isPicture: boolean loadingAttribute: string nodeId: number + nodeName: string srcHeight: number srcWidth: number srcsetAttribute: string
diff --git a/third_party/blink/web_tests/wpt_internal/private-aggregation/protected-audience-sends-report.https.window.js b/third_party/blink/web_tests/wpt_internal/private-aggregation/protected-audience-sends-report.https.window.js index 56e5caf..ca66ff1 100644 --- a/third_party/blink/web_tests/wpt_internal/private-aggregation/protected-audience-sends-report.https.window.js +++ b/third_party/blink/web_tests/wpt_internal/private-aggregation/protected-audience-sends-report.https.window.js
@@ -370,12 +370,22 @@ generateBid: `privateAggregation.enableDebugMode(); // Sums to value 1 if overflow is allowed. privateAggregation.contributeToHistogram({ bucket: 1n, value: 2147483647 }); - privateAggregation.contributeToHistogram({ bucket: 1n, value: 2147483647 }); - privateAggregation.contributeToHistogram({ bucket: 1n, value: 3 });` + privateAggregation.contributeToHistogram({ bucket: 1n, value: 1073741824 }); + privateAggregation.contributeToHistogram({ bucket: 1n, value: 1073741824 }); + privateAggregation.contributeToHistogram({ bucket: 1n, value: 2 });` }); - // No reports are expected as the budget has surely been exceeded. - await reportPoller.pollReportsAndAssert( - /*expectedNumReports=*/ 0, /*expectedNumDebugReports=*/ 0); + // The final contribution should succeed, but the first three should fail. + const {reports: [report], debug_reports: [debug_report]} = + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 1, /*expectedNumDebugReports=*/ 1); + verifyReport( + report, /*api=*/ 'protected-audience', + /*is_debug_enabled=*/ true, /*debug_key=*/ undefined, + /*expected_payload=*/ + buildExpectedPayload( + ONE_CONTRIBUTION_EXAMPLE, NUM_CONTRIBUTIONS_PROTECTED_AUDIENCE)); + + verifyReportsIdenticalExceptPayload(report, debug_report); }, 'auction that calls Private Aggregation with values that sum to more than the max long');
diff --git a/third_party/blink/web_tests/wpt_internal/private-aggregation/resources/shared-storage-module.js b/third_party/blink/web_tests/wpt_internal/private-aggregation/resources/shared-storage-module.js index 368d235..7724527 100644 --- a/third_party/blink/web_tests/wpt_internal/private-aggregation/resources/shared-storage-module.js +++ b/third_party/blink/web_tests/wpt_internal/private-aggregation/resources/shared-storage-module.js
@@ -4,11 +4,19 @@ privateAggregation.enableDebugMode(data.enableDebugModeArgs); } for (const contribution of data.contributions) { - privateAggregation.contributeToHistogram(contribution); + if (contribution.event) { + privateAggregation.contributeToHistogramOnEvent( + contribution.event, contribution); + } else { + privateAggregation.contributeToHistogram(contribution); + } } if (data.enableDebugModeAfterOp) { privateAggregation.enableDebugMode(data.enableDebugModeArgs); } + if (data.exceptionToThrow) { + throw data.exceptionToThrow; + } } }
diff --git a/third_party/blink/web_tests/wpt_internal/private-aggregation/shared-storage-error-reporting.https.window.js b/third_party/blink/web_tests/wpt_internal/private-aggregation/shared-storage-error-reporting.https.window.js new file mode 100644 index 0000000..aabc97ba --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/private-aggregation/shared-storage-error-reporting.https.window.js
@@ -0,0 +1,255 @@ +// META: timeout=long +// META: script=/common/get-host-info.sub.js +// META: script=../aggregation-service/support/aggregation-service.js +// META: script=resources/utils.js +// META: script=/shared-storage/resources/util.js + +'use strict'; + +const reportPoller = new ReportPoller( + '/.well-known/private-aggregation/report-shared-storage', + '/.well-known/private-aggregation/debug/report-shared-storage', + /*fullTimeoutMs=*/ 2000, +); + +private_aggregation_promise_test(async () => { + await addModuleOnce('resources/shared-storage-module.js'); + + const data = { + enableDebugMode: true, + contributions: [ + {event: 'non-reserved-event', bucket: 3n, value: 4}, + {bucket: 1n, value: 2}, + ] + }; + await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); + + // No report is expected as the non-reserved event should throw an exception. + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 0, /*expectedNumDebugReports=*/ 0); +}, 'run() that calls Private Aggregation with a non-reserved event'); + +private_aggregation_promise_test(async () => { + await addModuleOnce('resources/shared-storage-module.js'); + + const data = { + enableDebugMode: true, + contributions: [ + {event: 'reserved.non-existent', bucket: 3n, value: 4}, + {bucket: 1n, value: 2}, + ] + }; + await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); + + const {reports: [report], debug_reports: [debug_report]} = + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 1, /*expectedNumDebugReports=*/ 1); + + verifyReport( + report, /*api=*/ 'shared-storage', + /*is_debug_enabled=*/ true, + /*debug_key=*/ undefined, + /*expected_payload=*/ + buildExpectedPayload( + ONE_CONTRIBUTION_EXAMPLE, NUM_CONTRIBUTIONS_SHARED_STORAGE)); + + verifyReportsIdenticalExceptPayload(report, debug_report); +}, 'run() that calls Private Aggregation with a non-reserved event should no-op'); + +private_aggregation_promise_test(async () => { + await addModuleOnce('resources/shared-storage-module.js'); + + const data = { + enableDebugMode: true, + contributions: [ + {event: 'reserved.report-success', bucket: 'not a big int', value: 4}, + {bucket: 1n, value: 2}, + ] + }; + await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); + + // No report is expected as the invalid contribution should throw an + // exception. + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 0, /*expectedNumDebugReports=*/ 0); +}, 'run() that calls Private Aggregation with an invalid contribution'); + +private_aggregation_promise_test(async () => { + await addModuleOnce('resources/shared-storage-module.js'); + + const data = { + enableDebugMode: true, + contributions: [ + {event: 'reserved.report-success', bucket: 1n, value: 2}, + {bucket: 3n, value: 4}, + + // Other events should not be triggered. + {event: 'reserved.too-many-contributions', bucket: 4n, value: 5}, + {event: 'reserved.empty-report-dropped', bucket: 5n, value: 6}, + {event: 'reserved.pending-report-limit-reached', bucket: 6n, value: 7}, + {event: 'reserved.insufficient-budget', bucket: 7n, value: 8}, + {event: 'reserved.uncaught-error', bucket: 8n, value: 9}, + {event: 'reserved.contribution-timeout-reached', bucket: 9n, value: 10}, + ] + }; + await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); + + const {reports: [report], debug_reports: [debug_report]} = + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 1, /*expectedNumDebugReports=*/ 1); + + verifyReport( + report, /*api=*/ 'shared-storage', + /*is_debug_enabled=*/ true, + /*debug_key=*/ undefined, + /*expected_payload=*/ + buildExpectedPayload( + MULTIPLE_CONTRIBUTIONS_EXAMPLE, NUM_CONTRIBUTIONS_SHARED_STORAGE)); + + verifyReportsIdenticalExceptPayload(report, debug_report); +}, 'run() that calls Private Aggregation and triggers report-success'); + +private_aggregation_promise_test(async () => { + await addModuleOnce('resources/shared-storage-module.js'); + + let contributions = + buildArrayOfSequentialContributions(NUM_CONTRIBUTIONS_SHARED_STORAGE + 2); + contributions[0].event = 'reserved.too-many-contributions'; + + const data = { + enableDebugMode: true, + contributions: [ + ...contributions, + + // Other events should not be triggered. + {event: 'reserved.report-success', bucket: 4n, value: 5}, + {event: 'reserved.empty-report-dropped', bucket: 5n, value: 6}, + {event: 'reserved.pending-report-limit-reached', bucket: 6n, value: 7}, + {event: 'reserved.insufficient-budget', bucket: 7n, value: 8}, + {event: 'reserved.uncaught-error', bucket: 8n, value: 9}, + {event: 'reserved.contribution-timeout-reached', bucket: 9n, value: 10}, + ] + }; + await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); + + const {reports: [report], debug_reports: [debug_report]} = + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 1, /*expectedNumDebugReports=*/ 1); + + verifyReport( + report, /*api=*/ 'shared-storage', + /*is_debug_enabled=*/ true, + /*debug_key=*/ undefined, + /*expected_payload=*/ + buildPayloadWithSequentialContributions( + NUM_CONTRIBUTIONS_SHARED_STORAGE)); + + verifyReportsIdenticalExceptPayload(report, debug_report); +}, 'run() that calls Private Aggregation and triggers too-many-contributions'); + +private_aggregation_promise_test(async () => { + await addModuleOnce('resources/shared-storage-module.js'); + + const data = { + enableDebugMode: true, + contributions: [ + {event: 'reserved.empty-report-dropped', bucket: 1n, value: 2}, + + // Other events should not be triggered. + {event: 'reserved.report-success', bucket: 4n, value: 5}, + {event: 'reserved.too-many-contributions', bucket: 5n, value: 6}, + {event: 'reserved.pending-report-limit-reached', bucket: 6n, value: 7}, + {event: 'reserved.insufficient-budget', bucket: 7n, value: 8}, + {event: 'reserved.uncaught-error', bucket: 8n, value: 9}, + {event: 'reserved.contribution-timeout-reached', bucket: 9n, value: 10}, + ] + }; + await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); + + const {reports: [report], debug_reports: [debug_report]} = + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 1, /*expectedNumDebugReports=*/ 1); + + verifyReport( + report, /*api=*/ 'shared-storage', + /*is_debug_enabled=*/ true, + /*debug_key=*/ undefined, + /*expected_payload=*/ + buildExpectedPayload( + ONE_CONTRIBUTION_EXAMPLE, NUM_CONTRIBUTIONS_SHARED_STORAGE)); + + verifyReportsIdenticalExceptPayload(report, debug_report); +}, 'run() that calls Private Aggregation and triggers empty-report-dropped'); + + +private_aggregation_promise_test(async () => { + await addModuleOnce('resources/shared-storage-module.js'); + + const data = { + enableDebugMode: true, + contributions: [ + {event: 'reserved.insufficient-budget', bucket: 1n, value: 2}, + {bucket: 3n, value: 4}, + {bucket: 3n, value: 2 ** 16 - 3}, + + // Other events should not be triggered. + {event: 'reserved.report-success', bucket: 4n, value: 5}, + {event: 'reserved.too-many-contributions', bucket: 5n, value: 6}, + {event: 'reserved.empty-report-dropped', bucket: 6n, value: 7}, + {event: 'reserved.pending-report-limit-reached', bucket: 7n, value: 8}, + {event: 'reserved.uncaught-error', bucket: 8n, value: 9}, + {event: 'reserved.contribution-timeout-reached', bucket: 9n, value: 10}, + ] + }; + await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); + + const {reports: [report], debug_reports: [debug_report]} = + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 1, /*expectedNumDebugReports=*/ 1); + + verifyReport( + report, /*api=*/ 'shared-storage', + /*is_debug_enabled=*/ true, + /*debug_key=*/ undefined, + /*expected_payload=*/ + buildExpectedPayload( + MULTIPLE_CONTRIBUTIONS_EXAMPLE, NUM_CONTRIBUTIONS_SHARED_STORAGE)); + + verifyReportsIdenticalExceptPayload(report, debug_report); +}, 'run() that calls Private Aggregation and triggers insufficient-budget'); + + +private_aggregation_promise_test(async () => { + await addModuleOnce('resources/shared-storage-module.js'); + + const data = { + enableDebugMode: true, + exceptionToThrow: new Error('example error'), + contributions: [ + {event: 'reserved.uncaught-error', bucket: 1n, value: 2}, + {bucket: 3n, value: 4}, + + // Other events should not be triggered, except report-success. + {event: 'reserved.too-many-contributions', bucket: 5n, value: 6}, + {event: 'reserved.empty-report-dropped', bucket: 6n, value: 7}, + {event: 'reserved.pending-report-limit-reached', bucket: 7n, value: 8}, + {event: 'reserved.insufficient-budget', bucket: 8n, value: 9}, + {event: 'reserved.contribution-timeout-reached', bucket: 9n, value: 10}, + ] + }; + await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); + + const {reports: [report], debug_reports: [debug_report]} = + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 1, /*expectedNumDebugReports=*/ 1); + + verifyReport( + report, /*api=*/ 'shared-storage', + /*is_debug_enabled=*/ true, + /*debug_key=*/ undefined, + /*expected_payload=*/ + buildExpectedPayload( + MULTIPLE_CONTRIBUTIONS_EXAMPLE, NUM_CONTRIBUTIONS_SHARED_STORAGE)); + + verifyReportsIdenticalExceptPayload(report, debug_report); +}, 'run() that calls Private Aggregation and triggers uncaught-error');
diff --git a/third_party/blink/web_tests/wpt_internal/private-aggregation/shared-storage-sends-report.https.window.js b/third_party/blink/web_tests/wpt_internal/private-aggregation/shared-storage-sends-report.https.window.js index 9272998..c4d382d 100644 --- a/third_party/blink/web_tests/wpt_internal/private-aggregation/shared-storage-sends-report.https.window.js +++ b/third_party/blink/web_tests/wpt_internal/private-aggregation/shared-storage-sends-report.https.window.js
@@ -303,13 +303,22 @@ let contributions = [] // Sums to value 1 if overflow is allowed. contributions.push({bucket: 1n, value: 2147483647}); - contributions.push({bucket: 1n, value: 2147483647}); - contributions.push({bucket: 1n, value: 3}); + contributions.push({bucket: 1n, value: 1073741824}); + contributions.push({bucket: 1n, value: 1073741824}); + contributions.push({bucket: 1n, value: 2}); const data = {enableDebugMode: true, contributions}; await sharedStorage.run('contribute-to-histogram', {data, keepAlive: true}); - // No reports are expected as the budget has surely been exceeded. - await reportPoller.pollReportsAndAssert( - /*expectedNumReports=*/ 0, /*expectedNumDebugReports=*/ 0); + // The final contribution should succeed, but the first three should fail. + const {reports: [report], debug_reports: [debug_report]} = + await reportPoller.pollReportsAndAssert( + /*expectedNumReports=*/ 1, /*expectedNumDebugReports=*/ 1); + + verifyReport( + report, /*api=*/ 'shared-storage', /*is_debug_enabled=*/ true, + /*debug_key=*/ undefined, + /*expected_payload=*/ + buildExpectedPayload( + ONE_CONTRIBUTION_EXAMPLE, NUM_CONTRIBUTIONS_SHARED_STORAGE)); }, 'run() that calls Private Aggregation with values that sum to more than the max long');
diff --git a/third_party/catapult b/third_party/catapult index 783d02a..f1f18d8a 160000 --- a/third_party/catapult +++ b/third_party/catapult
@@ -1 +1 @@ -Subproject commit 783d02a67a6832201b5869439feb6692637b86f4 +Subproject commit f1f18d8a8d1547cf7441dc4e3e30c833fccf304b
diff --git a/third_party/crossbench b/third_party/crossbench index ac59b4d0..0bab440 160000 --- a/third_party/crossbench +++ b/third_party/crossbench
@@ -1 +1 @@ -Subproject commit ac59b4d0917aa8d3d8c49790978eeeabe7cb3f0c +Subproject commit 0bab4408ebd27fde91551ac967c642bfcd9dd69a
diff --git a/third_party/dawn b/third_party/dawn index 7ffa7f7..50b8c9b 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit 7ffa7f79728d68e24e61ed9b8a3c4ad6f37aec8b +Subproject commit 50b8c9bd99bf3ef47208b07bfe0b4663d9ef181b
diff --git a/third_party/depot_tools b/third_party/depot_tools index aacf07d..b128c99 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit aacf07dc8bc6336ef20873b93207fbf4482792ef +Subproject commit b128c9967e4067db21f244a185296f1f38107dd8
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index 10b25b3..07ad609 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit 10b25b3abb27b79cc9625170f453988d7e0368e6 +Subproject commit 07ad609dd5c61cdd3eea197ce9253783da05432f
diff --git a/third_party/dragonbox/BUILD.gn b/third_party/dragonbox/BUILD.gn new file mode 100644 index 0000000..cd8c6e9 --- /dev/null +++ b/third_party/dragonbox/BUILD.gn
@@ -0,0 +1,18 @@ +# Copyright 2025 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/gclient_args.gni") + +config("dragonbox_config") { + include_dirs = [ "src/include" ] +} + +source_set("dragonbox") { + public = [ "src/include/dragonbox/dragonbox.h" ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + public_configs = [ ":dragonbox_config" ] +}
diff --git a/third_party/dragonbox/OWNERS b/third_party/dragonbox/OWNERS new file mode 100644 index 0000000..6d684ed --- /dev/null +++ b/third_party/dragonbox/OWNERS
@@ -0,0 +1,3 @@ +leszeks@chromium.org +mlippautz@chromium.org +pthier@chromium.org
diff --git a/third_party/dragonbox/README.chromium b/third_party/dragonbox/README.chromium new file mode 100644 index 0000000..1b62483 --- /dev/null +++ b/third_party/dragonbox/README.chromium
@@ -0,0 +1,15 @@ +Name: dragonbox +URL: https://github.com/jk-jeon/dragonbox +Version: 1.1.3 +Revision: 6c7c925b571d54486b9ffae8d9d18a822801cbda +License: Apache-with-LLVM-Exception, BSL-1.0 +License File: src/LICENSE-Apache2-LLVM, src/LICENSE-Boost +Shipped: yes +Security Critical: yes +CPEPrefix: unknown + +Description: +A fast float-to-string conversion algorithm. + +Local Modifications: +None
diff --git a/third_party/dragonbox/src b/third_party/dragonbox/src new file mode 160000 index 0000000..6c7c925 --- /dev/null +++ b/third_party/dragonbox/src
@@ -0,0 +1 @@ +Subproject commit 6c7c925b571d54486b9ffae8d9d18a822801cbda
diff --git a/third_party/ffmpeg b/third_party/ffmpeg index 2a253f5..01f2364 160000 --- a/third_party/ffmpeg +++ b/third_party/ffmpeg
@@ -1 +1 @@ -Subproject commit 2a253f5db8a0acfb705b3a0fa387a1e225956e09 +Subproject commit 01f23648c6b84de6c0f717fa4e1816f53b9ee72e
diff --git a/third_party/hunspell/google/bdict_reader.cc b/third_party/hunspell/google/bdict_reader.cc index 387502c..7d276495 100644 --- a/third_party/hunspell/google/bdict_reader.cc +++ b/third_party/hunspell/google/bdict_reader.cc
@@ -384,10 +384,10 @@ NodeReader* result) const { size_t child_offset; if (is_lookup_32()) { - child_offset = base::numerics::U32FromLittleEndian( + child_offset = base::U32FromLittleEndian( bdict_data_.subspan(zeroth_entry_offset()).first<4>()); } else { - child_offset = base::numerics::U16FromLittleEndian( + child_offset = base::U16FromLittleEndian( bdict_data_.subspan(zeroth_entry_offset()).first<2>()); child_offset += node_offset_; } @@ -416,7 +416,7 @@ size_t child_offset = 0; if (is_lookup_32()) { // Table contains 32-bit absolute offsets. - child_offset = base::numerics::U32FromLittleEndian( + child_offset = base::U32FromLittleEndian( bdict_data_.subspan(table_offset + index * sizeof(uint32_t)) .first<4>()); if (!child_offset) { @@ -424,7 +424,7 @@ } } else { // Table contains 16-bit offsets relative to the current node. - child_offset = base::numerics::U16FromLittleEndian( + child_offset = base::U16FromLittleEndian( bdict_data_.subspan(table_offset + index * sizeof(uint16_t)) .first<2>()); if (!child_offset) { @@ -507,7 +507,7 @@ // The children begin right after the list. size_t children_begin = list_begin + list_item_count() * 3; offset = children_begin + - base::numerics::U16FromLittleEndian(list_item.subspan<1>()); + base::U16FromLittleEndian(list_item.subspan<1>()); } else { auto list_item = bdict_data_.subspan(list_begin + index * 2).first<2>(); *found_char = list_item[0];
diff --git a/third_party/ink/BUILD.gn b/third_party/ink/BUILD.gn index 2020671..0e869f43 100644 --- a/third_party/ink/BUILD.gn +++ b/third_party/ink/BUILD.gn
@@ -78,8 +78,6 @@ "src/ink/geometry/triangle.h", "src/ink/geometry/vec.cc", "src/ink/geometry/vec.h", - "src/ink/rendering/bitmap.cc", - "src/ink/rendering/bitmap.h", "src/ink/rendering/skia/common_internal/mesh_specification_data.cc", "src/ink/rendering/skia/common_internal/mesh_specification_data.h", "src/ink/rendering/skia/common_internal/sksl_common_shader_helper_functions.h",
diff --git a/third_party/ink/README.chromium b/third_party/ink/README.chromium index e2d2d93..0c38937 100644 --- a/third_party/ink/README.chromium +++ b/third_party/ink/README.chromium
@@ -1,7 +1,7 @@ Name: Ink URL: https://github.com/google/ink.git Version: N/A -Revision: c542d619a8959415beda5a76fe89ffa2f83df886 +Revision: da9cb551ada1e55309b0ac89b9fbff2d29dbfe1e License: Apache-2.0 License File: LICENSE Shipped: yes
diff --git a/third_party/ink/src b/third_party/ink/src index c542d61..da9cb55 160000 --- a/third_party/ink/src +++ b/third_party/ink/src
@@ -1 +1 @@ -Subproject commit c542d619a8959415beda5a76fe89ffa2f83df886 +Subproject commit da9cb551ada1e55309b0ac89b9fbff2d29dbfe1e
diff --git a/third_party/ink_stroke_modeler/README.chromium b/third_party/ink_stroke_modeler/README.chromium index 0b47011..9080f54 100644 --- a/third_party/ink_stroke_modeler/README.chromium +++ b/third_party/ink_stroke_modeler/README.chromium
@@ -1,7 +1,7 @@ Name: Ink Stroke Modeler URL: https://github.com/google/ink-stroke-modeler Version: N/A -Revision: f61f28792a00c9bdcb3489fec81d8fd0ca1cbaba +Revision: 03db1ed37b8b10b47d62ed0fa142d198a3861689 License: Apache-2.0 License File: LICENSE Shipped: yes
diff --git a/third_party/ink_stroke_modeler/src b/third_party/ink_stroke_modeler/src index f61f2879..03db1ed 160000 --- a/third_party/ink_stroke_modeler/src +++ b/third_party/ink_stroke_modeler/src
@@ -1 +1 @@ -Subproject commit f61f28792a00c9bdcb3489fec81d8fd0ca1cbaba +Subproject commit 03db1ed37b8b10b47d62ed0fa142d198a3861689
diff --git a/third_party/jetstream/main b/third_party/jetstream/main index ed6dfc1..0976dde 160000 --- a/third_party/jetstream/main +++ b/third_party/jetstream/main
@@ -1 +1 @@ -Subproject commit ed6dfc1d181e9003ad095d0fb914a8c961fc54da +Subproject commit 0976ddeae0863ef5fb3f9ad09906224b0989f9ad
diff --git a/third_party/jni_zero/.clang-format-ignore b/third_party/jni_zero/.clang-format-ignore new file mode 100644 index 0000000..9694e0f --- /dev/null +++ b/third_party/jni_zero/.clang-format-ignore
@@ -0,0 +1 @@ +# Void parent level config to enable formatting.
diff --git a/third_party/libvpx/BUILD.gn b/third_party/libvpx/BUILD.gn index d8b7235..dc2466f 100644 --- a/third_party/libvpx/BUILD.gn +++ b/third_party/libvpx/BUILD.gn
@@ -559,7 +559,7 @@ sources = libvpx_srcs_arm public_deps = [ ":libvpx_arm_headers" ] } - } else if (current_cpu == "arm64" || current_cpu == "arm64") { + } else if (current_cpu == "arm64" || current_cpu == "arm64e") { if (is_chromeos || is_win || is_mac || is_ios) { sources = libvpx_srcs_arm64_highbd public_deps = [ ":libvpx_arm64_highbd_headers" ]
diff --git a/third_party/libxml/DEPS b/third_party/libxml/DEPS index 6dcfa157..2586e8b 100644 --- a/third_party/libxml/DEPS +++ b/third_party/libxml/DEPS
@@ -1,3 +1,9 @@ include_rules = [ '+libxml', ] + +specific_include_rules = { + "memory.h": [ + "+../../libxml.h", + ], +}
diff --git a/third_party/libxml/README.chromium b/third_party/libxml/README.chromium index b3ada2d..92f91c1 100644 --- a/third_party/libxml/README.chromium +++ b/third_party/libxml/README.chromium
@@ -1,8 +1,8 @@ Name: libxml URL: http://xmlsoft.org -Version: 169857ad264e51d9b34d7119d2e2e006e35e60c2 -Revision: 169857ad264e51d9b34d7119d2e2e006e35e60c2 -CPEPrefix: cpe:/a:xmlsoft:libxml2:2.14.0 +Version: 2.14.2 +Revision: 0e145ae4881c2a05ae00128a3bd90d76d4dadc4b +CPEPrefix: cpe:/a:xmlsoft:libxml2:2.14.2 License: MIT License File: src/Copyright Security Critical: yes
diff --git a/third_party/libxml/chromium/counted_by.patch b/third_party/libxml/chromium/counted_by.patch deleted file mode 100644 index 83450727..0000000 --- a/third_party/libxml/chromium/counted_by.patch +++ /dev/null
@@ -1,50 +0,0 @@ -From 32b70e255e10067bb9666129973d5c067eacd290 Mon Sep 17 00:00:00 2001 -From: Daniel Cheng <dcheng@chromium.org> -Date: Wed, 5 Feb 2025 15:06:34 -0800 -Subject: [PATCH] Use __has_attribute to check for __counted_by__ support - -The initial clang patch to support __counted_by__ was landed and -reverted several times. There are some clang toolchains (e.g. the -Android toolchain) that report themselves as version 18 but do not -support __counted_by__. While it is debatable if Android should be -shipping a pre-release clang, using __has_attribute should be a bit -simpler overall. - -Note that this doesn't migrate everything else to use __has_attribute: -while clang has always supported __has_attribute, gcc didn't support -it until a bit later. - -Change-Id: I4a612f6373ec298c4bf9793a74e4c3a9e9a30591 ---- - third_party/libxml/src/libxml.h | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/third_party/libxml/src/libxml.h b/third_party/libxml/src/libxml.h -index 1fe3825f4d3f8..dde9a9c92f014 100644 ---- a/third_party/libxml/src/libxml.h -+++ b/third_party/libxml/src/libxml.h -@@ -29,6 +29,12 @@ - #include "config.h" - #include <libxml/xmlversion.h> - -+#if defined(__has_attribute) -+#define XML_HAS_ATTRIBUTE(x) __has_attribute(x) -+#else -+#define XML_HAS_ATTRIBUTE(x) 0 -+#endif -+ - #if !defined(_WIN32) && \ - !defined(__CYGWIN__) && \ - (defined(__clang__) || \ -@@ -48,8 +54,8 @@ - #define ATTRIBUTE_DESTRUCTOR __attribute__((destructor)) - #endif - --#if (defined(__clang__) && __clang_major__ >= 18) || \ -- (defined(__GNUC__) && __GNUC__ >= 15) -+#if XML_HAS_ATTRIBUTE(__counted_by__) - #define ATTRIBUTE_COUNTED_BY(c) __attribute__((__counted_by__(c))) - #else - #define ATTRIBUTE_COUNTED_BY(c) --- -2.48.1.502.g6dc24dfdaf-goog
diff --git a/third_party/libxml/chromium/remove-getentropy.patch b/third_party/libxml/chromium/remove-getentropy.patch index d32ad05..5fd8390 100644 --- a/third_party/libxml/chromium/remove-getentropy.patch +++ b/third_party/libxml/chromium/remove-getentropy.patch
@@ -5,51 +5,78 @@ generation behavior before a recent libxml upstream patch. diff --git a/dict.c b/dict.c -index ccd8b542..6273437e 100644 +index 1ef18701..bf2298b2 100644 --- a/dict.c +++ b/dict.c -@@ -928,13 +928,8 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) { +@@ -932,16 +932,8 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) { #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include <windows.h> - #include <bcrypt.h> --#elif HAVE_DECL_GETENTROPY -- #include <unistd.h> -- #include <sys/random.h> -#else +- #if HAVE_DECL_GETENTROPY +- /* POSIX 2024 */ +- #include <unistd.h> +- /* Older platforms */ +- #include <sys/random.h> +- #endif - #include <time.h> #endif +#include <time.h> static xmlMutex xmlRngMutex; -@@ -951,25 +946,6 @@ xmlInitRandom(void) { +@@ -958,49 +950,8 @@ xmlInitRandom(void) { xmlInitMutex(&xmlRngMutex); { -#ifdef _WIN32 - NTSTATUS status; - +- /* +- * You can find many (recent as of 2025) discussions how +- * to get a pseudo-random seed on Windows in projects like +- * Golang, Rust, Chromium and Firefox. +- * +- * TODO: Support ProcessPrng available since Windows 10. +- */ - status = BCryptGenRandom(NULL, (unsigned char *) globalRngState, - sizeof(globalRngState), - BCRYPT_USE_SYSTEM_PREFERRED_RNG); - if (!BCRYPT_SUCCESS(status)) - xmlAbort("libxml2: BCryptGenRandom failed with error code %lu\n", - GetLastError()); --#elif HAVE_DECL_GETENTROPY +-#else + int var; + +-#if HAVE_DECL_GETENTROPY - while (1) { - if (getentropy(globalRngState, sizeof(globalRngState)) == 0) +- return; +- +- /* +- * This most likely means that libxml2 was compiled on +- * a system supporting certain system calls and is running +- * on a system that doesn't support these calls, as can +- * be the case on Linux. +- */ +- if (errno == ENOSYS) - break; - +- /* +- * We really don't want to fallback to the unsafe PRNG +- * for possibly accidental reasons, so we abort on any +- * unknown error. +- */ - if (errno != EINTR) - xmlAbort("libxml2: getentropy failed with error code %d\n", - errno); - } --#else - int var; +-#endif - globalRngState[0] = -@@ -978,7 +954,6 @@ xmlInitRandom(void) { + /* + * TODO: Fallback to /dev/urandom for older POSIX systems. +@@ -1011,7 +962,6 @@ xmlInitRandom(void) { globalRngState[1] = HASH_ROL((unsigned) ((size_t) &xmlRngMutex & 0xFFFFFFFF), 16) ^ HASH_ROL((unsigned) ((size_t) &var & 0xFFFFFFFF), 24);
diff --git a/third_party/libxml/chromium/roll.py b/third_party/libxml/chromium/roll.py index b4a3aba..2a52ab9 100755 --- a/third_party/libxml/chromium/roll.py +++ b/third_party/libxml/chromium/roll.py
@@ -74,7 +74,6 @@ PATCHES = [ 'undo-sax-deprecation.patch', 'remove-getentropy.patch', - 'counted_by.patch', ] @@ -117,6 +116,7 @@ ('--without-xinclude', 'xinclude=no'), ('--without-xptr', 'xptr=no'), ('--without-zlib', 'zlib=no'), + ('--without-relaxng', 'relaxng=no'), ]
diff --git a/third_party/libxml/linux/config.h b/third_party/libxml/linux/config.h index 8139523..3ded926e 100644 --- a/third_party/libxml/linux/config.h +++ b/third_party/libxml/linux/config.h
@@ -1,15 +1,15 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define to 1 if you have the declaration of `getentropy', and to 0 if you +/* Define to 1 if you have the declaration of 'getentropy', and to 0 if you don't. */ #define HAVE_DECL_GETENTROPY 1 -/* Define to 1 if you have the declaration of `glob', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'glob', and to 0 if you don't. */ #define HAVE_DECL_GLOB 1 -/* Define to 1 if you have the declaration of `mmap', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'mmap', and to 0 if you don't. */ #define HAVE_DECL_MMAP 1 @@ -83,7 +83,7 @@ #define PACKAGE_NAME "libxml2" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxml2 2.14.0" +#define PACKAGE_STRING "libxml2 2.14.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxml2" @@ -92,15 +92,15 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.14.0" +#define PACKAGE_VERSION "2.14.2" -/* Define to 1 if all of the C90 standard headers exist (not just the ones +/* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.14.0" +#define VERSION "2.14.2" /* System configuration directory (/etc) */ #define XML_SYSCONFDIR "/usr/local/etc"
diff --git a/third_party/libxml/linux/include/libxml/xmlversion.h b/third_party/libxml/linux/include/libxml/xmlversion.h index 35176fcc..7abb039 100644 --- a/third_party/libxml/linux/include/libxml/xmlversion.h +++ b/third_party/libxml/linux/include/libxml/xmlversion.h
@@ -15,21 +15,21 @@ * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.14.0" +#define LIBXML_DOTTED_VERSION "2.14.2" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 21400 +#define LIBXML_VERSION 21402 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "21400" +#define LIBXML_VERSION_STRING "21402" /** * LIBXML_VERSION_EXTRA: @@ -44,7 +44,7 @@ * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(21400); +#define LIBXML_TEST_VERSION xmlCheckVersion(21402); /** * LIBXML_THREAD_ENABLED: @@ -155,11 +155,9 @@ /** * LIBXML_LEGACY_ENABLED: * - * Whether the deprecated APIs are compiled in for compatibility + * Removed in 2.14 */ -#if 0 -#define LIBXML_LEGACY_ENABLED -#endif +#undef LIBXML_LEGACY_ENABLED /** * LIBXML_C14N_ENABLED: @@ -245,11 +243,9 @@ /** * LIBXML_UNICODE_ENABLED: * - * Whether the Unicode related interfaces are compiled in + * Removed in 2.14 */ -#if 0 -#define LIBXML_UNICODE_ENABLED -#endif +#undef LIBXML_UNICODE_ENABLED /** * LIBXML_REGEXP_ENABLED: @@ -270,6 +266,15 @@ #endif /** + * LIBXML_RELAXNG_ENABLED: + * + * Whether the RelaxNG validation interfaces are compiled in + */ +#if 0 +#define LIBXML_RELAXNG_ENABLED +#endif + +/** * LIBXML_SCHEMAS_ENABLED: * * Whether the Schemas validation interfaces are compiled in
diff --git a/third_party/libxml/linux/xml2-config b/third_party/libxml/linux/xml2-config index 9da2eeb..90a574a 100755 --- a/third_party/libxml/linux/xml2-config +++ b/third_party/libxml/linux/xml2-config
@@ -58,7 +58,7 @@ ;; --version) - echo 2.14.0 + echo 2.14.2 exit 0 ;;
diff --git a/third_party/libxml/mac/config.h b/third_party/libxml/mac/config.h index 6307dacc..3ded926e 100644 --- a/third_party/libxml/mac/config.h +++ b/third_party/libxml/mac/config.h
@@ -83,7 +83,7 @@ #define PACKAGE_NAME "libxml2" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxml2 2.14.0" +#define PACKAGE_STRING "libxml2 2.14.2" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxml2" @@ -92,7 +92,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.14.0" +#define PACKAGE_VERSION "2.14.2" /* Define to 1 if all of the C89 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for @@ -100,7 +100,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "2.14.0" +#define VERSION "2.14.2" /* System configuration directory (/etc) */ #define XML_SYSCONFDIR "/usr/local/etc"
diff --git a/third_party/libxml/mac/include/libxml/xmlversion.h b/third_party/libxml/mac/include/libxml/xmlversion.h index 35176fcc..7abb039 100644 --- a/third_party/libxml/mac/include/libxml/xmlversion.h +++ b/third_party/libxml/mac/include/libxml/xmlversion.h
@@ -15,21 +15,21 @@ * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.14.0" +#define LIBXML_DOTTED_VERSION "2.14.2" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 21400 +#define LIBXML_VERSION 21402 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "21400" +#define LIBXML_VERSION_STRING "21402" /** * LIBXML_VERSION_EXTRA: @@ -44,7 +44,7 @@ * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(21400); +#define LIBXML_TEST_VERSION xmlCheckVersion(21402); /** * LIBXML_THREAD_ENABLED: @@ -155,11 +155,9 @@ /** * LIBXML_LEGACY_ENABLED: * - * Whether the deprecated APIs are compiled in for compatibility + * Removed in 2.14 */ -#if 0 -#define LIBXML_LEGACY_ENABLED -#endif +#undef LIBXML_LEGACY_ENABLED /** * LIBXML_C14N_ENABLED: @@ -245,11 +243,9 @@ /** * LIBXML_UNICODE_ENABLED: * - * Whether the Unicode related interfaces are compiled in + * Removed in 2.14 */ -#if 0 -#define LIBXML_UNICODE_ENABLED -#endif +#undef LIBXML_UNICODE_ENABLED /** * LIBXML_REGEXP_ENABLED: @@ -270,6 +266,15 @@ #endif /** + * LIBXML_RELAXNG_ENABLED: + * + * Whether the RelaxNG validation interfaces are compiled in + */ +#if 0 +#define LIBXML_RELAXNG_ENABLED +#endif + +/** * LIBXML_SCHEMAS_ENABLED: * * Whether the Schemas validation interfaces are compiled in
diff --git a/third_party/libxml/src/Copyright b/third_party/libxml/src/Copyright index f76a86df..8c0b7c1 100644 --- a/third_party/libxml/src/Copyright +++ b/third_party/libxml/src/Copyright
@@ -3,6 +3,7 @@ notices) all the files are: Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. + Copyright (C) The Libxml2 Contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
diff --git a/third_party/libxml/src/HTMLparser.c b/third_party/libxml/src/HTMLparser.c index 43c5bee..2260ef1 100644 --- a/third_party/libxml/src/HTMLparser.c +++ b/third_party/libxml/src/HTMLparser.c
@@ -41,10 +41,12 @@ #include "private/error.h" #include "private/html.h" #include "private/io.h" +#include "private/memory.h" #include "private/parser.h" #include "private/tree.h" #define HTML_MAX_NAMELEN 1000 +#define HTML_MAX_ATTRS 100000000 /* 100 million */ #define HTML_PARSER_BIG_BUFFER_SIZE 1000 #define HTML_PARSER_BUFFER_SIZE 100 @@ -62,6 +64,12 @@ #define IS_ALNUM(c) \ (IS_ASCII_LETTER(c) || IS_ASCII_DIGIT(c)) +typedef enum { + INSERT_INITIAL = 1, + INSERT_IN_HEAD = 3, + INSERT_IN_BODY = 10 +} htmlInsertMode; + typedef const unsigned htmlAsciiMask[2]; static htmlAsciiMask MASK_DQ = { @@ -153,20 +161,25 @@ static int htmlnamePush(htmlParserCtxtPtr ctxt, const xmlChar * value) { - if ((ctxt->html < 3) && (xmlStrEqual(value, BAD_CAST "head"))) - ctxt->html = 3; - if ((ctxt->html < 10) && (xmlStrEqual(value, BAD_CAST "body"))) - ctxt->html = 10; + if ((ctxt->html < INSERT_IN_HEAD) && (xmlStrEqual(value, BAD_CAST "head"))) + ctxt->html = INSERT_IN_HEAD; + if ((ctxt->html < INSERT_IN_BODY) && (xmlStrEqual(value, BAD_CAST "body"))) + ctxt->html = INSERT_IN_BODY; if (ctxt->nameNr >= ctxt->nameMax) { - size_t newSize = ctxt->nameMax * 2; const xmlChar **tmp; + int newSize; - tmp = xmlRealloc((xmlChar **) ctxt->nameTab, - newSize * sizeof(ctxt->nameTab[0])); - if (tmp == NULL) { + newSize = xmlGrowCapacity(ctxt->nameMax, sizeof(tmp[0]), + 10, XML_MAX_ITEMS); + if (newSize < 0) { htmlErrMemory(ctxt); return (-1); } + tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0])); + if (tmp == NULL) { + htmlErrMemory(ctxt); + return(-1); + } ctxt->nameTab = tmp; ctxt->nameMax = newSize; } @@ -214,17 +227,22 @@ htmlNodeInfoPush(htmlParserCtxtPtr ctxt, htmlParserNodeInfo *value) { if (ctxt->nodeInfoNr >= ctxt->nodeInfoMax) { - if (ctxt->nodeInfoMax == 0) - ctxt->nodeInfoMax = 5; - ctxt->nodeInfoMax *= 2; - ctxt->nodeInfoTab = (htmlParserNodeInfo *) - xmlRealloc((htmlParserNodeInfo *)ctxt->nodeInfoTab, - ctxt->nodeInfoMax * - sizeof(ctxt->nodeInfoTab[0])); - if (ctxt->nodeInfoTab == NULL) { + xmlParserNodeInfo *tmp; + int newSize; + + newSize = xmlGrowCapacity(ctxt->nodeInfoMax, sizeof(tmp[0]), + 5, XML_MAX_ITEMS); + if (newSize < 0) { htmlErrMemory(ctxt); return (0); } + tmp = xmlRealloc(ctxt->nodeInfoTab, newSize * sizeof(tmp[0])); + if (tmp == NULL) { + htmlErrMemory(ctxt); + return (0); + } + ctxt->nodeInfoTab = tmp; + ctxt->nodeInfoMax = newSize; } ctxt->nodeInfoTab[ctxt->nodeInfoNr] = *value; ctxt->nodeInfo = &ctxt->nodeInfoTab[ctxt->nodeInfoNr]; @@ -367,7 +385,8 @@ } static int -htmlValidateUtf8(xmlParserCtxtPtr ctxt, const xmlChar *str, size_t len) { +htmlValidateUtf8(xmlParserCtxtPtr ctxt, const xmlChar *str, size_t len, + int partial) { unsigned c = str[0]; int size; @@ -412,7 +431,8 @@ return(size); incomplete: - return(0); + if (partial) + return(0); invalid: /* Only report the first error */ @@ -1151,19 +1171,6 @@ }; /* - * The list of HTML elements which are supposed not to have - * CDATA content and where a p element will be implied - * - * TODO: extend that list by reading the HTML SGML DTD on - * implied paragraph - */ -static const char *const htmlNoContentElements[] = { - "html", - "head", - NULL -}; - -/* * The list of HTML attributes which are of content %Script; * NOTE: when adding ones, check htmlIsScriptAttribute() since * it assumes the name starts with 'on' @@ -1520,7 +1527,7 @@ (xmlStrEqual(newtag, BAD_CAST"link")) || (xmlStrEqual(newtag, BAD_CAST"title")) || (xmlStrEqual(newtag, BAD_CAST"base")))) { - if (ctxt->html >= 3) { + if (ctxt->html >= INSERT_IN_HEAD) { /* we already saw or generated an <head> before */ return; } @@ -1534,7 +1541,7 @@ } else if ((!xmlStrEqual(newtag, BAD_CAST"noframes")) && (!xmlStrEqual(newtag, BAD_CAST"frame")) && (!xmlStrEqual(newtag, BAD_CAST"frameset"))) { - if (ctxt->html >= 10) { + if (ctxt->html >= INSERT_IN_BODY) { /* we already saw or generated a <body> before */ return; } @@ -1554,48 +1561,22 @@ } /** - * htmlCheckParagraph + * htmlStartCharData * @ctxt: an HTML parser context * - * Check whether a p element need to be implied before inserting - * characters in the current element. - * - * Returns 1 if a paragraph has been inserted, 0 if not and -1 - * in case of error. + * Prepare for non-whitespace character data. */ -static int -htmlCheckParagraph(htmlParserCtxtPtr ctxt) { - const xmlChar *tag; - int i; - - if (ctxt == NULL) - return(-1); - if (ctxt->options & HTML_PARSE_HTML5) - return(0); - - tag = ctxt->name; - if (tag == NULL) { - htmlAutoClose(ctxt, BAD_CAST"p"); - htmlCheckImplied(ctxt, BAD_CAST"p"); - htmlnamePush(ctxt, BAD_CAST"p"); - if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL)) - ctxt->sax->startElement(ctxt->userData, BAD_CAST"p", NULL); - return(1); - } +static void +htmlStartCharData(htmlParserCtxtPtr ctxt) { + if (ctxt->options & (HTML_PARSE_NOIMPLIED | HTML_PARSE_HTML5)) + return; if (!htmlOmittedDefaultValue) - return(0); - for (i = 0; htmlNoContentElements[i] != NULL; i++) { - if (xmlStrEqual(tag, BAD_CAST htmlNoContentElements[i])) { - htmlAutoClose(ctxt, BAD_CAST"p"); - htmlCheckImplied(ctxt, BAD_CAST"p"); - htmlnamePush(ctxt, BAD_CAST"p"); - if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL)) - ctxt->sax->startElement(ctxt->userData, BAD_CAST"p", NULL); - return(1); - } - } - return(0); + return; + + if (xmlStrEqual(ctxt->name, BAD_CAST "head")) + htmlAutoClose(ctxt, BAD_CAST "p"); + htmlCheckImplied(ctxt, BAD_CAST "p"); } /** @@ -1976,7 +1957,7 @@ } /** - * UTF8ToHtml: + * htmlUTF8ToHtml: * @out: a pointer to an array of bytes to store the result * @outlen: the length of @out * @in: a pointer to an array of UTF-8 chars @@ -1991,8 +1972,8 @@ * The value of @outlen after return is the number of octets consumed. */ int -UTF8ToHtml(unsigned char* out, int *outlen, - const unsigned char* in, int *inlen) { +htmlUTF8ToHtml(unsigned char* out, int *outlen, + const unsigned char* in, int *inlen) { const unsigned char* instart = in; const unsigned char* inend; unsigned char* outstart = out; @@ -2412,7 +2393,7 @@ buf[nbchar++] = c; } } else { - size = htmlValidateUtf8(ctxt, in, avail); + size = htmlValidateUtf8(ctxt, in, avail, /* partial */ 0); if (size > 0) { if (nbchar + size <= HTML_PARSER_BUFFER_SIZE) { @@ -2787,7 +2768,14 @@ if ((input->flags & XML_INPUT_HAS_ENCODING) == 0) { xmlChar * guess; + if (in > chunk) + goto next_chunk; + +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + guess = NULL; +#else guess = htmlFindEncoding(ctxt); +#endif if (guess == NULL) { xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1); } else { @@ -2796,10 +2784,11 @@ } input->flags |= XML_INPUT_HAS_ENCODING; + eof = PARSER_PROGRESSIVE(ctxt); goto restart; } - size = htmlValidateUtf8(ctxt, in, avail); + size = htmlValidateUtf8(ctxt, in, avail, /* partial */ 0); if (size <= 0) { skip = 1; @@ -2835,7 +2824,7 @@ if (extraSize > buffer_size - used) { size_t newSize = (used + extraSize) * 2; - xmlChar *tmp = (xmlChar *) xmlRealloc(buffer, newSize + 1); + xmlChar *tmp = xmlRealloc(buffer, newSize + 1); if (tmp == NULL) { htmlErrMemory(ctxt); @@ -2947,16 +2936,47 @@ if ((mode == 0) || (mode == DATA_RCDATA) || (ctxt->sax->cdataBlock == NULL)) { - int blank = areBlanks(ctxt, buf, size); + if ((ctxt->name == NULL) || + (xmlStrEqual(ctxt->name, BAD_CAST "html")) || + (xmlStrEqual(ctxt->name, BAD_CAST "head"))) { + int i; - if ((mode == 0) && (blank > 0) && (!ctxt->keepBlanks)) { + /* + * Add leading whitespace to html or head elements before + * calling htmlStartCharData. + */ + for (i = 0; i < size; i++) + if (!IS_WS_HTML(buf[i])) + break; + + if (i > 0) { + if (!ctxt->keepBlanks) { + if (ctxt->sax->ignorableWhitespace != NULL) + ctxt->sax->ignorableWhitespace(ctxt->userData, buf, i); + } else { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, buf, i); + } + + buf += i; + size -= i; + } + + if (size <= 0) + return; + + htmlStartCharData(ctxt); + + if (PARSER_STOPPED(ctxt)) + return; + } + + if ((mode == 0) && + (!ctxt->keepBlanks) && + (areBlanks(ctxt, buf, size) > 0)) { if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, - buf, size); + ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size); } else { - if ((mode == 0) && (blank < 0)) - htmlCheckParagraph(ctxt); - if (ctxt->sax->characters != NULL) ctxt->sax->characters(ctxt->userData, buf, size); } @@ -2971,13 +2991,15 @@ /** * htmlParseCharData: * @ctxt: an HTML parser context - * @terminate: true if the input buffer is complete + * @partial: true if the input buffer is incomplete * * Parse character data and references. + * + * Returns 1 if all data was parsed, 0 otherwise. */ static int -htmlParseCharData(htmlParserCtxtPtr ctxt) { +htmlParseCharData(htmlParserCtxtPtr ctxt, int partial) { xmlParserInputPtr input = ctxt->input; xmlChar utf8Char[4]; int complete = 0; @@ -3030,6 +3052,11 @@ } if (avail == 0) { + if ((partial) && (ncr)) { + in -= ncrSize; + ncrSize = 0; + } + done = 1; break; } @@ -3092,6 +3119,7 @@ case '<': if (mode == 0) { done = 1; + complete = 1; goto next_chunk; } if (mode == DATA_PLAINTEXT) @@ -3148,8 +3176,7 @@ } } - if ((mode != 0) && (PARSER_PROGRESSIVE(ctxt))) { - in += 1; + if ((partial) && (j >= avail)) { done = 1; goto next_chunk; } @@ -3169,6 +3196,11 @@ mode = DATA_SCRIPT; } + if ((partial) && (j >= avail)) { + done = 1; + goto next_chunk; + } + break; case '&': @@ -3196,6 +3228,28 @@ } } } else { + if (partial) { + int terminated = 0; + size_t i; + + /* + * ∳ has 33 bytes. + */ + for (i = 1; i < avail; i++) { + if ((i >= 32) || + (!IS_ASCII_LETTER(in[i]) && + ((i < 2) || !IS_ASCII_DIGIT(in[i])))) { + terminated = 1; + break; + } + } + + if (!terminated) { + done = 1; + goto next_chunk; + } + } + repl = htmlFindEntityPrefix(in + j, avail - j, /* isAttr */ 0, @@ -3208,6 +3262,11 @@ skip = 0; } + if ((partial) && (j >= avail)) { + done = 1; + goto next_chunk; + } + break; case '\0': @@ -3222,6 +3281,11 @@ break; case '\r': + if (partial && avail < 2) { + done = 1; + goto next_chunk; + } + skip = 1; if (in[1] != 0x0A) { repl = BAD_CAST "\x0A"; @@ -3236,7 +3300,14 @@ if ((input->flags & XML_INPUT_HAS_ENCODING) == 0) { xmlChar * guess; + if (in > chunk) + goto next_chunk; + +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + guess = NULL; +#else guess = htmlFindEncoding(ctxt); +#endif if (guess == NULL) { xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1); } else { @@ -3245,10 +3316,16 @@ } input->flags |= XML_INPUT_HAS_ENCODING; + eof = PARSER_PROGRESSIVE(ctxt); goto restart; } - size = htmlValidateUtf8(ctxt, in, avail); + size = htmlValidateUtf8(ctxt, in, avail, partial); + + if ((partial) && (size == 0)) { + done = 1; + goto next_chunk; + } if (size <= 0) { skip = 1; @@ -3804,47 +3881,49 @@ if (nbatts + 4 > maxatts) { const xmlChar **tmp; unsigned *utmp; - size_t newSize = maxatts ? maxatts * 2 : 22; + int newSize; - tmp = xmlMalloc(newSize * sizeof(tmp[0])); + newSize = xmlGrowCapacity(maxatts, + sizeof(tmp[0]) * 2 + sizeof(utmp[0]), + 11, HTML_MAX_ATTRS); + if (newSize < 0) { + htmlErrMemory(ctxt); + goto failed; + } +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + if (newSize < 2) + newSize = 2; +#endif + tmp = xmlRealloc(atts, newSize * sizeof(tmp[0]) * 2); if (tmp == NULL) { htmlErrMemory(ctxt); - if (attvalue != NULL) - xmlFree(attvalue); goto failed; } + atts = tmp; + ctxt->atts = tmp; - utmp = xmlRealloc(ctxt->attallocs, - newSize / 2 * sizeof(utmp[0])); + utmp = xmlRealloc(ctxt->attallocs, newSize * sizeof(utmp[0])); if (utmp == NULL) { htmlErrMemory(ctxt); - if (attvalue != NULL) - xmlFree(attvalue); - xmlFree(tmp); goto failed; } - - if (maxatts > 0) - memcpy(tmp, atts, maxatts * sizeof(tmp[0])); - xmlFree(atts); - - atts = tmp; - maxatts = newSize; - ctxt->atts = atts; ctxt->attallocs = utmp; + + maxatts = newSize * 2; ctxt->maxatts = maxatts; } ctxt->attallocs[nbatts/2] = hattname.hashValue; atts[nbatts++] = attname; atts[nbatts++] = attvalue; - } - else { - if (attvalue != NULL) - xmlFree(attvalue); + + attvalue = NULL; } failed: + if (attvalue != NULL) + xmlFree(attvalue); + SKIP_BLANKS; } @@ -3907,11 +3986,25 @@ atts[nbatts] = NULL; atts[nbatts + 1] = NULL; + /* + * Apple's new libiconv is so broken that you routinely run into + * issues when fuzz testing (by accident with an uninstrumented + * libiconv). Here's a harmless (?) example: + * + * printf '>' | iconv -f shift_jis -t utf-8 | hexdump -C + * printf '\xfc\x00\x00' | iconv -f shift_jis -t utf-8 | hexdump -C + * printf '>\xfc\x00\x00' | iconv -f shift_jis -t utf-8 | hexdump -C + * + * The last command fails to detect the illegal sequence. + */ +#if !defined(__APPLE__) || \ + !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) /* * Handle specific association to the META tag */ if (meta) htmlCheckMeta(ctxt, atts); +#endif } /* @@ -3967,6 +4060,15 @@ SKIP(2); + if (ctxt->input->cur >= ctxt->input->end) { + htmlStartCharData(ctxt); + if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && + (ctxt->sax->characters != NULL)) + ctxt->sax->characters(ctxt->userData, + BAD_CAST "</", 2); + return; + } + if (CUR == '>') { SKIP(1); return; @@ -4118,14 +4220,14 @@ } else if (IS_ASCII_LETTER(NXT(1))) { htmlParseElementInternal(ctxt); } else { - htmlCheckParagraph(ctxt); + htmlStartCharData(ctxt); if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && (ctxt->sax->characters != NULL)) ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1); SKIP(1); } } else { - htmlParseCharData(ctxt); + htmlParseCharData(ctxt, /* partial */ 0); } SHRINK; @@ -4254,6 +4356,13 @@ } } +/** + * htmlCtxtParseContentInternal: + * @ctxt: parser context + * @input: parser input + * + * Returns a node list. + */ xmlNodePtr htmlCtxtParseContentInternal(htmlParserCtxtPtr ctxt, xmlParserInputPtr input) { xmlNodePtr root; @@ -4276,6 +4385,11 @@ htmlParseContent(ctxt); + /* + * Only check for truncated multi-byte sequences + */ + xmlParserCheckEOF(ctxt, XML_ERR_INTERNAL_ERROR); + /* TODO: Use xmlCtxtIsCatastrophicError */ if (ctxt->errNo != XML_ERR_NO_MEMORY) { xmlNodePtr cur; @@ -4325,8 +4439,14 @@ xmlDetectEncoding(ctxt); /* - * This is wrong but matches long-standing behavior. In most cases, - * a document starting with an XML declaration will specify UTF-8. + * TODO: Implement HTML5 prescan algorithm + */ + + /* + * This is wrong but matches long-standing behavior. In most + * cases, a document starting with an XML declaration will + * specify UTF-8. The HTML5 prescan algorithm handles + * XML declarations in a better way. */ if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) && (xmlStrncmp(ctxt->input->cur, BAD_CAST "<?xm", 4) == 0)) @@ -4394,11 +4514,9 @@ htmlParseContent(ctxt); /* - * autoclose + * Only check for truncated multi-byte sequences */ - if (CUR == 0) - htmlAutoCloseOnEnd(ctxt); - + xmlParserCheckEOF(ctxt, XML_ERR_INTERNAL_ERROR); /* * SAX: end of the document processing. @@ -4443,6 +4561,12 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt, const htmlSAXHandler *sax, void *userData) { +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + size_t initialNodeTabSize = 1; +#else + size_t initialNodeTabSize = 10; +#endif + if (ctxt == NULL) return(-1); memset(ctxt, 0, sizeof(htmlParserCtxt)); @@ -4465,11 +4589,11 @@ /* Allocate the Input stack */ ctxt->inputTab = (htmlParserInputPtr *) - xmlMalloc(5 * sizeof(htmlParserInputPtr)); + xmlMalloc(sizeof(htmlParserInputPtr)); if (ctxt->inputTab == NULL) return(-1); ctxt->inputNr = 0; - ctxt->inputMax = 5; + ctxt->inputMax = 1; ctxt->input = NULL; ctxt->version = NULL; ctxt->encoding = NULL; @@ -4477,19 +4601,19 @@ ctxt->instate = XML_PARSER_START; /* Allocate the Node stack */ - ctxt->nodeTab = (htmlNodePtr *) xmlMalloc(10 * sizeof(htmlNodePtr)); + ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(htmlNodePtr)); if (ctxt->nodeTab == NULL) return(-1); ctxt->nodeNr = 0; - ctxt->nodeMax = 10; + ctxt->nodeMax = initialNodeTabSize; ctxt->node = NULL; /* Allocate the Name stack */ - ctxt->nameTab = (const xmlChar **) xmlMalloc(10 * sizeof(xmlChar *)); + ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *)); if (ctxt->nameTab == NULL) return(-1); ctxt->nameNr = 0; - ctxt->nameMax = 10; + ctxt->nameMax = initialNodeTabSize; ctxt->name = NULL; ctxt->nodeInfoTab = NULL; @@ -4501,7 +4625,7 @@ ctxt->replaceEntities = 0; ctxt->linenumbers = xmlLineNumbersDefaultValue; ctxt->keepBlanks = xmlKeepBlanksDefaultValue; - ctxt->html = 1; + ctxt->html = INSERT_INITIAL; ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT; ctxt->vctxt.userData = ctxt; ctxt->vctxt.error = xmlParserValidityError; @@ -4680,7 +4804,7 @@ * * ************************************************************************/ -enum xmlLookupStates { +typedef enum { LSTATE_TAG_NAME = 0, LSTATE_BEFORE_ATTR_NAME, LSTATE_ATTR_NAME, @@ -4689,7 +4813,7 @@ LSTATE_ATTR_VALUE_DQUOTED, LSTATE_ATTR_VALUE_SQUOTED, LSTATE_ATTR_VALUE_UNQUOTED -}; +} xmlLookupStates; /** * htmlParseLookupGt: @@ -4866,8 +4990,14 @@ mark = htmlParseLookupString(ctxt, 2, "--", 2, 0); if (mark < 0) break; + /* + * <!--> is a complete comment, but + * <!--!> is not + * <!---!> is not + * <!----!> is + */ if ((NXT(mark+2) == '>') || - ((NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) { + ((mark >= 4) && (NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) { ctxt->checkIndex = 0; break; } @@ -4891,52 +5021,50 @@ * * Returns zero if no parsing was possible */ -static int +static void htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { - int ret = 0; - htmlParserInputPtr in; - ptrdiff_t avail = 0; - int cur; - - htmlParserNodeInfo node_info; - while (PARSER_STOPPED(ctxt) == 0) { + htmlParserInputPtr in; + size_t avail; in = ctxt->input; if (in == NULL) break; avail = in->end - in->cur; - if ((avail == 0) && (terminate)) { - htmlAutoCloseOnEnd(ctxt); - if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { - /* - * SAX: end of the document processing. - */ - ctxt->instate = XML_PARSER_EOF; - if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) - ctxt->sax->endDocument(ctxt->userData); - } - } - if (avail < 1) - goto done; - cur = in->cur[0]; switch (ctxt->instate) { case XML_PARSER_EOF: /* * Document parsing is done ! */ - goto done; + return; + case XML_PARSER_START: /* + * Very first chars read from the document flow. + */ + if ((!terminate) && (avail < 4)) + return; + + xmlDetectEncoding(ctxt); + + /* + * TODO: Implement HTML5 prescan algorithm + */ + + /* * This is wrong but matches long-standing behavior. In most * cases, a document starting with an XML declaration will - * specify UTF-8. + * specify UTF-8. The HTML5 prescan algorithm handles + * XML declarations in a better way. */ if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) && (xmlStrncmp(ctxt->input->cur, BAD_CAST "<?xm", 4) == 0)) { xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_UTF8); } + /* fall through */ + + case XML_PARSER_XML_DECL: if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) { ctxt->sax->setDocumentLocator(ctxt->userData, (xmlSAXLocator *) &xmlDefaultSAXLocator); @@ -4945,99 +5073,25 @@ (!ctxt->disableSAX)) ctxt->sax->startDocument(ctxt->userData); - /* Allow callback to modify state */ - if (ctxt->instate == XML_PARSER_START) + /* Allow callback to modify state for tests */ + if ((ctxt->instate == XML_PARSER_START) || + (ctxt->instate == XML_PARSER_XML_DECL)) ctxt->instate = XML_PARSER_MISC; break; - case XML_PARSER_START_TAG: { - const xmlChar *name; - int next; - const htmlElemDesc * info; - /* - * not enough chars in buffer - */ - if (avail < 2) - goto done; - cur = in->cur[0]; - next = in->cur[1]; - if (cur != '<') { - ctxt->instate = XML_PARSER_CONTENT; - break; - } - if (next == '/') { - ctxt->instate = XML_PARSER_END_TAG; - ctxt->checkIndex = 0; - break; - } + case XML_PARSER_START_TAG: if ((!terminate) && (htmlParseLookupGt(ctxt) < 0)) - goto done; + return; - /* Capture start position */ - if (ctxt->record_info) { - node_info.begin_pos = ctxt->input->consumed + - (CUR_PTR - ctxt->input->base); - node_info.begin_line = ctxt->input->line; - } - - - htmlParseStartTag(ctxt); - name = ctxt->name; - if (name == NULL) - break; - - /* - * Check for an Empty Element labeled the XML/SGML way - */ - if ((CUR == '/') && (NXT(1) == '>')) { - SKIP(2); - htmlParserFinishElementParsing(ctxt); - if ((ctxt->options & HTML_PARSE_HTML5) == 0) { - if ((ctxt->sax != NULL) && - (ctxt->sax->endElement != NULL)) - ctxt->sax->endElement(ctxt->userData, name); - } - htmlnamePop(ctxt); - ctxt->instate = XML_PARSER_CONTENT; - break; - } - - if (CUR != '>') - break; - SKIP(1); - - /* - * Lookup the info for that element. - */ - info = htmlTagLookup(name); - - /* - * Check for an Empty Element from DTD definition - */ - if ((info != NULL) && (info->empty)) { - htmlParserFinishElementParsing(ctxt); - if ((ctxt->options & HTML_PARSE_HTML5) == 0) { - if ((ctxt->sax != NULL) && - (ctxt->sax->endElement != NULL)) - ctxt->sax->endElement(ctxt->userData, name); - } - htmlnamePop(ctxt); - } - - if (info != NULL) - ctxt->endCheckState = info->dataMode; - - if (ctxt->record_info) - htmlNodeInfoPush(ctxt, &node_info); + htmlParseElementInternal(ctxt); ctxt->instate = XML_PARSER_CONTENT; break; - } - case XML_PARSER_MISC: - case XML_PARSER_PROLOG: - case XML_PARSER_CONTENT: - case XML_PARSER_EPILOG: { + + case XML_PARSER_MISC: /* initial */ + case XML_PARSER_PROLOG: /* before html */ + case XML_PARSER_CONTENT: { int mode; if ((ctxt->instate == XML_PARSER_MISC) || @@ -5047,34 +5101,22 @@ } if (avail < 1) - goto done; - cur = in->cur[0]; + return; + /* + * Note that endCheckState is also used by + * xmlParseLookupGt. + */ mode = ctxt->endCheckState; if (mode != 0) { - while ((PARSER_STOPPED(ctxt) == 0) && - (in->cur < in->end)) { - size_t extra; - - extra = strlen((const char *) ctxt->name) + 2; - - if ((!terminate) && - (htmlParseLookupString(ctxt, 0, "<", 1, - extra) < 0)) - goto done; - ctxt->checkIndex = 0; - - if (htmlParseCharData(ctxt)) - break; - } - - break; - } else if (cur == '<') { + if (htmlParseCharData(ctxt, !terminate) == 0) + return; + } else if (in->cur[0] == '<') { int next; if (avail < 2) { if (!terminate) - goto done; + return; next = ' '; } else { next = in->cur[1]; @@ -5082,18 +5124,19 @@ if (next == '!') { if ((!terminate) && (avail < 4)) - goto done; + return; if ((in->cur[2] == '-') && (in->cur[3] == '-')) { if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0)) - goto done; + return; SKIP(4); htmlParseComment(ctxt, /* bogus */ 0); + /* don't change state */ break; } if ((!terminate) && (avail < 9)) - goto done; + return; if ((UPP(2) == 'D') && (UPP(3) == 'O') && (UPP(4) == 'C') && (UPP(5) == 'T') && (UPP(6) == 'Y') && (UPP(7) == 'P') && @@ -5101,36 +5144,36 @@ if ((!terminate) && (htmlParseLookupString(ctxt, 9, ">", 1, 0) < 0)) - goto done; + return; htmlParseDocTypeDecl(ctxt); if (ctxt->instate == XML_PARSER_MISC) ctxt->instate = XML_PARSER_PROLOG; + else + ctxt->instate = XML_PARSER_CONTENT; } else { + ctxt->instate = XML_PARSER_CONTENT; if ((!terminate) && (htmlParseLookupString(ctxt, 2, ">", 1, 0) < 0)) - goto done; + return; SKIP(2); htmlParseComment(ctxt, /* bogus */ 1); } } else if (next == '?') { if ((!terminate) && (htmlParseLookupString(ctxt, 2, ">", 1, 0) < 0)) - goto done; + return; SKIP(1); htmlParseComment(ctxt, /* bogus */ 1); + /* don't change state */ } else if (next == '/') { ctxt->instate = XML_PARSER_END_TAG; ctxt->checkIndex = 0; - break; } else if (IS_ASCII_LETTER(next)) { - if ((!terminate) && (next == 0)) - goto done; ctxt->instate = XML_PARSER_START_TAG; ctxt->checkIndex = 0; - break; } else { ctxt->instate = XML_PARSER_CONTENT; - htmlCheckParagraph(ctxt); + htmlStartCharData(ctxt); if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && (ctxt->sax->characters != NULL)) ctxt->sax->characters(ctxt->userData, @@ -5138,41 +5181,32 @@ SKIP(1); } } else { + ctxt->instate = XML_PARSER_CONTENT; /* - * check that the text sequence is complete - * before handing out the data to the parser - * to avoid problems with erroneous end of - * data detection. + * We follow the logic of the XML push parser */ - if ((!terminate) && - (htmlParseLookupString(ctxt, 0, "<", 1, 0) < 0)) - goto done; + if (avail < HTML_PARSER_BIG_BUFFER_SIZE) { + if ((!terminate) && + (htmlParseLookupString(ctxt, 0, "<", 1, 0) < 0)) + return; + } ctxt->checkIndex = 0; - htmlParseCharData(ctxt); + if (htmlParseCharData(ctxt, !terminate) == 0) + return; } break; } + case XML_PARSER_END_TAG: - if ((terminate) && (avail == 2)) { - htmlCheckParagraph(ctxt); - if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && - (ctxt->sax->characters != NULL)) - ctxt->sax->characters(ctxt->userData, - BAD_CAST "</", 2); - goto done; - } if ((!terminate) && (htmlParseLookupGt(ctxt) < 0)) - goto done; + return; htmlParseEndTag(ctxt); - if (ctxt->nameNr == 0) { - ctxt->instate = XML_PARSER_EPILOG; - } else { - ctxt->instate = XML_PARSER_CONTENT; - } + ctxt->instate = XML_PARSER_CONTENT; ctxt->checkIndex = 0; break; + default: htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR, "HPP: internal error\n", NULL, NULL); @@ -5180,33 +5214,6 @@ break; } } -done: - if ((avail == 0) && (terminate)) { - htmlAutoCloseOnEnd(ctxt); - if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) { - /* - * SAX: end of the document processing. - */ - ctxt->instate = XML_PARSER_EOF; - if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) - ctxt->sax->endDocument(ctxt->userData); - } - } - if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && (ctxt->myDoc != NULL) && - ((terminate) || (ctxt->instate == XML_PARSER_EOF) || - (ctxt->instate == XML_PARSER_EPILOG))) { - xmlDtdPtr dtd; - dtd = xmlGetIntSubset(ctxt->myDoc); - if (dtd == NULL) { - ctxt->myDoc->intSubset = - xmlCreateIntSubset(ctxt->myDoc, BAD_CAST "html", - BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN", - BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd"); - if (ctxt->myDoc->intSubset == NULL) - htmlErrMemory(ctxt); - } - } - return(ret); } /** @@ -5233,12 +5240,15 @@ int htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, int terminate) { - if ((ctxt == NULL) || (ctxt->input == NULL)) + if ((ctxt == NULL) || + (ctxt->input == NULL) || (ctxt->input->buf == NULL) || + (size < 0) || + ((size > 0) && (chunk == NULL))) return(XML_ERR_ARGUMENT); if (PARSER_STOPPED(ctxt) != 0) return(ctxt->errNo); - if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) && - (ctxt->input->buf != NULL)) { + + if (size > 0) { size_t pos = ctxt->input->cur - ctxt->input->base; int res; @@ -5251,14 +5261,37 @@ return (ctxt->errNo); } } + htmlParseTryOrFinish(ctxt, terminate); - if (terminate) { - if (ctxt->instate != XML_PARSER_EOF) { - if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) - ctxt->sax->endDocument(ctxt->userData); - } + + if ((terminate) && (ctxt->instate != XML_PARSER_EOF)) { + htmlAutoCloseOnEnd(ctxt); + + /* + * Only check for truncated multi-byte sequences + */ + xmlParserCheckEOF(ctxt, XML_ERR_INTERNAL_ERROR); + + if ((ctxt->sax) && (ctxt->sax->endDocument != NULL)) + ctxt->sax->endDocument(ctxt->userData); + + if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && + (ctxt->myDoc != NULL)) { + xmlDtdPtr dtd; + dtd = xmlGetIntSubset(ctxt->myDoc); + if (dtd == NULL) { + ctxt->myDoc->intSubset = + xmlCreateIntSubset(ctxt->myDoc, BAD_CAST "html", + BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN", + BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd"); + if (ctxt->myDoc->intSubset == NULL) + htmlErrMemory(ctxt); + } + } + ctxt->instate = XML_PARSER_EOF; } + return((xmlParserErrors) ctxt->errNo); } @@ -5640,7 +5673,7 @@ ctxt->standalone = -1; ctxt->hasExternalSubset = 0; ctxt->hasPErefs = 0; - ctxt->html = 1; + ctxt->html = INSERT_INITIAL; ctxt->instate = XML_PARSER_START; ctxt->wellFormed = 1; @@ -5902,16 +5935,10 @@ return(NULL); } - ctxt->html = 1; + ctxt->html = INSERT_INITIAL; htmlParseDocument(ctxt); - if (ctxt->errNo != XML_ERR_NO_MEMORY) { - ret = ctxt->myDoc; - } else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - } - ctxt->myDoc = NULL; + ret = xmlCtxtGetDocument(ctxt); /* assert(ctxt->inputNr == 1); */ while (ctxt->inputNr > 0)
diff --git a/third_party/libxml/src/HTMLtree.c b/third_party/libxml/src/HTMLtree.c index 06741c21..4173a36 100644 --- a/third_party/libxml/src/HTMLtree.c +++ b/third_party/libxml/src/HTMLtree.c
@@ -333,74 +333,19 @@ #ifdef LIBXML_OUTPUT_ENABLED /************************************************************************ * * - * Output error handlers * - * * - ************************************************************************/ - -/** - * htmlSaveErr: - * @code: the error number - * @node: the location of the error. - * @extra: extra information - * - * Handle an out of memory condition - */ -static void -htmlSaveErr(int code, xmlNodePtr node, const char *extra) -{ - const char *msg = NULL; - int res; - - switch(code) { - case XML_SAVE_NOT_UTF8: - msg = "string is not in UTF-8\n"; - break; - case XML_SAVE_CHAR_INVALID: - msg = "invalid character value\n"; - break; - case XML_SAVE_UNKNOWN_ENCODING: - msg = "unknown encoding %s\n"; - break; - case XML_SAVE_NO_DOCTYPE: - msg = "HTML has no DOCTYPE\n"; - break; - default: - msg = "unexpected error number\n"; - } - - res = xmlRaiseError(NULL, NULL, NULL, NULL, node, - XML_FROM_OUTPUT, code, XML_ERR_ERROR, NULL, 0, - extra, NULL, NULL, 0, 0, - msg, extra); - if (res < 0) - xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_OUTPUT, NULL); -} - -/************************************************************************ - * * * Dumping HTML tree content to a simple buffer * * * ************************************************************************/ -static xmlCharEncodingHandler * -htmlFindOutputEncoder(const char *encoding) { - xmlCharEncodingHandler *handler = NULL; +static xmlParserErrors +htmlFindOutputEncoder(const char *encoding, xmlCharEncodingHandler **out) { + /* + * Fallback to HTML if the encoding is unspecified + */ + if (encoding == NULL) + encoding = "HTML"; - if (encoding != NULL) { - int res; - - res = xmlOpenCharEncodingHandler(encoding, /* output */ 1, - &handler); - if (res != XML_ERR_OK) - htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding); - } else { - /* - * Fallback to HTML when the encoding is unspecified - */ - xmlOpenCharEncodingHandler("HTML", /* output */ 1, &handler); - } - - return(handler); + return(xmlOpenCharEncodingHandler(encoding, /* output */ 1, out)); } /** @@ -508,10 +453,11 @@ /* * save the content to a temp buffer. */ - handler = htmlFindOutputEncoder(encoding); + if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK) + return(-1); buf = xmlOutputBufferCreateFile(out, handler); if (buf == NULL) - return(0); + return(-1); htmlNodeDumpFormatOutput(buf, doc, cur, NULL, format); @@ -559,7 +505,8 @@ return; encoding = (const char *) htmlGetMetaEncoding(cur); - handler = htmlFindOutputEncoder(encoding); + if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK) + return; buf = xmlAllocOutputBuffer(handler); if (buf == NULL) return; @@ -617,10 +564,8 @@ const char *encoding ATTRIBUTE_UNUSED) { xmlDtdPtr cur = doc->intSubset; - if (cur == NULL) { - htmlSaveErr(XML_SAVE_NO_DOCTYPE, (xmlNodePtr) doc, NULL); + if (cur == NULL) return; - } xmlOutputBufferWriteString(buf, "<!DOCTYPE "); xmlOutputBufferWriteString(buf, (const char *)cur->name); if (cur->ExternalID != NULL) { @@ -1025,7 +970,8 @@ } encoding = (const char *) htmlGetMetaEncoding(cur); - handler = htmlFindOutputEncoder(encoding); + if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK) + return(-1); buf = xmlOutputBufferCreateFile(f, handler); if (buf == NULL) return(-1); @@ -1057,10 +1003,11 @@ xmlInitParser(); encoding = (const char *) htmlGetMetaEncoding(cur); - handler = htmlFindOutputEncoder(encoding); + if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK) + return(-1); buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression); if (buf == NULL) - return(0); + return(-1); htmlDocContentDumpOutput(buf, cur, NULL); @@ -1091,7 +1038,8 @@ xmlInitParser(); - handler = htmlFindOutputEncoder(encoding); + if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK) + return(-1); if (handler != NULL) htmlSetMetaEncoding(cur, (const xmlChar *) handler->name); else
diff --git a/third_party/libxml/src/Makefile.am b/third_party/libxml/src/Makefile.am index f7e27d7f..6f98144 100644 --- a/third_party/libxml/src/Makefile.am +++ b/third_party/libxml/src/Makefile.am
@@ -36,9 +36,6 @@ libxml2_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined \ -version-info $(LIBXML_VERSION_INFO) -if USE_VERSION_SCRIPT -libxml2_la_LDFLAGS += $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms -endif libxml2_la_SOURCES = buf.c chvalid.c dict.c entities.c encoding.c error.c \ globals.c hash.c list.c parser.c parserInternals.c \ @@ -68,9 +65,6 @@ if WITH_HTTP_SOURCES libxml2_la_SOURCES += nanohttp.c endif -if WITH_LEGACY_SOURCES -libxml2_la_SOURCES += legacy.c -endif if WITH_LZMA_SOURCES libxml2_la_SOURCES += xzlib.c endif @@ -89,8 +83,11 @@ if WITH_REGEXPS_SOURCES libxml2_la_SOURCES += xmlregexp.c xmlunicode.c endif +if WITH_RELAXNG_SOURCES +libxml2_la_SOURCES += relaxng.c +endif if WITH_SCHEMAS_SOURCES -libxml2_la_SOURCES += relaxng.c xmlschemas.c xmlschemastypes.c +libxml2_la_SOURCES += xmlschemas.c xmlschemastypes.c endif if WITH_SCHEMATRON_SOURCES libxml2_la_SOURCES += schematron.c @@ -139,7 +136,7 @@ runsuite_DEPENDENCIES = $(DEPS) runsuite_LDADD= $(LDADDS) -xmllint_SOURCES = xmllint.c shell.c +xmllint_SOURCES = xmllint.c shell.c lintmain.c xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS) xmllint_DEPENDENCIES = $(DEPS) xmllint_LDADD= $(RDL_LIBS) $(LDADDS) @@ -148,7 +145,7 @@ testModule_DEPENDENCIES = $(DEPS) testModule_LDADD= $(LDADDS) -noinst_LTLIBRARIES = testdso.la +check_LTLIBRARIES = testdso.la testdso_la_SOURCES = testdso.c testdso_la_LDFLAGS = $(AM_LDFLAGS) \ -module -no-undefined -avoid-version -rpath $(libdir) @@ -176,14 +173,16 @@ $(CHECKER) ./testdict$(EXEEXT) $(CHECKER) ./testparser$(EXEEXT) $(CHECKER) ./testModule$(EXEEXT) - $(CHECKER) ./runxmlconf$(EXEEXT) + $(CHECKER) ./runxmlconf$(EXEEXT) -d $(srcdir)/xmlconf $(CHECKER) ./runsuite$(EXEEXT) if WITH_DEBUG_SOURCES test/scripts/test.sh ./xmllint$(EXEEXT) endif if WITH_CATALOG_SOURCES +if WITH_OUTPUT_SOURCES ASAN_OPTIONS=detect_leaks=0 test/catalogs/test.sh ./xmlcatalog$(EXEEXT) endif +endif # Compatibility name of the check target runtests: check @@ -203,7 +202,7 @@ -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;) dist-hook: cleanup - (cd $(srcdir) ; tar -cf - --exclude .git win32 os400 test result) | (cd $(distdir); tar xf -) + (cd $(srcdir) ; tar -cf - --exclude .git win32 test result) | (cd $(distdir); tar xf -) CLEANFILES = runsuite.log runxmlconf.log test.out *.gcda *.gcno *.res DISTCLEANFILES = COPYING missing.lst @@ -213,10 +212,10 @@ html5ent.inc iso8859x.inc \ tools/gentest.py \ tools/genChRanges.py tools/genEscape.py tools/genUnicode.py \ - libxml2.syms timsort.h \ + timsort.h \ README.zOS README.md \ CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in \ - meson.build meson_options.txt + meson.build meson_options.txt xml2-config-meson pkgconfigdir = $(libdir)/pkgconfig
diff --git a/third_party/libxml/src/NEWS b/third_party/libxml/src/NEWS index 9f13094..b96ad0f 100644 --- a/third_party/libxml/src/NEWS +++ b/third_party/libxml/src/NEWS
@@ -1,33 +1,114 @@ NEWS file for libxml2 -v2.14.0: not released yet +v2.14.2: Apr 17 2025 + +### Security + +- [CVE-2025-32415] schemas: Fix heap buffer overflow in + xmlSchemaIDCFillNodeTables +- [CVE-2025-32414] python: Read at most len/4 characters. (Maks Verver) + +### Build + +- error: Fix initGenericErrorDefaultFunc compatibility macro +- meson: don't link with pthreads on Windows (Benjamin Gilbert) +- cmake, meson: Align Darwin version info with Autotools +- globals: Fix --with-thread-alloc build +- meson: ensure relaxng option supports minimum option (Lovell Fuller) + + +v2.14.1: Apr 3 2025 + +### Regressions + +- parser: Fix XML_PARSE_NOBLANKS dropping non-whitespace text + +### Build systems + +- win32-legacy: Fix build (ThomasK) +- meson: Fix build from tarball +- cmake, meson: Change library filename to libxml2.so.16.0.0 + + +v2.14.0: Mar 27 2025 ### Major changes -The HTML tokenizer now conforms fully to HTML5. Note that HTML5 tree -construction isn't implemented yet. +The HTML tokenizer now conforms fully to HTML5. Several non-standard +syntax warnings were removed. Note that HTML5 tree construction isn't +implemented yet. -Input callbacks can now be set on a parser context and an improved API -to create parser input is available. - -A new API function xmlCtxtParseContent to parse XML content using an -existing parser context was added. - -The xmlSave API now has additional options to replace global settings. - -Parser options XML_PARSE_NO_UNZIP, XML_PARSE_NO_SYS_CATALOG and -XML_PARSE_NO_CATALOG_PI were added. +Binary compatibility is restricted to versions 2.14 or newer. On ELF +systems, the soname was bumped from libxml2.so.2 to libxml2.so.16. The serialization API will now take user-provided or default encodings into account when serializing attribute values, matching the serialization of text and avoiding unnecessary escaping. +The XML parser won't try to merge consecutive CDATA sections as before +to align with web standards. Each CDATA section will create exactly one +node or SAX callback. + +Support for RELAX NG can now be disabled with a new configuration +option independently of XML Schemas support. It is still enabled by +default. + +The "legacy" configuration option won't enable support for HTTP and +LZMA anymore. These features will be removed in the next release. + +Parts of the xmllint executable were refactored, allowing the +combination of more options. OOM errors should be reported reliably now. + +Several improvements were made to the build systems. Meson is fully +supported now. + +Parts of the buffering code were reworked and simplified. + +Overflow checks before reallocations were hardenend. + +Some unprefixed symbols were renamed to avoid namespace pollution. + +### Other potentially incompatible changes + +Strings passed to the "characters" callback of the HTML SAX parser +aren't null-terminated anymore, matching the behavior of the XML +parser. Custom SAX parsers must use the "len" argument. + +xmlIOParseDTD doesn't allow null bytes at the end of the input anymore. + +Type and layout of conversion callbacks in struct xmlCharEncodingHandler +were changed. Applications using libxml2's encoding conversion API +should use functions xmlCharEncInFunc and xmlCharEncOutFunc instead of +accessing the callbacks directly. + +### New features + +Input callbacks can now be set on a parser context and an improved API +to create parser input is available. The following new functions, +taking a parser input object, were added: + +- xmlCtxtParseDocument +- xmlCtxtParseContent as replacement for xmlParseBalancedChunkMemory + and xmlParseInNodeContext +- xmlCtxtParseDtd + +The xmlSave API now has additional options to replace global settings. + +Parser options XML_PARSE_UNZIP, XML_PARSE_NO_SYS_CATALOG and +XML_PARSE_CATALOG_PI were added. + An API function to install a custom character encoding converter is now available. This makes it possible to use ICU for encoding conversion -even if libxml2 was complied without ICU support, see example/icu.c. +even if libxml2 was compiled without ICU support, see example/icu.c. + +### Deprecations Access to many public struct members is now deprecated. Several accessor -functions were added. +functions were added to use instead. + +More internal functions were deprecated. + +### Removals Metadata about the HTML4 content model was removed from the htmlElemDesc struct and related functions were deprecated. @@ -35,14 +116,220 @@ The FTP module and related functions were removed. Support for the range and point extensions of the xpointer() scheme -were removed. The rest of the XPointer implementation isn't affected. +was removed. The rest of the XPointer implementation isn't affected. The xpointer() scheme now behaves like the xpath1() scheme. -Several legacy functions were removed from the header files. +Several legacy symbols and the functions in xmlunicode.h were removed. + +Some unprefixed, internal macros like ATTRIBUTE_UNUSED were removed +from public headers. + +ELF version information was removed. The shell was moved from libxml2 to xmllint. Several related functions are no longer available. +The libxml.m4 file containing autoconf macros was removed. + +The --with-tree configuration option was removed. + +The hack to detect single-threaded programs under glibc was removed. + +### Planned removals + +Support for HTTP and LZMA compression is planned to be removed in the +2.15 release. + +The following features are considered for removal: + +- Modules API (xmlmodule.h) +- Schematron support +- Support for zlib compressed file I/O +- Legacy Windows build system in win32 + +RELAX NG support is still in a bad state and a long-term removal +candidate. + +### Thanks + +Thanks to the following contributors: + +- Andrew Potter +- Benjamin Gilbert +- Chun-wei Fan +- correctmost +- Daniel Cheng +- Daniel E +- Florin Haja +- Grzegorz Szymaszek +- Heiko Becker +- Himanshibansal +- Jan Alexander Steffens (heftig) +- Kjell Ahlstedt +- makise-homura +- Markus Rickert +- Mike Dalessio +- Miklos Vajna +- Rosen Penev +- Ruslan Garipov +- Ryan Carsten Schmidt +- Saleem Abdulrasool +- Sam James +- Satadru Pramanik +- Taylor R Campbell +- triallax +- Yegor Yefremov +- Zak Ridouh + + +v2.13.7: Mar 27 2025 + +### Regressions + +- tree: Fix xmlTextMerge with NULL args +- io: Fix `compressed` flag for uncompressed stdin +- parser: Fix parsing of DTD content + + +v2.13.6: Feb 18 2025 + +### Security + +- [CVE-2025-24928] Fix stack-buffer-overflow in xmlSnprintfElements +- [CVE-2024-56171] Fix use-after-free after xmlSchemaItemListAdd +- pattern: Fix compilation of explicit child axis + +### Regressions + +- xmllint: Support compressed input from stdin +- uri: Fix handling of Windows drive letters +- reader: Fix return value of xmlTextReaderReadString again +- SAX2: Fix xmlSAX2ResolveEntity if systemId is NULL + +### Portability + +- dict: Handle ENOSYS from getentropy gracefully +- Fix compilation with uclibc (Dario Binacchi) +- python: Declare init func with PyMODINIT_FUNC +- tests: Fix sanitizer version check on old Apple clang +- cmake: Work around broken sys/random.h in old macOS SDKs + +### Build + +- autotools: Set AC_CONFIG_AUX_DIR +- cmake: Always build Python module as shared library +- cmake: add missing `Bcrypt` link on Windows (Saleem Abdulrasool) +- cmake: Fix compatibility in package version file + + +v2.13.5: Nov 12 2024 + +### Regressions + +- xmlIO: Fix reading from non-regular files like pipes +- xmlreader: Fix return value of xmlTextReaderReadString +- parser: Fix loading of parameter entities in external DTDs +- parser: Fix downstream code that swaps DTDs +- parser: Fix detection of duplicate attributes +- string: Fix va_copy fallback + +### Bug fixes + +- xpath: Fix parsing of non-ASCII names + + +v2.13.4: Sep 18 2024 + +### Regressions + +- parser: Make unsupported encodings an error in declarations +- io: don't set the executable bit when creating files (triallax) +- xmlcatalog: Improved fix for #699 +- Revert "catalog: Fetch XML catalog before dumping" +- io: Add missing calls to xmlInitParser +- tree: Restore return value of xmlNodeListGetString with NULL list +- parser: Fix error handling after reaching limit +- parser: Make xmlParseChunk return an error if parser was stopped + +### Bug fixes + +- python: Fix SAX driver with character streams + +### Improvements + +- xpath: Make recursion check work with xmlXPathCompile +- parser: Report at least one fatal error + +### Portability + +- include: Check whether _MSC_VER is defined + + +v2.13.3: Jul 24 2024 + +### Security + +- [CVE-2024-40896] Fix XXE protection in downstream code + +### Regressions + +- autotools: Use AC_CHECK_DECL to check for getentropy +- xinclude: Fix fallback for text includes +- io: Don't call getcwd in xmlParserGetDirectory +- io: Fix return value of xmlFileRead +- parser: Fix error return of xmlParseBalancedChunkMemory + +### Improvements + +- xinclude: Set error handler when parsing text +- Undeprecate xmlKeepBlanksDefault + + +v2.13.2: Jul 4 2024 + +### Regressions + +- tree: Fix handling of empty strings in xmlNodeParseContent +- valid: Restore ID lookup +- parser: Reenable ctxt->directory +- uri: Handle filesystem paths in xmlBuildRelativeURISafe +- encoding: Make xmlFindCharEncodingHandler return UTF-8 handler +- encoding: Fix encoding lookup with xmlOpenCharEncodingHandler +- include: Define ATTRIBUTE_UNUSED for clang +- uri: Fix xmlBuildURI with NULL base + +### Improvements + +- uri: Enable Windows paths on Cygwin +- tests: Clarify licence of test/intsubset2.xml + + +v2.13.1: Jun 19 2024 + +### Regressions + +- parser: Selectively reenable reading from "-" +- reader: Fix xmlTextReaderReadString +- xinclude: Set XPath context doc +- xinclude: Load included documents with XML_PARSE_DTDLOAD +- include: Don't redefine ATTRIBUTE_UNUSED +- include: Readd circular dependency between tree.h and parser.h +- xinclude: Add missing include (Jan Alexander Steffens (heftig)) +- win32, msvc: fix missing linking against Bcrypt.lib (Miklos Vajna) +- xinclude: Don't raise error on empty nodeset +- parser: Make failure to load main document a warning +- tree: Fix freeing entities via xmlFreeNode +- parser: Pass global object to sax->setDocumentLocator + +### Improvements + +- io: Fix resetting xmlParserInputBufferCreateFilename hook + +### Documentation + +- Fix typo in NEWS (--with-html -> --with-http) (Ryan Carsten Schmidt) +- doc: Don't mention xmlNewInputURL + v2.13.0: Jun 12 2024
diff --git a/third_party/libxml/src/README.md b/third_party/libxml/src/README.md index 904cd298..f5fb7c8a 100644 --- a/third_party/libxml/src/README.md +++ b/third_party/libxml/src/README.md
@@ -10,7 +10,9 @@ <https://gitlab.gnome.org/GNOME/libxml2> Bugs should be reported at -<https://gitlab.gnome.org/GNOME/libxml2/-/issues> +<https://gitlab.gnome.org/GNOME/libxml2/-/issues>. +Please report *security issues* to our bug tracker as well. Make sure to +mark the issue as *confidential*. Documentation is available at <https://gitlab.gnome.org/GNOME/libxml2/-/wikis> @@ -21,8 +23,7 @@ ## Build instructions -libxml2 can be built with GNU Autotools, CMake, meson or several other -build systems in platform-specific subdirectories. +libxml2 can be built with GNU Autotools, CMake or meson. ### Autotools (for POSIX systems like Linux, BSD, macOS) @@ -61,8 +62,9 @@ --with-python Python bindings (on) --with-reader xmlReader parsing interface (on) --with-regexps regular expressions support (on) + --with-relaxng RELAX NG support (on) --with-sax1 older SAX1 interface (on) - --with-schemas XML Schemas 1.0 and RELAX NG support (on) + --with-schemas XML Schemas 1.0 support (on) --with-schematron Schematron support (on) --with-threads multithreading support (on) --with-thread-alloc per-thread malloc hooks (off) @@ -98,12 +100,13 @@ ### CMake (mainly for Windows) -Another option for compiling libxml is using CMake: +Example commands: - cmake -E tar xf libxml2-xxx.tar.gz - cmake -S libxml2-xxx -B libxml2-xxx-build [possible options] - cmake --build libxml2-xxx-build - cmake --install libxml2-xxx-build + cmake -E tar xf libxml2-xxx.tar.xz + cmake -S libxml2-xxx -B builddir [options] + cmake --build builddir + ctest --test-dir builddir + cmake --install builddir Common CMake options include: @@ -111,40 +114,28 @@ -D CMAKE_BUILD_TYPE=Release # specify build type -D CMAKE_INSTALL_PREFIX=/usr/local # specify the install path -D LIBXML2_WITH_ICONV=OFF # disable iconv - -D LIBXML2_WITH_LZMA=OFF # disable liblzma -D LIBXML2_WITH_PYTHON=OFF # disable Python - -D LIBXML2_WITH_ZLIB=OFF # disable libz + -D LIBXML2_WITH_ZLIB=ON # enable zlib You can also open the libxml source directory with its CMakeLists.txt directly in various IDEs such as CLion, QtCreator, or Visual Studio. ### Meson -Still somewhat experimental, see -[issue 743](https://gitlab.gnome.org/GNOME/libxml2/-/issues/743). +Example commands: -Libxml can also be built with meson. Without option, simply call - - meson setup builddir + meson setup [options] builddir ninja -C builddir - -To add options, see the meson_options.txt file. For example: - - meson setup \ - -Dprefix=$prefix \ - -Dhistory=enabled \ - -Dhttp=enabled \ - -Dschematron=disabled \ - -Dzlib=enabled \ - builddir - -To install libxml: - + meson test -C builddir ninja -C builddir install -To launch tests: +See the `meson_options.txt` file for options. For example: - meson test -C builddir + -Dprefix=$prefix + -Dhistory=enabled + -Dhttp=enabled + -Dschematron=disabled + -Dzlib=enabled ## Dependencies
diff --git a/third_party/libxml/src/SAX2.c b/third_party/libxml/src/SAX2.c index 21a6b4e0..b5c2e47 100644 --- a/third_party/libxml/src/SAX2.c +++ b/third_party/libxml/src/SAX2.c
@@ -21,7 +21,6 @@ #include <libxml/valid.h> #include <libxml/entities.h> #include <libxml/xmlerror.h> -#include <libxml/debugXML.h> #include <libxml/xmlIO.h> #include <libxml/uri.h> #include <libxml/valid.h> @@ -289,6 +288,11 @@ const xmlChar *oldencoding; unsigned long consumed; size_t buffered; +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + int inputMax = 1; +#else + int inputMax = 5; +#endif /* * Ask the Entity resolver to load the damn thing @@ -316,14 +320,13 @@ oldencoding = ctxt->encoding; ctxt->encoding = NULL; - ctxt->inputTab = (xmlParserInputPtr *) - xmlMalloc(5 * sizeof(xmlParserInputPtr)); + ctxt->inputTab = xmlMalloc(inputMax * sizeof(xmlParserInputPtr)); if (ctxt->inputTab == NULL) { xmlSAX2ErrMemory(ctxt); goto error; } ctxt->inputNr = 0; - ctxt->inputMax = 5; + ctxt->inputMax = inputMax; ctxt->input = NULL; if (xmlCtxtPushInput(ctxt, input) < 0) goto error; @@ -2481,7 +2484,7 @@ (lastChild->type == type) && (((ctxt->html) && (type != XML_TEXT_NODE)) || (lastChild->name == xmlStringText)); - if ((coalesceText) && (ctxt->nodemem != 0)) { + if ((coalesceText) && (ctxt->nodemem > 0)) { int maxLength = (ctxt->options & XML_PARSE_HUGE) ? XML_MAX_HUGE_LENGTH : XML_MAX_TEXT_LENGTH; @@ -2566,7 +2569,7 @@ else { lastChild->line = USHRT_MAX; if (ctxt->options & XML_PARSE_BIG_LINES) - lastChild->psvi = (void *) (ptrdiff_t) ctxt->input->line; + lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line); } } }
diff --git a/third_party/libxml/src/VERSION b/third_party/libxml/src/VERSION index edcfe40d..7243b12c 100644 --- a/third_party/libxml/src/VERSION +++ b/third_party/libxml/src/VERSION
@@ -1 +1 @@ -2.14.0 +2.14.2
diff --git a/third_party/libxml/src/buf.c b/third_party/libxml/src/buf.c index ebab442..f24a819 100644 --- a/third_party/libxml/src/buf.c +++ b/third_party/libxml/src/buf.c
@@ -622,6 +622,7 @@ /** * xmlBufBackToBuffer: * @buf: new buffer wrapping the old one + * @ret: old buffer * * Function to be called once internal processing had been done to * update back the buffer provided by the user. This can lead to @@ -629,7 +630,7 @@ * than what an xmlBuffer can support on 64 bits (INT_MAX) * The xmlBufPtr @buf wrapper is deallocated by this call in any case. * - * Returns the old xmlBufferPtr unless the call failed and NULL is returned + * Returns 0 on success, -1 on error. */ int xmlBufBackToBuffer(xmlBufPtr buf, xmlBufferPtr ret) { @@ -1091,7 +1092,7 @@ * Add a string range to an XML buffer. if len == -1, the length of * str is recomputed. * - * Returns a xmlParserError code. + * Returns a xmlParserErrors code. */ int xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) { @@ -1123,7 +1124,7 @@ * Add a string range to the beginning of an XML buffer. * if len == -1, the length of @str is recomputed. * - * Returns a xmlParserError code. + * Returns a xmlParserErrors code. */ int xmlBufferAddHead(xmlBufferPtr buf, const xmlChar *str, int len) {
diff --git a/third_party/libxml/src/configure.ac b/third_party/libxml/src/configure.ac index 7c47778d..d21ebfe 100644 --- a/third_party/libxml/src/configure.ac +++ b/third_party/libxml/src/configure.ac
@@ -7,6 +7,7 @@ AC_CONFIG_SRCDIR([entities.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_AUX_DIR([.]) AC_CANONICAL_HOST LIBXML_VERSION=version_macro @@ -16,7 +17,7 @@ LIBXML_MICRO_VERSION_SUFFIX= # The oldest minor version we are compatible with. -LIBXML_MINOR_COMPAT=0 +LIBXML_MINOR_COMPAT=14 LIBXML_CURRENT=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION` LIBXML_AGE=`expr $LIBXML_MINOR_VERSION - $LIBXML_MINOR_COMPAT` LIBXML_VERSION_INFO=$LIBXML_CURRENT:$LIBXML_MICRO_VERSION:$LIBXML_AGE @@ -40,7 +41,7 @@ AC_SUBST(LIBXML_VERSION_NUMBER) AC_SUBST(LIBXML_VERSION_EXTRA) -AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz]) +AM_INIT_AUTOMAKE([1.16.3 foreign subdir-objects no-dist-gzip dist-xz]) AM_MAINTAINER_MODE([enable]) AM_SILENT_RULES([yes]) @@ -99,10 +100,12 @@ [ --with-reader xmlReader parsing interface (on)]) AC_ARG_WITH(regexps, [ --with-regexps regular expressions support (on)]) +AC_ARG_WITH(relaxng, +[ --with-relaxng RELAX NG support (on)]) AC_ARG_WITH(sax1, [ --with-sax1 older SAX1 interface (on)]) AC_ARG_WITH(schemas, -[ --with-schemas XML Schemas 1.0 and RELAX NG support (on)]) +[ --with-schemas XML Schemas 1.0 support (on)]) AC_ARG_WITH(schematron, [ --with-schematron Schematron support (on)]) AC_ARG_WITH(threads, @@ -134,12 +137,6 @@ dnl Legacy defaults dnl if test "$with_legacy" = "yes"; then - if test "$with_http" = ""; then - with_http=yes - fi - if test "$with_lzma" = ""; then - with_lzma=yes - fi if test "$with_zlib" = ""; then with_zlib=yes fi @@ -158,6 +155,16 @@ fi with_xpath=yes fi +if test "$with_relaxng" = "yes"; then + if test "$with_regexps" = "no"; then + echo WARNING: --with-relaxng overrides --without-regexps + fi + with_regexps=yes + if test "$with_schemas" = "no"; then + echo WARNING: --with-relaxng overrides --without-schemas + fi + with_schemas=yes +fi if test "$with_schemas" = "yes"; then if test "$with_pattern" = "no"; then echo WARNING: --with-schemas overrides --without-pattern @@ -194,12 +201,6 @@ fi with_push=yes fi -if test "$with_xinclude" = "yes"; then - if test "$with_xpath" = "no"; then - echo WARNING: --with-xinclude overrides --without-xpath - fi - with_xpath=yes -fi if test "$with_xptr" = "yes"; then if test "$with_xpath" = "no"; then echo WARNING: --with-xptr overrides --without-xpath @@ -237,6 +238,7 @@ test "$with_reader" = "" && with_reader=no test "$with_readline" = "" && with_readline=no test "$with_regexps" = "" && with_regexps=no + test "$with_relaxng" = "" && with_relaxng=no test "$with_sax1" = "" && with_sax1=no test "$with_schemas" = "" && with_schemas=no test "$with_schematron" = "" && with_schematron=no @@ -266,12 +268,15 @@ with_writer=no fi if test "$with_regexps" = "no"; then + with_relaxng=no with_schemas=no fi + if test "$with_schemas" = "no"; then + with_relaxng=no + fi if test "$with_xpath" = "no"; then with_c14n=no with_schematron=no - with_xinclude=no with_xptr=no fi fi @@ -349,33 +354,6 @@ fi dnl -dnl Linker version scripts for symbol versioning -dnl -VERSION_SCRIPT_FLAGS= -if test "$with_legacy" = "yes"; then - # lt_cv_prog_gnu_ld is from libtool 2.+ - if test "$lt_cv_prog_gnu_ld" = yes; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-msys* ) - ;; - *) - dnl lld 16 defaults to --no-undefined-version but the version - dnl script can contain symbols disabled by configuration - dnl options. - AX_APPEND_LINK_FLAGS([-Wl,--undefined-version], [VERSION_SCRIPT_FLAGS]) - AX_APPEND_FLAG([-Wl,--version-script=], [VERSION_SCRIPT_FLAGS]) - ;; - esac - else - case $host in - *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";; - esac - fi - AC_SUBST(VERSION_SCRIPT_FLAGS) -fi -AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"]) - -dnl dnl Workaround for native compilers dnl HP : http://bugs.gnome.org/db/31/3163.html dnl DEC : Enable NaN/Inf @@ -441,15 +419,6 @@ AC_SUBST(WITH_HTTP) AM_CONDITIONAL(WITH_HTTP_SOURCES, test "$WITH_HTTP" = "1") -if test "$with_legacy" != "yes" ; then - WITH_LEGACY=0 -else - echo Enabling deprecated APIs - WITH_LEGACY=1 -fi -AC_SUBST(WITH_LEGACY) -AM_CONDITIONAL(WITH_LEGACY_SOURCES, test "$WITH_LEGACY" = "1") - if test "$with_reader" = "no" ; then echo Disabling the xmlReader parsing interface WITH_READER=0 @@ -583,8 +552,17 @@ fi AC_SUBST(WITH_ISO8859X) +if test "$with_relaxng" = "no" ; then + echo "Disabling Relax-NG support" + WITH_RELAXNG=0 +else + WITH_RELAXNG=1 +fi +AC_SUBST(WITH_RELAXNG) +AM_CONDITIONAL(WITH_RELAXNG_SOURCES, test "$WITH_RELAXNG" = "1") + if test "$with_schemas" = "no" ; then - echo "Disabling Schemas/Relax-NG support" + echo "Disabling Schemas support" WITH_SCHEMAS=0 else WITH_SCHEMAS=1
diff --git a/third_party/libxml/src/dict.c b/third_party/libxml/src/dict.c index 6273437..bf2298b 100644 --- a/third_party/libxml/src/dict.c +++ b/third_party/libxml/src/dict.c
@@ -700,7 +700,7 @@ const xmlChar *name, int maybeLen, int update) { xmlDictEntry *entry = NULL; const xmlChar *ret; - unsigned hashValue; + unsigned hashValue, newSize; size_t maxLen, len, plen, klen; int found = 0; @@ -727,10 +727,21 @@ /* * Check for an existing entry */ - if (dict->size > 0) + if (dict->size == 0) { + newSize = MIN_HASH_SIZE; + } else { entry = xmlDictFindEntry(dict, prefix, name, klen, hashValue, &found); - if (found) - return(entry); + if (found) + return(entry); + + if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) { + if (dict->size >= MAX_HASH_SIZE) + return(NULL); + newSize = dict->size * 2; + } else { + newSize = 0; + } + } if ((dict->subdict != NULL) && (dict->subdict->size > 0)) { xmlDictEntry *subEntry; @@ -754,16 +765,9 @@ /* * Grow the hash table if needed */ - if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) { - unsigned newSize, mask, displ, pos; + if (newSize > 0) { + unsigned mask, displ, pos; - if (dict->size == 0) { - newSize = MIN_HASH_SIZE; - } else { - if (dict->size >= MAX_HASH_SIZE) - return(NULL); - newSize = dict->size * 2; - } if (xmlDictGrow(dict, newSize) != 0) return(NULL); @@ -948,6 +952,10 @@ { int var; + + /* + * TODO: Fallback to /dev/urandom for older POSIX systems. + */ globalRngState[0] = (unsigned) time(NULL) ^ HASH_ROL((unsigned) ((size_t) &xmlInitRandom & 0xFFFFFFFF), 8); @@ -1008,10 +1016,6 @@ */ unsigned xmlRandom(void) { -#ifdef LIBXML_THREAD_ENABLED return(xoroshiro64ss(xmlGetLocalRngState())); -#else - return(xmlGlobalRandom()); -#endif }
diff --git a/third_party/libxml/src/encoding.c b/third_party/libxml/src/encoding.c index 1c69d7a..a90694f 100644 --- a/third_party/libxml/src/encoding.c +++ b/third_party/libxml/src/encoding.c
@@ -45,12 +45,14 @@ #include "private/enc.h" #include "private/entities.h" #include "private/error.h" +#include "private/memory.h" #ifdef LIBXML_ICU_ENABLED #include <unicode/ucnv.h> #endif -#define XML_HANDLER_STATIC 1 +#define XML_HANDLER_STATIC (1 << 0) +#define XML_HANDLER_LEGACY (1 << 1) typedef struct _xmlCharEncodingAlias xmlCharEncodingAlias; typedef xmlCharEncodingAlias *xmlCharEncodingAliasPtr; @@ -110,36 +112,36 @@ { "UTF8", XML_CHAR_ENCODING_UTF8 } }; -static int -asciiToAscii(unsigned char* out, int *outlen, - const unsigned char* in, int *inlen, void *vctxt); -static int -UTF8ToUTF8(unsigned char* out, int *outlen, - const unsigned char* inb, int *inlenb, void *vctxt); -static int -latin1ToUTF8(unsigned char* out, int *outlen, - const unsigned char* in, int *inlen, void *vctxt); -static int -UTF16LEToUTF8(unsigned char* out, int *outlen, - const unsigned char* inb, int *inlenb, void *vctxt); -static int -UTF16BEToUTF8(unsigned char* out, int *outlen, - const unsigned char* inb, int *inlenb, void *vctxt); +static xmlCharEncError +asciiToAscii(void *vctxt, unsigned char* out, int *outlen, + const unsigned char* in, int *inlen, int flush); +static xmlCharEncError +UTF8ToUTF8(void *vctxt, unsigned char* out, int *outlen, + const unsigned char* inb, int *inlenb, int flush); +static xmlCharEncError +latin1ToUTF8(void *vctxt, unsigned char* out, int *outlen, + const unsigned char* in, int *inlen, int flush); +static xmlCharEncError +UTF16LEToUTF8(void *vctxt, unsigned char* out, int *outlen, + const unsigned char* inb, int *inlenb, int flush); +static xmlCharEncError +UTF16BEToUTF8(void *vctxt, unsigned char* out, int *outlen, + const unsigned char* inb, int *inlenb, int flush); #ifdef LIBXML_OUTPUT_ENABLED -static int -UTF8ToLatin1(unsigned char* outb, int *outlen, - const unsigned char* in, int *inlen, void *vctxt); -static int -UTF8ToUTF16(unsigned char* outb, int *outlen, - const unsigned char* in, int *inlen, void *vctxt); -static int -UTF8ToUTF16LE(unsigned char* outb, int *outlen, - const unsigned char* in, int *inlen, void *vctxt); -static int -UTF8ToUTF16BE(unsigned char* outb, int *outlen, - const unsigned char* in, int *inlen, void *vctxt); +static xmlCharEncError +UTF8ToLatin1(void *vctxt, unsigned char* outb, int *outlen, + const unsigned char* in, int *inlen, int flush); +static xmlCharEncError +UTF8ToUTF16(void *vctxt, unsigned char* outb, int *outlen, + const unsigned char* in, int *inlen, int flush); +static xmlCharEncError +UTF8ToUTF16LE(void *vctxt, unsigned char* outb, int *outlen, + const unsigned char* in, int *inlen, int flush); +static xmlCharEncError +UTF8ToUTF16BE(void *vctxt, unsigned char* outb, int *outlen, + const unsigned char* in, int *inlen, int flush); #else /* LIBXML_OUTPUT_ENABLED */ @@ -151,36 +153,27 @@ #endif /* LIBXML_OUTPUT_ENABLED */ #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTML_ENABLED) -static int -UTF8ToHtmlWrapper(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen, void *vctxt); +static xmlCharEncError +UTF8ToHtmlWrapper(void *vctxt, unsigned char *out, int *outlen, + const unsigned char *in, int *inlen, int flush); #else #define UTF8ToHtmlWrapper NULL #endif -#ifdef LIBXML_ICONV_ENABLED - #define EMPTY_ICONV , (iconv_t) 0, (iconv_t) 0 -#else - #define EMPTY_ICONV -#endif - #if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) && \ defined(LIBXML_ISO8859X_ENABLED) #include "iso8859x.inc" -static int -ISO8859xToUTF8(unsigned char* out, int *outlen, - const unsigned char* in, int *inlen, void *vctxt); -static int -UTF8ToISO8859x(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen, void *vctxt); +static xmlCharEncError +ISO8859xToUTF8(void *vctxt, unsigned char* out, int *outlen, + const unsigned char* in, int *inlen, int flush); +static xmlCharEncError +UTF8ToISO8859x(void *vctxt, unsigned char *out, int *outlen, + const unsigned char *in, int *inlen, int flush); #define MAKE_ISO_HANDLER(name, n) \ - { (char *) name, \ - (xmlCharEncodingInputFunc) (void (*)(void)) ISO8859xToUTF8, \ - (xmlCharEncodingInputFunc) (void (*)(void)) UTF8ToISO8859x \ - EMPTY_ICONV, \ + { (char *) name, { ISO8859xToUTF8 }, { UTF8ToISO8859x }, \ (void *) xmlunicodetable_ISO8859_##n, \ (void *) xmltranscodetable_ISO8859_##n, \ NULL, XML_HANDLER_STATIC } @@ -188,16 +181,13 @@ #else /* LIBXML_ISO8859X_ENABLED */ #define MAKE_ISO_HANDLER(name, n) \ - { (char *) name, NULL, NULL EMPTY_ICONV, NULL, NULL, NULL, \ + { (char *) name, { NULL }, { NULL }, NULL, NULL, NULL, \ XML_HANDLER_STATIC } #endif /* LIBXML_ISO8859X_ENABLED */ #define MAKE_HANDLER(name, in, out) \ - { (char *) name, \ - (xmlCharEncodingInputFunc) (void (*)(void)) in, \ - (xmlCharEncodingOutputFunc) (void (*)(void)) out \ - EMPTY_ICONV, NULL, NULL, NULL, XML_HANDLER_STATIC } + { (char *) name, { in }, { out }, NULL, NULL, NULL, XML_HANDLER_STATIC } /* * The layout must match enum xmlCharEncoding. @@ -213,9 +203,9 @@ MAKE_HANDLER("UCS-4LE", NULL, NULL), MAKE_HANDLER("UCS-4BE", NULL, NULL), MAKE_HANDLER("IBM037", NULL, NULL), - MAKE_HANDLER("ISO-10646-UCS-4", NULL, NULL), /* UCS4_2143 */ - MAKE_HANDLER("ISO-10646-UCS-4", NULL, NULL), /* UCS4_2143 */ - MAKE_HANDLER("ISO-10646-UCS-2", NULL, NULL), + MAKE_HANDLER(NULL, NULL, NULL), /* UCS4_2143 */ + MAKE_HANDLER(NULL, NULL, NULL), /* UCS4_3412 */ + MAKE_HANDLER("UCS-2", NULL, NULL), MAKE_HANDLER("ISO-8859-1", latin1ToUTF8, UTF8ToLatin1), MAKE_ISO_HANDLER("ISO-8859-2", 2), MAKE_ISO_HANDLER("ISO-8859-3", 3), @@ -248,13 +238,15 @@ static int nbCharEncodingHandler = 0; #ifdef LIBXML_ICONV_ENABLED -static int -xmlCharEncIconv(void *vctxt, const char *name, xmlCharEncConverter *conv); +static xmlParserErrors +xmlCharEncIconv(const char *name, xmlCharEncFlags flags, + xmlCharEncodingHandler **out); #endif #ifdef LIBXML_ICU_ENABLED -static int -xmlCharEncUconv(void *vctxt, const char *name, xmlCharEncConverter *conv); +static xmlParserErrors +xmlCharEncUconv(const char *name, xmlCharEncFlags flags, + xmlCharEncodingHandler **out); #endif /************************************************************************ @@ -286,12 +278,6 @@ if ((in[0] == 0x3C) && (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x00)) return(XML_CHAR_ENCODING_UCS4LE); - if ((in[0] == 0x00) && (in[1] == 0x00) && - (in[2] == 0x3C) && (in[3] == 0x00)) - return(XML_CHAR_ENCODING_UCS4_2143); - if ((in[0] == 0x00) && (in[1] == 0x3C) && - (in[2] == 0x00) && (in[3] == 0x00)) - return(XML_CHAR_ENCODING_UCS4_3412); if ((in[0] == 0x4C) && (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) return(XML_CHAR_ENCODING_EBCDIC); @@ -424,13 +410,13 @@ if (xmlCharEncodingAliasesNb >= xmlCharEncodingAliasesMax) { xmlCharEncodingAliasPtr tmp; - size_t newSize = xmlCharEncodingAliasesMax ? - xmlCharEncodingAliasesMax * 2 : - 20; + int newSize; - tmp = (xmlCharEncodingAliasPtr) - xmlRealloc(xmlCharEncodingAliases, - newSize * sizeof(xmlCharEncodingAlias)); + newSize = xmlGrowCapacity(xmlCharEncodingAliasesMax, sizeof(tmp[0]), + 20, XML_MAX_ITEMS); + if (newSize < 0) + return(-1); + tmp = xmlRealloc(xmlCharEncodingAliases, newSize * sizeof(tmp[0])); if (tmp == NULL) return(-1); xmlCharEncodingAliases = tmp; @@ -572,9 +558,9 @@ case XML_CHAR_ENCODING_UTF16BE: return("UTF-16"); case XML_CHAR_ENCODING_UCS4LE: - return("ISO-10646-UCS-4"); + return("UCS-4"); case XML_CHAR_ENCODING_UCS4BE: - return("ISO-10646-UCS-4"); + return("UCS-4"); default: break; } @@ -645,15 +631,10 @@ return(NULL); } memset(handler, 0, sizeof(xmlCharEncodingHandler)); - handler->input = input; - handler->output = output; + handler->input.legacyFunc = input; + handler->output.legacyFunc = output; handler->name = up; - handler->flags = XML_HANDLER_STATIC; - -#ifdef LIBXML_ICONV_ENABLED - handler->iconv_in = NULL; - handler->iconv_out = NULL; -#endif + handler->flags = XML_HANDLER_STATIC | XML_HANDLER_LEGACY; /* * registers and returns the handler. @@ -663,6 +644,64 @@ } /** + * xmlCharEncNewCustomHandler: + * @name: the encoding name + * @input: input callback which converts to UTF-8 + * @output: output callback which converts from UTF-8 + * @ctxtDtor: context destructor + * @inputCtxt: context for input callback + * @outputCtxt: context for output callback + * @out: pointer to resulting handler + * + * Create a custom xmlCharEncodingHandler. + * + * Returns an xmlParserErrors code. + */ +xmlParserErrors +xmlCharEncNewCustomHandler(const char *name, + xmlCharEncConvFunc input, xmlCharEncConvFunc output, + xmlCharEncConvCtxtDtor ctxtDtor, + void *inputCtxt, void *outputCtxt, + xmlCharEncodingHandler **out) { + xmlCharEncodingHandler *handler; + + if (out == NULL) + return(XML_ERR_ARGUMENT); + + handler = xmlMalloc(sizeof(*handler)); + if (handler == NULL) + goto error; + memset(handler, 0, sizeof(*handler)); + + if (name != NULL) { + handler->name = xmlMemStrdup(name); + if (handler->name == NULL) + goto error; + } + + handler->input.func = input; + handler->output.func = output; + handler->ctxtDtor = ctxtDtor; + handler->inputCtxt = inputCtxt; + handler->outputCtxt = outputCtxt; + + *out = handler; + return(XML_ERR_OK); + +error: + xmlFree(handler); + + if (ctxtDtor != NULL) { + if (inputCtxt != NULL) + ctxtDtor(inputCtxt); + if (outputCtxt != NULL) + ctxtDtor(outputCtxt); + } + + return(XML_ERR_NO_MEMORY); +} + +/** * xmlInitCharEncodingHandlers: * * DEPRECATED: Alias for xmlInitParser. @@ -753,32 +792,11 @@ } } -static int -xmlInvokeConvImpl(xmlCharEncConvImpl impl, void *implCtxt, - const char *name, xmlCharEncodingHandler *handler) { - xmlCharEncConverter conv = { NULL, NULL, NULL, NULL, NULL }; - int ret; - - ret = impl(implCtxt, name, &conv); - - if (ret == XML_ERR_OK) { - handler->input = - (xmlCharEncodingInputFunc) (void (*)(void)) conv.input; - handler->output = - (xmlCharEncodingOutputFunc) (void (*)(void)) conv.output; - handler->ctxtDtor = conv.ctxtDtor; - handler->inputCtxt = conv.inputCtxt; - handler->outputCtxt = conv.outputCtxt; - } - - return(ret); -} - /** * xmlFindExtraHandler: * @norig: name of the char encoding * @name: potentially aliased name of the encoding - * @output: boolean, use handler for output + * @flags: bit mask of flags * @impl: a conversion implementation (optional) * @implCtxt: user data for conversion implementation (optional) * @out: pointer to resulting handler @@ -787,87 +805,62 @@ * * Returns an xmlParserErrors error code. */ -static int -xmlFindExtraHandler(const char *norig, const char *name, int output, +static xmlParserErrors +xmlFindExtraHandler(const char *norig, const char *name, xmlCharEncFlags flags, xmlCharEncConvImpl impl, void *implCtxt, xmlCharEncodingHandler **out) { - xmlCharEncodingHandler *handler; - int ret; - int i; - - handler = xmlMalloc(sizeof(*handler)); - if (handler == NULL) - return(XML_ERR_NO_MEMORY); - memset(handler, 0, sizeof(*handler)); - - handler->name = xmlMemStrdup(name); - if (handler->name == NULL) { - ret = XML_ERR_NO_MEMORY; - goto done; - } - /* * Try custom implementation before deprecated global handlers. * * Note that we pass the original name without deprecated * alias resolution. */ - if (impl != NULL) { - ret = xmlInvokeConvImpl(impl, implCtxt, norig, handler); - if (ret != XML_ERR_OK) - goto done; - - *out = handler; - return(XML_ERR_OK); - } + if (impl != NULL) + return(impl(implCtxt, norig, flags, out)); /* * Deprecated */ if (globalHandlers != NULL) { + int i; + for (i = 0; i < nbCharEncodingHandler; i++) { xmlCharEncodingHandler *h = globalHandlers[i]; if (!xmlStrcasecmp((const xmlChar *) name, (const xmlChar *) h->name)) { - if ((output ? h->output : h->input) != NULL) { + if ((((flags & XML_ENC_INPUT) == 0) || (h->input.func)) && + (((flags & XML_ENC_OUTPUT) == 0) || (h->output.func))) { *out = h; - ret = XML_ERR_OK; - goto done; + return(XML_ERR_OK); } } } } #ifdef LIBXML_ICONV_ENABLED - ret = xmlInvokeConvImpl(xmlCharEncIconv, handler, name, handler); - if (ret == XML_ERR_OK) { - *out = handler; - return(XML_ERR_OK); + { + int ret = xmlCharEncIconv(name, flags, out); + + if (ret == XML_ERR_OK) + return(XML_ERR_OK); + if (ret != XML_ERR_UNSUPPORTED_ENCODING) + return(ret); } - if (ret != XML_ERR_UNSUPPORTED_ENCODING) - goto done; #endif /* LIBXML_ICONV_ENABLED */ #ifdef LIBXML_ICU_ENABLED - ret = xmlInvokeConvImpl(xmlCharEncUconv, handler, name, handler); - if (ret == XML_ERR_OK) { - *out = handler; - return(XML_ERR_OK); + { + int ret = xmlCharEncUconv(name, flags, out); + + if (ret == XML_ERR_OK) + return(XML_ERR_OK); + if (ret != XML_ERR_UNSUPPORTED_ENCODING) + return(ret); } - if (ret != XML_ERR_UNSUPPORTED_ENCODING) - goto done; #endif /* LIBXML_ICU_ENABLED */ - ret = XML_ERR_UNSUPPORTED_ENCODING; - -done: - if (handler != NULL) { - xmlFree(handler->name); - xmlFree(handler); - } - - return(ret); + return(XML_ERR_UNSUPPORTED_ENCODING); } /** @@ -893,7 +886,7 @@ * Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another * xmlParserErrors error code. */ -int +xmlParserErrors xmlLookupCharEncodingHandler(xmlCharEncoding enc, xmlCharEncodingHandler **out) { const xmlCharEncodingHandler *handler; @@ -911,14 +904,20 @@ return(XML_ERR_OK); handler = &defaultHandlers[enc]; - if ((handler->input != NULL) || (handler->output != NULL)) { + if ((handler->input.func != NULL) || (handler->output.func != NULL)) { *out = (xmlCharEncodingHandler *) handler; return(XML_ERR_OK); } - if (handler->name != NULL) - return(xmlFindExtraHandler(handler->name, handler->name, 0, + if (handler->name != NULL) { + xmlCharEncFlags flags = XML_ENC_INPUT; + +#ifdef LIBXML_OUTPUT_ENABLED + flags |= XML_ENC_OUTPUT; +#endif + return(xmlFindExtraHandler(handler->name, handler->name, flags, NULL, NULL, out)); + } return(XML_ERR_UNSUPPORTED_ENCODING); } @@ -944,7 +943,7 @@ /** * xmlCreateCharEncodingHandler: * @name: a string describing the char encoding. - * @output: boolean, use handler for output + * @flags: bit mask of flags * @impl: a conversion implementation (optional) * @implCtxt: user data for conversion implementation (optional) * @out: pointer to result @@ -963,13 +962,15 @@ * If the encoding is UTF-8, a NULL handler and no error code will * be returned. * + * @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both. + * * Available since 2.14.0. * * Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another * xmlParserErrors error code. */ -int -xmlCreateCharEncodingHandler(const char *name, int output, +xmlParserErrors +xmlCreateCharEncodingHandler(const char *name, xmlCharEncFlags flags, xmlCharEncConvImpl impl, void *implCtxt, xmlCharEncodingHandler **out) { const xmlCharEncodingHandler *handler; @@ -980,7 +981,7 @@ return(XML_ERR_ARGUMENT); *out = NULL; - if (name == NULL) + if ((name == NULL) || (flags == 0)) return(XML_ERR_ARGUMENT); norig = name; @@ -996,13 +997,14 @@ if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) { handler = &defaultHandlers[enc]; - if ((output ? handler->output : handler->input) != NULL) { + if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) && + (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) { *out = (xmlCharEncodingHandler *) handler; return(XML_ERR_OK); } } - return(xmlFindExtraHandler(norig, name, output, impl, implCtxt, out)); + return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out)); } /** @@ -1029,10 +1031,12 @@ * Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another * xmlParserErrors error code. */ -int +xmlParserErrors xmlOpenCharEncodingHandler(const char *name, int output, xmlCharEncodingHandler **out) { - return(xmlCreateCharEncodingHandler(name, output, NULL, NULL, out)); + xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT; + + return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out)); } /** @@ -1051,6 +1055,7 @@ xmlCharEncodingHandlerPtr xmlFindCharEncodingHandler(const char *name) { xmlCharEncodingHandler *ret; + xmlCharEncFlags flags; /* * This handler shouldn't be used, but we must return a non-NULL @@ -1061,7 +1066,11 @@ return((xmlCharEncodingHandlerPtr) &defaultHandlers[XML_CHAR_ENCODING_UTF8]); - xmlOpenCharEncodingHandler(name, 0, &ret); + flags = XML_ENC_INPUT; +#ifdef LIBXML_OUTPUT_ENABLED + flags |= XML_ENC_OUTPUT; +#endif + xmlCreateCharEncodingHandler(name, flags, NULL, NULL, &ret); return(ret); } @@ -1083,16 +1092,18 @@ * @outlen: the length of @out * @in: a pointer to an array of input bytes * @inlen: the length of @in - * - * Returns an XML_ENC_ERR code. + * @flush: end of input * * The value of @inlen after return is the number of octets consumed * as the return value is positive, else unpredictable. * The value of @outlen after return is the number of octets produced. + * + * Returns an XML_ENC_ERR code. */ -static int -xmlIconvConvert(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen, void *vctxt) { +static xmlCharEncError +xmlIconvConvert(void *vctxt, unsigned char *out, int *outlen, + const unsigned char *in, int *inlen, + int flush ATTRIBUTE_UNUSED) { xmlIconvCtxt *ctxt = vctxt; size_t icv_inlen, icv_outlen; const char *icv_in = (const char *) in; @@ -1122,6 +1133,14 @@ */ if (errno == EINVAL) return(XML_ENC_ERR_SUCCESS); +#ifdef __APPLE__ + /* + * Apple's new libiconv can return EOPNOTSUPP under + * unknown circumstances (detected when fuzzing). + */ + if (errno == EOPNOTSUPP) + return(XML_ENC_ERR_INPUT); +#endif return(XML_ENC_ERR_INTERNAL); } return(XML_ENC_ERR_SUCCESS); @@ -1131,71 +1150,145 @@ xmlIconvFree(void *vctxt) { xmlIconvCtxt *ctxt = vctxt; + if (ctxt == NULL) + return; + if (ctxt->cd != (iconv_t) -1) iconv_close(ctxt->cd); xmlFree(ctxt); } +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \ + defined(__GLIBC__) +#include <libxml/parserInternals.h> + static int -xmlCharEncIconv(void *vctxt, const char *name, xmlCharEncConverter *conv) { - xmlCharEncodingHandler *handler = vctxt; +xmlEncodingMatch(const char *name1, const char *name2) { + /* + * Fuzzy match for encoding names + */ + while (1) { + while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1))) + name1 += 1; + while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2))) + name2 += 1; + if ((*name1 == 0) || (*name2 == 0)) + break; + if ((*name1 | 0x20) != (*name2 | 0x20)) + return(0); + name1 += 1; + name2 += 1; + } + + return((*name1 == 0) && (*name2 == 0)); +} +#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */ + +static xmlParserErrors +xmlCharEncIconv(const char *name, xmlCharEncFlags flags, + xmlCharEncodingHandler **out) { + xmlCharEncConvFunc inFunc = NULL, outFunc = NULL; xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL; iconv_t icv_in; iconv_t icv_out; - int ret; + xmlParserErrors ret; - inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt)); - if (inputCtxt == NULL) { - ret = XML_ERR_NO_MEMORY; + /* + * POSIX allows "indicator suffixes" like "//IGNORE" to be + * passed to iconv_open. This can change the behavior in + * unexpected ways. + * + * Many iconv implementations also support non-standard + * codesets like "wchar_t", "char" or the empty string "". + * It would make sense to disallow them, but codeset names + * are matched fuzzily, so a string like "w-C.hA_rt" could + * be interpreted as "wchar_t". + * + * When escaping characters that aren't supported in the + * target encoding, we also rely on GNU libiconv behavior to + * stop conversion without trying any kind of fallback. + * This violates the POSIX spec which says: + * + * > If iconv() encounters a character in the input buffer + * > that is valid, but for which an identical character does + * > not exist in the output codeset [...] iconv() shall + * > perform an implementation-defined conversion on the + * > character. + * + * See: https://sourceware.org/bugzilla/show_bug.cgi?id=29913 + * + * Unfortunately, strict POSIX compliance makes it impossible + * to detect untranslatable characters. + */ + if (strstr(name, "//") != NULL) { + ret = XML_ERR_UNSUPPORTED_ENCODING; goto error; } - inputCtxt->cd = (iconv_t) -1; - icv_in = iconv_open("UTF-8", name); - if (icv_in == (iconv_t) -1) { - if (errno == EINVAL) - ret = XML_ERR_UNSUPPORTED_ENCODING; - else if (errno == ENOMEM) +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \ + defined(__GLIBC__) + /* + * This glibc bug can lead to unpredictable results with the + * push parser. + * + * https://sourceware.org/bugzilla/show_bug.cgi?id=32633 + */ + if ((xmlEncodingMatch(name, "TSCII")) || + (xmlEncodingMatch(name, "BIG5-HKSCS"))) { + ret = XML_ERR_UNSUPPORTED_ENCODING; + goto error; + } +#endif + + if (flags & XML_ENC_INPUT) { + inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt)); + if (inputCtxt == NULL) { ret = XML_ERR_NO_MEMORY; - else - ret = XML_ERR_SYSTEM; - goto error; - } - inputCtxt->cd = icv_in; + goto error; + } + inputCtxt->cd = (iconv_t) -1; - outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt)); - if (outputCtxt == NULL) { - ret = XML_ERR_NO_MEMORY; - goto error; - } - outputCtxt->cd = (iconv_t) -1; + icv_in = iconv_open("UTF-8", name); + if (icv_in == (iconv_t) -1) { + if (errno == EINVAL) + ret = XML_ERR_UNSUPPORTED_ENCODING; + else if (errno == ENOMEM) + ret = XML_ERR_NO_MEMORY; + else + ret = XML_ERR_SYSTEM; + goto error; + } + inputCtxt->cd = icv_in; - icv_out = iconv_open(name, "UTF-8"); - if (icv_out == (iconv_t) -1) { - if (errno == EINVAL) - ret = XML_ERR_UNSUPPORTED_ENCODING; - else if (errno == ENOMEM) + inFunc = xmlIconvConvert; + } + + if (flags & XML_ENC_OUTPUT) { + outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt)); + if (outputCtxt == NULL) { ret = XML_ERR_NO_MEMORY; - else - ret = XML_ERR_SYSTEM; - goto error; - } - outputCtxt->cd = icv_out; + goto error; + } + outputCtxt->cd = (iconv_t) -1; - conv->input = xmlIconvConvert; - conv->output = xmlIconvConvert; - conv->ctxtDtor = xmlIconvFree; - conv->inputCtxt = inputCtxt; - conv->outputCtxt = outputCtxt; + icv_out = iconv_open(name, "UTF-8"); + if (icv_out == (iconv_t) -1) { + if (errno == EINVAL) + ret = XML_ERR_UNSUPPORTED_ENCODING; + else if (errno == ENOMEM) + ret = XML_ERR_NO_MEMORY; + else + ret = XML_ERR_SYSTEM; + goto error; + } + outputCtxt->cd = icv_out; - /* Backward compatibility */ - if (handler != NULL) { - handler->iconv_in = icv_in; - handler->iconv_out = icv_out; + outFunc = xmlIconvConvert; } - return(XML_ERR_OK); + return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree, + inputCtxt, outputCtxt, out)); error: if (inputCtxt != NULL) @@ -1228,11 +1321,12 @@ /** * xmlUconvConvert: - * @vctxt: converison context + * @vctxt: conversion context * @out: a pointer to an array of bytes to store the result * @outlen: the length of @out * @in: a pointer to an array of input bytes * @inlen: the length of @in + * @flush: end of input * * Returns an XML_ENC_ERR code. * @@ -1240,9 +1334,9 @@ * as the return value is positive, else unpredictable. * The value of @outlen after return is the number of octets produced. */ -static int -xmlUconvConvert(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen, void *vctxt) { +static xmlCharEncError +xmlUconvConvert(void *vctxt, unsigned char *out, int *outlen, + const unsigned char *in, int *inlen, int flush) { xmlUconvCtxt *cd = vctxt; const char *ucv_in = (const char *) in; char *ucv_out = (char *) out; @@ -1257,14 +1351,10 @@ } /* - * Note that the ICU API is stateful. It can always consume a certain - * amount of input even if the output buffer would overflow. The - * remaining input must be processed by calling ucnv_convertEx with a - * possibly empty input buffer. - * - * ucnv_convertEx is always called with reset and flush set to 0, - * so we don't mess up the state. This should never generate - * U_TRUNCATED_CHAR_FOUND errors. + * The ICU API can consume input, including partial sequences, + * even if the output buffer would overflow. The remaining input + * must be processed by calling ucnv_convertEx with a possibly + * empty input buffer. */ if (cd->isInput) { source = cd->uconv; @@ -1277,7 +1367,8 @@ ucnv_convertEx(target, source, &ucv_out, ucv_out + *outlen, &ucv_in, ucv_in + *inlen, cd->pivot_buf, &cd->pivot_source, &cd->pivot_target, - cd->pivot_buf + ICU_PIVOT_BUF_SIZE, 0, 0, &err); + cd->pivot_buf + ICU_PIVOT_BUF_SIZE, + /* reset */ 0, flush, &err); *inlen = ucv_in - (const char*) in; *outlen = ucv_out - (char *) out; @@ -1287,8 +1378,8 @@ } else { switch (err) { case U_TRUNCATED_CHAR_FOUND: - /* Shouldn't happen without flush */ - ret = XML_ENC_ERR_SUCCESS; + /* Should only happen with flush */ + ret = XML_ENC_ERR_INPUT; break; case U_BUFFER_OVERFLOW_ERROR: @@ -1315,7 +1406,7 @@ return(ret); } -static int +static xmlParserErrors openIcuConverter(const char* name, int isInput, xmlUconvCtxt **out) { UErrorCode status; @@ -1354,7 +1445,7 @@ goto error; *out = conv; - return(0); + return(XML_ERR_OK); error: if (conv->uconv) @@ -1383,27 +1474,30 @@ closeIcuConverter(vctxt); } -static int -xmlCharEncUconv(void *vctxt ATTRIBUTE_UNUSED, const char *name, - xmlCharEncConverter *conv) { +static xmlParserErrors +xmlCharEncUconv(const char *name, xmlCharEncFlags flags, + xmlCharEncodingHandler **out) { + xmlCharEncConvFunc inFunc = NULL, outFunc = NULL; xmlUconvCtxt *ucv_in = NULL; xmlUconvCtxt *ucv_out = NULL; int ret; - ret = openIcuConverter(name, 1, &ucv_in); - if (ret != 0) - goto error; - ret = openIcuConverter(name, 0, &ucv_out); - if (ret != 0) - goto error; + if (flags & XML_ENC_INPUT) { + ret = openIcuConverter(name, 1, &ucv_in); + if (ret != 0) + goto error; + inFunc = xmlUconvConvert; + } - conv->input = xmlUconvConvert; - conv->output = xmlUconvConvert; - conv->ctxtDtor = xmlUconvFree; - conv->inputCtxt = ucv_in; - conv->outputCtxt = ucv_out; + if (flags & XML_ENC_OUTPUT) { + ret = openIcuConverter(name, 0, &ucv_out); + if (ret != 0) + goto error; + outFunc = xmlUconvConvert; + } - return(XML_ERR_OK); + return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlUconvFree, + ucv_in, ucv_out, out)); error: if (ucv_in != NULL) @@ -1426,9 +1520,9 @@ * * Convert XML_ENC_ERR to libxml2 error codes. */ -static int -xmlEncConvertError(int code) { - int ret; +static xmlParserErrors +xmlEncConvertError(xmlCharEncError code) { + xmlParserErrors ret; switch (code) { case XML_ENC_ERR_SUCCESS: @@ -1455,6 +1549,7 @@ * @outlen: the length of @out * @in: a pointer to an array of input bytes * @inlen: the length of @in + * @flush: end of input * * The value of @inlen after return is the number of octets consumed * as the return value is 0, else unpredictable. @@ -1462,24 +1557,44 @@ * * Returns an XML_ENC_ERR code. */ -int +xmlCharEncError xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out, - int *outlen, const unsigned char *in, int *inlen) { - int ret; + int *outlen, const unsigned char *in, int *inlen, + int flush) { + xmlCharEncError ret; - if (handler->input != NULL) { - xmlCharEncConvFunc conv = - (xmlCharEncConvFunc) (void (*)(void)) handler->input; + if (handler->flags & XML_HANDLER_LEGACY) { + xmlCharEncodingInputFunc func = handler->input.legacyFunc; - ret = conv(out, outlen, in, inlen, handler->inputCtxt); - if (ret > 0) - ret = XML_ENC_ERR_SUCCESS; + if (func == NULL) { + *outlen = 0; + *inlen = 0; + return(XML_ENC_ERR_INTERNAL); + } + + ret = func(out, outlen, in, inlen); + } else { + xmlCharEncConvFunc func = handler->input.func; + int oldInlen; + + if (func == NULL) { + *outlen = 0; + *inlen = 0; + return(XML_ENC_ERR_INTERNAL); + } + + oldInlen = *inlen; + ret = func(handler->inputCtxt, out, outlen, in, inlen, flush); + + /* + * Check for truncated multi-byte sequence. + */ + if ((flush) && (ret == XML_ENC_ERR_SUCCESS) && (*inlen != oldInlen)) + ret = XML_ENC_ERR_INPUT; } - else { - *outlen = 0; - *inlen = 0; - ret = XML_ENC_ERR_INTERNAL; - } + + if (ret > 0) + ret = XML_ENC_ERR_SUCCESS; return(ret); } @@ -1498,24 +1613,35 @@ * as the return value is 0, else unpredictable. * The value of @outlen after return is the number of octets produced. */ -static int +static xmlCharEncError xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out, int *outlen, const unsigned char *in, int *inlen) { - int ret; + xmlCharEncError ret; - if (handler->output != NULL) { - xmlCharEncConvFunc conv = - (xmlCharEncConvFunc) (void (*)(void)) handler->output; + if (handler->flags & XML_HANDLER_LEGACY) { + xmlCharEncodingOutputFunc func = handler->output.legacyFunc; - ret = conv(out, outlen, in, inlen, handler->outputCtxt); - if (ret > 0) - ret = XML_ENC_ERR_SUCCESS; + if (func == NULL) { + *outlen = 0; + *inlen = 0; + return(XML_ENC_ERR_INTERNAL); + } + + ret = func(out, outlen, in, inlen); + } else { + xmlCharEncConvFunc func = handler->output.func; + + if (func == NULL) { + *outlen = 0; + *inlen = 0; + return(XML_ENC_ERR_INTERNAL); + } + + ret = func(handler->outputCtxt, out, outlen, in, inlen, /* flush */ 0); } - else { - *outlen = 0; - *inlen = 0; - ret = XML_ENC_ERR_INTERNAL; - } + + if (ret > 0) + ret = XML_ENC_ERR_SUCCESS; return(ret); } @@ -1540,6 +1666,7 @@ * xmlCharEncInput: * @input: a parser input buffer * @sizeOut: pointer to output size + * @flush: end of input * * @sizeOut should be set to the maximum output size (or SIZE_MAX). * After return, it is set to the number of bytes written. @@ -1548,15 +1675,15 @@ * * Returns an XML_ENC_ERR code. */ -int -xmlCharEncInput(xmlParserInputBufferPtr input, size_t *sizeOut) +xmlCharEncError +xmlCharEncInput(xmlParserInputBufferPtr input, size_t *sizeOut, int flush) { xmlBufPtr out, in; const xmlChar *dataIn; size_t availIn; size_t maxOut; size_t totalIn, totalOut; - int ret; + xmlCharEncError ret; out = input->buffer; in = input->raw; @@ -1567,7 +1694,7 @@ *sizeOut = 0; availIn = xmlBufUse(in); - if (availIn == 0) + if ((availIn == 0) && (!flush)) return(0); dataIn = xmlBufContent(in); totalIn = 0; @@ -1598,7 +1725,7 @@ } ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out, - dataIn, &c_in); + dataIn, &c_in, flush && completeIn); totalIn += c_in; dataIn += c_in; @@ -1636,7 +1763,7 @@ input->rawconsumed += totalIn; *sizeOut = totalOut; - return(XML_ERR_OK); + return(XML_ENC_ERR_SUCCESS); } /** @@ -1673,7 +1800,7 @@ written = out->size - out->use - 1; } ret = xmlEncInputChunk(handler, &out->content[out->use], &written, - in->content, &toconv); + in->content, &toconv, /* flush */ 0); xmlBufferShrink(in, toconv); out->use += written; out->content[out->use] = 0; @@ -1999,10 +2126,11 @@ * * ************************************************************************/ -static int -asciiToAscii(unsigned char* out, int *poutlen, +static xmlCharEncError +asciiToAscii(void *vctxt ATTRIBUTE_UNUSED, + unsigned char* out, int *poutlen, const unsigned char* in, int *pinlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush ATTRIBUTE_UNUSED) { const unsigned char *inend; const unsigned char *instart = in; int inlen, outlen, ret; @@ -2043,10 +2171,11 @@ return(ret); } -static int -latin1ToUTF8(unsigned char* out, int *outlen, +static xmlCharEncError +latin1ToUTF8(void *vctxt ATTRIBUTE_UNUSED, + unsigned char* out, int *outlen, const unsigned char* in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush ATTRIBUTE_UNUSED) { unsigned char* outstart = out; const unsigned char* instart = in; unsigned char* outend; @@ -2085,7 +2214,7 @@ } /** - * isolat1ToUTF8: + * xmlIsolat1ToUTF8: * @out: a pointer to an array of bytes to store the result * @outlen: the length of @out * @in: a pointer to an array of ISO Latin 1 chars @@ -2101,15 +2230,17 @@ * The value of @outlen after return is the number of octets produced. */ int -isolat1ToUTF8(unsigned char* out, int *outlen, - const unsigned char* in, int *inlen) { - return(latin1ToUTF8(out, outlen, in, inlen, NULL)); +xmlIsolat1ToUTF8(unsigned char* out, int *outlen, + const unsigned char* in, int *inlen) { + return(latin1ToUTF8(/* ctxt */ NULL, out, outlen, in, inlen, + /* flush */ 0)); } -static int -UTF8ToUTF8(unsigned char* out, int *outlen, +static xmlCharEncError +UTF8ToUTF8(void *vctxt ATTRIBUTE_UNUSED, + unsigned char* out, int *outlen, const unsigned char* in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush ATTRIBUTE_UNUSED) { int len; int ret; @@ -2136,10 +2267,11 @@ #ifdef LIBXML_OUTPUT_ENABLED -static int -UTF8ToLatin1(unsigned char* out, int *outlen, +static xmlCharEncError +UTF8ToLatin1(void *vctxt ATTRIBUTE_UNUSED, + unsigned char* out, int *outlen, const unsigned char* in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush ATTRIBUTE_UNUSED) { const unsigned char* outend; const unsigned char* outstart = out; const unsigned char* instart = in; @@ -2188,7 +2320,7 @@ } /** - * UTF8Toisolat1: + * xmlUTF8ToIsolat1: * @out: a pointer to an array of bytes to store the result * @outlen: the length of @out * @in: a pointer to an array of UTF-8 chars @@ -2204,19 +2336,21 @@ * The value of @outlen after return is the number of octets produced. */ int -UTF8Toisolat1(unsigned char* out, int *outlen, +xmlUTF8ToIsolat1(unsigned char* out, int *outlen, const unsigned char* in, int *inlen) { if ((out == NULL) || (outlen == NULL) || (in == NULL) || (inlen == NULL)) return(XML_ENC_ERR_INTERNAL); - return(UTF8ToLatin1(out, outlen, in, inlen, NULL)); + return(UTF8ToLatin1(/* ctxt */ NULL, out, outlen, in, inlen, + /* flush */ 0)); } #endif /* LIBXML_OUTPUT_ENABLED */ -static int -UTF16LEToUTF8(unsigned char *out, int *outlen, +static xmlCharEncError +UTF16LEToUTF8(void *vctxt ATTRIBUTE_UNUSED, + unsigned char *out, int *outlen, const unsigned char *in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush ATTRIBUTE_UNUSED) { const unsigned char *instart = in; const unsigned char *inend = in + (*inlen & ~1); unsigned char *outstart = out; @@ -2282,10 +2416,11 @@ } #ifdef LIBXML_OUTPUT_ENABLED -static int -UTF8ToUTF16LE(unsigned char *out, int *outlen, +static xmlCharEncError +UTF8ToUTF16LE(void *vctxt ATTRIBUTE_UNUSED, + unsigned char *out, int *outlen, const unsigned char *in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush ATTRIBUTE_UNUSED) { const unsigned char *instart = in; const unsigned char *inend; unsigned char *outstart = out; @@ -2384,10 +2519,11 @@ return(ret); } -static int -UTF8ToUTF16(unsigned char* outb, int *outlen, +static xmlCharEncError +UTF8ToUTF16(void *vctxt, + unsigned char* outb, int *outlen, const unsigned char* in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush) { if (in == NULL) { /* * initialization, add the Byte Order Mark for UTF-16LE @@ -2403,14 +2539,15 @@ *inlen = 0; return(0); } - return (UTF8ToUTF16LE(outb, outlen, in, inlen, NULL)); + return (UTF8ToUTF16LE(vctxt, outb, outlen, in, inlen, flush)); } #endif /* LIBXML_OUTPUT_ENABLED */ -static int -UTF16BEToUTF8(unsigned char *out, int *outlen, +static xmlCharEncError +UTF16BEToUTF8(void *vctxt ATTRIBUTE_UNUSED, + unsigned char *out, int *outlen, const unsigned char *in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush ATTRIBUTE_UNUSED) { const unsigned char *instart = in; const unsigned char *inend = in + (*inlen & ~1); unsigned char *outstart = out; @@ -2476,10 +2613,11 @@ } #ifdef LIBXML_OUTPUT_ENABLED -static int -UTF8ToUTF16BE(unsigned char *out, int *outlen, +static xmlCharEncError +UTF8ToUTF16BE(void *vctxt ATTRIBUTE_UNUSED, + unsigned char *out, int *outlen, const unsigned char *in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { + int flush ATTRIBUTE_UNUSED) { const unsigned char *instart = in; const unsigned char *inend; unsigned char *outstart = out; @@ -2579,20 +2717,23 @@ #endif /* LIBXML_OUTPUT_ENABLED */ #if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTML_ENABLED) -static int -UTF8ToHtmlWrapper(unsigned char *out, int *outlen, +static xmlCharEncError +UTF8ToHtmlWrapper(void *vctxt ATTRIBUTE_UNUSED, + unsigned char *out, int *outlen, const unsigned char *in, int *inlen, - void *vctxt ATTRIBUTE_UNUSED) { - return(UTF8ToHtml(out, outlen, in, inlen)); + int flush ATTRIBUTE_UNUSED) { + return(htmlUTF8ToHtml(out, outlen, in, inlen)); } #endif #if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) && \ defined(LIBXML_ISO8859X_ENABLED) -static int -UTF8ToISO8859x(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen, void *vctxt) { +static xmlCharEncError +UTF8ToISO8859x(void *vctxt, + unsigned char *out, int *outlen, + const unsigned char *in, int *inlen, + int flush ATTRIBUTE_UNUSED) { const unsigned char *xlattable = vctxt; const unsigned char *instart = in; const unsigned char *inend; @@ -2670,9 +2811,11 @@ return(ret); } -static int -ISO8859xToUTF8(unsigned char* out, int *outlen, - const unsigned char* in, int *inlen, void *vctxt) { +static xmlCharEncError +ISO8859xToUTF8(void *vctxt, + unsigned char* out, int *outlen, + const unsigned char* in, int *inlen, + int flush ATTRIBUTE_UNUSED) { unsigned short const *unicodetable = vctxt; const unsigned char* instart = in; const unsigned char* inend;
diff --git a/third_party/libxml/src/entities.c b/third_party/libxml/src/entities.c index ae82c361..0a32f0b4 100644 --- a/third_party/libxml/src/entities.c +++ b/third_party/libxml/src/entities.c
@@ -29,6 +29,10 @@ #include "private/entities.h" #include "private/error.h" +#ifndef SIZE_MAX + #define SIZE_MAX ((size_t) -1) +#endif + /* * The XML predefined entities. */ @@ -512,6 +516,17 @@ return(xmlGetPredefinedEntity(name)); } +/* + * xmlSerializeHexCharRef: + * @buf: a char buffer + * @val: a codepoint + * + * Serializes a hex char ref like   + * + * Writes at most 9 bytes. Does not include a terminating zero byte. + * + * Returns the number of bytes written. + */ int xmlSerializeHexCharRef(char *buf, int val) { char *out = buf; @@ -549,6 +564,17 @@ return(out - buf); } +/* + * xmlSerializeDecCharRef: + * @buf: a char buffer + * @val: a codepoint + * + * Serializes a decimal char ref like & + * + * Writes at most 10 bytes. Does not include a terminating zero byte. + * + * Returns the number of bytes written. + */ int xmlSerializeDecCharRef(char *buf, int val) { char *out = buf; @@ -588,6 +614,21 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; +/* + * xmlEscapeText: + * @text: input text + * @flags: XML_ESCAPE flags + * + * Escapes certain characters with char refs. + * + * XML_ESCAPE_ATTR: for attribute content. + * XML_ESCAPE_NON_ASCII: escape non-ASCII chars. + * XML_ESCAPE_HTML: for HTML content. + * XML_ESCAPE_QUOT: escape double quotes. + * XML_ESCAPE_ALLOW_INVALID: allow invalid characters. + * + * Returns an escaped string or NULL if a memory allocation failed. + */ xmlChar * xmlEscapeText(const xmlChar *text, int flags) { const xmlChar *cur; @@ -710,16 +751,23 @@ if (totalSize > size - used) { xmlChar *tmp; + int newSize; - size += totalSize; + if ((size > (SIZE_MAX - 1) / 2) || + (totalSize > (SIZE_MAX - 1) / 2 - size)) { + xmlFree(buffer); + return(NULL); + } + newSize = size + totalSize; if (*cur != 0) - size *= 2; - tmp = xmlRealloc(buffer, size + 1); + newSize *= 2; + tmp = xmlRealloc(buffer, newSize + 1); if (tmp == NULL) { xmlFree(buffer); return(NULL); } buffer = tmp; + size = newSize; out = buffer + used; } @@ -739,7 +787,7 @@ * xmlEncodeEntitiesInternal: * @doc: the document containing the string * @input: A string to convert to XML. - * @attr: are we handling an attribute value + * @flags: XML_ESCAPE flags * * Do a global encoding of a string, replacing the predefined entities * and non ASCII values with their entities and CharRef counterparts.
diff --git a/third_party/libxml/src/error.c b/third_party/libxml/src/error.c index fc28bb6..563f472 100644 --- a/third_party/libxml/src/error.c +++ b/third_party/libxml/src/error.c
@@ -20,6 +20,37 @@ #include "private/globals.h" #include "private/string.h" +/** + * xmlIsCatastrophicError: + * @level: error level + * @code: error code + * + * Returns true if an error is catastrophic. + */ +int +xmlIsCatastrophicError(int level, int code) { + int fatal = 0; + + if (level != XML_ERR_FATAL) + return(0); + + switch (code) { + case XML_ERR_NO_MEMORY: + /* case XML_ERR_RESOURCE_LIMIT: */ + case XML_ERR_SYSTEM: + case XML_ERR_ARGUMENT: + case XML_ERR_INTERNAL_ERROR: + fatal = 1; + break; + default: + if ((code >= 1500) && (code <= 1599)) + fatal = 1; + break; + } + + return(fatal); +} + /************************************************************************ * * * Error struct * @@ -204,24 +235,6 @@ } /** - * initGenericErrorDefaultFunc: - * @handler: the handler - * - * DEPRECATED: Use xmlSetGenericErrorFunc. - * - * Set or reset (if NULL) the default handler for generic errors - * to the builtin error function. - */ -void -initGenericErrorDefaultFunc(xmlGenericErrorFunc * handler) -{ - if (handler == NULL) - xmlGenericError = xmlGenericErrorDefaultFunc; - else - xmlGenericError = (*handler); -} - -/** * xmlSetGenericErrorFunc: * @ctx: the new error handling context * @handler: the new handler function @@ -750,7 +763,7 @@ * @channel: the old callback channel * @data: the callback data * @ctx: the parser context or NULL - * @nod: the node or NULL + * @node: the node or NULL * @domain: the domain for the error * @code: the code for the error * @level: the xmlErrorLevel for the error @@ -1329,11 +1342,25 @@ return(errmsg); } +/** + * xmlVPrintErrorMessage: + * @fmt: printf format string + * @ap: arguments + * + * Prints to stderr. + */ void xmlVPrintErrorMessage(const char *fmt, va_list ap) { vfprintf(stderr, fmt, ap); } +/** + * xmlPrintErrorMessage: + * @fmt: printf format string + * @...: arguments + * + * Prints to stderr. + */ void xmlPrintErrorMessage(const char *fmt, ...) { va_list ap; @@ -1343,6 +1370,13 @@ va_end(ap); } +/** + * xmlAbort: + * @fmt: printf format string + * @...: arguments + * + * Print message to stderr and abort. + */ void xmlAbort(const char *fmt, ...) { va_list ap;
diff --git a/third_party/libxml/src/globals.c b/third_party/libxml/src/globals.c index 28ec3d31a..e0b05a2 100644 --- a/third_party/libxml/src/globals.c +++ b/third_party/libxml/src/globals.c
@@ -15,14 +15,13 @@ #include <string.h> #define XML_GLOBALS_NO_REDEFINITION -#include <libxml/globals.h> #include <libxml/xmlerror.h> #include <libxml/xmlmemory.h> #include <libxml/xmlIO.h> #include <libxml/parser.h> #include <libxml/threads.h> #include <libxml/tree.h> -#include <libxml/SAX.h> +#include <libxml/xmlsave.h> #include <libxml/SAX2.h> #include "private/dict.h" @@ -76,6 +75,14 @@ #ifdef LIBXML_THREAD_ENABLED +#ifdef HAVE_WIN32_THREADS + #if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL) + #define USE_WAIT_DTOR + #else + #define USE_DLL_MAIN + #endif +#endif + /* * On Darwin, thread-local storage destructors seem to be run before * pthread thread-specific data destructors. This causes ASan to @@ -90,44 +97,6 @@ #define USE_TLS #endif -#ifdef HAVE_WIN32_THREADS - #if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL) - #define USE_WAIT_DTOR - #else - #define USE_DLL_MAIN - #endif -#endif - -#define XML_DECLARE_MEMBER(name, type, attrs) \ - type gs_##name; - -struct _xmlGlobalState { -#ifdef USE_TLS - int initialized; -#endif - -#ifdef USE_WAIT_DTOR - void *threadHandle; - void *waitHandle; -#endif - - unsigned localRngState[2]; - - xmlError lastError; - -#define XML_OP XML_DECLARE_MEMBER -XML_GLOBALS_ALLOC -XML_GLOBALS_PARSER -XML_GLOBALS_ERROR -XML_GLOBALS_TREE -XML_GLOBALS_IO -#undef XML_OP -}; - -#ifdef USE_TLS -static XML_THREAD_LOCAL xmlGlobalState globalState; -#endif - #ifdef HAVE_POSIX_THREADS /* @@ -150,6 +119,69 @@ #endif /* LIBXML_THREAD_ENABLED */ +struct _xmlGlobalState { +#ifdef USE_TLS + int initialized; +#endif + +#ifdef USE_WAIT_DTOR + void *threadHandle; + void *waitHandle; +#endif + + unsigned localRngState[2]; + + xmlError lastError; + +#ifdef LIBXML_THREAD_ALLOC_ENABLED + xmlMallocFunc malloc; + xmlMallocFunc mallocAtomic; + xmlReallocFunc realloc; + xmlFreeFunc free; + xmlStrdupFunc memStrdup; +#endif + + int doValidityCheckingDefaultValue; + int getWarningsDefaultValue; + int keepBlanksDefaultValue; + int lineNumbersDefaultValue; + int loadExtDtdDefaultValue; + int pedanticParserDefaultValue; + int substituteEntitiesDefaultValue; + +#ifdef LIBXML_OUTPUT_ENABLED + int indentTreeOutput; + const char *treeIndentString; + int saveNoEmptyTags; +#endif + + xmlGenericErrorFunc genericError; + void *genericErrorContext; + xmlStructuredErrorFunc structuredError; + void *structuredErrorContext; + + xmlRegisterNodeFunc registerNodeDefaultValue; + xmlDeregisterNodeFunc deregisterNodeDefaultValue; + + xmlParserInputBufferCreateFilenameFunc parserInputBufferCreateFilenameValue; + xmlOutputBufferCreateFilenameFunc outputBufferCreateFilenameValue; +}; + +typedef struct _xmlGlobalState xmlGlobalState; +typedef xmlGlobalState *xmlGlobalStatePtr; + +#ifdef LIBXML_THREAD_ENABLED + +#ifdef USE_TLS +static XML_THREAD_LOCAL xmlGlobalState globalState; +#endif + +#else /* LIBXML_THREAD_ENABLED */ + +static xmlGlobalState globalState; + +#endif /* LIBXML_THREAD_ENABLED */ + /************************************************************************ * * * All the user accessible global variables of the library * @@ -219,268 +251,34 @@ */ xmlStrdupFunc xmlMemStrdup = xmlPosixStrdup; -/** - * xmlBufferAllocScheme: - * - * DEPRECATED: Don't use. - * - * Global setting, default allocation policy for buffers, default is - * XML_BUFFER_ALLOC_EXACT - */ -const xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT; -/** - * xmlDefaultBufferSize: - * - * DEPRECATED: Don't use. - * - * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE - */ -const int xmlDefaultBufferSize = BASE_BUFFER_SIZE; - /* * Parser defaults */ -/** - * oldXMLWDcompatibility: - * - * DEPRECATED, always 0. - */ -const int oldXMLWDcompatibility = 0; /* DEPRECATED */ -/** - * xmlParserDebugEntities: - * - * DEPRECATED, always 0. - */ -const int xmlParserDebugEntities = 0; -/** - * xmlDoValidityCheckingDefaultValue: - * - * DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID. - * - * Global setting, indicate that the parser should work in validating mode. - * Disabled by default. - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlDoValidityCheckingDefaultValue = 0; -#endif static int xmlDoValidityCheckingDefaultValueThrDef = 0; -/** - * xmlGetWarningsDefaultValue: - * - * DEPRECATED: Use the modern options API with XML_PARSE_NOWARNING. - * - * Global setting, indicate that the DTD validation should provide warnings. - * Activated by default. - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlGetWarningsDefaultValue = 1; -#endif static int xmlGetWarningsDefaultValueThrDef = 1; -/** - * xmlLoadExtDtdDefaultValue: - * - * DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD. - * - * Global setting, indicate that the parser should load DTD while not - * validating. - * Disabled by default. - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlLoadExtDtdDefaultValue = 0; -#endif static int xmlLoadExtDtdDefaultValueThrDef = 0; -/** - * xmlPedanticParserDefaultValue: - * - * DEPRECATED: Use the modern options API with XML_PARSE_PEDANTIC. - * - * Global setting, indicate that the parser be pedantic - * Disabled by default. - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlPedanticParserDefaultValue = 0; -#endif static int xmlPedanticParserDefaultValueThrDef = 0; -/** - * xmlLineNumbersDefaultValue: - * - * DEPRECATED: The modern options API always enables line numbers. - * - * Global setting, indicate that the parser should store the line number - * in the content field of elements in the DOM tree. - * Disabled by default since this may not be safe for old classes of - * application. - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlLineNumbersDefaultValue = 0; -#endif static int xmlLineNumbersDefaultValueThrDef = 0; -/** - * xmlKeepBlanksDefaultValue: - * - * DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS. - * - * Global setting, indicate that the parser should keep all blanks - * nodes found in the content - * Activated by default, this is actually needed to have the parser - * conformant to the XML Recommendation, however the option is kept - * for some applications since this was libxml1 default behaviour. - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlKeepBlanksDefaultValue = 1; -#endif static int xmlKeepBlanksDefaultValueThrDef = 1; -/** - * xmlSubstituteEntitiesDefaultValue: - * - * DEPRECATED: Use the modern options API with XML_PARSE_NOENT. - * - * Global setting, indicate that the parser should not generate entity - * references but replace them with the actual content of the entity - * Disabled by default, this should be activated when using XPath since - * the XPath data model requires entities replacement and the XPath - * engine does not handle entities references transparently. - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlSubstituteEntitiesDefaultValue = 0; -#endif static int xmlSubstituteEntitiesDefaultValueThrDef = 0; -/** - * xmlRegisterNodeDefaultValue: - * - * DEPRECATED: Don't use - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL; -#endif static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL; - -/** - * xmlDeregisterNodeDefaultValue: - * - * DEPRECATED: Don't use - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL; -#endif static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL; -/** - * xmlParserInputBufferCreateFilenameValue: - * - * DEPRECATED: Don't use - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -xmlParserInputBufferCreateFilenameFunc -xmlParserInputBufferCreateFilenameValue = NULL; -#endif static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef = NULL; - -/** - * xmlOutputBufferCreateFilenameValue: - * - * DEPRECATED: Don't use - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue = NULL; -#endif static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef = NULL; -/** - * xmlGenericError: - * - * DEPRECATED: Use xmlCtxtSetErrorHandler. - * - * Global setting: function used for generic error callbacks - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; -#endif static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc; -/** - * xmlStructuredError: - * - * DEPRECATED: Use xmlCtxtSetErrorHandler. - * - * Global setting: function used for structured error callbacks - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -xmlStructuredErrorFunc xmlStructuredError = NULL; -#endif static xmlStructuredErrorFunc xmlStructuredErrorThrDef = NULL; -/** - * xmlGenericErrorContext: - * - * DEPRECATED: Use xmlCtxtSetErrorHandler. - * - * Global setting passed to generic error callbacks - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -void *xmlGenericErrorContext = NULL; -#endif static void *xmlGenericErrorContextThrDef = NULL; -/** - * xmlStructuredErrorContext: - * - * DEPRECATED: Use xmlCtxtSetErrorHandler. - * - * Global setting passed to structured error callbacks - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -void *xmlStructuredErrorContext = NULL; -#endif static void *xmlStructuredErrorContextThrDef = NULL; -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -xmlError xmlLastError; -#endif #ifdef LIBXML_OUTPUT_ENABLED -/* - * output defaults - */ -/** - * xmlIndentTreeOutput: - * - * DEPRECATED: Use XML_SAVE_INDENT and XML_SAVE_NO_INDENT. - * - * Global setting, asking the serializer to indent the output tree by default - * Enabled by default - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlIndentTreeOutput = 1; -#endif static int xmlIndentTreeOutputThrDef = 1; - -/** - * xmlTreeIndentString: - * - * DEPRECATED: Use xmlSaveSetIndentString. - * - * The string used to do one-level indent. By default is equal to - * " " (two spaces) - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -const char *xmlTreeIndentString = " "; -#endif static const char *xmlTreeIndentStringThrDef = " "; - -/** - * xmlSaveNoEmptyTags: - * - * DEPRECATED: Use XML_SAVE_EMPTY and XML_SAVE_NO_EMPTY. - * - * Global setting, asking the serializer to not output empty tags - * as <empty/> but <empty></empty>. those two forms are indistinguishable - * once parsed. - * Disabled by default - */ -#if !defined(LIBXML_THREAD_ENABLED) || defined(LIBXML_LEGACY_ENABLED) -int xmlSaveNoEmptyTags = 0; -#endif static int xmlSaveNoEmptyTagsThrDef = 0; #endif /* LIBXML_OUTPUT_ENABLED */ @@ -581,6 +379,9 @@ }; #endif /* LIBXML_HTML_ENABLED */ +static void +xmlInitGlobalState(xmlGlobalStatePtr gs); + /************************************************************************ * * * Per thread global state handling * @@ -611,6 +412,8 @@ if (globalkey == TLS_OUT_OF_INDEXES) globalkey = TlsAlloc(); #endif +#else /* no thread support */ + xmlInitGlobalState(&globalState); #endif } @@ -654,50 +457,12 @@ } #endif #else /* no thread support */ - xmlResetError(&xmlLastError); + xmlResetError(&globalState.lastError); #endif xmlCleanupMutex(&xmlThrDefMutex); } -/** - * xmlInitializeGlobalState: - * @gs: a pointer to a newly allocated global state - * - * DEPRECATED: No-op. - */ -void -xmlInitializeGlobalState(xmlGlobalStatePtr gs ATTRIBUTE_UNUSED) -{ -} - -/** - * xmlGetGlobalState: - * - * DEPRECATED - * - * Returns NULL. - */ -xmlGlobalStatePtr -xmlGetGlobalState(void) -{ - return(NULL); -} - -/** - * xmlIsMainThread: - * - * DEPRECATED: Internal function, do not use. - * - * Check whether the current thread is the main thread. - * - * Returns 1 if the current thread is the main thread, 0 otherwise - */ -int -xmlIsMainThread(void) { - return(0); -} - #ifdef LIBXML_THREAD_ENABLED static void @@ -706,14 +471,9 @@ xmlGlobalState *gs = (xmlGlobalState *) state; /* - * Free any memory allocated in the thread's xmlLastError. If it + * Free any memory allocated in the thread's error struct. If it * weren't for this indirect allocation, we wouldn't need * a destructor with thread-local storage at all! - * - * It would be nice if we could make xmlLastError a special error - * type which uses statically allocated, fixed-size buffers. - * But the xmlError struct is fully public and widely used, - * so changes are dangerous. */ xmlResetError(&gs->lastError); #ifndef USE_TLS @@ -754,74 +514,6 @@ } #endif /* USE_WAIT_DTOR */ -static void -xmlInitGlobalState(xmlGlobalStatePtr gs) { - gs->localRngState[0] = xmlGlobalRandom(); - gs->localRngState[1] = xmlGlobalRandom(); - - memset(&gs->lastError, 0, sizeof(xmlError)); - -#ifdef LIBXML_THREAD_ALLOC_ENABLED - /* XML_GLOBALS_ALLOC */ - gs->gs_xmlFree = free; - gs->gs_xmlMalloc = malloc; - gs->gs_xmlMallocAtomic = malloc; - gs->gs_xmlRealloc = realloc; - gs->gs_xmlMemStrdup = xmlPosixStrdup; -#endif - - xmlMutexLock(&xmlThrDefMutex); - - /* XML_GLOBALS_PARSER */ - gs->gs_xmlDoValidityCheckingDefaultValue = - xmlDoValidityCheckingDefaultValueThrDef; - gs->gs_xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef; - gs->gs_xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef; - gs->gs_xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef; - gs->gs_xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef; - gs->gs_xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; - gs->gs_xmlSubstituteEntitiesDefaultValue = - xmlSubstituteEntitiesDefaultValueThrDef; -#ifdef LIBXML_OUTPUT_ENABLED - gs->gs_xmlIndentTreeOutput = xmlIndentTreeOutputThrDef; - gs->gs_xmlTreeIndentString = xmlTreeIndentStringThrDef; - gs->gs_xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; -#endif - - /* XML_GLOBALS_ERROR */ - gs->gs_xmlGenericError = xmlGenericErrorThrDef; - gs->gs_xmlStructuredError = xmlStructuredErrorThrDef; - gs->gs_xmlGenericErrorContext = xmlGenericErrorContextThrDef; - gs->gs_xmlStructuredErrorContext = xmlStructuredErrorContextThrDef; - - /* XML_GLOBALS_TREE */ - gs->gs_xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef; - gs->gs_xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef; - - /* XML_GLOBALS_IO */ - gs->gs_xmlParserInputBufferCreateFilenameValue = - xmlParserInputBufferCreateFilenameValueThrDef; - gs->gs_xmlOutputBufferCreateFilenameValue = - xmlOutputBufferCreateFilenameValueThrDef; - - xmlMutexUnlock(&xmlThrDefMutex); - -#ifdef USE_TLS - gs->initialized = 1; -#endif - -#ifdef HAVE_POSIX_THREADS - pthread_setspecific(globalkey, gs); -#elif defined HAVE_WIN32_THREADS -#ifndef USE_TLS - TlsSetValue(globalkey, gs); -#endif -#ifdef USE_WAIT_DTOR - xmlRegisterGlobalStateDtor(gs); -#endif -#endif -} - #ifndef USE_TLS /** * xmlNewGlobalState: @@ -888,26 +580,207 @@ return(gs); } -/* Define thread-local storage accessors with macro magic */ +#else /* LIBXML_THREAD_ENABLED */ -#define XML_DEFINE_GLOBAL_WRAPPER(name, type, attrs) \ - type *__##name(void) { \ - return (&xmlGetThreadLocalStorage(0)->gs_##name); \ - } +static xmlGlobalStatePtr +xmlGetThreadLocalStorage(int allowFailure ATTRIBUTE_UNUSED) { + return(&globalState); +} -#define XML_OP XML_DEFINE_GLOBAL_WRAPPER -XML_GLOBALS_ALLOC -XML_GLOBALS_PARSER -XML_GLOBALS_ERROR -XML_GLOBALS_TREE -XML_GLOBALS_IO -#undef XML_OP +#endif /* LIBXML_THREAD_ENABLED */ + +static void +xmlInitGlobalState(xmlGlobalStatePtr gs) { + gs->localRngState[0] = xmlGlobalRandom(); + gs->localRngState[1] = xmlGlobalRandom(); + + memset(&gs->lastError, 0, sizeof(xmlError)); + +#ifdef LIBXML_THREAD_ALLOC_ENABLED + /* XML_GLOBALS_ALLOC */ + gs->free = free; + gs->malloc = malloc; + gs->mallocAtomic = malloc; + gs->realloc = realloc; + gs->memStrdup = xmlPosixStrdup; +#endif + + xmlMutexLock(&xmlThrDefMutex); + + /* XML_GLOBALS_PARSER */ + gs->doValidityCheckingDefaultValue = + xmlDoValidityCheckingDefaultValueThrDef; + gs->getWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef; + gs->keepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef; + gs->lineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef; + gs->loadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef; + gs->pedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; + gs->substituteEntitiesDefaultValue = + xmlSubstituteEntitiesDefaultValueThrDef; +#ifdef LIBXML_OUTPUT_ENABLED + gs->indentTreeOutput = xmlIndentTreeOutputThrDef; + gs->treeIndentString = xmlTreeIndentStringThrDef; + gs->saveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; +#endif + + /* XML_GLOBALS_ERROR */ + gs->genericError = xmlGenericErrorThrDef; + gs->structuredError = xmlStructuredErrorThrDef; + gs->genericErrorContext = xmlGenericErrorContextThrDef; + gs->structuredErrorContext = xmlStructuredErrorContextThrDef; + + /* XML_GLOBALS_TREE */ + gs->registerNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef; + gs->deregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef; + + /* XML_GLOBALS_IO */ + gs->parserInputBufferCreateFilenameValue = + xmlParserInputBufferCreateFilenameValueThrDef; + gs->outputBufferCreateFilenameValue = + xmlOutputBufferCreateFilenameValueThrDef; + + xmlMutexUnlock(&xmlThrDefMutex); + +#ifdef USE_TLS + gs->initialized = 1; +#endif + +#ifdef HAVE_POSIX_THREADS + pthread_setspecific(globalkey, gs); +#elif defined HAVE_WIN32_THREADS +#ifndef USE_TLS + TlsSetValue(globalkey, gs); +#endif +#ifdef USE_WAIT_DTOR + xmlRegisterGlobalStateDtor(gs); +#endif +#endif +} const xmlError * __xmlLastError(void) { return(&xmlGetThreadLocalStorage(0)->lastError); } +int * +__xmlDoValidityCheckingDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue); +} + +int * +__xmlGetWarningsDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue); +} + +int * +__xmlKeepBlanksDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue); +} + +int * +__xmlLineNumbersDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->lineNumbersDefaultValue); +} + +int * +__xmlLoadExtDtdDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue); +} + +int * +__xmlPedanticParserDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue); +} + +int * +__xmlSubstituteEntitiesDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue); +} + +#ifdef LIBXML_OUTPUT_ENABLED +int * +__xmlIndentTreeOutput(void) { + return(&xmlGetThreadLocalStorage(0)->indentTreeOutput); +} + +const char ** +__xmlTreeIndentString(void) { + return(&xmlGetThreadLocalStorage(0)->treeIndentString); +} + +int * +__xmlSaveNoEmptyTags(void) { + return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags); +} +#endif + +xmlGenericErrorFunc * +__xmlGenericError(void) { + return(&xmlGetThreadLocalStorage(0)->genericError); +} + +void ** +__xmlGenericErrorContext(void) { + return(&xmlGetThreadLocalStorage(0)->genericErrorContext); +} + +xmlStructuredErrorFunc * +__xmlStructuredError(void) { + return(&xmlGetThreadLocalStorage(0)->structuredError); +} + +void ** +__xmlStructuredErrorContext(void) { + return(&xmlGetThreadLocalStorage(0)->structuredErrorContext); +} + +xmlRegisterNodeFunc * +__xmlRegisterNodeDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->registerNodeDefaultValue); +} + +xmlDeregisterNodeFunc * +__xmlDeregisterNodeDefaultValue(void) { + return(&xmlGetThreadLocalStorage(0)->deregisterNodeDefaultValue); +} + +xmlParserInputBufferCreateFilenameFunc * +__xmlParserInputBufferCreateFilenameValue(void) { + return(&xmlGetThreadLocalStorage(0)->parserInputBufferCreateFilenameValue); +} + +xmlOutputBufferCreateFilenameFunc * +__xmlOutputBufferCreateFilenameValue(void) { + return(&xmlGetThreadLocalStorage(0)->outputBufferCreateFilenameValue); +} + +#ifdef LIBXML_THREAD_ALLOC_ENABLED +xmlMallocFunc * +__xmlMalloc(void) { + return(&xmlGetThreadLocalStorage(0)->malloc); +} + +xmlMallocFunc * +__xmlMallocAtomic(void) { + return(&xmlGetThreadLocalStorage(0)->mallocAtomic); +} + +xmlReallocFunc * +__xmlRealloc(void) { + return(&xmlGetThreadLocalStorage(0)->realloc); +} + +xmlFreeFunc * +__xmlFree(void) { + return(&xmlGetThreadLocalStorage(0)->free); +} + +xmlStrdupFunc * +__xmlMemStrdup(void) { + return(&xmlGetThreadLocalStorage(0)->memStrdup); +} +#endif /* LIBXML_THREAD_ALLOC_ENABLED */ + /** * xmlGetLocalRngState: * @@ -918,44 +791,6 @@ return(xmlGetThreadLocalStorage(0)->localRngState); } -/* For backward compatibility */ - -const char *const * -__xmlParserVersion(void) { - return &xmlParserVersion; -} - -const int * -__oldXMLWDcompatibility(void) { - return &oldXMLWDcompatibility; -} - -const int * -__xmlParserDebugEntities(void) { - return &xmlParserDebugEntities; -} - -const xmlSAXLocator * -__xmlDefaultSAXLocator(void) { - return &xmlDefaultSAXLocator; -} - -#ifdef LIBXML_SAX1_ENABLED -const xmlSAXHandlerV1 * -__xmlDefaultSAXHandler(void) { - return &xmlDefaultSAXHandler; -} - -#ifdef LIBXML_HTML_ENABLED -const xmlSAXHandlerV1 * -__htmlDefaultSAXHandler(void) { - return &htmlDefaultSAXHandler; -} -#endif /* LIBXML_HTML_ENABLED */ -#endif /* LIBXML_SAX1_ENABLED */ - -#endif /* LIBXML_THREAD_ENABLED */ - /** * xmlCheckThreadLocalStorage: * @@ -981,13 +816,14 @@ return(0); } +/** + * xmlGetLastErrorInternal: + * + * Returns a pointer to the global error struct. + */ xmlError * xmlGetLastErrorInternal(void) { -#ifdef LIBXML_THREAD_ENABLED return(&xmlGetThreadLocalStorage(0)->lastError); -#else - return(&xmlLastError); -#endif } /** DOC_DISABLE */ @@ -1075,16 +911,6 @@ xmlMutexUnlock(&xmlThrDefMutex); } -xmlBufferAllocationScheme -xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v ATTRIBUTE_UNUSED) { - return xmlBufferAllocScheme; -} - -int -xmlThrDefDefaultBufferSize(int v ATTRIBUTE_UNUSED) { - return xmlDefaultBufferSize; -} - int xmlThrDefDoValidityCheckingDefaultValue(int v) { int ret; xmlMutexLock(&xmlThrDefMutex); @@ -1159,10 +985,6 @@ return ret; } -int xmlThrDefParserDebugEntities(int v ATTRIBUTE_UNUSED) { - return(xmlParserDebugEntities); -} - int xmlThrDefPedanticParserDefaultValue(int v) { int ret; xmlMutexLock(&xmlThrDefMutex);
diff --git a/third_party/libxml/src/hash.c b/third_party/libxml/src/hash.c index 0f728ef..4646197 100644 --- a/third_party/libxml/src/hash.c +++ b/third_party/libxml/src/hash.c
@@ -428,42 +428,49 @@ xmlChar *copy, *copy2, *copy3; xmlHashEntry *entry = NULL; size_t lengths[3] = {0, 0, 0}; - unsigned hashValue; - int found = 0; + unsigned hashValue, newSize; if ((hash == NULL) || (key == NULL)) return(-1); + hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths); + /* * Check for an existing entry */ - hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths); - if (hash->size > 0) + if (hash->size == 0) { + newSize = MIN_HASH_SIZE; + } else { + int found = 0; + entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found); - if (found) { - if (update) { - if (dealloc) - dealloc(entry->payload, entry->key); - entry->payload = payload; + + if (found) { + if (update) { + if (dealloc) + dealloc(entry->payload, entry->key); + entry->payload = payload; + } + + return(0); } - return(0); + if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) { + /* This guarantees that nbElems < INT_MAX */ + if (hash->size >= MAX_HASH_SIZE) + return(-1); + newSize = hash->size * 2; + } else { + newSize = 0; + } } /* * Grow the hash table if needed */ - if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) { - unsigned newSize, mask, displ, pos; + if (newSize > 0) { + unsigned mask, displ, pos; - if (hash->size == 0) { - newSize = MIN_HASH_SIZE; - } else { - /* This guarantees that nbElems < INT_MAX */ - if (hash->size >= MAX_HASH_SIZE) - return(-1); - newSize = hash->size * 2; - } if (xmlHashGrow(hash, newSize) != 0) return(-1);
diff --git a/third_party/libxml/src/include/libxml/HTMLparser.h b/third_party/libxml/src/include/libxml/HTMLparser.h index 116b0cf1..4ac13587 100644 --- a/third_party/libxml/src/include/libxml/HTMLparser.h +++ b/third_party/libxml/src/include/libxml/HTMLparser.h
@@ -22,6 +22,11 @@ #endif /* + * Backward compatibility + */ +#define UTF8ToHtml htmlUTF8ToHtml + +/* * Most of the back-end structures from XML and HTML are shared. */ typedef xmlParserCtxt htmlParserCtxt; @@ -76,11 +81,6 @@ XML_DEPRECATED XMLPUBVAR const xmlSAXHandlerV1 htmlDefaultSAXHandler; -#ifdef LIBXML_THREAD_ENABLED -XML_DEPRECATED -XMLPUBFUN const xmlSAXHandlerV1 *__htmlDefaultSAXHandler(void); -#endif - #endif /* LIBXML_SAX1_ENABLED */ /* @@ -150,7 +150,7 @@ htmlParseFile (const char *filename, const char *encoding); XMLPUBFUN int - UTF8ToHtml (unsigned char *out, + htmlUTF8ToHtml (unsigned char *out, int *outlen, const unsigned char *in, int *inlen);
diff --git a/third_party/libxml/src/include/libxml/SAX.h b/third_party/libxml/src/include/libxml/SAX.h index 178005b..c1ab58d 100644 --- a/third_party/libxml/src/include/libxml/SAX.h +++ b/third_party/libxml/src/include/libxml/SAX.h
@@ -11,4 +11,8 @@ #ifndef __XML_SAX_H__ #define __XML_SAX_H__ +#ifdef __GNUC__ + #warning "libxml/SAX.h is deprecated" +#endif + #endif /* __XML_SAX_H__ */
diff --git a/third_party/libxml/src/include/libxml/encoding.h b/third_party/libxml/src/include/libxml/encoding.h index 293fb3f..9a358db 100644 --- a/third_party/libxml/src/include/libxml/encoding.h +++ b/third_party/libxml/src/include/libxml/encoding.h
@@ -23,11 +23,18 @@ #define __XML_CHAR_ENCODING_H__ #include <libxml/xmlversion.h> +#include <libxml/xmlerror.h> #ifdef __cplusplus extern "C" { #endif +/* + * Backward compatibility + */ +#define UTF8Toisolat1 xmlUTF8ToIsolat1 +#define isolat1ToUTF8 xmlIsolat1ToUTF8 + typedef enum { XML_ENC_ERR_SUCCESS = 0, XML_ENC_ERR_INTERNAL = -1, @@ -77,6 +84,11 @@ XML_CHAR_ENCODING_8859_16= 30 /* ISO-8859-16 */ } xmlCharEncoding; +typedef enum { + XML_ENC_INPUT = (1 << 0), + XML_ENC_OUTPUT = (1 << 1) +} xmlCharEncFlags; + /** * xmlCharEncodingInputFunc: * @out: a pointer to an array of bytes to store the UTF-8 result @@ -120,17 +132,22 @@ * @outlen: the length of @out * @in: a pointer to an array of input bytes * @inlen: the length of @in + * @flush: end of input * * Convert between character encodings. * - * On success, the value of @inlen after return is the number of - * bytes consumed and @outlen is the number of bytes produced. + * The value of @inlen after return is the number of bytes consumed + * and @outlen is the number of bytes produced. * - * Returns the number of bytes written or an XML_ENC_ERR code. + * If the converter can consume partial multi-byte sequences, the + * @flush flag can be used to detect truncated sequences at EOF. + * Otherwise, the flag can be ignored. + * + * Returns an XML_ENC_ERR code. */ -typedef int -(*xmlCharEncConvFunc)(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen, void *vctxt); +typedef xmlCharEncError +(*xmlCharEncConvFunc)(void *vctxt, unsigned char *out, int *outlen, + const unsigned char *in, int *inlen, int flush); /** * xmlCharEncConvCtxtDtor: @@ -141,30 +158,6 @@ typedef void (*xmlCharEncConvCtxtDtor)(void *vctxt); -typedef struct { - xmlCharEncConvFunc input; - xmlCharEncConvFunc output; - xmlCharEncConvCtxtDtor ctxtDtor; - void *inputCtxt; - void *outputCtxt; -} xmlCharEncConverter; - -/** - * xmlCharEncConvImpl: - * vctxt: user data - * name: encoding name - * conv: pointer to xmlCharEncConverter struct - * - * If this function returns XML_ERR_OK, it must fill the @conv struct - * with a conversion function, and optional destructor and optional - * input and output conversion contexts. - * - * Returns an xmlParserErrors code. - */ -typedef int -(*xmlCharEncConvImpl)(void *vctxt, const char *name, - xmlCharEncConverter *conv); - /* * Block defining the handlers for non UTF-8 encodings. * @@ -174,18 +167,39 @@ typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; struct _xmlCharEncodingHandler { char *name XML_DEPRECATED_MEMBER; - xmlCharEncodingInputFunc input XML_DEPRECATED_MEMBER; - xmlCharEncodingOutputFunc output XML_DEPRECATED_MEMBER; -#ifdef LIBXML_ICONV_ENABLED - void *iconv_in XML_DEPRECATED_MEMBER; - void *iconv_out XML_DEPRECATED_MEMBER; -#endif /* LIBXML_ICONV_ENABLED */ + union { + xmlCharEncConvFunc func; + xmlCharEncodingInputFunc legacyFunc; + } input XML_DEPRECATED_MEMBER; + union { + xmlCharEncConvFunc func; + xmlCharEncodingOutputFunc legacyFunc; + } output XML_DEPRECATED_MEMBER; void *inputCtxt XML_DEPRECATED_MEMBER; void *outputCtxt XML_DEPRECATED_MEMBER; xmlCharEncConvCtxtDtor ctxtDtor XML_DEPRECATED_MEMBER; int flags XML_DEPRECATED_MEMBER; }; +/** + * xmlCharEncConvImpl: + * @vctxt: user data + * @name: encoding name + * @flags: bit mask of flags + * @out: pointer to resulting handler + * + * If this function returns XML_ERR_OK, it must fill the @out + * pointer with an encoding handler. The handler can be obtained + * from xmlCharEncNewCustomHandler. + * + * @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both. + * + * Returns an xmlParserErrors code. + */ +typedef xmlParserErrors +(*xmlCharEncConvImpl)(void *vctxt, const char *name, xmlCharEncFlags flags, + xmlCharEncodingHandler **out); + /* * Interfaces for encoding handlers. */ @@ -197,18 +211,18 @@ xmlCleanupCharEncodingHandlers (void); XMLPUBFUN void xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler); -XMLPUBFUN int +XMLPUBFUN xmlParserErrors xmlLookupCharEncodingHandler (xmlCharEncoding enc, xmlCharEncodingHandlerPtr *out); -XMLPUBFUN int +XMLPUBFUN xmlParserErrors xmlOpenCharEncodingHandler (const char *name, int output, xmlCharEncodingHandlerPtr *out); -XMLPUBFUN int +XMLPUBFUN xmlParserErrors xmlCreateCharEncodingHandler (const char *name, - int output, + xmlCharEncFlags flags, xmlCharEncConvImpl impl, - void *implCtxt, + void *implCtxt, xmlCharEncodingHandlerPtr *out); XMLPUBFUN xmlCharEncodingHandlerPtr xmlGetCharEncodingHandler (xmlCharEncoding enc); @@ -218,6 +232,14 @@ xmlNewCharEncodingHandler (const char *name, xmlCharEncodingInputFunc input, xmlCharEncodingOutputFunc output); +XMLPUBFUN xmlParserErrors + xmlCharEncNewCustomHandler (const char *name, + xmlCharEncConvFunc input, + xmlCharEncConvFunc output, + xmlCharEncConvCtxtDtor ctxtDtor, + void *inputCtxt, + void *outputCtxt, + xmlCharEncodingHandler **out); /* * Interfaces for encoding names and aliases. @@ -268,13 +290,13 @@ */ #ifdef LIBXML_OUTPUT_ENABLED XMLPUBFUN int - UTF8Toisolat1 (unsigned char *out, + xmlUTF8ToIsolat1 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen); #endif /* LIBXML_OUTPUT_ENABLED */ XMLPUBFUN int - isolat1ToUTF8 (unsigned char *out, + xmlIsolat1ToUTF8 (unsigned char *out, int *outlen, const unsigned char *in, int *inlen);
diff --git a/third_party/libxml/src/include/libxml/globals.h b/third_party/libxml/src/include/libxml/globals.h index 92f41312..a5db802 100644 --- a/third_party/libxml/src/include/libxml/globals.h +++ b/third_party/libxml/src/include/libxml/globals.h
@@ -22,20 +22,4 @@ #include <libxml/xmlsave.h> #include <libxml/threads.h> -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _xmlGlobalState xmlGlobalState; -typedef xmlGlobalState *xmlGlobalStatePtr; - -XML_DEPRECATED XMLPUBFUN void -xmlInitializeGlobalState(xmlGlobalStatePtr gs); -XML_DEPRECATED XMLPUBFUN -xmlGlobalStatePtr xmlGetGlobalState(void); - -#ifdef __cplusplus -} -#endif - #endif /* __XML_GLOBALS_H */
diff --git a/third_party/libxml/src/include/libxml/nanoftp.h b/third_party/libxml/src/include/libxml/nanoftp.h index 647a9b0..5dda634 100644 --- a/third_party/libxml/src/include/libxml/nanoftp.h +++ b/third_party/libxml/src/include/libxml/nanoftp.h
@@ -8,4 +8,9 @@ #ifndef __NANO_FTP_H__ #define __NANO_FTP_H__ + +#ifdef __GNUC__ + #warning "libxml/nanoftp.h is deprecated" +#endif + #endif /* __NANO_FTP_H__ */
diff --git a/third_party/libxml/src/include/libxml/parser.h b/third_party/libxml/src/include/libxml/parser.h index c980a4f..711d1ce 100644 --- a/third_party/libxml/src/include/libxml/parser.h +++ b/third_party/libxml/src/include/libxml/parser.h
@@ -40,10 +40,12 @@ */ #define XML_DEFAULT_VERSION "1.0" -#define XML_STATUS_NOT_WELL_FORMED (1 << 0) -#define XML_STATUS_NOT_NS_WELL_FORMED (1 << 1) -#define XML_STATUS_DTD_VALIDATION_FAILED (1 << 2) -#define XML_STATUS_CATASTROPHIC_ERROR (1 << 3) +typedef enum { + XML_STATUS_NOT_WELL_FORMED = (1 << 0), + XML_STATUS_NOT_NS_WELL_FORMED = (1 << 1), + XML_STATUS_DTD_VALIDATION_FAILED = (1 << 2), + XML_STATUS_CATASTROPHIC_ERROR = (1 << 3) +} xmlParserStatus; typedef enum { XML_RESOURCE_UNKNOWN = 0, @@ -55,6 +57,13 @@ XML_RESOURCE_XINCLUDE_TEXT } xmlResourceType; +typedef enum { + XML_INPUT_BUF_STATIC = (1 << 1), + XML_INPUT_BUF_ZERO_TERMINATED = (1 << 2), + XML_INPUT_UNZIP = (1 << 3), + XML_INPUT_NETWORK = (1 << 4) +} xmlParserInputFlags; + /** * xmlParserInput: * @@ -94,7 +103,7 @@ /* Current column */ int col; /* How many xmlChars already consumed */ - unsigned long consumed XML_DEPRECATED_MEMBER; + unsigned long consumed; /* function to deallocate the base */ xmlParserInputDeallocate free XML_DEPRECATED_MEMBER; /* unused */ @@ -193,9 +202,28 @@ typedef struct _xmlParserNsData xmlParserNsData; typedef struct _xmlAttrHashBucket xmlAttrHashBucket; -typedef int +/** + * xmlResourceLoader: + * @ctxt: parser context + * @url: URL to load + * @publicId: publid ID from DTD (optional) + * @type: resource type + * @flags: flags + * @out: result pointer + * + * Callback for custom resource loaders. + * + * @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK. + * + * On success, @out should be set to a new parser input object and + * XML_ERR_OK should be returned. + * + * Returns an xmlParserErrors code. + */ +typedef xmlParserErrors (*xmlResourceLoader)(void *ctxt, const char *url, const char *publicId, - xmlResourceType type, int flags, xmlParserInputPtr *out); + xmlResourceType type, xmlParserInputFlags flags, + xmlParserInputPtr *out); /** * xmlParserCtxt: @@ -340,7 +368,7 @@ void *_private; /* should the external subset be loaded */ - int loadsubset XML_DEPRECATED_MEMBER; + int loadsubset; /* set line number in element content */ int linenumbers XML_DEPRECATED_MEMBER; /* document's own catalog */ @@ -861,18 +889,23 @@ struct _xmlSAXHandler { - internalSubsetSAXFunc internalSubset; - isStandaloneSAXFunc isStandalone; - hasInternalSubsetSAXFunc hasInternalSubset; - hasExternalSubsetSAXFunc hasExternalSubset; - resolveEntitySAXFunc resolveEntity; - getEntitySAXFunc getEntity; - entityDeclSAXFunc entityDecl; - notationDeclSAXFunc notationDecl; - attributeDeclSAXFunc attributeDecl; - elementDeclSAXFunc elementDecl; - unparsedEntityDeclSAXFunc unparsedEntityDecl; - setDocumentLocatorSAXFunc setDocumentLocator; + /* + * For DTD-related handlers, it's recommended to either use the + * original libxml2 handler or set them to NULL if DTDs can be + * ignored. + */ + internalSubsetSAXFunc internalSubset; /* DTD */ + isStandaloneSAXFunc isStandalone; /* unused */ + hasInternalSubsetSAXFunc hasInternalSubset; /* DTD */ + hasExternalSubsetSAXFunc hasExternalSubset; /* DTD */ + resolveEntitySAXFunc resolveEntity; /* DTD */ + getEntitySAXFunc getEntity; /* DTD */ + entityDeclSAXFunc entityDecl; /* DTD */ + notationDeclSAXFunc notationDecl; /* DTD */ + attributeDeclSAXFunc attributeDecl; /* DTD */ + elementDeclSAXFunc elementDecl; /* DTD */ + unparsedEntityDeclSAXFunc unparsedEntityDecl; /* DTD */ + setDocumentLocatorSAXFunc setDocumentLocator; /* deprecated */ startDocumentSAXFunc startDocument; endDocumentSAXFunc endDocument; /* @@ -892,15 +925,20 @@ endElementSAXFunc endElement; referenceSAXFunc reference; charactersSAXFunc characters; + /* + * `ignorableWhitespace` should always be set to the same value + * as `characters`. Otherwise, the parser will try to detect + * whitespace which is unreliable. + */ ignorableWhitespaceSAXFunc ignorableWhitespace; processingInstructionSAXFunc processingInstruction; commentSAXFunc comment; warningSAXFunc warning; errorSAXFunc error; - fatalErrorSAXFunc fatalError; /* unused error() get all the errors */ - getParameterEntitySAXFunc getParameterEntity; + fatalErrorSAXFunc fatalError; /* unused, `error` gets all the errors */ + getParameterEntitySAXFunc getParameterEntity; /* DTD */ cdataBlockSAXFunc cdataBlock; - externalSubsetSAXFunc externalSubset; + externalSubsetSAXFunc externalSubset; /* DTD */ /* * `initialized` should always be set to XML_SAX2_MAGIC to enable the * modern SAX2 interface. @@ -912,6 +950,10 @@ void *_private; startElementNsSAX2Func startElementNs; endElementNsSAX2Func endElementNs; + /* + * Takes precedence over `error` or `warning`, but modern code + * should use xmlCtxtSetErrorHandler. + */ xmlStructuredErrorFunc serror; }; @@ -971,10 +1013,8 @@ */ XMLPUBVAR const char *const xmlParserVersion; -XML_DEPRECATED -XMLPUBVAR const int oldXMLWDcompatibility; -XML_DEPRECATED -XMLPUBVAR const int xmlParserDebugEntities; + +/** DOC_DISABLE */ XML_DEPRECATED XMLPUBVAR const xmlSAXLocator xmlDefaultSAXLocator; #ifdef LIBXML_SAX1_ENABLED @@ -982,65 +1022,44 @@ XMLPUBVAR const xmlSAXHandlerV1 xmlDefaultSAXHandler; #endif -#ifdef LIBXML_THREAD_ENABLED -/* backward compatibility */ -XMLPUBFUN const char *const *__xmlParserVersion(void); XML_DEPRECATED -XMLPUBFUN const int *__oldXMLWDcompatibility(void); +XMLPUBFUN int *__xmlDoValidityCheckingDefaultValue(void); XML_DEPRECATED -XMLPUBFUN const int *__xmlParserDebugEntities(void); +XMLPUBFUN int *__xmlGetWarningsDefaultValue(void); XML_DEPRECATED -XMLPUBFUN const xmlSAXLocator *__xmlDefaultSAXLocator(void); -#ifdef LIBXML_SAX1_ENABLED +XMLPUBFUN int *__xmlKeepBlanksDefaultValue(void); XML_DEPRECATED -XMLPUBFUN const xmlSAXHandlerV1 *__xmlDefaultSAXHandler(void); -#endif -#endif - -/** DOC_DISABLE */ -#define XML_GLOBALS_PARSER_CORE \ - XML_OP(xmlDoValidityCheckingDefaultValue, int, XML_DEPRECATED) \ - XML_OP(xmlGetWarningsDefaultValue, int, XML_DEPRECATED) \ - XML_OP(xmlKeepBlanksDefaultValue, int, XML_DEPRECATED) \ - XML_OP(xmlLineNumbersDefaultValue, int, XML_DEPRECATED) \ - XML_OP(xmlLoadExtDtdDefaultValue, int, XML_DEPRECATED) \ - XML_OP(xmlPedanticParserDefaultValue, int, XML_DEPRECATED) \ - XML_OP(xmlSubstituteEntitiesDefaultValue, int, XML_DEPRECATED) +XMLPUBFUN int *__xmlLineNumbersDefaultValue(void); +XML_DEPRECATED +XMLPUBFUN int *__xmlLoadExtDtdDefaultValue(void); +XML_DEPRECATED +XMLPUBFUN int *__xmlPedanticParserDefaultValue(void); +XML_DEPRECATED +XMLPUBFUN int *__xmlSubstituteEntitiesDefaultValue(void); #ifdef LIBXML_OUTPUT_ENABLED - #define XML_GLOBALS_PARSER_OUTPUT \ - XML_OP(xmlIndentTreeOutput, int, XML_NO_ATTR) \ - XML_OP(xmlTreeIndentString, const char *, XML_NO_ATTR) \ - XML_OP(xmlSaveNoEmptyTags, int, XML_NO_ATTR) -#else - #define XML_GLOBALS_PARSER_OUTPUT +XMLPUBFUN int *__xmlIndentTreeOutput(void); +XMLPUBFUN const char **__xmlTreeIndentString(void); +XMLPUBFUN int *__xmlSaveNoEmptyTags(void); #endif -#define XML_GLOBALS_PARSER \ - XML_GLOBALS_PARSER_CORE \ - XML_GLOBALS_PARSER_OUTPUT - -#define XML_OP XML_DECLARE_GLOBAL -XML_GLOBALS_PARSER -#undef XML_OP - -#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION) +#ifndef XML_GLOBALS_NO_REDEFINITION #define xmlDoValidityCheckingDefaultValue \ - XML_GLOBAL_MACRO(xmlDoValidityCheckingDefaultValue) + (*__xmlDoValidityCheckingDefaultValue()) #define xmlGetWarningsDefaultValue \ - XML_GLOBAL_MACRO(xmlGetWarningsDefaultValue) - #define xmlKeepBlanksDefaultValue XML_GLOBAL_MACRO(xmlKeepBlanksDefaultValue) + (*__xmlGetWarningsDefaultValue()) + #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue()) #define xmlLineNumbersDefaultValue \ - XML_GLOBAL_MACRO(xmlLineNumbersDefaultValue) - #define xmlLoadExtDtdDefaultValue XML_GLOBAL_MACRO(xmlLoadExtDtdDefaultValue) + (*__xmlLineNumbersDefaultValue()) + #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue()) #define xmlPedanticParserDefaultValue \ - XML_GLOBAL_MACRO(xmlPedanticParserDefaultValue) + (*__xmlPedanticParserDefaultValue()) #define xmlSubstituteEntitiesDefaultValue \ - XML_GLOBAL_MACRO(xmlSubstituteEntitiesDefaultValue) + (*__xmlSubstituteEntitiesDefaultValue()) #ifdef LIBXML_OUTPUT_ENABLED - #define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput) - #define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString) - #define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags) + #define xmlIndentTreeOutput (*__xmlIndentTreeOutput()) + #define xmlTreeIndentString (*__xmlTreeIndentString()) + #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags()) #endif #endif /** DOC_ENABLE */ @@ -1116,9 +1135,6 @@ XML_DEPRECATED XMLPUBFUN int xmlThrDefLoadExtDtdDefaultValue(int v); -XML_DEPRECATED -XMLPUBFUN int - xmlThrDefParserDebugEntities(int v); #ifdef LIBXML_SAX1_ENABLED /* @@ -1286,28 +1302,6 @@ XMLPUBFUN xmlParserCtxtPtr xmlCreateDocParserCtxt (const xmlChar *cur); -#ifdef LIBXML_LEGACY_ENABLED -/** DOC_DISABLE */ -/* - * Reading/setting optional parsing features. - */ -XML_DEPRECATED -XMLPUBFUN int - xmlGetFeaturesList (int *len, - const char **result); -XML_DEPRECATED -XMLPUBFUN int - xmlGetFeature (xmlParserCtxtPtr ctxt, - const char *name, - void *result); -XML_DEPRECATED -XMLPUBFUN int - xmlSetFeature (xmlParserCtxtPtr ctxt, - const char *name, - void *value); -/** DOC_ENABLE */ -#endif /* LIBXML_LEGACY_ENABLED */ - #ifdef LIBXML_PUSH_ENABLED /* * Interfaces for the Push mode. @@ -1419,9 +1413,9 @@ /* since 2.13.0 */ XML_PARSE_NO_XXE = 1<<23,/* disable loading of external content */ /* since 2.14.0 */ - XML_PARSE_NO_UNZIP = 1<<24,/* disable compressed content */ + XML_PARSE_UNZIP = 1<<24,/* allow compressed content */ XML_PARSE_NO_SYS_CATALOG = 1<<25,/* disable global system catalog */ - XML_PARSE_NO_CATALOG_PI = 1<<26 /* ignore catalog PIs */ + XML_PARSE_CATALOG_PI = 1<<26 /* allow catalog PIs */ } xmlParserOption; XMLPUBFUN void @@ -1455,13 +1449,26 @@ XMLPUBFUN void xmlCtxtSetDict (xmlParserCtxtPtr ctxt, xmlDictPtr); +XMLPUBFUN xmlSAXHandler * + xmlCtxtGetSaxHandler (xmlParserCtxtPtr ctxt); +XMLPUBFUN int + xmlCtxtSetSaxHandler (xmlParserCtxtPtr ctxt, + const xmlSAXHandler *sax); +XMLPUBFUN xmlDocPtr + xmlCtxtGetDocument (xmlParserCtxtPtr ctxt); +XMLPUBFUN int + xmlCtxtIsHtml (xmlParserCtxtPtr ctxt); +XMLPUBFUN int + xmlCtxtIsStopped (xmlParserCtxtPtr ctxt); +XMLPUBFUN xmlValidCtxtPtr + xmlCtxtGetValidCtxt (xmlParserCtxtPtr ctxt); XMLPUBFUN const xmlChar * xmlCtxtGetVersion (xmlParserCtxtPtr ctxt); XMLPUBFUN const xmlChar * xmlCtxtGetDeclaredEncoding(xmlParserCtxtPtr ctxt); XMLPUBFUN int xmlCtxtGetStandalone (xmlParserCtxtPtr ctxt); -XMLPUBFUN int +XMLPUBFUN xmlParserStatus xmlCtxtGetStatus (xmlParserCtxtPtr ctxt); XMLPUBFUN void xmlCtxtSetErrorHandler (xmlParserCtxtPtr ctxt, @@ -1550,24 +1557,22 @@ * New input API */ -#define XML_INPUT_BUF_STATIC (1 << 1) -#define XML_INPUT_BUF_ZERO_TERMINATED (1 << 2) -#define XML_INPUT_UNZIP (1 << 3) -#define XML_INPUT_NETWORK (1 << 4) - -XMLPUBFUN int -xmlNewInputFromUrl(const char *url, int flags, xmlParserInputPtr *out); +XMLPUBFUN xmlParserErrors +xmlNewInputFromUrl(const char *url, xmlParserInputFlags flags, + xmlParserInputPtr *out); XMLPUBFUN xmlParserInputPtr xmlNewInputFromMemory(const char *url, const void *mem, size_t size, - int flags); + xmlParserInputFlags flags); XMLPUBFUN xmlParserInputPtr -xmlNewInputFromString(const char *url, const char *str, int flags); +xmlNewInputFromString(const char *url, const char *str, + xmlParserInputFlags flags); XMLPUBFUN xmlParserInputPtr -xmlNewInputFromFd(const char *url, int fd, int flags); +xmlNewInputFromFd(const char *url, int fd, xmlParserInputFlags flags); XMLPUBFUN xmlParserInputPtr xmlNewInputFromIO(const char *url, xmlInputReadCallback ioRead, - xmlInputCloseCallback ioClose, void *ioCtxt, int flags); -XMLPUBFUN int + xmlInputCloseCallback ioClose, void *ioCtxt, + xmlParserInputFlags flags); +XMLPUBFUN xmlParserErrors xmlInputSetEncodingHandler(xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler); @@ -1615,6 +1620,7 @@ XML_WITH_ZLIB = 31, XML_WITH_ICU = 32, XML_WITH_LZMA = 33, + XML_WITH_RELAXNG = 34, /* since 2.14.0 */ XML_WITH_NONE = 99999 /* just to be sure of allocation size */ } xmlFeature;
diff --git a/third_party/libxml/src/include/libxml/parserInternals.h b/third_party/libxml/src/include/libxml/parserInternals.h index 9b3118e..3d259fc 100644 --- a/third_party/libxml/src/include/libxml/parserInternals.h +++ b/third_party/libxml/src/include/libxml/parserInternals.h
@@ -22,17 +22,12 @@ extern "C" { #endif -/** - * xmlParserMaxDepth: - * - * DEPRECATED: has no effect - * - * arbitrary depth limit for the XML documents that we allow to - * process. This is not a limitation of the parser but a safety - * boundary feature, use XML_PARSE_HUGE option to override it. +/* + * Backward compatibility */ -XML_DEPRECATED -XMLPUBVAR const unsigned int xmlParserMaxDepth; +#define inputPush xmlCtxtPushInput +#define inputPop xmlCtxtPopInput +#define xmlParserMaxDepth 256 /** * XML_MAX_TEXT_LENGTH: @@ -91,14 +86,6 @@ */ #define XML_MAX_NAMELEN 100 -/** - * INPUT_CHUNK: - * - * The parser tries to always have that amount of input ready. - * One of the point is providing context when reporting errors. - */ -#define INPUT_CHUNK 250 - /************************************************************************ * * * UNICODE version of the macros. * @@ -567,23 +554,6 @@ xmlChar end3); /* - * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP. - */ -XML_DEPRECATED -XMLPUBFUN int nodePush (xmlParserCtxtPtr ctxt, - xmlNodePtr value); -XML_DEPRECATED -XMLPUBFUN xmlNodePtr nodePop (xmlParserCtxtPtr ctxt); -XMLPUBFUN int inputPush (xmlParserCtxtPtr ctxt, - xmlParserInputPtr value); -XMLPUBFUN xmlParserInputPtr inputPop (xmlParserCtxtPtr ctxt); -XML_DEPRECATED -XMLPUBFUN const xmlChar * namePop (xmlParserCtxtPtr ctxt); -XML_DEPRECATED -XMLPUBFUN int namePush (xmlParserCtxtPtr ctxt, - const xmlChar *value); - -/* * other commodities shared between parser.c and parserInternals. */ XML_DEPRECATED
diff --git a/third_party/libxml/src/include/libxml/relaxng.h b/third_party/libxml/src/include/libxml/relaxng.h index 96cf499..e9cb1ec9 100644 --- a/third_party/libxml/src/include/libxml/relaxng.h +++ b/third_party/libxml/src/include/libxml/relaxng.h
@@ -16,7 +16,7 @@ #include <libxml/tree.h> #include <libxml/parser.h> -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #ifdef __cplusplus extern "C" { @@ -219,6 +219,6 @@ } #endif -#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* LIBXML_RELAXNG_ENABLED */ #endif /* __XML_RELAX_NG__ */
diff --git a/third_party/libxml/src/include/libxml/threads.h b/third_party/libxml/src/include/libxml/threads.h index 8f4b6e1..ec2b16b 100644 --- a/third_party/libxml/src/include/libxml/threads.h +++ b/third_party/libxml/src/include/libxml/threads.h
@@ -61,12 +61,6 @@ XMLPUBFUN void xmlUnlockLibrary(void); XML_DEPRECATED -XMLPUBFUN int - xmlGetThreadId (void); -XML_DEPRECATED -XMLPUBFUN int - xmlIsMainThread (void); -XML_DEPRECATED XMLPUBFUN void xmlCleanupThreads(void);
diff --git a/third_party/libxml/src/include/libxml/tree.h b/third_party/libxml/src/include/libxml/tree.h index 489ad03..e5a8fb7 100644 --- a/third_party/libxml/src/include/libxml/tree.h +++ b/third_party/libxml/src/include/libxml/tree.h
@@ -33,6 +33,12 @@ #endif /* + * Backward compatibility + */ +#define xmlBufferAllocScheme XML_BUFFER_ALLOC_EXACT +#define xmlDefaultBufferSize 4096 + +/* * Some of the basic types pointer to structures: */ /* xmlIO.h */ @@ -60,13 +66,6 @@ typedef xmlEntity *xmlEntityPtr; /** - * BASE_BUFFER_SIZE: - * - * default buffer size 4000. - */ -#define BASE_BUFFER_SIZE 4096 - -/** * LIBXML_NAMESPACE_DICT: * * Defines experimental behaviour: @@ -678,34 +677,17 @@ * Variables. */ -XML_DEPRECATED -XMLPUBVAR const xmlBufferAllocationScheme xmlBufferAllocScheme; -XML_DEPRECATED -XMLPUBVAR const int xmlDefaultBufferSize; - -#ifdef LIBXML_THREAD_ENABLED -/* backward compatibility */ -XML_DEPRECATED -XMLPUBFUN const xmlBufferAllocationScheme *__xmlBufferAllocScheme(void); -XML_DEPRECATED -XMLPUBFUN const int *__xmlDefaultBufferSize(void); -#endif - /** DOC_DISABLE */ -#define XML_GLOBALS_TREE \ - XML_OP(xmlRegisterNodeDefaultValue, xmlRegisterNodeFunc, XML_DEPRECATED) \ - XML_OP(xmlDeregisterNodeDefaultValue, xmlDeregisterNodeFunc, \ - XML_DEPRECATED) +XML_DEPRECATED +XMLPUBFUN xmlRegisterNodeFunc *__xmlRegisterNodeDefaultValue(void); +XML_DEPRECATED +XMLPUBFUN xmlDeregisterNodeFunc *__xmlDeregisterNodeDefaultValue(void); -#define XML_OP XML_DECLARE_GLOBAL -XML_GLOBALS_TREE -#undef XML_OP - -#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION) +#ifndef XML_GLOBALS_NO_REDEFINITION #define xmlRegisterNodeDefaultValue \ - XML_GLOBAL_MACRO(xmlRegisterNodeDefaultValue) + (*__xmlRegisterNodeDefaultValue()) #define xmlDeregisterNodeDefaultValue \ - XML_GLOBAL_MACRO(xmlDeregisterNodeDefaultValue) + (*__xmlDeregisterNodeDefaultValue()) #endif /** DOC_ENABLE */ @@ -1334,11 +1316,6 @@ XMLPUBFUN xmlDeregisterNodeFunc xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func); -XML_DEPRECATED XMLPUBFUN xmlBufferAllocationScheme - xmlThrDefBufferAllocScheme (xmlBufferAllocationScheme v); -XML_DEPRECATED XMLPUBFUN int - xmlThrDefDefaultBufferSize (int v); - #ifdef __cplusplus } #endif
diff --git a/third_party/libxml/src/include/libxml/xmlIO.h b/third_party/libxml/src/include/libxml/xmlIO.h index 11d41a3..06472b04 100644 --- a/third_party/libxml/src/include/libxml/xmlIO.h +++ b/third_party/libxml/src/include/libxml/xmlIO.h
@@ -176,21 +176,18 @@ #endif /* LIBXML_OUTPUT_ENABLED */ /** DOC_DISABLE */ -#define XML_GLOBALS_IO \ - XML_OP(xmlParserInputBufferCreateFilenameValue, \ - xmlParserInputBufferCreateFilenameFunc, XML_DEPRECATED) \ - XML_OP(xmlOutputBufferCreateFilenameValue, \ - xmlOutputBufferCreateFilenameFunc, XML_DEPRECATED) +XML_DEPRECATED +XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * +__xmlParserInputBufferCreateFilenameValue(void); +XML_DEPRECATED +XMLPUBFUN xmlOutputBufferCreateFilenameFunc * +__xmlOutputBufferCreateFilenameValue(void); -#define XML_OP XML_DECLARE_GLOBAL -XML_GLOBALS_IO -#undef XML_OP - -#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION) +#ifndef XML_GLOBALS_NO_REDEFINITION #define xmlParserInputBufferCreateFilenameValue \ - XML_GLOBAL_MACRO(xmlParserInputBufferCreateFilenameValue) + (*__xmlParserInputBufferCreateFilenameValue()) #define xmlOutputBufferCreateFilenameValue \ - XML_GLOBAL_MACRO(xmlOutputBufferCreateFilenameValue) + (*__xmlOutputBufferCreateFilenameValue()) #endif /** DOC_ENABLE */
diff --git a/third_party/libxml/src/include/libxml/xmlerror.h b/third_party/libxml/src/include/libxml/xmlerror.h index d847bfd..f59ce632 100644 --- a/third_party/libxml/src/include/libxml/xmlerror.h +++ b/third_party/libxml/src/include/libxml/xmlerror.h
@@ -16,6 +16,11 @@ extern "C" { #endif +/* + * Backward compatibility + */ +#define initGenericErrorDefaultFunc(h) xmlSetGenericErrorFunc(NULL, *(h)) + /** * xmlErrorLevel: * @@ -865,31 +870,20 @@ typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error); /** DOC_DISABLE */ -#if defined(LIBXML_THREAD_ENABLED) XML_DEPRECATED -XMLPUBFUN const xmlError * -__xmlLastError(void); -#elif !defined(IN_LIBXML) -XML_DEPRECATED -XMLPUBVAR const xmlError xmlLastError; -#endif +XMLPUBFUN const xmlError *__xmlLastError(void); -#define XML_GLOBALS_ERROR \ - XML_OP(xmlGenericError, xmlGenericErrorFunc, XML_NO_ATTR) \ - XML_OP(xmlGenericErrorContext, void *, XML_NO_ATTR) \ - XML_OP(xmlStructuredError, xmlStructuredErrorFunc, XML_NO_ATTR) \ - XML_OP(xmlStructuredErrorContext, void *, XML_NO_ATTR) +XMLPUBFUN xmlGenericErrorFunc *__xmlGenericError(void); +XMLPUBFUN void **__xmlGenericErrorContext(void); +XMLPUBFUN xmlStructuredErrorFunc *__xmlStructuredError(void); +XMLPUBFUN void **__xmlStructuredErrorContext(void); -#define XML_OP XML_DECLARE_GLOBAL -XML_GLOBALS_ERROR -#undef XML_OP - -#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION) - #define xmlLastError XML_GLOBAL_MACRO(xmlLastError) - #define xmlGenericError XML_GLOBAL_MACRO(xmlGenericError) - #define xmlGenericErrorContext XML_GLOBAL_MACRO(xmlGenericErrorContext) - #define xmlStructuredError XML_GLOBAL_MACRO(xmlStructuredError) - #define xmlStructuredErrorContext XML_GLOBAL_MACRO(xmlStructuredErrorContext) +#ifndef XML_GLOBALS_NO_REDEFINITION + #define xmlLastError (*__xmlLastError()) + #define xmlGenericError (*__xmlGenericError()) + #define xmlGenericErrorContext (*__xmlGenericErrorContext()) + #define xmlStructuredError (*__xmlStructuredError()) + #define xmlStructuredErrorContext (*__xmlStructuredErrorContext()) #endif /** DOC_ENABLE */ @@ -904,9 +898,6 @@ XMLPUBFUN void xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); -XML_DEPRECATED -XMLPUBFUN void - initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler); XMLPUBFUN void xmlSetStructuredErrorFunc (void *ctx,
diff --git a/third_party/libxml/src/include/libxml/xmlexports.h b/third_party/libxml/src/include/libxml/xmlexports.h index 52267fa..c4b7481 100644 --- a/third_party/libxml/src/include/libxml/xmlexports.h +++ b/third_party/libxml/src/include/libxml/xmlexports.h
@@ -78,58 +78,6 @@ #endif /* - * Warnings pragmas, should be moved from public headers - */ - -#if defined(__LCC__) - - #define XML_IGNORE_FPTR_CAST_WARNINGS - #define XML_POP_WARNINGS \ - _Pragma("diag_default 1215") - -#elif defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) - - #if defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 800) - #define XML_IGNORE_FPTR_CAST_WARNINGS \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wpedantic\"") \ - _Pragma("GCC diagnostic ignored \"-Wcast-function-type\"") - #else - #define XML_IGNORE_FPTR_CAST_WARNINGS \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wpedantic\"") - #endif - #define XML_POP_WARNINGS \ - _Pragma("GCC diagnostic pop") - -#elif defined(_MSC_VER) && _MSC_VER >= 1400 - - #define XML_IGNORE_FPTR_CAST_WARNINGS __pragma(warning(push)) - #define XML_POP_WARNINGS __pragma(warning(pop)) - -#else - - #define XML_IGNORE_FPTR_CAST_WARNINGS - #define XML_POP_WARNINGS - -#endif - -/* - * Accessors for globals - */ - -#define XML_NO_ATTR - -#ifdef LIBXML_THREAD_ENABLED - #define XML_DECLARE_GLOBAL(name, type, attrs) \ - attrs XMLPUBFUN type *__##name(void); - #define XML_GLOBAL_MACRO(name) (*__##name()) -#else - #define XML_DECLARE_GLOBAL(name, type, attrs) \ - attrs XMLPUBVAR type name; -#endif - -/* * Originally declared in xmlversion.h which is generated */
diff --git a/third_party/libxml/src/include/libxml/xmlmemory.h b/third_party/libxml/src/include/libxml/xmlmemory.h index 9a57b129..2b8c3aa8 100644 --- a/third_party/libxml/src/include/libxml/xmlmemory.h +++ b/third_party/libxml/src/include/libxml/xmlmemory.h
@@ -69,27 +69,25 @@ * - xmlMemStrdup * - xmlFree */ -/** DOC_DISABLE */ #ifdef LIBXML_THREAD_ALLOC_ENABLED - #define XML_GLOBALS_ALLOC \ - XML_OP(xmlMalloc, xmlMallocFunc, XML_NO_ATTR) \ - XML_OP(xmlMallocAtomic, xmlMallocFunc, XML_NO_ATTR) \ - XML_OP(xmlRealloc, xmlReallocFunc, XML_NO_ATTR) \ - XML_OP(xmlFree, xmlFreeFunc, XML_NO_ATTR) \ - XML_OP(xmlMemStrdup, xmlStrdupFunc, XML_NO_ATTR) - #define XML_OP XML_DECLARE_GLOBAL - XML_GLOBALS_ALLOC - #undef XML_OP - #if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION) - #define xmlMalloc XML_GLOBAL_MACRO(xmlMalloc) - #define xmlMallocAtomic XML_GLOBAL_MACRO(xmlMallocAtomic) - #define xmlRealloc XML_GLOBAL_MACRO(xmlRealloc) - #define xmlFree XML_GLOBAL_MACRO(xmlFree) - #define xmlMemStrdup XML_GLOBAL_MACRO(xmlMemStrdup) - #endif -#else - #define XML_GLOBALS_ALLOC + +/** DOC_DISABLE */ +XMLPUBFUN xmlMallocFunc *__xmlMalloc(void); +XMLPUBFUN xmlMallocFunc *__xmlMallocAtomic(void); +XMLPUBFUN xmlReallocFunc *__xmlRealloc(void); +XMLPUBFUN xmlFreeFunc *__xmlFree(void); +XMLPUBFUN xmlStrdupFunc *__xmlMemStrdup(void); + +#ifndef XML_GLOBALS_NO_REDEFINITION + #define xmlMalloc (*__xmlMalloc()) + #define xmlMallocAtomic (*__xmlMallocAtomic()) + #define xmlRealloc (*__xmlRealloc()) + #define xmlFree (*__xmlFree()) + #define xmlMemStrdup (*__xmlMemStrdup()) +#endif /** DOC_ENABLE */ + +#else XMLPUBVAR xmlMallocFunc xmlMalloc; XMLPUBVAR xmlMallocFunc xmlMallocAtomic; XMLPUBVAR xmlReallocFunc xmlRealloc;
diff --git a/third_party/libxml/src/include/libxml/xmlreader.h b/third_party/libxml/src/include/libxml/xmlreader.h index 65e5cc7..2344901 100644 --- a/third_party/libxml/src/include/libxml/xmlreader.h +++ b/third_party/libxml/src/include/libxml/xmlreader.h
@@ -14,8 +14,10 @@ #include <libxml/tree.h> #include <libxml/xmlerror.h> #include <libxml/xmlIO.h> -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #include <libxml/relaxng.h> +#endif +#ifdef LIBXML_SCHEMAS_ENABLED #include <libxml/xmlschemas.h> #endif #include <libxml/parser.h> @@ -287,7 +289,7 @@ xmlTextReaderNextSibling (xmlTextReaderPtr reader); XMLPUBFUN int xmlTextReaderIsValid (xmlTextReaderPtr reader); -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED XMLPUBFUN int xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader, const char *rng); @@ -299,6 +301,8 @@ XMLPUBFUN int xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader, xmlRelaxNGPtr schema); +#endif +#ifdef LIBXML_SCHEMAS_ENABLED XMLPUBFUN int xmlTextReaderSchemaValidate (xmlTextReaderPtr reader, const char *xsd);
diff --git a/third_party/libxml/src/include/libxml/xmlregexp.h b/third_party/libxml/src/include/libxml/xmlregexp.h index edbdc98d..f7e10c32 100644 --- a/third_party/libxml/src/include/libxml/xmlregexp.h +++ b/third_party/libxml/src/include/libxml/xmlregexp.h
@@ -47,6 +47,7 @@ XMLPUBFUN int xmlRegexpExec (xmlRegexpPtr comp, const xmlChar *value); +XML_DEPRECATED XMLPUBFUN void xmlRegexpPrint (FILE *output, xmlRegexpPtr regexp);
diff --git a/third_party/libxml/src/include/libxml/xmlsave.h b/third_party/libxml/src/include/libxml/xmlsave.h index 176b1c7a..91d6ef9 100644 --- a/third_party/libxml/src/include/libxml/xmlsave.h +++ b/third_party/libxml/src/include/libxml/xmlsave.h
@@ -77,7 +77,7 @@ xmlSaveFlush (xmlSaveCtxtPtr ctxt); XMLPUBFUN int xmlSaveClose (xmlSaveCtxtPtr ctxt); -XMLPUBFUN int +XMLPUBFUN xmlParserErrors xmlSaveFinish (xmlSaveCtxtPtr ctxt); XMLPUBFUN int xmlSaveSetIndentString (xmlSaveCtxtPtr ctxt,
diff --git a/third_party/libxml/src/include/libxml/xmlschemas.h b/third_party/libxml/src/include/libxml/xmlschemas.h index adaff3e..78073cd 100644 --- a/third_party/libxml/src/include/libxml/xmlschemas.h +++ b/third_party/libxml/src/include/libxml/xmlschemas.h
@@ -172,11 +172,11 @@ xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); XMLPUBFUN void xmlSchemaFree (xmlSchemaPtr schema); -#ifdef LIBXML_OUTPUT_ENABLED +#ifdef LIBXML_DEBUG_ENABLED XMLPUBFUN void xmlSchemaDump (FILE *output, xmlSchemaPtr schema); -#endif /* LIBXML_OUTPUT_ENABLED */ +#endif /* LIBXML_DEBUG_ENABLED */ /* * Interfaces for validating */ @@ -217,7 +217,7 @@ xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt, xmlParserInputBufferPtr input, xmlCharEncoding enc, - xmlSAXHandlerPtr sax, + const xmlSAXHandler *sax, void *user_data); XMLPUBFUN int xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
diff --git a/third_party/libxml/src/include/libxml/xmlunicode.h b/third_party/libxml/src/include/libxml/xmlunicode.h index b6d795b..efda81b 100644 --- a/third_party/libxml/src/include/libxml/xmlunicode.h +++ b/third_party/libxml/src/include/libxml/xmlunicode.h
@@ -2,365 +2,14 @@ * Summary: Unicode character APIs * Description: API for the Unicode character APIs * - * This file is automatically generated from the - * UCS description files of the Unicode Character Database - * http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html - * using the genUnicode.py Python script. - * - * Generation date: Tue Apr 30 17:30:38 2024 - * Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt - * Author: Daniel Veillard + * Deprecated, don't use. */ #ifndef __XML_UNICODE_H__ #define __XML_UNICODE_H__ -#include <libxml/xmlversion.h> - -#ifdef LIBXML_UNICODE_ENABLED - -#ifdef __cplusplus -extern "C" { +#ifdef __GNUC__ + #warning "libxml/xmlunicode.h is deprecated" #endif -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsAegeanNumbers (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsAlphabeticPresentationForms (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsArabic (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsArabicPresentationFormsA (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsArabicPresentationFormsB (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsArmenian (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsArrows (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsBasicLatin (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsBengali (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsBlockElements (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsBopomofo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsBopomofoExtended (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsBoxDrawing (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsBraillePatterns (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsBuhid (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsByzantineMusicalSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKCompatibility (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKCompatibilityForms (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKCompatibilityIdeographs (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKCompatibilityIdeographsSupplement (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKRadicalsSupplement (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKSymbolsandPunctuation (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographs (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographsExtensionA (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographsExtensionB (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCherokee (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCombiningDiacriticalMarks (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCombiningDiacriticalMarksforSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCombiningHalfMarks (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCombiningMarksforSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsControlPictures (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCurrencySymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCypriotSyllabary (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCyrillic (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCyrillicSupplement (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsDeseret (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsDevanagari (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsDingbats (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsEnclosedAlphanumerics (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsEnclosedCJKLettersandMonths (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsEthiopic (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGeneralPunctuation (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGeometricShapes (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGeorgian (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGothic (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGreek (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGreekExtended (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGreekandCoptic (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGujarati (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsGurmukhi (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHalfwidthandFullwidthForms (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHangulCompatibilityJamo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHangulJamo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHangulSyllables (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHanunoo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHebrew (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHighPrivateUseSurrogates (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHighSurrogates (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsHiragana (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsIPAExtensions (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsIdeographicDescriptionCharacters (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsKanbun (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsKangxiRadicals (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsKannada (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsKatakana (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsKatakanaPhoneticExtensions (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsKhmer (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsKhmerSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLao (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLatin1Supplement (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLatinExtendedA (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLatinExtendedB (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLatinExtendedAdditional (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLetterlikeSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLimbu (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLinearBIdeograms (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLinearBSyllabary (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsLowSurrogates (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMalayalam (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMathematicalAlphanumericSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMathematicalOperators (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMiscellaneousMathematicalSymbolsA (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMiscellaneousMathematicalSymbolsB (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMiscellaneousSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMiscellaneousSymbolsandArrows (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMiscellaneousTechnical (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMongolian (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMusicalSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsMyanmar (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsNumberForms (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsOgham (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsOldItalic (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsOpticalCharacterRecognition (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsOriya (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsOsmanya (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsPhoneticExtensions (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsPrivateUse (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsPrivateUseArea (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsRunic (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsShavian (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSinhala (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSmallFormVariants (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSpacingModifierLetters (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSpecials (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSuperscriptsandSubscripts (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSupplementalArrowsA (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSupplementalArrowsB (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSupplementalMathematicalOperators (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSupplementaryPrivateUseAreaA (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSupplementaryPrivateUseAreaB (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsSyriac (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsTagalog (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsTagbanwa (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsTags (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsTaiLe (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsTaiXuanJingSymbols (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsTamil (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsTelugu (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsThaana (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsThai (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsTibetan (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsUgaritic (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsUnifiedCanadianAboriginalSyllabics (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsVariationSelectors (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsVariationSelectorsSupplement (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsYiRadicals (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsYiSyllables (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsYijingHexagramSymbols (int code); - -XMLPUBFUN int xmlUCSIsBlock (int code, const char *block); - -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatC (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatCc (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatCf (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatCo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatCs (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatL (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatLl (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatLm (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatLo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatLt (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatLu (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatM (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatMc (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatMe (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatMn (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatN (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatNd (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatNl (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatNo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatP (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatPc (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatPd (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatPe (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatPf (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatPi (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatPo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatPs (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatS (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatSc (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatSk (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatSm (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatSo (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatZ (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatZl (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatZp (int code); -XML_DEPRECATED -XMLPUBFUN int xmlUCSIsCatZs (int code); - -XMLPUBFUN int xmlUCSIsCat (int code, const char *cat); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_UNICODE_ENABLED */ - #endif /* __XML_UNICODE_H__ */
diff --git a/third_party/libxml/src/include/libxml/xmlversion.h.in b/third_party/libxml/src/include/libxml/xmlversion.h.in index 000a0fa..c3f0e4d 100644 --- a/third_party/libxml/src/include/libxml/xmlversion.h.in +++ b/third_party/libxml/src/include/libxml/xmlversion.h.in
@@ -155,11 +155,9 @@ /** * LIBXML_LEGACY_ENABLED: * - * Whether the deprecated APIs are compiled in for compatibility + * Removed in 2.14 */ -#if @WITH_LEGACY@ -#define LIBXML_LEGACY_ENABLED -#endif +#undef LIBXML_LEGACY_ENABLED /** * LIBXML_C14N_ENABLED: @@ -245,11 +243,9 @@ /** * LIBXML_UNICODE_ENABLED: * - * Whether the Unicode related interfaces are compiled in + * Removed in 2.14 */ -#if @WITH_REGEXPS@ -#define LIBXML_UNICODE_ENABLED -#endif +#undef LIBXML_UNICODE_ENABLED /** * LIBXML_REGEXP_ENABLED: @@ -270,6 +266,15 @@ #endif /** + * LIBXML_RELAXNG_ENABLED: + * + * Whether the RelaxNG validation interfaces are compiled in + */ +#if @WITH_RELAXNG@ +#define LIBXML_RELAXNG_ENABLED +#endif + +/** * LIBXML_SCHEMAS_ENABLED: * * Whether the Schemas validation interfaces are compiled in
diff --git a/third_party/libxml/src/include/libxml/xpathInternals.h b/third_party/libxml/src/include/libxml/xpathInternals.h index 48eb472..88b487a 100644 --- a/third_party/libxml/src/include/libxml/xpathInternals.h +++ b/third_party/libxml/src/include/libxml/xpathInternals.h
@@ -22,6 +22,12 @@ extern "C" { #endif +/* + * Backward compatibility + */ +#define valuePush xmlXPathValuePush +#define valuePop xmlXPathValuePop + /************************************************************************ * * * Helpers * @@ -478,11 +484,10 @@ XMLPUBFUN void xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt); -/* TODO: remap to xmlXPathValuePop and Push. */ XMLPUBFUN xmlXPathObjectPtr - valuePop (xmlXPathParserContextPtr ctxt); + xmlXPathValuePop (xmlXPathParserContextPtr ctxt); XMLPUBFUN int - valuePush (xmlXPathParserContextPtr ctxt, + xmlXPathValuePush (xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value); XMLPUBFUN xmlXPathObjectPtr
diff --git a/third_party/libxml/src/include/private/Makefile.am b/third_party/libxml/src/include/private/Makefile.am index 5e1cdf84..7bdba3d 100644 --- a/third_party/libxml/src/include/private/Makefile.am +++ b/third_party/libxml/src/include/private/Makefile.am
@@ -8,14 +8,15 @@ globals.h \ html.h \ io.h \ + lint.h \ memory.h \ parser.h \ regexp.h \ save.h \ - shell.h \ string.h \ threads.h \ tree.h \ + unicode.h \ xinclude.h \ xpath.h \ xzlib.h
diff --git a/third_party/libxml/src/include/private/Makefile.in b/third_party/libxml/src/include/private/Makefile.in index bed4e1a6..a5097b8 100644 --- a/third_party/libxml/src/include/private/Makefile.in +++ b/third_party/libxml/src/include/private/Makefile.in
@@ -91,12 +91,8 @@ host_triplet = @host@ subdir = include/private ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_flag.m4 \ - $(top_srcdir)/m4/ax_append_link_flags.m4 \ - $(top_srcdir)/m4/ax_check_link_flag.m4 \ - $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_recursive_eval.m4 \ - $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/VERSION \ @@ -231,7 +227,6 @@ TAR = @TAR@ THREAD_LIBS = @THREAD_LIBS@ VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ WGET = @WGET@ WITH_C14N = @WITH_C14N@ WITH_CATALOG = @WITH_CATALOG@ @@ -241,7 +236,6 @@ WITH_ICONV = @WITH_ICONV@ WITH_ICU = @WITH_ICU@ WITH_ISO8859X = @WITH_ISO8859X@ -WITH_LEGACY = @WITH_LEGACY@ WITH_LZMA = @WITH_LZMA@ WITH_MODULES = @WITH_MODULES@ WITH_OUTPUT = @WITH_OUTPUT@ @@ -249,6 +243,7 @@ WITH_PUSH = @WITH_PUSH@ WITH_READER = @WITH_READER@ WITH_REGEXPS = @WITH_REGEXPS@ +WITH_RELAXNG = @WITH_RELAXNG@ WITH_SAX1 = @WITH_SAX1@ WITH_SCHEMAS = @WITH_SCHEMAS@ WITH_SCHEMATRON = @WITH_SCHEMATRON@ @@ -339,14 +334,15 @@ globals.h \ html.h \ io.h \ + lint.h \ memory.h \ parser.h \ regexp.h \ save.h \ - shell.h \ string.h \ threads.h \ tree.h \ + unicode.h \ xinclude.h \ xpath.h \ xzlib.h
diff --git a/third_party/libxml/src/include/private/enc.h b/third_party/libxml/src/include/private/enc.h index 864025f8..ef8ce5a 100644 --- a/third_party/libxml/src/include/private/enc.h +++ b/third_party/libxml/src/include/private/enc.h
@@ -7,11 +7,12 @@ XML_HIDDEN void xmlInitEncodingInternal(void); -XML_HIDDEN int +XML_HIDDEN xmlCharEncError xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out, - int *outlen, const unsigned char *in, int *inlen); -XML_HIDDEN int -xmlCharEncInput(xmlParserInputBufferPtr input, size_t *sizeOut); + int *outlen, const unsigned char *in, int *inlen, + int flush); +XML_HIDDEN xmlCharEncError +xmlCharEncInput(xmlParserInputBufferPtr input, size_t *sizeOut, int flush); XML_HIDDEN int xmlCharEncOutput(xmlOutputBufferPtr output, int init);
diff --git a/third_party/libxml/src/include/private/error.h b/third_party/libxml/src/include/private/error.h index d99cfea..b88fd82 100644 --- a/third_party/libxml/src/include/private/error.h +++ b/third_party/libxml/src/include/private/error.h
@@ -10,6 +10,9 @@ struct _xmlNode; +XML_HIDDEN int +xmlIsCatastrophicError(int level, int code); + XML_HIDDEN void xmlRaiseMemoryError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel, void *data, int domain, xmlError *error);
diff --git a/third_party/libxml/src/include/private/globals.h b/third_party/libxml/src/include/private/globals.h index d111701e..88a38256 100644 --- a/third_party/libxml/src/include/private/globals.h +++ b/third_party/libxml/src/include/private/globals.h
@@ -9,9 +9,7 @@ XML_HIDDEN xmlError * xmlGetLastErrorInternal(void); -#ifdef LIBXML_THREAD_ENABLED XML_HIDDEN unsigned * xmlGetLocalRngState(void); -#endif #endif /* XML_GLOBALS_H_PRIVATE__ */
diff --git a/third_party/libxml/src/include/private/io.h b/third_party/libxml/src/include/private/io.h index 8748c66..d6af99f 100644 --- a/third_party/libxml/src/include/private/io.h +++ b/third_party/libxml/src/include/private/io.h
@@ -21,15 +21,19 @@ XML_HIDDEN int xmlNoNetExists(const char *filename); -XML_HIDDEN int +XML_HIDDEN xmlParserErrors xmlParserInputBufferCreateUrl(const char *URI, xmlCharEncoding enc, - int flags, xmlParserInputBufferPtr *out); + xmlParserInputFlags flags, + xmlParserInputBufferPtr *out); XML_HIDDEN xmlParserInputBufferPtr -xmlNewInputBufferString(const char *str, int flags); +xmlNewInputBufferString(const char *str, xmlParserInputFlags flags); XML_HIDDEN xmlParserInputBufferPtr -xmlNewInputBufferMemory(const void *mem, size_t size, int flags, - xmlCharEncoding enc); +xmlNewInputBufferMemory(const void *mem, size_t size, + xmlParserInputFlags flags, xmlCharEncoding enc); + +XML_HIDDEN xmlParserErrors +xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, xmlParserInputFlags flags); #ifdef LIBXML_OUTPUT_ENABLED XML_HIDDEN void
diff --git a/third_party/libxml/src/include/private/lint.h b/third_party/libxml/src/include/private/lint.h new file mode 100644 index 0000000..5c055c3 --- /dev/null +++ b/third_party/libxml/src/include/private/lint.h
@@ -0,0 +1,15 @@ +#ifndef XML_LINT_H_PRIVATE__ +#define XML_LINT_H_PRIVATE__ + +#include <stdio.h> + +#include <libxml/parser.h> + +int +xmllintMain(int argc, const char **argv, FILE *errStream, + xmlResourceLoader loader); + +void +xmllintShell(xmlDocPtr doc, const char *filename, FILE *output); + +#endif /* XML_LINT_H_PRIVATE__ */
diff --git a/third_party/libxml/src/include/private/memory.h b/third_party/libxml/src/include/private/memory.h index ef0497c..754803b 100644 --- a/third_party/libxml/src/include/private/memory.h +++ b/third_party/libxml/src/include/private/memory.h
@@ -1,9 +1,58 @@ #ifndef XML_MEMORY_H_PRIVATE__ #define XML_MEMORY_H_PRIVATE__ +#include "../../libxml.h" + +#include <limits.h> +#include <stddef.h> + +#ifndef SIZE_MAX + #define SIZE_MAX ((size_t) -1) +#endif + +#define XML_MAX_ITEMS 1000000000 /* 1 billion */ + XML_HIDDEN void xmlInitMemoryInternal(void); XML_HIDDEN void xmlCleanupMemoryInternal(void); +/** + * xmlGrowCapacity: + * @array: pointer to array + * @capacity: pointer to capacity (in/out) + * @elemSize: size of an element in bytes + * @min: elements in initial allocation + * @max: maximum elements in the array + * + * Grow an array by at least one element, checking for overflow. + * + * Returns the new array size on success, -1 on failure. + */ +static XML_INLINE int +xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) { + int extra; + + if (capacity <= 0) { +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + (void) min; + return(1); +#else + return(min); +#endif + } + + if ((capacity >= max) || + ((size_t) capacity > SIZE_MAX / 2 / elemSize)) + return(-1); + + /* Grow by 50% */ + extra = (capacity + 1) / 2; + + if (capacity > max - extra) + return(max); + + return(capacity + extra); +} + #endif /* XML_MEMORY_H_PRIVATE__ */
diff --git a/third_party/libxml/src/include/private/parser.h b/third_party/libxml/src/include/private/parser.h index a0964223..d5f2fef 100644 --- a/third_party/libxml/src/include/private/parser.h +++ b/third_party/libxml/src/include/private/parser.h
@@ -21,6 +21,9 @@ */ #define XML_VCTXT_USE_PCTXT (1u << 1) +/* + * TODO: Rename to avoid confusion with xmlParserInputFlags + */ #define XML_INPUT_HAS_ENCODING (1u << 0) #define XML_INPUT_AUTO_ENCODING (7u << 1) #define XML_INPUT_AUTO_UTF8 (1u << 1) @@ -46,6 +49,14 @@ (((ctxt)->input->entity != NULL) && \ ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY))) +/** + * INPUT_CHUNK: + * + * The parser tries to always have that amount of input ready. + * One of the point is providing context when reporting errors. + */ +#define INPUT_CHUNK 250 + struct _xmlAttrHashBucket { int index; }; @@ -68,8 +79,6 @@ XML_HIDDEN void xmlCtxtErrIO(xmlParserCtxtPtr ctxt, int code, const char *uri); XML_HIDDEN int -xmlIsCatastrophicError(int level, int code); -XML_HIDDEN int xmlCtxtIsCatastrophicError(xmlParserCtxtPtr ctxt); XML_HIDDEN void @@ -86,6 +95,11 @@ XML_HIDDEN const xmlChar * xmlGetActualEncoding(xmlParserCtxtPtr ctxt); +XML_HIDDEN int +nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value); +XML_HIDDEN xmlNodePtr +nodePop(xmlParserCtxtPtr ctxt); + XML_HIDDEN xmlParserNsData * xmlParserNsCreate(void); XML_HIDDEN void @@ -105,23 +119,26 @@ xmlResourceType type); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromUrl(xmlParserCtxtPtr ctxt, const char *url, - const char *publicId, const char *encoding, int flags); + const char *publicId, const char *encoding, + xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromMemory(xmlParserCtxtPtr ctxt, const char *url, const void *mem, size_t size, - const char *encoding, int flags); + const char *encoding, + xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromString(xmlParserCtxtPtr ctxt, const char *url, - const char *str, const char *encoding, int flags); + const char *str, const char *encoding, + xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromFd(xmlParserCtxtPtr ctxt, const char *filename, int fd, - const char *encoding, int flags); + const char *encoding, xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlCtxtNewInputFromIO(xmlParserCtxtPtr ctxt, const char *url, xmlInputReadCallback ioRead, xmlInputCloseCallback ioClose, void *ioCtxt, - const char *encoding, int flags); + const char *encoding, xmlParserInputFlags flags); XML_HIDDEN xmlParserInputPtr xmlNewPushInput(const char *url, const char *chunk, int size); @@ -129,4 +146,7 @@ xmlExpandEntitiesInAttValue(xmlParserCtxtPtr ctxt, const xmlChar *str, int normalize); +XML_HIDDEN void +xmlParserCheckEOF(xmlParserCtxtPtr ctxt, xmlParserErrors code); + #endif /* XML_PARSER_H_PRIVATE__ */
diff --git a/third_party/libxml/src/include/private/shell.h b/third_party/libxml/src/include/private/shell.h deleted file mode 100644 index 53a857e..0000000 --- a/third_party/libxml/src/include/private/shell.h +++ /dev/null
@@ -1,7 +0,0 @@ -#ifndef XML_SHELL_H_PRIVATE__ -#define XML_SHELL_H_PRIVATE__ - -void -xmllintShell(xmlDocPtr doc, const char *filename, FILE *output); - -#endif /* XML_SHELL_H_PRIVATE__ */
diff --git a/third_party/libxml/src/include/private/unicode.h b/third_party/libxml/src/include/private/unicode.h new file mode 100644 index 0000000..2765263 --- /dev/null +++ b/third_party/libxml/src/include/private/unicode.h
@@ -0,0 +1,44 @@ +#ifndef XML_UNICODE_H_PRIVATE__ +#define XML_UNICODE_H_PRIVATE__ + +XML_HIDDEN int xmlUCSIsBlock (int code, const char *block); +XML_HIDDEN int xmlUCSIsCat (int code, const char *cat); + +XML_HIDDEN int xmlUCSIsCatC (int code); +XML_HIDDEN int xmlUCSIsCatCc (int code); +XML_HIDDEN int xmlUCSIsCatCf (int code); +XML_HIDDEN int xmlUCSIsCatCo (int code); +XML_HIDDEN int xmlUCSIsCatCs (int code); +XML_HIDDEN int xmlUCSIsCatL (int code); +XML_HIDDEN int xmlUCSIsCatLl (int code); +XML_HIDDEN int xmlUCSIsCatLm (int code); +XML_HIDDEN int xmlUCSIsCatLo (int code); +XML_HIDDEN int xmlUCSIsCatLt (int code); +XML_HIDDEN int xmlUCSIsCatLu (int code); +XML_HIDDEN int xmlUCSIsCatM (int code); +XML_HIDDEN int xmlUCSIsCatMc (int code); +XML_HIDDEN int xmlUCSIsCatMe (int code); +XML_HIDDEN int xmlUCSIsCatMn (int code); +XML_HIDDEN int xmlUCSIsCatN (int code); +XML_HIDDEN int xmlUCSIsCatNd (int code); +XML_HIDDEN int xmlUCSIsCatNl (int code); +XML_HIDDEN int xmlUCSIsCatNo (int code); +XML_HIDDEN int xmlUCSIsCatP (int code); +XML_HIDDEN int xmlUCSIsCatPc (int code); +XML_HIDDEN int xmlUCSIsCatPd (int code); +XML_HIDDEN int xmlUCSIsCatPe (int code); +XML_HIDDEN int xmlUCSIsCatPf (int code); +XML_HIDDEN int xmlUCSIsCatPi (int code); +XML_HIDDEN int xmlUCSIsCatPo (int code); +XML_HIDDEN int xmlUCSIsCatPs (int code); +XML_HIDDEN int xmlUCSIsCatS (int code); +XML_HIDDEN int xmlUCSIsCatSc (int code); +XML_HIDDEN int xmlUCSIsCatSk (int code); +XML_HIDDEN int xmlUCSIsCatSm (int code); +XML_HIDDEN int xmlUCSIsCatSo (int code); +XML_HIDDEN int xmlUCSIsCatZ (int code); +XML_HIDDEN int xmlUCSIsCatZl (int code); +XML_HIDDEN int xmlUCSIsCatZp (int code); +XML_HIDDEN int xmlUCSIsCatZs (int code); + +#endif /* XML_UNICODE_H_PRIVATE__ */
diff --git a/third_party/libxml/src/libxml.h b/third_party/libxml/src/libxml.h index eeaf71d..f2fcb45 100644 --- a/third_party/libxml/src/libxml.h +++ b/third_party/libxml/src/libxml.h
@@ -35,6 +35,29 @@ #define XML_HAS_ATTRIBUTE(x) 0 #endif +#if __STDC_VERSION__ >= 199901L + #define XML_INLINE inline +#elif defined(_MSC_VER) + #if _MSC_VER >= 1900 + #define XML_INLINE inline + #else + #define XML_INLINE _inline + #endif +#else + #define XML_INLINE +#endif + +#if __STDC_VERSION__ >= 199901L || (defined(_MSC_VER) && _MSC_VER >= 1900) + #include <stdint.h> + #define XML_INTPTR_T intptr_t +#else + #include <stddef.h> + #define XML_INTPTR_T ptrdiff_t +#endif + +#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p)) +#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i)) + #if !defined(_WIN32) && \ !defined(__CYGWIN__) && \ (defined(__clang__) || \
diff --git a/third_party/libxml/src/lintmain.c b/third_party/libxml/src/lintmain.c new file mode 100644 index 0000000..9e49ec6c --- /dev/null +++ b/third_party/libxml/src/lintmain.c
@@ -0,0 +1,14 @@ +/* + * lintmain.c: Main routine for xmllint + * + * See Copyright for the status of this software. + */ + +#include <stdio.h> + +#include "private/lint.h" + +int +main(int argc, char **argv) { + return(xmllintMain(argc, (const char **) argv, stderr, NULL)); +}
diff --git a/third_party/libxml/src/parser.c b/third_party/libxml/src/parser.c index dbf1796..d8d590f 100644 --- a/third_party/libxml/src/parser.c +++ b/third_party/libxml/src/parser.c
@@ -73,6 +73,7 @@ #include "private/error.h" #include "private/html.h" #include "private/io.h" +#include "private/memory.h" #include "private/parser.h" #define NS_INDEX_EMPTY INT_MAX @@ -88,6 +89,8 @@ #define SIZE_MAX ((size_t) -1) #endif +#define XML_MAX_ATTRS 100000000 /* 100 million */ + struct _xmlStartTag { const xmlChar *prefix; const xmlChar *URI; @@ -158,18 +161,6 @@ */ #define XML_ENT_FIXED_COST 20 -/** - * xmlParserMaxDepth: - * - * arbitrary depth limit for the XML documents that we allow to - * process. This is not a limitation of the parser but a safety - * boundary feature. It can be disabled with the XML_PARSE_HUGE - * parser option. - */ -const unsigned int xmlParserMaxDepth = 256; - - - #define XML_PARSER_BIG_BUFFER_SIZE 300 #define XML_PARSER_BUFFER_SIZE 100 #define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document" @@ -584,11 +575,7 @@ return(0); #endif case XML_WITH_LEGACY: -#ifdef LIBXML_LEGACY_ENABLED - return(1); -#else return(0); -#endif case XML_WITH_C14N: #ifdef LIBXML_C14N_ENABLED return(1); @@ -632,11 +619,7 @@ return(0); #endif case XML_WITH_UNICODE: -#ifdef LIBXML_UNICODE_ENABLED - return(1); -#else return(0); -#endif case XML_WITH_REGEXP: #ifdef LIBXML_REGEXP_ENABLED return(1); @@ -655,6 +638,12 @@ #else return(0); #endif + case XML_WITH_RELAXNG: +#ifdef LIBXML_RELAXNG_ENABLED + return(1); +#else + return(0); +#endif case XML_WITH_SCHEMAS: #ifdef LIBXML_SCHEMAS_ENABLED return(1); @@ -1104,7 +1093,19 @@ xmlDefAttrsPtr temp; int newSize; - newSize = (defaults != NULL) ? 2 * defaults->maxAttrs : 4; + if (defaults == NULL) { + newSize = 4; + } else { + if ((defaults->maxAttrs >= XML_MAX_ATTRS) || + ((size_t) defaults->maxAttrs > + SIZE_MAX / 2 / sizeof(temp[0]) - sizeof(*defaults))) + goto mem_error; + + if (defaults->maxAttrs > XML_MAX_ATTRS / 2) + newSize = XML_MAX_ATTRS; + else + newSize = defaults->maxAttrs * 2; + } temp = xmlRealloc(defaults, sizeof(*defaults) + newSize * sizeof(xmlDefAttr)); if (temp == NULL) @@ -1184,7 +1185,7 @@ } if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr, - (void *) (ptrdiff_t) type) < 0) + XML_INT_TO_PTR(type)) < 0) goto mem_error; return; @@ -1203,7 +1204,7 @@ const xmlChar *unused ATTRIBUTE_UNUSED) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data; - if (((ptrdiff_t) payload) == XML_ATTRIBUTE_CDATA) { + if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) { xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL); } } @@ -1670,9 +1671,11 @@ xmlParserNsExtra *extra; int newSize; - if (ctxt->nsMax > INT_MAX / 2) + newSize = xmlGrowCapacity(ctxt->nsMax, + sizeof(table[0]) + sizeof(extra[0]), + 16, XML_MAX_ITEMS); + if (newSize < 0) goto error; - newSize = ctxt->nsMax ? ctxt->nsMax * 2 : 16; table = xmlRealloc(ctxt->nsTab, 2 * newSize * sizeof(table[0])); if (table == NULL) @@ -1895,35 +1898,31 @@ xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt) { const xmlChar **atts; unsigned *attallocs; - int maxatts = ctxt->maxatts; + int newSize; - if (maxatts == 0) { - maxatts = 50; - } else { - if ((maxatts > INT_MAX / 2 - 5) || - ((size_t) maxatts > SIZE_MAX / 2 / sizeof(const xmlChar *))) - goto mem_error; - maxatts *= 2; + newSize = xmlGrowCapacity(ctxt->maxatts / 5, + sizeof(atts[0]) * 5 + sizeof(attallocs[0]), + 10, XML_MAX_ATTRS); + if (newSize < 0) { + xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, + "Maximum number of attributes exceeded"); + return(-1); } - atts = xmlMalloc(maxatts * sizeof(const xmlChar *)); + atts = xmlRealloc(ctxt->atts, newSize * sizeof(atts[0]) * 5); if (atts == NULL) goto mem_error; - attallocs = xmlRealloc(ctxt->attallocs, - (maxatts / 5) * sizeof(attallocs[0])); - if (attallocs == NULL) { - xmlFree(atts); - goto mem_error; - } - if (ctxt->maxatts > 0) - memcpy(atts, ctxt->atts, ctxt->maxatts * sizeof(const xmlChar *)); - xmlFree(ctxt->atts); - ctxt->atts = atts; - ctxt->attallocs = attallocs; - ctxt->maxatts = maxatts; - return(maxatts); + attallocs = xmlRealloc(ctxt->attallocs, + newSize * sizeof(attallocs[0])); + if (attallocs == NULL) + goto mem_error; + ctxt->attallocs = attallocs; + + ctxt->maxatts = newSize * 5; + + return(0); mem_error: xmlErrMemory(ctxt); @@ -1949,22 +1948,23 @@ return(-1); maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20; - if (ctxt->inputNr > maxDepth) { - xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, - "Maximum entity nesting depth exceeded"); - xmlHaltParser(ctxt); - return(-1); - } if (ctxt->inputNr >= ctxt->inputMax) { - size_t newSize = ctxt->inputMax * 2; xmlParserInputPtr *tmp; + int newSize; - tmp = (xmlParserInputPtr *) xmlRealloc(ctxt->inputTab, - newSize * sizeof(*tmp)); + newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]), + 5, maxDepth); + if (newSize < 0) { + xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, + "Maximum entity nesting depth exceeded"); + xmlHaltParser(ctxt); + return(-1); + } + tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlErrMemory(ctxt); - return (-1); + return(-1); } ctxt->inputTab = tmp; ctxt->inputMax = newSize; @@ -2029,33 +2029,6 @@ } /** - * inputPush: - * @ctxt: an XML parser context - * @value: the parser input - * - * Pushes a new parser input on top of the input stack - * - * Returns -1 in case of error, the index in the stack otherwise - */ -int -inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value) -{ - return(xmlCtxtPushInput(ctxt, value)); -} -/** - * inputPop: - * @ctxt: an XML parser context - * - * Pops the top parser input from the input stack - * - * Returns the input just removed - */ -xmlParserInputPtr -inputPop(xmlParserCtxtPtr ctxt) -{ - return(xmlCtxtPopInput(ctxt)); -} -/** * nodePush: * @ctxt: an XML parser context * @value: the element node @@ -2069,32 +2042,34 @@ int nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value) { - int maxDepth; - if (ctxt == NULL) return(0); - maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256; - if (ctxt->nodeNr > maxDepth) { - xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT, - "Excessive depth in document: %d use XML_PARSE_HUGE option\n", - ctxt->nodeNr); - xmlHaltParser(ctxt); - return(-1); - } if (ctxt->nodeNr >= ctxt->nodeMax) { + int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256; xmlNodePtr *tmp; + int newSize; - tmp = (xmlNodePtr *) xmlRealloc(ctxt->nodeTab, - ctxt->nodeMax * 2 * - sizeof(ctxt->nodeTab[0])); + newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]), + 10, maxDepth); + if (newSize < 0) { + xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT, + "Excessive depth in document: %d," + " use XML_PARSE_HUGE option\n", + ctxt->nodeNr); + xmlHaltParser(ctxt); + return(-1); + } + + tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlErrMemory(ctxt); return (-1); } ctxt->nodeTab = tmp; - ctxt->nodeMax *= 2; + ctxt->nodeMax = newSize; } + ctxt->nodeTab[ctxt->nodeNr] = value; ctxt->node = value; return (ctxt->nodeNr++); @@ -2148,28 +2123,29 @@ xmlStartTag *tag; if (ctxt->nameNr >= ctxt->nameMax) { - const xmlChar * *tmp; + const xmlChar **tmp; xmlStartTag *tmp2; - ctxt->nameMax *= 2; - tmp = (const xmlChar * *) xmlRealloc((xmlChar * *)ctxt->nameTab, - ctxt->nameMax * - sizeof(ctxt->nameTab[0])); - if (tmp == NULL) { - ctxt->nameMax /= 2; + int newSize; + + newSize = xmlGrowCapacity(ctxt->nameMax, + sizeof(tmp[0]) + sizeof(tmp2[0]), + 10, XML_MAX_ITEMS); + if (newSize < 0) + goto mem_error; + + tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0])); + if (tmp == NULL) goto mem_error; - } ctxt->nameTab = tmp; - tmp2 = (xmlStartTag *) xmlRealloc((void * *)ctxt->pushTab, - ctxt->nameMax * - sizeof(ctxt->pushTab[0])); - if (tmp2 == NULL) { - ctxt->nameMax /= 2; + + tmp2 = xmlRealloc(ctxt->pushTab, newSize * sizeof(tmp2[0])); + if (tmp2 == NULL) goto mem_error; - } ctxt->pushTab = tmp2; + + ctxt->nameMax = newSize; } else if (ctxt->pushTab == NULL) { - ctxt->pushTab = (xmlStartTag *) xmlMalloc(ctxt->nameMax * - sizeof(ctxt->pushTab[0])); + ctxt->pushTab = xmlMalloc(ctxt->nameMax * sizeof(ctxt->pushTab[0])); if (ctxt->pushTab == NULL) goto mem_error; } @@ -2213,41 +2189,6 @@ #endif /* LIBXML_PUSH_ENABLED */ /** - * namePush: - * @ctxt: an XML parser context - * @value: the element name - * - * DEPRECATED: Internal function, do not use. - * - * Pushes a new element name on top of the name stack - * - * Returns -1 in case of error, the index in the stack otherwise - */ -int -namePush(xmlParserCtxtPtr ctxt, const xmlChar * value) -{ - if (ctxt == NULL) return (-1); - - if (ctxt->nameNr >= ctxt->nameMax) { - const xmlChar * *tmp; - tmp = (const xmlChar * *) xmlRealloc((xmlChar * *)ctxt->nameTab, - ctxt->nameMax * 2 * - sizeof(ctxt->nameTab[0])); - if (tmp == NULL) { - goto mem_error; - } - ctxt->nameTab = tmp; - ctxt->nameMax *= 2; - } - ctxt->nameTab[ctxt->nameNr] = value; - ctxt->name = value; - return (ctxt->nameNr++); -mem_error: - xmlErrMemory(ctxt); - return (-1); -} - -/** * namePop: * @ctxt: an XML parser context * @@ -2257,7 +2198,7 @@ * * Returns the name just removed */ -const xmlChar * +static const xmlChar * namePop(xmlParserCtxtPtr ctxt) { const xmlChar *ret; @@ -2277,16 +2218,23 @@ static int spacePush(xmlParserCtxtPtr ctxt, int val) { if (ctxt->spaceNr >= ctxt->spaceMax) { int *tmp; + int newSize; - ctxt->spaceMax *= 2; - tmp = (int *) xmlRealloc(ctxt->spaceTab, - ctxt->spaceMax * sizeof(ctxt->spaceTab[0])); + newSize = xmlGrowCapacity(ctxt->spaceMax, sizeof(tmp[0]), + 10, XML_MAX_ITEMS); + if (newSize < 0) { + xmlErrMemory(ctxt); + return(-1); + } + + tmp = xmlRealloc(ctxt->spaceTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlErrMemory(ctxt); - ctxt->spaceMax /=2; return(-1); } ctxt->spaceTab = tmp; + + ctxt->spaceMax = newSize; } ctxt->spaceTab[ctxt->spaceNr] = val; ctxt->space = &ctxt->spaceTab[ctxt->spaceNr]; @@ -2382,9 +2330,7 @@ } while (0) #define SHRINK \ - if ((!PARSER_PROGRESSIVE(ctxt)) && \ - (ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \ - (ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \ + if (!PARSER_PROGRESSIVE(ctxt)) \ xmlParserShrink(ctxt); #define GROW \ @@ -2443,10 +2389,6 @@ const xmlChar *cur; int res = 0; - /* - * It's Okay to use CUR/NEXT here since all the blanks are on - * the ASCII range. - */ cur = ctxt->input->cur; while (IS_BLANK_CH(*cur)) { if (*cur == '\n') { @@ -2465,6 +2407,9 @@ } ctxt->input->cur = cur; + if (res > 4) + GROW; + return(res); } @@ -2535,6 +2480,10 @@ if (!inParam && !expandParam) return(xmlSkipBlankChars(ctxt)); + /* + * It's Okay to use CUR/NEXT here since all the blanks are on + * the ASCII range. + */ while (PARSER_STOPPED(ctxt) == 0) { if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */ NEXT; @@ -2949,13 +2898,6 @@ xmlNodePtr lastChild; /* - * Don't spend time trying to differentiate them, the same callback is - * used ! - */ - if (ctxt->sax->ignorableWhitespace == ctxt->sax->characters) - return(0); - - /* * Check for xml:space value. */ if ((ctxt->space == NULL) || (*(ctxt->space) == 1) || @@ -2998,6 +2940,10 @@ /* * Otherwise, heuristic :-\ + * + * When push parsing, we could be at the end of a chunk. + * This makes the look-ahead and consequently the NOBLANKS + * option unreliable. */ if ((RAW != '<') && (RAW != 0xD)) return(0); if ((ctxt->node->children == NULL) && @@ -3083,15 +3029,22 @@ while ((c != 0) && (c != ':')) { /* tested bigname.xml */ if (len + 10 > max) { xmlChar *tmp; + int newSize; - max *= 2; - tmp = (xmlChar *) xmlRealloc(buffer, max); - if (tmp == NULL) { - xmlFree(buffer); + newSize = xmlGrowCapacity(max, 1, 1, XML_MAX_ITEMS); + if (newSize < 0) { xmlErrMemory(ctxt); + xmlFree(buffer); + return(NULL); + } + tmp = xmlRealloc(buffer, newSize); + if (tmp == NULL) { + xmlErrMemory(ctxt); + xmlFree(buffer); return(NULL); } buffer = tmp; + max = newSize; } buffer[len++] = c; c = *cur++; @@ -3171,9 +3124,15 @@ while (c != 0) { /* tested bigname2.xml */ if (len + 10 > max) { xmlChar *tmp; + int newSize; - max *= 2; - tmp = (xmlChar *) xmlRealloc(buffer, max); + newSize = xmlGrowCapacity(max, 1, 1, XML_MAX_ITEMS); + if (newSize < 0) { + xmlErrMemory(ctxt); + xmlFree(buffer); + return(NULL); + } + tmp = xmlRealloc(buffer, newSize); if (tmp == NULL) { xmlErrMemory(ctxt); xmlFree(prefix); @@ -3181,6 +3140,7 @@ return(NULL); } buffer = tmp; + max = newSize; } buffer[len++] = c; c = *cur++; @@ -3667,24 +3627,26 @@ while (xmlIsNameChar(ctxt, c)) { if (len + 10 > max) { xmlChar *tmp; + int newSize; - max *= 2; - tmp = (xmlChar *) xmlRealloc(buffer, max); + newSize = xmlGrowCapacity(max, 1, 1, maxLength); + if (newSize < 0) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); + xmlFree(buffer); + return(NULL); + } + tmp = xmlRealloc(buffer, newSize); if (tmp == NULL) { xmlErrMemory(ctxt); xmlFree(buffer); return(NULL); } buffer = tmp; + max = newSize; } COPY_BUF(buffer, len, c); cur += l; c = CUR_SCHAR(cur, l); - if (len > maxLength) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName"); - xmlFree(buffer); - return(NULL); - } } buffer[len] = 0; *str = cur; @@ -3750,22 +3712,24 @@ while (xmlIsNameChar(ctxt, c)) { if (len + 10 > max) { xmlChar *tmp; + int newSize; - max *= 2; - tmp = (xmlChar *) xmlRealloc(buffer, max); + newSize = xmlGrowCapacity(max, 1, 1, maxLength); + if (newSize < 0) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken"); + xmlFree(buffer); + return(NULL); + } + tmp = xmlRealloc(buffer, newSize); if (tmp == NULL) { xmlErrMemory(ctxt); xmlFree(buffer); return(NULL); } buffer = tmp; + max = newSize; } COPY_BUF(buffer, len, c); - if (len > maxLength) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken"); - xmlFree(buffer); - return(NULL); - } NEXTL(l); c = xmlCurrentChar(ctxt, &l); } @@ -4669,22 +4633,24 @@ while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */ if (len + 5 >= size) { xmlChar *tmp; + int newSize; - size *= 2; - tmp = (xmlChar *) xmlRealloc(buf, size); + newSize = xmlGrowCapacity(size, 1, 1, maxLength); + if (newSize < 0) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral"); + xmlFree(buf); + return(NULL); + } + tmp = xmlRealloc(buf, newSize); if (tmp == NULL) { xmlFree(buf); xmlErrMemory(ctxt); return(NULL); } buf = tmp; + size = newSize; } COPY_BUF(buf, len, cur); - if (len > maxLength) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral"); - xmlFree(buf); - return(NULL); - } NEXTL(l); cur = xmlCurrentCharRecover(ctxt, &l); } @@ -4741,22 +4707,24 @@ (PARSER_STOPPED(ctxt) == 0)) { /* checked */ if (len + 1 >= size) { xmlChar *tmp; + int newSize; - size *= 2; - tmp = (xmlChar *) xmlRealloc(buf, size); + newSize = xmlGrowCapacity(size, 1, 1, maxLength); + if (newSize) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID"); + xmlFree(buf); + return(NULL); + } + tmp = xmlRealloc(buf, size); if (tmp == NULL) { xmlErrMemory(ctxt); xmlFree(buf); return(NULL); } buf = tmp; + size = newSize; } buf[len++] = cur; - if (len > maxLength) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID"); - xmlFree(buf); - return(NULL); - } NEXT; cur = CUR; } @@ -4809,6 +4777,40 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static void +xmlCharacters(xmlParserCtxtPtr ctxt, const xmlChar *buf, int size, + int isBlank) { + int checkBlanks; + + if ((ctxt->sax == NULL) || (ctxt->disableSAX)) + return; + + checkBlanks = (!ctxt->keepBlanks) || + (ctxt->sax->ignorableWhitespace != ctxt->sax->characters); + + /* + * Calling areBlanks with only parts of a text node + * is fundamentally broken, making the NOBLANKS option + * essentially unusable. + */ + if ((checkBlanks) && + (areBlanks(ctxt, buf, size, isBlank))) { + if ((ctxt->sax->ignorableWhitespace != NULL) && + (ctxt->keepBlanks)) + ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size); + } else { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, buf, size); + + /* + * The old code used to update this value for "complex" data + * even if checkBlanks was false. This was probably a bug. + */ + if ((checkBlanks) && (*ctxt->space == -1)) + *ctxt->space = -2; + } +} + /** * xmlParseCharDataInternal: * @ctxt: an XML parser context @@ -4854,27 +4856,7 @@ const xmlChar *tmp = ctxt->input->cur; ctxt->input->cur = in; - if ((ctxt->sax != NULL) && - (ctxt->disableSAX == 0) && - (ctxt->sax->ignorableWhitespace != - ctxt->sax->characters)) { - if (areBlanks(ctxt, tmp, nbchar, 1)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, - tmp, nbchar); - } else { - if (ctxt->sax->characters != NULL) - ctxt->sax->characters(ctxt->userData, - tmp, nbchar); - if (*ctxt->space == -1) - *ctxt->space = -2; - } - } else if ((ctxt->sax != NULL) && - (ctxt->disableSAX == 0) && - (ctxt->sax->characters != NULL)) { - ctxt->sax->characters(ctxt->userData, - tmp, nbchar); - } + xmlCharacters(ctxt, tmp, nbchar, 1); } return; } @@ -4899,41 +4881,21 @@ ctxt->input->cur = in + 1; return; } - in++; - ctxt->input->col++; - goto get_more; + if ((!partial) || (ctxt->input->end - in >= 2)) { + in++; + ctxt->input->col++; + goto get_more; + } } nbchar = in - ctxt->input->cur; if (nbchar > 0) { - if ((ctxt->sax != NULL) && - (ctxt->disableSAX == 0) && - (ctxt->sax->ignorableWhitespace != - ctxt->sax->characters) && - (IS_BLANK_CH(*ctxt->input->cur))) { - const xmlChar *tmp = ctxt->input->cur; - ctxt->input->cur = in; + const xmlChar *tmp = ctxt->input->cur; + ctxt->input->cur = in; - if (areBlanks(ctxt, tmp, nbchar, 0)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, - tmp, nbchar); - } else { - if (ctxt->sax->characters != NULL) - ctxt->sax->characters(ctxt->userData, - tmp, nbchar); - if (*ctxt->space == -1) - *ctxt->space = -2; - } - line = ctxt->input->line; - col = ctxt->input->col; - } else if ((ctxt->sax != NULL) && - (ctxt->disableSAX == 0)) { - if (ctxt->sax->characters != NULL) - ctxt->sax->characters(ctxt->userData, - ctxt->input->cur, nbchar); - line = ctxt->input->line; - col = ctxt->input->col; - } + xmlCharacters(ctxt, tmp, nbchar, 0); + + line = ctxt->input->line; + col = ctxt->input->col; } ctxt->input->cur = in; if (*in == 0xD) { @@ -4952,6 +4914,9 @@ if (*in == '&') { return; } + if ((partial) && (*in == ']') && (ctxt->input->end - in < 2)) { + return; + } SHRINK; GROW; in = ctxt->input->cur; @@ -4982,6 +4947,8 @@ cur = xmlCurrentCharRecover(ctxt, &l); while ((cur != '<') && /* checked */ (cur != '&') && + ((!partial) || (cur != ']') || + (ctxt->input->end - ctxt->input->cur >= 2)) && (IS_CHAR(cur))) { if ((cur == ']') && (NXT(1) == ']') && (NXT(2) == '>')) { xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL); @@ -4992,23 +4959,7 @@ if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) { buf[nbchar] = 0; - /* - * OK the segment is to be consumed as chars. - */ - if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { - if (areBlanks(ctxt, buf, nbchar, 0)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, - buf, nbchar); - } else { - if (ctxt->sax->characters != NULL) - ctxt->sax->characters(ctxt->userData, buf, nbchar); - if ((ctxt->sax->characters != - ctxt->sax->ignorableWhitespace) && - (*ctxt->space == -1)) - *ctxt->space = -2; - } - } + xmlCharacters(ctxt, buf, nbchar, 0); nbchar = 0; SHRINK; } @@ -5016,21 +4967,8 @@ } if (nbchar != 0) { buf[nbchar] = 0; - /* - * OK the segment is to be consumed as chars. - */ - if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { - if (areBlanks(ctxt, buf, nbchar, 0)) { - if (ctxt->sax->ignorableWhitespace != NULL) - ctxt->sax->ignorableWhitespace(ctxt->userData, buf, nbchar); - } else { - if (ctxt->sax->characters != NULL) - ctxt->sax->characters(ctxt->userData, buf, nbchar); - if ((ctxt->sax->characters != ctxt->sax->ignorableWhitespace) && - (*ctxt->space == -1)) - *ctxt->space = -2; - } - } + + xmlCharacters(ctxt, buf, nbchar, 0); } /* * cur == 0 can mean @@ -5046,7 +4984,7 @@ "Incomplete UTF-8 sequence starting with %02X\n", CUR); NEXTL(1); } - } else if ((cur != '<') && (cur != '&')) { + } else if ((cur != '<') && (cur != '&') && (cur != ']')) { /* Generate the error and skip the offending character */ xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR, "PCDATA invalid Char value %d\n", cur); @@ -5162,9 +5100,9 @@ int q, ql; int r, rl; int cur, l; - size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ? - XML_MAX_HUGE_LENGTH : - XML_MAX_TEXT_LENGTH; + int maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_HUGE_LENGTH : + XML_MAX_TEXT_LENGTH; if (buf == NULL) { len = 0; @@ -5207,26 +5145,26 @@ xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL); } if (len + 5 >= size) { - xmlChar *new_buf; - size_t new_size; + xmlChar *tmp; + int newSize; - new_size = size * 2; - new_buf = (xmlChar *) xmlRealloc(buf, new_size); - if (new_buf == NULL) { - xmlFree (buf); + newSize = xmlGrowCapacity(size, 1, 1, maxLength); + if (newSize < 0) { + xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, + "Comment too big found", NULL); + xmlFree (buf); + return; + } + tmp = xmlRealloc(buf, newSize); + if (tmp == NULL) { xmlErrMemory(ctxt); + xmlFree(buf); return; } - buf = new_buf; - size = new_size; + buf = tmp; + size = newSize; } COPY_BUF(buf, len, q); - if (len > maxLength) { - xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, - "Comment too big found", NULL); - xmlFree (buf); - return; - } q = r; ql = rl; @@ -5328,6 +5266,12 @@ * save current set of data */ if (nbchar > 0) { + if (nbchar > maxLength - len) { + xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, + "Comment too big found", NULL); + xmlFree(buf); + return; + } if (buf == NULL) { if ((*in == '-') && (in[1] == '-')) size = nbchar + 1; @@ -5341,11 +5285,11 @@ len = 0; } else if (len + nbchar + 1 >= size) { xmlChar *new_buf; - size += len + nbchar + XML_PARSER_BUFFER_SIZE; - new_buf = (xmlChar *) xmlRealloc(buf, size); + size += len + nbchar + XML_PARSER_BUFFER_SIZE; + new_buf = xmlRealloc(buf, size); if (new_buf == NULL) { - xmlFree (buf); xmlErrMemory(ctxt); + xmlFree(buf); return; } buf = new_buf; @@ -5354,12 +5298,6 @@ len += nbchar; buf[len] = 0; } - if (len > maxLength) { - xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED, - "Comment too big found", NULL); - xmlFree (buf); - return; - } ctxt->input->cur = in; if (*in == 0xA) { in++; @@ -5591,23 +5529,25 @@ ((cur != '?') || (NXT(1) != '>'))) { if (len + 5 >= size) { xmlChar *tmp; - size_t new_size = size * 2; - tmp = (xmlChar *) xmlRealloc(buf, new_size); + int newSize; + + newSize = xmlGrowCapacity(size, 1, 1, maxLength); + if (newSize < 0) { + xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, + "PI %s too big found", target); + xmlFree(buf); + return; + } + tmp = xmlRealloc(buf, newSize); if (tmp == NULL) { xmlErrMemory(ctxt); xmlFree(buf); return; } buf = tmp; - size = new_size; + size = newSize; } COPY_BUF(buf, len, cur); - if (len > maxLength) { - xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED, - "PI %s too big found", target); - xmlFree(buf); - return; - } NEXTL(l); cur = xmlCurrentCharRecover(ctxt, &l); } @@ -5623,7 +5563,7 @@ (xmlStrEqual(target, XML_CATALOG_PI))) { xmlCatalogAllow allow = xmlCatalogGetDefaults(); - if (((ctxt->options & XML_PARSE_NO_CATALOG_PI) == 0) && + if ((ctxt->options & XML_PARSE_CATALOG_PI) && ((allow == XML_CATA_ALLOW_DOCUMENT) || (allow == XML_CATA_ALLOW_ALL))) xmlParseCatalogPI(ctxt, buf); @@ -7065,15 +7005,23 @@ if (inputIdsSize <= depth) { int *tmp; + int newSize; - inputIdsSize = (inputIdsSize == 0 ? 4 : inputIdsSize * 2); - tmp = (int *) xmlRealloc(inputIds, - inputIdsSize * sizeof(int)); + newSize = xmlGrowCapacity(inputIdsSize, sizeof(tmp[0]), + 4, 1000); + if (newSize < 0) { + xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, + "Maximum conditional section nesting" + " depth exceeded\n"); + goto error; + } + tmp = xmlRealloc(inputIds, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlErrMemory(ctxt); goto error; } inputIds = tmp; + inputIdsSize = newSize; } inputIds[depth] = id; depth++; @@ -7205,7 +7153,11 @@ xmlParseComment(ctxt); break; default: - /* there is an error but it will be detected later */ + xmlFatalErr(ctxt, + ctxt->inSubset == 2 ? + XML_ERR_EXT_SUBSET_NOT_FINISHED : + XML_ERR_INT_SUBSET_NOT_FINISHED, + NULL); SKIP(2); break; } @@ -7349,9 +7301,7 @@ while (ctxt->inputNr > oldInputNr) xmlPopPE(ctxt); - if (RAW != 0) { - xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL); - } + xmlParserCheckEOF(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED); } /** @@ -7536,7 +7486,7 @@ int len = xmlStrlen(cur->content); if ((cur->type == XML_TEXT_NODE) || - (ctxt->sax->cdataBlock == NULL)) { + (ctxt->options & XML_PARSE_NOCDATA)) { if (ctxt->sax->characters != NULL) ctxt->sax->characters(ctxt, cur->content, len); } else { @@ -7559,7 +7509,7 @@ int len = xmlStrlen(cur->content); if ((cur->type == XML_TEXT_NODE) || - (ctxt->sax->cdataBlock == NULL)) { + (ctxt->options & XML_PARSE_NOCDATA)) { if (ctxt->sax->characters != NULL) ctxt->sax->characters(ctxt, cur->content, len); } else { @@ -8215,7 +8165,10 @@ */ SKIP(9); - SKIP_BLANKS; + if (SKIP_BLANKS == 0) { + xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, + "Space required after 'DOCTYPE'\n"); + } /* * Parse the DOCTYPE name. @@ -8249,20 +8202,9 @@ (!ctxt->disableSAX)) ctxt->sax->internalSubset(ctxt->userData, name, ExternalID, URI); - /* - * Is there any internal subset declarations ? - * they are handled separately in xmlParseInternalSubset() - */ - if (RAW == '[') - return; - - /* - * We should be at the end of the DOCTYPE declaration. - */ - if (RAW != '>') { + if ((RAW != '[') && (RAW != '>')) { xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL); } - NEXT; } /** @@ -8499,52 +8441,50 @@ for (i = 0; i < nbatts;i += 2) { if (xmlStrEqual(atts[i], attname)) { xmlErrAttributeDup(ctxt, NULL, attname); - xmlFree(attvalue); goto failed; } } /* * Add the pair to atts */ - if (atts == NULL) { - maxatts = 22; /* allow for 10 attrs by default */ - atts = (const xmlChar **) - xmlMalloc(maxatts * sizeof(xmlChar *)); - if (atts == NULL) { + if (nbatts + 4 > maxatts) { + const xmlChar **n; + int newSize; + + newSize = xmlGrowCapacity(maxatts, sizeof(n[0]) * 2, + 11, XML_MAX_ATTRS); + if (newSize < 0) { xmlErrMemory(ctxt); - if (attvalue != NULL) - xmlFree(attvalue); goto failed; } - ctxt->atts = atts; - ctxt->maxatts = maxatts; - } else if (nbatts + 4 > maxatts) { - const xmlChar **n; - - maxatts *= 2; - n = (const xmlChar **) xmlRealloc((void *) atts, - maxatts * sizeof(const xmlChar *)); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + if (newSize < 2) + newSize = 2; +#endif + n = xmlRealloc(atts, newSize * sizeof(n[0]) * 2); if (n == NULL) { xmlErrMemory(ctxt); - if (attvalue != NULL) - xmlFree(attvalue); goto failed; } atts = n; + maxatts = newSize * 2; ctxt->atts = atts; ctxt->maxatts = maxatts; } + atts[nbatts++] = attname; atts[nbatts++] = attvalue; atts[nbatts] = NULL; atts[nbatts + 1] = NULL; - } else { - if (attvalue != NULL) - xmlFree(attvalue); + + attvalue = NULL; } failed: + if (attvalue != NULL) + xmlFree(attvalue); + GROW if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>')))) break; @@ -8849,9 +8789,8 @@ if (ctxt->attsSpecial != NULL) { int type; - type = (int) (ptrdiff_t) xmlHashQLookup2(ctxt->attsSpecial, - pref, elem, - prefix, name); + type = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem, + prefix, name)); if (type != 0) normalize = 1; } @@ -8954,7 +8893,7 @@ const xmlChar **atts = &ctxt->atts[bucket->index]; if (name == atts[0]) { - int nsIndex = (int) (ptrdiff_t) atts[2]; + int nsIndex = XML_PTR_TO_INT(atts[2]); if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) : (nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) : @@ -9250,11 +9189,13 @@ * of xmlChar pointers. */ if ((atts == NULL) || (nbatts + 5 > maxatts)) { - if (xmlCtxtGrowAttrs(ctxt) < 0) { - goto next_attr; - } + int res = xmlCtxtGrowAttrs(ctxt); + maxatts = ctxt->maxatts; atts = ctxt->atts; + + if (res < 0) + goto next_attr; } ctxt->attallocs[nratts++] = (hattname.hashValue & 0x7FFFFFFF) | ((unsigned) alloc << 31); @@ -9325,6 +9266,11 @@ NULL, 1) > 0) nbNs++; } else { + if (nratts + nbTotalDef >= XML_MAX_ATTRS) { + xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, + "Maximum number of attributes exceeded"); + break; + } nbTotalDef += 1; } } @@ -9358,7 +9304,7 @@ } } - atts[i+2] = (const xmlChar *) (ptrdiff_t) nsIndex; + atts[i+2] = XML_INT_TO_PTR(nsIndex); } /* @@ -9396,7 +9342,7 @@ attname = atts[i]; aprefix = atts[i+1]; - nsIndex = (ptrdiff_t) atts[i+2]; + nsIndex = XML_PTR_TO_INT(atts[i+2]); /* Hash values always have bit 31 set, see dict.c */ nameHashValue = ctxt->attallocs[j] | 0x80000000; @@ -9512,17 +9458,20 @@ xmlParserEntityCheck(ctxt, attr->expandedSize); if ((atts == NULL) || (nbatts + 5 > maxatts)) { - if (xmlCtxtGrowAttrs(ctxt) < 0) { + res = xmlCtxtGrowAttrs(ctxt); + + maxatts = ctxt->maxatts; + atts = ctxt->atts; + + if (res < 0) { localname = NULL; goto done; } - maxatts = ctxt->maxatts; - atts = ctxt->atts; } atts[nbatts++] = attname; atts[nbatts++] = aprefix; - atts[nbatts++] = (const xmlChar *) (ptrdiff_t) nsIndex; + atts[nbatts++] = XML_INT_TO_PTR(nsIndex); atts[nbatts++] = attr->value.name; atts[nbatts++] = attr->valueEnd; if ((ctxt->standalone == 1) && (attr->external != 0)) { @@ -9578,7 +9527,7 @@ */ for (i = 0, j = 0; i < nbatts; i += 5, j++) { /* namespace URI */ - nsIndex = (ptrdiff_t) atts[i+2]; + nsIndex = XML_PTR_TO_INT(atts[i+2]); if (nsIndex == INT_MAX) atts[i+2] = NULL; else if (nsIndex == INT_MAX - 1) @@ -9587,8 +9536,8 @@ atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1]; if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) { - atts[i+3] = BASE_PTR + (ptrdiff_t) atts[i+3]; /* value */ - atts[i+4] = BASE_PTR + (ptrdiff_t) atts[i+4]; /* valuend */ + atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]); /* value */ + atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]); /* valuend */ } } @@ -9754,21 +9703,23 @@ ((r != ']') || (s != ']') || (cur != '>'))) { if (len + 5 >= size) { xmlChar *tmp; + int newSize; - tmp = (xmlChar *) xmlRealloc(buf, size * 2); + newSize = xmlGrowCapacity(size, 1, 1, maxLength); + if (newSize < 0) { + xmlFatalErrMsg(ctxt, XML_ERR_CDATA_NOT_FINISHED, + "CData section too big found\n"); + goto out; + } + tmp = xmlRealloc(buf, newSize); if (tmp == NULL) { xmlErrMemory(ctxt); goto out; } buf = tmp; - size *= 2; + size = newSize; } COPY_BUF(buf, len, r); - if (len > maxLength) { - xmlFatalErrMsg(ctxt, XML_ERR_CDATA_NOT_FINISHED, - "CData section too big found\n"); - goto out; - } r = s; rl = sl; s = cur; @@ -9788,10 +9739,13 @@ * OK the buffer is to be consumed as cdata. */ if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) { - if (ctxt->sax->cdataBlock != NULL) - ctxt->sax->cdataBlock(ctxt->userData, buf, len); - else if (ctxt->sax->characters != NULL) - ctxt->sax->characters(ctxt->userData, buf, len); + if (ctxt->options & XML_PARSE_NOCDATA) { + if (ctxt->sax->characters != NULL) + ctxt->sax->characters(ctxt->userData, buf, len); + } else { + if (ctxt->sax->cdataBlock != NULL) + ctxt->sax->cdataBlock(ctxt->userData, buf, len); + } } out: @@ -9920,8 +9874,7 @@ xmlParseContentInternal(ctxt); - if (ctxt->input->cur < ctxt->input->end) - xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL); + xmlParserCheckEOF(ctxt, XML_ERR_NOT_WELL_BALANCED); } /** @@ -10148,6 +10101,9 @@ xmlChar *buf = NULL; int len = 0; int size = 10; + int maxLength = (ctxt->options & XML_PARSE_HUGE) ? + XML_MAX_TEXT_LENGTH : + XML_MAX_NAME_LENGTH; xmlChar cur; buf = xmlMalloc(size); @@ -10173,15 +10129,22 @@ while ((cur >= '0') && (cur <= '9')) { if (len + 1 >= size) { xmlChar *tmp; + int newSize; - size *= 2; - tmp = (xmlChar *) xmlRealloc(buf, size); + newSize = xmlGrowCapacity(size, 1, 1, maxLength); + if (newSize) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "VersionNum"); + xmlFree(buf); + return(NULL); + } + tmp = xmlRealloc(buf, newSize); if (tmp == NULL) { - xmlFree(buf); xmlErrMemory(ctxt); + xmlFree(buf); return(NULL); } buf = tmp; + size = newSize; } buf[len++] = cur; NEXT; @@ -10281,22 +10244,24 @@ (cur == '-')) { if (len + 1 >= size) { xmlChar *tmp; + int newSize; - size *= 2; - tmp = (xmlChar *) xmlRealloc(buf, size); + newSize = xmlGrowCapacity(size, 1, 1, maxLength); + if (newSize < 0) { + xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName"); + xmlFree(buf); + return(NULL); + } + tmp = xmlRealloc(buf, newSize); if (tmp == NULL) { xmlErrMemory(ctxt); xmlFree(buf); return(NULL); } buf = tmp; + size = newSize; } buf[len++] = cur; - if (len > maxLength) { - xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName"); - xmlFree(buf); - return(NULL); - } NEXT; cur = CUR; } @@ -10573,7 +10538,7 @@ /** * xmlCtxtGetVersion: - * ctxt: parser context + * @ctxt: parser context * * Available since 2.14.0. * @@ -10589,7 +10554,7 @@ /** * xmlCtxtGetStandalone: - * ctxt: parser context + * @ctxt: parser context * * Available since 2.14.0. * @@ -10735,7 +10700,9 @@ xmlParseDocTypeDecl(ctxt); if (RAW == '[') { xmlParseInternalSubset(ctxt); - } + } else if (RAW == '>') { + NEXT; + } /* * Create and update the external subset. @@ -10768,16 +10735,7 @@ */ xmlParseMisc(ctxt); - if (ctxt->input->cur < ctxt->input->end) { - if (ctxt->wellFormed) - xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL); - } else if ((ctxt->input->buf != NULL) && - (ctxt->input->buf->encoder != NULL) && - (ctxt->input->buf->error == 0) && - (!xmlBufIsEmpty(ctxt->input->buf->raw))) { - xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, - "Truncated multi-byte sequence at EOF\n"); - } + xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END); } ctxt->instate = XML_PARSER_EOF; @@ -11461,6 +11419,8 @@ if (RAW == '[') { ctxt->instate = XML_PARSER_DTD; } else { + if (RAW == '>') + NEXT; /* * Create and update the external subset. */ @@ -11532,10 +11492,13 @@ * The last chunk, which will often be empty, must be marked with * the @terminate flag. With the default SAX callbacks, the resulting * document will be available in ctxt->myDoc. This pointer will not - * be freed by the library. + * be freed when calling xmlFreeParserCtxt and must be freed by the + * caller. If the document isn't well-formed, it will still be returned + * in ctxt->myDoc. * - * If the document isn't well-formed, ctxt->myDoc is set to NULL. - * The push parser doesn't support recovery mode. + * As an exception, xmlCtxtResetPush will free the document in + * ctxt->myDoc. So ctxt->myDoc should be set to NULL after extracting + * the document. * * Returns an xmlParserErrors code (0 on success). */ @@ -11622,11 +11585,8 @@ xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY, "Start tag expected, '<' not found\n"); } - } else if ((ctxt->input->buf->encoder != NULL) && - (ctxt->input->buf->error == 0) && - (!xmlBufIsEmpty(ctxt->input->buf->raw))) { - xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, - "Truncated multi-byte sequence at EOF\n"); + } else { + xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END); } if (ctxt->instate != XML_PARSER_EOF) { ctxt->instate = XML_PARSER_EOF; @@ -11658,6 +11618,9 @@ * * Passing an initial chunk is useless and deprecated. * + * The push parser doesn't support recovery mode or the + * XML_PARSE_NOBLANKS option. + * * @filename is used as base URI to fetch external entities and for * error reports. * @@ -12754,6 +12717,8 @@ if (ctxt == NULL) return(NULL); + options |= XML_PARSE_UNZIP; + xmlCtxtUseOptions(ctxt, options); ctxt->linenumbers = 1; @@ -13494,9 +13459,9 @@ XML_PARSE_IGNORE_ENC | XML_PARSE_BIG_LINES | XML_PARSE_NO_XXE | - XML_PARSE_NO_UNZIP | + XML_PARSE_UNZIP | XML_PARSE_NO_SYS_CATALOG | - XML_PARSE_NO_CATALOG_PI; + XML_PARSE_CATALOG_PI; ctxt->options = (ctxt->options & keepMask) | (options & allMask); @@ -13523,15 +13488,6 @@ ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1; ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1; - /* - * Changing SAX callbacks is a bad idea. This should be fixed. - */ - if (options & XML_PARSE_NOBLANKS) { - ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace; - } - if (options & XML_PARSE_NOCDATA) { - ctxt->sax->cdataBlock = NULL; - } if (options & XML_PARSE_HUGE) { if (ctxt->dict != NULL) xmlDictSetLimit(ctxt->dict, 0); @@ -13559,6 +13515,8 @@ * How this mode behaves exactly is unspecified and may change * without further notice. Use of this feature is DISCOURAGED. * + * Not supported by the push parser. + * * XML_PARSE_NOENT * * Despite the confusing name, this option enables substitution @@ -13611,13 +13569,13 @@ * * XML_PARSE_NOBLANKS * - * Remove some text nodes containing only whitespace from the - * result document. Which nodes are removed depends on DTD - * element declarations or a conservative heuristic. The - * reindenting feature of the serialization code relies on this - * option to be set when parsing. Use of this option is + * Remove some whitespace from the result document. Where to + * remove whitespace depends on DTD element declarations or a + * broken heuristic with unfixable bugs. Use of this option is * DISCOURAGED. * + * Not supported by the push parser. + * * XML_PARSE_SAX1 * * Always invoke the deprecated SAX1 startElement and endElement @@ -13691,9 +13649,9 @@ * * Enable reporting of line numbers larger than 65535. * - * XML_PARSE_NO_UNZIP + * XML_PARSE_UNZIP * - * Disables input decompression. Setting this option is recommended + * Enable input decompression. Setting this option is discouraged * to avoid zip bombs. * * Available since 2.14.0. @@ -13704,9 +13662,9 @@ * * Available since 2.14.0. * - * XML_PARSE_NO_CATALOG_PI + * XML_PARSE_CATALOG_PI * - * Ignore XML catalog processing instructions. + * Enable XML catalog processing instructions. * * Available since 2.14.0. * @@ -13849,17 +13807,7 @@ xmlParseDocument(ctxt); - if ((ctxt->wellFormed) || - ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) { - ret = ctxt->myDoc; - } else { - if (ctxt->errNo == XML_ERR_OK) - xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR, "unknown error\n"); - - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - } - ctxt->myDoc = NULL; + ret = xmlCtxtGetDocument(ctxt); /* assert(ctxt->inputNr == 1); */ while (ctxt->inputNr > 0) @@ -13915,6 +13863,11 @@ * Convenience function to parse an XML file from the filesystem, * the network or a global user-define resource loader. * + * This function always enables the XML_PARSE_UNZIP option for + * backward compatibility. If a "-" filename is passed, it will + * read from stdin. Both of these features are potentially + * insecure and might be removed from later versions. + * * See xmlCtxtReadFile for details. * * Returns the resulting document tree @@ -13930,6 +13883,8 @@ if (ctxt == NULL) return(NULL); + options |= XML_PARSE_UNZIP; + xmlCtxtUseOptions(ctxt, options); /* @@ -14116,6 +14071,10 @@ * Parse an XML file from the filesystem, the network or a user-defined * resource loader. * + * This function always enables the XML_PARSE_UNZIP option for + * backward compatibility. This feature is potentially insecure + * and might be removed from later versions. + * * Returns the resulting document tree */ xmlDocPtr @@ -14127,6 +14086,8 @@ if (ctxt == NULL) return(NULL); + options |= XML_PARSE_UNZIP; + xmlCtxtReset(ctxt); xmlCtxtUseOptions(ctxt, options);
diff --git a/third_party/libxml/src/parserInternals.c b/third_party/libxml/src/parserInternals.c index c04a0f5..af2dfd9 100644 --- a/third_party/libxml/src/parserInternals.c +++ b/third_party/libxml/src/parserInternals.c
@@ -44,8 +44,13 @@ #include "private/enc.h" #include "private/error.h" #include "private/io.h" +#include "private/memory.h" #include "private/parser.h" +#ifndef SIZE_MAX + #define SIZE_MAX ((size_t) -1) +#endif + #define XML_MAX_ERRORS 100 /* @@ -256,30 +261,12 @@ msg, str1, str2); } -int -xmlIsCatastrophicError(int level, int code) { - int fatal = 0; - - if (level != XML_ERR_FATAL) - return(0); - - switch (code) { - case XML_ERR_NO_MEMORY: - /* case XML_ERR_RESOURCE_LIMIT: */ - case XML_ERR_SYSTEM: - case XML_ERR_ARGUMENT: - case XML_ERR_INTERNAL_ERROR: - fatal = 1; - break; - default: - if ((code >= 1500) && (code <= 1599)) - fatal = 1; - break; - } - - return(fatal); -} - +/** + * xmlCtxtIsCatastrophicError: + * @ctxt: parser context + * + * Returns true if the last error is catastrophic. + */ int xmlCtxtIsCatastrophicError(xmlParserCtxtPtr ctxt) { if (ctxt == NULL) @@ -456,9 +443,9 @@ * * Returns a bitmask of XML_STATUS_* flags ORed together. */ -int +xmlParserStatus xmlCtxtGetStatus(xmlParserCtxt *ctxt) { - int bits = 0; + xmlParserStatus bits = 0; if (xmlCtxtIsCatastrophicError(ctxt)) { bits |= XML_STATUS_CATASTROPHIC_ERROR | @@ -610,6 +597,49 @@ } /** + * xmlParserCheckEOF: + * @ctxt: parser ctxt + * @code: error code + * + * Raises an error with @code if the input wasn't consumed + * completely. + */ +void +xmlParserCheckEOF(xmlParserCtxtPtr ctxt, xmlParserErrors code) { + xmlParserInputPtr in = ctxt->input; + xmlParserInputBufferPtr buf; + + if (ctxt->errNo != XML_ERR_OK) + return; + + if (in->cur < in->end) { + xmlFatalErr(ctxt, code, NULL); + return; + } + + buf = in->buf; + if ((buf != NULL) && (buf->encoder != NULL)) { + size_t curBase = in->cur - in->base; + size_t sizeOut = 64; + xmlCharEncError ret; + + /* + * Check for truncated multi-byte sequence + */ + ret = xmlCharEncInput(buf, &sizeOut, /* flush */ 1); + xmlBufUpdateInput(buf->buffer, in, curBase); + if (ret != XML_ENC_ERR_SUCCESS) { + xmlCtxtErrIO(ctxt, buf->error, NULL); + return; + } + + /* Shouldn't happen */ + if (in->cur < in->end) + xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "expected EOF"); + } +} + +/** * xmlParserInputGrow: * @in: an XML parser input * @len: an indicative size for the lookahead @@ -1099,12 +1129,14 @@ ctxt->convCtxt = vctxt; } -static int +static xmlParserErrors xmlDetectEBCDIC(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr *hout) { xmlChar out[200]; xmlParserInputPtr input = ctxt->input; xmlCharEncodingHandlerPtr handler; - int inlen, outlen, res, i; + int inlen, outlen, i; + xmlParserErrors code; + xmlCharEncError res; *hout = NULL; @@ -1112,13 +1144,14 @@ * To detect the EBCDIC code page, we convert the first 200 bytes * to IBM037 (EBCDIC-US) and try to find the encoding declaration. */ - res = xmlCreateCharEncodingHandler("IBM037", /* output */ 0, + code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt, &handler); - if (res != 0) - return(res); + if (code != XML_ERR_OK) + return(code); outlen = sizeof(out) - 1; inlen = input->end - input->cur; - res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen); + res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen, + /* flush */ 0); /* * Return the EBCDIC handler if decoding failed. The error will * be reported later. @@ -1156,13 +1189,13 @@ break; out[i] = 0; xmlCharEncCloseFunc(handler); - res = xmlCreateCharEncodingHandler((char *) out + start, - /* output */ 0, ctxt->convImpl, ctxt->convCtxt, + code = xmlCreateCharEncodingHandler((char *) out + start, + XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt, &handler); - if (res != 0) - return(res); + if (code != XML_ERR_OK) + return(code); *hout = handler; - return(0); + return(XML_ERR_OK); } } @@ -1171,12 +1204,12 @@ * Encoding handlers are stateful, so we have to recreate them. */ xmlCharEncCloseFunc(handler); - res = xmlCreateCharEncodingHandler("IBM037", /* output */ 0, + code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt, &handler); - if (res != 0) - return(res); + if (code != XML_ERR_OK) + return(code); *hout = handler; - return(0); + return(XML_ERR_OK); } /** @@ -1197,14 +1230,14 @@ { xmlCharEncodingHandlerPtr handler = NULL; int ret; - int res; + xmlParserErrors code; if ((ctxt == NULL) || (ctxt->input == NULL)) return(-1); - res = xmlLookupCharEncodingHandler(enc, &handler); - if (res != 0) { - xmlFatalErr(ctxt, res, NULL); + code = xmlLookupCharEncodingHandler(enc, &handler); + if (code != 0) { + xmlFatalErr(ctxt, code, NULL); return(-1); } @@ -1229,12 +1262,12 @@ xmlSwitchInputEncodingName(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, const char *encoding) { xmlCharEncodingHandlerPtr handler; - int res; + xmlParserErrors res; if (encoding == NULL) return(-1); - res = xmlCreateCharEncodingHandler(encoding, /* output */ 0, + res = xmlCreateCharEncodingHandler(encoding, XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt, &handler); if (res == XML_ERR_UNSUPPORTED_ENCODING) { xmlWarningMsg(ctxt, XML_ERR_UNSUPPORTED_ENCODING, @@ -1288,12 +1321,12 @@ * * Returns an xmlParserErrors code. */ -int +xmlParserErrors xmlInputSetEncodingHandler(xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler) { xmlParserInputBufferPtr in; xmlBufPtr buf; - int code = XML_ERR_OK; + xmlParserErrors code = XML_ERR_OK; if ((input == NULL) || (input->buf == NULL)) { xmlCharEncCloseFunc(handler); @@ -1346,7 +1379,7 @@ if (input->end > input->base) { size_t processed; size_t nbchars; - int res; + xmlCharEncError res; /* * Shrink the current input buffer. @@ -1364,11 +1397,11 @@ * memory buffer which we don't want to convert completely. */ if (input->flags & XML_INPUT_PROGRESSIVE) - nbchars = ((size_t) - 1); + nbchars = SIZE_MAX; else nbchars = 4000 /* MINLEN */; - res = xmlCharEncInput(in, &nbchars); - if (res < 0) + res = xmlCharEncInput(in, &nbchars, /* flush */ 0); + if (res != XML_ENC_ERR_SUCCESS) code = in->error; } @@ -1392,7 +1425,7 @@ int xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, xmlCharEncodingHandlerPtr handler) { - int code = xmlInputSetEncodingHandler(input, handler); + xmlParserErrors code = xmlInputSetEncodingHandler(input, handler); if (code != XML_ERR_OK) { xmlCtxtErrIO(ctxt, code, NULL); @@ -1417,7 +1450,7 @@ int xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler) { - int code; + xmlParserErrors code; if (ctxt == NULL) return(-1); @@ -1467,12 +1500,23 @@ enc = XML_CHAR_ENCODING_NONE; bomSize = 0; + /* + * BOM sniffing and detection of initial bytes of an XML + * declaration. + * + * The HTML5 spec doesn't cover UTF-32 (UCS-4) or EBCDIC. + */ switch (in[0]) { case 0x00: - if ((in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) { + if ((!ctxt->html) && + (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) { enc = XML_CHAR_ENCODING_UCS4BE; autoFlag = XML_INPUT_AUTO_OTHER; } else if ((in[1] == 0x3C) && (in[2] == 0x00) && (in[3] == 0x3F)) { + /* + * TODO: The HTML5 spec requires to check that the + * next codepoint is an 'x'. + */ enc = XML_CHAR_ENCODING_UTF16BE; autoFlag = XML_INPUT_AUTO_UTF16BE; } @@ -1480,10 +1524,15 @@ case 0x3C: if (in[1] == 0x00) { - if ((in[2] == 0x00) && (in[3] == 0x00)) { + if ((!ctxt->html) && + (in[2] == 0x00) && (in[3] == 0x00)) { enc = XML_CHAR_ENCODING_UCS4LE; autoFlag = XML_INPUT_AUTO_OTHER; } else if ((in[2] == 0x3F) && (in[3] == 0x00)) { + /* + * TODO: The HTML5 spec requires to check that the + * next codepoint is an 'x'. + */ enc = XML_CHAR_ENCODING_UTF16LE; autoFlag = XML_INPUT_AUTO_UTF16LE; } @@ -1491,7 +1540,8 @@ break; case 0x4C: - if ((in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) { + if ((!ctxt->html) && + (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) { enc = XML_CHAR_ENCODING_EBCDIC; autoFlag = XML_INPUT_AUTO_OTHER; } @@ -1531,7 +1581,7 @@ if (enc == XML_CHAR_ENCODING_EBCDIC) { xmlCharEncodingHandlerPtr handler; - int res; + xmlParserErrors res; res = xmlDetectEBCDIC(ctxt, &handler); if (res != XML_ERR_OK) { @@ -1562,7 +1612,7 @@ if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) && ((ctxt->options & XML_PARSE_IGNORE_ENC) == 0)) { xmlCharEncodingHandlerPtr handler; - int res; + xmlParserErrors res; /* * xmlSwitchEncodingName treats unsupported encodings as @@ -1570,7 +1620,7 @@ * declaration. */ res = xmlCreateCharEncodingHandler((const char *) encoding, - /* output */ 0, ctxt->convImpl, ctxt->convCtxt, &handler); + XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt, &handler); if (res != XML_ERR_OK) { xmlFatalErr(ctxt, res, (const char *) encoding); xmlFree(encoding); @@ -1644,7 +1694,7 @@ /** * xmlCtxtGetDeclaredEncoding: - * ctxt: parser context + * @ctxt: parser context * * Available since 2.14.0. * @@ -1750,7 +1800,7 @@ xmlParserInputPtr xmlCtxtNewInputFromUrl(xmlParserCtxtPtr ctxt, const char *url, const char *publicId, const char *encoding, - int flags ATTRIBUTE_UNUSED) { + xmlParserInputFlags flags ATTRIBUTE_UNUSED) { xmlParserInputPtr input; if ((ctxt == NULL) || (url == NULL)) @@ -1828,7 +1878,7 @@ */ xmlParserInputPtr xmlNewInputFromMemory(const char *url, const void *mem, size_t size, - int flags) { + xmlParserInputFlags flags) { xmlParserInputBufferPtr buf; if (mem == NULL) @@ -1855,7 +1905,7 @@ xmlParserInputPtr xmlCtxtNewInputFromMemory(xmlParserCtxtPtr ctxt, const char *url, const void *mem, size_t size, - const char *encoding, int flags) { + const char *encoding, xmlParserInputFlags flags) { xmlParserInputPtr input; if ((ctxt == NULL) || (mem == NULL)) @@ -1893,7 +1943,8 @@ * Returns a new parser input or NULL if a memory allocation failed. */ xmlParserInputPtr -xmlNewInputFromString(const char *url, const char *str, int flags) { +xmlNewInputFromString(const char *url, const char *str, + xmlParserInputFlags flags) { xmlParserInputBufferPtr buf; if (str == NULL) @@ -1918,7 +1969,8 @@ */ xmlParserInputPtr xmlCtxtNewInputFromString(xmlParserCtxtPtr ctxt, const char *url, - const char *str, const char *encoding, int flags) { + const char *str, const char *encoding, + xmlParserInputFlags flags) { xmlParserInputPtr input; if ((ctxt == NULL) || (str == NULL)) @@ -1940,7 +1992,7 @@ * xmlNewInputFromFd: * @url: base URL (optional) * @fd: file descriptor - * @flags: unused, pass 0 + * @flags: input flags * * Creates a new parser input to read from a zero-terminated string. * @@ -1949,21 +2001,30 @@ * * @fd is closed after parsing has finished. * + * Supported @flags are XML_INPUT_UNZIP to decompress data + * automatically. This feature is deprecated and will be removed + * in a future release. + * * Available since 2.14.0. * * Returns a new parser input or NULL if a memory allocation failed. */ xmlParserInputPtr -xmlNewInputFromFd(const char *url, int fd, int flags ATTRIBUTE_UNUSED) { +xmlNewInputFromFd(const char *url, int fd, xmlParserInputFlags flags) { xmlParserInputBufferPtr buf; if (fd < 0) return(NULL); - buf = xmlParserInputBufferCreateFd(fd, XML_CHAR_ENCODING_NONE); + buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE); if (buf == NULL) return(NULL); + if (xmlInputFromFd(buf, fd, flags) != XML_ERR_OK) { + xmlFreeParserInputBuffer(buf); + return(NULL); + } + return(xmlNewInputInternal(buf, url)); } @@ -1979,12 +2040,16 @@ */ xmlParserInputPtr xmlCtxtNewInputFromFd(xmlParserCtxtPtr ctxt, const char *url, - int fd, const char *encoding, int flags) { + int fd, const char *encoding, + xmlParserInputFlags flags) { xmlParserInputPtr input; if ((ctxt == NULL) || (fd < 0)) return(NULL); + if (ctxt->options & XML_PARSE_UNZIP) + flags |= XML_INPUT_UNZIP; + input = xmlNewInputFromFd(url, fd, flags); if (input == NULL) { xmlCtxtErrMemory(ctxt); @@ -2026,7 +2091,7 @@ xmlParserInputPtr xmlNewInputFromIO(const char *url, xmlInputReadCallback ioRead, xmlInputCloseCallback ioClose, void *ioCtxt, - int flags ATTRIBUTE_UNUSED) { + xmlParserInputFlags flags ATTRIBUTE_UNUSED) { xmlParserInputBufferPtr buf; if (ioRead == NULL) @@ -2062,7 +2127,8 @@ xmlCtxtNewInputFromIO(xmlParserCtxtPtr ctxt, const char *url, xmlInputReadCallback ioRead, xmlInputCloseCallback ioClose, - void *ioCtxt, const char *encoding, int flags) { + void *ioCtxt, const char *encoding, + xmlParserInputFlags flags) { xmlParserInputPtr input; if ((ctxt == NULL) || (ioRead == NULL)) @@ -2303,7 +2369,7 @@ #endif #ifdef LIBXML_HTTP_ENABLED -static int +static xmlParserErrors xmlCheckHTTPInputInternal(xmlParserInputPtr input) { const char *encoding; const char *redir; @@ -2327,7 +2393,7 @@ encoding = xmlNanoHTTPEncoding(input->buf->context); if (encoding != NULL) { xmlCharEncodingHandlerPtr handler; - int res; + xmlParserErrors res; res = xmlOpenCharEncodingHandler(encoding, /* output */ 0, &handler); @@ -2414,11 +2480,12 @@ * * Returns an xmlParserErrors code. */ -int -xmlNewInputFromUrl(const char *filename, int flags, xmlParserInputPtr *out) { +xmlParserErrors +xmlNewInputFromUrl(const char *filename, xmlParserInputFlags flags, + xmlParserInputPtr *out) { xmlParserInputBufferPtr buf; xmlParserInputPtr input; - int code = XML_ERR_OK; + xmlParserErrors code = XML_ERR_OK; if (out == NULL) return(XML_ERR_ARGUMENT); @@ -2468,13 +2535,13 @@ xmlParserInputPtr xmlNewInputFromFile(xmlParserCtxtPtr ctxt, const char *filename) { xmlParserInputPtr input; - int flags = 0; - int code; + xmlParserInputFlags flags = 0; + xmlParserErrors code; if ((ctxt == NULL) || (filename == NULL)) return(NULL); - if ((ctxt->options & XML_PARSE_NO_UNZIP) == 0) + if (ctxt->options & XML_PARSE_UNZIP) flags |= XML_INPUT_UNZIP; if ((ctxt->options & XML_PARSE_NONET) == 0) flags |= XML_INPUT_NETWORK; @@ -2637,7 +2704,7 @@ if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) { char *resource = NULL; - int flags = 0; + xmlParserInputFlags flags = 0; int code; #ifdef LIBXML_CATALOG_ENABLED @@ -2646,7 +2713,7 @@ url = resource; #endif - if ((ctxt->options & XML_PARSE_NO_UNZIP) == 0) + if (ctxt->options & XML_PARSE_UNZIP) flags |= XML_INPUT_UNZIP; if ((ctxt->options & XML_PARSE_NONET) == 0) flags |= XML_INPUT_NETWORK; @@ -3044,7 +3111,7 @@ /** * xmlCtxtGetPrivate: - * ctxt: parser context + * @ctxt: parser context * * Available since 2.14.0. * @@ -3060,8 +3127,8 @@ /** * xmlCtxtSetPrivate: - * ctxt: parser context - * priv: private application data + * @ctxt: parser context + * @priv: private application data * * Available since 2.14.0. * @@ -3077,7 +3144,7 @@ /** * xmlCtxtGetCatalogs: - * ctxt: parser context + * @ctxt: parser context * * Available since 2.14.0. * @@ -3093,8 +3160,8 @@ /** * xmlCtxtSetCatalogs: - * ctxt: parser context - * catalogs: catalogs pointer + * @ctxt: parser context + * @catalogs: catalogs pointer * * Available since 2.14.0. * @@ -3110,7 +3177,7 @@ /** * xmlCtxtGetDict: - * ctxt: parser context + * @ctxt: parser context * * Available since 2.14.0. * @@ -3126,8 +3193,8 @@ /** * xmlCtxtSetDict: - * ctxt: parser context - * dict: dictionary + * @ctxt: parser context + * @dict: dictionary * * Available since 2.14.0. * @@ -3146,6 +3213,132 @@ ctxt->dict = dict; } +/** + * xmlCtxtGetSaxHandler: + * @ctxt: parser context + * + * Available since 2.14.0. + * + * Returns the SAX handler struct. This is not a copy and must not + * be freed. Handlers can be updated. + */ +xmlSAXHandler * +xmlCtxtGetSaxHandler(xmlParserCtxtPtr ctxt) { + if (ctxt == NULL) + return(NULL); + + return(ctxt->sax); +} + +/** + * xmlCtxtSetSaxHandler: + * @ctxt: parser context + * @sax: SAX handler + * + * Available since 2.14.0. + * + * Set the SAX handler struct to a copy of @sax. + * + * Returns 0 on success or -1 if arguments are invalid or a memory + * allocation failed. + */ +int +xmlCtxtSetSaxHandler(xmlParserCtxtPtr ctxt, const xmlSAXHandler *sax) { + xmlSAXHandler *copy; + + if ((ctxt == NULL) || (sax == NULL)) + return(-1); + + copy = xmlMalloc(sizeof(*copy)); + if (copy == NULL) + return(-1); + + memcpy(copy, sax, sizeof(*copy)); + ctxt->sax = copy; + + return(0); +} + +/** + * xmlCtxtGetDocument: + * @ctxt: parser context + * + * Available since 2.14.0. + * + * Returns the parsed document or NULL if a fatal error occurred when + * parsing. The document must be freed by the caller. Resets the + * context's document to NULL. + */ +xmlDocPtr +xmlCtxtGetDocument(xmlParserCtxtPtr ctxt) { + xmlDocPtr doc; + + if (ctxt == NULL) + return(NULL); + + if ((ctxt->wellFormed) || + (((ctxt->recovery) || (ctxt->html)) && + (!xmlCtxtIsCatastrophicError(ctxt)))) { + doc = ctxt->myDoc; + } else { + if (ctxt->errNo == XML_ERR_OK) + xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "unknown error"); + doc = NULL; + xmlFreeDoc(ctxt->myDoc); + } + ctxt->myDoc = NULL; + + return(doc); +} + +/** + * xmlCtxtIsHtml: + * @ctxt: parser context + * + * Available since 2.14.0. + * + * Returns 1 if this is a HTML parser context, 0 otherwise. + */ +int +xmlCtxtIsHtml(xmlParserCtxtPtr ctxt) { + if (ctxt == NULL) + return(0); + + return(ctxt->html ? 1 : 0); +} + +/** + * xmlCtxtIsStopped: + * @ctxt: parser context + * + * Available since 2.14.0. + * + * Returns 1 if the parser is stopped, 0 otherwise. + */ +int +xmlCtxtIsStopped(xmlParserCtxtPtr ctxt) { + if (ctxt == NULL) + return(0); + + return(PARSER_STOPPED(ctxt)); +} + +/** + * xmlCtxtGetValidCtxt: + * @ctxt: parser context + * + * Available since 2.14.0. + * + * Returns the validation context. + */ +xmlValidCtxtPtr +xmlCtxtGetValidCtxt(xmlParserCtxtPtr ctxt) { + if (ctxt == NULL) + return(NULL); + + return(&ctxt->vctxt); +} + /************************************************************************ * * * Handling of node information * @@ -3307,29 +3500,23 @@ /* Otherwise, we need to add new node to buffer */ else { - if ((ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) || - (ctxt->node_seq.buffer == NULL)) { - xmlParserNodeInfo *tmp_buffer; - unsigned int byte_size; + if (ctxt->node_seq.length + 1 > ctxt->node_seq.maximum) { + xmlParserNodeInfo *tmp; + int newSize; - if (ctxt->node_seq.maximum == 0) - ctxt->node_seq.maximum = 2; - byte_size = (sizeof(*ctxt->node_seq.buffer) * - (2 * ctxt->node_seq.maximum)); - - if (ctxt->node_seq.buffer == NULL) - tmp_buffer = (xmlParserNodeInfo *) xmlMalloc(byte_size); - else - tmp_buffer = - (xmlParserNodeInfo *) xmlRealloc(ctxt->node_seq.buffer, - byte_size); - - if (tmp_buffer == NULL) { + newSize = xmlGrowCapacity(ctxt->node_seq.maximum, sizeof(tmp[0]), + 4, XML_MAX_ITEMS); + if (newSize < 0) { xmlCtxtErrMemory(ctxt); return; } - ctxt->node_seq.buffer = tmp_buffer; - ctxt->node_seq.maximum *= 2; + tmp = xmlRealloc(ctxt->node_seq.buffer, newSize * sizeof(tmp[0])); + if (tmp == NULL) { + xmlCtxtErrMemory(ctxt); + return; + } + ctxt->node_seq.buffer = tmp; + ctxt->node_seq.maximum = newSize; } /* If position is not at end, move elements out of the way */
diff --git a/third_party/libxml/src/pattern.c b/third_party/libxml/src/pattern.c index ea4d5a4..d1fd3d39 100644 --- a/third_party/libxml/src/pattern.c +++ b/third_party/libxml/src/pattern.c
@@ -34,6 +34,8 @@ #include <libxml/xmlerror.h> #include <libxml/parserInternals.h> +#include "private/memory.h" + #ifdef LIBXML_PATTERN_ENABLED #ifdef ERROR @@ -207,14 +209,8 @@ return(NULL); } memset(cur, 0, sizeof(xmlPattern)); - cur->maxStep = 10; - cur->steps = (xmlStepOpPtr) xmlMalloc(cur->maxStep * sizeof(xmlStepOp)); - if (cur->steps == NULL) { - xmlFree(cur); - ERROR(NULL, NULL, NULL, - "xmlNewPattern : malloc failed\n"); - return(NULL); - } + cur->steps = NULL; + cur->maxStep = 0; return(cur); } @@ -332,6 +328,24 @@ xmlFree(ctxt); } +static int +xmlPatternGrow(xmlPatternPtr comp) { + xmlStepOpPtr temp; + int newSize; + + newSize = xmlGrowCapacity(comp->maxStep, sizeof(temp[0]), + 10, XML_MAX_ITEMS); + if (newSize < 0) + return(-1); + temp = xmlRealloc(comp->steps, newSize * sizeof(temp[0])); + if (temp == NULL) + return(-1); + comp->steps = temp; + comp->maxStep = newSize; + + return(0); +} + /** * xmlPatternAdd: * @comp: the compiled match expression @@ -348,23 +362,16 @@ xmlPatOp op, xmlChar * value, xmlChar * value2) { if (comp->nbStep >= comp->maxStep) { - xmlStepOpPtr temp; - temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 * - sizeof(xmlStepOp)); - if (temp == NULL) { - ERROR(ctxt, NULL, NULL, - "xmlPatternAdd: realloc failed\n"); + if (xmlPatternGrow(comp) < 0) { ctxt->error = -1; - return (-1); - } - comp->steps = temp; - comp->maxStep *= 2; + return(-1); + } } comp->steps[comp->nbStep].op = op; comp->steps[comp->nbStep].value = value; comp->steps[comp->nbStep].value2 = value2; comp->nbStep++; - return (0); + return(0); } /** @@ -390,18 +397,15 @@ } comp->nbStep--; } + + /* + * Grow to add OP_END later + */ if (comp->nbStep >= comp->maxStep) { - xmlStepOpPtr temp; - temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 * - sizeof(xmlStepOp)); - if (temp == NULL) { - ERROR(ctxt, NULL, NULL, - "xmlReversePattern: realloc failed\n"); - return (-1); - } - comp->steps = temp; - comp->maxStep *= 2; + if (xmlPatternGrow(comp) < 0) + return(-1); } + i = 0; j = comp->nbStep - 1; while (j > i) { @@ -419,6 +423,7 @@ j--; i++; } + comp->steps[comp->nbStep].value = NULL; comp->steps[comp->nbStep].value2 = NULL; comp->steps[comp->nbStep++].op = XML_OP_END; @@ -434,14 +439,18 @@ static int xmlPatPushState(xmlStepStates *states, int step, xmlNodePtr node) { if (states->maxstates <= states->nbstates) { - size_t newSize = states->maxstates ? states->maxstates * 2 : 4; xmlStepState *tmp; + int newSize; + newSize = xmlGrowCapacity(states->maxstates, sizeof(tmp[0]), + 4, XML_MAX_ITEMS); + if (newSize < 0) + return(-1); tmp = xmlRealloc(states->states, newSize * sizeof(tmp[0])); if (tmp == NULL) return(-1); states->states = tmp; - states->maxstates *= 2; + states->maxstates = newSize; } states->states[states->nbstates].step = step; states->states[states->nbstates++].node = node; @@ -1025,10 +1034,10 @@ goto error; } } else { - PUSH(XML_OP_CHILD, token, URL); + PUSH(XML_OP_ELEM, token, URL); } } else - PUSH(XML_OP_CHILD, name, NULL); + PUSH(XML_OP_ELEM, name, NULL); return; } else if (xmlStrEqual(name, (const xmlChar *) "attribute")) { XML_PAT_FREE_STRING(ctxt, name) @@ -1343,15 +1352,24 @@ xmlStreamStepPtr cur; if (comp->nbStep >= comp->maxStep) { - cur = (xmlStreamStepPtr) xmlRealloc(comp->steps, - comp->maxStep * 2 * sizeof(xmlStreamStep)); + xmlStreamStepPtr tmp; + int newSize; + + newSize = xmlGrowCapacity(comp->maxStep, sizeof(tmp[0]), + 4, XML_MAX_ITEMS); + if (newSize < 0) { + ERROR(NULL, NULL, NULL, + "xmlNewStreamComp: growCapacity failed\n"); + return(-1); + } + cur = xmlRealloc(comp->steps, newSize * sizeof(tmp[0])); if (cur == NULL) { ERROR(NULL, NULL, NULL, "xmlNewStreamComp: malloc failed\n"); return(-1); } comp->steps = cur; - comp->maxStep *= 2; + comp->maxStep = newSize; } cur = &comp->steps[comp->nbStep++]; cur->flags = flags; @@ -1559,15 +1577,9 @@ return(NULL); } memset(cur, 0, sizeof(xmlStreamCtxt)); - cur->states = (int *) xmlMalloc(4 * 2 * sizeof(int)); - if (cur->states == NULL) { - xmlFree(cur); - ERROR(NULL, NULL, NULL, - "xmlNewStreamCtxt: malloc failed\n"); - return(NULL); - } + cur->states = NULL; cur->nbState = 0; - cur->maxState = 4; + cur->maxState = 0; cur->level = 0; cur->comp = stream; cur->blockLevel = -1; @@ -1613,17 +1625,24 @@ } } if (comp->nbState >= comp->maxState) { - int *cur; + int *tmp; + int newSize; - cur = (int *) xmlRealloc(comp->states, - comp->maxState * 4 * sizeof(int)); - if (cur == NULL) { + newSize = xmlGrowCapacity(comp->maxState, sizeof(tmp[0]) * 2, + 4, XML_MAX_ITEMS); + if (newSize < 0) { + ERROR(NULL, NULL, NULL, + "xmlNewStreamCtxt: growCapacity failed\n"); + return(-1); + } + tmp = xmlRealloc(comp->states, newSize * sizeof(tmp[0]) * 2); + if (tmp == NULL) { ERROR(NULL, NULL, NULL, "xmlNewStreamCtxt: malloc failed\n"); return(-1); } - comp->states = cur; - comp->maxState *= 2; + comp->states = tmp; + comp->maxState = newSize; } comp->states[2 * comp->nbState] = idx; comp->states[2 * comp->nbState++ + 1] = level;
diff --git a/third_party/libxml/src/py-compile b/third_party/libxml/src/py-compile index 81b122b0..c9d4fde 100755 --- a/third_party/libxml/src/py-compile +++ b/third_party/libxml/src/py-compile
@@ -1,9 +1,9 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2021-02-27.01; # UTC +scriptversion=2024-06-19.01; # UTC -# Copyright (C) 2000-2021 Free Software Foundation, Inc. +# Copyright (C) 2000-2024 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,22 +62,30 @@ ;; -h|--help) cat <<\EOF -Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." +Usage: py-compile [options] FILES... Byte compile some python scripts FILES. Use --destdir to specify any leading directory path to the FILES that you don't want to include in the byte compiled file. Specify --basedir for any additional path information you do want to be shown in the byte compiled file. +Options: + --basedir DIR Prefix all FILES with DIR, and include in error messages. + --destdir DIR Prefix all FILES with DIR before compiling. + -v, --version Display version information. + -h, --help This help screen. + Example: py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py Report bugs to <bug-automake@gnu.org>. +GNU Automake home page: <https://www.gnu.org/software/automake/>. +General help using GNU software: <https://www.gnu.org/gethelp/>. EOF exit $? ;; -v|--version) - echo "$me $scriptversion" + echo "$me (GNU Automake) $scriptversion" exit $? ;; --) @@ -94,8 +102,7 @@ shift done -files=$* -if test -z "$files"; then +if test $# -eq 0; then usage_error "no files given" fi @@ -115,68 +122,116 @@ filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" fi -python_major=`$PYTHON -V 2>&1 | sed -e 's/.* //;s/\..*$//;1q'` +python_major=`$PYTHON -c 'import sys; print(sys.version_info[0])'` if test -z "$python_major"; then - echo "$me: could not determine $PYTHON major version, guessing 3" >&2 - python_major=3 + usage_error "could not determine $PYTHON major version" fi -# The old way to import libraries was deprecated. -if test "$python_major" -le 2; then - import_lib=imp - import_test="hasattr(imp, 'get_tag')" - import_call=imp.cache_from_source - import_arg2=', False' # needed in one call and not the other -else - import_lib=importlib - import_test="hasattr(sys.implementation, 'cache_tag')" - import_call=importlib.util.cache_from_source - import_arg2= -fi +case $python_major in +[01]) + usage_error "python version 0.x and 1.x not supported" + ;; +esac +python_minor=`$PYTHON -c 'import sys; print(sys.version_info[1])'` + +# NB: When adding support for newer versions, prefer copying & adding new cases +# rather than try to keep things merged with shell variables. + +# First byte compile (no optimization) all the modules. +# This works for all currently known Python versions. $PYTHON -c " -import sys, os, py_compile, $import_lib +import sys, os, py_compile -files = '''$files''' +try: + import importlib +except ImportError: + importlib = None + +# importlib.util.cache_from_source was added in 3.4 +if ( + hasattr(importlib, 'util') + and hasattr(importlib.util, 'cache_from_source') +): + destpath = importlib.util.cache_from_source +else: + destpath = lambda filepath: filepath + 'c' sys.stdout.write('Byte-compiling python modules...\n') -for file in files.split(): +for file in sys.argv[1:]: $pathtrans $filetrans - if not os.path.exists(filepath) or not (len(filepath) >= 3 - and filepath[-3:] == '.py'): - continue - sys.stdout.write(file) + if ( + not os.path.exists(filepath) + or not (len(filepath) >= 3 and filepath[-3:] == '.py') + ): + continue + sys.stdout.write(file + ' ') sys.stdout.flush() - if $import_test: - py_compile.compile(filepath, $import_call(filepath), path) - else: - py_compile.compile(filepath, filepath + 'c', path) -sys.stdout.write('\n')" || exit $? + py_compile.compile(filepath, destpath(filepath), path) +sys.stdout.write('\n')" "$@" || exit $? -# this will fail for python < 1.5, but that doesn't matter ... +# Then byte compile w/optimization all the modules. $PYTHON -O -c " -import sys, os, py_compile, $import_lib +import sys, os, py_compile -# pypy does not use .pyo optimization -if hasattr(sys, 'pypy_translation_info'): +try: + import importlib +except ImportError: + importlib = None + +# importlib.util.cache_from_source was added in 3.4 +if ( + hasattr(importlib, 'util') + and hasattr(importlib.util, 'cache_from_source') +): + destpath = importlib.util.cache_from_source +else: + destpath = lambda filepath: filepath + 'o' + +# pypy2 does not use .pyo optimization +if sys.version_info.major <= 2 and hasattr(sys, 'pypy_translation_info'): sys.exit(0) -files = '''$files''' sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n') -for file in files.split(): +for file in sys.argv[1:]: $pathtrans $filetrans - if not os.path.exists(filepath) or not (len(filepath) >= 3 - and filepath[-3:] == '.py'): - continue - sys.stdout.write(file) + if ( + not os.path.exists(filepath) + or not (len(filepath) >= 3 and filepath[-3:] == '.py') + ): + continue + sys.stdout.write(file + ' ') sys.stdout.flush() - if $import_test: - py_compile.compile(filepath, $import_call(filepath$import_arg2), path) - else: - py_compile.compile(filepath, filepath + 'o', path) -sys.stdout.write('\n')" 2>/dev/null || exit $? + py_compile.compile(filepath, destpath(filepath), path) +sys.stdout.write('\n')" "$@" 2>/dev/null || exit $? + +# Then byte compile w/more optimization. +# Only do this for Python 3.5+, see https://bugs.gnu.org/38043 for background. +case $python_major.$python_minor in +2.*|3.[0-4]) + ;; +*) + $PYTHON -OO -c " +import sys, os, py_compile, importlib + +sys.stdout.write('Byte-compiling python modules (more optimized versions)' + ' ...\n') +for file in sys.argv[1:]: + $pathtrans + $filetrans + if ( + not os.path.exists(filepath) + or not (len(filepath) >= 3 and filepath[-3:] == '.py') + ): + continue + sys.stdout.write(file + ' ') + sys.stdout.flush() + py_compile.compile(filepath, importlib.util.cache_from_source(filepath), path) +sys.stdout.write('\n')" "$@" 2>/dev/null || exit $? + ;; +esac # Local Variables: # mode: shell-script
diff --git a/third_party/libxml/src/runsuite.c b/third_party/libxml/src/runsuite.c index c92b818e..52fc6a1 100644 --- a/third_party/libxml/src/runsuite.c +++ b/third_party/libxml/src/runsuite.c
@@ -17,7 +17,8 @@ #include <libxml/parserInternals.h> #include <libxml/tree.h> #include <libxml/uri.h> -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_XPATH_ENABLED) +#if (defined(LIBXML_RELAXNG_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)) && \ + defined(LIBXML_XPATH_ENABLED) #include <libxml/xmlreader.h> #include <libxml/xpath.h> @@ -55,16 +56,6 @@ return(1); } -static xmlChar *composeDir(const xmlChar *dir, const xmlChar *path) { - char buf[500]; - - if (dir == NULL) return(xmlStrdup(path)); - if (path == NULL) return(NULL); - - snprintf(buf, 500, "%s/%s", (const char *) dir, (const char *) path); - return(xmlStrdup((const xmlChar *) buf)); -} - /************************************************************************ * * * Libxml2 specific routines * @@ -78,60 +69,6 @@ static int nb_unimplemented = 0; static int nb_leaks = 0; -static int -fatalError(void) { - fprintf(stderr, "Exitting tests on fatal error\n"); - exit(1); -} - -/* - * that's needed to implement <resource> - */ -#define MAX_ENTITIES 20 -static char *testEntitiesName[MAX_ENTITIES]; -static char *testEntitiesValue[MAX_ENTITIES]; -static int nb_entities = 0; -static void resetEntities(void) { - int i; - - for (i = 0;i < nb_entities;i++) { - if (testEntitiesName[i] != NULL) - xmlFree(testEntitiesName[i]); - if (testEntitiesValue[i] != NULL) - xmlFree(testEntitiesValue[i]); - } - nb_entities = 0; -} -static int addEntity(char *name, char *content) { - if (nb_entities >= MAX_ENTITIES) { - fprintf(stderr, "Too many entities defined\n"); - return(-1); - } - testEntitiesName[nb_entities] = name; - testEntitiesValue[nb_entities] = content; - nb_entities++; - return(0); -} - -static int -testResourceLoader(void *vctxt ATTRIBUTE_UNUSED, const char *URL, - const char *ID ATTRIBUTE_UNUSED, - xmlResourceType type ATTRIBUTE_UNUSED, - int flags ATTRIBUTE_UNUSED, xmlParserInputPtr *out) { - int i; - - for (i = 0; i < nb_entities; i++) { - if (!strcmp(testEntitiesName[i], URL)) { - *out = xmlNewInputFromString(testEntitiesName[i], - testEntitiesValue[i], - XML_INPUT_BUF_STATIC); - return(XML_ERR_OK); - } - } - - return(xmlNewInputFromUrl(URL, 0, out)); -} - /* * Trapping the error messages at the generic level to grab the equivalent of * stderr messages on CLI tools. @@ -206,6 +143,8 @@ #endif #ifdef LIBXML_SCHEMAS_ENABLED xmlSchemaInitTypes(); +#endif +#ifdef LIBXML_RELAXNG_ENABLED xmlRelaxNGInitTypes(); #endif } @@ -271,6 +210,63 @@ * * ************************************************************************/ +#ifdef LIBXML_RELAXNG_ENABLED + +/* + * that's needed to implement <resource> + */ +#define MAX_ENTITIES 20 +static char *testEntitiesName[MAX_ENTITIES]; +static char *testEntitiesValue[MAX_ENTITIES]; +static int nb_entities = 0; +static void resetEntities(void) { + int i; + + for (i = 0;i < nb_entities;i++) { + if (testEntitiesName[i] != NULL) + xmlFree(testEntitiesName[i]); + if (testEntitiesValue[i] != NULL) + xmlFree(testEntitiesValue[i]); + } + nb_entities = 0; +} +static int addEntity(char *name, char *content) { + if (nb_entities >= MAX_ENTITIES) { + fprintf(stderr, "Too many entities defined\n"); + return(-1); + } + testEntitiesName[nb_entities] = name; + testEntitiesValue[nb_entities] = content; + nb_entities++; + return(0); +} + +static xmlParserErrors +testResourceLoader(void *vctxt ATTRIBUTE_UNUSED, const char *URL, + const char *ID ATTRIBUTE_UNUSED, + xmlResourceType type ATTRIBUTE_UNUSED, + xmlParserInputFlags flags ATTRIBUTE_UNUSED, + xmlParserInputPtr *out) { + int i; + + for (i = 0; i < nb_entities; i++) { + if (!strcmp(testEntitiesName[i], URL)) { + *out = xmlNewInputFromString(testEntitiesName[i], + testEntitiesValue[i], + XML_INPUT_BUF_STATIC); + return(XML_ERR_OK); + } + } + + return(xmlNewInputFromUrl(URL, 0, out)); +} + +static int +fatalError(void) { + fprintf(stderr, "Exitting tests on fatal error\n"); + exit(1); +} + static int xsdIncorrectTestCase(xmlNodePtr cur) { xmlNodePtr test; @@ -330,6 +326,16 @@ return(ret); } +static xmlChar *composeDir(const xmlChar *dir, const xmlChar *path) { + char buf[500]; + + if (dir == NULL) return(xmlStrdup(path)); + if (path == NULL) return(NULL); + + snprintf(buf, 500, "%s/%s", (const char *) dir, (const char *) path); + return(xmlStrdup((const xmlChar *) buf)); +} + static void installResources(xmlNodePtr tst, const xmlChar *base) { xmlNodePtr test; @@ -732,6 +738,7 @@ xmlFreeDoc(doc); return(ret); } +#endif /* LIBXML_RELAXNG_ENABLED */ /************************************************************************ * * @@ -739,6 +746,7 @@ * * ************************************************************************/ +#ifdef LIBXML_SCHEMAS_ENABLED static int xstcTestInstance(xmlNodePtr cur, xmlSchemaPtr schemas, const xmlChar *spath, const char *base) { @@ -998,6 +1006,7 @@ xmlFreeDoc(doc); return(ret); } +#endif /* LIBXML_SCHEMAS_ENABLED */ /************************************************************************ * * @@ -1008,7 +1017,10 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { int ret = 0; - int old_errors, old_tests, old_leaks, expected_errors; + int old_errors, old_tests, old_leaks; +#ifdef LIBXML_RELAXNG_ENABLED + int expected_errors; +#endif logfile = fopen(LOGFILE, "wb"); if (logfile == NULL) { @@ -1021,7 +1033,7 @@ if ((argc >= 2) && (!strcmp(argv[1], "-v"))) verbose = 1; - +#ifdef LIBXML_RELAXNG_ENABLED old_errors = nb_errors; old_tests = nb_tests; old_leaks = nb_leaks; @@ -1063,7 +1075,9 @@ nb_tests - old_tests, nb_errors - old_errors, nb_leaks - old_leaks); +#endif /* LIBXML_RELAXNG_ENABLED */ +#ifdef LIBXML_SCHEMAS_ENABLED old_errors = nb_errors; old_tests = nb_tests; old_leaks = nb_leaks; @@ -1123,6 +1137,7 @@ printf("Some errors were expected.\n"); nb_errors = old_errors; } +#endif /* LIBXML_SCHEMAS_ENABLED */ if ((nb_errors == 0) && (nb_leaks == 0)) { ret = 0; @@ -1140,7 +1155,7 @@ fclose(logfile); return(ret); } -#else /* !SCHEMAS */ +#else /* !RELAXNG && !SCHEMAS */ int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { fprintf(stderr, "runsuite requires support for schemas and xpath in libxml2\n");
diff --git a/third_party/libxml/src/runtest.c b/third_party/libxml/src/runtest.c index d06ec83e..1d36ea0d 100644 --- a/third_party/libxml/src/runtest.c +++ b/third_party/libxml/src/runtest.c
@@ -52,8 +52,11 @@ #endif #endif -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #include <libxml/relaxng.h> +#endif + +#ifdef LIBXML_SCHEMAS_ENABLED #include <libxml/xmlschemas.h> #include <libxml/xmlschemastypes.h> #endif @@ -313,9 +316,11 @@ #endif xmlInitializeCatalog(); #endif +#ifdef LIBXML_RELAXNG_ENABLED + xmlRelaxNGInitTypes(); +#endif #ifdef LIBXML_SCHEMAS_ENABLED xmlSchemaInitTypes(); - xmlRelaxNGInitTypes(); #endif } @@ -1797,6 +1802,8 @@ config.startTag = BAD_CAST startTag; config.inCharacters = 0; ctxt->_private = &config; + /* Skip charset auto-detection */ + ctxt->instate = XML_PARSER_XML_DECL; htmlCtxtUseOptions(ctxt, options | HTML_PARSE_HTML5); htmlParseChunk(ctxt, data, size, 1); htmlFreeParserCtxt(ctxt); @@ -2254,9 +2261,13 @@ if ((options & XML_PARSE_HTML) && (ctxt->endCheckState)) { max = strlen((const char *) ctxt->name) + 2; + } else if (c == '&') { + max = (options & XML_PARSE_HTML) ? 32 : 1; + } else if (c == '<') { + max = 1; } else { /* 3 bytes for partial UTF-8 */ - max = ((c == '<') || (c == '&')) ? 1 : 3; + max = 3; } } else if (ctxt->instate == XML_PARSER_CDATA_SECTION) { /* 2 bytes for terminator, 3 bytes for UTF-8 */ @@ -2726,7 +2737,7 @@ return(-1); } } -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if (rng != NULL) { ret = xmlTextReaderRelaxNGValidate(reader, rng); if (ret < 0) { @@ -3521,12 +3532,13 @@ return(failures); } -#ifdef LIBXML_SCHEMAS_ENABLED /************************************************************************ * * * Schemas tests * * * ************************************************************************/ + +#ifdef LIBXML_SCHEMAS_ENABLED static int schemasOneTest(const char *sch, const char *filename, @@ -3681,12 +3693,15 @@ return(res); } +#endif /* LIBXML_SCHEMAS_ENABLED */ /************************************************************************ * * - * Schemas tests * + * RELAX NG tests * * * ************************************************************************/ + +#ifdef LIBXML_RELAXNG_ENABLED static int rngOneTest(const char *sch, const char *filename, @@ -3909,7 +3924,7 @@ } #endif /* READER */ -#endif +#endif /* LIBXML_RELAX_ENABLED */ /************************************************************************ * * @@ -5266,6 +5281,8 @@ { "Schemas regression tests" , schemasTest, "./test/schemas/*_*.xsd", NULL, NULL, NULL, 0 }, +#endif +#ifdef LIBXML_RELAXNG_ENABLED { "Relax-NG regression tests" , rngTest, "./test/relaxng/*.rng", NULL, NULL, NULL, XML_PARSE_DTDATTR | XML_PARSE_NOENT },
diff --git a/third_party/libxml/src/runxmlconf.c b/third_party/libxml/src/runxmlconf.c index 62401e8e..10feb0b 100644 --- a/third_party/libxml/src/runxmlconf.c +++ b/third_party/libxml/src/runxmlconf.c
@@ -504,12 +504,14 @@ } static int -xmlconfTest(void) { - const char *confxml = "xmlconf/xmlconf.xml"; +xmlconfTest(const char *dir) { + char confxml[500]; xmlDocPtr doc; xmlNodePtr cur; int ret = 0; + snprintf(confxml, sizeof(confxml), "%s/xmlconf.xml", dir); + if (!checkTestFile(confxml)) { fprintf(stderr, "%s is missing \n", confxml); xmlconfInfo(); @@ -541,9 +543,11 @@ ************************************************************************/ int -main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { +main(int argc, char **argv) { int ret = 0; int old_errors, old_tests, old_leaks; + const char *dir = "xmlconf"; + int i; logfile = fopen(LOGFILE, "wb"); if (logfile == NULL) { @@ -553,14 +557,22 @@ } initializeLibxml2(); - if ((argc >= 2) && (!strcmp(argv[1], "-v"))) - verbose = 1; - + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-v") == 0) { + verbose = 1; + } else if (strcmp(argv[i], "-d") == 0 && i + 1 < argc) { + i += 1; + dir = argv[i]; + } else { + fprintf(stderr, "invalid argument: %s\n", argv[i]); + return 1; + } + } old_errors = nb_errors; old_tests = nb_tests; old_leaks = nb_leaks; - xmlconfTest(); + xmlconfTest(dir); if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) printf("Ran %d tests, no errors\n", nb_tests - old_tests); else
diff --git a/third_party/libxml/src/shell.c b/third_party/libxml/src/shell.c index a1572b2..623cc77 100644 --- a/third_party/libxml/src/shell.c +++ b/third_party/libxml/src/shell.c
@@ -31,11 +31,11 @@ #include <libxml/uri.h> #include <libxml/xpath.h> #include <libxml/xpathInternals.h> -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #include <libxml/relaxng.h> #endif -#include "private/shell.h" +#include "private/lint.h" #ifndef STDIN_FILENO #define STDIN_FILENO 0 @@ -599,7 +599,7 @@ return (0); } -#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_RELAXNG_ENABLED) static void xmllintShellPrintf(void *ctx, const char *msg, ...) { xmllintShellCtxtPtr sctxt = ctx; @@ -609,9 +609,9 @@ vfprintf(sctxt->output, msg, ap); va_end(ap); } -#endif /* defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ +#endif /* defined(LIBXML_VALID_ENABLED) || defined(LIBXML_RELAXNG_ENABLED) */ -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED /** * xmllintShellRNGValidate: * @ctxt: the shell context @@ -1096,7 +1096,6 @@ * xmllintShell: * @doc: the initial document * @filename: the output buffer - * @input: the line reading function * @output: the output FILE*, defaults to stdout if NULL * * Implements the XML shell @@ -1228,7 +1227,7 @@ #ifdef LIBXML_VALID_ENABLED fprintf(ctxt->output, "\tvalidate check the document for errors\n"); #endif /* LIBXML_VALID_ENABLED */ -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED fprintf(ctxt->output, "\trelaxng rng validate the document against the Relax-NG schemas\n"); #endif fprintf(ctxt->output, "\tgrep string search for a string in the subtree\n"); @@ -1238,7 +1237,7 @@ #endif /* LIBXML_VALID_ENABLED */ } else if (!strcmp(command, "load")) { xmllintShellLoad(ctxt, arg, NULL, NULL); -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED } else if (!strcmp(command, "relaxng")) { xmllintShellRNGValidate(ctxt, arg, NULL, NULL); #endif
diff --git a/third_party/libxml/src/testModule.c b/third_party/libxml/src/testModule.c index 00055a4c..4baf4265 100644 --- a/third_party/libxml/src/testModule.c +++ b/third_party/libxml/src/testModule.c
@@ -19,8 +19,8 @@ #include <stdarg.h> #include <libxml/xmlmemory.h> -#include <libxml/debugXML.h> #include <libxml/xmlmodule.h> +#include <libxml/xmlstring.h> #ifdef _WIN32 #define MODULE_PATH "." @@ -81,4 +81,4 @@ printf("%s : Module support not compiled in\n", argv[0]); return(0); } -#endif /* LIBXML_SCHEMAS_ENABLED */ +#endif /* LIBXML_MODULES_ENABLED */
diff --git a/third_party/libxml/src/testapi.c b/third_party/libxml/src/testapi.c index 438acfb..5e3e6fb 100644 --- a/third_party/libxml/src/testapi.c +++ b/third_party/libxml/src/testapi.c
@@ -142,7 +142,7 @@ #ifdef LIBXML_CATALOG_ENABLED xmlInitializeCatalog(); #endif -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED xmlRelaxNGInitTypes(); #endif @@ -852,6 +852,8 @@ } static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) { } +#endif +#ifdef LIBXML_RELAXNG_ENABLED static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) { xmlRelaxNGFreeParserCtxt(val); } @@ -1105,6 +1107,21 @@ static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) { } +#define gen_nb_xmlParserInputFlags 4 +static xmlParserInputFlags gen_xmlParserInputFlags(int no, int nr ATTRIBUTE_UNUSED) { + if (no == 1) return(XML_INPUT_BUF_STATIC); + if (no == 2) return(XML_INPUT_BUF_ZERO_TERMINATED); + if (no == 3) return(XML_INPUT_NETWORK); + if (no == 4) return(XML_INPUT_UNZIP); + return(0); +} + +static void des_xmlParserInputFlags(int no ATTRIBUTE_UNUSED, xmlParserInputFlags val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} + +static void desret_xmlParserStatus(xmlParserStatus val ATTRIBUTE_UNUSED) { +} + #ifdef LIBXML_SCHEMAS_ENABLED #define gen_nb_xmlSchemaValType 4 static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) { @@ -1269,61 +1286,6 @@ return(test_ret); } - -static int -test_UTF8ToHtml(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - unsigned char * out; /* a pointer to an array of bytes to store the result */ - int n_out; - int * outlen; /* the length of @out */ - int n_outlen; - const unsigned char * in; /* a pointer to an array of UTF-8 chars */ - int n_in; - int * inlen; /* the length of @in */ - int n_inlen; - - for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { - for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { - for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { - for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { - mem_base = xmlMemBlocks(); - out = gen_unsigned_char_ptr(n_out, 0); - outlen = gen_int_ptr(n_outlen, 1); - in = gen_const_unsigned_char_ptr(n_in, 2); - inlen = gen_int_ptr(n_inlen, 3); - - ret_val = UTF8ToHtml(out, outlen, in, inlen); - desret_int(ret_val); - call_tests++; - des_unsigned_char_ptr(n_out, out, 0); - des_int_ptr(n_outlen, outlen, 1); - des_const_unsigned_char_ptr(n_in, in, 2); - des_int_ptr(n_inlen, inlen, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in UTF8ToHtml", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_outlen); - printf(" %d", n_in); - printf(" %d", n_inlen); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - #ifdef LIBXML_HTML_ENABLED #define gen_nb_const_htmlElemDesc_ptr 1 @@ -1850,6 +1812,47 @@ static int +test_htmlCtxtSetOptions(void) { + int test_ret = 0; + +#if defined(LIBXML_HTML_ENABLED) + int mem_base; + int ret_val; + xmlParserCtxtPtr ctxt; /* an HTML parser context */ + int n_ctxt; + int options; /* a bitmask of xmlParserOption values */ + int n_options; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + for (n_options = 0;n_options < gen_nb_int;n_options++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + options = gen_int(n_options, 1); + + ret_val = htmlCtxtSetOptions(ctxt, options); + desret_int(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + des_int(n_options, options, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in htmlCtxtSetOptions", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_options); + printf("\n"); + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int test_htmlCtxtUseOptions(void) { int test_ret = 0; @@ -2912,12 +2915,66 @@ return(test_ret); } + +static int +test_htmlUTF8ToHtml(void) { + int test_ret = 0; + +#if defined(LIBXML_HTML_ENABLED) + int mem_base; + int ret_val; + unsigned char * out; /* a pointer to an array of bytes to store the result */ + int n_out; + int * outlen; /* the length of @out */ + int n_outlen; + const unsigned char * in; /* a pointer to an array of UTF-8 chars */ + int n_in; + int * inlen; /* the length of @in */ + int n_inlen; + + for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { + for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { + for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { + for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { + mem_base = xmlMemBlocks(); + out = gen_unsigned_char_ptr(n_out, 0); + outlen = gen_int_ptr(n_outlen, 1); + in = gen_const_unsigned_char_ptr(n_in, 2); + inlen = gen_int_ptr(n_inlen, 3); + + ret_val = htmlUTF8ToHtml(out, outlen, in, inlen); + desret_int(ret_val); + call_tests++; + des_unsigned_char_ptr(n_out, out, 0); + des_int_ptr(n_outlen, outlen, 1); + des_const_unsigned_char_ptr(n_in, in, 2); + des_int_ptr(n_inlen, inlen, 3); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in htmlUTF8ToHtml", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_out); + printf(" %d", n_outlen); + printf(" %d", n_in); + printf(" %d", n_inlen); + printf("\n"); + } + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + static int test_HTMLparser(void) { int test_ret = 0; - if (quiet == 0) printf("Testing HTMLparser : 36 of 42 functions ...\n"); - test_ret += test_UTF8ToHtml(); + if (quiet == 0) printf("Testing HTMLparser : 37 of 43 functions ...\n"); test_ret += test_htmlAttrAllowed(); test_ret += test_htmlAutoCloseTag(); test_ret += test_htmlCreateFileParserCtxt(); @@ -2928,6 +2985,7 @@ test_ret += test_htmlCtxtReadFile(); test_ret += test_htmlCtxtReadMemory(); test_ret += test_htmlCtxtReset(); + test_ret += test_htmlCtxtSetOptions(); test_ret += test_htmlCtxtUseOptions(); test_ret += test_htmlElementAllowedHere(); test_ret += test_htmlElementStatusHere(); @@ -2954,6 +3012,7 @@ test_ret += test_htmlSAXParseDoc(); test_ret += test_htmlSAXParseFile(); test_ret += test_htmlTagLookup(); + test_ret += test_htmlUTF8ToHtml(); if (test_ret != 0) printf("Module HTMLparser: %d errors\n", test_ret); @@ -7873,116 +7932,6 @@ } static int -test_UTF8Toisolat1(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef LIBXML_OUTPUT_ENABLED - int mem_base; - int ret_val; - unsigned char * out; /* a pointer to an array of bytes to store the result */ - int n_out; - int * outlen; /* the length of @out */ - int n_outlen; - const unsigned char * in; /* a pointer to an array of UTF-8 chars */ - int n_in; - int * inlen; /* the length of @in */ - int n_inlen; - - for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { - for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { - for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { - for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { - mem_base = xmlMemBlocks(); - out = gen_unsigned_char_ptr(n_out, 0); - outlen = gen_int_ptr(n_outlen, 1); - in = gen_const_unsigned_char_ptr(n_in, 2); - inlen = gen_int_ptr(n_inlen, 3); - - ret_val = UTF8Toisolat1(out, outlen, in, inlen); - desret_int(ret_val); - call_tests++; - des_unsigned_char_ptr(n_out, out, 0); - des_int_ptr(n_outlen, outlen, 1); - des_const_unsigned_char_ptr(n_in, in, 2); - des_int_ptr(n_inlen, inlen, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in UTF8Toisolat1", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_outlen); - printf(" %d", n_in); - printf(" %d", n_inlen); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_isolat1ToUTF8(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned char * out; /* a pointer to an array of bytes to store the result */ - int n_out; - int * outlen; /* the length of @out */ - int n_outlen; - const unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */ - int n_in; - int * inlen; /* the length of @in */ - int n_inlen; - - for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { - for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { - for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { - for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { - mem_base = xmlMemBlocks(); - out = gen_unsigned_char_ptr(n_out, 0); - outlen = gen_int_ptr(n_outlen, 1); - in = gen_const_unsigned_char_ptr(n_in, 2); - inlen = gen_int_ptr(n_inlen, 3); - - ret_val = isolat1ToUTF8(out, outlen, in, inlen); - desret_int(ret_val); - call_tests++; - des_unsigned_char_ptr(n_out, out, 0); - des_int_ptr(n_outlen, outlen, 1); - des_const_unsigned_char_ptr(n_in, in, 2); - des_int_ptr(n_inlen, inlen, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in isolat1ToUTF8", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_outlen); - printf(" %d", n_in); - printf(" %d", n_inlen); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int test_xmlAddEncodingAlias(void) { int test_ret = 0; @@ -8140,6 +8089,16 @@ static int +test_xmlCharEncNewCustomHandler(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int test_xmlCharEncOutFunc(void) { int test_ret = 0; @@ -8404,6 +8363,59 @@ static int +test_xmlIsolat1ToUTF8(void) { + int test_ret = 0; + + int mem_base; + int ret_val; + unsigned char * out; /* a pointer to an array of bytes to store the result */ + int n_out; + int * outlen; /* the length of @out */ + int n_outlen; + const unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */ + int n_in; + int * inlen; /* the length of @in */ + int n_inlen; + + for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { + for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { + for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { + for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { + mem_base = xmlMemBlocks(); + out = gen_unsigned_char_ptr(n_out, 0); + outlen = gen_int_ptr(n_outlen, 1); + in = gen_const_unsigned_char_ptr(n_in, 2); + inlen = gen_int_ptr(n_inlen, 3); + + ret_val = xmlIsolat1ToUTF8(out, outlen, in, inlen); + desret_int(ret_val); + call_tests++; + des_unsigned_char_ptr(n_out, out, 0); + des_int_ptr(n_outlen, outlen, 1); + des_const_unsigned_char_ptr(n_in, in, 2); + des_int_ptr(n_inlen, inlen, 3); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlIsolat1ToUTF8", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_out); + printf(" %d", n_outlen); + printf(" %d", n_in); + printf(" %d", n_inlen); + printf("\n"); + } + } + } + } + } + function_tests++; + + return(test_ret); +} + + +static int test_xmlLookupCharEncodingHandler(void) { int test_ret = 0; @@ -8498,17 +8510,71 @@ return(test_ret); } + +static int +test_xmlUTF8ToIsolat1(void) { + int test_ret = 0; + +#if defined(LIBXML_OUTPUT_ENABLED) + int mem_base; + int ret_val; + unsigned char * out; /* a pointer to an array of bytes to store the result */ + int n_out; + int * outlen; /* the length of @out */ + int n_outlen; + const unsigned char * in; /* a pointer to an array of UTF-8 chars */ + int n_in; + int * inlen; /* the length of @in */ + int n_inlen; + + for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { + for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { + for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { + for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { + mem_base = xmlMemBlocks(); + out = gen_unsigned_char_ptr(n_out, 0); + outlen = gen_int_ptr(n_outlen, 1); + in = gen_const_unsigned_char_ptr(n_in, 2); + inlen = gen_int_ptr(n_inlen, 3); + + ret_val = xmlUTF8ToIsolat1(out, outlen, in, inlen); + desret_int(ret_val); + call_tests++; + des_unsigned_char_ptr(n_out, out, 0); + des_int_ptr(n_outlen, outlen, 1); + des_const_unsigned_char_ptr(n_in, in, 2); + des_int_ptr(n_inlen, inlen, 3); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlUTF8ToIsolat1", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_out); + printf(" %d", n_outlen); + printf(" %d", n_in); + printf(" %d", n_inlen); + printf("\n"); + } + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + static int test_encoding(void) { int test_ret = 0; - if (quiet == 0) printf("Testing encoding : 16 of 22 functions ...\n"); - test_ret += test_UTF8Toisolat1(); - test_ret += test_isolat1ToUTF8(); + if (quiet == 0) printf("Testing encoding : 16 of 23 functions ...\n"); test_ret += test_xmlAddEncodingAlias(); test_ret += test_xmlCharEncCloseFunc(); test_ret += test_xmlCharEncFirstLine(); test_ret += test_xmlCharEncInFunc(); + test_ret += test_xmlCharEncNewCustomHandler(); test_ret += test_xmlCharEncOutFunc(); test_ret += test_xmlCleanupCharEncodingHandlers(); test_ret += test_xmlCleanupEncodingAliases(); @@ -8520,11 +8586,13 @@ test_ret += test_xmlGetCharEncodingName(); test_ret += test_xmlGetEncodingAlias(); test_ret += test_xmlInitCharEncodingHandlers(); + test_ret += test_xmlIsolat1ToUTF8(); test_ret += test_xmlLookupCharEncodingHandler(); test_ret += test_xmlNewCharEncodingHandler(); test_ret += test_xmlOpenCharEncodingHandler(); test_ret += test_xmlParseCharEncoding(); test_ret += test_xmlRegisterCharEncodingHandler(); + test_ret += test_xmlUTF8ToIsolat1(); if (test_ret != 0) printf("Module encoding: %d errors\n", test_ret); @@ -8905,7 +8973,7 @@ int mem_base; xmlChar * ret_val; - const xmlDoc * doc; /* the document containing the string */ + const xmlDoc * doc; /* unused */ int n_doc; const xmlChar * input; /* A string to convert to XML. */ int n_input; @@ -11837,7 +11905,7 @@ int mem_base; void * ret_val; - xmlParserCtxtPtr ctxt; /* */ + xmlParserCtxtPtr ctxt; /* parser context */ int n_ctxt; for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { @@ -11869,7 +11937,7 @@ int mem_base; const xmlChar * ret_val; - xmlParserCtxtPtr ctxt; /* */ + xmlParserCtxtPtr ctxt; /* parser context */ int n_ctxt; for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { @@ -11896,6 +11964,38 @@ static int +test_xmlCtxtGetDocument(void) { + int test_ret = 0; + + int mem_base; + xmlDocPtr ret_val; + xmlParserCtxtPtr ctxt; /* parser context */ + int n_ctxt; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + + ret_val = xmlCtxtGetDocument(ctxt); + desret_xmlDocPtr(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtGetDocument", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf("\n"); + } + } + function_tests++; + + return(test_ret); +} + + +static int test_xmlCtxtGetOptions(void) { int test_ret = 0; @@ -11933,7 +12033,7 @@ int mem_base; void * ret_val; - xmlParserCtxtPtr ctxt; /* */ + xmlParserCtxtPtr ctxt; /* parser context */ int n_ctxt; for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { @@ -11960,12 +12060,22 @@ static int +test_xmlCtxtGetSaxHandler(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int test_xmlCtxtGetStandalone(void) { int test_ret = 0; int mem_base; int ret_val; - xmlParserCtxtPtr ctxt; /* */ + xmlParserCtxtPtr ctxt; /* parser context */ int n_ctxt; for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { @@ -12000,7 +12110,7 @@ int test_ret = 0; int mem_base; - int ret_val; + xmlParserStatus ret_val; xmlParserCtxt * ctxt; /* an XML parser context */ int n_ctxt; @@ -12009,7 +12119,7 @@ ctxt = gen_xmlParserCtxt_ptr(n_ctxt, 0); ret_val = xmlCtxtGetStatus(ctxt); - desret_int(ret_val); + desret_xmlParserStatus(ret_val); call_tests++; des_xmlParserCtxt_ptr(n_ctxt, ctxt, 0); xmlResetLastError(); @@ -12028,12 +12138,22 @@ static int +test_xmlCtxtGetValidCtxt(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int test_xmlCtxtGetVersion(void) { int test_ret = 0; int mem_base; const xmlChar * ret_val; - xmlParserCtxtPtr ctxt; /* */ + xmlParserCtxtPtr ctxt; /* parser context */ int n_ctxt; for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { @@ -12060,6 +12180,70 @@ static int +test_xmlCtxtIsHtml(void) { + int test_ret = 0; + + int mem_base; + int ret_val; + xmlParserCtxtPtr ctxt; /* parser context */ + int n_ctxt; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + + ret_val = xmlCtxtIsHtml(ctxt); + desret_int(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtIsHtml", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf("\n"); + } + } + function_tests++; + + return(test_ret); +} + + +static int +test_xmlCtxtIsStopped(void) { + int test_ret = 0; + + int mem_base; + int ret_val; + xmlParserCtxtPtr ctxt; /* parser context */ + int n_ctxt; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + + ret_val = xmlCtxtIsStopped(ctxt); + desret_int(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtIsStopped", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf("\n"); + } + } + function_tests++; + + return(test_ret); +} + + +static int test_xmlCtxtParseContent(void) { int test_ret = 0; @@ -12152,6 +12336,61 @@ static int +test_xmlCtxtParseDtd(void) { + int test_ret = 0; + +#if defined(LIBXML_VALID_ENABLED) + int mem_base; + xmlDtdPtr ret_val; + xmlParserCtxtPtr ctxt; /* a parser context */ + int n_ctxt; + xmlParserInputPtr input; /* a parser input */ + int n_input; + const xmlChar * publicId; /* public ID of the DTD (optional) */ + int n_publicId; + const xmlChar * systemId; /* system ID of the DTD (optional) */ + int n_systemId; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { + for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { + for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + input = gen_xmlParserInputPtr(n_input, 1); + publicId = gen_const_xmlChar_ptr(n_publicId, 2); + systemId = gen_const_xmlChar_ptr(n_systemId, 3); + + ret_val = xmlCtxtParseDtd(ctxt, input, publicId, systemId); + desret_xmlDtdPtr(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + des_xmlParserInputPtr(n_input, input, 1); + des_const_xmlChar_ptr(n_publicId, publicId, 2); + des_const_xmlChar_ptr(n_systemId, systemId, 3); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtParseDtd", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_input); + printf(" %d", n_publicId); + printf(" %d", n_systemId); + printf("\n"); + } + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int test_xmlCtxtReadDoc(void) { int test_ret = 0; @@ -12432,9 +12671,9 @@ int test_ret = 0; int mem_base; - xmlParserCtxtPtr ctxt; /* */ + xmlParserCtxtPtr ctxt; /* parser context */ int n_ctxt; - void * catalogs; /* */ + void * catalogs; /* catalogs pointer */ int n_catalogs; for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { @@ -12479,9 +12718,9 @@ int test_ret = 0; int mem_base; - xmlParserCtxtPtr ctxt; /* */ + xmlParserCtxtPtr ctxt; /* parser context */ int n_ctxt; - xmlDictPtr dict; /* */ + xmlDictPtr dict; /* dictionary */ int n_dict; for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { @@ -12575,9 +12814,9 @@ int test_ret = 0; int mem_base; - xmlParserCtxtPtr ctxt; /* */ + xmlParserCtxtPtr ctxt; /* parser context */ int n_ctxt; - void * priv; /* */ + void * priv; /* private application data */ int n_priv; for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { @@ -12617,6 +12856,49 @@ } +#define gen_nb_const_xmlSAXHandler_ptr 1 +#define gen_const_xmlSAXHandler_ptr(no, nr) NULL +#define des_const_xmlSAXHandler_ptr(no, val, nr) + +static int +test_xmlCtxtSetSaxHandler(void) { + int test_ret = 0; + + int mem_base; + int ret_val; + xmlParserCtxtPtr ctxt; /* parser context */ + int n_ctxt; + const xmlSAXHandler * sax; /* SAX handler */ + int n_sax; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + for (n_sax = 0;n_sax < gen_nb_const_xmlSAXHandler_ptr;n_sax++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + sax = gen_const_xmlSAXHandler_ptr(n_sax, 1); + + ret_val = xmlCtxtSetSaxHandler(ctxt, sax); + desret_int(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + des_const_xmlSAXHandler_ptr(n_sax, sax, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtSetSaxHandler", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_sax); + printf("\n"); + } + } + } + function_tests++; + + return(test_ret); +} + + static int test_xmlCtxtUseOptions(void) { int test_ret = 0; @@ -12657,6 +12939,95 @@ static int +test_xmlCtxtValidateDocument(void) { + int test_ret = 0; + +#if defined(LIBXML_VALID_ENABLED) + int mem_base; + int ret_val; + xmlParserCtxtPtr ctxt; /* a parser context */ + int n_ctxt; + xmlDocPtr doc; /* a document instance */ + int n_doc; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + doc = gen_xmlDocPtr(n_doc, 1); + + ret_val = xmlCtxtValidateDocument(ctxt, doc); + desret_int(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + des_xmlDocPtr(n_doc, doc, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtValidateDocument", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_doc); + printf("\n"); + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlCtxtValidateDtd(void) { + int test_ret = 0; + +#if defined(LIBXML_VALID_ENABLED) + int mem_base; + int ret_val; + xmlParserCtxtPtr ctxt; /* a parser context */ + int n_ctxt; + xmlDocPtr doc; /* a document instance */ + int n_doc; + xmlDtdPtr dtd; /* a dtd instance */ + int n_dtd; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { + for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + doc = gen_xmlDocPtr(n_doc, 1); + dtd = gen_xmlDtdPtr(n_dtd, 2); + + ret_val = xmlCtxtValidateDtd(ctxt, doc, dtd); + desret_int(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + des_xmlDocPtr(n_doc, doc, 1); + des_xmlDtdPtr(n_dtd, dtd, 2); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtValidateDtd", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_doc); + printf(" %d", n_dtd); + printf("\n"); + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int test_xmlGetExternalEntityLoader(void) { int test_ret = 0; @@ -12851,7 +13222,7 @@ int test_ret = 0; int mem_base; - int ret_val; + xmlParserErrors ret_val; xmlParserInputPtr input; /* the input stream */ int n_input; xmlCharEncodingHandlerPtr handler; /* the encoding handler */ @@ -12864,7 +13235,7 @@ handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1); ret_val = xmlInputSetEncodingHandler(input, handler); - desret_int(ret_val); + desret_xmlParserErrors(ret_val); call_tests++; des_xmlParserInputPtr(n_input, input, 0); des_xmlCharEncodingHandlerPtr(n_handler, handler, 1); @@ -13052,23 +13423,23 @@ int n_url; int fd; /* file descriptor */ int n_fd; - int flags; /* unused, pass 0 */ + xmlParserInputFlags flags; /* input flags */ int n_flags; for (n_url = 0;n_url < gen_nb_filepath;n_url++) { for (n_fd = 0;n_fd < gen_nb_int;n_fd++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { + for (n_flags = 0;n_flags < gen_nb_xmlParserInputFlags;n_flags++) { mem_base = xmlMemBlocks(); url = gen_filepath(n_url, 0); fd = gen_int(n_fd, 1); - flags = gen_int(n_flags, 2); + flags = gen_xmlParserInputFlags(n_flags, 2); ret_val = xmlNewInputFromFd(url, fd, flags); desret_xmlParserInputPtr(ret_val); call_tests++; des_filepath(n_url, url, 0); des_int(n_fd, fd, 1); - des_int(n_flags, flags, 2); + des_xmlParserInputFlags(n_flags, flags, 2); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { printf("Leak of %d blocks found in xmlNewInputFromFd", @@ -13118,23 +13489,23 @@ int n_url; const char * str; /* zero-terminated string */ int n_str; - int flags; /* optimization hints */ + xmlParserInputFlags flags; /* optimization hints */ int n_flags; for (n_url = 0;n_url < gen_nb_filepath;n_url++) { for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { + for (n_flags = 0;n_flags < gen_nb_xmlParserInputFlags;n_flags++) { mem_base = xmlMemBlocks(); url = gen_filepath(n_url, 0); str = gen_const_char_ptr(n_str, 1); - flags = gen_int(n_flags, 2); + flags = gen_xmlParserInputFlags(n_flags, 2); ret_val = xmlNewInputFromString(url, str, flags); desret_xmlParserInputPtr(ret_val); call_tests++; des_filepath(n_url, url, 0); des_const_char_ptr(n_str, str, 1); - des_int(n_flags, flags, 2); + des_xmlParserInputFlags(n_flags, flags, 2); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { printf("Leak of %d blocks found in xmlNewInputFromString", @@ -13163,27 +13534,27 @@ int test_ret = 0; int mem_base; - int ret_val; + xmlParserErrors ret_val; const char * filename; /* the filename to use as entity */ int n_filename; - int flags; /* XML_INPUT flags */ + xmlParserInputFlags flags; /* XML_INPUT flags */ int n_flags; xmlParserInputPtr * out; /* pointer to new parser input */ int n_out; for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { + for (n_flags = 0;n_flags < gen_nb_xmlParserInputFlags;n_flags++) { for (n_out = 0;n_out < gen_nb_xmlParserInputPtr_ptr;n_out++) { mem_base = xmlMemBlocks(); filename = gen_filepath(n_filename, 0); - flags = gen_int(n_flags, 1); + flags = gen_xmlParserInputFlags(n_flags, 1); out = gen_xmlParserInputPtr_ptr(n_out, 2); ret_val = xmlNewInputFromUrl(filename, flags, out); - desret_int(ret_val); + desret_xmlParserErrors(ret_val); call_tests++; des_filepath(n_filename, filename, 0); - des_int(n_flags, flags, 1); + des_xmlParserInputFlags(n_flags, flags, 1); des_xmlParserInputPtr_ptr(n_out, out, 2); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { @@ -13229,10 +13600,6 @@ } -#define gen_nb_const_xmlSAXHandler_ptr 1 -#define gen_const_xmlSAXHandler_ptr(no, nr) NULL -#define des_const_xmlSAXHandler_ptr(no, val, nr) - static int test_xmlNewSAXParserCtxt(void) { int test_ret = 0; @@ -15237,38 +15604,6 @@ static int -test_xmlThrDefParserDebugEntities(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - int v; /* */ - int n_v; - - for (n_v = 0;n_v < gen_nb_int;n_v++) { - mem_base = xmlMemBlocks(); - v = gen_int(n_v, 0); - - ret_val = xmlThrDefParserDebugEntities(v); - desret_int(ret_val); - call_tests++; - des_int(n_v, v, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlThrDefParserDebugEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_v); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int test_xmlThrDefPedanticParserDefaultValue(void) { int test_ret = 0; @@ -15335,7 +15670,7 @@ test_parser(void) { int test_ret = 0; - if (quiet == 0) printf("Testing parser : 86 of 102 functions ...\n"); + if (quiet == 0) printf("Testing parser : 92 of 110 functions ...\n"); test_ret += test_xmlByteConsumed(); test_ret += test_xmlCleanupGlobals(); test_ret += test_xmlClearNodeInfoSeq(); @@ -15344,13 +15679,19 @@ test_ret += test_xmlCreatePushParserCtxt(); test_ret += test_xmlCtxtGetCatalogs(); test_ret += test_xmlCtxtGetDeclaredEncoding(); + test_ret += test_xmlCtxtGetDocument(); test_ret += test_xmlCtxtGetOptions(); test_ret += test_xmlCtxtGetPrivate(); + test_ret += test_xmlCtxtGetSaxHandler(); test_ret += test_xmlCtxtGetStandalone(); test_ret += test_xmlCtxtGetStatus(); + test_ret += test_xmlCtxtGetValidCtxt(); test_ret += test_xmlCtxtGetVersion(); + test_ret += test_xmlCtxtIsHtml(); + test_ret += test_xmlCtxtIsStopped(); test_ret += test_xmlCtxtParseContent(); test_ret += test_xmlCtxtParseDocument(); + test_ret += test_xmlCtxtParseDtd(); test_ret += test_xmlCtxtReadDoc(); test_ret += test_xmlCtxtReadFile(); test_ret += test_xmlCtxtReadMemory(); @@ -15364,7 +15705,10 @@ test_ret += test_xmlCtxtSetOptions(); test_ret += test_xmlCtxtSetPrivate(); test_ret += test_xmlCtxtSetResourceLoader(); + test_ret += test_xmlCtxtSetSaxHandler(); test_ret += test_xmlCtxtUseOptions(); + test_ret += test_xmlCtxtValidateDocument(); + test_ret += test_xmlCtxtValidateDtd(); test_ret += test_xmlGetExternalEntityLoader(); test_ret += test_xmlHasFeature(); test_ret += test_xmlIOParseDTD(); @@ -15427,7 +15771,6 @@ test_ret += test_xmlThrDefKeepBlanksDefaultValue(); test_ret += test_xmlThrDefLineNumbersDefaultValue(); test_ret += test_xmlThrDefLoadExtDtdDefaultValue(); - test_ret += test_xmlThrDefParserDebugEntities(); test_ret += test_xmlThrDefPedanticParserDefaultValue(); test_ret += test_xmlThrDefSubstituteEntitiesDefaultValue(); @@ -15437,219 +15780,6 @@ } static int -test_inputPop(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = inputPop(ctxt); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in inputPop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_inputPush(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlParserInputPtr value; /* the parser input */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - value = gen_xmlParserInputPtr(n_value, 1); - - ret_val = inputPush(ctxt, value); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlParserInputPtr(n_value, value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in inputPush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_namePop(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = namePop(ctxt); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in namePop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_namePush(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - const xmlChar * value; /* the element name */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - - ret_val = namePush(ctxt, value); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_value, value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in namePush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_nodePop(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = nodePop(ctxt); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in nodePop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_nodePush(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlNodePtr value; /* the element node */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - value = gen_xmlNodePtr(n_value, 1); - - ret_val = nodePush(ctxt, value); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_value, value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in nodePush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int test_xmlCheckLanguageID(void) { int test_ret = 0; @@ -15956,6 +16086,77 @@ static int +test_xmlCtxtPopInput(void) { + int test_ret = 0; + + int mem_base; + xmlParserInputPtr ret_val; + xmlParserCtxtPtr ctxt; /* an XML parser context */ + int n_ctxt; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + + ret_val = xmlCtxtPopInput(ctxt); + desret_xmlParserInputPtr(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtPopInput", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf("\n"); + } + } + function_tests++; + + return(test_ret); +} + + +static int +test_xmlCtxtPushInput(void) { + int test_ret = 0; + + int mem_base; + int ret_val; + xmlParserCtxtPtr ctxt; /* an XML parser context */ + int n_ctxt; + xmlParserInputPtr value; /* the parser input */ + int n_value; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { + for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); + value = gen_xmlParserInputPtr(n_value, 1); + + ret_val = xmlCtxtPushInput(ctxt, value); + desret_int(ret_val); + call_tests++; + des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); + des_xmlParserInputPtr(n_value, value, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlCtxtPushInput", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_value); + printf("\n"); + } + } + } + function_tests++; + + return(test_ret); +} + + +static int test_xmlCurrentChar(void) { int test_ret = 0; @@ -16708,13 +16909,7 @@ test_parserInternals(void) { int test_ret = 0; - if (quiet == 0) printf("Testing parserInternals : 32 of 79 functions ...\n"); - test_ret += test_inputPop(); - test_ret += test_inputPush(); - test_ret += test_namePop(); - test_ret += test_namePush(); - test_ret += test_nodePop(); - test_ret += test_nodePush(); + if (quiet == 0) printf("Testing parserInternals : 28 of 75 functions ...\n"); test_ret += test_xmlCheckLanguageID(); test_ret += test_xmlCopyChar(); test_ret += test_xmlCopyCharMultiByte(); @@ -16723,6 +16918,8 @@ test_ret += test_xmlCreateMemoryParserCtxt(); test_ret += test_xmlCreateURLParserCtxt(); test_ret += test_xmlCtxtErrMemory(); + test_ret += test_xmlCtxtPopInput(); + test_ret += test_xmlCtxtPushInput(); test_ret += test_xmlCurrentChar(); test_ret += test_xmlIsLetter(); test_ret += test_xmlNewEntityInputStream(); @@ -17261,7 +17458,7 @@ printf("Module pattern: %d errors\n", test_ret); return(test_ret); } -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #define gen_nb_xmlRelaxNGPtr 1 #define gen_xmlRelaxNGPtr(no, nr) NULL @@ -17273,7 +17470,7 @@ test_xmlRelaxNGDump(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) int mem_base; FILE * output; /* the file output */ int n_output; @@ -17312,7 +17509,7 @@ test_xmlRelaxNGDumpTree(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) int mem_base; FILE * output; /* the file output */ int n_output; @@ -17346,21 +17543,21 @@ return(test_ret); } -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #define gen_nb_xmlRelaxNGParserCtxtPtr 1 #define gen_xmlRelaxNGParserCtxtPtr(no, nr) NULL #define des_xmlRelaxNGParserCtxtPtr(no, val, nr) #endif -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1 #define gen_xmlRelaxNGValidityErrorFunc_ptr(no, nr) NULL #define des_xmlRelaxNGValidityErrorFunc_ptr(no, val, nr) #endif -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1 #define gen_xmlRelaxNGValidityWarningFunc_ptr(no, nr) NULL @@ -17372,7 +17569,7 @@ test_xmlRelaxNGGetParserErrors(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */ @@ -17422,7 +17619,7 @@ return(test_ret); } -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #define gen_nb_xmlRelaxNGValidCtxtPtr 1 #define gen_xmlRelaxNGValidCtxtPtr(no, nr) NULL @@ -17434,7 +17631,7 @@ test_xmlRelaxNGGetValidErrors(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */ @@ -17489,7 +17686,7 @@ test_xmlRelaxNGInitTypes(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; @@ -17516,7 +17713,7 @@ test_xmlRelaxNGNewDocParserCtxt(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; xmlRelaxNGParserCtxtPtr ret_val; xmlDocPtr doc; /* a preparsed document tree */ @@ -17550,7 +17747,7 @@ test_xmlRelaxNGNewMemParserCtxt(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; xmlRelaxNGParserCtxtPtr ret_val; const char * buffer; /* a pointer to a char array containing the schemas */ @@ -17594,7 +17791,7 @@ test_xmlRelaxNGNewParserCtxt(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; xmlRelaxNGParserCtxtPtr ret_val; const char * URL; /* the location of the schema */ @@ -17698,7 +17895,7 @@ test_xmlRelaxNGValidateDoc(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */ @@ -17739,7 +17936,7 @@ test_xmlRelaxNGValidateFullElement(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */ @@ -17787,7 +17984,7 @@ test_xmlRelaxNGValidatePopElement(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */ @@ -17835,7 +18032,7 @@ test_xmlRelaxNGValidatePushCData(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */ @@ -17886,7 +18083,7 @@ test_xmlRelaxNGValidatePushElement(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */ @@ -17934,7 +18131,7 @@ test_xmlRelaxParserSetFlag(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */ @@ -22646,7 +22843,7 @@ xmlChar * ret_val; const xmlDoc * doc; /* a document (optional) */ int n_doc; - const xmlNode * list; /* a node list of attribute children (optional) */ + const xmlNode * list; /* a node list of attribute children */ int n_list; int inLine; /* whether entity references are substituted */ int n_inLine; @@ -22692,7 +22889,7 @@ xmlChar * ret_val; xmlDocPtr doc; /* a document (optional) */ int n_doc; - const xmlNode * list; /* a node list of attribute children (optional) */ + const xmlNode * list; /* a node list of attribute children */ int n_list; int inLine; /* whether entity references are substituted */ int n_inLine; @@ -24013,70 +24210,6 @@ static int -test_xmlThrDefBufferAllocScheme(void) { - int test_ret = 0; - - int mem_base; - xmlBufferAllocationScheme ret_val; - xmlBufferAllocationScheme v; /* */ - int n_v; - - for (n_v = 0;n_v < gen_nb_xmlBufferAllocationScheme;n_v++) { - mem_base = xmlMemBlocks(); - v = gen_xmlBufferAllocationScheme(n_v, 0); - - ret_val = xmlThrDefBufferAllocScheme(v); - desret_xmlBufferAllocationScheme(ret_val); - call_tests++; - des_xmlBufferAllocationScheme(n_v, v, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlThrDefBufferAllocScheme", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_v); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlThrDefDefaultBufferSize(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - int v; /* */ - int n_v; - - for (n_v = 0;n_v < gen_nb_int;n_v++) { - mem_base = xmlMemBlocks(); - v = gen_int(n_v, 0); - - ret_val = xmlThrDefDefaultBufferSize(v); - desret_int(ret_val); - call_tests++; - des_int(n_v, v, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlThrDefDefaultBufferSize", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_v); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int test_xmlThrDefDeregisterNodeDefault(void) { int test_ret = 0; @@ -24340,7 +24473,7 @@ test_tree(void) { int test_ret = 0; - if (quiet == 0) printf("Testing tree : 146 of 172 functions ...\n"); + if (quiet == 0) printf("Testing tree : 144 of 170 functions ...\n"); test_ret += test_xmlAddChild(); test_ret += test_xmlAddChildList(); test_ret += test_xmlAddNextSibling(); @@ -24489,8 +24622,6 @@ test_ret += test_xmlStringLenGetNodeList(); test_ret += test_xmlTextConcat(); test_ret += test_xmlTextMerge(); - test_ret += test_xmlThrDefBufferAllocScheme(); - test_ret += test_xmlThrDefDefaultBufferSize(); test_ret += test_xmlThrDefDeregisterNodeDefault(); test_ret += test_xmlThrDefRegisterNodeDefault(); test_ret += test_xmlUnsetNsProp(); @@ -26683,28 +26814,28 @@ #if defined(LIBXML_VALID_ENABLED) int mem_base; int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; + xmlValidCtxtPtr vctxt; /* the validation context */ + int n_vctxt; xmlDocPtr doc; /* a document instance */ int n_doc; - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { + for (n_vctxt = 0;n_vctxt < gen_nb_xmlValidCtxtPtr;n_vctxt++) { for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); + vctxt = gen_xmlValidCtxtPtr(n_vctxt, 0); doc = gen_xmlDocPtr(n_doc, 1); - ret_val = xmlValidateDocument(ctxt, doc); + ret_val = xmlValidateDocument(vctxt, doc); desret_int(ret_val); call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); + des_xmlValidCtxtPtr(n_vctxt, vctxt, 0); des_xmlDocPtr(n_doc, doc, 1); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { printf("Leak of %d blocks found in xmlValidateDocument", xmlMemBlocks() - mem_base); test_ret++; - printf(" %d", n_ctxt); + printf(" %d", n_vctxt); printf(" %d", n_doc); printf("\n"); } @@ -28874,26 +29005,26 @@ int n_out; int len; /* the size in bytes of the array. */ int n_len; - const char * buf; /* an char array */ - int n_buf; + const char * data; /* an char array */ + int n_data; for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { for (n_len = 0;n_len < gen_nb_int;n_len++) { - for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) { + for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) { mem_base = xmlMemBlocks(); out = gen_xmlOutputBufferPtr(n_out, 0); len = gen_int(n_len, 1); - buf = gen_const_char_ptr(n_buf, 2); - if ((buf != NULL) && - (len > xmlStrlen(BAD_CAST buf))) + data = gen_const_char_ptr(n_data, 2); + if ((data != NULL) && + (len > xmlStrlen(BAD_CAST data))) len = 0; - ret_val = xmlOutputBufferWrite(out, len, buf); + ret_val = xmlOutputBufferWrite(out, len, data); desret_int(ret_val); call_tests++; des_xmlOutputBufferPtr(n_out, out, 0); des_int(n_len, len, 1); - des_const_char_ptr(n_buf, buf, 2); + des_const_char_ptr(n_data, data, 2); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { printf("Leak of %d blocks found in xmlOutputBufferWrite", @@ -28901,7 +29032,7 @@ test_ret++; printf(" %d", n_out); printf(" %d", n_len); - printf(" %d", n_buf); + printf(" %d", n_data); printf("\n"); } } @@ -29842,40 +29973,6 @@ return(test_ret); } -#define gen_nb_xmlGenericErrorFunc_ptr 1 -#define gen_xmlGenericErrorFunc_ptr(no, nr) NULL -#define des_xmlGenericErrorFunc_ptr(no, val, nr) - -static int -test_initGenericErrorDefaultFunc(void) { - int test_ret = 0; - - int mem_base; - xmlGenericErrorFunc * handler; /* the handler */ - int n_handler; - - for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) { - mem_base = xmlMemBlocks(); - handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0); - - initGenericErrorDefaultFunc(handler); - call_tests++; - des_xmlGenericErrorFunc_ptr(n_handler, handler, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in initGenericErrorDefaultFunc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_handler); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - #define gen_nb_const_xmlError_ptr 1 #define gen_const_xmlError_ptr(no, nr) NULL #define des_const_xmlError_ptr(no, val, nr) @@ -30171,8 +30268,7 @@ test_xmlerror(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlerror : 7 of 18 functions ...\n"); - test_ret += test_initGenericErrorDefaultFunc(); + if (quiet == 0) printf("Testing xmlerror : 6 of 17 functions ...\n"); test_ret += test_xmlCopyError(); test_ret += test_xmlCtxtGetLastError(); test_ret += test_xmlCtxtResetLastError(); @@ -32818,7 +32914,7 @@ test_xmlTextReaderRelaxNGSetSchema(void) { int test_ret = 0; -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ @@ -32859,7 +32955,7 @@ test_xmlTextReaderRelaxNGValidate(void) { int test_ret = 0; -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ @@ -32900,7 +32996,7 @@ test_xmlTextReaderRelaxNGValidateCtxt(void) { int test_ret = 0; -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_RELAXNG_ENABLED) int mem_base; int ret_val; xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ @@ -33895,7 +33991,7 @@ #if defined(LIBXML_OUTPUT_ENABLED) int mem_base; - int ret_val; + xmlParserErrors ret_val; xmlSaveCtxtPtr ctxt; /* a document saving context */ int n_ctxt; @@ -33904,7 +34000,7 @@ ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); ret_val = xmlSaveFinish(ctxt); - desret_int(ret_val); + desret_xmlParserErrors(ret_val); call_tests++; des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); xmlResetLastError(); @@ -34219,7 +34315,7 @@ test_xmlSchemaDump(void) { int test_ret = 0; -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) +#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_DEBUG_ENABLED) int mem_base; FILE * output; /* the file output */ int n_output; @@ -34953,7 +35049,7 @@ int n_input; xmlCharEncoding enc; /* an optional encoding information */ int n_enc; - xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */ + const xmlSAXHandler * sax; /* a SAX handler for the resulting events */ int n_sax; void * user_data; /* the context to provide to the SAX handler. */ int n_user_data; @@ -34961,13 +35057,13 @@ for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { + for (n_sax = 0;n_sax < gen_nb_const_xmlSAXHandler_ptr;n_sax++) { for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { mem_base = xmlMemBlocks(); ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); input = gen_xmlParserInputBufferPtr(n_input, 1); enc = gen_xmlCharEncoding(n_enc, 2); - sax = gen_xmlSAXHandlerPtr(n_sax, 3); + sax = gen_const_xmlSAXHandler_ptr(n_sax, 3); user_data = gen_userdata(n_user_data, 4); ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data); @@ -34976,7 +35072,7 @@ des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); des_xmlParserInputBufferPtr(n_input, input, 1); des_xmlCharEncoding(n_enc, enc, 2); - des_xmlSAXHandlerPtr(n_sax, sax, 3); + des_const_xmlSAXHandler_ptr(n_sax, sax, 3); des_userdata(n_user_data, user_data, 4); xmlResetLastError(); if (mem_base != xmlMemBlocks()) { @@ -41411,81 +41507,6 @@ static int -test_valuePop(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = valuePop(ctxt); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in valuePop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_valuePush(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */ - int n_ctxt; - xmlXPathObjectPtr value; /* the XPath object */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - value = gen_xmlXPathObjectPtr(n_value, 1); - - ret_val = valuePush(ctxt, value); - desret_int(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlXPathObjectPtr(n_value, value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in valuePush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int test_xmlXPathAddValues(void) { int test_ret = 0; @@ -45318,6 +45339,81 @@ static int +test_xmlXPathValuePop(void) { + int test_ret = 0; + +#if defined(LIBXML_XPATH_ENABLED) + int mem_base; + xmlXPathObjectPtr ret_val; + xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */ + int n_ctxt; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); + + ret_val = xmlXPathValuePop(ctxt); + desret_xmlXPathObjectPtr(ret_val); + call_tests++; + des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlXPathValuePop", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf("\n"); + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlXPathValuePush(void) { + int test_ret = 0; + +#if defined(LIBXML_XPATH_ENABLED) + int mem_base; + int ret_val; + xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */ + int n_ctxt; + xmlXPathObjectPtr value; /* the XPath object */ + int n_value; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { + for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); + value = gen_xmlXPathObjectPtr(n_value, 1); + + ret_val = xmlXPathValuePush(ctxt, value); + desret_int(ret_val); + call_tests++; + des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); + des_xmlXPathObjectPtr(n_value, value, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlXPathValuePush", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_value); + printf("\n"); + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int test_xmlXPathVariableLookup(void) { int test_ret = 0; @@ -45565,8 +45661,6 @@ int test_ret = 0; if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n"); - test_ret += test_valuePop(); - test_ret += test_valuePush(); test_ret += test_xmlXPathAddValues(); test_ret += test_xmlXPathBooleanFunction(); test_ret += test_xmlXPathCeilingFunction(); @@ -45672,6 +45766,8 @@ test_ret += test_xmlXPathTranslateFunction(); test_ret += test_xmlXPathTrueFunction(); test_ret += test_xmlXPathValueFlipSign(); + test_ret += test_xmlXPathValuePop(); + test_ret += test_xmlXPathValuePush(); test_ret += test_xmlXPathVariableLookup(); test_ret += test_xmlXPathVariableLookupNS(); test_ret += test_xmlXPathWrapCString();
diff --git a/third_party/libxml/src/testparser.c b/third_party/libxml/src/testparser.c index 9c5174a..85fee9b 100644 --- a/third_party/libxml/src/testparser.c +++ b/third_party/libxml/src/testparser.c
@@ -255,6 +255,39 @@ return err; } + +static int +testNoBlanks(void) { + const xmlChar xml[] = + "<refentry>\n" + " <refsect1>\n" + " <para>\n" + " Run <command>tester --help</command> for more options.\n" + " </para>\n" + " </refsect1>\n" + "</refentry>\n"; + const xmlChar expect[] = + "<?xml version=\"1.0\"?>\n" + "<refentry><refsect1><para>\n" + " Run <command>tester --help</command> for more options.\n" + " </para></refsect1></refentry>\n"; + xmlDocPtr doc; + xmlChar *out; + int size; + int err = 0; + + doc = xmlReadDoc(xml, NULL, NULL, XML_PARSE_NOBLANKS); + xmlDocDumpMemory(doc, &out, &size); + xmlFreeDoc(doc); + + if (!xmlStrEqual(out, expect)) { + fprintf(stderr, "parsing with XML_PARSE_NOBLANKS failed\n"); + err = 1; + } + xmlFree(out); + + return err; +} #endif /* LIBXML_OUTPUT_ENABLED */ #ifdef LIBXML_SAX1_ENABLED @@ -314,7 +347,7 @@ xmlBufferPtr buf; xmlChar *chunk; xmlParserCtxtPtr ctxt; - int err, i; + int err = 0, i; /* * Test the push parser with a built-in encoding handler like ISO-8859-1 @@ -335,7 +368,8 @@ xmlParseChunk(ctxt, (char *) chunk, xmlStrlen(chunk), 0); xmlParseChunk(ctxt, NULL, 0, 1); - err = ctxt->wellFormed ? 0 : 1; + if (!ctxt->wellFormed) + err = 1; xmlFreeDoc(ctxt->myDoc); xmlFreeParserCtxt(ctxt); xmlFree(chunk); @@ -365,14 +399,71 @@ xmlParseChunk(ctxt, (char *) chunk, xmlStrlen(chunk), 1); - err = ctxt->wellFormed ? 0 : 1; + if (!ctxt->wellFormed) + err = 1; xmlFreeDoc(ctxt->myDoc); xmlFreeParserCtxt(ctxt); xmlFree(chunk); return err; } -#endif + +static int +testPushCDataEnd(void) { + int err = 0; + int k; + + for (k = 0; k < 2; k++) { + xmlBufferPtr buf; + xmlChar *chunk; + xmlParserCtxtPtr ctxt; + int i; + + ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL); + xmlCtxtSetOptions(ctxt, XML_PARSE_NOERROR); + + /* + * Push parse text data with ']]>' split across chunks. + */ + buf = xmlBufferCreate(); + xmlBufferCCat(buf, "<doc>"); + + /* + * Also test xmlParseCharDataCopmlex + */ + if (k == 0) + xmlBufferCCat(buf, "x"); + else + xmlBufferCCat(buf, "\xC3\xA4"); + + /* + * Create enough data to trigger a "characters" SAX callback. + * (XML_PARSER_BIG_BUFFER_SIZE = 300) + */ + for (i = 0; i < 2000; i++) + xmlBufferCCat(buf, "x"); + + xmlBufferCCat(buf, "]"); + chunk = xmlBufferDetach(buf); + xmlBufferFree(buf); + + xmlParseChunk(ctxt, (char *) chunk, xmlStrlen(chunk), 0); + xmlParseChunk(ctxt, "]>xxx</doc>", 11, 1); + + if (ctxt->errNo != XML_ERR_MISPLACED_CDATA_END) { + fprintf(stderr, "xmlParseChunk failed to detect CData end: %d\n", + ctxt->errNo); + err = 1; + } + + xmlFree(chunk); + xmlFreeDoc(ctxt->myDoc); + xmlFreeParserCtxt(ctxt); + } + + return err; +} +#endif /* PUSH */ #ifdef LIBXML_HTML_ENABLED static int @@ -416,7 +507,7 @@ err = 1; } - node = xmlDocGetRootElement(doc)->children->children->children; + node = xmlDocGetRootElement(doc)->children->children; if (!xmlStrEqual(node->content, BAD_CAST "-\xC3\xA4-")) { fprintf(stderr, "testHtmlPushWithEncoding failed\n"); err = 1; @@ -497,6 +588,76 @@ return err; } +static int +testReaderNode(xmlTextReader *reader) { + xmlChar *string; + int type; + int err = 0; + + type = xmlTextReaderNodeType(reader); + string = xmlTextReaderReadString(reader); + + if (type == XML_READER_TYPE_ELEMENT) { + xmlNodePtr node = xmlTextReaderCurrentNode(reader); + + if ((node->children == NULL) != (string == NULL)) + err = 1; + } else if (type == XML_READER_TYPE_TEXT || + type == XML_READER_TYPE_CDATA || + type == XML_READER_TYPE_WHITESPACE || + type == XML_READER_TYPE_SIGNIFICANT_WHITESPACE) { + if (string == NULL) + err = 1; + } else { + if (string != NULL) + err = 1; + } + + if (err) + fprintf(stderr, "xmlTextReaderReadString failed for %d\n", type); + + xmlFree(string); + + return err; +} + +static int +testReader(void) { + xmlTextReader *reader; + const xmlChar *xml = BAD_CAST + "<d>\n" + " x<e a='v'>y</e><f>z</f>\n" + " <![CDATA[cdata]]>\n" + " <!-- comment -->\n" + " <?pi content?>\n" + " <empty/>\n" + "</d>"; + int err = 0; + + reader = xmlReaderForDoc(xml, NULL, NULL, 0); + + while (xmlTextReaderRead(reader) > 0) { + if (testReaderNode(reader) > 0) { + err = 1; + break; + } + + if (xmlTextReaderMoveToFirstAttribute(reader) > 0) { + do { + if (testReaderNode(reader) > 0) { + err = 1; + break; + } + } while (xmlTextReaderMoveToNextAttribute(reader) > 0); + + xmlTextReaderMoveToElement(reader); + } + } + + xmlFreeTextReader(reader); + return err; +} + #ifdef LIBXML_XINCLUDE_ENABLED typedef struct { char *message; @@ -749,11 +910,163 @@ return err; } +#if defined(_WIN32) || defined(__CYGWIN__) +static int +testWindowsUri(void) { + const char *url = "c:/a%20b/file.txt"; + xmlURIPtr uri; + xmlChar *res; + int err = 0; + int i; + + static const xmlRelativeUriTest tests[] = { + { + "c:/a%20b/file.txt", + "base.xml", + "c:/a b/file.txt" + }, { + "file:///c:/a%20b/file.txt", + "base.xml", + "file:///c:/a%20b/file.txt" + }, { + "Z:/a%20b/file.txt", + "http://example.com/", + "Z:/a b/file.txt" + }, { + "a%20b/b1/c1", + "C:/a/b2/c2", + "C:/a/b2/a b/b1/c1" + }, { + "a%20b/b1/c1", + "\\a\\b2\\c2", + "/a/b2/a b/b1/c1" + }, { + "a%20b/b1/c1", + "\\\\?\\a\\b2\\c2", + "//?/a/b2/a b/b1/c1" + }, { + "a%20b/b1/c1", + "\\\\\\\\server\\b2\\c2", + "//server/b2/a b/b1/c1" + } + }; + + uri = xmlParseURI(url); + if (uri == NULL) { + fprintf(stderr, "xmlParseURI failed\n"); + err = 1; + } else { + if (uri->scheme != NULL) { + fprintf(stderr, "invalid scheme: %s\n", uri->scheme); + err = 1; + } + if (uri->path == NULL || strcmp(uri->path, "c:/a b/file.txt") != 0) { + fprintf(stderr, "invalid path: %s\n", uri->path); + err = 1; + } + + xmlFreeURI(uri); + } + + for (i = 0; (size_t) i < sizeof(tests) / sizeof(tests[0]); i++) { + const xmlRelativeUriTest *test = tests + i; + + res = xmlBuildURI(BAD_CAST test->uri, BAD_CAST test->base); + if (res == NULL || !xmlStrEqual(res, BAD_CAST test->result)) { + fprintf(stderr, "xmlBuildURI failed uri=%s base=%s " + "result=%s expected=%s\n", test->uri, test->base, + res, test->result); + err = 1; + } + xmlFree(res); + } + + return err; +} +#endif /* WIN32 */ + +#if defined(LIBXML_ICONV_ENABLED) || defined(LIBXML_ICU_ENABLED) +static int +testTruncatedMultiByte(void) { + const char xml[] = + "<?xml version=\"1.0\" encoding=\"EUC-JP\"?>\n" + "<doc/>\xC3"; +#ifdef LIBXML_HTML_ENABLED + const char html[] = + "<meta charset=\"EUC-JP\">\n" + "<div/>\xC3"; +#endif + xmlDocPtr doc; + const xmlError *error; + int err = 0; + + xmlResetLastError(); + doc = xmlReadDoc(BAD_CAST xml, NULL, NULL, XML_PARSE_NOERROR); + error = xmlGetLastError(); + if (error == NULL || error->code != XML_ERR_INVALID_ENCODING) { + fprintf(stderr, "xml, pull: expected XML_ERR_INVALID_ENCODING\n"); + err = 1; + } + xmlFreeDoc(doc); + +#ifdef LIBXML_HTML_ENABLED + xmlResetLastError(); + doc = htmlReadDoc(BAD_CAST html, NULL, NULL, XML_PARSE_NOERROR); + error = xmlGetLastError(); + if (error == NULL || error->code != XML_ERR_INVALID_ENCODING) { + fprintf(stderr, "html, pull: expected XML_ERR_INVALID_ENCODING\n"); + err = 1; + } + xmlFreeDoc(doc); +#endif /* LIBXML_HTML_ENABLED */ + +#ifdef LIBXML_PUSH_ENABLED + { + xmlParserCtxtPtr ctxt; + + ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL); + xmlCtxtSetOptions(ctxt, XML_PARSE_NOERROR); + + xmlParseChunk(ctxt, xml, sizeof(xml) - 1, 0); + xmlParseChunk(ctxt, "", 0, 1); + + if (ctxt->errNo != XML_ERR_INVALID_ENCODING) { + fprintf(stderr, "xml, push: expected XML_ERR_INVALID_ENCODING\n"); + err = 1; + } + + xmlFreeDoc(ctxt->myDoc); + xmlFreeParserCtxt(ctxt); + +#ifdef LIBXML_HTML_ENABLED + ctxt = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL, + XML_CHAR_ENCODING_NONE); + xmlCtxtSetOptions(ctxt, XML_PARSE_NOERROR); + + htmlParseChunk(ctxt, html, sizeof(html) - 1, 0); + htmlParseChunk(ctxt, "", 0, 1); + + if (ctxt->errNo != XML_ERR_INVALID_ENCODING) { + fprintf(stderr, "html, push: expected XML_ERR_INVALID_ENCODING\n"); + err = 1; + } + + xmlFreeDoc(ctxt->myDoc); + htmlFreeParserCtxt(ctxt); +#endif /* LIBXML_HTML_ENABLED */ + } +#endif /* LIBXML_PUSH_ENABLED */ + + return err; +} +#endif /* iconv || icu */ + static int charEncConvImplError; -static int -rot13Convert(unsigned char *out, int *outlen, - const unsigned char *in, int *inlen, void *vctxt) { +static xmlCharEncError +rot13Convert(void *vctxt, unsigned char *out, int *outlen, + const unsigned char *in, int *inlen, + int flush ATTRIBUTE_UNUSED) { int *ctxt = vctxt; int inSize = *inlen; int outSize = *outlen; @@ -783,27 +1096,23 @@ xmlFree(vctxt); } -static int +static xmlParserErrors rot13ConvImpl(void *vctxt ATTRIBUTE_UNUSED, const char *name, - xmlCharEncConverter *conv) { + xmlCharEncFlags flags, xmlCharEncodingHandler **out) { int *inputCtxt; - if (strcmp(name, "rot13") != 0) { - fprintf(stderr, "rot13ConvImpl received wrong name\n"); - charEncConvImplError = 1; + if (strcmp(name, "rot13") != 0) + return xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out); + if (flags & XML_ENC_OUTPUT) return XML_ERR_UNSUPPORTED_ENCODING; - } - conv->input = rot13Convert; - conv->output = rot13Convert; - conv->ctxtDtor = rot13ConvCtxtDtor; - inputCtxt = xmlMalloc(sizeof(*inputCtxt)); *inputCtxt = 13; - conv->inputCtxt = inputCtxt; - return XML_ERR_OK; + return xmlCharEncNewCustomHandler(name, rot13Convert, NULL, + rot13ConvCtxtDtor, inputCtxt, NULL, + out); } static int @@ -847,6 +1156,7 @@ #endif #ifdef LIBXML_OUTPUT_ENABLED err |= testCtxtParseContent(); + err |= testNoBlanks(); #endif #ifdef LIBXML_SAX1_ENABLED err |= testBalancedChunk(); @@ -854,6 +1164,7 @@ #ifdef LIBXML_PUSH_ENABLED err |= testHugePush(); err |= testHugeEncodedChunk(); + err |= testPushCDataEnd(); #endif #ifdef LIBXML_HTML_ENABLED err |= testHtmlIds(); @@ -864,6 +1175,7 @@ #ifdef LIBXML_READER_ENABLED err |= testReaderEncoding(); err |= testReaderContent(); + err |= testReader(); #ifdef LIBXML_XINCLUDE_ENABLED err |= testReaderXIncludeError(); #endif @@ -872,6 +1184,12 @@ err |= testWriterClose(); #endif err |= testBuildRelativeUri(); +#if defined(_WIN32) || defined(__CYGWIN__) + err |= testWindowsUri(); +#endif +#if defined(LIBXML_ICONV_ENABLED) || defined(LIBXML_ICU_ENABLED) + err |= testTruncatedMultiByte(); +#endif err |= testCharEncConvImpl(); return err;
diff --git a/third_party/libxml/src/threads.c b/third_party/libxml/src/threads.c index 4a08756..b36b31f 100644 --- a/third_party/libxml/src/threads.c +++ b/third_party/libxml/src/threads.c
@@ -19,9 +19,11 @@ #ifdef LIBXML_CATALOG_ENABLED #include <libxml/catalog.h> #endif +#ifdef LIBXML_RELAXNG_ENABLED +#include <libxml/relaxng.h> +#endif #ifdef LIBXML_SCHEMAS_ENABLED #include <libxml/xmlschemastypes.h> -#include <libxml/relaxng.h> #endif #if defined(SOLARIS) @@ -159,6 +161,12 @@ #endif } +/** + * xmlInitRMutex: + * @tok: mutex + * + * Initialize the mutex. + */ void xmlInitRMutex(xmlRMutexPtr tok) { (void) tok; @@ -195,6 +203,12 @@ return (tok); } +/** + * xmlCleanupRMutex: + * @tok: mutex + * + * Cleanup the mutex. + */ void xmlCleanupRMutex(xmlRMutexPtr tok) { (void) tok; @@ -288,35 +302,6 @@ ************************************************************************/ /** - * xmlGetThreadId: - * - * DEPRECATED: Internal function, do not use. - * - * xmlGetThreadId() find the current thread ID number - * Note that this is likely to be broken on some platforms using pthreads - * as the specification doesn't mandate pthread_t to be an integer type - * - * Returns the current thread ID number - */ -int -xmlGetThreadId(void) -{ -#ifdef HAVE_POSIX_THREADS - pthread_t id; - int ret; - - id = pthread_self(); - /* horrible but preserves compat, see warning above */ - memcpy(&ret, &id, sizeof(ret)); - return (ret); -#elif defined HAVE_WIN32_THREADS - return GetCurrentThreadId(); -#else - return ((int) 0); -#endif -} - -/** * xmlLockLibrary: * * xmlLockLibrary() is used to take out a re-entrant lock on the libxml2 @@ -482,6 +467,8 @@ #endif #ifdef LIBXML_SCHEMAS_ENABLED xmlSchemaCleanupTypes(); +#endif +#ifdef LIBXML_RELAXNG_ENABLED xmlRelaxNGCleanupTypes(); #endif
diff --git a/third_party/libxml/src/tools/genUnicode.py b/third_party/libxml/src/tools/genUnicode.py index cf50bfef..cfcdc88 100755 --- a/third_party/libxml/src/tools/genUnicode.py +++ b/third_party/libxml/src/tools/genUnicode.py
@@ -192,12 +192,6 @@ # Generate the resulting files # try: - header = open("include/libxml/xmlunicode.h", "w") -except: - print("Failed to open include/libxml/xmlunicode.h") - sys.exit(1) - -try: output = open("xmlunicode.c", "w") except: print("Failed to open xmlunicode.c") @@ -205,34 +199,6 @@ date = time.asctime(time.localtime(time.time())) -header.write( -"""/* - * Summary: Unicode character APIs - * Description: API for the Unicode character APIs - * - * This file is automatically generated from the - * UCS description files of the Unicode Character Database - * %s - * using the genUnicode.py Python script. - * - * Generation date: %s - * Sources: %s - * Author: Daniel Veillard - */ - -#ifndef __XML_UNICODE_H__ -#define __XML_UNICODE_H__ - -#include <libxml/xmlversion.h> - -#ifdef LIBXML_UNICODE_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -""" % (webpage, date, sources)); - output.write( """/* * xmlunicode.c: this module implements the Unicode character APIs @@ -250,13 +216,14 @@ #define IN_LIBXML #include "libxml.h" -#ifdef LIBXML_UNICODE_ENABLED +#ifdef LIBXML_REGEXP_ENABLED #include <string.h> #include <libxml/xmlversion.h> -#include <libxml/xmlunicode.h> #include <libxml/chvalid.h> +#include "private/unicode.h" + typedef int (xmlIntFunc)(int); /* just to keep one's mind untwisted */ typedef struct { @@ -272,29 +239,8 @@ static xmlIntFunc *xmlUnicodeLookup(const xmlUnicodeNameTable *tptr, const char *tname); -static const xmlUnicodeRange xmlUnicodeBlocks[] = { """ % (webpage, date, sources)); -flag = 0 -for block in bkeys: - name = block.replace('-', '') - if flag: - output.write(',\n') - else: - flag = 1 - output.write(' {"%s", xmlUCSIs%s}' % (block, name)) -output.write('};\n\n') - -output.write('static const xmlUnicodeRange xmlUnicodeCats[] = {\n') -flag = 0; -for name in ckeys: - if flag: - output.write(',\n') - else: - flag = 1 - output.write(' {"%s", xmlUCSIsCat%s}' % (name, name)) -output.write('};\n\n') - # # For any categories with more than minTableSize ranges we generate # a range table suitable for xmlCharInRange @@ -335,10 +281,7 @@ output.write( -"""static const xmlUnicodeNameTable xmlUnicodeBlockTbl = {xmlUnicodeBlocks, %s}; -static const xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, %s}; - -/** +"""/** * xmlUnicodeLookup: * @tptr: pointer to the name table * @name: name to be found @@ -359,7 +302,8 @@ sptr = tptr->table; while (low <= high) { mid = (low + high) / 2; - if ((cmp=strcmp(tname, sptr[mid].rangename)) == 0) + cmp = strcmp(tname, sptr[mid].rangename); + if (cmp == 0) return (sptr[mid].func); if (cmp < 0) high = mid - 1; @@ -369,16 +313,15 @@ return (NULL); } -""" % (len(BlockNames), len(Categories)) ) +""") for block in bkeys: name = block.replace('-', '') - header.write("XML_DEPRECATED\nXMLPUBFUN int xmlUCSIs%s\t(int code);\n" % name) output.write("/**\n * xmlUCSIs%s:\n * @code: UCS code point\n" % (name)) output.write(" *\n * Check whether the character is part of %s UCS Block\n"% (block)) output.write(" *\n * Returns 1 if true 0 otherwise\n */\n"); - output.write("int\nxmlUCSIs%s(int code) {\n return(" % name) + output.write("static int\nxmlUCSIs%s(int code) {\n return(" % name) flag = 0 for (start, end) in BlockNames[block]: if flag: @@ -388,32 +331,8 @@ output.write("((code >= %s) && (code <= %s))" % (start, end)) output.write(");\n}\n\n") -header.write("\nXMLPUBFUN int xmlUCSIsBlock\t(int code, const char *block);\n\n") -output.write( -"""/** - * xmlUCSIsBlock: - * @code: UCS code point - * @block: UCS block name - * - * Check whether the character is part of the UCS Block - * - * Returns 1 if true, 0 if false and -1 on unknown block - */ -int -xmlUCSIsBlock(int code, const char *block) { - xmlIntFunc *func; - - func = xmlUnicodeLookup(&xmlUnicodeBlockTbl, block); - if (func == NULL) - return (-1); - return (func(code)); -} - -""") - for name in ckeys: ranges = Categories[name] - header.write("XML_DEPRECATED\nXMLPUBFUN int xmlUCSIsCat%s\t(int code);\n" % name) output.write("/**\n * xmlUCSIsCat%s:\n * @code: UCS code point\n" % (name)) output.write(" *\n * Check whether the character is part of %s UCS Category\n"% (name)) @@ -438,9 +357,54 @@ hex(begin), hex(end))) output.write(");\n}\n\n") -header.write("\nXMLPUBFUN int xmlUCSIsCat\t(int code, const char *cat);\n") output.write( -"""/** +"""static const xmlUnicodeRange xmlUnicodeBlocks[] = {""") + +flag = 0 +for block in bkeys: + name = block.replace('-', '') + if flag: + output.write(',\n') + else: + flag = 1 + output.write(' {"%s", xmlUCSIs%s}' % (block, name)) +output.write('};\n\n') + +output.write('static const xmlUnicodeRange xmlUnicodeCats[] = {\n') +flag = 0; +for name in ckeys: + if flag: + output.write(',\n') + else: + flag = 1 + output.write(' {"%s", xmlUCSIsCat%s}' % (name, name)) + +output.write( +"""}; + +static const xmlUnicodeNameTable xmlUnicodeBlockTbl = {xmlUnicodeBlocks, %s}; +static const xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, %s}; + +/** + * xmlUCSIsBlock: + * @code: UCS code point + * @block: UCS block name + * + * Check whether the character is part of the UCS Block + * + * Returns 1 if true, 0 if false and -1 on unknown block + */ +int +xmlUCSIsBlock(int code, const char *block) { + xmlIntFunc *func; + + func = xmlUnicodeLookup(&xmlUnicodeBlockTbl, block); + if (func == NULL) + return (-1); + return (func(code)); +} + +/** * xmlUCSIsCat: * @code: UCS code point * @cat: UCS Category name @@ -459,18 +423,7 @@ return (func(code)); } -#endif /* LIBXML_UNICODE_ENABLED */ -""") +#endif /* LIBXML_REGEXP_ENABLED */ +""" % (len(BlockNames), len(Categories))) -header.write(""" -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_UNICODE_ENABLED */ - -#endif /* __XML_UNICODE_H__ */ -"""); - -header.close() output.close()
diff --git a/third_party/libxml/src/tools/gentest.py b/third_party/libxml/src/tools/gentest.py index fcdf206..0d869fa 100755 --- a/third_party/libxml/src/tools/gentest.py +++ b/third_party/libxml/src/tools/gentest.py
@@ -30,7 +30,7 @@ "HTMLparser": "LIBXML_HTML_ENABLED", "catalog": "LIBXML_CATALOG_ENABLED", "xmlreader": "LIBXML_READER_ENABLED", - "relaxng": "LIBXML_SCHEMAS_ENABLED", + "relaxng": "LIBXML_RELAXNG_ENABLED", "schemasInternals": "LIBXML_SCHEMAS_ENABLED", "xmlschemas": "LIBXML_SCHEMAS_ENABLED", "xmlschemastypes": "LIBXML_SCHEMAS_ENABLED", @@ -143,9 +143,6 @@ "xmlParseXMLDecl", "xmlParseTextDecl", "xmlParseMisc", "xmlParseExternalSubset", "xmlParserHandlePEReference", "xmlSkipBlankChars", -# Legacy -"xmlCleanupPredefinedEntities", "xmlInitializePredefinedEntities", -"xmlSetFeature", "xmlGetFeature", "xmlGetFeaturesList", # Shouldn't free result "xmlCtxtGetDict", ] @@ -526,6 +523,8 @@ # if (name == None) or ((name not in argtypes) and (name not in rettypes)): continue; + if name == 'xmlCharEncFlags': + continue define = 0 if (name in argtypes) and is_known_param_type(name) == 0:
diff --git a/third_party/libxml/src/tree.c b/third_party/libxml/src/tree.c index 1b79b99..7454b07e 100644 --- a/third_party/libxml/src/tree.c +++ b/third_party/libxml/src/tree.c
@@ -38,13 +38,11 @@ #ifdef LIBXML_HTML_ENABLED #include <libxml/HTMLtree.h> #endif -#ifdef LIBXML_DEBUG_ENABLED -#include <libxml/debugXML.h> -#endif #include "private/buf.h" #include "private/entities.h" #include "private/error.h" +#include "private/memory.h" #include "private/tree.h" /* @@ -3305,7 +3303,7 @@ * * If @cur is an attribute node, it is appended to the attributes of * @parent. If the attribute list contains an attribute with a name - * matching @elem, the old attribute is destroyed. + * matching @cur, the old attribute is destroyed. * * General notes: * @@ -3332,7 +3330,7 @@ * * Moving DTDs between documents isn't supported. * - * Returns @elem or a sibling if @elem was merged. Returns NULL + * Returns @cur or a sibling if @cur was merged. Returns NULL * if arguments are invalid or a memory allocation failed. */ xmlNodePtr @@ -4679,7 +4677,7 @@ (node->type == XML_PI_NODE)) { if (node->line == 65535) { if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL)) - result = (long) (ptrdiff_t) node->psvi; + result = XML_PTR_TO_INT(node->psvi); else if ((node->type == XML_ELEMENT_NODE) && (node->children != NULL)) result = xmlGetLineNoInternal(node->children, depth + 1); @@ -4689,7 +4687,7 @@ result = xmlGetLineNoInternal(node->prev, depth + 1); } if ((result == -1) || (result == 65535)) - result = (long) node->line; + result = node->line; } else if ((node->prev != NULL) && ((node->prev->type == XML_ELEMENT_NODE) || (node->prev->type == XML_TEXT_NODE) || @@ -4732,8 +4730,8 @@ xmlGetNodePath(const xmlNode *node) { const xmlNode *cur, *tmp, *next; - xmlChar *buffer = NULL, *temp; - size_t buf_len; + xmlChar *buffer = NULL; + size_t buf_len, len; xmlChar *buf; const char *sep; const char *name; @@ -4930,23 +4928,36 @@ /* * Make sure there is enough room */ - if (xmlStrlen(buffer) + sizeof(nametemp) + 20 > buf_len) { - buf_len = - 2 * buf_len + xmlStrlen(buffer) + sizeof(nametemp) + 20; - temp = (xmlChar *) xmlRealloc(buffer, buf_len); + len = strlen((const char *) buffer); + if (buf_len - len < sizeof(nametemp) + 20) { + xmlChar *temp; + int newSize; + + if ((buf_len > SIZE_MAX / 2) || + (2 * buf_len > SIZE_MAX - len - sizeof(nametemp) - 20)) { + xmlFree(buf); + xmlFree(buffer); + return (NULL); + } + newSize = 2 * buf_len + len + sizeof(nametemp) + 20; + + temp = xmlRealloc(buffer, newSize); if (temp == NULL) { xmlFree(buf); xmlFree(buffer); return (NULL); } buffer = temp; - temp = (xmlChar *) xmlRealloc(buf, buf_len); + + temp = xmlRealloc(buf, newSize); if (temp == NULL) { xmlFree(buf); xmlFree(buffer); return (NULL); } buf = temp; + + buf_len = newSize; } if (occur == 0) snprintf((char *) buf, buf_len, "%s%s%s", @@ -5779,15 +5790,21 @@ * @first: the first text node * @second: the second text node being merged * - * Merge the second text node into the first. The second node is - * unlinked and freed. + * Merge the second text node into the first. If @first is NULL, + * @second is returned. Otherwise, the second node is unlinked and + * freed. * * Returns the first text node augmented or NULL in case of error. */ xmlNodePtr xmlTextMerge(xmlNodePtr first, xmlNodePtr second) { - if ((first == NULL) || (first->type != XML_TEXT_NODE) || - (second == NULL) || (second->type != XML_TEXT_NODE) || + if (first == NULL) + return(second); + if (second == NULL) + return(first); + + if ((first->type != XML_TEXT_NODE) || + (second->type != XML_TEXT_NODE) || (first == second) || (first->name != second->name)) return(NULL); @@ -5843,16 +5860,26 @@ if (i >= nbns) { if (nbns >= maxns) { xmlNsPtr *tmp; + int newSize; - maxns = maxns ? maxns * 2 : 10; - tmp = (xmlNsPtr *) xmlRealloc(namespaces, - (maxns + 1) * - sizeof(xmlNsPtr)); + newSize = xmlGrowCapacity(maxns, sizeof(tmp[0]), + 10, XML_MAX_ITEMS); + if (newSize < 0) { + xmlFree(namespaces); + return(-1); + } +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + if (newSize < 2) + newSize = 2; +#endif + tmp = xmlRealloc(namespaces, + (newSize + 1) * sizeof(tmp[0])); if (tmp == NULL) { xmlFree(namespaces); return(-1); } namespaces = tmp; + maxns = newSize; } namespaces[nbns++] = cur; namespaces[nbns] = NULL; @@ -6273,6 +6300,24 @@ xmlNsPtr newNs; } xmlNsCache; +static int +xmlGrowNsCache(xmlNsCache **cache, int *capacity) { + xmlNsCache *tmp; + int newSize; + + newSize = xmlGrowCapacity(*capacity, sizeof(tmp[0]), + 10, XML_MAX_ITEMS); + if (newSize < 0) + return(-1); + tmp = xmlRealloc(*cache, newSize * sizeof(tmp[0])); + if (tmp == NULL) + return(-1); + *cache = tmp; + *capacity = newSize; + + return(0); +} + /** * xmlReconciliateNs: * @doc: the document @@ -6323,19 +6368,10 @@ /* * check if we need to grow the cache buffers. */ - if (sizeCache <= nbCache) { - xmlNsCache *tmp; - size_t newSize = sizeCache ? sizeCache * 2 : 10; - - tmp = xmlRealloc(cache, newSize * sizeof(tmp[0])); - if (tmp == NULL) { - ret = -1; - } else { - cache = tmp; - sizeCache = newSize; - } - } - if (nbCache < sizeCache) { + if ((sizeCache <= nbCache) && + (xmlGrowNsCache(&cache, &sizeCache) < 0)) { + ret = -1; + } else { cache[nbCache].newNs = n; cache[nbCache++].oldNs = node->ns; } @@ -6367,21 +6403,10 @@ /* * check if we need to grow the cache buffers. */ - if (sizeCache <= nbCache) { - xmlNsCache *tmp; - size_t newSize = sizeCache ? - sizeCache * 2 : 10; - - tmp = xmlRealloc(cache, - newSize * sizeof(tmp[0])); - if (tmp == NULL) { - ret = -1; - } else { - cache = tmp; - sizeCache = newSize; - } - } - if (nbCache < sizeCache) { + if ((sizeCache <= nbCache) && + (xmlGrowNsCache(&cache, &sizeCache) < 0)) { + ret = -1; + } else { cache[nbCache].newNs = n; cache[nbCache++].oldNs = attr->ns; } @@ -7388,9 +7413,11 @@ { if (*number >= *size) { xmlNsPtr *tmp; - size_t newSize; + int newSize; - newSize = *size ? *size * 2 : 3; + newSize = xmlGrowCapacity(*size, 2 * sizeof(tmp[0]), 3, XML_MAX_ITEMS); + if (newSize < 0) + return(-1); tmp = xmlRealloc(*list, newSize * 2 * sizeof(tmp[0])); if (tmp == NULL) return(-1); @@ -8605,8 +8632,7 @@ /* * Attributes (xmlAttr). */ - /* Use xmlRealloc to avoid -Warray-bounds warning */ - clone = (xmlNodePtr) xmlRealloc(NULL, sizeof(xmlAttr)); + clone = xmlMalloc(sizeof(xmlAttr)); if (clone == NULL) goto internal_error; memset(clone, 0, sizeof(xmlAttr));
diff --git a/third_party/libxml/src/uri.c b/third_party/libxml/src/uri.c index 94c831fb..a94acb4 100644 --- a/third_party/libxml/src/uri.c +++ b/third_party/libxml/src/uri.c
@@ -19,6 +19,7 @@ #include <libxml/xmlerror.h> #include "private/error.h" +#include "private/memory.h" /** * MAX_URI_LENGTH: @@ -231,6 +232,15 @@ if (!ISA_ALPHA(cur)) return(1); cur++; + +#if defined(_WIN32) || defined(__CYGWIN__) + /* + * Don't treat Windows drive letters as scheme. + */ + if (*cur == ':') + return(1); +#endif + while (ISA_ALPHA(cur) || ISA_DIGIT(cur) || (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++; if (uri != NULL) { @@ -582,11 +592,21 @@ const char *cur; cur = *str; - if (!ISA_PCHAR(uri, cur)) { + if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) { if (empty) return(0); return(1); } + NEXT(cur); + +#if defined(_WIN32) || defined(__CYGWIN__) + /* + * Allow Windows drive letters. + */ + if ((forbid == ':') && (*cur == forbid)) + NEXT(cur); +#endif + while (ISA_PCHAR(uri, cur) && (*cur != forbid)) NEXT(cur); *str = cur; @@ -1100,15 +1120,15 @@ static xmlChar * xmlSaveUriRealloc(xmlChar *ret, int *max) { xmlChar *temp; - int tmp; + int newSize; - if (*max > MAX_URI_LENGTH) + newSize = xmlGrowCapacity(*max, 1, 80, MAX_URI_LENGTH); + if (newSize < 0) return(NULL); - tmp = *max * 2; - temp = (xmlChar *) xmlRealloc(ret, (tmp + 1)); + temp = xmlRealloc(ret, newSize + 1); if (temp == NULL) return(NULL); - *max = tmp; + *max = newSize; return(temp); } @@ -1676,7 +1696,6 @@ xmlChar * xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) { xmlChar *ret, ch; - xmlChar *temp; const xmlChar *in; int len, out; @@ -1694,15 +1713,21 @@ out = 0; while(*in != 0) { if (len - out <= 3) { - if (len > INT_MAX / 2) + xmlChar *temp; + int newSize; + + newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS); + if (newSize < 0) { + xmlFree(ret); return(NULL); - temp = xmlRealloc(ret, len * 2); + } + temp = xmlRealloc(ret, newSize); if (temp == NULL) { xmlFree(ret); return(NULL); } ret = temp; - len *= 2; + len = newSize; } ch = *in; @@ -2064,6 +2089,23 @@ return(xmlResolvePath(URI, base, valPtr)); } +#if defined(_WIN32) || defined(__CYGWIN__) + /* + * Resolve paths with a Windows drive letter as filesystem path + * even if base has a scheme. + */ + if ((ref != NULL) && (ref->path != NULL)) { + int c = ref->path[0]; + + if ((((c >= 'A') && (c <= 'Z')) || + ((c >= 'a') && (c <= 'z'))) && + (ref->path[1] == ':')) { + xmlFreeURI(ref); + return(xmlResolvePath(URI, base, valPtr)); + } + } +#endif + ret = xmlParseURISafe((const char *) base, &bas); if (ret < 0) goto done;
diff --git a/third_party/libxml/src/valid.c b/third_party/libxml/src/valid.c index 1dd6018..a99c0137 100644 --- a/third_party/libxml/src/valid.c +++ b/third_party/libxml/src/valid.c
@@ -24,6 +24,7 @@ #include <libxml/xmlsave.h> #include "private/error.h" +#include "private/memory.h" #include "private/parser.h" #include "private/regexp.h" #include "private/save.h" @@ -204,27 +205,23 @@ static int vstateVPush(xmlValidCtxtPtr ctxt, xmlElementPtr elemDecl, xmlNodePtr node) { - if ((ctxt->vstateMax == 0) || (ctxt->vstateTab == NULL)) { - ctxt->vstateMax = 10; - ctxt->vstateTab = (xmlValidState *) xmlMalloc(ctxt->vstateMax * - sizeof(ctxt->vstateTab[0])); - if (ctxt->vstateTab == NULL) { + if (ctxt->vstateNr >= ctxt->vstateMax) { + xmlValidState *tmp; + int newSize; + + newSize = xmlGrowCapacity(ctxt->vstateMax, sizeof(tmp[0]), + 10, XML_MAX_ITEMS); + if (newSize < 0) { xmlVErrMemory(ctxt); return(-1); } - } - - if (ctxt->vstateNr >= ctxt->vstateMax) { - xmlValidState *tmp; - - tmp = (xmlValidState *) xmlRealloc(ctxt->vstateTab, - 2 * ctxt->vstateMax * sizeof(ctxt->vstateTab[0])); + tmp = xmlRealloc(ctxt->vstateTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlVErrMemory(ctxt); return(-1); } - ctxt->vstateMax *= 2; ctxt->vstateTab = tmp; + ctxt->vstateMax = newSize; } ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr]; ctxt->vstateTab[ctxt->vstateNr].elemDecl = elemDecl; @@ -312,29 +309,23 @@ unsigned char state) { int i = ctxt->vstateNr - 1; - if (ctxt->vstateNr > MAX_RECURSE) { - return(-1); - } - if (ctxt->vstateTab == NULL) { - ctxt->vstateMax = 8; - ctxt->vstateTab = (xmlValidState *) xmlMalloc( - ctxt->vstateMax * sizeof(ctxt->vstateTab[0])); - if (ctxt->vstateTab == NULL) { - xmlVErrMemory(ctxt); - return(-1); - } - } if (ctxt->vstateNr >= ctxt->vstateMax) { xmlValidState *tmp; + int newSize; - tmp = (xmlValidState *) xmlRealloc(ctxt->vstateTab, - 2 * ctxt->vstateMax * sizeof(ctxt->vstateTab[0])); + newSize = xmlGrowCapacity(ctxt->vstateMax, sizeof(tmp[0]), + 8, MAX_RECURSE); + if (newSize < 0) { + xmlVErrMemory(ctxt); + return(-1); + } + tmp = xmlRealloc(ctxt->vstateTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlVErrMemory(ctxt); return(-1); } - ctxt->vstateMax *= 2; ctxt->vstateTab = tmp; + ctxt->vstateMax = newSize; ctxt->vstate = &ctxt->vstateTab[0]; } /* @@ -372,27 +363,23 @@ static int nodeVPush(xmlValidCtxtPtr ctxt, xmlNodePtr value) { - if (ctxt->nodeMax <= 0) { - ctxt->nodeMax = 4; - ctxt->nodeTab = - (xmlNodePtr *) xmlMalloc(ctxt->nodeMax * - sizeof(ctxt->nodeTab[0])); - if (ctxt->nodeTab == NULL) { - xmlVErrMemory(ctxt); - ctxt->nodeMax = 0; - return (0); - } - } if (ctxt->nodeNr >= ctxt->nodeMax) { xmlNodePtr *tmp; - tmp = (xmlNodePtr *) xmlRealloc(ctxt->nodeTab, - ctxt->nodeMax * 2 * sizeof(ctxt->nodeTab[0])); + int newSize; + + newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]), + 4, XML_MAX_ITEMS); + if (newSize < 0) { + xmlVErrMemory(ctxt); + return (-1); + } + tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlVErrMemory(ctxt); - return (0); + return (-1); } - ctxt->nodeMax *= 2; ctxt->nodeTab = tmp; + ctxt->nodeMax = newSize; } ctxt->nodeTab[ctxt->nodeNr] = value; ctxt->node = value; @@ -5010,26 +4997,26 @@ return; } switch (cur->type) { - case XML_ELEMENT_NODE: + case XML_ELEMENT_NODE: { + int qnameLen = xmlStrlen(cur->name); + + if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) + qnameLen += xmlStrlen(cur->ns->prefix) + 1; + if (size - len < qnameLen + 10) { + if ((size - len > 4) && (buf[len - 1] != '.')) + strcat(buf, " ..."); + return; + } if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) { - if (size - len < xmlStrlen(cur->ns->prefix) + 10) { - if ((size - len > 4) && (buf[len - 1] != '.')) - strcat(buf, " ..."); - return; - } strcat(buf, (char *) cur->ns->prefix); strcat(buf, ":"); } - if (size - len < xmlStrlen(cur->name) + 10) { - if ((size - len > 4) && (buf[len - 1] != '.')) - strcat(buf, " ..."); - return; - } if (cur->name != NULL) strcat(buf, (char *) cur->name); if (cur->next != NULL) strcat(buf, " "); break; + } case XML_TEXT_NODE: if (xmlIsBlankNode(cur)) break; @@ -5126,7 +5113,10 @@ */ if ((cur->children != NULL) && (cur->children->children != NULL)) { - nodeVPush(ctxt, cur); + if (nodeVPush(ctxt, cur) < 0) { + ret = -1; + goto fail; + } cur = cur->children->children; continue; } @@ -5185,9 +5175,12 @@ /* * Allocate the stack */ +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION ctxt->vstateMax = 8; - ctxt->vstateTab = (xmlValidState *) xmlMalloc( - ctxt->vstateMax * sizeof(ctxt->vstateTab[0])); +#else + ctxt->vstateMax = 1; +#endif + ctxt->vstateTab = xmlMalloc(ctxt->vstateMax * sizeof(ctxt->vstateTab[0])); if (ctxt->vstateTab == NULL) { xmlVErrMemory(ctxt); return(-1); @@ -5230,7 +5223,11 @@ */ if ((cur->children != NULL) && (cur->children->children != NULL)) { - nodeVPush(ctxt, cur); + if (nodeVPush(ctxt, cur) < 0) { + xmlFreeNodeList(repl); + ret = -1; + goto done; + } cur = cur->children->children; continue; } @@ -5238,9 +5235,8 @@ case XML_TEXT_NODE: if (xmlIsBlankNode(cur)) break; - /* no break on purpose */ + /* falls through */ case XML_CDATA_SECTION_NODE: - /* no break on purpose */ case XML_ELEMENT_NODE: /* * Allocate a new node and minimally fills in @@ -5398,7 +5394,10 @@ */ if ((cur->children != NULL) && (cur->children->children != NULL)) { - nodeVPush(ctxt, cur); + if (nodeVPush(ctxt, cur) < 0) { + ret = 0; + goto done; + } cur = cur->children->children; continue; } @@ -5555,12 +5554,6 @@ *extsubset = 1; } } - if (elemDecl == NULL) { - xmlErrValidNode(ctxt, elem, - XML_DTD_UNKNOWN_ELEM, - "No declaration for element %s\n", - elem->name, NULL, NULL); - } return(elemDecl); } @@ -5603,10 +5596,6 @@ ret = 0; break; case XML_ELEMENT_TYPE_EMPTY: - xmlErrValidNode(ctxt, state->node, - XML_DTD_NOT_EMPTY, - "Element %s was declared EMPTY this one has content\n", - state->node->name, NULL, NULL); ret = 0; break; case XML_ELEMENT_TYPE_ANY: @@ -5617,20 +5606,10 @@ if ((elemDecl->content != NULL) && (elemDecl->content->type == XML_ELEMENT_CONTENT_PCDATA)) { - xmlErrValidNode(ctxt, state->node, - XML_DTD_NOT_PCDATA, - "Element %s was declared #PCDATA but contains non text nodes\n", - state->node->name, NULL, NULL); ret = 0; } else { ret = xmlValidateCheckMixed(ctxt, elemDecl->content, qname); - if (ret != 1) { - xmlErrValidNode(ctxt, state->node, - XML_DTD_INVALID_CHILD, - "Element %s is not declared in %s list of possible children\n", - qname, state->node->name, NULL); - } } break; case XML_ELEMENT_TYPE_ELEMENT: @@ -5647,10 +5626,6 @@ return(0); } if (ret < 0) { - xmlErrValidNode(ctxt, state->node, - XML_DTD_CONTENT_MODEL, - "Element %s content does not follow the DTD, Misplaced %s\n", - state->node->name, qname, NULL); ret = 0; } else { ret = 1; @@ -5700,10 +5675,6 @@ ret = 0; break; case XML_ELEMENT_TYPE_EMPTY: - xmlErrValidNode(ctxt, state->node, - XML_DTD_NOT_EMPTY, - "Element %s was declared EMPTY this one has content\n", - state->node->name, NULL, NULL); ret = 0; break; case XML_ELEMENT_TYPE_ANY: @@ -5776,11 +5747,6 @@ if (ret <= 0) { if (ret == XML_REGEXP_OUT_OF_MEMORY) xmlVErrMemory(ctxt); - else - xmlErrValidNode(ctxt, state->node, - XML_DTD_CONTENT_MODEL, - "Element %s content does not follow the DTD, Expecting more children\n", - state->node->name, NULL,NULL); ret = 0; } else { /* @@ -5853,8 +5819,13 @@ * Fetch the declaration */ elemDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset); - if (elemDecl == NULL) + if (elemDecl == NULL) { + xmlErrValidNode(ctxt, elem, + XML_DTD_UNKNOWN_ELEM, + "No declaration for element %s\n", + elem->name, NULL, NULL); return(0); + } /* * If vstateNr is not zero that means continuous validation is @@ -6796,7 +6767,7 @@ /** * xmlValidateDocument: - * @ctxt: the validation context + * @vctxt: the validation context * @doc: a document instance * * DEPRECATED: This function can't report malloc or other failures. @@ -7030,4 +7001,3 @@ return(nb_valid_elements); } #endif /* LIBXML_VALID_ENABLED */ -
diff --git a/third_party/libxml/src/win32/Makefile.bcb b/third_party/libxml/src/win32/Makefile.bcb index b9c3233e..db891e3 100644 --- a/third_party/libxml/src/win32/Makefile.bcb +++ b/third_party/libxml/src/win32/Makefile.bcb
@@ -121,14 +121,12 @@ $(XML_INTDIR)\hash.obj\ $(XML_INTDIR)\HTMLparser.obj\ $(XML_INTDIR)\HTMLtree.obj\ - $(XML_INTDIR)\legacy.obj\ $(XML_INTDIR)\list.obj\ $(XML_INTDIR)\nanohttp.obj\ $(XML_INTDIR)\parser.obj\ $(XML_INTDIR)\parserInternals.obj\ $(XML_INTDIR)\pattern.obj\ $(XML_INTDIR)\relaxng.obj\ - $(XML_INTDIR)\SAX.obj\ $(XML_INTDIR)\SAX2.obj\ $(XML_INTDIR)\schematron.obj\ $(XML_INTDIR)\threads.obj\ @@ -165,14 +163,12 @@ $(XML_INTDIR_A)\hash.obj\ $(XML_INTDIR_A)\HTMLparser.obj\ $(XML_INTDIR_A)\HTMLtree.obj\ - $(XML_INTDIR_A)\legacy.obj\ $(XML_INTDIR_A)\list.obj\ $(XML_INTDIR_A)\nanohttp.obj\ $(XML_INTDIR_A)\parser.obj\ $(XML_INTDIR_A)\parserInternals.obj\ $(XML_INTDIR_A)\pattern.obj\ $(XML_INTDIR_A)\relaxng.obj\ - $(XML_INTDIR_A)\SAX.obj\ $(XML_INTDIR_A)\SAX2.obj\ $(XML_INTDIR_A)\schematron.obj\ $(XML_INTDIR_A)\threads.obj\
diff --git a/third_party/libxml/src/win32/Makefile.msvc b/third_party/libxml/src/win32/Makefile.msvc index 2b2e6ca8..df6e487d 100644 --- a/third_party/libxml/src/win32/Makefile.msvc +++ b/third_party/libxml/src/win32/Makefile.msvc
@@ -115,7 +115,6 @@ $(XML_INTDIR)\hash.obj\ $(XML_INTDIR)\HTMLparser.obj\ $(XML_INTDIR)\HTMLtree.obj\ - $(XML_INTDIR)\legacy.obj\ $(XML_INTDIR)\list.obj\ $(XML_INTDIR)\nanohttp.obj\ $(XML_INTDIR)\parser.obj\ @@ -123,7 +122,6 @@ $(XML_INTDIR)\pattern.obj\ $(XML_INTDIR)\relaxng.obj\ $(XML_INTDIR)\SAX2.obj\ - $(XML_INTDIR)\SAX.obj\ $(XML_INTDIR)\schematron.obj\ $(XML_INTDIR)\threads.obj\ $(XML_INTDIR)\tree.obj\ @@ -159,7 +157,6 @@ $(XML_INTDIR_A)\hash.obj\ $(XML_INTDIR_A)\HTMLparser.obj\ $(XML_INTDIR_A)\HTMLtree.obj\ - $(XML_INTDIR_A)\legacy.obj\ $(XML_INTDIR_A)\list.obj\ $(XML_INTDIR_A)\nanohttp.obj\ $(XML_INTDIR_A)\parser.obj\ @@ -167,7 +164,6 @@ $(XML_INTDIR_A)\pattern.obj\ $(XML_INTDIR_A)\relaxng.obj\ $(XML_INTDIR_A)\SAX2.obj\ - $(XML_INTDIR_A)\SAX.obj\ $(XML_INTDIR_A)\schematron.obj\ $(XML_INTDIR_A)\threads.obj\ $(XML_INTDIR_A)\tree.obj\ @@ -203,7 +199,6 @@ $(XML_INTDIR_A_DLL)\hash.obj\ $(XML_INTDIR_A_DLL)\HTMLparser.obj\ $(XML_INTDIR_A_DLL)\HTMLtree.obj\ - $(XML_INTDIR_A_DLL)\legacy.obj\ $(XML_INTDIR_A_DLL)\list.obj\ $(XML_INTDIR_A_DLL)\nanohttp.obj\ $(XML_INTDIR_A_DLL)\parser.obj\ @@ -211,7 +206,6 @@ $(XML_INTDIR_A_DLL)\pattern.obj\ $(XML_INTDIR_A_DLL)\relaxng.obj\ $(XML_INTDIR_A_DLL)\SAX2.obj\ - $(XML_INTDIR_A_DLL)\SAX.obj\ $(XML_INTDIR_A_DLL)\schematron.obj\ $(XML_INTDIR_A_DLL)\threads.obj\ $(XML_INTDIR_A_DLL)\tree.obj\
diff --git a/third_party/libxml/src/xml2-config-meson b/third_party/libxml/src/xml2-config-meson new file mode 100755 index 0000000..0403b96 --- /dev/null +++ b/third_party/libxml/src/xml2-config-meson
@@ -0,0 +1,56 @@ +#!/bin/sh + +usage() { + cat <<EOF +${2:+$2 + +}Usage: xml2-config <OPTION...> + +Options: + --prefix print libxml prefix + --prefix=DIR change libxml prefix + --libs print library linking information + --dynamic skip libraries only necessary for static linking + --cflags print pre-processor and compiler flags + --modules module support enabled + --help display this help and exit + --version output version information +EOF + exit "$1" +} + +if [ "$#" -lt 1 ]; then + usage 1 "Need at least one option." +fi + +prefix=0 +set_prefix= +libs=0 +libflag=--static +cflags=0 +modules=0 +version=0 + +for arg in "$@"; do + case $arg in + --prefix) prefix=1 ;; + --prefix=*) set_prefix="${arg#*=}" ;; + --libs) libs=1 ;; + --dynamic) libflag=--shared ;; + --cflags) cflags=1 ;; + --modules) modules=1 ;; + --help) usage 0 ;; + --version) version=1 ;; + *) usage 1 "Unknown option: $arg" ;; + esac +done + +set -- +[ "$prefix" -eq 1 ] && set -- "$@" --variable=prefix +[ -n "$set_prefix" ] && set -- "$@" --define-variable=prefix="$set_prefix" +[ "$libs" -eq 1 ] && set -- "$@" --libs "$libflag" +[ "$cflags" -eq 1 ] && set -- "$@" --cflags +[ "$modules" -eq 1 ] && set -- "$@" --variable=modules +[ "$version" -eq 1 ] && set -- "$@" --modversion + +exec ${PKG_CONFIG:-pkg-config} "$@" libxml-2.0
diff --git a/third_party/libxml/src/xmlIO.c b/third_party/libxml/src/xmlIO.c index 4e177d4..206efa79 100644 --- a/third_party/libxml/src/xmlIO.c +++ b/third_party/libxml/src/xmlIO.c
@@ -122,10 +122,10 @@ * * Returns an xmlParserErrors code. */ -static int +static xmlParserErrors xmlIOErr(int err) { - int code; + xmlParserErrors code; if (err == 0) code = XML_IO_UNKNOWN; #ifdef EACCES @@ -438,6 +438,10 @@ return(0); } +typedef struct { + int fd; +} xmlFdIOCtxt; + /** * xmlFdOpen: * @filename: the URI for matching @@ -445,12 +449,12 @@ * * Returns an xmlParserErrors code */ -static int +static xmlParserErrors xmlFdOpen(const char *filename, int write, int *out) { char *fromUri = NULL; int flags; int fd; - int ret; + xmlParserErrors ret; *out = -1; if (filename == NULL) @@ -517,7 +521,8 @@ */ static int xmlFdRead(void *context, char *buffer, int len) { - int fd = (int) (ptrdiff_t) context; + xmlFdIOCtxt *fdctxt = context; + int fd = fdctxt->fd; int ret = 0; int bytes; @@ -555,7 +560,8 @@ */ static int xmlFdWrite(void *context, const char *buffer, int len) { - int fd = (int) (ptrdiff_t) context; + xmlFdIOCtxt *fdctxt = context; + int fd = fdctxt->fd; int ret = 0; int bytes; @@ -572,6 +578,12 @@ } #endif /* LIBXML_OUTPUT_ENABLED */ +static int +xmlFdFree(void *context) { + xmlFree(context); + return(XML_ERR_OK); +} + /** * xmlFdClose: * @context: the I/O context @@ -582,9 +594,14 @@ */ static int xmlFdClose (void * context) { + xmlFdIOCtxt *fdctxt = context; + int fd = fdctxt->fd; int ret; - ret = close((int) (ptrdiff_t) context); + ret = close(fd); + + xmlFree(fdctxt); + if (ret < 0) return(xmlIOErr(errno)); @@ -611,13 +628,13 @@ * * input from FILE * * - * Returns an I/O context or NULL in case of error + * Returns an xmlParserErrors code */ -static int +static xmlParserErrors xmlFileOpenSafe(const char *filename, int write, void **out) { char *fromUri = NULL; FILE *fd; - int ret = XML_ERR_OK; + xmlParserErrors ret = XML_ERR_OK; *out = NULL; if (filename == NULL) @@ -1021,6 +1038,121 @@ } /** + * xmlInputFromFd: + * @buf: parser input buffer + * @fd: file descriptor + * @flags: flags + * + * Update the buffer to read from @fd. Supports the XML_INPUT_UNZIP + * flag. + * + * Returns an xmlParserErrors code. + */ +xmlParserErrors +xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, + xmlParserInputFlags flags) { + xmlFdIOCtxt *fdctxt; + int copy; + + (void) flags; + +#ifdef LIBXML_LZMA_ENABLED + if (flags & XML_INPUT_UNZIP) { + xzFile xzStream; + off_t pos; + + pos = lseek(fd, 0, SEEK_CUR); + + copy = dup(fd); + if (copy == -1) + return(xmlIOErr(errno)); + + xzStream = __libxml2_xzdopen("?", copy, "rb"); + + if (xzStream == NULL) { + close(copy); + } else { + int compressed = (__libxml2_xzcompressed(xzStream) > 0); + + if ((compressed) || + /* Try to rewind if not gzip compressed */ + (pos < 0) || + (lseek(fd, pos, SEEK_SET) < 0)) { + /* + * If a file isn't seekable, we pipe uncompressed + * input through xzlib. + */ + buf->context = xzStream; + buf->readcallback = xmlXzfileRead; + buf->closecallback = xmlXzfileClose; + buf->compressed = compressed; + + return(XML_ERR_OK); + } + + xmlXzfileClose(xzStream); + } + } +#endif /* LIBXML_LZMA_ENABLED */ + +#ifdef LIBXML_ZLIB_ENABLED + if (flags & XML_INPUT_UNZIP) { + gzFile gzStream; + off_t pos; + + pos = lseek(fd, 0, SEEK_CUR); + + copy = dup(fd); + if (copy == -1) + return(xmlIOErr(errno)); + + gzStream = gzdopen(copy, "rb"); + + if (gzStream == NULL) { + close(copy); + } else { + int compressed = (gzdirect(gzStream) == 0); + + if ((compressed) || + /* Try to rewind if not gzip compressed */ + (pos < 0) || + (lseek(fd, pos, SEEK_SET) < 0)) { + /* + * If a file isn't seekable, we pipe uncompressed + * input through zlib. + */ + buf->context = gzStream; + buf->readcallback = xmlGzfileRead; + buf->closecallback = xmlGzfileClose; + buf->compressed = compressed; + + return(XML_ERR_OK); + } + + xmlGzfileClose(gzStream); + } + } +#endif /* LIBXML_ZLIB_ENABLED */ + + copy = dup(fd); + if (copy == -1) + return(xmlIOErr(errno)); + + fdctxt = xmlMalloc(sizeof(*fdctxt)); + if (fdctxt == NULL) { + close(copy); + return(XML_ERR_NO_MEMORY); + } + fdctxt->fd = copy; + + buf->context = fdctxt; + buf->readcallback = xmlFdRead; + buf->closecallback = xmlFdClose; + + return(XML_ERR_OK); +} + +/** * xmlInputDefaultOpen: * @buf: input buffer to be filled * @filename: filename or URI @@ -1028,15 +1160,12 @@ * * Returns an xmlParserErrors code. */ -static int +static xmlParserErrors xmlInputDefaultOpen(xmlParserInputBufferPtr buf, const char *filename, - int flags) { - int ret; + xmlParserInputFlags flags) { + xmlParserErrors ret; int fd; - /* Avoid unused variable warning */ - (void) flags; - #ifdef LIBXML_HTTP_ENABLED if (xmlIOHTTPMatch(filename)) { if ((flags & XML_INPUT_NETWORK) == 0) @@ -1055,80 +1184,15 @@ if (!xmlFileMatch(filename)) return(XML_IO_ENOENT); -#ifdef LIBXML_LZMA_ENABLED - if (flags & XML_INPUT_UNZIP) { - xzFile xzStream; - - ret = xmlFdOpen(filename, 0, &fd); - if (ret != XML_ERR_OK) - return(ret); - - xzStream = __libxml2_xzdopen(filename, fd, "rb"); - - if (xzStream == NULL) { - close(fd); - } else { - /* - * Non-regular files like pipes can't be reopened. - * If a file isn't seekable, we pipe uncompressed - * input through xzlib. - */ - if ((lseek(fd, 0, SEEK_CUR) < 0) || - (__libxml2_xzcompressed(xzStream) > 0)) { - buf->context = xzStream; - buf->readcallback = xmlXzfileRead; - buf->closecallback = xmlXzfileClose; - buf->compressed = 1; - - return(XML_ERR_OK); - } - - xmlXzfileClose(xzStream); - } - } -#endif /* LIBXML_LZMA_ENABLED */ - -#ifdef LIBXML_ZLIB_ENABLED - if (flags & XML_INPUT_UNZIP) { - gzFile gzStream; - - ret = xmlFdOpen(filename, 0, &fd); - if (ret != XML_ERR_OK) - return(ret); - - gzStream = gzdopen(fd, "rb"); - - if (gzStream == NULL) { - close(fd); - } else { - /* - * Non-regular files like pipes can't be reopened. - * If a file isn't seekable, we pipe uncompressed - * input through zlib. - */ - if ((lseek(fd, 0, SEEK_CUR) < 0) || - (gzdirect(gzStream) == 0)) { - buf->context = gzStream; - buf->readcallback = xmlGzfileRead; - buf->closecallback = xmlGzfileClose; - buf->compressed = 1; - - return(XML_ERR_OK); - } - - xmlGzfileClose(gzStream); - } - } -#endif /* LIBXML_ZLIB_ENABLED */ - ret = xmlFdOpen(filename, 0, &fd); if (ret != XML_ERR_OK) return(ret); - buf->context = (void *) (ptrdiff_t) fd; - buf->readcallback = xmlFdRead; - buf->closecallback = xmlFdClose; - return(XML_ERR_OK); + ret = xmlInputFromFd(buf, fd, flags); + + close(fd); + + return(ret); } #ifdef LIBXML_OUTPUT_ENABLED @@ -1141,9 +1205,10 @@ * * Returns an xmlParserErrors code. */ -static int +static xmlParserErrors xmlOutputDefaultOpen(xmlOutputBufferPtr buf, const char *filename, int compression) { + xmlFdIOCtxt *fdctxt; int fd; (void) compression; @@ -1182,7 +1247,14 @@ } #endif /* LIBXML_ZLIB_ENABLED */ - buf->context = (void *) (ptrdiff_t) fd; + fdctxt = xmlMalloc(sizeof(*fdctxt)); + if (fdctxt == NULL) { + close(fd); + return(XML_ERR_NO_MEMORY); + } + fdctxt->fd = fd; + + buf->context = fdctxt; buf->writecallback = xmlFdWrite; buf->closecallback = xmlFdClose; return(XML_ERR_OK); @@ -1218,7 +1290,7 @@ return(NULL); } if (enc != XML_CHAR_ENCODING_NONE) { - if (xmlLookupCharEncodingHandler(enc, &ret->encoder) != 0) { + if (xmlLookupCharEncodingHandler(enc, &ret->encoder) != XML_ERR_OK) { /* We can't handle errors properly here. */ xmlFreeParserInputBuffer(ret); return(NULL); @@ -1341,7 +1413,8 @@ if (out->closecallback != NULL) { int code = out->closecallback(out->context); - if ((code != XML_ERR_OK) && (out->error == XML_ERR_OK)) { + if ((code != XML_ERR_OK) && + (!xmlIsCatastrophicError(XML_ERR_FATAL, out->error))) { if (code < 0) out->error = XML_IO_UNKNOWN; else @@ -1381,11 +1454,12 @@ * * Returns an xmlParserErrors code. */ -int +xmlParserErrors xmlParserInputBufferCreateUrl(const char *URI, xmlCharEncoding enc, - int flags, xmlParserInputBufferPtr *out) { + xmlParserInputFlags flags, + xmlParserInputBufferPtr *out) { xmlParserInputBufferPtr buf; - int ret; + xmlParserErrors ret; int i; xmlInitParser(); @@ -1460,11 +1534,25 @@ xmlParserInputBufferPtr xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) { xmlParserInputBufferPtr ret; + xmlParserErrors code; if (xmlParserInputBufferCreateFilenameValue != NULL) return(xmlParserInputBufferCreateFilenameValue(URI, enc)); - xmlParserInputBufferCreateUrl(URI, enc, 0, &ret); + code = xmlParserInputBufferCreateUrl(URI, enc, 0, &ret); + + /* + * xmlParserInputBufferCreateFilename has no way to return + * the kind of error although it really is crucial. + * All we can do is to set the global error. + */ + if ((code != XML_ERR_OK) && (code != XML_IO_ENOENT)) { + if (xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_IO, code, + XML_ERR_ERROR, URI, 0, NULL, NULL, NULL, 0, 0, + "Failed to open file\n") < 0) + xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_IO, NULL); + } + return(ret); } @@ -1473,7 +1561,7 @@ __xmlOutputBufferCreateFilename(const char *URI, xmlCharEncodingHandlerPtr encoder, int compression) { - xmlOutputBufferPtr ret; + xmlOutputBufferPtr ret = NULL; xmlURIPtr puri; int i = 0; char *unescaped = NULL; @@ -1481,7 +1569,7 @@ xmlInitParser(); if (URI == NULL) - return(NULL); + goto error; puri = xmlParseURI(URI); if (puri != NULL) { @@ -1492,8 +1580,7 @@ unescaped = xmlURIUnescapeString(URI, 0, NULL); if (unescaped == NULL) { xmlFreeURI(puri); - xmlCharEncCloseFunc(encoder); - return(NULL); + goto error; } URI = unescaped; } @@ -1504,10 +1591,9 @@ * Allocate the Output buffer front-end. */ ret = xmlAllocOutputBuffer(encoder); - if (ret == NULL) { - xmlFree(unescaped); - return(NULL); - } + encoder = NULL; + if (ret == NULL) + goto error; /* * Try to find one of the output accept method accepting that scheme @@ -1515,7 +1601,7 @@ */ for (i = xmlOutputCallbackNr - 1; i >= 0; i--) { xmlOutputCallback *cb = &xmlOutputCallbackTable[i]; - int code; + xmlParserErrors code; if (cb->matchcallback == xmlIODefaultMatch) { code = xmlOutputDefaultOpen(ret, URI, compression); @@ -1538,7 +1624,10 @@ ret = NULL; } +error: xmlFree(unescaped); + if (encoder != NULL) + xmlCharEncCloseFunc(encoder); return(ret); } @@ -1619,7 +1708,10 @@ xmlOutputBufferCreateFile(FILE *file, xmlCharEncodingHandlerPtr encoder) { xmlOutputBufferPtr ret; - if (file == NULL) return(NULL); + if (file == NULL) { + xmlCharEncCloseFunc(encoder); + return(NULL); + } ret = xmlAllocOutputBuffer(encoder); if (ret != NULL) { @@ -1647,7 +1739,10 @@ xmlCharEncodingHandlerPtr encoder) { xmlOutputBufferPtr ret; - if (buffer == NULL) return(NULL); + if (buffer == NULL) { + xmlCharEncCloseFunc(encoder); + return(NULL); + } ret = xmlOutputBufferCreateIO(xmlBufferWrite, NULL, (void *) buffer, encoder); @@ -1714,8 +1809,17 @@ ret = xmlAllocParserInputBuffer(enc); if (ret != NULL) { - ret->context = (void *) (ptrdiff_t) fd; + xmlFdIOCtxt *fdctxt; + + fdctxt = xmlMalloc(sizeof(*fdctxt)); + if (fdctxt == NULL) { + return(NULL); + } + fdctxt->fd = fd; + + ret->context = fdctxt; ret->readcallback = xmlFdRead; + ret->closecallback = xmlFdFree; } return(ret); @@ -1760,8 +1864,8 @@ * Returns the new input buffer or NULL. */ xmlParserInputBufferPtr -xmlNewInputBufferMemory(const void *mem, size_t size, int flags, - xmlCharEncoding enc) { +xmlNewInputBufferMemory(const void *mem, size_t size, + xmlParserInputFlags flags, xmlCharEncoding enc) { xmlParserInputBufferPtr ret; if ((flags & XML_INPUT_BUF_STATIC) && @@ -1876,7 +1980,7 @@ * Returns the new input buffer or NULL. */ xmlParserInputBufferPtr -xmlNewInputBufferString(const char *str, int flags) { +xmlNewInputBufferString(const char *str, xmlParserInputFlags flags) { xmlParserInputBufferPtr ret; ret = xmlMalloc(sizeof(*ret)); @@ -1912,13 +2016,24 @@ xmlOutputBufferCreateFd(int fd, xmlCharEncodingHandlerPtr encoder) { xmlOutputBufferPtr ret; - if (fd < 0) return(NULL); + if (fd < 0) { + xmlCharEncCloseFunc(encoder); + return(NULL); + } ret = xmlAllocOutputBuffer(encoder); if (ret != NULL) { - ret->context = (void *) (ptrdiff_t) fd; + xmlFdIOCtxt *fdctxt; + + fdctxt = xmlMalloc(sizeof(*fdctxt)); + if (fdctxt == NULL) { + return(NULL); + } + fdctxt->fd = fd; + + ret->context = fdctxt; ret->writecallback = xmlFdWrite; - ret->closecallback = NULL; + ret->closecallback = xmlFdFree; } return(ret); @@ -2088,7 +2203,8 @@ * convert as much as possible to the parser reading buffer. */ nbchars = SIZE_MAX; - if (xmlCharEncInput(in, &nbchars) < 0) + if (xmlCharEncInput(in, &nbchars, /* flush */ 0) != + XML_ENC_ERR_SUCCESS) return(-1); if (nbchars > INT_MAX) nbchars = INT_MAX; @@ -2199,7 +2315,8 @@ else sizeOut = SIZE_MAX; - if (xmlCharEncInput(in, &sizeOut) < 0) + if (xmlCharEncInput(in, &sizeOut, /* flush */ 0) != + XML_ENC_ERR_SUCCESS) return(-1); res = sizeOut; }
diff --git a/third_party/libxml/src/xmlreader.c b/third_party/libxml/src/xmlreader.c index 26bfd4ab..fc87be7 100644 --- a/third_party/libxml/src/xmlreader.c +++ b/third_party/libxml/src/xmlreader.c
@@ -27,8 +27,10 @@ #include <libxml/xmlIO.h> #include <libxml/xmlreader.h> #include <libxml/parserInternals.h> -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED #include <libxml/relaxng.h> +#endif +#ifdef LIBXML_SCHEMAS_ENABLED #include <libxml/xmlschemas.h> #endif #include <libxml/uri.h> @@ -41,8 +43,9 @@ #include "private/buf.h" #include "private/error.h" -#include "private/tree.h" +#include "private/memory.h" #include "private/parser.h" +#include "private/tree.h" #ifdef LIBXML_XINCLUDE_ENABLED #include "private/xinclude.h" #endif @@ -126,13 +129,15 @@ xmlTextReaderErrorFunc errorFunc; /* callback function */ void *errorFuncArg; /* callback function user argument */ -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED /* Handling of RelaxNG validation */ xmlRelaxNGPtr rngSchemas; /* The Relax NG schemas */ xmlRelaxNGValidCtxtPtr rngValidCtxt;/* The Relax NG validation context */ int rngPreserveCtxt; /* 1 if the context was provided by the user */ int rngValidErrors;/* The number of errors detected */ xmlNodePtr rngFullNode; /* the node if RNG not progressive */ +#endif +#ifdef LIBXML_SCHEMAS_ENABLED /* Handling of Schemas validation */ xmlSchemaPtr xsdSchemas; /* The Schemas schemas */ xmlSchemaValidCtxtPtr xsdValidCtxt;/* The Schemas validation context */ @@ -574,11 +579,16 @@ xmlTextReaderEntPush(xmlTextReaderPtr reader, xmlNodePtr value) { if (reader->entNr >= reader->entMax) { - size_t newSize = reader->entMax == 0 ? 10 : reader->entMax * 2; xmlNodePtr *tmp; + int newSize; - tmp = (xmlNodePtr *) xmlRealloc(reader->entTab, - newSize * sizeof(*tmp)); + newSize = xmlGrowCapacity(reader->entMax, sizeof(tmp[0]), + 10, XML_MAX_ITEMS); + if (newSize < 0) { + xmlTextReaderErrMemory(reader); + return (-1); + } + tmp = xmlRealloc(reader->entTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlTextReaderErrMemory(reader); return (-1); @@ -910,7 +920,7 @@ }*/ } #endif /* LIBXML_VALID_ENABLED */ -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) && (reader->rngValidCtxt != NULL)) { int ret; @@ -959,7 +969,7 @@ data, len); } #endif /* LIBXML_VALID_ENABLED */ -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) && (reader->rngValidCtxt != NULL)) { int ret; @@ -1009,7 +1019,7 @@ }*/ } #endif /* LIBXML_VALID_ENABLED */ -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) && (reader->rngValidCtxt != NULL)) { int ret; @@ -1736,8 +1746,9 @@ * * Reads the contents of an element or a text node as a string. * - * Returns a string containing the contents of the Element or Text node, - * or NULL if the reader is positioned on any other type of node. + * Returns a string containing the contents of the non-empty Element or + * Text node (including CDATA sections), or NULL if the reader + * is positioned on any other type of node. * The string must be deallocated by the caller. */ xmlChar * @@ -1760,11 +1771,8 @@ (node->children == NULL)) return(NULL); break; - case XML_ATTRIBUTE_NODE: - /* TODO */ - break; default: - break; + return(NULL); } buf = xmlBufCreate(50); @@ -2128,7 +2136,7 @@ xmlFreeTextReader(xmlTextReaderPtr reader) { if (reader == NULL) return; -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if (reader->rngSchemas != NULL) { xmlRelaxNGFree(reader->rngSchemas); reader->rngSchemas = NULL; @@ -2138,6 +2146,8 @@ xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt); reader->rngValidCtxt = NULL; } +#endif +#ifdef LIBXML_SCHEMAS_ENABLED if (reader->xsdPlug != NULL) { xmlSchemaSAXUnplug(reader->xsdPlug); reader->xsdPlug = NULL; @@ -3951,27 +3961,23 @@ if (comp == NULL) return(-1); - if (reader->patternMax <= 0) { - reader->patternMax = 4; - reader->patternTab = (xmlPatternPtr *) xmlMalloc(reader->patternMax * - sizeof(reader->patternTab[0])); - if (reader->patternTab == NULL) { - xmlTextReaderErrMemory(reader); - return (-1); - } - } if (reader->patternNr >= reader->patternMax) { xmlPatternPtr *tmp; - reader->patternMax *= 2; - tmp = (xmlPatternPtr *) xmlRealloc(reader->patternTab, - reader->patternMax * - sizeof(reader->patternTab[0])); + int newSize; + + newSize = xmlGrowCapacity(reader->patternMax, sizeof(tmp[0]), + 4, XML_MAX_ITEMS); + if (newSize < 0) { + xmlTextReaderErrMemory(reader); + return(-1); + } + tmp = xmlRealloc(reader->patternTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlTextReaderErrMemory(reader); - reader->patternMax /= 2; - return (-1); + return(-1); } reader->patternTab = tmp; + reader->patternMax = newSize; } reader->patternTab[reader->patternNr] = comp; return(reader->patternNr++); @@ -4003,7 +4009,7 @@ return(reader->ctxt->myDoc); } -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED /** * xmlTextReaderRelaxNGSetSchema: * @reader: the xmlTextReaderPtr used @@ -4058,7 +4064,9 @@ reader->validate = XML_TEXTREADER_VALIDATE_RNG; return(0); } +#endif /* LIBXML_RELAXNG_ENABLED */ +#ifdef LIBXML_SCHEMAS_ENABLED /** * xmlTextReaderLocator: * @ctx: the xmlTextReaderPtr used @@ -4191,7 +4199,9 @@ reader->validate = XML_TEXTREADER_VALIDATE_XSD; return(0); } +#endif /* LIBXML_SCHEMAS_ENABLED */ +#ifdef LIBXML_RELAXNG_ENABLED /** * xmlTextReaderRelaxNGValidateInternal: * @reader: the xmlTextReaderPtr used @@ -4279,7 +4289,9 @@ reader->validate = XML_TEXTREADER_VALIDATE_RNG; return(0); } +#endif /* LIBXML_RELAXNG_ENABLED */ +#ifdef LIBXML_SCHEMAS_ENABLED /** * xmlTextReaderSchemaValidateInternal: * @reader: the xmlTextReaderPtr used @@ -4427,7 +4439,9 @@ { return(xmlTextReaderSchemaValidateInternal(reader, xsd, NULL, 0)); } +#endif /* LIBXML_SCHEMAS_ENABLED */ +#ifdef LIBXML_RELAXNG_ENABLED /** * xmlTextReaderRelaxNGValidateCtxt: * @reader: the xmlTextReaderPtr used @@ -4466,8 +4480,7 @@ { return(xmlTextReaderRelaxNGValidateInternal(reader, rng, NULL, 0)); } - -#endif +#endif /* LIBXML_RELAXNG_ENABLED */ /** * xmlTextReaderIsNamespaceDecl: @@ -4651,11 +4664,13 @@ reader->errorFuncArg = arg; xmlCtxtSetErrorHandler(reader->ctxt, xmlTextReaderStructuredRelay, reader); -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if (reader->rngValidCtxt) { xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt, xmlTextReaderStructuredRelay, reader); } +#endif +#ifdef LIBXML_SCHEMAS_ENABLED if (reader->xsdValidCtxt) { xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt, xmlTextReaderStructuredRelay, reader); @@ -4667,11 +4682,13 @@ reader->sErrorFunc = NULL; reader->errorFuncArg = NULL; xmlCtxtSetErrorHandler(reader->ctxt, NULL, NULL); -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if (reader->rngValidCtxt) { xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt, NULL, NULL); } +#endif +#ifdef LIBXML_SCHEMAS_ENABLED if (reader->xsdValidCtxt) { xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt, NULL, NULL); @@ -4700,11 +4717,13 @@ reader->errorFuncArg = arg; xmlCtxtSetErrorHandler(reader->ctxt, xmlTextReaderStructuredRelay, reader); -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if (reader->rngValidCtxt) { xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt, xmlTextReaderStructuredRelay, reader); } +#endif +#ifdef LIBXML_SCHEMAS_ENABLED if (reader->xsdValidCtxt) { xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt, xmlTextReaderStructuredRelay, reader); @@ -4716,11 +4735,13 @@ reader->sErrorFunc = NULL; reader->errorFuncArg = NULL; xmlCtxtSetErrorHandler(reader->ctxt, NULL, NULL); -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if (reader->rngValidCtxt) { xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt, NULL, NULL); } +#endif +#ifdef LIBXML_SCHEMAS_ENABLED if (reader->xsdValidCtxt) { xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt, NULL, NULL); @@ -4783,9 +4804,11 @@ { if (reader == NULL) return (-1); -#ifdef LIBXML_SCHEMAS_ENABLED +#ifdef LIBXML_RELAXNG_ENABLED if (reader->validate == XML_TEXTREADER_VALIDATE_RNG) return (reader->rngValidErrors == 0); +#endif +#ifdef LIBXML_SCHEMAS_ENABLED if (reader->validate == XML_TEXTREADER_VALIDATE_XSD) return (reader->xsdValidErrors == 0); #endif
diff --git a/third_party/libxml/src/xmlsave.c b/third_party/libxml/src/xmlsave.c index d0492ee..38ccdbf 100644 --- a/third_party/libxml/src/xmlsave.c +++ b/third_party/libxml/src/xmlsave.c
@@ -83,8 +83,10 @@ const char *msg = NULL; int res; - /* Don't overwrite memory errors */ - if ((out != NULL) && (out->error == XML_ERR_NO_MEMORY)) + /* Don't overwrite catastrophic errors */ + if ((out != NULL) && + (out->error != XML_ERR_OK) && + (xmlIsCatastrophicError(XML_ERR_FATAL, out->error))) return; if (code == XML_ERR_NO_MEMORY) { @@ -317,7 +319,7 @@ memset(ret, 0, sizeof(xmlSaveCtxt)); if (encoding != NULL) { - int res; + xmlParserErrors res; res = xmlOpenCharEncodingHandler(encoding, /* output */ 1, &ret->handler); @@ -769,7 +771,7 @@ if ((encoding != NULL) && (buf->encoder == NULL) && (buf->conv == NULL)) { xmlCharEncodingHandler *handler; - int res; + xmlParserErrors res; res = xmlOpenCharEncodingHandler(encoding, /* output */ 1, &handler); if (res != XML_ERR_OK) { @@ -1711,10 +1713,14 @@ tmp = cur->children; while (tmp != NULL) { if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { + int res; xmlChar *httpequiv; - httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); - if (httpequiv != NULL) { + res = xmlNodeGetAttrValue(tmp, BAD_CAST "http-equiv", + NULL, &httpequiv); + if (res < 0) { + xmlSaveErrMemory(buf); + } else if (res == 0) { if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { xmlFree(httpequiv); @@ -2190,15 +2196,21 @@ * * Returns an xmlParserErrors code. */ -int +xmlParserErrors xmlSaveFinish(xmlSaveCtxtPtr ctxt) { int ret; if (ctxt == NULL) return(XML_ERR_INTERNAL_ERROR); - xmlSaveFlush(ctxt); - ret = ctxt->buf->error; + + ret = xmlOutputBufferClose(ctxt->buf); + ctxt->buf = NULL; + if (ret < 0) + ret = -ret; + else + ret = XML_ERR_OK; + xmlFreeSaveCtxt(ctxt); return(ret); } @@ -2537,7 +2549,7 @@ if (txt_encoding == NULL) txt_encoding = (const char *) out_doc->encoding; if (txt_encoding != NULL) { - int res; + xmlParserErrors res; res = xmlOpenCharEncodingHandler(txt_encoding, /* output */ 1, &conv_hdlr); @@ -2659,7 +2671,7 @@ encoding = (const char *) cur->encoding; if (encoding != NULL) { - int res; + xmlParserErrors res; res = xmlOpenCharEncodingHandler(encoding, /* output */ 1, &handler); if (res != XML_ERR_OK) { @@ -2805,7 +2817,7 @@ encoding = (const char *) cur->encoding; if (encoding != NULL) { - int res; + xmlParserErrors res; res = xmlOpenCharEncodingHandler(encoding, /* output */ 1, &handler); if (res != XML_ERR_OK)
diff --git a/third_party/libxml/src/xmlunicode.c b/third_party/libxml/src/xmlunicode.c index a385bcbd..0f0dd02 100644 --- a/third_party/libxml/src/xmlunicode.c +++ b/third_party/libxml/src/xmlunicode.c
@@ -6,7 +6,7 @@ * http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html * using the genUnicode.py Python script. * - * Generation date: Mon Mar 27 11:09:52 2006 + * Generation date: Tue Mar 4 16:29:31 2025 * Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt * Daniel Veillard <veillard@redhat.com> */ @@ -14,13 +14,14 @@ #define IN_LIBXML #include "libxml.h" -#ifdef LIBXML_UNICODE_ENABLED +#ifdef LIBXML_REGEXP_ENABLED #include <string.h> #include <libxml/xmlversion.h> -#include <libxml/xmlunicode.h> #include <libxml/chvalid.h> +#include "private/unicode.h" + typedef int (xmlIntFunc)(int); /* just to keep one's mind untwisted */ typedef struct { @@ -36,174 +37,6 @@ static xmlIntFunc *xmlUnicodeLookup(const xmlUnicodeNameTable *tptr, const char *tname); -static const xmlUnicodeRange xmlUnicodeBlocks[] = { - {"AegeanNumbers", xmlUCSIsAegeanNumbers}, - {"AlphabeticPresentationForms", xmlUCSIsAlphabeticPresentationForms}, - {"Arabic", xmlUCSIsArabic}, - {"ArabicPresentationForms-A", xmlUCSIsArabicPresentationFormsA}, - {"ArabicPresentationForms-B", xmlUCSIsArabicPresentationFormsB}, - {"Armenian", xmlUCSIsArmenian}, - {"Arrows", xmlUCSIsArrows}, - {"BasicLatin", xmlUCSIsBasicLatin}, - {"Bengali", xmlUCSIsBengali}, - {"BlockElements", xmlUCSIsBlockElements}, - {"Bopomofo", xmlUCSIsBopomofo}, - {"BopomofoExtended", xmlUCSIsBopomofoExtended}, - {"BoxDrawing", xmlUCSIsBoxDrawing}, - {"BraillePatterns", xmlUCSIsBraillePatterns}, - {"Buhid", xmlUCSIsBuhid}, - {"ByzantineMusicalSymbols", xmlUCSIsByzantineMusicalSymbols}, - {"CJKCompatibility", xmlUCSIsCJKCompatibility}, - {"CJKCompatibilityForms", xmlUCSIsCJKCompatibilityForms}, - {"CJKCompatibilityIdeographs", xmlUCSIsCJKCompatibilityIdeographs}, - {"CJKCompatibilityIdeographsSupplement", xmlUCSIsCJKCompatibilityIdeographsSupplement}, - {"CJKRadicalsSupplement", xmlUCSIsCJKRadicalsSupplement}, - {"CJKSymbolsandPunctuation", xmlUCSIsCJKSymbolsandPunctuation}, - {"CJKUnifiedIdeographs", xmlUCSIsCJKUnifiedIdeographs}, - {"CJKUnifiedIdeographsExtensionA", xmlUCSIsCJKUnifiedIdeographsExtensionA}, - {"CJKUnifiedIdeographsExtensionB", xmlUCSIsCJKUnifiedIdeographsExtensionB}, - {"Cherokee", xmlUCSIsCherokee}, - {"CombiningDiacriticalMarks", xmlUCSIsCombiningDiacriticalMarks}, - {"CombiningDiacriticalMarksforSymbols", xmlUCSIsCombiningDiacriticalMarksforSymbols}, - {"CombiningHalfMarks", xmlUCSIsCombiningHalfMarks}, - {"CombiningMarksforSymbols", xmlUCSIsCombiningMarksforSymbols}, - {"ControlPictures", xmlUCSIsControlPictures}, - {"CurrencySymbols", xmlUCSIsCurrencySymbols}, - {"CypriotSyllabary", xmlUCSIsCypriotSyllabary}, - {"Cyrillic", xmlUCSIsCyrillic}, - {"CyrillicSupplement", xmlUCSIsCyrillicSupplement}, - {"Deseret", xmlUCSIsDeseret}, - {"Devanagari", xmlUCSIsDevanagari}, - {"Dingbats", xmlUCSIsDingbats}, - {"EnclosedAlphanumerics", xmlUCSIsEnclosedAlphanumerics}, - {"EnclosedCJKLettersandMonths", xmlUCSIsEnclosedCJKLettersandMonths}, - {"Ethiopic", xmlUCSIsEthiopic}, - {"GeneralPunctuation", xmlUCSIsGeneralPunctuation}, - {"GeometricShapes", xmlUCSIsGeometricShapes}, - {"Georgian", xmlUCSIsGeorgian}, - {"Gothic", xmlUCSIsGothic}, - {"Greek", xmlUCSIsGreek}, - {"GreekExtended", xmlUCSIsGreekExtended}, - {"GreekandCoptic", xmlUCSIsGreekandCoptic}, - {"Gujarati", xmlUCSIsGujarati}, - {"Gurmukhi", xmlUCSIsGurmukhi}, - {"HalfwidthandFullwidthForms", xmlUCSIsHalfwidthandFullwidthForms}, - {"HangulCompatibilityJamo", xmlUCSIsHangulCompatibilityJamo}, - {"HangulJamo", xmlUCSIsHangulJamo}, - {"HangulSyllables", xmlUCSIsHangulSyllables}, - {"Hanunoo", xmlUCSIsHanunoo}, - {"Hebrew", xmlUCSIsHebrew}, - {"HighPrivateUseSurrogates", xmlUCSIsHighPrivateUseSurrogates}, - {"HighSurrogates", xmlUCSIsHighSurrogates}, - {"Hiragana", xmlUCSIsHiragana}, - {"IPAExtensions", xmlUCSIsIPAExtensions}, - {"IdeographicDescriptionCharacters", xmlUCSIsIdeographicDescriptionCharacters}, - {"Kanbun", xmlUCSIsKanbun}, - {"KangxiRadicals", xmlUCSIsKangxiRadicals}, - {"Kannada", xmlUCSIsKannada}, - {"Katakana", xmlUCSIsKatakana}, - {"KatakanaPhoneticExtensions", xmlUCSIsKatakanaPhoneticExtensions}, - {"Khmer", xmlUCSIsKhmer}, - {"KhmerSymbols", xmlUCSIsKhmerSymbols}, - {"Lao", xmlUCSIsLao}, - {"Latin-1Supplement", xmlUCSIsLatin1Supplement}, - {"LatinExtended-A", xmlUCSIsLatinExtendedA}, - {"LatinExtended-B", xmlUCSIsLatinExtendedB}, - {"LatinExtendedAdditional", xmlUCSIsLatinExtendedAdditional}, - {"LetterlikeSymbols", xmlUCSIsLetterlikeSymbols}, - {"Limbu", xmlUCSIsLimbu}, - {"LinearBIdeograms", xmlUCSIsLinearBIdeograms}, - {"LinearBSyllabary", xmlUCSIsLinearBSyllabary}, - {"LowSurrogates", xmlUCSIsLowSurrogates}, - {"Malayalam", xmlUCSIsMalayalam}, - {"MathematicalAlphanumericSymbols", xmlUCSIsMathematicalAlphanumericSymbols}, - {"MathematicalOperators", xmlUCSIsMathematicalOperators}, - {"MiscellaneousMathematicalSymbols-A", xmlUCSIsMiscellaneousMathematicalSymbolsA}, - {"MiscellaneousMathematicalSymbols-B", xmlUCSIsMiscellaneousMathematicalSymbolsB}, - {"MiscellaneousSymbols", xmlUCSIsMiscellaneousSymbols}, - {"MiscellaneousSymbolsandArrows", xmlUCSIsMiscellaneousSymbolsandArrows}, - {"MiscellaneousTechnical", xmlUCSIsMiscellaneousTechnical}, - {"Mongolian", xmlUCSIsMongolian}, - {"MusicalSymbols", xmlUCSIsMusicalSymbols}, - {"Myanmar", xmlUCSIsMyanmar}, - {"NumberForms", xmlUCSIsNumberForms}, - {"Ogham", xmlUCSIsOgham}, - {"OldItalic", xmlUCSIsOldItalic}, - {"OpticalCharacterRecognition", xmlUCSIsOpticalCharacterRecognition}, - {"Oriya", xmlUCSIsOriya}, - {"Osmanya", xmlUCSIsOsmanya}, - {"PhoneticExtensions", xmlUCSIsPhoneticExtensions}, - {"PrivateUse", xmlUCSIsPrivateUse}, - {"PrivateUseArea", xmlUCSIsPrivateUseArea}, - {"Runic", xmlUCSIsRunic}, - {"Shavian", xmlUCSIsShavian}, - {"Sinhala", xmlUCSIsSinhala}, - {"SmallFormVariants", xmlUCSIsSmallFormVariants}, - {"SpacingModifierLetters", xmlUCSIsSpacingModifierLetters}, - {"Specials", xmlUCSIsSpecials}, - {"SuperscriptsandSubscripts", xmlUCSIsSuperscriptsandSubscripts}, - {"SupplementalArrows-A", xmlUCSIsSupplementalArrowsA}, - {"SupplementalArrows-B", xmlUCSIsSupplementalArrowsB}, - {"SupplementalMathematicalOperators", xmlUCSIsSupplementalMathematicalOperators}, - {"SupplementaryPrivateUseArea-A", xmlUCSIsSupplementaryPrivateUseAreaA}, - {"SupplementaryPrivateUseArea-B", xmlUCSIsSupplementaryPrivateUseAreaB}, - {"Syriac", xmlUCSIsSyriac}, - {"Tagalog", xmlUCSIsTagalog}, - {"Tagbanwa", xmlUCSIsTagbanwa}, - {"Tags", xmlUCSIsTags}, - {"TaiLe", xmlUCSIsTaiLe}, - {"TaiXuanJingSymbols", xmlUCSIsTaiXuanJingSymbols}, - {"Tamil", xmlUCSIsTamil}, - {"Telugu", xmlUCSIsTelugu}, - {"Thaana", xmlUCSIsThaana}, - {"Thai", xmlUCSIsThai}, - {"Tibetan", xmlUCSIsTibetan}, - {"Ugaritic", xmlUCSIsUgaritic}, - {"UnifiedCanadianAboriginalSyllabics", xmlUCSIsUnifiedCanadianAboriginalSyllabics}, - {"VariationSelectors", xmlUCSIsVariationSelectors}, - {"VariationSelectorsSupplement", xmlUCSIsVariationSelectorsSupplement}, - {"YiRadicals", xmlUCSIsYiRadicals}, - {"YiSyllables", xmlUCSIsYiSyllables}, - {"YijingHexagramSymbols", xmlUCSIsYijingHexagramSymbols}}; - -static const xmlUnicodeRange xmlUnicodeCats[] = { - {"C", xmlUCSIsCatC}, - {"Cc", xmlUCSIsCatCc}, - {"Cf", xmlUCSIsCatCf}, - {"Co", xmlUCSIsCatCo}, - {"Cs", xmlUCSIsCatCs}, - {"L", xmlUCSIsCatL}, - {"Ll", xmlUCSIsCatLl}, - {"Lm", xmlUCSIsCatLm}, - {"Lo", xmlUCSIsCatLo}, - {"Lt", xmlUCSIsCatLt}, - {"Lu", xmlUCSIsCatLu}, - {"M", xmlUCSIsCatM}, - {"Mc", xmlUCSIsCatMc}, - {"Me", xmlUCSIsCatMe}, - {"Mn", xmlUCSIsCatMn}, - {"N", xmlUCSIsCatN}, - {"Nd", xmlUCSIsCatNd}, - {"Nl", xmlUCSIsCatNl}, - {"No", xmlUCSIsCatNo}, - {"P", xmlUCSIsCatP}, - {"Pc", xmlUCSIsCatPc}, - {"Pd", xmlUCSIsCatPd}, - {"Pe", xmlUCSIsCatPe}, - {"Pf", xmlUCSIsCatPf}, - {"Pi", xmlUCSIsCatPi}, - {"Po", xmlUCSIsCatPo}, - {"Ps", xmlUCSIsCatPs}, - {"S", xmlUCSIsCatS}, - {"Sc", xmlUCSIsCatSc}, - {"Sk", xmlUCSIsCatSk}, - {"Sm", xmlUCSIsCatSm}, - {"So", xmlUCSIsCatSo}, - {"Z", xmlUCSIsCatZ}, - {"Zl", xmlUCSIsCatZl}, - {"Zp", xmlUCSIsCatZp}, - {"Zs", xmlUCSIsCatZs}}; - static const xmlChSRange xmlCS[] = {{0x0, 0x1f}, {0x7f, 0x9f}, {0xad, 0xad}, {0x600, 0x603}, {0x6dd, 0x6dd}, {0x70f, 0x70f}, {0x17b4, 0x17b5}, {0x200b, 0x200f}, {0x202a, 0x202e}, {0x2060, 0x2063}, @@ -930,9 +763,6 @@ {0x202f, 0x202f}, {0x205f, 0x205f}, {0x3000, 0x3000} }; static const xmlChRangeGroup xmlZG = {9,0,xmlZS,NULL}; -static const xmlUnicodeNameTable xmlUnicodeBlockTbl = {xmlUnicodeBlocks, 128}; -static const xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, 36}; - /** * xmlUnicodeLookup: * @tptr: pointer to the name table @@ -973,7 +803,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsAegeanNumbers(int code) { return(((code >= 0x10100) && (code <= 0x1013F))); } @@ -986,7 +816,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsAlphabeticPresentationForms(int code) { return(((code >= 0xFB00) && (code <= 0xFB4F))); } @@ -999,7 +829,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsArabic(int code) { return(((code >= 0x0600) && (code <= 0x06FF))); } @@ -1012,7 +842,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsArabicPresentationFormsA(int code) { return(((code >= 0xFB50) && (code <= 0xFDFF))); } @@ -1025,7 +855,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsArabicPresentationFormsB(int code) { return(((code >= 0xFE70) && (code <= 0xFEFF))); } @@ -1038,7 +868,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsArmenian(int code) { return(((code >= 0x0530) && (code <= 0x058F))); } @@ -1051,7 +881,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsArrows(int code) { return(((code >= 0x2190) && (code <= 0x21FF))); } @@ -1064,7 +894,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsBasicLatin(int code) { return(((code >= 0x0000) && (code <= 0x007F))); } @@ -1077,7 +907,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsBengali(int code) { return(((code >= 0x0980) && (code <= 0x09FF))); } @@ -1090,7 +920,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsBlockElements(int code) { return(((code >= 0x2580) && (code <= 0x259F))); } @@ -1103,7 +933,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsBopomofo(int code) { return(((code >= 0x3100) && (code <= 0x312F))); } @@ -1116,7 +946,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsBopomofoExtended(int code) { return(((code >= 0x31A0) && (code <= 0x31BF))); } @@ -1129,7 +959,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsBoxDrawing(int code) { return(((code >= 0x2500) && (code <= 0x257F))); } @@ -1142,7 +972,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsBraillePatterns(int code) { return(((code >= 0x2800) && (code <= 0x28FF))); } @@ -1155,7 +985,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsBuhid(int code) { return(((code >= 0x1740) && (code <= 0x175F))); } @@ -1168,7 +998,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsByzantineMusicalSymbols(int code) { return(((code >= 0x1D000) && (code <= 0x1D0FF))); } @@ -1181,7 +1011,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKCompatibility(int code) { return(((code >= 0x3300) && (code <= 0x33FF))); } @@ -1194,7 +1024,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKCompatibilityForms(int code) { return(((code >= 0xFE30) && (code <= 0xFE4F))); } @@ -1207,7 +1037,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKCompatibilityIdeographs(int code) { return(((code >= 0xF900) && (code <= 0xFAFF))); } @@ -1220,7 +1050,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKCompatibilityIdeographsSupplement(int code) { return(((code >= 0x2F800) && (code <= 0x2FA1F))); } @@ -1233,7 +1063,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKRadicalsSupplement(int code) { return(((code >= 0x2E80) && (code <= 0x2EFF))); } @@ -1246,7 +1076,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKSymbolsandPunctuation(int code) { return(((code >= 0x3000) && (code <= 0x303F))); } @@ -1259,7 +1089,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKUnifiedIdeographs(int code) { return(((code >= 0x4E00) && (code <= 0x9FFF))); } @@ -1272,7 +1102,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKUnifiedIdeographsExtensionA(int code) { return(((code >= 0x3400) && (code <= 0x4DBF))); } @@ -1285,7 +1115,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCJKUnifiedIdeographsExtensionB(int code) { return(((code >= 0x20000) && (code <= 0x2A6DF))); } @@ -1298,7 +1128,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCherokee(int code) { return(((code >= 0x13A0) && (code <= 0x13FF))); } @@ -1311,7 +1141,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCombiningDiacriticalMarks(int code) { return(((code >= 0x0300) && (code <= 0x036F))); } @@ -1324,7 +1154,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCombiningDiacriticalMarksforSymbols(int code) { return(((code >= 0x20D0) && (code <= 0x20FF))); } @@ -1337,7 +1167,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCombiningHalfMarks(int code) { return(((code >= 0xFE20) && (code <= 0xFE2F))); } @@ -1350,7 +1180,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCombiningMarksforSymbols(int code) { return(((code >= 0x20D0) && (code <= 0x20FF))); } @@ -1363,7 +1193,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsControlPictures(int code) { return(((code >= 0x2400) && (code <= 0x243F))); } @@ -1376,7 +1206,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCurrencySymbols(int code) { return(((code >= 0x20A0) && (code <= 0x20CF))); } @@ -1389,7 +1219,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCypriotSyllabary(int code) { return(((code >= 0x10800) && (code <= 0x1083F))); } @@ -1402,7 +1232,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCyrillic(int code) { return(((code >= 0x0400) && (code <= 0x04FF))); } @@ -1415,7 +1245,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsCyrillicSupplement(int code) { return(((code >= 0x0500) && (code <= 0x052F))); } @@ -1428,7 +1258,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsDeseret(int code) { return(((code >= 0x10400) && (code <= 0x1044F))); } @@ -1441,7 +1271,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsDevanagari(int code) { return(((code >= 0x0900) && (code <= 0x097F))); } @@ -1454,7 +1284,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsDingbats(int code) { return(((code >= 0x2700) && (code <= 0x27BF))); } @@ -1467,7 +1297,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsEnclosedAlphanumerics(int code) { return(((code >= 0x2460) && (code <= 0x24FF))); } @@ -1480,7 +1310,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsEnclosedCJKLettersandMonths(int code) { return(((code >= 0x3200) && (code <= 0x32FF))); } @@ -1493,7 +1323,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsEthiopic(int code) { return(((code >= 0x1200) && (code <= 0x137F))); } @@ -1506,7 +1336,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGeneralPunctuation(int code) { return(((code >= 0x2000) && (code <= 0x206F))); } @@ -1519,7 +1349,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGeometricShapes(int code) { return(((code >= 0x25A0) && (code <= 0x25FF))); } @@ -1532,7 +1362,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGeorgian(int code) { return(((code >= 0x10A0) && (code <= 0x10FF))); } @@ -1545,7 +1375,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGothic(int code) { return(((code >= 0x10330) && (code <= 0x1034F))); } @@ -1558,7 +1388,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGreek(int code) { return(((code >= 0x0370) && (code <= 0x03FF))); } @@ -1571,7 +1401,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGreekExtended(int code) { return(((code >= 0x1F00) && (code <= 0x1FFF))); } @@ -1584,7 +1414,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGreekandCoptic(int code) { return(((code >= 0x0370) && (code <= 0x03FF))); } @@ -1597,7 +1427,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGujarati(int code) { return(((code >= 0x0A80) && (code <= 0x0AFF))); } @@ -1610,7 +1440,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsGurmukhi(int code) { return(((code >= 0x0A00) && (code <= 0x0A7F))); } @@ -1623,7 +1453,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHalfwidthandFullwidthForms(int code) { return(((code >= 0xFF00) && (code <= 0xFFEF))); } @@ -1636,7 +1466,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHangulCompatibilityJamo(int code) { return(((code >= 0x3130) && (code <= 0x318F))); } @@ -1649,7 +1479,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHangulJamo(int code) { return(((code >= 0x1100) && (code <= 0x11FF))); } @@ -1662,7 +1492,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHangulSyllables(int code) { return(((code >= 0xAC00) && (code <= 0xD7AF))); } @@ -1675,7 +1505,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHanunoo(int code) { return(((code >= 0x1720) && (code <= 0x173F))); } @@ -1688,7 +1518,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHebrew(int code) { return(((code >= 0x0590) && (code <= 0x05FF))); } @@ -1701,7 +1531,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHighPrivateUseSurrogates(int code) { return(((code >= 0xDB80) && (code <= 0xDBFF))); } @@ -1714,7 +1544,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHighSurrogates(int code) { return(((code >= 0xD800) && (code <= 0xDB7F))); } @@ -1727,7 +1557,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsHiragana(int code) { return(((code >= 0x3040) && (code <= 0x309F))); } @@ -1740,7 +1570,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsIPAExtensions(int code) { return(((code >= 0x0250) && (code <= 0x02AF))); } @@ -1753,7 +1583,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsIdeographicDescriptionCharacters(int code) { return(((code >= 0x2FF0) && (code <= 0x2FFF))); } @@ -1766,7 +1596,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsKanbun(int code) { return(((code >= 0x3190) && (code <= 0x319F))); } @@ -1779,7 +1609,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsKangxiRadicals(int code) { return(((code >= 0x2F00) && (code <= 0x2FDF))); } @@ -1792,7 +1622,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsKannada(int code) { return(((code >= 0x0C80) && (code <= 0x0CFF))); } @@ -1805,7 +1635,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsKatakana(int code) { return(((code >= 0x30A0) && (code <= 0x30FF))); } @@ -1818,7 +1648,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsKatakanaPhoneticExtensions(int code) { return(((code >= 0x31F0) && (code <= 0x31FF))); } @@ -1831,7 +1661,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsKhmer(int code) { return(((code >= 0x1780) && (code <= 0x17FF))); } @@ -1844,7 +1674,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsKhmerSymbols(int code) { return(((code >= 0x19E0) && (code <= 0x19FF))); } @@ -1857,7 +1687,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLao(int code) { return(((code >= 0x0E80) && (code <= 0x0EFF))); } @@ -1870,7 +1700,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLatin1Supplement(int code) { return(((code >= 0x0080) && (code <= 0x00FF))); } @@ -1883,7 +1713,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLatinExtendedA(int code) { return(((code >= 0x0100) && (code <= 0x017F))); } @@ -1896,7 +1726,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLatinExtendedB(int code) { return(((code >= 0x0180) && (code <= 0x024F))); } @@ -1909,7 +1739,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLatinExtendedAdditional(int code) { return(((code >= 0x1E00) && (code <= 0x1EFF))); } @@ -1922,7 +1752,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLetterlikeSymbols(int code) { return(((code >= 0x2100) && (code <= 0x214F))); } @@ -1935,7 +1765,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLimbu(int code) { return(((code >= 0x1900) && (code <= 0x194F))); } @@ -1948,7 +1778,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLinearBIdeograms(int code) { return(((code >= 0x10080) && (code <= 0x100FF))); } @@ -1961,7 +1791,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLinearBSyllabary(int code) { return(((code >= 0x10000) && (code <= 0x1007F))); } @@ -1974,7 +1804,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsLowSurrogates(int code) { return(((code >= 0xDC00) && (code <= 0xDFFF))); } @@ -1987,7 +1817,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMalayalam(int code) { return(((code >= 0x0D00) && (code <= 0x0D7F))); } @@ -2000,7 +1830,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMathematicalAlphanumericSymbols(int code) { return(((code >= 0x1D400) && (code <= 0x1D7FF))); } @@ -2013,7 +1843,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMathematicalOperators(int code) { return(((code >= 0x2200) && (code <= 0x22FF))); } @@ -2026,7 +1856,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMiscellaneousMathematicalSymbolsA(int code) { return(((code >= 0x27C0) && (code <= 0x27EF))); } @@ -2039,7 +1869,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMiscellaneousMathematicalSymbolsB(int code) { return(((code >= 0x2980) && (code <= 0x29FF))); } @@ -2052,7 +1882,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMiscellaneousSymbols(int code) { return(((code >= 0x2600) && (code <= 0x26FF))); } @@ -2065,7 +1895,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMiscellaneousSymbolsandArrows(int code) { return(((code >= 0x2B00) && (code <= 0x2BFF))); } @@ -2078,7 +1908,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMiscellaneousTechnical(int code) { return(((code >= 0x2300) && (code <= 0x23FF))); } @@ -2091,7 +1921,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMongolian(int code) { return(((code >= 0x1800) && (code <= 0x18AF))); } @@ -2104,7 +1934,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMusicalSymbols(int code) { return(((code >= 0x1D100) && (code <= 0x1D1FF))); } @@ -2117,7 +1947,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsMyanmar(int code) { return(((code >= 0x1000) && (code <= 0x109F))); } @@ -2130,7 +1960,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsNumberForms(int code) { return(((code >= 0x2150) && (code <= 0x218F))); } @@ -2143,7 +1973,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsOgham(int code) { return(((code >= 0x1680) && (code <= 0x169F))); } @@ -2156,7 +1986,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsOldItalic(int code) { return(((code >= 0x10300) && (code <= 0x1032F))); } @@ -2169,7 +1999,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsOpticalCharacterRecognition(int code) { return(((code >= 0x2440) && (code <= 0x245F))); } @@ -2182,7 +2012,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsOriya(int code) { return(((code >= 0x0B00) && (code <= 0x0B7F))); } @@ -2195,7 +2025,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsOsmanya(int code) { return(((code >= 0x10480) && (code <= 0x104AF))); } @@ -2208,7 +2038,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsPhoneticExtensions(int code) { return(((code >= 0x1D00) && (code <= 0x1D7F))); } @@ -2221,7 +2051,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsPrivateUse(int code) { return(((code >= 0xE000) && (code <= 0xF8FF)) || ((code >= 0xF0000) && (code <= 0xFFFFF)) || @@ -2236,7 +2066,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsPrivateUseArea(int code) { return(((code >= 0xE000) && (code <= 0xF8FF))); } @@ -2249,7 +2079,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsRunic(int code) { return(((code >= 0x16A0) && (code <= 0x16FF))); } @@ -2262,7 +2092,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsShavian(int code) { return(((code >= 0x10450) && (code <= 0x1047F))); } @@ -2275,7 +2105,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSinhala(int code) { return(((code >= 0x0D80) && (code <= 0x0DFF))); } @@ -2288,7 +2118,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSmallFormVariants(int code) { return(((code >= 0xFE50) && (code <= 0xFE6F))); } @@ -2301,7 +2131,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSpacingModifierLetters(int code) { return(((code >= 0x02B0) && (code <= 0x02FF))); } @@ -2314,7 +2144,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSpecials(int code) { return(((code >= 0xFFF0) && (code <= 0xFFFF))); } @@ -2327,7 +2157,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSuperscriptsandSubscripts(int code) { return(((code >= 0x2070) && (code <= 0x209F))); } @@ -2340,7 +2170,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSupplementalArrowsA(int code) { return(((code >= 0x27F0) && (code <= 0x27FF))); } @@ -2353,7 +2183,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSupplementalArrowsB(int code) { return(((code >= 0x2900) && (code <= 0x297F))); } @@ -2366,7 +2196,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSupplementalMathematicalOperators(int code) { return(((code >= 0x2A00) && (code <= 0x2AFF))); } @@ -2379,7 +2209,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSupplementaryPrivateUseAreaA(int code) { return(((code >= 0xF0000) && (code <= 0xFFFFF))); } @@ -2392,7 +2222,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSupplementaryPrivateUseAreaB(int code) { return(((code >= 0x100000) && (code <= 0x10FFFF))); } @@ -2405,7 +2235,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsSyriac(int code) { return(((code >= 0x0700) && (code <= 0x074F))); } @@ -2418,7 +2248,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsTagalog(int code) { return(((code >= 0x1700) && (code <= 0x171F))); } @@ -2431,7 +2261,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsTagbanwa(int code) { return(((code >= 0x1760) && (code <= 0x177F))); } @@ -2444,7 +2274,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsTags(int code) { return(((code >= 0xE0000) && (code <= 0xE007F))); } @@ -2457,7 +2287,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsTaiLe(int code) { return(((code >= 0x1950) && (code <= 0x197F))); } @@ -2470,7 +2300,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsTaiXuanJingSymbols(int code) { return(((code >= 0x1D300) && (code <= 0x1D35F))); } @@ -2483,7 +2313,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsTamil(int code) { return(((code >= 0x0B80) && (code <= 0x0BFF))); } @@ -2496,7 +2326,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsTelugu(int code) { return(((code >= 0x0C00) && (code <= 0x0C7F))); } @@ -2509,7 +2339,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsThaana(int code) { return(((code >= 0x0780) && (code <= 0x07BF))); } @@ -2522,7 +2352,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsThai(int code) { return(((code >= 0x0E00) && (code <= 0x0E7F))); } @@ -2535,7 +2365,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsTibetan(int code) { return(((code >= 0x0F00) && (code <= 0x0FFF))); } @@ -2548,7 +2378,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsUgaritic(int code) { return(((code >= 0x10380) && (code <= 0x1039F))); } @@ -2561,7 +2391,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsUnifiedCanadianAboriginalSyllabics(int code) { return(((code >= 0x1400) && (code <= 0x167F))); } @@ -2574,7 +2404,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsVariationSelectors(int code) { return(((code >= 0xFE00) && (code <= 0xFE0F))); } @@ -2587,7 +2417,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsVariationSelectorsSupplement(int code) { return(((code >= 0xE0100) && (code <= 0xE01EF))); } @@ -2600,7 +2430,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsYiRadicals(int code) { return(((code >= 0xA490) && (code <= 0xA4CF))); } @@ -2613,7 +2443,7 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsYiSyllables(int code) { return(((code >= 0xA000) && (code <= 0xA48F))); } @@ -2626,31 +2456,12 @@ * * Returns 1 if true 0 otherwise */ -int +static int xmlUCSIsYijingHexagramSymbols(int code) { return(((code >= 0x4DC0) && (code <= 0x4DFF))); } /** - * xmlUCSIsBlock: - * @code: UCS code point - * @block: UCS block name - * - * Check whether the character is part of the UCS Block - * - * Returns 1 if true, 0 if false and -1 on unknown block - */ -int -xmlUCSIsBlock(int code, const char *block) { - xmlIntFunc *func; - - func = xmlUnicodeLookup(&xmlUnicodeBlockTbl, block); - if (func == NULL) - return (-1); - return (func(code)); -} - -/** * xmlUCSIsCatC: * @code: UCS code point * @@ -3156,6 +2967,195 @@ (code == 0x3000)); } +static const xmlUnicodeRange xmlUnicodeBlocks[] = { {"AegeanNumbers", xmlUCSIsAegeanNumbers}, + {"AlphabeticPresentationForms", xmlUCSIsAlphabeticPresentationForms}, + {"Arabic", xmlUCSIsArabic}, + {"ArabicPresentationForms-A", xmlUCSIsArabicPresentationFormsA}, + {"ArabicPresentationForms-B", xmlUCSIsArabicPresentationFormsB}, + {"Armenian", xmlUCSIsArmenian}, + {"Arrows", xmlUCSIsArrows}, + {"BasicLatin", xmlUCSIsBasicLatin}, + {"Bengali", xmlUCSIsBengali}, + {"BlockElements", xmlUCSIsBlockElements}, + {"Bopomofo", xmlUCSIsBopomofo}, + {"BopomofoExtended", xmlUCSIsBopomofoExtended}, + {"BoxDrawing", xmlUCSIsBoxDrawing}, + {"BraillePatterns", xmlUCSIsBraillePatterns}, + {"Buhid", xmlUCSIsBuhid}, + {"ByzantineMusicalSymbols", xmlUCSIsByzantineMusicalSymbols}, + {"CJKCompatibility", xmlUCSIsCJKCompatibility}, + {"CJKCompatibilityForms", xmlUCSIsCJKCompatibilityForms}, + {"CJKCompatibilityIdeographs", xmlUCSIsCJKCompatibilityIdeographs}, + {"CJKCompatibilityIdeographsSupplement", xmlUCSIsCJKCompatibilityIdeographsSupplement}, + {"CJKRadicalsSupplement", xmlUCSIsCJKRadicalsSupplement}, + {"CJKSymbolsandPunctuation", xmlUCSIsCJKSymbolsandPunctuation}, + {"CJKUnifiedIdeographs", xmlUCSIsCJKUnifiedIdeographs}, + {"CJKUnifiedIdeographsExtensionA", xmlUCSIsCJKUnifiedIdeographsExtensionA}, + {"CJKUnifiedIdeographsExtensionB", xmlUCSIsCJKUnifiedIdeographsExtensionB}, + {"Cherokee", xmlUCSIsCherokee}, + {"CombiningDiacriticalMarks", xmlUCSIsCombiningDiacriticalMarks}, + {"CombiningDiacriticalMarksforSymbols", xmlUCSIsCombiningDiacriticalMarksforSymbols}, + {"CombiningHalfMarks", xmlUCSIsCombiningHalfMarks}, + {"CombiningMarksforSymbols", xmlUCSIsCombiningMarksforSymbols}, + {"ControlPictures", xmlUCSIsControlPictures}, + {"CurrencySymbols", xmlUCSIsCurrencySymbols}, + {"CypriotSyllabary", xmlUCSIsCypriotSyllabary}, + {"Cyrillic", xmlUCSIsCyrillic}, + {"CyrillicSupplement", xmlUCSIsCyrillicSupplement}, + {"Deseret", xmlUCSIsDeseret}, + {"Devanagari", xmlUCSIsDevanagari}, + {"Dingbats", xmlUCSIsDingbats}, + {"EnclosedAlphanumerics", xmlUCSIsEnclosedAlphanumerics}, + {"EnclosedCJKLettersandMonths", xmlUCSIsEnclosedCJKLettersandMonths}, + {"Ethiopic", xmlUCSIsEthiopic}, + {"GeneralPunctuation", xmlUCSIsGeneralPunctuation}, + {"GeometricShapes", xmlUCSIsGeometricShapes}, + {"Georgian", xmlUCSIsGeorgian}, + {"Gothic", xmlUCSIsGothic}, + {"Greek", xmlUCSIsGreek}, + {"GreekExtended", xmlUCSIsGreekExtended}, + {"GreekandCoptic", xmlUCSIsGreekandCoptic}, + {"Gujarati", xmlUCSIsGujarati}, + {"Gurmukhi", xmlUCSIsGurmukhi}, + {"HalfwidthandFullwidthForms", xmlUCSIsHalfwidthandFullwidthForms}, + {"HangulCompatibilityJamo", xmlUCSIsHangulCompatibilityJamo}, + {"HangulJamo", xmlUCSIsHangulJamo}, + {"HangulSyllables", xmlUCSIsHangulSyllables}, + {"Hanunoo", xmlUCSIsHanunoo}, + {"Hebrew", xmlUCSIsHebrew}, + {"HighPrivateUseSurrogates", xmlUCSIsHighPrivateUseSurrogates}, + {"HighSurrogates", xmlUCSIsHighSurrogates}, + {"Hiragana", xmlUCSIsHiragana}, + {"IPAExtensions", xmlUCSIsIPAExtensions}, + {"IdeographicDescriptionCharacters", xmlUCSIsIdeographicDescriptionCharacters}, + {"Kanbun", xmlUCSIsKanbun}, + {"KangxiRadicals", xmlUCSIsKangxiRadicals}, + {"Kannada", xmlUCSIsKannada}, + {"Katakana", xmlUCSIsKatakana}, + {"KatakanaPhoneticExtensions", xmlUCSIsKatakanaPhoneticExtensions}, + {"Khmer", xmlUCSIsKhmer}, + {"KhmerSymbols", xmlUCSIsKhmerSymbols}, + {"Lao", xmlUCSIsLao}, + {"Latin-1Supplement", xmlUCSIsLatin1Supplement}, + {"LatinExtended-A", xmlUCSIsLatinExtendedA}, + {"LatinExtended-B", xmlUCSIsLatinExtendedB}, + {"LatinExtendedAdditional", xmlUCSIsLatinExtendedAdditional}, + {"LetterlikeSymbols", xmlUCSIsLetterlikeSymbols}, + {"Limbu", xmlUCSIsLimbu}, + {"LinearBIdeograms", xmlUCSIsLinearBIdeograms}, + {"LinearBSyllabary", xmlUCSIsLinearBSyllabary}, + {"LowSurrogates", xmlUCSIsLowSurrogates}, + {"Malayalam", xmlUCSIsMalayalam}, + {"MathematicalAlphanumericSymbols", xmlUCSIsMathematicalAlphanumericSymbols}, + {"MathematicalOperators", xmlUCSIsMathematicalOperators}, + {"MiscellaneousMathematicalSymbols-A", xmlUCSIsMiscellaneousMathematicalSymbolsA}, + {"MiscellaneousMathematicalSymbols-B", xmlUCSIsMiscellaneousMathematicalSymbolsB}, + {"MiscellaneousSymbols", xmlUCSIsMiscellaneousSymbols}, + {"MiscellaneousSymbolsandArrows", xmlUCSIsMiscellaneousSymbolsandArrows}, + {"MiscellaneousTechnical", xmlUCSIsMiscellaneousTechnical}, + {"Mongolian", xmlUCSIsMongolian}, + {"MusicalSymbols", xmlUCSIsMusicalSymbols}, + {"Myanmar", xmlUCSIsMyanmar}, + {"NumberForms", xmlUCSIsNumberForms}, + {"Ogham", xmlUCSIsOgham}, + {"OldItalic", xmlUCSIsOldItalic}, + {"OpticalCharacterRecognition", xmlUCSIsOpticalCharacterRecognition}, + {"Oriya", xmlUCSIsOriya}, + {"Osmanya", xmlUCSIsOsmanya}, + {"PhoneticExtensions", xmlUCSIsPhoneticExtensions}, + {"PrivateUse", xmlUCSIsPrivateUse}, + {"PrivateUseArea", xmlUCSIsPrivateUseArea}, + {"Runic", xmlUCSIsRunic}, + {"Shavian", xmlUCSIsShavian}, + {"Sinhala", xmlUCSIsSinhala}, + {"SmallFormVariants", xmlUCSIsSmallFormVariants}, + {"SpacingModifierLetters", xmlUCSIsSpacingModifierLetters}, + {"Specials", xmlUCSIsSpecials}, + {"SuperscriptsandSubscripts", xmlUCSIsSuperscriptsandSubscripts}, + {"SupplementalArrows-A", xmlUCSIsSupplementalArrowsA}, + {"SupplementalArrows-B", xmlUCSIsSupplementalArrowsB}, + {"SupplementalMathematicalOperators", xmlUCSIsSupplementalMathematicalOperators}, + {"SupplementaryPrivateUseArea-A", xmlUCSIsSupplementaryPrivateUseAreaA}, + {"SupplementaryPrivateUseArea-B", xmlUCSIsSupplementaryPrivateUseAreaB}, + {"Syriac", xmlUCSIsSyriac}, + {"Tagalog", xmlUCSIsTagalog}, + {"Tagbanwa", xmlUCSIsTagbanwa}, + {"Tags", xmlUCSIsTags}, + {"TaiLe", xmlUCSIsTaiLe}, + {"TaiXuanJingSymbols", xmlUCSIsTaiXuanJingSymbols}, + {"Tamil", xmlUCSIsTamil}, + {"Telugu", xmlUCSIsTelugu}, + {"Thaana", xmlUCSIsThaana}, + {"Thai", xmlUCSIsThai}, + {"Tibetan", xmlUCSIsTibetan}, + {"Ugaritic", xmlUCSIsUgaritic}, + {"UnifiedCanadianAboriginalSyllabics", xmlUCSIsUnifiedCanadianAboriginalSyllabics}, + {"VariationSelectors", xmlUCSIsVariationSelectors}, + {"VariationSelectorsSupplement", xmlUCSIsVariationSelectorsSupplement}, + {"YiRadicals", xmlUCSIsYiRadicals}, + {"YiSyllables", xmlUCSIsYiSyllables}, + {"YijingHexagramSymbols", xmlUCSIsYijingHexagramSymbols}}; + +static const xmlUnicodeRange xmlUnicodeCats[] = { + {"C", xmlUCSIsCatC}, + {"Cc", xmlUCSIsCatCc}, + {"Cf", xmlUCSIsCatCf}, + {"Co", xmlUCSIsCatCo}, + {"Cs", xmlUCSIsCatCs}, + {"L", xmlUCSIsCatL}, + {"Ll", xmlUCSIsCatLl}, + {"Lm", xmlUCSIsCatLm}, + {"Lo", xmlUCSIsCatLo}, + {"Lt", xmlUCSIsCatLt}, + {"Lu", xmlUCSIsCatLu}, + {"M", xmlUCSIsCatM}, + {"Mc", xmlUCSIsCatMc}, + {"Me", xmlUCSIsCatMe}, + {"Mn", xmlUCSIsCatMn}, + {"N", xmlUCSIsCatN}, + {"Nd", xmlUCSIsCatNd}, + {"Nl", xmlUCSIsCatNl}, + {"No", xmlUCSIsCatNo}, + {"P", xmlUCSIsCatP}, + {"Pc", xmlUCSIsCatPc}, + {"Pd", xmlUCSIsCatPd}, + {"Pe", xmlUCSIsCatPe}, + {"Pf", xmlUCSIsCatPf}, + {"Pi", xmlUCSIsCatPi}, + {"Po", xmlUCSIsCatPo}, + {"Ps", xmlUCSIsCatPs}, + {"S", xmlUCSIsCatS}, + {"Sc", xmlUCSIsCatSc}, + {"Sk", xmlUCSIsCatSk}, + {"Sm", xmlUCSIsCatSm}, + {"So", xmlUCSIsCatSo}, + {"Z", xmlUCSIsCatZ}, + {"Zl", xmlUCSIsCatZl}, + {"Zp", xmlUCSIsCatZp}, + {"Zs", xmlUCSIsCatZs}}; + +static const xmlUnicodeNameTable xmlUnicodeBlockTbl = {xmlUnicodeBlocks, 128}; +static const xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, 36}; + +/** + * xmlUCSIsBlock: + * @code: UCS code point + * @block: UCS block name + * + * Check whether the character is part of the UCS Block + * + * Returns 1 if true, 0 if false and -1 on unknown block + */ +int +xmlUCSIsBlock(int code, const char *block) { + xmlIntFunc *func; + + func = xmlUnicodeLookup(&xmlUnicodeBlockTbl, block); + if (func == NULL) + return (-1); + return (func(code)); +} + /** * xmlUCSIsCat: * @code: UCS code point @@ -3175,4 +3175,4 @@ return (func(code)); } -#endif /* LIBXML_UNICODE_ENABLED */ +#endif /* LIBXML_REGEXP_ENABLED */
diff --git a/third_party/libxml/src/xpath.c b/third_party/libxml/src/xpath.c index 1bd0fba..7be6cfd 100644 --- a/third_party/libxml/src/xpath.c +++ b/third_party/libxml/src/xpath.c
@@ -46,6 +46,7 @@ #include "private/buf.h" #include "private/error.h" +#include "private/memory.h" #include "private/xpath.h" /* Disabled for now */ @@ -133,11 +134,48 @@ #if defined(LIBXML_XPATH_ENABLED) -/************************************************************************ - * * - * Floating point stuff * - * * - ************************************************************************/ +static void +xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs); + +static const struct { + const char *name; + xmlXPathFunction func; +} xmlXPathStandardFunctions[] = { + { "boolean", xmlXPathBooleanFunction }, + { "ceiling", xmlXPathCeilingFunction }, + { "count", xmlXPathCountFunction }, + { "concat", xmlXPathConcatFunction }, + { "contains", xmlXPathContainsFunction }, + { "id", xmlXPathIdFunction }, + { "false", xmlXPathFalseFunction }, + { "floor", xmlXPathFloorFunction }, + { "last", xmlXPathLastFunction }, + { "lang", xmlXPathLangFunction }, + { "local-name", xmlXPathLocalNameFunction }, + { "not", xmlXPathNotFunction }, + { "name", xmlXPathNameFunction }, + { "namespace-uri", xmlXPathNamespaceURIFunction }, + { "normalize-space", xmlXPathNormalizeFunction }, + { "number", xmlXPathNumberFunction }, + { "position", xmlXPathPositionFunction }, + { "round", xmlXPathRoundFunction }, + { "string", xmlXPathStringFunction }, + { "string-length", xmlXPathStringLengthFunction }, + { "starts-with", xmlXPathStartsWithFunction }, + { "substring", xmlXPathSubstringFunction }, + { "substring-before", xmlXPathSubstringBeforeFunction }, + { "substring-after", xmlXPathSubstringAfterFunction }, + { "sum", xmlXPathSumFunction }, + { "true", xmlXPathTrueFunction }, + { "translate", xmlXPathTranslateFunction } +}; + +#define NUM_STANDARD_FUNCTIONS \ + (sizeof(xmlXPathStandardFunctions) / sizeof(xmlXPathStandardFunctions[0])) + +#define SF_HASH_SIZE 64 + +static unsigned char xmlXPathSFHash[SF_HASH_SIZE]; double xmlXPathNAN = 0.0; double xmlXPathPINF = 0.0; @@ -153,6 +191,18 @@ xmlInitParser(); } +ATTRIBUTE_NO_SANITIZE_INTEGER +static unsigned +xmlXPathSFComputeHash(const xmlChar *name) { + unsigned hashValue = 5381; + const xmlChar *ptr; + + for (ptr = name; *ptr; ptr++) + hashValue = hashValue * 33 + *ptr; + + return(hashValue); +} + /** * xmlInitXPathInternal: * @@ -161,6 +211,8 @@ ATTRIBUTE_NO_SANITIZE("float-divide-by-zero") void xmlInitXPathInternal(void) { + size_t i; + #if defined(NAN) && defined(INFINITY) xmlXPathNAN = NAN; xmlXPathPINF = INFINITY; @@ -172,8 +224,34 @@ xmlXPathPINF = 1.0 / zero; xmlXPathNINF = -xmlXPathPINF; #endif + + /* + * Initialize hash table for standard functions + */ + + for (i = 0; i < SF_HASH_SIZE; i++) + xmlXPathSFHash[i] = UCHAR_MAX; + + for (i = 0; i < NUM_STANDARD_FUNCTIONS; i++) { + const char *name = xmlXPathStandardFunctions[i].name; + int bucketIndex = xmlXPathSFComputeHash(BAD_CAST name) % SF_HASH_SIZE; + + while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) { + bucketIndex += 1; + if (bucketIndex >= SF_HASH_SIZE) + bucketIndex = 0; + } + + xmlXPathSFHash[bucketIndex] = i; + } } +/************************************************************************ + * * + * Floating point stuff * + * * + ************************************************************************/ + /** * xmlXPathIsNaN: * @val: a double value @@ -230,7 +308,10 @@ static void xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes); +#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content) + #ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON + /** * xmlXPathCmpNodesExt: * @node1: the first node @@ -248,7 +329,7 @@ int misc = 0, precedence1 = 0, precedence2 = 0; xmlNodePtr miscNode1 = NULL, miscNode2 = NULL; xmlNodePtr cur, root; - ptrdiff_t l1, l2; + XML_INTPTR_T l1, l2; if ((node1 == NULL) || (node2 == NULL)) return(-2); @@ -262,12 +343,12 @@ switch (node1->type) { case XML_ELEMENT_NODE: if (node2->type == XML_ELEMENT_NODE) { - if ((0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + if ((0 > XML_NODE_SORT_VALUE(node1)) && + (0 > XML_NODE_SORT_VALUE(node2)) && (node1->doc == node2->doc)) { - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -XML_NODE_SORT_VALUE(node1); + l2 = -XML_NODE_SORT_VALUE(node2); if (l1 < l2) return(1); if (l1 > l2) @@ -312,7 +393,7 @@ node1 = node1->parent; } if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) || - (0 <= (ptrdiff_t) node1->content)) { + (0 <= XML_NODE_SORT_VALUE(node1))) { /* * Fallback for whatever case. */ @@ -362,7 +443,7 @@ node2 = node2->parent; } if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) || - (0 <= (ptrdiff_t) node2->content)) + (0 <= XML_NODE_SORT_VALUE(node2))) { node2 = miscNode2; precedence2 = 0; @@ -435,12 +516,12 @@ */ if ((node1->type == XML_ELEMENT_NODE) && (node2->type == XML_ELEMENT_NODE) && - (0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + (0 > XML_NODE_SORT_VALUE(node1)) && + (0 > XML_NODE_SORT_VALUE(node2)) && (node1->doc == node2->doc)) { - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -XML_NODE_SORT_VALUE(node1); + l2 = -XML_NODE_SORT_VALUE(node2); if (l1 < l2) return(1); if (l1 > l2) @@ -503,12 +584,12 @@ */ if ((node1->type == XML_ELEMENT_NODE) && (node2->type == XML_ELEMENT_NODE) && - (0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + (0 > XML_NODE_SORT_VALUE(node1)) && + (0 > XML_NODE_SORT_VALUE(node2)) && (node1->doc == node2->doc)) { - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -XML_NODE_SORT_VALUE(node1); + l2 = -XML_NODE_SORT_VALUE(node2); if (l1 < l2) return(1); if (l1 > l2) @@ -876,7 +957,11 @@ if (cur == NULL) return(NULL); memset(cur, 0, sizeof(xmlXPathCompExpr)); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + cur->maxStep = 1; +#else cur->maxStep = 10; +#endif cur->nbStep = 0; cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep * sizeof(xmlXPathStepOp)); @@ -963,20 +1048,21 @@ xmlXPathCompExprPtr comp = ctxt->comp; if (comp->nbStep >= comp->maxStep) { xmlXPathStepOp *real; + int newSize; - if (comp->maxStep >= XPATH_MAX_STEPS) { + newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]), + 10, XPATH_MAX_STEPS); + if (newSize < 0) { xmlXPathPErrMemory(ctxt); return(-1); } - comp->maxStep *= 2; - real = (xmlXPathStepOp *) xmlRealloc(comp->steps, - comp->maxStep * sizeof(xmlXPathStepOp)); + real = xmlRealloc(comp->steps, newSize * sizeof(real[0])); if (real == NULL) { - comp->maxStep /= 2; xmlXPathPErrMemory(ctxt); return(-1); } comp->steps = real; + comp->maxStep = newSize; } comp->last = comp->nbStep; comp->steps[comp->nbStep].ch1 = ch1; @@ -1384,6 +1470,10 @@ } fprintf(output, "\n"); finish: + /* OP_VALUE has invalid ch1. */ + if (op->op == XPATH_OP_VALUE) + return; + if (op->ch1 >= 0) xmlXPathDebugDumpStepOp(output, comp, &comp->steps[op->ch1], depth + 1); if (op->ch2 >= 0) @@ -1921,7 +2011,7 @@ } /** - * valuePop: + * xmlXPathValuePop: * @ctxt: an XPath evaluation context * * Pops the top XPath object from the value stack @@ -1929,7 +2019,7 @@ * Returns the XPath object just removed */ xmlXPathObjectPtr -valuePop(xmlXPathParserContextPtr ctxt) +xmlXPathValuePop(xmlXPathParserContextPtr ctxt) { xmlXPathObjectPtr ret; @@ -1945,8 +2035,9 @@ ctxt->valueTab[ctxt->valueNr] = NULL; return (ret); } + /** - * valuePush: + * xmlXPathValuePush: * @ctxt: an XPath evaluation context * @value: the XPath object * @@ -1958,7 +2049,7 @@ * The object is destroyed in case of error. */ int -valuePush(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value) +xmlXPathValuePush(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value) { if (ctxt == NULL) return(-1); if (value == NULL) { @@ -1970,22 +2061,23 @@ } if (ctxt->valueNr >= ctxt->valueMax) { xmlXPathObjectPtr *tmp; + int newSize; - if (ctxt->valueMax >= XPATH_MAX_STACK_DEPTH) { + newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]), + 10, XPATH_MAX_STACK_DEPTH); + if (newSize < 0) { xmlXPathPErrMemory(ctxt); xmlXPathFreeObject(value); return (-1); } - tmp = (xmlXPathObjectPtr *) xmlRealloc(ctxt->valueTab, - 2 * ctxt->valueMax * - sizeof(ctxt->valueTab[0])); + tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0])); if (tmp == NULL) { xmlXPathPErrMemory(ctxt); xmlXPathFreeObject(value); return (-1); } - ctxt->valueMax *= 2; ctxt->valueTab = tmp; + ctxt->valueMax = newSize; } ctxt->valueTab[ctxt->valueNr] = value; ctxt->value = value; @@ -2006,7 +2098,7 @@ xmlXPathObjectPtr obj; int ret; - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); if (obj == NULL) { xmlXPathSetError(ctxt, XPATH_INVALID_OPERAND); return(0); @@ -2033,7 +2125,7 @@ xmlXPathObjectPtr obj; double ret; - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); if (obj == NULL) { xmlXPathSetError(ctxt, XPATH_INVALID_OPERAND); return(0); @@ -2060,7 +2152,7 @@ xmlXPathObjectPtr obj; xmlChar * ret; - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); if (obj == NULL) { xmlXPathSetError(ctxt, XPATH_INVALID_OPERAND); return(NULL); @@ -2095,7 +2187,7 @@ xmlXPathSetTypeError(ctxt); return(NULL); } - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); ret = obj->nodesetval; obj->nodesetval = NULL; xmlXPathReleaseObject(ctxt->context, obj); @@ -2124,7 +2216,7 @@ xmlXPathSetTypeError(ctxt); return(NULL); } - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); ret = obj->user; obj->user = NULL; xmlXPathReleaseObject(ctxt->context, obj); @@ -2336,7 +2428,7 @@ */ long xmlXPathOrderDocElems(xmlDocPtr doc) { - ptrdiff_t count = 0; + XML_INTPTR_T count = 0; xmlNodePtr cur; if (doc == NULL) @@ -2344,7 +2436,8 @@ cur = doc->children; while (cur != NULL) { if (cur->type == XML_ELEMENT_NODE) { - cur->content = (void *) (-(++count)); + count += 1; + cur->content = XML_INT_TO_PTR(-count); if (cur->children != NULL) { cur = cur->children; continue; @@ -2436,13 +2529,13 @@ */ if ((node1->type == XML_ELEMENT_NODE) && (node2->type == XML_ELEMENT_NODE) && - (0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + (0 > XML_NODE_SORT_VALUE(node1)) && + (0 > XML_NODE_SORT_VALUE(node2)) && (node1->doc == node2->doc)) { - ptrdiff_t l1, l2; + XML_INTPTR_T l1, l2; - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -XML_NODE_SORT_VALUE(node1); + l2 = -XML_NODE_SORT_VALUE(node2); if (l1 < l2) return(1); if (l1 > l2) @@ -2499,13 +2592,13 @@ */ if ((node1->type == XML_ELEMENT_NODE) && (node2->type == XML_ELEMENT_NODE) && - (0 > (ptrdiff_t) node1->content) && - (0 > (ptrdiff_t) node2->content) && + (0 > XML_NODE_SORT_VALUE(node1)) && + (0 > XML_NODE_SORT_VALUE(node2)) && (node1->doc == node2->doc)) { - ptrdiff_t l1, l2; + XML_INTPTR_T l1, l2; - l1 = -((ptrdiff_t) node1->content); - l2 = -((ptrdiff_t) node2->content); + l1 = -XML_NODE_SORT_VALUE(node1); + l2 = -XML_NODE_SORT_VALUE(node2); if (l1 < l2) return(1); if (l1 > l2) @@ -2714,6 +2807,24 @@ return(0); } +static int +xmlXPathNodeSetGrow(xmlNodeSetPtr cur) { + xmlNodePtr *temp; + int newSize; + + newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]), + XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH); + if (newSize < 0) + return(-1); + temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0])); + if (temp == NULL) + return(-1); + cur->nodeMax = newSize; + cur->nodeTab = temp; + + return(0); +} + /** * xmlXPathNodeSetAddNs: * @cur: the initial node set @@ -2749,25 +2860,9 @@ /* * grow the nodeTab if needed */ - if (cur->nodeMax == 0) { - cur->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT * - sizeof(xmlNodePtr)); - if (cur->nodeTab == NULL) - return(-1); - memset(cur->nodeTab, 0 , - XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); - cur->nodeMax = XML_NODESET_DEFAULT; - } else if (cur->nodeNr == cur->nodeMax) { - xmlNodePtr *temp; - - if (cur->nodeMax >= XPATH_MAX_NODESET_LENGTH) + if (cur->nodeNr >= cur->nodeMax) { + if (xmlXPathNodeSetGrow(cur) < 0) return(-1); - temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * - sizeof(xmlNodePtr)); - if (temp == NULL) - return(-1); - cur->nodeMax *= 2; - cur->nodeTab = temp; } nsNode = xmlXPathNodeSetDupNs(node, ns); if(nsNode == NULL) @@ -2801,26 +2896,11 @@ /* * grow the nodeTab if needed */ - if (cur->nodeMax == 0) { - cur->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT * - sizeof(xmlNodePtr)); - if (cur->nodeTab == NULL) - return(-1); - memset(cur->nodeTab, 0 , - XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); - cur->nodeMax = XML_NODESET_DEFAULT; - } else if (cur->nodeNr == cur->nodeMax) { - xmlNodePtr *temp; - - if (cur->nodeMax >= XPATH_MAX_NODESET_LENGTH) + if (cur->nodeNr >= cur->nodeMax) { + if (xmlXPathNodeSetGrow(cur) < 0) return(-1); - temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * - sizeof(xmlNodePtr)); - if (temp == NULL) - return(-1); - cur->nodeMax *= 2; - cur->nodeTab = temp; } + if (val->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) val; xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); @@ -2851,26 +2931,11 @@ /* * grow the nodeTab if needed */ - if (cur->nodeMax == 0) { - cur->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT * - sizeof(xmlNodePtr)); - if (cur->nodeTab == NULL) - return(-1); - memset(cur->nodeTab, 0 , - XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); - cur->nodeMax = XML_NODESET_DEFAULT; - } else if (cur->nodeNr == cur->nodeMax) { - xmlNodePtr *temp; - - if (cur->nodeMax >= XPATH_MAX_NODESET_LENGTH) + if (cur->nodeNr >= cur->nodeMax) { + if (xmlXPathNodeSetGrow(cur) < 0) return(-1); - temp = (xmlNodePtr *) xmlRealloc(cur->nodeTab, cur->nodeMax * 2 * - sizeof(xmlNodePtr)); - if (temp == NULL) - return(-1); - cur->nodeTab = temp; - cur->nodeMax *= 2; } + if (val->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) val; xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); @@ -2939,26 +3004,10 @@ /* * grow the nodeTab if needed */ - if (val1->nodeMax == 0) { - val1->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT * - sizeof(xmlNodePtr)); - if (val1->nodeTab == NULL) - goto error; - memset(val1->nodeTab, 0 , - XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); - val1->nodeMax = XML_NODESET_DEFAULT; - } else if (val1->nodeNr == val1->nodeMax) { - xmlNodePtr *temp; - - if (val1->nodeMax >= XPATH_MAX_NODESET_LENGTH) + if (val1->nodeNr >= val1->nodeMax) { + if (xmlXPathNodeSetGrow(val1) < 0) goto error; - temp = (xmlNodePtr *) xmlRealloc(val1->nodeTab, val1->nodeMax * 2 * - sizeof(xmlNodePtr)); - if (temp == NULL) - goto error; - val1->nodeTab = temp; - val1->nodeMax *= 2; - } + } if (n2->type == XML_NAMESPACE_DECL) { xmlNsPtr ns = (xmlNsPtr) n2; xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns); @@ -3025,26 +3074,10 @@ /* * grow the nodeTab if needed */ - if (set1->nodeMax == 0) { - set1->nodeTab = (xmlNodePtr *) xmlMalloc( - XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); - if (set1->nodeTab == NULL) - goto error; - memset(set1->nodeTab, 0, - XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); - set1->nodeMax = XML_NODESET_DEFAULT; - } else if (set1->nodeNr >= set1->nodeMax) { - xmlNodePtr *temp; - - if (set1->nodeMax >= XPATH_MAX_NODESET_LENGTH) + if (set1->nodeNr >= set1->nodeMax) { + if (xmlXPathNodeSetGrow(set1) < 0) goto error; - temp = (xmlNodePtr *) xmlRealloc( - set1->nodeTab, set1->nodeMax * 2 * sizeof(xmlNodePtr)); - if (temp == NULL) - goto error; - set1->nodeTab = temp; - set1->nodeMax *= 2; - } + } set1->nodeTab[set1->nodeNr++] = n2; skip_node: set2->nodeTab[i] = NULL; @@ -3080,26 +3113,10 @@ for (i = 0;i < set2->nodeNr;i++) { n2 = set2->nodeTab[i]; - if (set1->nodeMax == 0) { - set1->nodeTab = (xmlNodePtr *) xmlMalloc( - XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); - if (set1->nodeTab == NULL) - goto error; - memset(set1->nodeTab, 0, - XML_NODESET_DEFAULT * sizeof(xmlNodePtr)); - set1->nodeMax = XML_NODESET_DEFAULT; - } else if (set1->nodeNr >= set1->nodeMax) { - xmlNodePtr *temp; - - if (set1->nodeMax >= XPATH_MAX_NODESET_LENGTH) + if (set1->nodeNr >= set1->nodeMax) { + if (xmlXPathNodeSetGrow(set1) < 0) goto error; - temp = (xmlNodePtr *) xmlRealloc( - set1->nodeTab, set1->nodeMax * 2 * sizeof(xmlNodePtr)); - if (temp == NULL) - goto error; - set1->nodeTab = temp; - set1->nodeMax *= 2; - } + } set1->nodeTab[set1->nodeNr++] = n2; set2->nodeTab[i] = NULL; } @@ -3803,6 +3820,7 @@ xmlXPathRegisterFuncNS(xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri, xmlXPathFunction f) { int ret; + void *payload; if (ctxt == NULL) return(-1); @@ -3817,9 +3835,8 @@ } if (f == NULL) return(xmlHashRemoveEntry2(ctxt->funcHash, name, ns_uri, NULL)); -XML_IGNORE_FPTR_CAST_WARNINGS - ret = xmlHashAddEntry2(ctxt->funcHash, name, ns_uri, (void *) f); -XML_POP_WARNINGS + memcpy(&payload, &f, sizeof(f)); + ret = xmlHashAddEntry2(ctxt->funcHash, name, ns_uri, payload); if (ret < 0) { xmlXPathErrMemory(ctxt); return(-1); @@ -3858,18 +3875,6 @@ */ xmlXPathFunction xmlXPathFunctionLookup(xmlXPathContextPtr ctxt, const xmlChar *name) { - if (ctxt == NULL) - return (NULL); - - if (ctxt->funcLookupFunc != NULL) { - xmlXPathFunction ret; - xmlXPathFuncLookupFunc f; - - f = ctxt->funcLookupFunc; - ret = f(ctxt->funcLookupData, name, NULL); - if (ret != NULL) - return(ret); - } return(xmlXPathFunctionLookupNS(ctxt, name, NULL)); } @@ -3888,12 +3893,29 @@ xmlXPathFunctionLookupNS(xmlXPathContextPtr ctxt, const xmlChar *name, const xmlChar *ns_uri) { xmlXPathFunction ret; + void *payload; if (ctxt == NULL) return(NULL); if (name == NULL) return(NULL); + if (ns_uri == NULL) { + int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE; + + while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) { + int funcIndex = xmlXPathSFHash[bucketIndex]; + + if (strcmp(xmlXPathStandardFunctions[funcIndex].name, + (char *) name) == 0) + return(xmlXPathStandardFunctions[funcIndex].func); + + bucketIndex += 1; + if (bucketIndex >= SF_HASH_SIZE) + bucketIndex = 0; + } + } + if (ctxt->funcLookupFunc != NULL) { xmlXPathFuncLookupFunc f; @@ -3906,9 +3928,9 @@ if (ctxt->funcHash == NULL) return(NULL); -XML_IGNORE_FPTR_CAST_WARNINGS - ret = (xmlXPathFunction) xmlHashLookup2(ctxt->funcHash, name, ns_uri); -XML_POP_WARNINGS + payload = xmlHashLookup2(ctxt->funcHash, name, ns_uri); + memcpy(&ret, &payload, sizeof(payload)); + return(ret); } @@ -4934,13 +4956,6 @@ } #endif - xmlXPathRegisterAllFunctions(ret); - - if (ret->lastError.code != XML_ERR_OK) { - xmlXPathFreeContext(ret); - return(NULL); - } - return(ret); } @@ -5048,15 +5063,18 @@ memset(ret, 0 , sizeof(xmlXPathParserContext)); /* Allocate the value stack */ - ret->valueTab = (xmlXPathObjectPtr *) - xmlMalloc(10 * sizeof(xmlXPathObjectPtr)); +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + ret->valueMax = 1; +#else + ret->valueMax = 10; +#endif + ret->valueTab = xmlMalloc(ret->valueMax * sizeof(xmlXPathObjectPtr)); if (ret->valueTab == NULL) { xmlFree(ret); xmlXPathErrMemory(ctxt); return(NULL); } ret->valueNr = 0; - ret->valueMax = 10; ret->value = NULL; ret->context = ctxt; @@ -5273,10 +5291,10 @@ for (i = 0;i < ns->nodeNr;i++) { str2 = xmlXPathCastNodeToString(ns->nodeTab[i]); if (str2 != NULL) { - valuePush(ctxt, xmlXPathCacheNewString(ctxt, str2)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2)); xmlFree(str2); xmlXPathNumberFunction(ctxt, 1); - valuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f)); + xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f)); ret = xmlXPathCompareValues(ctxt, inf, strict); if (ret) break; @@ -5329,10 +5347,10 @@ for (i = 0;i < ns->nodeNr;i++) { str2 = xmlXPathCastNodeToString(ns->nodeTab[i]); if (str2 != NULL) { - valuePush(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2)); xmlFree(str2); - valuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s)); + xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s)); ret = xmlXPathCompareValues(ctxt, inf, strict); if (ret) break; @@ -5486,9 +5504,9 @@ case XPATH_STRING: return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val)); case XPATH_BOOLEAN: - valuePush(ctxt, arg); + xmlXPathValuePush(ctxt, arg); xmlXPathBooleanFunction(ctxt, 1); - valuePush(ctxt, val); + xmlXPathValuePush(ctxt, val); return(xmlXPathCompareValues(ctxt, inf, strict)); default: xmlXPathReleaseObject(ctxt->context, arg); @@ -5588,11 +5606,11 @@ for (i=0;i<ns->nodeNr;i++) { str2 = xmlXPathCastNodeToString(ns->nodeTab[i]); if (str2 != NULL) { - valuePush(ctxt, xmlXPathCacheNewString(ctxt, str2)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2)); xmlFree(str2); xmlXPathNumberFunction(ctxt, 1); CHECK_ERROR0; - val = valuePop(ctxt); + val = xmlXPathValuePop(ctxt); v = val->floatval; xmlXPathReleaseObject(ctxt->context, val); if (!xmlXPathIsNaN(v)) { @@ -5787,9 +5805,9 @@ xmlXPathCastNumberToBoolean(arg1->floatval)); break; case XPATH_STRING: - valuePush(ctxt, arg2); + xmlXPathValuePush(ctxt, arg2); xmlXPathNumberFunction(ctxt, 1); - arg2 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); if (ctxt->error) break; /* Falls through. */ @@ -5845,9 +5863,9 @@ ret = xmlStrEqual(arg1->stringval, arg2->stringval); break; case XPATH_NUMBER: - valuePush(ctxt, arg1); + xmlXPathValuePush(ctxt, arg1); xmlXPathNumberFunction(ctxt, 1); - arg1 = valuePop(ctxt); + arg1 = xmlXPathValuePop(ctxt); if (ctxt->error) break; /* Hand check NaN and Infinity equalities */ @@ -5912,8 +5930,8 @@ int ret = 0; if ((ctxt == NULL) || (ctxt->context == NULL)) return(0); - arg2 = valuePop(ctxt); - arg1 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); + arg1 = xmlXPathValuePop(ctxt); if ((arg1 == NULL) || (arg2 == NULL)) { if (arg1 != NULL) xmlXPathReleaseObject(ctxt->context, arg1); @@ -5987,8 +6005,8 @@ int ret = 0; if ((ctxt == NULL) || (ctxt->context == NULL)) return(0); - arg2 = valuePop(ctxt); - arg1 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); + arg1 = xmlXPathValuePop(ctxt); if ((arg1 == NULL) || (arg2 == NULL)) { if (arg1 != NULL) xmlXPathReleaseObject(ctxt->context, arg1); @@ -6078,8 +6096,8 @@ xmlXPathObjectPtr arg1, arg2; if ((ctxt == NULL) || (ctxt->context == NULL)) return(0); - arg2 = valuePop(ctxt); - arg1 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); + arg1 = xmlXPathValuePop(ctxt); if ((arg1 == NULL) || (arg2 == NULL)) { if (arg1 != NULL) xmlXPathReleaseObject(ctxt->context, arg1); @@ -6111,14 +6129,14 @@ } if (arg1->type != XPATH_NUMBER) { - valuePush(ctxt, arg1); + xmlXPathValuePush(ctxt, arg1); xmlXPathNumberFunction(ctxt, 1); - arg1 = valuePop(ctxt); + arg1 = xmlXPathValuePop(ctxt); } if (arg2->type != XPATH_NUMBER) { - valuePush(ctxt, arg2); + xmlXPathValuePush(ctxt, arg2); xmlXPathNumberFunction(ctxt, 1); - arg2 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); } if (ctxt->error) goto error; @@ -6206,7 +6224,7 @@ xmlXPathObjectPtr arg; double val; - arg = valuePop(ctxt); + arg = xmlXPathValuePop(ctxt); if (arg == NULL) XP_ERROR(XPATH_INVALID_OPERAND); val = xmlXPathCastToNumberInternal(ctxt, arg); @@ -6229,7 +6247,7 @@ xmlXPathObjectPtr arg; double val; - arg = valuePop(ctxt); + arg = xmlXPathValuePop(ctxt); if (arg == NULL) XP_ERROR(XPATH_INVALID_OPERAND); val = xmlXPathCastToNumberInternal(ctxt, arg); @@ -6252,7 +6270,7 @@ xmlXPathObjectPtr arg; double val; - arg = valuePop(ctxt); + arg = xmlXPathValuePop(ctxt); if (arg == NULL) XP_ERROR(XPATH_INVALID_OPERAND); val = xmlXPathCastToNumberInternal(ctxt, arg); @@ -6276,7 +6294,7 @@ xmlXPathObjectPtr arg; double val; - arg = valuePop(ctxt); + arg = xmlXPathValuePop(ctxt); if (arg == NULL) XP_ERROR(XPATH_INVALID_OPERAND); val = xmlXPathCastToNumberInternal(ctxt, arg); @@ -6299,7 +6317,7 @@ xmlXPathObjectPtr arg; double arg1, arg2; - arg = valuePop(ctxt); + arg = xmlXPathValuePop(ctxt); if (arg == NULL) XP_ERROR(XPATH_INVALID_OPERAND); arg2 = xmlXPathCastToNumberInternal(ctxt, arg); @@ -7107,7 +7125,7 @@ xmlXPathRoot(xmlXPathParserContextPtr ctxt) { if ((ctxt == NULL) || (ctxt->context == NULL)) return; - valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, (xmlNodePtr) ctxt->context->doc)); } @@ -7132,7 +7150,7 @@ xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs) { CHECK_ARITY(0); if (ctxt->context->contextSize >= 0) { - valuePush(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize)); } else { XP_ERROR(XPATH_INVALID_CTXT_SIZE); @@ -7154,7 +7172,7 @@ xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs) { CHECK_ARITY(0); if (ctxt->context->proximityPosition >= 0) { - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->proximityPosition)); } else { XP_ERROR(XPATH_INVALID_CTXT_POSITION); @@ -7178,12 +7196,12 @@ ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if ((cur == NULL) || (cur->nodesetval == NULL)) - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0)); else - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, (double) cur->nodesetval->nodeNr)); xmlXPathReleaseObject(ctxt->context, cur); } @@ -7276,7 +7294,7 @@ xmlXPathObjectPtr obj; CHECK_ARITY(1); - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND); if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) { xmlNodeSetPtr ns; @@ -7304,7 +7322,7 @@ } } xmlXPathReleaseObject(ctxt->context, obj); - valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret)); return; } tokens = xmlXPathCastToString(obj); @@ -7315,7 +7333,7 @@ if (ret == NULL) xmlXPathPErrMemory(ctxt); xmlFree(tokens); - valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret)); } /** @@ -7338,7 +7356,7 @@ if (ctxt == NULL) return; if (nargs == 0) { - valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); nargs = 1; } @@ -7347,10 +7365,10 @@ ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) { - valuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); } else { int i = 0; /* Should be first in document order !!!!! */ switch (cur->nodesetval->nodeTab[i]->type) { @@ -7358,17 +7376,17 @@ case XML_ATTRIBUTE_NODE: case XML_PI_NODE: if (cur->nodesetval->nodeTab[i]->name[0] == ' ') - valuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); else - valuePush(ctxt, xmlXPathCacheNewString(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, cur->nodesetval->nodeTab[i]->name)); break; case XML_NAMESPACE_DECL: - valuePush(ctxt, xmlXPathCacheNewString(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix)); break; default: - valuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); } } xmlXPathReleaseObject(ctxt->context, cur); @@ -7395,7 +7413,7 @@ if (ctxt == NULL) return; if (nargs == 0) { - valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); nargs = 1; } CHECK_ARITY(1); @@ -7403,23 +7421,23 @@ ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) { - valuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); } else { int i = 0; /* Should be first in document order !!!!! */ switch (cur->nodesetval->nodeTab[i]->type) { case XML_ELEMENT_NODE: case XML_ATTRIBUTE_NODE: if (cur->nodesetval->nodeTab[i]->ns == NULL) - valuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); else - valuePush(ctxt, xmlXPathCacheNewString(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, cur->nodesetval->nodeTab[i]->ns->href)); break; default: - valuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); } } xmlXPathReleaseObject(ctxt->context, cur); @@ -7453,7 +7471,7 @@ xmlXPathObjectPtr cur; if (nargs == 0) { - valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); nargs = 1; } @@ -7462,10 +7480,10 @@ ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) { - valuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); } else { int i = 0; /* Should be first in document order !!!!! */ @@ -7473,11 +7491,11 @@ case XML_ELEMENT_NODE: case XML_ATTRIBUTE_NODE: if (cur->nodesetval->nodeTab[i]->name[0] == ' ') - valuePush(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); else if ((cur->nodesetval->nodeTab[i]->ns == NULL) || (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) { - valuePush(ctxt, xmlXPathCacheNewString(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, cur->nodesetval->nodeTab[i]->name)); } else { xmlChar *fullname; @@ -7489,11 +7507,11 @@ fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name); if (fullname == NULL) xmlXPathPErrMemory(ctxt); - valuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname)); } break; default: - valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, cur->nodesetval->nodeTab[i])); xmlXPathLocalNameFunction(ctxt, 1); } @@ -7548,12 +7566,12 @@ stringval = xmlXPathCastNodeToString(ctxt->context->node); if (stringval == NULL) xmlXPathPErrMemory(ctxt); - valuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval)); return; } CHECK_ARITY(1); - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND); if (cur->type != XPATH_STRING) { stringval = xmlXPathCastToString(cur); @@ -7562,7 +7580,7 @@ xmlXPathReleaseObject(ctxt->context, cur); cur = xmlXPathCacheWrapString(ctxt, stringval); } - valuePush(ctxt, cur); + xmlXPathValuePush(ctxt, cur); } /** @@ -7585,14 +7603,14 @@ if ((ctxt == NULL) || (ctxt->context == NULL)) return; if (ctxt->context->node == NULL) { - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0)); } else { xmlChar *content; content = xmlXPathCastNodeToString(ctxt->context->node); if (content == NULL) xmlXPathPErrMemory(ctxt); - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, xmlUTF8Strlen(content))); xmlFree(content); } @@ -7601,8 +7619,8 @@ CHECK_ARITY(1); CAST_TO_STRING; CHECK_TYPE(XPATH_STRING); - cur = valuePop(ctxt); - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, + cur = xmlXPathValuePop(ctxt); + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, xmlUTF8Strlen(cur->stringval))); xmlXPathReleaseObject(ctxt->context, cur); } @@ -7627,7 +7645,7 @@ } CAST_TO_STRING; - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if ((cur == NULL) || (cur->type != XPATH_STRING)) { xmlXPathReleaseObject(ctxt->context, cur); return; @@ -7636,7 +7654,7 @@ while (nargs > 0) { CAST_TO_STRING; - newobj = valuePop(ctxt); + newobj = xmlXPathValuePop(ctxt); if ((newobj == NULL) || (newobj->type != XPATH_STRING)) { xmlXPathReleaseObject(ctxt->context, newobj); xmlXPathReleaseObject(ctxt->context, cur); @@ -7650,7 +7668,7 @@ xmlXPathReleaseObject(ctxt->context, newobj); nargs--; } - valuePush(ctxt, cur); + xmlXPathValuePush(ctxt, cur); } /** @@ -7670,9 +7688,9 @@ CHECK_ARITY(2); CAST_TO_STRING; CHECK_TYPE(XPATH_STRING); - needle = valuePop(ctxt); + needle = xmlXPathValuePop(ctxt); CAST_TO_STRING; - hay = valuePop(ctxt); + hay = xmlXPathValuePop(ctxt); if ((hay == NULL) || (hay->type != XPATH_STRING)) { xmlXPathReleaseObject(ctxt->context, hay); @@ -7680,9 +7698,9 @@ XP_ERROR(XPATH_INVALID_TYPE); } if (xmlStrstr(hay->stringval, needle->stringval)) - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1)); else - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0)); xmlXPathReleaseObject(ctxt->context, hay); xmlXPathReleaseObject(ctxt->context, needle); } @@ -7705,9 +7723,9 @@ CHECK_ARITY(2); CAST_TO_STRING; CHECK_TYPE(XPATH_STRING); - needle = valuePop(ctxt); + needle = xmlXPathValuePop(ctxt); CAST_TO_STRING; - hay = valuePop(ctxt); + hay = xmlXPathValuePop(ctxt); if ((hay == NULL) || (hay->type != XPATH_STRING)) { xmlXPathReleaseObject(ctxt->context, hay); @@ -7716,9 +7734,9 @@ } n = xmlStrlen(needle->stringval); if (xmlStrncmp(hay->stringval, needle->stringval, n)) - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0)); else - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1)); xmlXPathReleaseObject(ctxt->context, hay); xmlXPathReleaseObject(ctxt->context, needle); } @@ -7769,19 +7787,19 @@ if (nargs == 3) { CAST_TO_NUMBER; CHECK_TYPE(XPATH_NUMBER); - len = valuePop(ctxt); + len = xmlXPathValuePop(ctxt); le = len->floatval; xmlXPathReleaseObject(ctxt->context, len); } CAST_TO_NUMBER; CHECK_TYPE(XPATH_NUMBER); - start = valuePop(ctxt); + start = xmlXPathValuePop(ctxt); in = start->floatval; xmlXPathReleaseObject(ctxt->context, start); CAST_TO_STRING; CHECK_TYPE(XPATH_STRING); - str = valuePop(ctxt); + str = xmlXPathValuePop(ctxt); if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */ i = INT_MAX; @@ -7817,10 +7835,10 @@ xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i); if (ret == NULL) xmlXPathPErrMemory(ctxt); - valuePush(ctxt, xmlXPathCacheNewString(ctxt, ret)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret)); xmlFree(ret); } else { - valuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); + xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, "")); } xmlXPathReleaseObject(ctxt->context, str); @@ -7848,9 +7866,9 @@ CHECK_ARITY(2); CAST_TO_STRING; - find = valuePop(ctxt); + find = xmlXPathValuePop(ctxt); CAST_TO_STRING; - str = valuePop(ctxt); + str = xmlXPathValuePop(ctxt); if (ctxt->error != 0) goto error; @@ -7864,7 +7882,7 @@ xmlXPathPErrMemory(ctxt); goto error; } - valuePush(ctxt, xmlXPathCacheWrapString(ctxt, result)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, result)); error: xmlXPathReleaseObject(ctxt->context, str); @@ -7894,9 +7912,9 @@ CHECK_ARITY(2); CAST_TO_STRING; - find = valuePop(ctxt); + find = xmlXPathValuePop(ctxt); CAST_TO_STRING; - str = valuePop(ctxt); + str = xmlXPathValuePop(ctxt); if (ctxt->error != 0) goto error; @@ -7910,7 +7928,7 @@ xmlXPathPErrMemory(ctxt); goto error; } - valuePush(ctxt, xmlXPathCacheWrapString(ctxt, result)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, result)); error: xmlXPathReleaseObject(ctxt->context, str); @@ -7942,7 +7960,7 @@ source = xmlXPathCastNodeToString(ctxt->context->node); if (source == NULL) xmlXPathPErrMemory(ctxt); - valuePush(ctxt, xmlXPathCacheWrapString(ctxt, source)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, source)); nargs = 1; } @@ -8010,11 +8028,11 @@ CHECK_ARITY(3); CAST_TO_STRING; - to = valuePop(ctxt); + to = xmlXPathValuePop(ctxt); CAST_TO_STRING; - from = valuePop(ctxt); + from = xmlXPathValuePop(ctxt); CAST_TO_STRING; - str = valuePop(ctxt); + str = xmlXPathValuePop(ctxt); if (ctxt->error != 0) goto error; @@ -8077,7 +8095,7 @@ if (content == NULL) xmlXPathPErrMemory(ctxt); else - valuePush(ctxt, xmlXPathCacheWrapString(ctxt, content)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content)); xmlBufFree(target); error: xmlXPathReleaseObject(ctxt->context, str); @@ -8103,7 +8121,7 @@ xmlXPathObjectPtr cur; CHECK_ARITY(1); - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND); if (cur->type != XPATH_BOOLEAN) { int boolval = xmlXPathCastToBoolean(cur); @@ -8111,7 +8129,7 @@ xmlXPathReleaseObject(ctxt->context, cur); cur = xmlXPathCacheNewBoolean(ctxt, boolval); } - valuePush(ctxt, cur); + xmlXPathValuePush(ctxt, cur); } /** @@ -8143,7 +8161,7 @@ void xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs) { CHECK_ARITY(0); - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1)); } /** @@ -8157,7 +8175,7 @@ void xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs) { CHECK_ARITY(0); - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0)); } /** @@ -8193,7 +8211,7 @@ CHECK_ARITY(1); CAST_TO_STRING; CHECK_TYPE(XPATH_STRING); - val = valuePop(ctxt); + val = xmlXPathValuePop(ctxt); lang = val->stringval; cur = ctxt->context->node; while (cur != NULL) { @@ -8216,7 +8234,7 @@ xmlFree((void *)theLang); xmlXPathReleaseObject(ctxt->context, val); - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret)); } /** @@ -8235,21 +8253,21 @@ if (ctxt == NULL) return; if (nargs == 0) { if (ctxt->context->node == NULL) { - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0)); } else { xmlChar* content = xmlNodeGetContent(ctxt->context->node); if (content == NULL) xmlXPathPErrMemory(ctxt); res = xmlXPathStringEvalNumber(content); - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res)); xmlFree(content); } return; } CHECK_ARITY(1); - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if (cur->type != XPATH_NUMBER) { double floatval; @@ -8257,7 +8275,7 @@ xmlXPathReleaseObject(ctxt->context, cur); cur = xmlXPathCacheNewFloat(ctxt, floatval); } - valuePush(ctxt, cur); + xmlXPathValuePush(ctxt, cur); } /** @@ -8281,7 +8299,7 @@ ((ctxt->value->type != XPATH_NODESET) && (ctxt->value->type != XPATH_XSLT_TREE))) XP_ERROR(XPATH_INVALID_TYPE); - cur = valuePop(ctxt); + cur = xmlXPathValuePop(ctxt); if ((cur->nodesetval != NULL) && (cur->nodesetval->nodeNr != 0)) { for (i = 0; i < cur->nodesetval->nodeNr; i++) { @@ -8289,7 +8307,7 @@ cur->nodesetval->nodeTab[i]); } } - valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res)); xmlXPathReleaseObject(ctxt->context, cur); } @@ -8657,18 +8675,22 @@ (IS_EXTENDER(c))) { if (len + 10 > max) { xmlChar *tmp; - if (max > XML_MAX_NAME_LENGTH) { + int newSize; + + newSize = xmlGrowCapacity(max, 1, 1, XML_MAX_NAME_LENGTH); + if (newSize < 0) { xmlFree(buffer); - XP_ERRORNULL(XPATH_EXPR_ERROR); + xmlXPathErr(ctxt, XPATH_EXPR_ERROR); + return(NULL); } - max *= 2; - tmp = (xmlChar *) xmlRealloc(buffer, max); + tmp = xmlRealloc(buffer, newSize); if (tmp == NULL) { xmlFree(buffer); xmlXPathPErrMemory(ctxt); return(NULL); } buffer = tmp; + max = newSize; } COPY_BUF(buffer,len,c); NEXTL(l); @@ -10399,7 +10421,7 @@ CHECK_TYPE0(XPATH_NODESET); - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); /* * Setup namespaces. */ @@ -10500,7 +10522,7 @@ } contextSeq = obj->nodesetval; if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) { - valuePush(ctxt, obj); + xmlXPathValuePush(ctxt, obj); return(0); } /* @@ -10915,7 +10937,7 @@ * Hand over the result. Better to push the set also in * case of errors. */ - valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq)); + xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq)); /* * Reset the context node. */ @@ -10993,8 +11015,8 @@ first); CHECK_ERROR0; - arg2 = valuePop(ctxt); - arg1 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); + arg1 = xmlXPathValuePop(ctxt); if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { xmlXPathReleaseObject(ctxt->context, arg1); @@ -11020,7 +11042,7 @@ if (arg1->nodesetval == NULL) xmlXPathPErrMemory(ctxt); } - valuePush(ctxt, arg1); + xmlXPathValuePush(ctxt, arg1); xmlXPathReleaseObject(ctxt->context, arg2); total += cur; break; @@ -11034,7 +11056,7 @@ if (op->ch2 != -1) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); CHECK_ERROR0; - valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); break; case XPATH_OP_COLLECT:{ @@ -11048,7 +11070,7 @@ break; } case XPATH_OP_VALUE: - valuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4)); + xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4)); break; case XPATH_OP_SORT: if (op->ch1 != -1) @@ -11132,8 +11154,8 @@ && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */ } - arg2 = valuePop(ctxt); - arg1 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); + arg1 = xmlXPathValuePop(ctxt); if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { xmlXPathReleaseObject(ctxt->context, arg1); @@ -11159,7 +11181,7 @@ if (arg1->nodesetval == NULL) xmlXPathPErrMemory(ctxt); } - valuePush(ctxt, arg1); + xmlXPathValuePush(ctxt, arg1); xmlXPathReleaseObject(ctxt->context, arg2); total += cur; break; @@ -11173,7 +11195,7 @@ if (op->ch2 != -1) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); CHECK_ERROR0; - valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); break; case XPATH_OP_COLLECT:{ @@ -11187,7 +11209,7 @@ break; } case XPATH_OP_VALUE: - valuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4)); + xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4)); break; case XPATH_OP_SORT: if (op->ch1 != -1) @@ -11274,14 +11296,14 @@ * stack to avoid freeing it prematurely. */ CHECK_TYPE0(XPATH_NODESET); - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); set = obj->nodesetval; if (set != NULL) { xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1); if (set->nodeNr > 0) *first = set->nodeTab[0]; } - valuePush(ctxt, obj); + xmlXPathValuePush(ctxt, obj); return (total); } @@ -11319,7 +11341,7 @@ xmlXPathBooleanFunction(ctxt, 1); if ((ctxt->value == NULL) || (ctxt->value->boolval == 0)) break; - arg2 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); if (ctxt->error) { xmlXPathFreeObject(arg2); @@ -11336,7 +11358,7 @@ xmlXPathBooleanFunction(ctxt, 1); if ((ctxt->value == NULL) || (ctxt->value->boolval == 1)) break; - arg2 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); if (ctxt->error) { xmlXPathFreeObject(arg2); @@ -11356,7 +11378,7 @@ equal = xmlXPathEqualValues(ctxt); else equal = xmlXPathNotEqualValues(ctxt); - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal)); break; case XPATH_OP_CMP: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); @@ -11364,7 +11386,7 @@ total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); CHECK_ERROR0; ret = xmlXPathCompareValues(ctxt, op->value, op->value2); - valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret)); + xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret)); break; case XPATH_OP_PLUS: total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); @@ -11402,8 +11424,8 @@ total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); CHECK_ERROR0; - arg2 = valuePop(ctxt); - arg1 = valuePop(ctxt); + arg2 = xmlXPathValuePop(ctxt); + arg1 = xmlXPathValuePop(ctxt); if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) || (arg2 == NULL) || (arg2->type != XPATH_NODESET)) { xmlXPathReleaseObject(ctxt->context, arg1); @@ -11431,7 +11453,7 @@ xmlXPathPErrMemory(ctxt); } - valuePush(ctxt, arg1); + xmlXPathValuePush(ctxt, arg1); xmlXPathReleaseObject(ctxt->context, arg2); break; case XPATH_OP_ROOT: @@ -11444,7 +11466,7 @@ if (op->ch2 != -1) total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]); CHECK_ERROR0; - valuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, + xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node)); break; case XPATH_OP_COLLECT:{ @@ -11458,7 +11480,7 @@ break; } case XPATH_OP_VALUE: - valuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4)); + xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4)); break; case XPATH_OP_VARIABLE:{ xmlXPathObjectPtr val; @@ -11470,7 +11492,7 @@ val = xmlXPathVariableLookup(ctxt->context, op->value4); if (val == NULL) XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); - valuePush(ctxt, val); + xmlXPathValuePush(ctxt, val); } else { const xmlChar *URI; @@ -11483,7 +11505,7 @@ op->value4, URI); if (val == NULL) XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); - valuePush(ctxt, val); + xmlXPathValuePush(ctxt, val); } break; } @@ -11661,12 +11683,12 @@ * prematurely. */ CHECK_TYPE0(XPATH_NODESET); - obj = valuePop(ctxt); + obj = xmlXPathValuePop(ctxt); set = obj->nodesetval; if (set != NULL) xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, set->nodeNr, 1); - valuePush(ctxt, obj); + xmlXPathValuePush(ctxt, obj); break; } case XPATH_OP_SORT: @@ -11738,7 +11760,7 @@ if (ctxt->error != XPATH_EXPRESSION_OK) return(-1); - resObj = valuePop(ctxt); + resObj = xmlXPathValuePop(ctxt); if (resObj == NULL) return(-1); break; @@ -11750,7 +11772,7 @@ if (ctxt->error != XPATH_EXPRESSION_OK) return(-1); - resObj = valuePop(ctxt); + resObj = xmlXPathValuePop(ctxt); if (resObj == NULL) return(-1); break; @@ -12031,15 +12053,20 @@ return(-1); if (ctxt->valueTab == NULL) { +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + int valueMax = 1; +#else + int valueMax = 10; +#endif + /* Allocate the value stack */ - ctxt->valueTab = (xmlXPathObjectPtr *) - xmlMalloc(10 * sizeof(xmlXPathObjectPtr)); + ctxt->valueTab = xmlMalloc(valueMax * sizeof(xmlXPathObjectPtr)); if (ctxt->valueTab == NULL) { xmlXPathPErrMemory(ctxt); return(-1); } ctxt->valueNr = 0; - ctxt->valueMax = 10; + ctxt->valueMax = valueMax; ctxt->value = NULL; } #ifdef XPATH_STREAMING @@ -12062,7 +12089,7 @@ res = xmlXPathRunStreamEval(ctxt, ctxt->comp->stream, &resObj, 0); if ((res != -1) && (resObj != NULL)) { - valuePush(ctxt, resObj); + xmlXPathValuePush(ctxt, resObj); return(0); } if (resObj != NULL) @@ -12477,7 +12504,7 @@ if (pctxt->valueNr != ((toBool) ? 0 : 1)) xmlXPathErr(pctxt, XPATH_STACK_ERROR); else if (!toBool) - resObj = valuePop(pctxt); + resObj = xmlXPathValuePop(pctxt); } if (resObjPtr) @@ -12620,7 +12647,7 @@ xmlXPathErr(ctxt, XPATH_STACK_ERROR); res = NULL; } else { - res = valuePop(ctxt); + res = xmlXPathValuePop(ctxt); } xmlXPathFreeParserContext(ctxt); @@ -12685,186 +12712,17 @@ return(xmlXPathEval(str, ctxt)); } -/************************************************************************ - * * - * Extra functions not pertaining to the XPath spec * - * * - ************************************************************************/ -/** - * xmlXPathEscapeUriFunction: - * @ctxt: the XPath Parser context - * @nargs: the number of arguments - * - * Implement the escape-uri() XPath function - * string escape-uri(string $str, bool $escape-reserved) - * - * This function applies the URI escaping rules defined in section 2 of [RFC - * 2396] to the string supplied as $uri-part, which typically represents all - * or part of a URI. The effect of the function is to replace any special - * character in the string by an escape sequence of the form %xx%yy..., - * where xxyy... is the hexadecimal representation of the octets used to - * represent the character in UTF-8. - * - * The set of characters that are escaped depends on the setting of the - * boolean argument $escape-reserved. - * - * If $escape-reserved is true, all characters are escaped other than lower - * case letters a-z, upper case letters A-Z, digits 0-9, and the characters - * referred to in [RFC 2396] as "marks": specifically, "-" | "_" | "." | "!" - * | "~" | "*" | "'" | "(" | ")". The "%" character itself is escaped only - * if it is not followed by two hexadecimal digits (that is, 0-9, a-f, and - * A-F). - * - * If $escape-reserved is false, the behavior differs in that characters - * referred to in [RFC 2396] as reserved characters are not escaped. These - * characters are ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ",". - * - * [RFC 2396] does not define whether escaped URIs should use lower case or - * upper case for hexadecimal digits. To ensure that escaped URIs can be - * compared using string comparison functions, this function must always use - * the upper-case letters A-F. - * - * Generally, $escape-reserved should be set to true when escaping a string - * that is to form a single part of a URI, and to false when escaping an - * entire URI or URI reference. - * - * In the case of non-ascii characters, the string is encoded according to - * utf-8 and then converted according to RFC 2396. - * - * Examples - * xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), true()) - * returns "gopher%3A%2F%2Fspinaltap.micro.umn.edu%2F00%2FWeather%2FCalifornia%2FLos%20Angeles%23ocean" - * xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), false()) - * returns "gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles%23ocean" - * - */ -static void -xmlXPathEscapeUriFunction(xmlXPathParserContextPtr ctxt, int nargs) { - xmlXPathObjectPtr str; - int escape_reserved; - xmlBufPtr target; - xmlChar *cptr; - xmlChar escape[4]; - - CHECK_ARITY(2); - - escape_reserved = xmlXPathPopBoolean(ctxt); - - CAST_TO_STRING; - str = valuePop(ctxt); - - target = xmlBufCreate(50); - - escape[0] = '%'; - escape[3] = 0; - - if (target) { - for (cptr = str->stringval; *cptr; cptr++) { - if ((*cptr >= 'A' && *cptr <= 'Z') || - (*cptr >= 'a' && *cptr <= 'z') || - (*cptr >= '0' && *cptr <= '9') || - *cptr == '-' || *cptr == '_' || *cptr == '.' || - *cptr == '!' || *cptr == '~' || *cptr == '*' || - *cptr == '\''|| *cptr == '(' || *cptr == ')' || - (*cptr == '%' && - ((cptr[1] >= 'A' && cptr[1] <= 'F') || - (cptr[1] >= 'a' && cptr[1] <= 'f') || - (cptr[1] >= '0' && cptr[1] <= '9')) && - ((cptr[2] >= 'A' && cptr[2] <= 'F') || - (cptr[2] >= 'a' && cptr[2] <= 'f') || - (cptr[2] >= '0' && cptr[2] <= '9'))) || - (!escape_reserved && - (*cptr == ';' || *cptr == '/' || *cptr == '?' || - *cptr == ':' || *cptr == '@' || *cptr == '&' || - *cptr == '=' || *cptr == '+' || *cptr == '$' || - *cptr == ','))) { - xmlBufAdd(target, cptr, 1); - } else { - if ((*cptr >> 4) < 10) - escape[1] = '0' + (*cptr >> 4); - else - escape[1] = 'A' - 10 + (*cptr >> 4); - if ((*cptr & 0xF) < 10) - escape[2] = '0' + (*cptr & 0xF); - else - escape[2] = 'A' - 10 + (*cptr & 0xF); - - xmlBufAdd(target, &escape[0], 3); - } - } - } - valuePush(ctxt, xmlXPathCacheNewString(ctxt, xmlBufContent(target))); - xmlBufFree(target); - xmlXPathReleaseObject(ctxt->context, str); -} - /** * xmlXPathRegisterAllFunctions: * @ctxt: the XPath context * + * DEPRECATED: No-op since 2.14.0. + * * Registers all default XPath functions in this context */ void -xmlXPathRegisterAllFunctions(xmlXPathContextPtr ctxt) +xmlXPathRegisterAllFunctions(xmlXPathContextPtr ctxt ATTRIBUTE_UNUSED) { - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"boolean", - xmlXPathBooleanFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"ceiling", - xmlXPathCeilingFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"count", - xmlXPathCountFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"concat", - xmlXPathConcatFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"contains", - xmlXPathContainsFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"id", - xmlXPathIdFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"false", - xmlXPathFalseFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"floor", - xmlXPathFloorFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"last", - xmlXPathLastFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"lang", - xmlXPathLangFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"local-name", - xmlXPathLocalNameFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"not", - xmlXPathNotFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"name", - xmlXPathNameFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"namespace-uri", - xmlXPathNamespaceURIFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"normalize-space", - xmlXPathNormalizeFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"number", - xmlXPathNumberFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"position", - xmlXPathPositionFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"round", - xmlXPathRoundFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"string", - xmlXPathStringFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"string-length", - xmlXPathStringLengthFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"starts-with", - xmlXPathStartsWithFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"substring", - xmlXPathSubstringFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"substring-before", - xmlXPathSubstringBeforeFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"substring-after", - xmlXPathSubstringAfterFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"sum", - xmlXPathSumFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"true", - xmlXPathTrueFunction); - xmlXPathRegisterFunc(ctxt, (const xmlChar *)"translate", - xmlXPathTranslateFunction); - - xmlXPathRegisterFuncNS(ctxt, (const xmlChar *)"escape-uri", - (const xmlChar *)"http://www.w3.org/2002/08/xquery-functions", - xmlXPathEscapeUriFunction); } #endif /* LIBXML_XPATH_ENABLED */
diff --git a/third_party/libxml/win32/include/libxml/xmlversion.h b/third_party/libxml/win32/include/libxml/xmlversion.h index 1b2940df..50edba6 100644 --- a/third_party/libxml/win32/include/libxml/xmlversion.h +++ b/third_party/libxml/win32/include/libxml/xmlversion.h
@@ -15,21 +15,21 @@ * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.14.0" +#define LIBXML_DOTTED_VERSION "2.14.2" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 21400 +#define LIBXML_VERSION 21402 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "21400" +#define LIBXML_VERSION_STRING "21402" /** * LIBXML_VERSION_EXTRA: @@ -44,7 +44,7 @@ * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(21400); +#define LIBXML_TEST_VERSION xmlCheckVersion(21402); /** * LIBXML_THREAD_ENABLED: @@ -155,11 +155,9 @@ /** * LIBXML_LEGACY_ENABLED: * - * Whether the deprecated APIs are compiled in for compatibility + * Removed in 2.14 */ -#if 0 -#define LIBXML_LEGACY_ENABLED -#endif +#undef LIBXML_LEGACY_ENABLED /** * LIBXML_C14N_ENABLED: @@ -245,11 +243,9 @@ /** * LIBXML_UNICODE_ENABLED: * - * Whether the Unicode related interfaces are compiled in + * Removed in 2.14 */ -#if 0 -#define LIBXML_UNICODE_ENABLED -#endif +#undef LIBXML_UNICODE_ENABLED /** * LIBXML_REGEXP_ENABLED: @@ -270,6 +266,15 @@ #endif /** + * LIBXML_RELAXNG_ENABLED: + * + * Whether the RelaxNG validation interfaces are compiled in + */ +#if 0 +#define LIBXML_RELAXNG_ENABLED +#endif + +/** * LIBXML_SCHEMAS_ENABLED: * * Whether the Schemas validation interfaces are compiled in
diff --git a/third_party/llvm-libc/src b/third_party/llvm-libc/src index 1e5d08e..64a6b82 160000 --- a/third_party/llvm-libc/src +++ b/third_party/llvm-libc/src
@@ -1 +1 @@ -Subproject commit 1e5d08e2bb8cca9f544c8fbfae84f2dc1f4d3605 +Subproject commit 64a6b82928934c23e2d75ae78b7c3714907210f5
diff --git a/third_party/perfetto b/third_party/perfetto index 54d422c1..86ffe81 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit 54d422c148f1c98bef74195086c70320960c9c6b +Subproject commit 86ffe81a57cee5ebefffb8ebacc2d7125998627e
diff --git a/third_party/private-join-and-compute/README.chromium b/third_party/private-join-and-compute/README.chromium index 1a9e5f3e..b192be7 100644 --- a/third_party/private-join-and-compute/README.chromium +++ b/third_party/private-join-and-compute/README.chromium
@@ -3,7 +3,7 @@ URL: https://github.com/google/private-join-and-compute Version: N/A Date: 2025-02-14 -Revision: b4137857c71153ca99d315dc3797e7c71ea07ed5 +Revision: 08df854f9fa14304fb4f19df48c7b6bc31f140d3 License: Apache-2.0 License File: src/LICENSE Security Critical: yes @@ -15,10 +15,11 @@ Local Modifications: Stripped all the dependencies except for BoringSSL. chromium_patch.h is the only new file. Other modifications are removing the includes, fixing the macroses to those used in Chrome and removing unused functions and classes. The diff files are in order of modifications: -files.diff - the files deleted from the original library. Generated using following command in `chromium/src` where private-join-and-compute.b413785 HEAD is at Revision given above, `diff -qr /tmp/private-join-and-compute.b413785/private_join_and_compute/ third_party/private-join-and-compute/src/`. +files.diff - the files deleted from the original library. Generated using following command in `chromium/src` where private-join-and-compute.08df854 HEAD is at Revision given above, `diff -qr /tmp/private-join-and-compute.08df854/private_join_and_compute/ third_party/private-join-and-compute/src/ > third_party/private-join-and-compute/patches/files.diff`. dependencies.diff - removes all the dependencies on Abseil and other libraries replacing them with Chrome's analogues. compilation.diff - fixes compilation/static analyzers in Chrome. fix_nulls.diff - makes the presubmit happy by replacing NULL with nullptr. Use-absil-statusor.diff - removes existing status/statusor library's version, and uses absl::status and absl::statusor as source of truth. private_key_inverse.diff - makes private key inverse use Fermat's Little Theorem instead of ModInverseBlinded -version-b413785.diff - Copy files from version b4137857c71153ca99d315dc3797e7c71ea07ed5 and edit them to fix include macros, include header guards. Export classes. Assume macro OPENSSL_IS_BORINGSSL is defined and remove OpensslInit() call in `context.cc`. Pathc file is created using the following command `diff -r /tmp/private-join-and-compute.b413785/private_join_and_compute/ third_party/private-join-and-compute/src/ > version-b413785.diff`. +version-b413785.diff - Copy files from version b4137857c71153ca99d315dc3797e7c71ea07ed5 and edit them to fix include macros, include header guards. Export classes. Assume macro OPENSSL_IS_BORINGSSL is defined and remove OpensslInit() call in `context.cc`. Patch file is created using the following command `diff -r /tmp/private-join-and-compute.b413785/private_join_and_compute/ third_party/private-join-and-compute/src/ > version-b413785.diff`. +version-08df854.diff - Only util/status_macros.h is changed among the files imported to chromium between versions b413785 and 08df854. This is verified using `git diff b413785..08df854 --stat util/LICENSE util/status.inc util/status_macros.h crypto/big_num.* crypto/context.* crypto/ec_commutative_cipher.* crypto/ec_group.* crypto/ec_point.* crypto/elgamal.*`. Patch file is created using the following command `diff -r /tmp/private-join-and-compute.08df854/private_join_and_compute/ third_party/private-join-and-compute/src/ > third_party/private-join-and-compute/patches/version-08df854.diff`, where private-join-and-compute.08df854 HEAD is at Revision given above
diff --git a/third_party/private-join-and-compute/patches/files.diff b/third_party/private-join-and-compute/patches/files.diff index 804a241c..012726b1 100644 --- a/third_party/private-join-and-compute/patches/files.diff +++ b/third_party/private-join-and-compute/patches/files.diff
@@ -1,103 +1,102 @@ -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: BUILD +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: BUILD Only in third_party/private-join-and-compute/src/: BUILD.gn Only in third_party/private-join-and-compute/src/: chromium_patch.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: client.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: client_impl.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: client_impl.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: client.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: client_impl.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: client_impl.h Only in third_party/private-join-and-compute/src/: CONTRIBUTING.md -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/big_num.cc and third_party/private-join-and-compute/src/crypto/big_num.cc differ -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/big_num.h and third_party/private-join-and-compute/src/crypto/big_num.h differ -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: BUILD -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: camenisch_shoup.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: camenisch_shoup.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: camenisch_shoup_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: commutative_elgamal.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: commutative_elgamal.h -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/context.cc and third_party/private-join-and-compute/src/crypto/context.cc differ -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/context.h and third_party/private-join-and-compute/src/crypto/context.h differ -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: dodis_yampolskiy_prf -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/ec_commutative_cipher.cc and third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.cc differ -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/ec_commutative_cipher.h and third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.h differ -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/ec_group.cc and third_party/private-join-and-compute/src/crypto/ec_group.cc differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/big_num.cc and third_party/private-join-and-compute/src/crypto/big_num.cc differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/big_num.h and third_party/private-join-and-compute/src/crypto/big_num.h differ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: BUILD +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: camenisch_shoup.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: camenisch_shoup.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: camenisch_shoup_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: commutative_elgamal.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: commutative_elgamal.h +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/context.cc and third_party/private-join-and-compute/src/crypto/context.cc differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/context.h and third_party/private-join-and-compute/src/crypto/context.h differ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: dodis_yampolskiy_prf +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_commutative_cipher.cc and third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.cc differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_commutative_cipher.h and third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.h differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_group.cc and third_party/private-join-and-compute/src/crypto/ec_group.cc differ Only in third_party/private-join-and-compute/src/crypto: ec_group.cc.bak -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/ec_group.h and third_party/private-join-and-compute/src/crypto/ec_group.h differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_group.h and third_party/private-join-and-compute/src/crypto/ec_group.h differ Only in third_party/private-join-and-compute/src/crypto: ec_group.h.bak -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: ec_key.proto -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/ec_point.cc and third_party/private-join-and-compute/src/crypto/ec_point.cc differ -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/ec_point.h and third_party/private-join-and-compute/src/crypto/ec_point.h differ -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: ec_point_util.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: ec_point_util.h -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/elgamal.cc and third_party/private-join-and-compute/src/crypto/elgamal.cc differ -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto/elgamal.h and third_party/private-join-and-compute/src/crypto/elgamal.h differ -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: elgamal.proto -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: fixed_base_exp.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: fixed_base_exp.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: mont_mul.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: mont_mul.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: openssl_init.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: openssl_init.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: paillier.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: paillier.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: paillier.proto -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: pedersen_over_zn.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: pedersen_over_zn.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: pedersen_over_zn_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: proto -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: shanks_discrete_log.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: shanks_discrete_log.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: simultaneous_fixed_bases_exp.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: simultaneous_fixed_bases_exp.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: simultaneous_fixed_bases_exp_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: two_modulus_crt.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/crypto: two_modulus_crt.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: data_util.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: data_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: ec_key.proto +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_point.cc and third_party/private-join-and-compute/src/crypto/ec_point.cc differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_point.h and third_party/private-join-and-compute/src/crypto/ec_point.h differ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: ec_point_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: ec_point_util.h +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/elgamal.cc and third_party/private-join-and-compute/src/crypto/elgamal.cc differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/elgamal.h and third_party/private-join-and-compute/src/crypto/elgamal.h differ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: elgamal.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: fixed_base_exp.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: fixed_base_exp.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: mont_mul.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: mont_mul.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: openssl_init.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: openssl_init.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: paillier.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: paillier.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: paillier.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: pedersen_over_zn.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: pedersen_over_zn.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: pedersen_over_zn_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: shanks_discrete_log.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: shanks_discrete_log.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: simultaneous_fixed_bases_exp.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: simultaneous_fixed_bases_exp.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: simultaneous_fixed_bases_exp_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: two_modulus_crt.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: two_modulus_crt.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: data_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: data_util.h Only in third_party/private-join-and-compute/src/: DEPS -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: generate_dummy_data.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: generate_dummy_data.cc Only in third_party/private-join-and-compute/src/: LICENSE -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: match.proto -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: message_sink.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: private_intersection_sum.proto -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: private_join_and_compute.proto -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: private_join_and_compute_rpc_impl.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: private_join_and_compute_rpc_impl.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: protocol_client.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: protocol_server.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: py -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: server.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: server_impl.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/: server_impl.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: BUILD +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: match.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: message_sink.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: private_intersection_sum.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: private_join_and_compute.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: private_join_and_compute_rpc_impl.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: private_join_and_compute_rpc_impl.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: protocol_client.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: protocol_server.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: py +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: server.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: server_impl.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: server_impl.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: BUILD Only in third_party/private-join-and-compute/src/util: canonical_errors.cc Only in third_party/private-join-and-compute/src/util: canonical_errors.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: ec_key_util.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: ec_key_util.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: ec_key_util_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: elgamal_key_util.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: elgamal_key_util.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: elgamal_key_util_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: elgamal_proto_util.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: elgamal_proto_util.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: elgamal_proto_util_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: file.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: file.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: file_posix.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: file_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: file_test.proto -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: process_record_file_parameters.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: process_record_file_util.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: process_record_file_util_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: proto_util.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: proto_util_test.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: recordio.cc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: recordio.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: recordio_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: ec_key_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: ec_key_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: ec_key_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_key_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_key_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_key_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_proto_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_proto_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_proto_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file_posix.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file_test.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: process_record_file_parameters.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: process_record_file_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: process_record_file_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: proto_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: proto_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: recordio.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: recordio.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: recordio_test.cc Only in third_party/private-join-and-compute/src/util: status.h -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/util/status.inc and third_party/private-join-and-compute/src/util/status.inc differ -Files /tmp/private-join-and-compute.b413785/private_join_and_compute/util/status_macros.h and third_party/private-join-and-compute/src/util/status_macros.h differ -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: status_matchers.h +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/util/status.inc and third_party/private-join-and-compute/src/util/status.inc differ +Files /tmp/private-join-and-compute.08df854/private_join_and_compute/util/status_macros.h and third_party/private-join-and-compute/src/util/status_macros.h differ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: status_matchers.h Only in third_party/private-join-and-compute/src/util: statusor.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: status_testing.h -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: status_testing.inc -Only in /tmp/private-join-and-compute.b413785/private_join_and_compute/util: test.proto - +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: status_testing.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: status_testing.inc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: test.proto
diff --git a/third_party/private-join-and-compute/patches/version-08df854.diff b/third_party/private-join-and-compute/patches/version-08df854.diff new file mode 100644 index 0000000..6b98875f5 --- /dev/null +++ b/third_party/private-join-and-compute/patches/version-08df854.diff
@@ -0,0 +1,1226 @@ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: BUILD +Only in third_party/private-join-and-compute/src/: BUILD.gn +Only in third_party/private-join-and-compute/src/: chromium_patch.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: client.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: client_impl.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: client_impl.h +Only in third_party/private-join-and-compute/src/: CONTRIBUTING.md +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/big_num.cc third_party/private-join-and-compute/src/crypto/big_num.cc +16c16 +< #include "private_join_and_compute/crypto/big_num.h" +--- +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +23,29c23,28 +< #include "absl/log/check.h" +< #include "absl/status/status.h" +< #include "absl/status/statusor.h" +< #include "absl/strings/str_cat.h" +< #include "absl/strings/string_view.h" +< #include "private_join_and_compute/crypto/context.h" +< #include "private_join_and_compute/crypto/openssl.inc" +--- +> #include "third_party/abseil-cpp/absl/strings/str_cat.h" +> #include "third_party/abseil-cpp/absl/strings/string_view.h" +> #include "third_party/private-join-and-compute/src/chromium_patch.h" +> #include "third_party/private-join-and-compute/src/crypto/context.h" +> #include "third_party/private-join-and-compute/src/crypto/openssl.inc" +> #include "third_party/private-join-and-compute/src/util/status.inc" +109c108 +< absl::StatusOr<uint64_t> BigNum::ToIntValue() const { +--- +> StatusOr<uint64_t> BigNum::ToIntValue() const { +112c111 +< return absl::InvalidArgumentError("BigNum has more than 64 bits."); +--- +> return InvalidArgumentError("BigNum has more than 64 bits."); +252c251 +< absl::StatusOr<BigNum> BigNum::ModInverse(const BigNum& m) const { +--- +> StatusOr<BigNum> BigNum::ModInverse(const BigNum& m) const { +255c254 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/big_num.h third_party/private-join-and-compute/src/crypto/big_num.h +16,17c16,17 +< #ifndef PRIVATE_JOIN_AND_COMPUTE_CRYPTO_BIG_NUM_H_ +< #define PRIVATE_JOIN_AND_COMPUTE_CRYPTO_BIG_NUM_H_ +--- +> #ifndef CRYPTO_BIG_NUM_H_ +> #define CRYPTO_BIG_NUM_H_ +25,28c25,29 +< #include "absl/base/attributes.h" +< #include "absl/status/statusor.h" +< #include "absl/strings/string_view.h" +< #include "private_join_and_compute/crypto/openssl.inc" +--- +> #include "third_party/abseil-cpp/absl/base/attributes.h" +> #include "third_party/abseil-cpp/absl/strings/string_view.h" +> #include "third_party/private-join-and-compute/base/private_join_and_compute_export.h" +> #include "third_party/private-join-and-compute/src/crypto/openssl.inc" +> #include "third_party/private-join-and-compute/src/util/status.inc" +37c38 +< class ABSL_MUST_USE_RESULT BigNum { +--- +> class PRIVATE_COMPUTE_EXPORT BigNum { +67c68 +< absl::StatusOr<uint64_t> ToIntValue() const; +--- +> StatusOr<uint64_t> ToIntValue() const; +158c159 +< absl::StatusOr<BigNum> ModInverse(const BigNum& m) const; +--- +> StatusOr<BigNum> ModInverse(const BigNum& m) const; +261c262 +< #endif // PRIVATE_JOIN_AND_COMPUTE_CRYPTO_BIG_NUM_H_ +--- +> #endif // CRYPTO_BIG_NUM_H_ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: BUILD +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: camenisch_shoup.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: camenisch_shoup.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: camenisch_shoup_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: commutative_elgamal.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: commutative_elgamal.h +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/context.cc third_party/private-join-and-compute/src/crypto/context.cc +16c16 +< #include "private_join_and_compute/crypto/context.h" +--- +> #include "third_party/private-join-and-compute/src/crypto/context.h" +22,24c22,24 +< #include "absl/strings/str_cat.h" +< #include "absl/strings/string_view.h" +< #include "private_join_and_compute/crypto/openssl_init.h" +--- +> #include "third_party/abseil-cpp/absl/strings/str_cat.h" +> #include "third_party/abseil-cpp/absl/strings/string_view.h" +> #include "third_party/private-join-and-compute/src/chromium_patch.h" +41d40 +< OpenSSLInit(); +95c94,95 +< BigNum Context::RandomOracle(absl::string_view x, const BigNum& max_value, +--- +> BigNum Context::RandomOracle(absl::string_view x, +> const BigNum& max_value, +143c143,144 +< BigNum Context::PRF(absl::string_view key, absl::string_view data, +--- +> BigNum Context::PRF(absl::string_view key, +> absl::string_view data, +145c146 +< CHECK_GE(key.size() * 8, 80); +--- +> CHECK_GE(key.size() * 8, std::size_t(80)); +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/context.h third_party/private-join-and-compute/src/crypto/context.h +16,17c16,17 +< #ifndef PRIVATE_JOIN_AND_COMPUTE_CRYPTO_CONTEXT_H_ +< #define PRIVATE_JOIN_AND_COMPUTE_CRYPTO_CONTEXT_H_ +--- +> #ifndef CRYPTO_CONTEXT_H_ +> #define CRYPTO_CONTEXT_H_ +24,27c24,28 +< #include "absl/log/check.h" +< #include "absl/strings/string_view.h" +< #include "private_join_and_compute/crypto/big_num.h" +< #include "private_join_and_compute/crypto/openssl.inc" +--- +> #include "third_party/abseil-cpp/absl/strings/string_view.h" +> #include "third_party/private-join-and-compute/base/private_join_and_compute_export.h" +> #include "third_party/private-join-and-compute/src/chromium_patch.h" +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +> #include "third_party/private-join-and-compute/src/crypto/openssl.inc" +44c45 +< class Context { +--- +> class PRIVATE_COMPUTE_EXPORT Context { +131c132,133 +< BigNum PRF(absl::string_view key, absl::string_view data, +--- +> BigNum PRF(absl::string_view key, +> absl::string_view data, +182c184,185 +< virtual BigNum RandomOracle(absl::string_view x, const BigNum& max_value, +--- +> virtual BigNum RandomOracle(absl::string_view x, +> const BigNum& max_value, +188c191 +< #endif // PRIVATE_JOIN_AND_COMPUTE_CRYPTO_CONTEXT_H_ +--- +> #endif // CRYPTO_CONTEXT_H_ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: dodis_yampolskiy_prf +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_commutative_cipher.cc third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.cc +16c16 +< #include "private_join_and_compute/crypto/ec_commutative_cipher.h" +--- +> #include "third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.h" +22,27c22,26 +< #include "absl/status/status.h" +< #include "absl/status/statusor.h" +< #include "absl/strings/string_view.h" +< #include "private_join_and_compute/crypto/big_num.h" +< #include "private_join_and_compute/crypto/ec_group.h" +< #include "private_join_and_compute/crypto/elgamal.h" +--- +> #include "third_party/abseil-cpp/absl/strings/string_view.h" +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +> #include "third_party/private-join-and-compute/src/crypto/ec_group.h" +> #include "third_party/private-join-and-compute/src/crypto/elgamal.h" +> #include "third_party/private-join-and-compute/src/util/status.inc" +38c37,38 +< BigNum InvertPrivateScalar(const BigNum& scalar, const ECGroup& ec_group, +--- +> BigNum InvertPrivateScalar(const BigNum& scalar, +> const ECGroup& ec_group, +47c47,48 +< ECGroup group, BigNum private_key, +--- +> ECGroup group, +> BigNum private_key, +65c66 +< absl::StatusOr<std::unique_ptr<ECCommutativeCipher>> +--- +> StatusOr<std::unique_ptr<ECCommutativeCipher>> +68c69 +< absl::StatusOr<ECGroup> group = ECGroup::Create(curve_id, context.get()); +--- +> StatusOr<ECGroup> group = ECGroup::Create(curve_id, context.get()); +73c74 +< return absl::InvalidArgumentError("Invalid hash type."); +--- +> return InvalidArgumentError("Invalid hash type."); +81,82c82,84 +< absl::StatusOr<std::unique_ptr<ECCommutativeCipher>> +< ECCommutativeCipher::CreateFromKey(int curve_id, absl::string_view key_bytes, +--- +> StatusOr<std::unique_ptr<ECCommutativeCipher>> +> ECCommutativeCipher::CreateFromKey(int curve_id, +> absl::string_view key_bytes, +85c87 +< absl::StatusOr<ECGroup> group = ECGroup::Create(curve_id, context.get()); +--- +> StatusOr<ECGroup> group = ECGroup::Create(curve_id, context.get()); +90c92 +< return absl::InvalidArgumentError("Invalid hash type."); +--- +> return InvalidArgumentError("Invalid hash type."); +102c104 +< absl::StatusOr<std::unique_ptr<ECCommutativeCipher>> +--- +> StatusOr<std::unique_ptr<ECCommutativeCipher>> +108c110 +< absl::StatusOr<ECGroup> group = ECGroup::Create(curve_id, context.get()); +--- +> StatusOr<ECGroup> group = ECGroup::Create(curve_id, context.get()); +113c115 +< return absl::InvalidArgumentError("Seed is too short."); +--- +> return InvalidArgumentError("Seed is too short."); +116c118 +< return absl::InvalidArgumentError("Invalid hash type."); +--- +> return InvalidArgumentError("Invalid hash type."); +124c126 +< absl::StatusOr<std::string> ECCommutativeCipher::Encrypt( +--- +> StatusOr<std::string> ECCommutativeCipher::Encrypt( +126c128 +< absl::StatusOr<ECPoint> hashed_point = HashToTheCurveInternal(plaintext); +--- +> StatusOr<ECPoint> hashed_point = HashToTheCurveInternal(plaintext); +130c132 +< absl::StatusOr<ECPoint> encrypted_point = Encrypt(*hashed_point); +--- +> StatusOr<ECPoint> encrypted_point = Encrypt(*hashed_point); +137c139 +< absl::StatusOr<std::string> ECCommutativeCipher::ReEncrypt( +--- +> StatusOr<std::string> ECCommutativeCipher::ReEncrypt( +139c141 +< absl::StatusOr<ECPoint> point = group_.CreateECPoint(ciphertext); +--- +> StatusOr<ECPoint> point = group_.CreateECPoint(ciphertext); +143c145 +< absl::StatusOr<ECPoint> reencrypted_point = Encrypt(*point); +--- +> StatusOr<ECPoint> reencrypted_point = Encrypt(*point); +150c152 +< absl::StatusOr<ECPoint> ECCommutativeCipher::Encrypt(const ECPoint& point) { +--- +> StatusOr<ECPoint> ECCommutativeCipher::Encrypt(const ECPoint& point) { +154c156 +< absl::StatusOr<std::pair<std::string, std::string>> +--- +> StatusOr<std::pair<std::string, std::string>> +157c159 +< absl::StatusOr<ECPoint> u = group_.CreateECPoint(elgamal_ciphertext.first); +--- +> StatusOr<ECPoint> u = group_.CreateECPoint(elgamal_ciphertext.first); +161c163 +< absl::StatusOr<ECPoint> e = group_.CreateECPoint(elgamal_ciphertext.second); +--- +> StatusOr<ECPoint> e = group_.CreateECPoint(elgamal_ciphertext.second); +168c170 +< absl::StatusOr<elgamal::Ciphertext> reencrypted_ciphertext = +--- +> StatusOr<elgamal::Ciphertext> reencrypted_ciphertext = +174c176 +< absl::StatusOr<std::string> serialized_u = +--- +> StatusOr<std::string> serialized_u = +179c181 +< absl::StatusOr<std::string> serialized_e = +--- +> StatusOr<std::string> serialized_e = +188c190 +< absl::StatusOr<std::string> ECCommutativeCipher::Decrypt( +--- +> StatusOr<std::string> ECCommutativeCipher::Decrypt( +190c192 +< absl::StatusOr<ECPoint> point = group_.CreateECPoint(ciphertext); +--- +> StatusOr<ECPoint> point = group_.CreateECPoint(ciphertext); +194c196 +< absl::StatusOr<ECPoint> decrypted_point = point->Mul(private_key_inverse_); +--- +> StatusOr<ECPoint> decrypted_point = point->Mul(private_key_inverse_); +201c203 +< absl::StatusOr<ECPoint> ECCommutativeCipher::HashToTheCurveInternal( +--- +> StatusOr<ECPoint> ECCommutativeCipher::HashToTheCurveInternal( +203c205 +< absl::StatusOr<ECPoint> point; +--- +> StatusOr<ECPoint> point; +214c216 +< return absl::InvalidArgumentError("Invalid hash type."); +--- +> return InvalidArgumentError("Invalid hash type."); +219c221 +< absl::StatusOr<std::string> ECCommutativeCipher::HashToTheCurve( +--- +> StatusOr<std::string> ECCommutativeCipher::HashToTheCurve( +221c223 +< absl::StatusOr<ECPoint> point = HashToTheCurveInternal(plaintext); +--- +> StatusOr<ECPoint> point = HashToTheCurveInternal(plaintext); +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_commutative_cipher.h third_party/private-join-and-compute/src/crypto/ec_commutative_cipher.h +16,17c16,17 +< #ifndef PRIVATE_JOIN_AND_COMPUTE_EC_COMMUTATIVE_CIPHER_H_ +< #define PRIVATE_JOIN_AND_COMPUTE_EC_COMMUTATIVE_CIPHER_H_ +--- +> #ifndef EC_COMMUTATIVE_CIPHER_H_ +> #define EC_COMMUTATIVE_CIPHER_H_ +23,28c23,29 +< #include "absl/status/statusor.h" +< #include "absl/strings/string_view.h" +< #include "private_join_and_compute/crypto/big_num.h" +< #include "private_join_and_compute/crypto/context.h" +< #include "private_join_and_compute/crypto/ec_group.h" +< #include "private_join_and_compute/crypto/ec_point.h" +--- +> #include "third_party/abseil-cpp/absl/strings/string_view.h" +> #include "third_party/private-join-and-compute/base/private_join_and_compute_export.h" +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +> #include "third_party/private-join-and-compute/src/crypto/context.h" +> #include "third_party/private-join-and-compute/src/crypto/ec_group.h" +> #include "third_party/private-join-and-compute/src/crypto/ec_point.h" +> #include "third_party/private-join-and-compute/src/util/status.inc" +74c75 +< // absl::StatusOr<string> double_encrypted_string = +--- +> // ::private_join_and_compute::StatusOr<string> double_encrypted_string = +80c81 +< // absl::StatusOr<string> decrypted_string = +--- +> // ::private_join_and_compute::StatusOr<string> decrypted_string = +85c86,87 +< // absl::StatusOr<std::pair<string, string>> double_encrypted_string = +--- +> // ::private_join_and_compute::StatusOr<std::pair<string, string>> +> // double_encrypted_string = +88c90 +< class ECCommutativeCipher { +--- +> class PRIVATE_COMPUTE_EXPORT ECCommutativeCipher { +114,115c116,117 +< static absl::StatusOr<std::unique_ptr<ECCommutativeCipher>> CreateWithNewKey( +< int curve_id, HashType hash_type); +--- +> static ::private_join_and_compute::StatusOr<std::unique_ptr<ECCommutativeCipher>> +> CreateWithNewKey(int curve_id, HashType hash_type); +125,126c127,129 +< static absl::StatusOr<std::unique_ptr<ECCommutativeCipher>> CreateFromKey( +< int curve_id, absl::string_view key_bytes, HashType hash_type); +--- +> static ::private_join_and_compute::StatusOr< +> std::unique_ptr<ECCommutativeCipher>> +> CreateFromKey(int curve_id, absl::string_view key_bytes, HashType hash_type); +133,135c136,141 +< static absl::StatusOr<std::unique_ptr<ECCommutativeCipher>> +< CreateWithKeyFromSeed(int curve_id, absl::string_view seed_bytes, +< absl::string_view tag_bytes, HashType hash_type); +--- +> static ::private_join_and_compute::StatusOr< +> std::unique_ptr<ECCommutativeCipher>> +> CreateWithKeyFromSeed(int curve_id, +> absl::string_view seed_bytes, +> absl::string_view tag_bytes, +> HashType hash_type); +148c154,155 +< absl::StatusOr<std::string> Encrypt(absl::string_view plaintext); +--- +> ::private_join_and_compute::StatusOr<std::string> Encrypt( +> absl::string_view plaintext); +161c168,169 +< absl::StatusOr<std::string> ReEncrypt(absl::string_view ciphertext); +--- +> ::private_join_and_compute::StatusOr<std::string> ReEncrypt( +> absl::string_view ciphertext); +171c179 +< absl::StatusOr<std::pair<std::string, std::string>> +--- +> ::private_join_and_compute::StatusOr<std::pair<std::string, std::string>> +190c198,199 +< absl::StatusOr<std::string> Decrypt(absl::string_view ciphertext); +--- +> ::private_join_and_compute::StatusOr<std::string> Decrypt( +> absl::string_view ciphertext); +202c211,212 +< absl::StatusOr<std::string> HashToTheCurve(absl::string_view plaintext); +--- +> ::private_join_and_compute::StatusOr<std::string> HashToTheCurve( +> absl::string_view plaintext); +214c224 +< absl::StatusOr<ECPoint> Encrypt(const ECPoint& point); +--- +> ::private_join_and_compute::StatusOr<ECPoint> Encrypt(const ECPoint& point); +217c227,228 +< absl::StatusOr<ECPoint> HashToTheCurveInternal(absl::string_view plaintext); +--- +> ::private_join_and_compute::StatusOr<ECPoint> HashToTheCurveInternal( +> absl::string_view plaintext); +238c249 +< #endif // PRIVATE_JOIN_AND_COMPUTE_EC_COMMUTATIVE_CIPHER_H_ +--- +> #endif // EC_COMMUTATIVE_CIPHER_H_ +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_group.cc third_party/private-join-and-compute/src/crypto/ec_group.cc +16c16 +< #include "private_join_and_compute/crypto/ec_group.h" +--- +> #include "third_party/private-join-and-compute/src/crypto/ec_group.h" +17a18 +> #include <algorithm> +23,30c24,30 +< #include "absl/status/status.h" +< #include "absl/status/statusor.h" +< #include "absl/strings/str_cat.h" +< #include "absl/strings/string_view.h" +< #include "private_join_and_compute/crypto/big_num.h" +< #include "private_join_and_compute/crypto/context.h" +< #include "private_join_and_compute/crypto/ec_point.h" +< #include "private_join_and_compute/crypto/openssl.inc" +--- +> #include "third_party/abseil-cpp/absl/strings/str_cat.h" +> #include "third_party/abseil-cpp/absl/strings/string_view.h" +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +> #include "third_party/private-join-and-compute/src/crypto/context.h" +> #include "third_party/private-join-and-compute/src/crypto/ec_point.h" +> #include "third_party/private-join-and-compute/src/crypto/openssl.inc" +> #include "third_party/private-join-and-compute/src/util/status.inc" +38c38 +< absl::StatusOr<ECGroup::ECGroupPtr> CreateGroup(int curve_id) { +--- +> StatusOr<ECGroup::ECGroupPtr> CreateGroup(int curve_id) { +42c42 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +51c51 +< absl::StatusOr<BigNum> CreateOrder(const EC_GROUP* group, Context* context) { +--- +> StatusOr<BigNum> CreateOrder(const EC_GROUP* group, Context* context) { +54c54 +< return absl::InternalError( +--- +> return InternalError( +60c60 +< return absl::InternalError(absl::StrCat( +--- +> return InternalError(absl::StrCat( +67c67 +< absl::StatusOr<BigNum> CreateCofactor(const EC_GROUP* group, Context* context) { +--- +> StatusOr<BigNum> CreateCofactor(const EC_GROUP* group, Context* context) { +70c70 +< return absl::InternalError( +--- +> return InternalError( +76c76 +< return absl::InternalError( +--- +> return InternalError( +85,86c85,86 +< absl::StatusOr<ECGroup::CurveParams> CreateCurveParams(const EC_GROUP* group, +< Context* context) { +--- +> StatusOr<ECGroup::CurveParams> CreateCurveParams(const EC_GROUP* group, +> Context* context) { +91c91 +< return absl::InternalError( +--- +> return InternalError( +100c100 +< return absl::InternalError( +--- +> return InternalError( +106c106 +< return absl::InternalError(absl::StrCat( +--- +> return InternalError(absl::StrCat( +132,133c132,133 +< absl::StatusOr<ECGroup> ECGroup::Create(int curve_id, Context* context) { +< absl::StatusOr<ECGroupPtr> g = CreateGroup(curve_id); +--- +> StatusOr<ECGroup> ECGroup::Create(int curve_id, Context* context) { +> StatusOr<ECGroupPtr> g = CreateGroup(curve_id); +137c137 +< absl::StatusOr<BigNum> order = CreateOrder(g->get(), context); +--- +> StatusOr<BigNum> order = CreateOrder(g->get(), context); +141c141 +< absl::StatusOr<BigNum> cofactor = CreateCofactor(g->get(), context); +--- +> StatusOr<BigNum> cofactor = CreateCofactor(g->get(), context); +145c145 +< absl::StatusOr<CurveParams> params = CreateCurveParams(g->get(), context); +--- +> StatusOr<CurveParams> params = CreateCurveParams(g->get(), context); +159c159 +< absl::Status ECGroup::CheckPrivateKey(const BigNum& priv_key) const { +--- +> Status ECGroup::CheckPrivateKey(const BigNum& priv_key) const { +161c161 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +167c167 +< absl::StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveInternal( +--- +> StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveInternal( +178c178 +< return absl::InternalError("Could not hash x to the curve."); +--- +> return InternalError("Could not hash x to the curve."); +181c181 +< absl::StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSha256( +--- +> StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSha256( +185c185 +< absl::StatusOr<ECPoint> point = GetPointByHashingToCurveInternal(x); +--- +> StatusOr<ECPoint> point = GetPointByHashingToCurveInternal(x); +193c193 +< absl::StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSha384( +--- +> StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSha384( +197c197 +< absl::StatusOr<ECPoint> point = GetPointByHashingToCurveInternal(x); +--- +> StatusOr<ECPoint> point = GetPointByHashingToCurveInternal(x); +205c205 +< absl::StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSha512( +--- +> StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSha512( +209c209 +< absl::StatusOr<ECPoint> point = GetPointByHashingToCurveInternal(x); +--- +> StatusOr<ECPoint> point = GetPointByHashingToCurveInternal(x); +217,219c217,220 +< absl::StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSswuRo( +< absl::string_view m, absl::string_view dst) const { +< absl::StatusOr<ECPoint> out = GetPointAtInfinity(); +--- +> StatusOr<ECPoint> ECGroup::GetPointByHashingToCurveSswuRo( +> absl::string_view m, +> absl::string_view dst) const { +> StatusOr<ECPoint> out = GetPointAtInfinity(); +229c230 +< return absl::InternalError(OpenSSLErrorString()); +--- +> return InternalError(OpenSSLErrorString()); +236c237 +< return absl::InternalError(OpenSSLErrorString()); +--- +> return InternalError(OpenSSLErrorString()); +239,240c240 +< return absl::InvalidArgumentError( +< "Curve does not support HashToCurveSswuRo."); +--- +> return InvalidArgumentError("Curve does not support HashToCurveSswuRo."); +245,246c245,246 +< absl::StatusOr<ECPoint> ECGroup::GetPointByPaddingX( +< const BigNum& m, size_t padding_bit_count) const { +--- +> StatusOr<ECPoint> ECGroup::GetPointByPaddingX(const BigNum& m, +> size_t padding_bit_count) const { +251c251 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +255c255 +< absl::StatusOr<ECPoint> point = +--- +> StatusOr<ECPoint> point = +264,265c264,266 +< absl::StatusOr<BigNum> ECGroup::RecoverXFromPaddedPoint( +< const ECPoint& point, size_t padding_bit_count) const { +--- +> StatusOr<BigNum> ECGroup::RecoverXFromPaddedPoint( +> const ECPoint& point, +> size_t padding_bit_count) const { +268c269 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +302c303 +< absl::StatusOr<ECPoint> ECGroup::GetFixedGenerator() const { +--- +> StatusOr<ECPoint> ECGroup::GetFixedGenerator() const { +306c307 +< return absl::InternalError(OpenSSLErrorString()); +--- +> return InternalError(OpenSSLErrorString()); +312,313c313,314 +< absl::StatusOr<ECPoint> ECGroup::GetRandomGenerator() const { +< absl::StatusOr<ECPoint> generator = GetFixedGenerator(); +--- +> StatusOr<ECPoint> ECGroup::GetRandomGenerator() const { +> StatusOr<ECPoint> generator = GetFixedGenerator(); +320,321c321,322 +< absl::StatusOr<ECPoint> ECGroup::CreateECPoint(const BigNum& x, +< const BigNum& y) const { +--- +> StatusOr<ECPoint> ECGroup::CreateECPoint(const BigNum& x, +> const BigNum& y) const { +324c325 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +330c331 +< absl::StatusOr<ECPoint> ECGroup::CreateECPoint(absl::string_view bytes) const { +--- +> StatusOr<ECPoint> ECGroup::CreateECPoint(absl::string_view bytes) const { +333,334c334 +< return absl::InternalError( +< "ECGroup::CreateECPoint: Failed to create point."); +--- +> return InternalError("ECGroup::CreateECPoint: Failed to create point."); +340c340 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +347c347 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +353c353 +< absl::StatusOr<ECPoint> ECGroup::GetPointAtInfinity() const { +--- +> StatusOr<ECPoint> ECGroup::GetPointAtInfinity() const { +356c356 +< return absl::InternalError( +--- +> return InternalError( +361c361 +< return absl::InternalError( +--- +> return InternalError( +Only in third_party/private-join-and-compute/src/crypto: ec_group.cc.bak +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_group.h third_party/private-join-and-compute/src/crypto/ec_group.h +16,17c16,17 +< #ifndef PRIVATE_JOIN_AND_COMPUTE_CRYPTO_EC_GROUP_H_ +< #define PRIVATE_JOIN_AND_COMPUTE_CRYPTO_EC_GROUP_H_ +--- +> #ifndef CRYPTO_EC_GROUP_H_ +> #define CRYPTO_EC_GROUP_H_ +20a21 +> #include <string> +22,27c23,28 +< #include "absl/status/status.h" +< #include "absl/status/statusor.h" +< #include "absl/strings/string_view.h" +< #include "private_join_and_compute/crypto/big_num.h" +< #include "private_join_and_compute/crypto/context.h" +< #include "private_join_and_compute/crypto/openssl.inc" +--- +> #include "third_party/abseil-cpp/absl/strings/string_view.h" +> #include "third_party/private-join-and-compute/base/private_join_and_compute_export.h" +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +> #include "third_party/private-join-and-compute/src/crypto/context.h" +> #include "third_party/private-join-and-compute/src/crypto/openssl.inc" +> #include "third_party/private-join-and-compute/src/util/status.inc" +34c35 +< class ECGroup { +--- +> class PRIVATE_COMPUTE_EXPORT ECGroup { +49c50 +< static absl::StatusOr<ECGroup> Create(int curve_id, Context* context); +--- +> static StatusOr<ECGroup> Create(int curve_id, Context* context); +56,58c57,58 +< // Returns absl::Status::OK if the key is valid, otherwise returns +< // INVALID_ARGUMENT. +< absl::Status CheckPrivateKey(const BigNum& priv_key) const; +--- +> // Returns Status::OK if the key is valid, otherwise returns INVALID_ARGUMENT. +> Status CheckPrivateKey(const BigNum& priv_key) const; +68,75c68,72 +< absl::StatusOr<ECPoint> GetPointByHashingToCurveSha256( +< absl::string_view m) const; +< absl::StatusOr<ECPoint> GetPointByHashingToCurveSha384( +< absl::string_view m) const; +< absl::StatusOr<ECPoint> GetPointByHashingToCurveSha512( +< absl::string_view m) const; +< absl::StatusOr<ECPoint> GetPointByHashingToCurveSswuRo( +< absl::string_view m, absl::string_view dst) const; +--- +> StatusOr<ECPoint> GetPointByHashingToCurveSha256(absl::string_view m) const; +> StatusOr<ECPoint> GetPointByHashingToCurveSha384(absl::string_view m) const; +> StatusOr<ECPoint> GetPointByHashingToCurveSha512(absl::string_view m) const; +> StatusOr<ECPoint> GetPointByHashingToCurveSswuRo(absl::string_view m, +> absl::string_view dst) const; +80,81c77,78 +< absl::StatusOr<ECPoint> GetPointByPaddingX(const BigNum& m, +< size_t padding_bit_count) const; +--- +> StatusOr<ECPoint> GetPointByPaddingX(const BigNum& m, +> size_t padding_bit_count) const; +85,86c82,83 +< absl::StatusOr<BigNum> RecoverXFromPaddedPoint( +< const ECPoint& point, size_t padding_bit_count) const; +--- +> StatusOr<BigNum> RecoverXFromPaddedPoint(const ECPoint& point, +> size_t padding_bit_count) const; +94c91 +< absl::StatusOr<ECPoint> GetFixedGenerator() const; +--- +> StatusOr<ECPoint> GetFixedGenerator() const; +98c95 +< absl::StatusOr<ECPoint> GetRandomGenerator() const; +--- +> StatusOr<ECPoint> GetRandomGenerator() const; +104c101 +< absl::StatusOr<ECPoint> CreateECPoint(absl::string_view bytes) const; +--- +> StatusOr<ECPoint> CreateECPoint(absl::string_view bytes) const; +109c106 +< absl::StatusOr<ECPoint> CreateECPoint(const BigNum& x, const BigNum& y) const; +--- +> StatusOr<ECPoint> CreateECPoint(const BigNum& x, const BigNum& y) const; +129c126 +< absl::StatusOr<ECPoint> GetPointAtInfinity() const; +--- +> StatusOr<ECPoint> GetPointAtInfinity() const; +160,161c157 +< absl::StatusOr<ECPoint> GetPointByHashingToCurveInternal( +< const BigNum& x) const; +--- +> StatusOr<ECPoint> GetPointByHashingToCurveInternal(const BigNum& x) const; +166c162 +< #endif // PRIVATE_JOIN_AND_COMPUTE_CRYPTO_EC_GROUP_H_ +--- +> #endif // CRYPTO_EC_GROUP_H_ +Only in third_party/private-join-and-compute/src/crypto: ec_group.h.bak +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: ec_key.proto +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_point.cc third_party/private-join-and-compute/src/crypto/ec_point.cc +16c16 +< #include "private_join_and_compute/crypto/ec_point.h" +--- +> #include "third_party/private-join-and-compute/src/crypto/ec_point.h" +22,27c22,27 +< #include "absl/status/status.h" +< #include "absl/status/statusor.h" +< #include "absl/strings/str_cat.h" +< #include "private_join_and_compute/crypto/big_num.h" +< #include "private_join_and_compute/crypto/context.h" +< #include "private_join_and_compute/crypto/openssl.inc" +--- +> #include "third_party/abseil-cpp/absl/strings/str_cat.h" +> #include "third_party/private-join-and-compute/src/chromium_patch.h" +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +> #include "third_party/private-join-and-compute/src/crypto/context.h" +> #include "third_party/private-join-and-compute/src/crypto/openssl.inc" +> #include "third_party/private-join-and-compute/src/util/status.inc" +49c49 +< absl::StatusOr<std::string> ECPoint::ToBytesCompressed() const { +--- +> StatusOr<std::string> ECPoint::ToBytesCompressed() const { +55c55 +< return absl::InternalError( +--- +> return InternalError( +61c61 +< absl::StatusOr<std::string> ECPoint::ToBytesUnCompressed() const { +--- +> StatusOr<std::string> ECPoint::ToBytesUnCompressed() const { +68c68 +< return absl::InternalError( +--- +> return InternalError( +74c74 +< absl::StatusOr<std::pair<BigNum::BignumPtr, BigNum::BignumPtr>> +--- +> StatusOr<std::pair<BigNum::BignumPtr, BigNum::BignumPtr>> +79c79 +< return absl::InternalError( +--- +> return InternalError( +85c85 +< return absl::InternalError(absl::StrCat( +--- +> return InternalError(absl::StrCat( +91c91 +< absl::StatusOr<ECPoint> ECPoint::Mul(const BigNum& scalar) const { +--- +> StatusOr<ECPoint> ECPoint::Mul(const BigNum& scalar) const { +95c95 +< return absl::InternalError( +--- +> return InternalError( +101c101 +< absl::StatusOr<ECPoint> ECPoint::Add(const ECPoint& point) const { +--- +> StatusOr<ECPoint> ECPoint::Add(const ECPoint& point) const { +105c105 +< return absl::InternalError( +--- +> return InternalError( +111c111 +< absl::StatusOr<ECPoint> ECPoint::Clone() const { +--- +> StatusOr<ECPoint> ECPoint::Clone() const { +114c114 +< return absl::InternalError( +--- +> return InternalError( +120c120 +< absl::StatusOr<ECPoint> ECPoint::Inverse() const { +--- +> StatusOr<ECPoint> ECPoint::Inverse() const { +122c122 +< absl::StatusOr<ECPoint> inv = ECPoint(group_, bn_ctx_); +--- +> StatusOr<ECPoint> inv = ECPoint(group_, bn_ctx_); +127c127 +< return absl::InternalError( +--- +> return InternalError( +132c132 +< return absl::InternalError( +--- +> return InternalError( +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/ec_point.h third_party/private-join-and-compute/src/crypto/ec_point.h +16,17c16,17 +< #ifndef PRIVATE_JOIN_AND_COMPUTE_CRYPTO_EC_POINT_H_ +< #define PRIVATE_JOIN_AND_COMPUTE_CRYPTO_EC_POINT_H_ +--- +> #ifndef CRYPTO_EC_POINT_H_ +> #define CRYPTO_EC_POINT_H_ +23,25c23,26 +< #include "absl/status/statusor.h" +< #include "private_join_and_compute/crypto/big_num.h" +< #include "private_join_and_compute/crypto/openssl.inc" +--- +> #include "third_party/private-join-and-compute/base/private_join_and_compute_export.h" +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +> #include "third_party/private-join-and-compute/src/crypto/openssl.inc" +> #include "third_party/private-join-and-compute/src/util/status.inc" +29d29 +< class BigNum; +33c33 +< class ECPoint { +--- +> class PRIVATE_COMPUTE_EXPORT ECPoint { +52c52 +< absl::StatusOr<std::string> ToBytesCompressed() const; +--- +> StatusOr<std::string> ToBytesCompressed() const; +56c56 +< absl::StatusOr<std::string> ToBytesUnCompressed() const; +--- +> StatusOr<std::string> ToBytesUnCompressed() const; +60c60 +< absl::StatusOr<ECPoint> Mul(const BigNum& scalar) const; +--- +> StatusOr<ECPoint> Mul(const BigNum& scalar) const; +64c64 +< absl::StatusOr<ECPoint> Add(const ECPoint& point) const; +--- +> StatusOr<ECPoint> Add(const ECPoint& point) const; +67c67 +< absl::StatusOr<std::pair<BigNum::BignumPtr, BigNum::BignumPtr>> +--- +> StatusOr<std::pair<BigNum::BignumPtr, BigNum::BignumPtr>> +72c72 +< absl::StatusOr<ECPoint> Inverse() const; +--- +> StatusOr<ECPoint> Inverse() const; +82c82 +< absl::StatusOr<ECPoint> Clone() const; +--- +> StatusOr<ECPoint> Clone() const; +111c111 +< #endif // PRIVATE_JOIN_AND_COMPUTE_CRYPTO_EC_POINT_H_ +--- +> #endif // CRYPTO_EC_POINT_H_ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: ec_point_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: ec_point_util.h +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/elgamal.cc third_party/private-join-and-compute/src/crypto/elgamal.cc +16c16 +< #include "private_join_and_compute/crypto/elgamal.h" +--- +> #include "third_party/private-join-and-compute/src/crypto/elgamal.h" +23,29c23,27 +< #include "absl/log/check.h" +< #include "absl/memory/memory.h" +< #include "absl/status/status.h" +< #include "absl/status/statusor.h" +< #include "private_join_and_compute/crypto/big_num.h" +< #include "private_join_and_compute/crypto/ec_group.h" +< #include "private_join_and_compute/crypto/ec_point.h" +--- +> #include "third_party/abseil-cpp/absl/memory/memory.h" +> #include "third_party/private-join-and-compute/src/crypto/big_num.h" +> #include "third_party/private-join-and-compute/src/crypto/ec_group.h" +> #include "third_party/private-join-and-compute/src/crypto/ec_point.h" +> #include "third_party/private-join-and-compute/src/util/status.inc" +35,36c33 +< absl::StatusOr< +< std::pair<std::unique_ptr<PublicKey>, std::unique_ptr<PrivateKey>>> +--- +> StatusOr<std::pair<std::unique_ptr<PublicKey>, std::unique_ptr<PrivateKey>>> +38c35 +< absl::StatusOr<ECPoint> g = ec_group.GetFixedGenerator(); +--- +> StatusOr<ECPoint> g = ec_group.GetFixedGenerator(); +43c40 +< absl::StatusOr<ECPoint> y = g->Mul(x); +--- +> StatusOr<ECPoint> y = g->Mul(x); +55c52 +< absl::StatusOr<std::unique_ptr<PublicKey>> GeneratePublicKeyFromShares( +--- +> StatusOr<std::unique_ptr<PublicKey>> GeneratePublicKeyFromShares( +58c55 +< return absl::InvalidArgumentError( +--- +> return InvalidArgumentError( +61c58 +< absl::StatusOr<ECPoint> g = (*shares.begin())->g.Clone(); +--- +> StatusOr<ECPoint> g = (*shares.begin())->g.Clone(); +65c62 +< absl::StatusOr<ECPoint> y = (*shares.begin())->y.Clone(); +--- +> StatusOr<ECPoint> y = (*shares.begin())->y.Clone(); +81,84c78,80 +< absl::StatusOr<elgamal::Ciphertext> Mul( +< const elgamal::Ciphertext& ciphertext1, +< const elgamal::Ciphertext& ciphertext2) { +< absl::StatusOr<ECPoint> u = ciphertext1.u.Add(ciphertext2.u); +--- +> StatusOr<elgamal::Ciphertext> Mul(const elgamal::Ciphertext& ciphertext1, +> const elgamal::Ciphertext& ciphertext2) { +> StatusOr<ECPoint> u = ciphertext1.u.Add(ciphertext2.u); +88c84 +< absl::StatusOr<ECPoint> e = ciphertext1.e.Add(ciphertext2.e); +--- +> StatusOr<ECPoint> e = ciphertext1.e.Add(ciphertext2.e); +95,97c91,93 +< absl::StatusOr<elgamal::Ciphertext> Exp(const elgamal::Ciphertext& ciphertext, +< const BigNum& scalar) { +< absl::StatusOr<ECPoint> u = ciphertext.u.Mul(scalar); +--- +> StatusOr<elgamal::Ciphertext> Exp(const elgamal::Ciphertext& ciphertext, +> const BigNum& scalar) { +> StatusOr<ECPoint> u = ciphertext.u.Mul(scalar); +101c97 +< absl::StatusOr<ECPoint> e = ciphertext.e.Mul(scalar); +--- +> StatusOr<ECPoint> e = ciphertext.e.Mul(scalar); +108,109c104,105 +< absl::StatusOr<Ciphertext> GetZero(const ECGroup* group) { +< absl::StatusOr<ECPoint> u = group->GetPointAtInfinity(); +--- +> StatusOr<Ciphertext> GetZero(const ECGroup* group) { +> StatusOr<ECPoint> u = group->GetPointAtInfinity(); +113c109 +< absl::StatusOr<ECPoint> e = group->GetPointAtInfinity(); +--- +> StatusOr<ECPoint> e = group->GetPointAtInfinity(); +120,121c116,117 +< absl::StatusOr<Ciphertext> CloneCiphertext(const Ciphertext& ciphertext) { +< absl::StatusOr<ECPoint> clone_u = ciphertext.u.Clone(); +--- +> StatusOr<Ciphertext> CloneCiphertext(const Ciphertext& ciphertext) { +> StatusOr<ECPoint> clone_u = ciphertext.u.Clone(); +125c121 +< absl::StatusOr<ECPoint> clone_e = ciphertext.e.Clone(); +--- +> StatusOr<ECPoint> clone_e = ciphertext.e.Clone(); +148c144 +< absl::StatusOr<elgamal::Ciphertext> ElGamalEncrypter::Encrypt( +--- +> StatusOr<elgamal::Ciphertext> ElGamalEncrypter::Encrypt( +152c148 +< absl::StatusOr<ECPoint> u = public_key_->g.Mul(r); +--- +> StatusOr<ECPoint> u = public_key_->g.Mul(r); +156c152 +< absl::StatusOr<ECPoint> y_to_r = public_key_->y.Mul(r); +--- +> StatusOr<ECPoint> y_to_r = public_key_->y.Mul(r); +160c156 +< absl::StatusOr<ECPoint> e = message.Add(*y_to_r); +--- +> StatusOr<ECPoint> e = message.Add(*y_to_r); +167c163 +< absl::StatusOr<elgamal::Ciphertext> ElGamalEncrypter::ReRandomize( +--- +> StatusOr<elgamal::Ciphertext> ElGamalEncrypter::ReRandomize( +171c167 +< absl::StatusOr<ECPoint> g_to_r = public_key_->g.Mul(r); +--- +> StatusOr<ECPoint> g_to_r = public_key_->g.Mul(r); +175c171 +< absl::StatusOr<ECPoint> u = elgamal_ciphertext.u.Add(*g_to_r); +--- +> StatusOr<ECPoint> u = elgamal_ciphertext.u.Add(*g_to_r); +179c175 +< absl::StatusOr<ECPoint> y_to_r = public_key_->y.Mul(r); +--- +> StatusOr<ECPoint> y_to_r = public_key_->y.Mul(r); +183c179 +< absl::StatusOr<ECPoint> e = elgamal_ciphertext.e.Add(*y_to_r); +--- +> StatusOr<ECPoint> e = elgamal_ciphertext.e.Add(*y_to_r); +198c194 +< absl::StatusOr<ECPoint> ElGamalDecrypter::Decrypt( +--- +> StatusOr<ECPoint> ElGamalDecrypter::Decrypt( +200c196 +< absl::StatusOr<ECPoint> u_to_x = ciphertext.u.Mul(private_key_->x); +--- +> StatusOr<ECPoint> u_to_x = ciphertext.u.Mul(private_key_->x); +204c200 +< absl::StatusOr<ECPoint> u_to_x_inverse = u_to_x->Inverse(); +--- +> StatusOr<ECPoint> u_to_x_inverse = u_to_x->Inverse(); +208c204 +< absl::StatusOr<ECPoint> message = ciphertext.e.Add(*u_to_x_inverse); +--- +> StatusOr<ECPoint> message = ciphertext.e.Add(*u_to_x_inverse); +215c211 +< absl::StatusOr<elgamal::Ciphertext> ElGamalDecrypter::PartialDecrypt( +--- +> StatusOr<elgamal::Ciphertext> ElGamalDecrypter::PartialDecrypt( +217c213 +< absl::StatusOr<ECPoint> clone_u = ciphertext.u.Clone(); +--- +> StatusOr<ECPoint> clone_u = ciphertext.u.Clone(); +221c217 +< absl::StatusOr<ECPoint> dec_e = ElGamalDecrypter::Decrypt(ciphertext); +--- +> StatusOr<ECPoint> dec_e = ElGamalDecrypter::Decrypt(ciphertext); +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto/elgamal.h third_party/private-join-and-compute/src/crypto/elgamal.h +36,37c36,37 +< #ifndef PRIVATE_JOIN_AND_COMPUTE_CRYPTO_ELGAMAL_H_ +< #define PRIVATE_JOIN_AND_COMPUTE_CRYPTO_ELGAMAL_H_ +--- +> #ifndef CRYPTO_ELGAMAL_H_ +> #define CRYPTO_ELGAMAL_H_ +43,45c43,45 +< #include "absl/status/statusor.h" +< #include "private_join_and_compute/crypto/ec_group.h" +< #include "private_join_and_compute/crypto/ec_point.h" +--- +> #include "third_party/private-join-and-compute/src/crypto/ec_group.h" +> #include "third_party/private-join-and-compute/src/crypto/ec_point.h" +> #include "third_party/private-join-and-compute/src/util/status.inc" +72,73c72 +< absl::StatusOr< +< std::pair<std::unique_ptr<PublicKey>, std::unique_ptr<PrivateKey>>> +--- +> StatusOr<std::pair<std::unique_ptr<PublicKey>, std::unique_ptr<PrivateKey>>> +77c76 +< absl::StatusOr<std::unique_ptr<PublicKey>> GeneratePublicKeyFromShares( +--- +> StatusOr<std::unique_ptr<PublicKey>> GeneratePublicKeyFromShares( +82,83c81,82 +< absl::StatusOr<elgamal::Ciphertext> Mul(const elgamal::Ciphertext& ciphertext1, +< const elgamal::Ciphertext& ciphertext2); +--- +> StatusOr<elgamal::Ciphertext> Mul(const elgamal::Ciphertext& ciphertext1, +> const elgamal::Ciphertext& ciphertext2); +87,88c86,87 +< absl::StatusOr<elgamal::Ciphertext> Exp(const elgamal::Ciphertext& ciphertext, +< const BigNum& scalar); +--- +> StatusOr<elgamal::Ciphertext> Exp(const elgamal::Ciphertext& ciphertext, +> const BigNum& scalar); +92c91 +< absl::StatusOr<Ciphertext> GetZero(const ECGroup* group); +--- +> StatusOr<Ciphertext> GetZero(const ECGroup* group); +96c95 +< absl::StatusOr<Ciphertext> CloneCiphertext(const Ciphertext& ciphertext); +--- +> StatusOr<Ciphertext> CloneCiphertext(const Ciphertext& ciphertext); +105c104 +< class ElGamalEncrypter { +--- +> class PRIVATE_COMPUTE_EXPORT ElGamalEncrypter { +119c118 +< absl::StatusOr<elgamal::Ciphertext> Encrypt(const ECPoint& message) const; +--- +> StatusOr<elgamal::Ciphertext> Encrypt(const ECPoint& message) const; +123c122 +< absl::StatusOr<elgamal::Ciphertext> ReRandomize( +--- +> StatusOr<elgamal::Ciphertext> ReRandomize( +135c134 +< class ElGamalDecrypter { +--- +> class PRIVATE_COMPUTE_EXPORT ElGamalDecrypter { +149c148 +< absl::StatusOr<ECPoint> Decrypt(const elgamal::Ciphertext& ciphertext) const; +--- +> StatusOr<ECPoint> Decrypt(const elgamal::Ciphertext& ciphertext) const; +154c153 +< absl::StatusOr<elgamal::Ciphertext> PartialDecrypt( +--- +> StatusOr<elgamal::Ciphertext> PartialDecrypt( +168c167 +< #endif // PRIVATE_JOIN_AND_COMPUTE_CRYPTO_ELGAMAL_H_ +--- +> #endif // CRYPTO_ELGAMAL_H_ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: elgamal.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: fixed_base_exp.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: fixed_base_exp.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: mont_mul.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: mont_mul.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: openssl_init.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: openssl_init.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: paillier.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: paillier.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: paillier.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: pedersen_over_zn.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: pedersen_over_zn.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: pedersen_over_zn_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: shanks_discrete_log.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: shanks_discrete_log.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: simultaneous_fixed_bases_exp.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: simultaneous_fixed_bases_exp.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: simultaneous_fixed_bases_exp_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: two_modulus_crt.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/crypto: two_modulus_crt.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: data_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: data_util.h +Only in third_party/private-join-and-compute/src/: DEPS +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: generate_dummy_data.cc +Only in third_party/private-join-and-compute/src/: LICENSE +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: match.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: message_sink.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: private_intersection_sum.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: private_join_and_compute.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: private_join_and_compute_rpc_impl.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: private_join_and_compute_rpc_impl.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: protocol_client.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: protocol_server.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: py +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: server.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: server_impl.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/: server_impl.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: BUILD +Only in third_party/private-join-and-compute/src/util: canonical_errors.cc +Only in third_party/private-join-and-compute/src/util: canonical_errors.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: ec_key_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: ec_key_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: ec_key_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_key_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_key_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_key_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_proto_util.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_proto_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: elgamal_proto_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file_posix.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: file_test.proto +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: process_record_file_parameters.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: process_record_file_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: process_record_file_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: proto_util.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: proto_util_test.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: recordio.cc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: recordio.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: recordio_test.cc +Only in third_party/private-join-and-compute/src/util: status.h +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/util/status.inc third_party/private-join-and-compute/src/util/status.inc +2c2 +< * Copyright 2019 Google LLC. +--- +> * Copyright 2019 Google Inc. +16,36c16,19 +< #include "absl/status/status.h" // IWYU pragma: export +< #include "absl/status/statusor.h" // IWYU pragma: export +< +< #include "private_join_and_compute/util/status_macros.h" +< +< namespace private_join_and_compute { +< // Aliases StatusCode to be compatible with our code. +< using StatusCode = ::absl::StatusCode; +< // Aliases Status, StatusOr and canonical errors. This alias exists for +< // historical reasons (when this library had a fork of absl::Status). +< using Status = absl::Status; +< template <typename T> +< using StatusOr = absl::StatusOr<T>; +< using absl::InternalError; +< using absl::InvalidArgumentError; +< using absl::IsInternal; +< using absl::IsInvalidArgument; +< using absl::OkStatus; +< } // namespace private_join_and_compute +< +< +--- +> #include "third_party/private-join-and-compute/src/util/canonical_errors.h" +> #include "third_party/private-join-and-compute/src/util/status.h" +> #include "third_party/private-join-and-compute/src/util/statusor.h" +> #include "third_party/private-join-and-compute/src/util/status_macros.h" +diff '--color=auto' -r /tmp/private-join-and-compute.08df854/private_join_and_compute/util/status_macros.h third_party/private-join-and-compute/src/util/status_macros.h +16,17c16,17 +< #ifndef PRIVATE_JOIN_AND_COMPUTE_UTIL_STATUS_MACROS_H_ +< #define PRIVATE_JOIN_AND_COMPUTE_UTIL_STATUS_MACROS_H_ +--- +> #ifndef UTIL_STATUS_MACROS_H_ +> #define UTIL_STATUS_MACROS_H_ +19,21c19,21 +< #include "absl/base/port.h" +< #include "absl/status/status.h" +< #include "absl/status/statusor.h" +--- +> #include "third_party/private-join-and-compute/src/chromium_patch.h" +> #include "third_party/private-join-and-compute/src/util/status.h" +> #include "third_party/private-join-and-compute/src/util/statusor.h" +66c66 +< #endif // PRIVATE_JOIN_AND_COMPUTE_UTIL_STATUS_MACROS_H_ +--- +> #endif // UTIL_STATUS_MACROS_H_ +Only in third_party/private-join-and-compute/src/util: status_macros.h.~main~ +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: status_matchers.h +Only in third_party/private-join-and-compute/src/util: statusor.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: status_testing.h +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: status_testing.inc +Only in /tmp/private-join-and-compute.08df854/private_join_and_compute/util: test.proto
diff --git a/third_party/private-join-and-compute/src/util/status_macros.h b/third_party/private-join-and-compute/src/util/status_macros.h index ee88aa2..2a70a22 100644 --- a/third_party/private-join-and-compute/src/util/status_macros.h +++ b/third_party/private-join-and-compute/src/util/status_macros.h
@@ -1,5 +1,5 @@ /* - * Copyright 2019 Google Inc. + * Copyright 2019 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,23 +23,44 @@ // Helper macro that checks if the right hand side (rexpression) evaluates to a // StatusOr with Status OK, and if so assigns the value to the value on the left // hand side (lhs), otherwise returns the error status. Example: -// ASSIGN_OR_RETURN(lhs, rexpression); -#define ASSIGN_OR_RETURN(lhs, rexpr) \ - PRIVACY_BLINDERS_ASSIGN_OR_RETURN_IMPL_( \ - PRIVACY_BLINDERS_STATUS_MACROS_IMPL_CONCAT_(status_or_value, __LINE__), \ +// PJC_ASSIGN_OR_RETURN(lhs, rexpression); +#ifndef PJC_ASSIGN_OR_RETURN +#define PJC_ASSIGN_OR_RETURN(lhs, rexpr) \ + PRIVATE_JOIN_AND_COMPUTE_ASSIGN_OR_RETURN_IMPL_( \ + PRIVATE_JOIN_AND_COMPUTE_STATUS_MACROS_IMPL_CONCAT_(status_or_value, \ + __LINE__), \ lhs, rexpr) // Internal helper. -#define PRIVACY_BLINDERS_ASSIGN_OR_RETURN_IMPL_(statusor, lhs, rexpr) \ - auto statusor = (rexpr); \ - if (!statusor.ok()) [[unlikely]] { \ - return std::move(statusor).status(); \ - } \ - lhs = std::move(statusor).value() +#define PRIVATE_JOIN_AND_COMPUTE_ASSIGN_OR_RETURN_IMPL_(statusor, lhs, rexpr) \ + auto statusor = (rexpr); \ + if (ABSL_PREDICT_FALSE(!statusor.ok())) { \ + return std::move(statusor).status(); \ + } \ + lhs = *std::move(statusor) +#endif // PJC_ASSIGN_OR_RETURN + +// Helper macro that checks if the given expression evaluates to a +// Status with Status OK. If not, returns the error status. Example: +// PJC_RETURN_IF_ERROR(expression); +#ifndef PJC_RETURN_IF_ERROR +#define PJC_RETURN_IF_ERROR(expr) \ + PRIVATE_JOIN_AND_COMPUTE_RETURN_IF_ERROR_IMPL_( \ + PRIVATE_JOIN_AND_COMPUTE_STATUS_MACROS_IMPL_CONCAT_(status_value, \ + __LINE__), \ + expr) + +// Internal helper. +#define PRIVATE_JOIN_AND_COMPUTE_RETURN_IF_ERROR_IMPL_(status, expr) \ + auto status = (expr); \ + if (ABSL_PREDICT_FALSE(!status.ok())) { \ + return status; \ + } +#endif // PJC_RETURN_IF_ERROR // Internal helper for concatenating macro values. -#define PRIVACY_BLINDERS_STATUS_MACROS_IMPL_CONCAT_INNER_(x, y) x##y -#define PRIVACY_BLINDERS_STATUS_MACROS_IMPL_CONCAT_(x, y) \ - PRIVACY_BLINDERS_STATUS_MACROS_IMPL_CONCAT_INNER_(x, y) +#define PRIVATE_JOIN_AND_COMPUTE_STATUS_MACROS_IMPL_CONCAT_INNER_(x, y) x##y +#define PRIVATE_JOIN_AND_COMPUTE_STATUS_MACROS_IMPL_CONCAT_(x, y) \ + PRIVATE_JOIN_AND_COMPUTE_STATUS_MACROS_IMPL_CONCAT_INNER_(x, y) #endif // UTIL_STATUS_MACROS_H_
diff --git a/third_party/protobuf/.github/workflows/test_java.yml b/third_party/protobuf/.github/workflows/test_java.yml index 94dff14..3e04ad26 100644 --- a/third_party/protobuf/.github/workflows/test_java.yml +++ b/third_party/protobuf/.github/workflows/test_java.yml
@@ -34,8 +34,7 @@ # TODO: b/318555165 - enable the layering check. Currently it does # not work correctly with the toolchain in this Docker image. targets: //java/... //java/internal:java_version //compatibility/... --features=-layering_check - # TODO: b/393604460 - enable bzlmod once coursier error is fixed. - flags: --java_language_version=8 --noenable_bzlmod + flags: --java_language_version=8 - name: OpenJDK 11 cache_key: '11' image: us-docker.pkg.dev/protobuf-build/containers/test/linux/java:7.1.2-11-d9624f2aa83cba3eaf906f751d75b36aacb9aa82
diff --git a/third_party/protobuf/CMakeLists.txt b/third_party/protobuf/CMakeLists.txt index 3e10d12..66e80a8 100644 --- a/third_party/protobuf/CMakeLists.txt +++ b/third_party/protobuf/CMakeLists.txt
@@ -86,7 +86,7 @@ endif () # Version metadata -set(protobuf_VERSION_STRING "6.30.1") +set(protobuf_VERSION_STRING "6.30.2") set(protobuf_DESCRIPTION "Protocol Buffers") set(protobuf_CONTACT "protobuf@googlegroups.com")
diff --git a/third_party/protobuf/MODULE.bazel b/third_party/protobuf/MODULE.bazel index d90bd39..400186b 100644 --- a/third_party/protobuf/MODULE.bazel +++ b/third_party/protobuf/MODULE.bazel
@@ -3,7 +3,7 @@ module( name = "protobuf", - version = "30.1", # Automatically updated on release + version = "30.2", # Automatically updated on release compatibility_level = 1, repo_name = "com_google_protobuf", ) @@ -85,10 +85,31 @@ use_repo(pip, "protobuf_pip_deps") -protobuf_maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven", dev_dependency = True) +PROTOBUF_MAVEN_ARTIFACTS = [ + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.code.gson:gson:2.8.9", + "com.google.errorprone:error_prone_annotations:2.5.1", + "com.google.j2objc:j2objc-annotations:2.8", + "com.google.guava:guava:32.0.1-jre", +] + +protobuf_maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") protobuf_maven.install( name = "protobuf_maven", - artifacts = [ + artifacts = PROTOBUF_MAVEN_ARTIFACTS, + lock_file = "//:maven_install.json", + repositories = [ + "https://repo1.maven.org/maven2", + "https://repo.maven.apache.org/maven2", + ], +) +use_repo(protobuf_maven, "protobuf_maven") + +# Development dependencies +protobuf_maven_dev = use_extension("@rules_jvm_external//:extensions.bzl", "maven", dev_dependency = True) +protobuf_maven_dev.install( + name = "protobuf_maven_dev", + artifacts = PROTOBUF_MAVEN_ARTIFACTS + [ "com.google.caliper:caliper:1.0-beta-3", "com.google.guava:guava-testlib:32.0.1-jre", "com.google.testparameterinjector:test-parameter-injector:1.18", @@ -98,29 +119,13 @@ "biz.aQute.bnd:biz.aQute.bndlib:6.4.0", "info.picocli:picocli:4.6.3", ], + lock_file = "//:maven_dev_install.json", repositories = [ "https://repo1.maven.org/maven2", "https://repo.maven.apache.org/maven2", ], ) -use_repo(protobuf_maven, "protobuf_maven") - -maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") -maven.install( - name = "maven", - artifacts = [ - "com.google.code.findbugs:jsr305:3.0.2", - "com.google.code.gson:gson:2.8.9", - "com.google.errorprone:error_prone_annotations:2.5.1", - "com.google.j2objc:j2objc-annotations:2.8", - "com.google.guava:guava:32.0.1-jre", - ], - repositories = [ - "https://repo1.maven.org/maven2", - "https://repo.maven.apache.org/maven2", - ], -) -use_repo(maven, "maven") +use_repo(protobuf_maven_dev, "protobuf_maven_dev") # Development dependencies bazel_dep(name = "googletest", version = "1.14.0", dev_dependency = True)
diff --git a/third_party/protobuf/Protobuf.podspec b/third_party/protobuf/Protobuf.podspec index 14e66e9..bfac7865 100644 --- a/third_party/protobuf/Protobuf.podspec +++ b/third_party/protobuf/Protobuf.podspec
@@ -5,7 +5,7 @@ # dependent projects use the :git notation to refer to the library. Pod::Spec.new do |s| s.name = 'Protobuf' - s.version = '4.30.1' + s.version = '4.30.2' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/protocolbuffers/protobuf' s.license = 'BSD-3-Clause'
diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README.chromium index 65585c5..63e4511 100644 --- a/third_party/protobuf/README.chromium +++ b/third_party/protobuf/README.chromium
@@ -3,9 +3,9 @@ URL: https://github.com/google/protobuf License: BSD-3-Clause License File: LICENSE -Version: 30.1 -CPEPrefix: cpe:/a:google:protobuf:30.1 -Revision: 0d815c5b74281f081c1ee4b431a4d5bbb1615c97 +Version: 30.2 +CPEPrefix: cpe:/a:google:protobuf:30.2 +Revision: 43e1626812c1b543e56a7bec59dc09eb18248bd2 Security Critical: yes Shipped: yes
diff --git a/third_party/protobuf/WORKSPACE b/third_party/protobuf/WORKSPACE index e89c81c..b1030fa 100644 --- a/third_party/protobuf/WORKSPACE +++ b/third_party/protobuf/WORKSPACE
@@ -65,7 +65,7 @@ load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( - name = "maven", + name = "protobuf_maven", artifacts = PROTOBUF_MAVEN_ARTIFACTS, # For updating instructions, see: # https://github.com/bazelbuild/rules_jvm_external#updating-maven_installjson @@ -76,11 +76,12 @@ ], ) -load("@maven//:defs.bzl", "pinned_maven_install") +load("@protobuf_maven//:defs.bzl", "pinned_maven_install") + pinned_maven_install() maven_install( - name = "protobuf_maven", + name = "protobuf_maven_dev", artifacts = [ "com.google.caliper:caliper:1.0-beta-3", "com.google.guava:guava-testlib:32.0.1-jre", @@ -100,9 +101,9 @@ ], ) -load("@protobuf_maven//:defs.bzl", pinned_protobuf_maven_install = "pinned_maven_install") -pinned_protobuf_maven_install() +load("@protobuf_maven_dev//:defs.bzl", pinned_protobuf_maven_install = "pinned_maven_install") +pinned_protobuf_maven_install() # For `cc_proto_blacklist_test` and `build_test`. load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
diff --git a/third_party/protobuf/cmake/installed_include_golden.txt b/third_party/protobuf/cmake/installed_include_golden.txt index 20ad3219..9a1bad8 100644 --- a/third_party/protobuf/cmake/installed_include_golden.txt +++ b/third_party/protobuf/cmake/installed_include_golden.txt
@@ -12,9 +12,11 @@ google/protobuf/compiler/code_generator.h google/protobuf/compiler/code_generator_lite.h google/protobuf/compiler/command_line_interface.h +google/protobuf/compiler/cpp/generator.h google/protobuf/compiler/cpp/helpers.h google/protobuf/compiler/cpp/names.h google/protobuf/compiler/cpp/options.h +google/protobuf/compiler/csharp/csharp_generator.h google/protobuf/compiler/csharp/names.h google/protobuf/compiler/importer.h google/protobuf/compiler/java/context.h @@ -25,7 +27,9 @@ google/protobuf/compiler/java/name_resolver.h google/protobuf/compiler/java/names.h google/protobuf/compiler/java/options.h +google/protobuf/compiler/kotlin/generator.h google/protobuf/compiler/notices.h +google/protobuf/compiler/objectivec/generator.h google/protobuf/compiler/objectivec/line_consumer.h google/protobuf/compiler/objectivec/names.h google/protobuf/compiler/objectivec/nsobject_methods.h @@ -35,7 +39,10 @@ google/protobuf/compiler/plugin.h google/protobuf/compiler/plugin.pb.h google/protobuf/compiler/plugin.proto +google/protobuf/compiler/python/generator.h +google/protobuf/compiler/python/pyi_generator.h google/protobuf/compiler/retention.h +google/protobuf/compiler/ruby/ruby_generator.h google/protobuf/compiler/scc.h google/protobuf/compiler/subprocess.h google/protobuf/compiler/versions.h
diff --git a/third_party/protobuf/csharp/Google.Protobuf.Tools.nuspec b/third_party/protobuf/csharp/Google.Protobuf.Tools.nuspec index d629c56..a49040f 100644 --- a/third_party/protobuf/csharp/Google.Protobuf.Tools.nuspec +++ b/third_party/protobuf/csharp/Google.Protobuf.Tools.nuspec
@@ -5,7 +5,7 @@ <title>Google Protocol Buffers tools</title> <summary>Tools for Protocol Buffers - Google's data interchange format.</summary> <description>See project site for more info.</description> - <version>3.30.1</version> + <version>3.30.2</version> <authors>Google Inc.</authors> <owners>protobuf-packages</owners> <licenseUrl>https://github.com/protocolbuffers/protobuf/blob/main/LICENSE</licenseUrl>
diff --git a/third_party/protobuf/csharp/src/Google.Protobuf.Test/testprotos.pb b/third_party/protobuf/csharp/src/Google.Protobuf.Test/testprotos.pb index b27cd3b..12865bb 100644 --- a/third_party/protobuf/csharp/src/Google.Protobuf.Test/testprotos.pb +++ b/third_party/protobuf/csharp/src/Google.Protobuf.Test/testprotos.pb Binary files differ
diff --git a/third_party/protobuf/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/third_party/protobuf/csharp/src/Google.Protobuf/Google.Protobuf.csproj index f02f615..3fcd16c 100644 --- a/third_party/protobuf/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/third_party/protobuf/csharp/src/Google.Protobuf/Google.Protobuf.csproj
@@ -5,7 +5,7 @@ <Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description> <Copyright>Copyright 2015, Google Inc.</Copyright> <AssemblyTitle>Google Protocol Buffers</AssemblyTitle> - <VersionPrefix>3.30.1</VersionPrefix> + <VersionPrefix>3.30.2</VersionPrefix> <LangVersion>10.0</LangVersion> <Authors>Google Inc.</Authors> <TargetFrameworks>netstandard1.1;netstandard2.0;net45;net50</TargetFrameworks>
diff --git a/third_party/protobuf/examples/WORKSPACE b/third_party/protobuf/examples/WORKSPACE index 7cf8b5aef..5b8c8d0 100644 --- a/third_party/protobuf/examples/WORKSPACE +++ b/third_party/protobuf/examples/WORKSPACE
@@ -76,7 +76,7 @@ load("@rules_jvm_external//:defs.bzl", "maven_install") maven_install( - name = "maven", + name = "protobuf_maven", artifacts = PROTOBUF_MAVEN_ARTIFACTS, repositories = [ "https://repo1.maven.org/maven2",
diff --git a/third_party/protobuf/java/bom/pom.xml b/third_party/protobuf/java/bom/pom.xml index 608f2450..1a0f690 100644 --- a/third_party/protobuf/java/bom/pom.xml +++ b/third_party/protobuf/java/bom/pom.xml
@@ -4,7 +4,7 @@ <groupId>com.google.protobuf</groupId> <artifactId>protobuf-bom</artifactId> - <version>4.30.1</version> + <version>4.30.2</version> <packaging>pom</packaging> <name>Protocol Buffers [BOM]</name>
diff --git a/third_party/protobuf/java/core/BUILD.bazel b/third_party/protobuf/java/core/BUILD.bazel index 0698fef..b998d83d 100644 --- a/third_party/protobuf/java/core/BUILD.bazel +++ b/third_party/protobuf/java/core/BUILD.bazel
@@ -147,6 +147,7 @@ deps = [":lite_runtime_only"], ) +# Bazel users, don't depend on this target, use //java/lite. protobuf_versioned_java_library( name = "lite_bundle", srcs = LITE_SRCS + [ @@ -268,22 +269,17 @@ ], ) +# Bazel users, don't depend on this target, use :core. protobuf_versioned_java_library( name = "core_bundle", - srcs = FULL_SRCS, + srcs = FULL_SRCS + LITE_SRCS, automatic_module_name = "com.google.protobuf", bundle_description = "Core Protocol Buffers library. Protocol Buffers " + "are a way of encoding structured data in an " + "efficient yet extensible format.", bundle_name = "Protocol Buffers [Core]", bundle_symbolic_name = "com.google.protobuf", - visibility = ["//visibility:public"], - exports = [ - ":lite_runtime_only", - ], - deps = [ - ":lite_runtime_only", - ], + visibility = ["//visibility:private"], ) # Bazel users, don't depend on this target, use :core. @@ -393,8 +389,8 @@ ":generic_test_protos_java_proto", ":java_test_protos_java_proto", ":lite_test_protos_java_proto", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:junit_junit", ], ) @@ -444,11 +440,11 @@ ":java_test_protos_java_proto", ":lite_test_protos_java_proto", ":test_util", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:com_google_testparameterinjector_test_parameter_injector", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", - "@protobuf_maven//:org_mockito_mockito_core", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:com_google_testparameterinjector_test_parameter_injector", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", + "@protobuf_maven_dev//:org_mockito_mockito_core", ], ) @@ -464,9 +460,9 @@ ], deps = [ ":core", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", ], ) @@ -521,8 +517,8 @@ ":java_test_protos_java_proto_lite", ":lite_runtime_only", ":lite_test_protos_java_proto_lite", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:junit_junit", ], ) @@ -533,6 +529,7 @@ "src/test/java/com/google/protobuf/CodedInputStreamTest.java", "src/test/java/com/google/protobuf/DeprecatedFieldTest.java", "src/test/java/com/google/protobuf/DebugFormatTest.java", + "src/test/java/com/google/protobuf/ConcurrentDescriptorsTest.java", "src/test/java/com/google/protobuf/DescriptorsTest.java", "src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java", "src/test/java/com/google/protobuf/DynamicMessageTest.java", @@ -590,9 +587,9 @@ ":lite", ":lite_test_protos_java_proto_lite", ":test_util_lite", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", - "@protobuf_maven//:org_mockito_mockito_core", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", + "@protobuf_maven_dev//:org_mockito_mockito_core", ], ) @@ -606,8 +603,8 @@ deps = [ ":core", "//compatibility:v25_test_protos_srcjar", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:junit_junit", ], ) @@ -640,10 +637,10 @@ ":core", ":v25_test_util_srcjar", "//compatibility:v25_test_protos_srcjar", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", - "@protobuf_maven//:org_mockito_mockito_core", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", + "@protobuf_maven_dev//:org_mockito_mockito_core", ], ) @@ -657,8 +654,8 @@ deps = [ ":core", "//compatibility:v25_test_protos_jar", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:junit_junit", ], ) @@ -690,10 +687,10 @@ ":core", ":v25_test_util_jar", "//compatibility:v25_test_protos_jar", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", - "@protobuf_maven//:org_mockito_mockito_core", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", + "@protobuf_maven_dev//:org_mockito_mockito_core", ], )
diff --git a/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Descriptors.java b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Descriptors.java index c459781..420298d33 100644 --- a/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Descriptors.java +++ b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/Descriptors.java
@@ -537,6 +537,7 @@ private final FileDescriptor[] dependencies; private final FileDescriptor[] publicDependencies; private final DescriptorPool pool; + private volatile boolean featuresResolved; private FileDescriptor( final FileDescriptorProto proto, @@ -547,6 +548,7 @@ this.pool = pool; this.proto = proto; this.dependencies = dependencies.clone(); + this.featuresResolved = false; HashMap<String, FileDescriptor> nameToFileMap = new HashMap<>(); for (FileDescriptor file : dependencies) { nameToFileMap.put(file.getName(), file); @@ -618,6 +620,7 @@ .build(); this.dependencies = new FileDescriptor[0]; this.publicDependencies = new FileDescriptor[0]; + this.featuresResolved = false; messageTypes = new Descriptor[] {message}; enumTypes = EMPTY_ENUM_DESCRIPTORS; @@ -641,12 +644,12 @@ * and all of its children. */ private void resolveAllFeaturesInternal() throws DescriptorValidationException { - if (this.features != null) { + if (this.featuresResolved) { return; } synchronized (this) { - if (this.features != null) { + if (this.featuresResolved) { return; } resolveFeatures(proto.getOptions().getFeatures()); @@ -666,6 +669,7 @@ for (FieldDescriptor extension : extensions) { extension.resolveAllFeatures(); } + this.featuresResolved = true; } } @@ -2934,10 +2938,7 @@ } if (this.features == null) { throw new NullPointerException( - String.format( - "Features not yet loaded for %s. This may be caused by a known issue for proto2" - + " dependency descriptors obtained from proto1 (b/362326130)", - getFullName())); + String.format("Features not yet loaded for %s.", getFullName())); } return this.features; }
diff --git a/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RuntimeVersion.java b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RuntimeVersion.java index c329902..b765502 100644 --- a/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RuntimeVersion.java +++ b/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RuntimeVersion.java
@@ -28,7 +28,7 @@ public static final RuntimeDomain OSS_DOMAIN = RuntimeDomain.PUBLIC; public static final int OSS_MAJOR = 4; public static final int OSS_MINOR = 30; - public static final int OSS_PATCH = 1; + public static final int OSS_PATCH = 2; public static final String OSS_SUFFIX = ""; public static final RuntimeDomain DOMAIN = OSS_DOMAIN;
diff --git a/third_party/protobuf/java/core/src/test/java/com/google/protobuf/ConcurrentDescriptorsTest.java b/third_party/protobuf/java/core/src/test/java/com/google/protobuf/ConcurrentDescriptorsTest.java new file mode 100644 index 0000000..17686167 --- /dev/null +++ b/third_party/protobuf/java/core/src/test/java/com/google/protobuf/ConcurrentDescriptorsTest.java
@@ -0,0 +1,113 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2025 Google Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd + +package com.google.protobuf; + +import proto2_unittest.UnittestProto; +import proto2_unittest.UnittestProto.TestAllTypes; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public final class ConcurrentDescriptorsTest { + public static final int N = 1000; + + static class Worker implements Runnable { + private final CountDownLatch startSignal; + private final CountDownLatch doneSignal; + private final Runnable trigger; + + Worker(CountDownLatch startSignal, CountDownLatch doneSignal, Runnable trigger) { + this.startSignal = startSignal; + this.doneSignal = doneSignal; + this.trigger = trigger; + } + + @Override + public void run() { + try { + startSignal.await(); + trigger.run(); + } catch (InterruptedException | RuntimeException e) { + doneSignal.countDown(); + throw new RuntimeException(e); // Rethrow for main thread to handle + } + doneSignal.countDown(); + } + } + + @Test + public void testSimultaneousStaticInit() throws InterruptedException { + ExecutorService executor = Executors.newFixedThreadPool(N); + CountDownLatch startSignal = new CountDownLatch(1); + CountDownLatch doneSignal = new CountDownLatch(N); + List<Future<?>> futures = new ArrayList<>(N); + for (int i = 0; i < N; i++) { + Future<?> future = + executor.submit( + new Worker( + startSignal, + doneSignal, + // Static method invocation triggers static initialization. + () -> Assert.assertNotNull(UnittestProto.getDescriptor()))); + futures.add(future); + } + startSignal.countDown(); + doneSignal.await(); + System.out.println("Done with all threads..."); + for (int i = 0; i < futures.size(); i++) { + try { + futures.get(i).get(); + } catch (ExecutionException e) { + Assert.fail("Thread " + i + " failed with:" + e.getMessage()); + } + } + executor.shutdown(); + } + + @Test + public void testSimultaneousFeatureAccess() throws InterruptedException { + ExecutorService executor = Executors.newFixedThreadPool(N); + CountDownLatch startSignal = new CountDownLatch(1); + CountDownLatch doneSignal = new CountDownLatch(N); + List<Future<?>> futures = new ArrayList<>(N); + for (int i = 0; i < N; i++) { + Future<?> future = + executor.submit( + new Worker( + startSignal, + doneSignal, + // hasPresence() uses the [field_presence] feature. + () -> + Assert.assertTrue( + TestAllTypes.getDescriptor() + .findFieldByName("optional_int32") + .hasPresence()))); + futures.add(future); + } + startSignal.countDown(); + doneSignal.await(); + System.out.println("Done with all threads..."); + for (int i = 0; i < futures.size(); i++) { + try { + futures.get(i).get(); + } catch (ExecutionException e) { + Assert.fail("Thread " + i + " failed with:" + e.getMessage()); + } + } + executor.shutdown(); + } +}
diff --git a/third_party/protobuf/java/internal/BUILD.bazel b/third_party/protobuf/java/internal/BUILD.bazel index f349e5a..79fb9f551 100644 --- a/third_party/protobuf/java/internal/BUILD.bazel +++ b/third_party/protobuf/java/internal/BUILD.bazel
@@ -19,7 +19,7 @@ srcs = ["JavaVersionTest.java"], test_class = "JavaVersionTest", deps = [ - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", ], )
diff --git a/third_party/protobuf/java/kotlin-lite/BUILD.bazel b/third_party/protobuf/java/kotlin-lite/BUILD.bazel index 6f3d01b..70b21ac 100644 --- a/third_party/protobuf/java/kotlin-lite/BUILD.bazel +++ b/third_party/protobuf/java/kotlin-lite/BUILD.bazel
@@ -115,8 +115,8 @@ "//java/kotlin:only_for_use_in_proto_generated_code_its_generator_and_tests", "//java/kotlin:shared_runtime", "//java/lite", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", "@rules_kotlin//kotlin/compiler:kotlin-test", ], ) @@ -211,8 +211,8 @@ deps = [ ":kotlin_unittest_lite", "//java/core:test_util_lite", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", ], ) @@ -228,8 +228,8 @@ deps = [ ":kotlin_proto3_unittest_lite", "//java/core:test_util_lite", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", ], )
diff --git a/third_party/protobuf/java/kotlin/BUILD.bazel b/third_party/protobuf/java/kotlin/BUILD.bazel index f286d687..501f137 100644 --- a/third_party/protobuf/java/kotlin/BUILD.bazel +++ b/third_party/protobuf/java/kotlin/BUILD.bazel
@@ -117,8 +117,8 @@ deps = [ ":bytestring_lib", "//java/core:lite_runtime_only", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", "@rules_kotlin//kotlin/compiler:kotlin-test", ], ) @@ -152,9 +152,9 @@ ":example_extensible_message_java_proto", ":only_for_use_in_proto_generated_code_its_generator_and_tests", ":shared_runtime", - "@protobuf_maven//:com_google_guava_guava_testlib", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_guava_guava_testlib", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", "@rules_kotlin//kotlin/compiler:kotlin-test", ], ) @@ -178,8 +178,8 @@ ":only_for_use_in_proto_generated_code_its_generator_and_tests", ":shared_runtime", "//java/core", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", "@rules_kotlin//kotlin/compiler:kotlin-test", ], ) @@ -290,8 +290,8 @@ deps = [ ":kotlin_unittest", "//java/core:test_util", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", "@rules_kotlin//kotlin/compiler:kotlin-reflect", ], ) @@ -308,8 +308,8 @@ deps = [ ":kotlin_proto3_unittest", "//java/core:test_util", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", ], )
diff --git a/third_party/protobuf/java/kotlin/pom.xml b/third_party/protobuf/java/kotlin/pom.xml index 9c2ce19..555312c 100644 --- a/third_party/protobuf/java/kotlin/pom.xml +++ b/third_party/protobuf/java/kotlin/pom.xml
@@ -4,7 +4,7 @@ <parent> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-parent</artifactId> - <version>4.30.1</version> + <version>4.30.2</version> </parent> <artifactId>protobuf-kotlin</artifactId>
diff --git a/third_party/protobuf/java/lite/BUILD.bazel b/third_party/protobuf/java/lite/BUILD.bazel index c67cb76..0754c74 100644 --- a/third_party/protobuf/java/lite/BUILD.bazel +++ b/third_party/protobuf/java/lite/BUILD.bazel
@@ -76,8 +76,8 @@ "//java/core:java_test_protos_java_proto_lite", "//java/core:lite_test_protos_java_proto_lite", "//java/core:test_util_lite", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", ], )
diff --git a/third_party/protobuf/java/osgi/BUILD.bazel b/third_party/protobuf/java/osgi/BUILD.bazel index 0a9b21052..e55bc2b8 100644 --- a/third_party/protobuf/java/osgi/BUILD.bazel +++ b/third_party/protobuf/java/osgi/BUILD.bazel
@@ -9,8 +9,8 @@ srcs = ["OsgiWrapper.java"], main_class = "com.google.protobuf.osgi.OsgiWrapper", deps = [ - "@protobuf_maven//:biz_aQute_bnd_biz_aQute_bndlib", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:info_picocli_picocli", + "@protobuf_maven_dev//:biz_aQute_bnd_biz_aQute_bndlib", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:info_picocli_picocli", ], )
diff --git a/third_party/protobuf/java/pom.xml b/third_party/protobuf/java/pom.xml index 2256dd88..2101328 100644 --- a/third_party/protobuf/java/pom.xml +++ b/third_party/protobuf/java/pom.xml
@@ -4,7 +4,7 @@ <groupId>com.google.protobuf</groupId> <artifactId>protobuf-parent</artifactId> - <version>4.30.1</version> + <version>4.30.2</version> <packaging>pom</packaging> <name>Protocol Buffers [Parent]</name>
diff --git a/third_party/protobuf/java/protoc/pom.xml b/third_party/protobuf/java/protoc/pom.xml index 9e5c020..3a00092 100644 --- a/third_party/protobuf/java/protoc/pom.xml +++ b/third_party/protobuf/java/protoc/pom.xml
@@ -8,7 +8,7 @@ </parent> <groupId>com.google.protobuf</groupId> <artifactId>protoc</artifactId> - <version>4.30.1</version> + <version>4.30.2</version> <packaging>pom</packaging> <name>Protobuf Compiler</name> <description>
diff --git a/third_party/protobuf/java/util/BUILD.bazel b/third_party/protobuf/java/util/BUILD.bazel index d80e63f..2e0e6f1 100644 --- a/third_party/protobuf/java/util/BUILD.bazel +++ b/third_party/protobuf/java/util/BUILD.bazel
@@ -14,11 +14,11 @@ visibility = ["//visibility:public"], deps = [ "//java/core", - "@maven//:com_google_code_findbugs_jsr305", - "@maven//:com_google_code_gson_gson", - "@maven//:com_google_errorprone_error_prone_annotations", - "@maven//:com_google_guava_guava", - "@maven//:com_google_j2objc_j2objc_annotations", + "@protobuf_maven//:com_google_code_findbugs_jsr305", + "@protobuf_maven//:com_google_code_gson_gson", + "@protobuf_maven//:com_google_errorprone_error_prone_annotations", + "@protobuf_maven//:com_google_guava_guava", + "@protobuf_maven//:com_google_j2objc_j2objc_annotations", ], ) @@ -91,11 +91,11 @@ ":util", "//java/core", "//java/core:generic_test_protos_java_proto", - "@protobuf_maven//:com_google_code_gson_gson", - "@protobuf_maven//:com_google_guava_guava", - "@protobuf_maven//:com_google_j2objc_j2objc_annotations", - "@protobuf_maven//:com_google_truth_truth", - "@protobuf_maven//:junit_junit", + "@protobuf_maven_dev//:com_google_code_gson_gson", + "@protobuf_maven_dev//:com_google_guava_guava", + "@protobuf_maven_dev//:com_google_j2objc_j2objc_annotations", + "@protobuf_maven_dev//:com_google_truth_truth", + "@protobuf_maven_dev//:junit_junit", ], )
diff --git a/third_party/protobuf/patches/0029-make-initializers-optimizable.patch b/third_party/protobuf/patches/0029-make-initializers-optimizable.patch index 7646aad..9761524 100644 --- a/third_party/protobuf/patches/0029-make-initializers-optimizable.patch +++ b/third_party/protobuf/patches/0029-make-initializers-optimizable.patch
@@ -57,6 +57,27 @@ InitProtobufDefaultsSlow(); } } +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index b800697578986..31f2a7f6d8999 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -573,16 +573,6 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), + #define PROTOBUF_FINAL final + #endif + +-// Determines the platforms where descriptor weak messages can be used. +-#ifdef PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED +-#error PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED was previously defined +-#endif +-#if defined(__GNUC__) && defined(__clang__) && !defined(__APPLE__) && \ +- !defined(_MSC_VER) +-#define PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED +-#endif +- +- + // TODO: Enable the feature by default and remove this flag. + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + #error PROTOBUF_PREFETCH_PARSE_TABLE was previously defined -- -2.49.0.rc1.451.g8f38331e32-goog +2.49.0.901.g37484f566f-goog
diff --git a/third_party/protobuf/patches/0030-workaround-windows-constinit.patch b/third_party/protobuf/patches/0030-workaround-windows-constinit.patch index 29787a64..f57827b6 100644 --- a/third_party/protobuf/patches/0030-workaround-windows-constinit.patch +++ b/third_party/protobuf/patches/0030-workaround-windows-constinit.patch
@@ -39,18 +39,18 @@ )cc"); } diff --git a/src/google/protobuf/compiler/cpp/message.cc b/src/google/protobuf/compiler/cpp/message.cc -index 1b4b8e6051772..9caa39c20af28 100644 ---- a/third_party/protobuf/src/google/protobuf/compiler/cpp/message.cc -+++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/message.cc +index 4b9b9b84b1ea8..b89bfaab5bd58 100644 +--- a/src/google/protobuf/compiler/cpp/message.cc ++++ b/src/google/protobuf/compiler/cpp/message.cc @@ -4210,7 +4210,7 @@ void MessageGenerator::GenerateClassData(io::Printer* p) { }; } -- PROTOBUF_CONSTINIT$ dllexport_decl$ -+ PROTOBUF_CONSTINIT_WITH_PTR$ dllexport_decl$ - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const $pbi$::ClassDataFull - $classname$_class_data_ = - $classname$::InternalGenerateClassData_(); +- PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ++ PROTOBUF_CONSTINIT_WITH_PTR PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + $pbi$::ClassDataFull $classname$_class_data_ = + $classname$::InternalGenerateClassData_(); + diff --git a/src/google/protobuf/compiler/cpp/parse_function_generator.cc b/src/google/protobuf/compiler/cpp/parse_function_generator.cc index 774679bd30804..be004cef4b39b 100644 --- a/src/google/protobuf/compiler/cpp/parse_function_generator.cc
diff --git a/third_party/protobuf/patches/0052-remove-dynamic-annotations.patch b/third_party/protobuf/patches/0052-remove-dynamic-annotations.patch index e7343177..8abb2ae 100644 --- a/third_party/protobuf/patches/0052-remove-dynamic-annotations.patch +++ b/third_party/protobuf/patches/0052-remove-dynamic-annotations.patch
@@ -1,15 +1,15 @@ diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc -index bbbeb343b7cf7..d2a631b4d465e 100644 +index dcbea63f535e3..e2795db8331df 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc -@@ -37,7 +37,6 @@ +@@ -38,7 +38,6 @@ #include "absl/base/call_once.h" #include "absl/base/casts.h" #include "absl/base/const_init.h" -#include "absl/base/dynamic_annotations.h" + #include "absl/base/optimization.h" #include "absl/base/thread_annotations.h" #include "absl/cleanup/cleanup.h" - #include "absl/container/btree_map.h" diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index cacad88b13735..e428811d27169 100644 --- a/src/google/protobuf/repeated_field.h
diff --git a/third_party/protobuf/patches/0054-use-full-types-in-java-context.patch b/third_party/protobuf/patches/0054-use-full-types-in-java-context.patch index c693b32..86d100d 100644 --- a/third_party/protobuf/patches/0054-use-full-types-in-java-context.patch +++ b/third_party/protobuf/patches/0054-use-full-types-in-java-context.patch
@@ -1,19 +1,19 @@ diff --git a/src/google/protobuf/compiler/java/context.h b/src/google/protobuf/compiler/java/context.h index 993301bbd796b..8117ce67821bd 100644 ---- a//src/google/protobuf/compiler/java/context.h -+++ b//src/google/protobuf/compiler/java/context.h -@@ -12,1 +12,1 @@ +--- a/src/google/protobuf/compiler/java/context.h ++++ b/src/google/protobuf/compiler/java/context.h +@@ -12,6 +12,7 @@ #include <vector> - + #include "absl/container/flat_hash_map.h" +#include "google/protobuf/compiler/java/field_common.h" #include "google/protobuf/compiler/java/helpers.h" #include "google/protobuf/compiler/java/options.h" #include "google/protobuf/port.h" -@@ -36,2 +37,2 @@ namespace protobuf { +@@ -36,8 +37,6 @@ namespace protobuf { namespace compiler { namespace java { - + -struct FieldGeneratorInfo; -struct OneofGeneratorInfo; // A context object holds the information that is shared among all code
diff --git a/third_party/protobuf/php/ext/google/protobuf/protobuf.h b/third_party/protobuf/php/ext/google/protobuf/protobuf.h index 3bee72a..61e7be7 100644 --- a/third_party/protobuf/php/ext/google/protobuf/protobuf.h +++ b/third_party/protobuf/php/ext/google/protobuf/protobuf.h
@@ -32,7 +32,7 @@ ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -#define PHP_PROTOBUF_VERSION "4.30.1" +#define PHP_PROTOBUF_VERSION "4.30.2" // ptr -> PHP object cache. This is a weak map that caches lazily-created // wrapper objects around upb types:
diff --git a/third_party/protobuf/pkg/BUILD.bazel b/third_party/protobuf/pkg/BUILD.bazel index 0c2c008..fdc00fe 100644 --- a/third_party/protobuf/pkg/BUILD.bazel +++ b/third_party/protobuf/pkg/BUILD.bazel
@@ -224,8 +224,15 @@ "//src/google/protobuf/compiler/java:names", "//src/google/protobuf/compiler/objectivec:names", "//src/google/protobuf/compiler/php:names", - # TODO Make this private once gRPC migrates off it. + # TODO Make these private in the next breaking C++ release. + "//src/google/protobuf/compiler/cpp:generator_headers", + "//src/google/protobuf/compiler/csharp:generator_headers", + "//src/google/protobuf/compiler/java:generator_headers", + "//src/google/protobuf/compiler/kotlin:generator_headers", + "//src/google/protobuf/compiler/objectivec:generator_headers", "//src/google/protobuf/compiler/php", + "//src/google/protobuf/compiler/python:generator_headers", + "//src/google/protobuf/compiler/ruby:generator_headers", ], )
diff --git a/third_party/protobuf/protobuf_version.bzl b/third_party/protobuf/protobuf_version.bzl index 6267795d..81269e4 100644 --- a/third_party/protobuf/protobuf_version.bzl +++ b/third_party/protobuf/protobuf_version.bzl
@@ -1,8 +1,8 @@ """ Contains version numbers to be used in other bzl files """ -PROTOC_VERSION = "30.1" -PROTOBUF_JAVA_VERSION = "4.30.1" -PROTOBUF_PYTHON_VERSION = "6.30.1" -PROTOBUF_PHP_VERSION = "4.30.1" -PROTOBUF_RUBY_VERSION = "4.30.1" -PROTOBUF_RUST_VERSION = "4.30.1" +PROTOC_VERSION = "30.2" +PROTOBUF_JAVA_VERSION = "4.30.2" +PROTOBUF_PYTHON_VERSION = "6.30.2" +PROTOBUF_PHP_VERSION = "4.30.2" +PROTOBUF_RUBY_VERSION = "4.30.2" +PROTOBUF_RUST_VERSION = "4.30.2" PROTOBUF_PREVIOUS_RELEASE = "28.0-rc1"
diff --git a/third_party/protobuf/python/google/protobuf/__init__.py b/third_party/protobuf/python/google/protobuf/__init__.py index cf28114..6f52a5f9 100755 --- a/third_party/protobuf/python/google/protobuf/__init__.py +++ b/third_party/protobuf/python/google/protobuf/__init__.py
@@ -7,4 +7,4 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '6.30.1' +__version__ = '6.30.2'
diff --git a/third_party/protobuf/python/google/protobuf/compiler/plugin_pb2.py b/third_party/protobuf/python/google/protobuf/compiler/plugin_pb2.py index 692eecb..341a3e4 100644 --- a/third_party/protobuf/python/google/protobuf/compiler/plugin_pb2.py +++ b/third_party/protobuf/python/google/protobuf/compiler/plugin_pb2.py
@@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: google/protobuf/compiler/plugin.proto -# Protobuf Python Version: 6.30.1 +# Protobuf Python Version: 6.30.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -13,7 +13,7 @@ _runtime_version.Domain.PUBLIC, 6, 30, - 1, + 2, '', 'google/protobuf/compiler/plugin.proto' )
diff --git a/third_party/protobuf/python/google/protobuf/descriptor_pb2.py b/third_party/protobuf/python/google/protobuf/descriptor_pb2.py index 79a8c3a..854f35d 100644 --- a/third_party/protobuf/python/google/protobuf/descriptor_pb2.py +++ b/third_party/protobuf/python/google/protobuf/descriptor_pb2.py
@@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: google/protobuf/descriptor.proto -# Protobuf Python Version: 6.30.1 +# Protobuf Python Version: 6.30.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -13,7 +13,7 @@ _runtime_version.Domain.PUBLIC, 6, 30, - 1, + 2, '', 'google/protobuf/descriptor.proto' )
diff --git a/third_party/protobuf/python/google/protobuf/runtime_version.py b/third_party/protobuf/python/google/protobuf/runtime_version.py index d4367ac..0288924 100644 --- a/third_party/protobuf/python/google/protobuf/runtime_version.py +++ b/third_party/protobuf/python/google/protobuf/runtime_version.py
@@ -29,7 +29,7 @@ OSS_DOMAIN = Domain.PUBLIC OSS_MAJOR = 6 OSS_MINOR = 30 -OSS_PATCH = 1 +OSS_PATCH = 2 OSS_SUFFIX = '' DOMAIN = OSS_DOMAIN
diff --git a/third_party/protobuf/ruby/google-protobuf.gemspec b/third_party/protobuf/ruby/google-protobuf.gemspec index c899bbd5..1d3cead3 100644 --- a/third_party/protobuf/ruby/google-protobuf.gemspec +++ b/third_party/protobuf/ruby/google-protobuf.gemspec
@@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "4.30.1" + s.version = "4.30.2" git_tag = "v#{s.version.to_s.sub('.rc.', '-rc')}" # Converts X.Y.Z.rc.N to vX.Y.Z-rcN, used for the git tag s.licenses = ["BSD-3-Clause"] s.summary = "Protocol Buffers"
diff --git a/third_party/protobuf/ruby/pom.xml b/third_party/protobuf/ruby/pom.xml index d9cd3b9..742313e5 100644 --- a/third_party/protobuf/ruby/pom.xml +++ b/third_party/protobuf/ruby/pom.xml
@@ -9,7 +9,7 @@ <groupId>com.google.protobuf.jruby</groupId> <artifactId>protobuf-jruby</artifactId> - <version>4.30.1</version> + <version>4.30.2</version> <name>Protocol Buffer JRuby native extension</name> <description> Protocol Buffers are a way of encoding structured data in an efficient yet @@ -76,7 +76,7 @@ <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java-util</artifactId> - <version>4.30.1</version> + <version>4.30.2</version> </dependency> <dependency> <groupId>org.jruby</groupId>
diff --git a/third_party/protobuf/src/file_lists.cmake b/third_party/protobuf/src/file_lists.cmake index d74a982..a2c1997c 100644 --- a/third_party/protobuf/src/file_lists.cmake +++ b/third_party/protobuf/src/file_lists.cmake
@@ -316,9 +316,11 @@ ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/code_generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/code_generator_lite.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/command_line_interface.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/cpp/generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/cpp/helpers.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/cpp/names.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/cpp/options.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/csharp/csharp_generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/csharp/names.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/context.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/doc_comment.h @@ -328,7 +330,9 @@ ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/name_resolver.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/names.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/options.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/kotlin/generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/notices.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/line_consumer.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/names.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/nsobject_methods.h @@ -336,7 +340,10 @@ ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/php/php_generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.pb.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/python/generator.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/python/pyi_generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/retention.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/ruby/ruby_generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/scc.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/subprocess.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/versions.h
diff --git a/third_party/protobuf/src/google/protobuf/any.pb.cc b/third_party/protobuf/src/google/protobuf/any.pb.cc index 53e27aa..d824f974 100644 --- a/third_party/protobuf/src/google/protobuf/any.pb.cc +++ b/third_party/protobuf/src/google/protobuf/any.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/any.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/any.pb.h" @@ -228,10 +228,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Any_class_data_ = - Any::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Any_class_data_ = + Any::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/any.pb.h b/third_party/protobuf/src/google/protobuf/any.pb.h index 5586d7c..801f5df 100644 --- a/third_party/protobuf/src/google/protobuf/any.pb.h +++ b/third_party/protobuf/src/google/protobuf/any.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/any.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fany_2eproto_2epb_2eh #define google_2fprotobuf_2fany_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/api.pb.cc b/third_party/protobuf/src/google/protobuf/api.pb.cc index 4039a9c..fd21356 100644 --- a/third_party/protobuf/src/google/protobuf/api.pb.cc +++ b/third_party/protobuf/src/google/protobuf/api.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/api.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/api.pb.h" @@ -398,10 +398,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Api_class_data_ = - Api::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Api_class_data_ = + Api::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -899,10 +898,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Method_class_data_ = - Method::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Method_class_data_ = + Method::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1368,10 +1366,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Mixin_class_data_ = - Mixin::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Mixin_class_data_ = + Mixin::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/api.pb.h b/third_party/protobuf/src/google/protobuf/api.pb.h index 2404c5eb..eb3e59e 100644 --- a/third_party/protobuf/src/google/protobuf/api.pb.h +++ b/third_party/protobuf/src/google/protobuf/api.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/api.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fapi_2eproto_2epb_2eh #define google_2fprotobuf_2fapi_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/BUILD.bazel b/third_party/protobuf/src/google/protobuf/compiler/cpp/BUILD.bazel index 72aa5e2..f1febdd 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/BUILD.bazel +++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/BUILD.bazel
@@ -23,6 +23,20 @@ ) cc_library( + name = "generator_headers", + hdrs = ["generator.h"], + copts = COPTS, + strip_include_prefix = "/src", + visibility = ["//pkg:__pkg__"], + deps = [ + "//src/google/protobuf", + "//src/google/protobuf/compiler:code_generator", + "@abseil-cpp//absl/status", + "@abseil-cpp//absl/strings", + ], +) + +cc_library( name = "names_internal", srcs = [ "helpers.cc",
diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/message.cc b/third_party/protobuf/src/google/protobuf/compiler/cpp/message.cc index dc5a522..b89bfaab 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/message.cc +++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/message.cc
@@ -4210,10 +4210,9 @@ }; } - PROTOBUF_CONSTINIT_WITH_PTR$ dllexport_decl$ - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const $pbi$::ClassDataFull - $classname$_class_data_ = - $classname$::InternalGenerateClassData_(); + PROTOBUF_CONSTINIT_WITH_PTR PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + $pbi$::ClassDataFull $classname$_class_data_ = + $classname$::InternalGenerateClassData_(); //~ This function needs to be marked as weak to avoid significantly //~ slowing down compilation times. This breaks up LLVM's SCC
diff --git a/third_party/protobuf/src/google/protobuf/compiler/csharp/BUILD.bazel b/third_party/protobuf/src/google/protobuf/compiler/csharp/BUILD.bazel index c140fc3..1e965e4 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/csharp/BUILD.bazel +++ b/third_party/protobuf/src/google/protobuf/compiler/csharp/BUILD.bazel
@@ -21,6 +21,18 @@ ) cc_library( + name = "generator_headers", + hdrs = ["csharp_generator.h"], + copts = COPTS, + strip_include_prefix = "/src", + visibility = ["//pkg:__pkg__"], + deps = [ + "//src/google/protobuf", + "//src/google/protobuf/compiler:code_generator", + ], +) + +cc_library( name = "csharp", srcs = [ "csharp_doc_comment.cc",
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/BUILD.bazel b/third_party/protobuf/src/google/protobuf/compiler/java/BUILD.bazel index 16c2128..5197a0f 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/java/BUILD.bazel +++ b/third_party/protobuf/src/google/protobuf/compiler/java/BUILD.bazel
@@ -25,6 +25,18 @@ ) cc_library( + name = "generator_headers", + hdrs = ["generator.h"], + copts = COPTS, + strip_include_prefix = "/src", + visibility = ["//pkg:__pkg__"], + deps = [ + "//src/google/protobuf", + "//src/google/protobuf/compiler:code_generator", + ], +) + +cc_library( name = "helpers", srcs = [ "doc_comment.cc",
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_features.pb.cc b/third_party/protobuf/src/google/protobuf/compiler/java/java_features.pb.cc index 2261a689..c779bea 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/java/java_features.pb.cc +++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_features.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/compiler/java/java_features.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/compiler/java/java_features.pb.h" @@ -224,10 +224,9 @@ }; } -PROTOBUF_CONSTINIT PROTOC_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - JavaFeatures_class_data_ = - JavaFeatures::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull JavaFeatures_class_data_ = + JavaFeatures::InternalGenerateClassData_(); const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL JavaFeatures::GetClassData() const { ::google::protobuf::internal::PrefetchToLocalCache(&JavaFeatures_class_data_);
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_features.pb.h b/third_party/protobuf/src/google/protobuf/compiler/java/java_features.pb.h index 83d6a66..7944e5e 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/java/java_features.pb.h +++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_features.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/compiler/java/java_features.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_2epb_2eh #define google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/compiler/kotlin/BUILD.bazel b/third_party/protobuf/src/google/protobuf/compiler/kotlin/BUILD.bazel index 3ae6340a..94799b7 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/kotlin/BUILD.bazel +++ b/third_party/protobuf/src/google/protobuf/compiler/kotlin/BUILD.bazel
@@ -1,6 +1,18 @@ load("//build_defs:cpp_opts.bzl", "COPTS") cc_library( + name = "generator_headers", + hdrs = ["generator.h"], + copts = COPTS, + strip_include_prefix = "/src", + visibility = ["//pkg:__pkg__"], + deps = [ + "//src/google/protobuf", + "//src/google/protobuf/compiler:code_generator", + ], +) + +cc_library( name = "kotlin", srcs = ["generator.cc"], hdrs = ["generator.h"],
diff --git a/third_party/protobuf/src/google/protobuf/compiler/objectivec/BUILD.bazel b/third_party/protobuf/src/google/protobuf/compiler/objectivec/BUILD.bazel index b74a135..26b4766 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/objectivec/BUILD.bazel +++ b/third_party/protobuf/src/google/protobuf/compiler/objectivec/BUILD.bazel
@@ -18,6 +18,18 @@ ) cc_library( + name = "generator_headers", + hdrs = ["generator.h"], + copts = COPTS, + strip_include_prefix = "/src", + visibility = ["//pkg:__pkg__"], + deps = [ + "//src/google/protobuf", + "//src/google/protobuf/compiler:code_generator", + ], +) + +cc_library( name = "names_internal", srcs = [ "names.cc",
diff --git a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc index 082c0b90..7684b28 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc +++ b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/compiler/plugin.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/compiler/plugin.pb.h" @@ -412,10 +412,9 @@ }; } -PROTOBUF_CONSTINIT PROTOC_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Version_class_data_ = - Version::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Version_class_data_ = + Version::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -784,10 +783,9 @@ }; } -PROTOBUF_CONSTINIT PROTOC_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - CodeGeneratorRequest_class_data_ = - CodeGeneratorRequest::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull CodeGeneratorRequest_class_data_ = + CodeGeneratorRequest::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1192,10 +1190,9 @@ }; } -PROTOBUF_CONSTINIT PROTOC_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - CodeGeneratorResponse_File_class_data_ = - CodeGeneratorResponse_File::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull CodeGeneratorResponse_File_class_data_ = + CodeGeneratorResponse_File::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1567,10 +1564,9 @@ }; } -PROTOBUF_CONSTINIT PROTOC_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - CodeGeneratorResponse_class_data_ = - CodeGeneratorResponse::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull CodeGeneratorResponse_class_data_ = + CodeGeneratorResponse::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h index 4ff61ab8..cd7f2e7 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h +++ b/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/compiler/plugin.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh #define google_2fprotobuf_2fcompiler_2fplugin_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/compiler/python/BUILD.bazel b/third_party/protobuf/src/google/protobuf/compiler/python/BUILD.bazel index f3b00be..7fde826 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/python/BUILD.bazel +++ b/third_party/protobuf/src/google/protobuf/compiler/python/BUILD.bazel
@@ -7,6 +7,26 @@ load("//build_defs:cpp_opts.bzl", "COPTS") cc_library( + name = "generator_headers", + hdrs = [ + "generator.h", + "pyi_generator.h", + ], + copts = COPTS, + strip_include_prefix = "/src", + visibility = ["//pkg:__pkg__"], + deps = [ + "//src/google/protobuf", + "//src/google/protobuf/compiler:code_generator", + "@abseil-cpp//absl/container:flat_hash_map", + "@abseil-cpp//absl/container:flat_hash_set", + "@abseil-cpp//absl/memory", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/synchronization", + ], +) + +cc_library( name = "python", srcs = [ "generator.cc",
diff --git a/third_party/protobuf/src/google/protobuf/compiler/ruby/BUILD.bazel b/third_party/protobuf/src/google/protobuf/compiler/ruby/BUILD.bazel index 2109139..7a2fdd8c 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/ruby/BUILD.bazel +++ b/third_party/protobuf/src/google/protobuf/compiler/ruby/BUILD.bazel
@@ -7,6 +7,18 @@ load("//build_defs:cpp_opts.bzl", "COPTS") cc_library( + name = "generator_headers", + hdrs = ["ruby_generator.h"], + copts = COPTS, + strip_include_prefix = "/src", + visibility = ["//pkg:__pkg__"], + deps = [ + "//src/google/protobuf", + "//src/google/protobuf/compiler:code_generator", + ], +) + +cc_library( name = "ruby", srcs = ["ruby_generator.cc"], hdrs = ["ruby_generator.h"],
diff --git a/third_party/protobuf/src/google/protobuf/compiler/versions.h b/third_party/protobuf/src/google/protobuf/compiler/versions.h index 964e620..ecd2db9 100644 --- a/third_party/protobuf/src/google/protobuf/compiler/versions.h +++ b/third_party/protobuf/src/google/protobuf/compiler/versions.h
@@ -53,10 +53,10 @@ // // Please avoid changing them manually, as they should be updated automatically // by Protobuf release process. -#define PROTOBUF_CPP_VERSION_STRING "6.30.1" -#define PROTOBUF_JAVA_VERSION_STRING "4.30.1" -#define PROTOBUF_PYTHON_VERSION_STRING "6.30.1" -#define PROTOBUF_RUST_VERSION_STRING "4.30.1" +#define PROTOBUF_CPP_VERSION_STRING "6.30.2" +#define PROTOBUF_JAVA_VERSION_STRING "4.30.2" +#define PROTOBUF_PYTHON_VERSION_STRING "6.30.2" +#define PROTOBUF_RUST_VERSION_STRING "4.30.2" namespace google {
diff --git a/third_party/protobuf/src/google/protobuf/cpp_features.pb.cc b/third_party/protobuf/src/google/protobuf/cpp_features.pb.cc index 76ceeef0..30d2395b 100644 --- a/third_party/protobuf/src/google/protobuf/cpp_features.pb.cc +++ b/third_party/protobuf/src/google/protobuf/cpp_features.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/cpp_features.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/cpp_features.pb.h" @@ -218,10 +218,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - CppFeatures_class_data_ = - CppFeatures::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull CppFeatures_class_data_ = + CppFeatures::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/cpp_features.pb.h b/third_party/protobuf/src/google/protobuf/cpp_features.pb.h index 249d1e9..fa85bf1 100644 --- a/third_party/protobuf/src/google/protobuf/cpp_features.pb.h +++ b/third_party/protobuf/src/google/protobuf/cpp_features.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/cpp_features.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh #define google_2fprotobuf_2fcpp_5ffeatures_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/descriptor.cc b/third_party/protobuf/src/google/protobuf/descriptor.cc index dcbea63f..e2795db 100644 --- a/third_party/protobuf/src/google/protobuf/descriptor.cc +++ b/third_party/protobuf/src/google/protobuf/descriptor.cc
@@ -38,7 +38,6 @@ #include "absl/base/call_once.h" #include "absl/base/casts.h" #include "absl/base/const_init.h" -#include "absl/base/dynamic_annotations.h" #include "absl/base/optimization.h" #include "absl/base/thread_annotations.h" #include "absl/cleanup/cleanup.h"
diff --git a/third_party/protobuf/src/google/protobuf/descriptor.pb.cc b/third_party/protobuf/src/google/protobuf/descriptor.pb.cc index 06c33301..3768b2e 100644 --- a/third_party/protobuf/src/google/protobuf/descriptor.pb.cc +++ b/third_party/protobuf/src/google/protobuf/descriptor.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/descriptor.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/descriptor.pb.h" @@ -2459,10 +2459,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FileDescriptorSet_class_data_ = - FileDescriptorSet::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FileDescriptorSet_class_data_ = + FileDescriptorSet::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -2795,10 +2794,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FileDescriptorProto_class_data_ = - FileDescriptorProto::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FileDescriptorProto_class_data_ = + FileDescriptorProto::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -3431,10 +3429,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - DescriptorProto_ExtensionRange_class_data_ = - DescriptorProto_ExtensionRange::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull DescriptorProto_ExtensionRange_class_data_ = + DescriptorProto_ExtensionRange::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -3743,10 +3740,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - DescriptorProto_ReservedRange_class_data_ = - DescriptorProto_ReservedRange::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull DescriptorProto_ReservedRange_class_data_ = + DescriptorProto_ReservedRange::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -4084,10 +4080,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - DescriptorProto_class_data_ = - DescriptorProto::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull DescriptorProto_class_data_ = + DescriptorProto::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -4651,10 +4646,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - ExtensionRangeOptions_Declaration_class_data_ = - ExtensionRangeOptions_Declaration::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ExtensionRangeOptions_Declaration_class_data_ = + ExtensionRangeOptions_Declaration::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -5036,10 +5030,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - ExtensionRangeOptions_class_data_ = - ExtensionRangeOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ExtensionRangeOptions_class_data_ = + ExtensionRangeOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -5444,10 +5437,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FieldDescriptorProto_class_data_ = - FieldDescriptorProto::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FieldDescriptorProto_class_data_ = + FieldDescriptorProto::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -5984,10 +5976,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - OneofDescriptorProto_class_data_ = - OneofDescriptorProto::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull OneofDescriptorProto_class_data_ = + OneofDescriptorProto::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -6276,10 +6267,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - EnumDescriptorProto_EnumReservedRange_class_data_ = - EnumDescriptorProto_EnumReservedRange::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull EnumDescriptorProto_EnumReservedRange_class_data_ = + EnumDescriptorProto_EnumReservedRange::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -6587,10 +6577,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - EnumDescriptorProto_class_data_ = - EnumDescriptorProto::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull EnumDescriptorProto_class_data_ = + EnumDescriptorProto::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -6992,10 +6981,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - EnumValueDescriptorProto_class_data_ = - EnumValueDescriptorProto::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull EnumValueDescriptorProto_class_data_ = + EnumValueDescriptorProto::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -7341,10 +7329,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - ServiceDescriptorProto_class_data_ = - ServiceDescriptorProto::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ServiceDescriptorProto_class_data_ = + ServiceDescriptorProto::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -7700,10 +7687,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - MethodDescriptorProto_class_data_ = - MethodDescriptorProto::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull MethodDescriptorProto_class_data_ = + MethodDescriptorProto::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -8165,10 +8151,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FileOptions_class_data_ = - FileOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FileOptions_class_data_ = + FileOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -8973,10 +8958,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - MessageOptions_class_data_ = - MessageOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull MessageOptions_class_data_ = + MessageOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -9376,10 +9360,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FieldOptions_EditionDefault_class_data_ = - FieldOptions_EditionDefault::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FieldOptions_EditionDefault_class_data_ = + FieldOptions_EditionDefault::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -9671,10 +9654,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FieldOptions_FeatureSupport_class_data_ = - FieldOptions_FeatureSupport::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FieldOptions_FeatureSupport_class_data_ = + FieldOptions_FeatureSupport::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -10057,10 +10039,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FieldOptions_class_data_ = - FieldOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FieldOptions_class_data_ = + FieldOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -10658,10 +10639,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - OneofOptions_class_data_ = - OneofOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull OneofOptions_class_data_ = + OneofOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -11006,10 +10986,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - EnumOptions_class_data_ = - EnumOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull EnumOptions_class_data_ = + EnumOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -11416,10 +11395,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - EnumValueOptions_class_data_ = - EnumValueOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull EnumValueOptions_class_data_ = + EnumValueOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -11835,10 +11813,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - ServiceOptions_class_data_ = - ServiceOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ServiceOptions_class_data_ = + ServiceOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -12209,10 +12186,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - MethodOptions_class_data_ = - MethodOptions::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull MethodOptions_class_data_ = + MethodOptions::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -12582,10 +12558,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - UninterpretedOption_NamePart_class_data_ = - UninterpretedOption_NamePart::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull UninterpretedOption_NamePart_class_data_ = + UninterpretedOption_NamePart::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -12899,10 +12874,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - UninterpretedOption_class_data_ = - UninterpretedOption::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull UninterpretedOption_class_data_ = + UninterpretedOption::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -13343,10 +13317,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FeatureSet_class_data_ = - FeatureSet::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FeatureSet_class_data_ = + FeatureSet::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -13764,10 +13737,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FeatureSetDefaults_FeatureSetEditionDefault_class_data_ = - FeatureSetDefaults_FeatureSetEditionDefault::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FeatureSetDefaults_FeatureSetEditionDefault_class_data_ = + FeatureSetDefaults_FeatureSetEditionDefault::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -14121,10 +14093,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FeatureSetDefaults_class_data_ = - FeatureSetDefaults::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FeatureSetDefaults_class_data_ = + FeatureSetDefaults::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -14471,10 +14442,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - SourceCodeInfo_Location_class_data_ = - SourceCodeInfo_Location::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull SourceCodeInfo_Location_class_data_ = + SourceCodeInfo_Location::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -14851,10 +14821,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - SourceCodeInfo_class_data_ = - SourceCodeInfo::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull SourceCodeInfo_class_data_ = + SourceCodeInfo::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -15142,10 +15111,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - GeneratedCodeInfo_Annotation_class_data_ = - GeneratedCodeInfo_Annotation::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull GeneratedCodeInfo_Annotation_class_data_ = + GeneratedCodeInfo_Annotation::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -15511,10 +15479,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - GeneratedCodeInfo_class_data_ = - GeneratedCodeInfo::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull GeneratedCodeInfo_class_data_ = + GeneratedCodeInfo::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/descriptor.pb.h b/third_party/protobuf/src/google/protobuf/descriptor.pb.h index 0b2a75d..c5c86b5 100644 --- a/third_party/protobuf/src/google/protobuf/descriptor.pb.h +++ b/third_party/protobuf/src/google/protobuf/descriptor.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/descriptor.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh #define google_2fprotobuf_2fdescriptor_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/duration.pb.cc b/third_party/protobuf/src/google/protobuf/duration.pb.cc index 3376e2b9..c27d262 100644 --- a/third_party/protobuf/src/google/protobuf/duration.pb.cc +++ b/third_party/protobuf/src/google/protobuf/duration.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/duration.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/duration.pb.h" @@ -197,10 +197,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Duration_class_data_ = - Duration::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Duration_class_data_ = + Duration::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/duration.pb.h b/third_party/protobuf/src/google/protobuf/duration.pb.h index 9b1d27bf..1a099d5 100644 --- a/third_party/protobuf/src/google/protobuf/duration.pb.h +++ b/third_party/protobuf/src/google/protobuf/duration.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/duration.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fduration_2eproto_2epb_2eh #define google_2fprotobuf_2fduration_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/empty.pb.cc b/third_party/protobuf/src/google/protobuf/empty.pb.cc index 6f954a9e..e63abe3 100644 --- a/third_party/protobuf/src/google/protobuf/empty.pb.cc +++ b/third_party/protobuf/src/google/protobuf/empty.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/empty.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/empty.pb.h" @@ -159,10 +159,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Empty_class_data_ = - Empty::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Empty_class_data_ = + Empty::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/empty.pb.h b/third_party/protobuf/src/google/protobuf/empty.pb.h index b267284..8324680 100644 --- a/third_party/protobuf/src/google/protobuf/empty.pb.h +++ b/third_party/protobuf/src/google/protobuf/empty.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/empty.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fempty_2eproto_2epb_2eh #define google_2fprotobuf_2fempty_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/field_mask.pb.cc b/third_party/protobuf/src/google/protobuf/field_mask.pb.cc index 5c1feca..24c31459 100644 --- a/third_party/protobuf/src/google/protobuf/field_mask.pb.cc +++ b/third_party/protobuf/src/google/protobuf/field_mask.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/field_mask.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/field_mask.pb.h" @@ -208,10 +208,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FieldMask_class_data_ = - FieldMask::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FieldMask_class_data_ = + FieldMask::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/field_mask.pb.h b/third_party/protobuf/src/google/protobuf/field_mask.pb.h index 7eb97a0..c3cefdc 100644 --- a/third_party/protobuf/src/google/protobuf/field_mask.pb.h +++ b/third_party/protobuf/src/google/protobuf/field_mask.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/field_mask.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2ffield_5fmask_2eproto_2epb_2eh #define google_2fprotobuf_2ffield_5fmask_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/port.cc b/third_party/protobuf/src/google/protobuf/port.cc index af668e9e..d60c2b89 100644 --- a/third_party/protobuf/src/google/protobuf/port.cc +++ b/third_party/protobuf/src/google/protobuf/port.cc
@@ -97,14 +97,9 @@ } } -#if defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT const GlobalEmptyString - fixed_address_empty_string{}; -#else PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GlobalEmptyString fixed_address_empty_string{}; -#endif } // namespace internal } // namespace protobuf
diff --git a/third_party/protobuf/src/google/protobuf/port.h b/third_party/protobuf/src/google/protobuf/port.h index 5f9e909..386ecc02 100644 --- a/third_party/protobuf/src/google/protobuf/port.h +++ b/third_party/protobuf/src/google/protobuf/port.h
@@ -494,20 +494,27 @@ // Default empty string object. Don't use this directly. Instead, call // GetEmptyString() to get the reference. This empty string is aligned with a // minimum alignment of 8 bytes to match the requirement of ArenaStringPtr. -#if defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L + // Take advantage of C++20 constexpr support in std::string. -class alignas(8) GlobalEmptyString { +class alignas(8) GlobalEmptyStringConstexpr { public: const std::string& get() const { return value_; } // Nothing to init, or destroy. std::string* Init() const { return nullptr; } + template <typename T = std::string, bool = (T(), true)> + static constexpr std::true_type HasConstexprDefaultConstructor(int) { + return {}; + } + static constexpr std::false_type HasConstexprDefaultConstructor(char) { + return {}; + } + private: std::string value_; }; -PROTOBUF_EXPORT extern const GlobalEmptyString fixed_address_empty_string; -#else -class alignas(8) GlobalEmptyString { + +class alignas(8) GlobalEmptyStringDynamicInit { public: const std::string& get() const { return *reinterpret_cast<const std::string*>(internal::Launder(buffer_)); @@ -519,8 +526,12 @@ private: alignas(std::string) char buffer_[sizeof(std::string)]; }; + +using GlobalEmptyString = std::conditional_t< + GlobalEmptyStringConstexpr::HasConstexprDefaultConstructor(0), + const GlobalEmptyStringConstexpr, GlobalEmptyStringDynamicInit>; + PROTOBUF_EXPORT extern GlobalEmptyString fixed_address_empty_string; -#endif } // namespace internal } // namespace protobuf
diff --git a/third_party/protobuf/src/google/protobuf/port_def.inc b/third_party/protobuf/src/google/protobuf/port_def.inc index b971127..31f2a7f6 100644 --- a/third_party/protobuf/src/google/protobuf/port_def.inc +++ b/third_party/protobuf/src/google/protobuf/port_def.inc
@@ -573,8 +573,6 @@ #define PROTOBUF_FINAL final #endif - - // TODO: Enable the feature by default and remove this flag. #ifdef PROTOBUF_PREFETCH_PARSE_TABLE #error PROTOBUF_PREFETCH_PARSE_TABLE was previously defined
diff --git a/third_party/protobuf/src/google/protobuf/runtime_version.h b/third_party/protobuf/src/google/protobuf/runtime_version.h index f2ad6502..e767d60f 100644 --- a/third_party/protobuf/src/google/protobuf/runtime_version.h +++ b/third_party/protobuf/src/google/protobuf/runtime_version.h
@@ -18,7 +18,7 @@ #endif // PROTOBUF_OSS_VERSION_SUFFIX // The OSS versions are not stripped to avoid merging conflicts. -#define PROTOBUF_OSS_VERSION 6030001 +#define PROTOBUF_OSS_VERSION 6030002 #define PROTOBUF_OSS_VERSION_SUFFIX "" #define PROTOBUF_VERSION PROTOBUF_OSS_VERSION
diff --git a/third_party/protobuf/src/google/protobuf/source_context.pb.cc b/third_party/protobuf/src/google/protobuf/source_context.pb.cc index ddb7f98..43dc2ea 100644 --- a/third_party/protobuf/src/google/protobuf/source_context.pb.cc +++ b/third_party/protobuf/src/google/protobuf/source_context.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/source_context.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/source_context.pb.h" @@ -205,10 +205,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - SourceContext_class_data_ = - SourceContext::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull SourceContext_class_data_ = + SourceContext::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/source_context.pb.h b/third_party/protobuf/src/google/protobuf/source_context.pb.h index 268ffac..978c4a8 100644 --- a/third_party/protobuf/src/google/protobuf/source_context.pb.h +++ b/third_party/protobuf/src/google/protobuf/source_context.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/source_context.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fsource_5fcontext_2eproto_2epb_2eh #define google_2fprotobuf_2fsource_5fcontext_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/struct.pb.cc b/third_party/protobuf/src/google/protobuf/struct.pb.cc index de1989f..93e4fc9 100644 --- a/third_party/protobuf/src/google/protobuf/struct.pb.cc +++ b/third_party/protobuf/src/google/protobuf/struct.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/struct.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/struct.pb.h" @@ -277,10 +277,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Struct_FieldsEntry_DoNotUse_class_data_ = - Struct_FieldsEntry_DoNotUse::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Struct_FieldsEntry_DoNotUse_class_data_ = + Struct_FieldsEntry_DoNotUse::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -440,10 +439,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Struct_class_data_ = - Struct::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Struct_class_data_ = + Struct::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -803,10 +801,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Value_class_data_ = - Value::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Value_class_data_ = + Value::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1183,10 +1180,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - ListValue_class_data_ = - ListValue::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull ListValue_class_data_ = + ListValue::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/struct.pb.h b/third_party/protobuf/src/google/protobuf/struct.pb.h index 00e0a5e..6ceeac7 100644 --- a/third_party/protobuf/src/google/protobuf/struct.pb.h +++ b/third_party/protobuf/src/google/protobuf/struct.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/struct.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fstruct_2eproto_2epb_2eh #define google_2fprotobuf_2fstruct_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/stubs/common.h b/third_party/protobuf/src/google/protobuf/stubs/common.h index d315ee4..23f7400d 100644 --- a/third_party/protobuf/src/google/protobuf/stubs/common.h +++ b/third_party/protobuf/src/google/protobuf/stubs/common.h
@@ -45,7 +45,7 @@ // The current version, represented as a single integer to make comparison // easier: major * 10^6 + minor * 10^3 + micro -#define GOOGLE_PROTOBUF_VERSION 6030001 +#define GOOGLE_PROTOBUF_VERSION 6030002 // A suffix string for alpha, beta or rc releases. Empty for stable releases. #define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
diff --git a/third_party/protobuf/src/google/protobuf/timestamp.pb.cc b/third_party/protobuf/src/google/protobuf/timestamp.pb.cc index 228182f..9910701 100644 --- a/third_party/protobuf/src/google/protobuf/timestamp.pb.cc +++ b/third_party/protobuf/src/google/protobuf/timestamp.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/timestamp.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/timestamp.pb.h" @@ -197,10 +197,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Timestamp_class_data_ = - Timestamp::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Timestamp_class_data_ = + Timestamp::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/timestamp.pb.h b/third_party/protobuf/src/google/protobuf/timestamp.pb.h index a0d5d8fa..2f3d4eb3 100644 --- a/third_party/protobuf/src/google/protobuf/timestamp.pb.h +++ b/third_party/protobuf/src/google/protobuf/timestamp.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/timestamp.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2ftimestamp_2eproto_2epb_2eh #define google_2fprotobuf_2ftimestamp_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/type.pb.cc b/third_party/protobuf/src/google/protobuf/type.pb.cc index 4d955a1..b3728dd 100644 --- a/third_party/protobuf/src/google/protobuf/type.pb.cc +++ b/third_party/protobuf/src/google/protobuf/type.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/type.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/type.pb.h" @@ -545,10 +545,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Type_class_data_ = - Type::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Type_class_data_ = + Type::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1043,10 +1042,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Field_class_data_ = - Field::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Field_class_data_ = + Field::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1649,10 +1647,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Enum_class_data_ = - Enum::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Enum_class_data_ = + Enum::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -2101,10 +2098,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - EnumValue_class_data_ = - EnumValue::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull EnumValue_class_data_ = + EnumValue::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -2441,10 +2437,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Option_class_data_ = - Option::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Option_class_data_ = + Option::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/type.pb.h b/third_party/protobuf/src/google/protobuf/type.pb.h index 6c113f93..f310215 100644 --- a/third_party/protobuf/src/google/protobuf/type.pb.h +++ b/third_party/protobuf/src/google/protobuf/type.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/type.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2ftype_2eproto_2epb_2eh #define google_2fprotobuf_2ftype_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/src/google/protobuf/wrappers.pb.cc b/third_party/protobuf/src/google/protobuf/wrappers.pb.cc index 108b0ef9..5eace5a0 100644 --- a/third_party/protobuf/src/google/protobuf/wrappers.pb.cc +++ b/third_party/protobuf/src/google/protobuf/wrappers.pb.cc
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/wrappers.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #include "google/protobuf/wrappers.pb.h" @@ -495,10 +495,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - DoubleValue_class_data_ = - DoubleValue::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull DoubleValue_class_data_ = + DoubleValue::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -731,10 +730,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - FloatValue_class_data_ = - FloatValue::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull FloatValue_class_data_ = + FloatValue::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -967,10 +965,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Int64Value_class_data_ = - Int64Value::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Int64Value_class_data_ = + Int64Value::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1204,10 +1201,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - UInt64Value_class_data_ = - UInt64Value::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull UInt64Value_class_data_ = + UInt64Value::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1441,10 +1437,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - Int32Value_class_data_ = - Int32Value::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Int32Value_class_data_ = + Int32Value::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1678,10 +1673,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - UInt32Value_class_data_ = - UInt32Value::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull UInt32Value_class_data_ = + UInt32Value::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -1915,10 +1909,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - BoolValue_class_data_ = - BoolValue::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull BoolValue_class_data_ = + BoolValue::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -2165,10 +2158,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - StringValue_class_data_ = - StringValue::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull StringValue_class_data_ = + StringValue::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL @@ -2429,10 +2421,9 @@ }; } -PROTOBUF_CONSTINIT PROTOBUF_EXPORT - PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const ::google::protobuf::internal::ClassDataFull - BytesValue_class_data_ = - BytesValue::InternalGenerateClassData_(); +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull BytesValue_class_data_ = + BytesValue::InternalGenerateClassData_(); PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL
diff --git a/third_party/protobuf/src/google/protobuf/wrappers.pb.h b/third_party/protobuf/src/google/protobuf/wrappers.pb.h index d7061d2..d44b39d 100644 --- a/third_party/protobuf/src/google/protobuf/wrappers.pb.h +++ b/third_party/protobuf/src/google/protobuf/wrappers.pb.h
@@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: google/protobuf/wrappers.proto -// Protobuf C++ Version: 6.30.1 +// Protobuf C++ Version: 6.30.2 #ifndef google_2fprotobuf_2fwrappers_2eproto_2epb_2eh #define google_2fprotobuf_2fwrappers_2eproto_2epb_2eh @@ -12,7 +12,7 @@ #include <utility> #include "google/protobuf/runtime_version.h" -#if PROTOBUF_VERSION != 6030001 +#if PROTOBUF_VERSION != 6030002 #error "Protobuf C++ gencode is built with an incompatible version of" #error "Protobuf C++ headers/runtime. See" #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
diff --git a/third_party/protobuf/version.json b/third_party/protobuf/version.json index 4c1c29d..5d1c1d8f9 100644 --- a/third_party/protobuf/version.json +++ b/third_party/protobuf/version.json
@@ -1,18 +1,18 @@ { "30.x": { - "protoc_version": "30.1", + "protoc_version": "30.2", "lts": false, - "date": "2025-03-13", + "date": "2025-03-26", "languages": { - "cpp": "6.30.1", - "csharp": "3.30.1", - "java": "4.30.1", - "javascript": "3.30.1", - "objectivec": "4.30.1", - "php": "4.30.1", - "python": "6.30.1", - "ruby": "4.30.1", - "rust": "4.30.1" + "cpp": "6.30.2", + "csharp": "3.30.2", + "java": "4.30.2", + "javascript": "3.30.2", + "objectivec": "4.30.2", + "php": "4.30.2", + "python": "6.30.2", + "ruby": "4.30.2", + "rust": "4.30.2" } } } \ No newline at end of file
diff --git a/third_party/skia b/third_party/skia index 02cd056..7104f14 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit 02cd0561f4f756bf4f7b16641d8fc4c61577c765 +Subproject commit 7104f1487466dae855c0c3fb7ff53283dee6b443
diff --git a/third_party/vulkan-deps b/third_party/vulkan-deps index ac1b0b8..063fff2 160000 --- a/third_party/vulkan-deps +++ b/third_party/vulkan-deps
@@ -1 +1 @@ -Subproject commit ac1b0b8709461338010b05b3308d7829445a06af +Subproject commit 063fff22da82669345380796662d7ec134bbd1e9
diff --git a/third_party/vulkan-validation-layers/src b/third_party/vulkan-validation-layers/src index 7a6329b..62aaa9f 160000 --- a/third_party/vulkan-validation-layers/src +++ b/third_party/vulkan-validation-layers/src
@@ -1 +1 @@ -Subproject commit 7a6329b34b1652acfd685941ed1f5735200cf522 +Subproject commit 62aaa9fbaad7accfffa5928ac5dc5d1119a04596
diff --git a/third_party/webrtc b/third_party/webrtc index 70fb834..de7866f 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit 70fb834e8c8c4617b00bdf42b3f8f9dd22d53a70 +Subproject commit de7866f6cab90d0dc7279cde6c2560fcae90c2d3
diff --git a/third_party/zlib/gzguts.h b/third_party/zlib/gzguts.h index f937504..adc2b34 100644 --- a/third_party/zlib/gzguts.h +++ b/third_party/zlib/gzguts.h
@@ -210,9 +210,5 @@ /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ -#ifdef INT_MAX -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) -#else unsigned ZLIB_INTERNAL gz_intmax(void); -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) -#endif +#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
diff --git a/third_party/zlib/gzlib.c b/third_party/zlib/gzlib.c index 0d3ebf8..7258cae 100644 --- a/third_party/zlib/gzlib.c +++ b/third_party/zlib/gzlib.c
@@ -566,20 +566,20 @@ #endif } -#ifndef INT_MAX /* portably return maximum value for an int (when limits.h presumed not available) -- we need to do this to cover cases where 2's complement not used, since C standard permits 1's complement and sign-bit representations, otherwise we could just use ((unsigned)-1) >> 1 */ unsigned ZLIB_INTERNAL gz_intmax(void) { - unsigned p, q; - - p = 1; +#ifdef INT_MAX + return INT_MAX; +#else + unsigned p = 1, q; do { q = p; p <<= 1; p++; } while (p > q); return q >> 1; -} #endif +}
diff --git a/third_party/zlib/test/minigzip.c b/third_party/zlib/test/minigzip.c index c72356dbc..134e10e 100644 --- a/third_party/zlib/test/minigzip.c +++ b/third_party/zlib/test/minigzip.c
@@ -303,7 +303,7 @@ #ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */ /* Try compressing the input file at once using mmap. Return Z_OK if - * if success, Z_ERRNO otherwise. + * success, Z_ERRNO otherwise. */ static int gz_compress_mmap(FILE *in, gzFile out) { int len;
diff --git a/third_party/zlib/zlib.h b/third_party/zlib/zlib.h index ba1812e..e2c920f 100644 --- a/third_party/zlib/zlib.h +++ b/third_party/zlib/zlib.h
@@ -1757,14 +1757,14 @@ seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ /* ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
diff --git a/third_party/zlib/zutil.h b/third_party/zlib/zutil.h index 2e2f5766..7155090 100644 --- a/third_party/zlib/zutil.h +++ b/third_party/zlib/zutil.h
@@ -71,7 +71,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] +#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err))
diff --git a/tools/android/devil_util/BUILD.gn b/tools/android/devil_util/BUILD.gn index db8866f7..d34ecf7a 100644 --- a/tools/android/devil_util/BUILD.gn +++ b/tools/android/devil_util/BUILD.gn
@@ -47,7 +47,6 @@ deps = [ "//base", "//third_party/zlib:zlib", - "//third_party/zlib/google:compression_utils_portable", "//third_party/zstd:compress", "//third_party/zstd:decompress", ]
diff --git a/tools/android/devil_util/crc32_hasher.cc b/tools/android/devil_util/crc32_hasher.cc index fde7bb7..1ff1ba6f 100644 --- a/tools/android/devil_util/crc32_hasher.cc +++ b/tools/android/devil_util/crc32_hasher.cc
@@ -13,34 +13,15 @@ #include "base/base64.h" #include "base/strings/string_split.h" -#include "third_party/zlib/google/compression_utils_portable.h" #include "third_party/zlib/zlib.h" Crc32Hasher::Crc32Hasher() = default; Crc32Hasher::~Crc32Hasher() = default; -std::vector<std::string> Crc32Hasher::MakeFileListFromCompressedList( - std::string_view data) { - std::string gzipdata; - // Expected compressed input is using Base64 encoding, we got convert it - // to a regular string before passing it to zlib. - base::Base64Decode(data, &gzipdata); - - size_t compressed_size = gzipdata.size(); - unsigned long decompressed_size = zlib_internal::GetGzipUncompressedSize( - reinterpret_cast<const Bytef*>(gzipdata.c_str()), compressed_size); - std::string decompressed(decompressed_size, '\0'); - - // We can skip an extraneous copy by relying on a C++11 std::string guarantee - // of contiguous memory access to a string. - zlib_internal::UncompressHelper( - zlib_internal::WrapperType::GZIP, - reinterpret_cast<unsigned char*>(&decompressed[0]), &decompressed_size, - reinterpret_cast<const unsigned char*>(gzipdata.c_str()), - compressed_size); - - return SplitString(decompressed, kFilePathDelimiter, base::KEEP_WHITESPACE, +std::vector<std::string> Crc32Hasher::ParseFileList( + const std::string& combined_paths) { + return SplitString(combined_paths, kFilePathDelimiter, base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); }
diff --git a/tools/android/devil_util/crc32_hasher.h b/tools/android/devil_util/crc32_hasher.h index 426f54e..0312183 100644 --- a/tools/android/devil_util/crc32_hasher.h +++ b/tools/android/devil_util/crc32_hasher.h
@@ -17,10 +17,9 @@ Crc32Hasher(); ~Crc32Hasher(); - // Given a buffer containing a list of kFilePathDelimiter-separated file paths - // which are gzipped and base64-encoded, return the file paths as a vector. - std::vector<std::string> MakeFileListFromCompressedList( - std::string_view data); + // Given a list of kFilePathDelimiter-separated file paths, return the file + // paths as a vector. + std::vector<std::string> ParseFileList(const std::string& combined_paths); // If there is no file at the given path, return std::nullopt. // Otherwise, return the checksum obtained by hashing the file at that path. std::optional<uint32_t> HashFile(const std::string& path);
diff --git a/tools/android/devil_util/main.cc b/tools/android/devil_util/main.cc index 5a70fb2..e67bd38 100644 --- a/tools/android/devil_util/main.cc +++ b/tools/android/devil_util/main.cc
@@ -11,9 +11,11 @@ #include <cstddef> #include <iostream> #include <random> +#include <sstream> #include "archive_reader.h" #include "archive_writer.h" +#include "base/strings/string_split.h" #include "crc32_hasher.h" #include "zst_compressor.h" #include "zst_decompressor.h" @@ -24,10 +26,18 @@ } void PrintUsageInfoHash(std::string program_name) { - std::cerr << "Usage: " << program_name << " hash base64-gzipped-'" - << kFilePathDelimiter << "'-separated-files" << std::endl; + std::cerr << "Usage: " << program_name << " hash '" << kFilePathDelimiter + << "'-separated-file-paths" << std::endl; + std::cerr << "E.g.: " << program_name << " hash path1" << kFilePathDelimiter + << "path2" << std::endl; +} + +void PrintUsageInfoCompress(std::string program_name) { + std::cerr << "Usage: " << program_name + << " compress destination-file-path uncompressed-content" + << std::endl; std::cerr << "E.g.: " << program_name - << " hash $(echo -n path1:path2 | gzip | base64)" << std::endl; + << " compress /path/to/compressed/content abcdefg" << std::endl; } void PrintUsageInfoArchive(std::string program_name) { @@ -58,15 +68,14 @@ // which are gzipped and base64-encoded, and it outputs a crc32 hash for each // file in the list, in the same order as the input list. If a file does not // exist, outputs a blank line for it. -int DoHash(int argc, const char* argv[]) { - if (argc != 3) { - PrintUsageInfoHash(std::string(argv[0])); +int DoHash(const std::vector<std::string>& argv) { + if (argv.size() != 3) { + PrintUsageInfoHash(argv[0]); return 1; } Crc32Hasher hasher; - std::vector<std::string> files = - hasher.MakeFileListFromCompressedList(std::string_view(argv[2])); + std::vector<std::string> files = hasher.ParseFileList(argv[2]); for (const auto& file : files) { std::optional<uint32_t> hash = hasher.HashFile(file); @@ -79,14 +88,41 @@ return 0; } +// The compress command is given a string that needs to be compressed. +// It compresses the string via zst and saves the result to the specified file. +int DoCompress(const std::vector<std::string>& argv) { + if (argv.size() != 4) { + PrintUsageInfoCompress(argv[0]); + return 1; + } + + std::string destination_file_path = argv[2]; + std::ofstream output_file_stream; + output_file_stream.open(destination_file_path, + std::ios::binary | std::ios::trunc); + if (output_file_stream.fail()) { + std::cerr << "Failed to open the destination file at " + << destination_file_path << std::endl; + return 1; + } + + ZstCompressor compressor(output_file_stream, 3); + std::string uncompressed_string = argv[3]; + ZstCompressor::UncompressedContent uncompressed_content; + uncompressed_content.buffer = uncompressed_string.data(); + uncompressed_content.size = uncompressed_string.size(); + compressor.CompressStreaming(uncompressed_content, true); + return 0; +} + // The archive command creates a zst-compressed archive file. It is given a text // file that contains the paths to the files that should be included in archive. // It then creates an archive from these files and compresses the archive via // zstd. The archive is in a custom file format and can be extracted using the // extract command below. -int DoArchive(int argc, const char* argv[]) { - if (argc != 4) { - PrintUsageInfoArchive(std::string(argv[0])); +int DoArchive(const std::vector<std::string>& argv) { + if (argv.size() != 4) { + PrintUsageInfoArchive(argv[0]); return 1; } @@ -153,9 +189,9 @@ // It does so in a streaming way (i.e. it reads a portion of the input file and // extracts it, and then read the next portion of input file and extracts it). // The input file can be created by the archive command above. -int DoExtract(int argc, const char* argv[]) { - if (argc != 3) { - PrintUsageInfoExtract(std::string(argv[0])); +int DoExtract(const std::vector<std::string>& argv) { + if (argv.size() != 3) { + PrintUsageInfoExtract(argv[0]); return 1; } @@ -199,14 +235,14 @@ // The pipe command is given a path, and it creates a named pipe at that path // via a mkfifo() system call. -int DoPipe(int argc, const char* argv[]) { - if (argc != 3) { - PrintUsageInfoPipe(std::string(argv[0])); +int DoPipe(const std::vector<std::string>& argv) { + if (argv.size() != 3) { + PrintUsageInfoPipe(argv[0]); return 1; } - const char* named_pipe_path = argv[2]; - int result = mkfifo(named_pipe_path, 0777); + std::string named_pipe_path = argv[2]; + int result = mkfifo(named_pipe_path.c_str(), 0777); if (result != 0) { std::cerr << "Failed to call mkfifo(): " << strerror(errno) << std::endl; return 1; @@ -214,23 +250,88 @@ return 0; } +// Given the path to a response file, process the response file and return the +// command line arguments that it contains as a vector of strings. +std::vector<std::string> HandleResponseFile( + const std::string& response_file_path) { + std::string response_file_content; + if (response_file_path.length() >= 4 && + response_file_path.substr(response_file_path.length() - 4) == ".zst") { + // If the path to the response file ends in .zst, then decompress the + // content of the response file via zst. + std::ifstream input_file_stream; + input_file_stream.open(response_file_path, std::ios::binary); + if (input_file_stream.fail()) { + std::cerr << "Failed to open the input response file at " + << response_file_path << std::endl; + exit(1); + } + ZstDecompressor decompressor(input_file_stream); + ZstDecompressor::DecompressedContent decompressed_content; + std::stringstream decompressed_string_stream; + while (true) { + if (decompressor.DecompressStreaming(&decompressed_content)) { + break; + } + decompressed_string_stream.write(decompressed_content.buffer, + decompressed_content.size); + } + response_file_content = decompressed_string_stream.str(); + } else { + // If the path to the response file does not end in .zst, then read the + // entire content of the response file. + std::ifstream input_file_stream; + input_file_stream.open(response_file_path); + if (input_file_stream.fail()) { + std::cerr << "Failed to open the input response file at " + << response_file_path << std::endl; + exit(1); + } + std::stringstream string_stream; + string_stream << input_file_stream.rdbuf(); + response_file_content = string_stream.str(); + } + // Each line in the response file is treated as a separate command line + // argument. + return SplitString(response_file_content, "\n", base::KEEP_WHITESPACE, + base::SPLIT_WANT_NONEMPTY); +} + int main(int argc, const char* argv[]) { - if (argc < 2) { - PrintUsageInfo(std::string(argv[0])); + // Pre-process the command line arguments and expand all the response files + // (a response file is identified by the @ symbol). + std::vector<std::string> processed_argv; + for (int i = 0; i < argc; ++i) { + std::string arg = argv[i]; + if (arg.length() >= 1 && arg[0] == '@') { + std::string response_file_path = arg.substr(1); + std::vector<std::string> response_file_args = + HandleResponseFile(response_file_path); + processed_argv.insert(processed_argv.end(), response_file_args.begin(), + response_file_args.end()); + } else { + processed_argv.push_back(arg); + } + } + + if (processed_argv.size() < 2) { + PrintUsageInfo(processed_argv[0]); return 1; } - std::string command = argv[1]; + std::string command = processed_argv[1]; if (command == "hash") { - return DoHash(argc, argv); + return DoHash(processed_argv); + } else if (command == "compress") { + return DoCompress(processed_argv); } else if (command == "archive") { - return DoArchive(argc, argv); + return DoArchive(processed_argv); } else if (command == "extract") { - return DoExtract(argc, argv); + return DoExtract(processed_argv); } else if (command == "pipe") { - return DoPipe(argc, argv); + return DoPipe(processed_argv); } else { - PrintUsageInfo(std::string(argv[0])); + PrintUsageInfo(processed_argv[0]); return 1; } }
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index b1a37f7..8f419c4 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -36,7 +36,7 @@ # https://chromium.googlesource.com/chromium/src/+/main/docs/updating_clang.md # Reverting problematic clang rolls is safe, though. # This is the output of `git describe` and is usable as a commit-ish. -CLANG_REVISION = 'llvmorg-21-init-6681-g5b36835d' +CLANG_REVISION = 'llvmorg-21-init-9266-g09006611' CLANG_SUB_REVISION = 1 PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)
diff --git a/tools/cygprofile/generate_orderfile.pydeps b/tools/cygprofile/generate_orderfile.pydeps index 4d0010be..32e3921 100644 --- a/tools/cygprofile/generate_orderfile.pydeps +++ b/tools/cygprofile/generate_orderfile.pydeps
@@ -66,7 +66,6 @@ //third_party/catapult/devil/devil/utils/run_tests_helper.py //third_party/catapult/devil/devil/utils/timeout_retry.py //third_party/catapult/devil/devil/utils/watchdog_timer.py -//third_party/catapult/devil/devil/utils/zip_utils.py //tools/cygprofile/android_profile_tool.py //tools/cygprofile/cluster.py //tools/cygprofile/generate_orderfile.py
diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py index c28ffa4..f55b703 100644 --- a/tools/grit/grit/tool/build.py +++ b/tools/grit/grit/tool/build.py
@@ -178,7 +178,8 @@ ('depdir=', 'depfile=', 'assert-file-list=', 'help', 'output-all-resource-defines', 'no-output-all-resource-defines', 'no-replace-ellipsis', 'depend-on-stamp', 'css-minifier=', - 'write-only-new=', 'allowlist-support', 'brotli=')) + 'write-only-new=', 'allowlist-support', 'brotli=', + 'translate-genders')) for (key, val) in own_opts: if key == '-a': assert_output_files.append(val)
diff --git a/tools/grit/grit/tool/build_unittest.py b/tools/grit/grit/tool/build_unittest.py index 4ad7c9f..8610bbe6 100755 --- a/tools/grit/grit/tool/build_unittest.py +++ b/tools/grit/grit/tool/build_unittest.py
@@ -44,7 +44,13 @@ builder.Run(DummyOpts(), ['-o', output_dir.GetPath()]) output_dir.CleanUp() - def testGenerateDepFile(self): + def testGenerateDepFileWithoutGenderSupport(self): + self._testGenerateDepFileInternal(False) + + def testGenerateDepFileWithGenderSupport(self): + self._testGenerateDepFileInternal(True) + + def _testGenerateDepFileInternal(self, translate_genders): output_dir = util.TempDir({}) builder = build.RcBuilder() class DummyOpts: @@ -53,9 +59,16 @@ self.verbose = False self.extra_verbose = False expected_dep_file = output_dir.GetPath('substitute.grd.d') - builder.Run(DummyOpts(), ['-o', output_dir.GetPath(), - '--depdir', output_dir.GetPath(), - '--depfile', expected_dep_file]) + + args = [ + '-o', + output_dir.GetPath(), '--depdir', + output_dir.GetPath(), '--depfile', expected_dep_file + ] + if translate_genders: + args.append('--translate-genders') + + builder.Run(DummyOpts(), args) self.assertTrue(os.path.isfile(expected_dep_file)) with open(expected_dep_file) as f: @@ -63,7 +76,9 @@ (dep_output_file, deps_string) = line.split(': ') deps = deps_string.split(' ') - self.assertEqual("default_100_percent.pak", dep_output_file) + self.assertEqual( + "default_100_percent_OTHER.pak" + if translate_genders else "default_100_percent.pak", dep_output_file) self.assertEqual(deps, [ util.PathFromRoot('grit/testdata/default_100_percent/a.png'), util.PathFromRoot('grit/testdata/grit_part.grdp'), @@ -212,7 +227,13 @@ encoding='utf16') output_dir.CleanUp() - def testAllowlistResources(self): + def testAllowlistResourcesWithoutGenderSupport(self): + self._testAllowlistResourcesInternal(False) + + def testAllowlistResourcesWithGenderSupport(self): + self._testAllowlistResourcesInternal(True) + + def _testAllowlistResourcesInternal(self, translate_genders): output_dir = util.TempDir({}) builder = build.RcBuilder() class DummyOpts: @@ -222,11 +243,18 @@ self.extra_verbose = False allowlist_file = util.PathFromRoot('grit/testdata/allowlist.txt') - builder.Run(DummyOpts(), ['-o', output_dir.GetPath(), '-w', allowlist_file]) + + args = ['-o', output_dir.GetPath(), '-w', allowlist_file] + if translate_genders: + args.append('--translate-genders') + builder.Run(DummyOpts(), args) + header = output_dir.GetPath('allowlist_test_resources.h') map_cc = output_dir.GetPath('allowlist_test_resources_map.cc') map_h = output_dir.GetPath('allowlist_test_resources_map.h') - pak = output_dir.GetPath('allowlist_test_resources.pak') + pak = output_dir.GetPath( + 'allowlist_test_resources_OTHER.pak' + if translate_genders else 'allowlist_test_resources.pak') # Ensure the resource map header and .pak files exist, but don't verify # their content.
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index 86b6353..ccad6f8 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -49584,6 +49584,9 @@ <suffix name="EditBookmark" label="Recorded when the 'Edit bookmark' option in the context menu is selected."/> + <suffix name="MoveToGroup" + label="Recorded when the 'Move to group' option in the context menu is + selected."/> <suffix name="SelectTabs" label="Recorded when the 'Select tabs' option in the context menu is selected."/>
diff --git a/tools/metrics/dwa/dwa.xml b/tools/metrics/dwa/dwa.xml index d7080840..bc02bc7 100644 --- a/tools/metrics/dwa/dwa.xml +++ b/tools/metrics/dwa/dwa.xml
@@ -100,6 +100,26 @@ </metric> </event> +<event name="AttributionConversionsSendReport"> + <owner>linnan@google.com</owner> + <owner>zhouzj@google.com</owner> + <owner>measurement-api-dev+metrics@google.com</owner> + <metric name="AggregatableReportDelayFromTrigger"> + <summary> + Records the time in ms between a trigger and the aggregatable reporting. + This is emitted only when an aggregatable report is successfully sent. + </summary> + </metric> + <metric name="EventLevelExtraReportDelay"> + <summary> + Records the "extra" non-scheduled time in ms it took for + event-level reporting. This is primarily due to a report's scheduled + report time taking place while the browser is closed. Recorded when an + event-level report is successfully sent. + </summary> + </metric> +</event> + <event name="AttributionConversionsStoreSource"> <owner>linnan@google.com</owner> <owner>zhouzj@google.com</owner>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 7d720e0..55b2b80f 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -8840,6 +8840,7 @@ <int value="-2097013050" label="WaylandTextInputV3:disabled"/> <int value="-2096845406" label="QuickAnswersRichCard:enabled"/> <int value="-2095519429" label="FtpProtocol:enabled"/> + <int value="-2095167043" label="WebFeedKillSwitch:disabled"/> <int value="-2095123598" label="FastEnumeratePrinters:disabled"/> <int value="-2094897448" label="TranslateIntent:disabled"/> <int value="-2093968325" label="FedCmAutoSelectedFlag:disabled"/> @@ -11542,6 +11543,7 @@ <int value="-1075089382" label="enable-physical-web"/> <int value="-1074257709" label="ScalableAppList:enabled"/> <int value="-1074254048" label="ShimlessRMAHardwareValidationSkip:disabled"/> + <int value="-1074138544" label="WebFeedKillSwitch:enabled"/> <int value="-1074107607" label="data-reduction-proxy-experiment"/> <int value="-1073479583" label="ShowArcFilesApp:disabled"/> <int value="-1073388569" label="TerminalDev:enabled"/>
diff --git a/tools/metrics/histograms/extract_histograms.py b/tools/metrics/histograms/extract_histograms.py index 2a6b1dc..c40bd61 100644 --- a/tools/metrics/histograms/extract_histograms.py +++ b/tools/metrics/histograms/extract_histograms.py
@@ -84,6 +84,15 @@ pass +class ExtractionErrors(list[str]): + """A list of error strings, with new entries also logged.""" + + def AppendAndLog(self, error: str) -> None: + """Appends an error to the list after logging it.""" + logging.error(error) + self.append(error) + + def _ExpandHistogramNameWithSuffixes(suffix_name, histogram_name, histogram_suffixes_node): """Creates a new histogram name based on a histogram suffix. @@ -95,11 +104,12 @@ histogram_suffixes_node: The histogram_suffixes XML node. Returns: - A string with the expanded histogram name. - - Raises: - Error: if the expansion can't be done. + A tuple with: + * A string with the expanded histogram name. + * Any errors accumulated during this process. """ + errors = ExtractionErrors() + if histogram_suffixes_node.hasAttribute('separator'): separator = histogram_suffixes_node.getAttribute('separator') else: @@ -116,43 +126,63 @@ else: placement = 1 if ordering not in ['prefix', 'suffix']: - logging.error('ordering needs to be prefix or suffix, value is %s', - ordering) - raise Error() + errors.AppendAndLog( + f'ordering needs to be prefix or suffix, value is {ordering}') + return None, errors if not suffix_name: - return histogram_name + return histogram_name, errors if ordering == 'suffix': - return histogram_name + separator + suffix_name + return histogram_name + separator + suffix_name, errors # For prefixes, the suffix_name is inserted between the "cluster" and the # "remainder", e.g. Foo.BarHist expanded with gamma becomes Foo.gamma_BarHist. sections = histogram_name.split('.') if len(sections) <= placement: - logging.error( - 'Prefix histogram_suffixes expansions require histogram names which ' - 'include a dot separator. Histogram name is %s, histogram_suffixes is ' - '%s, and placment is %d', histogram_name, - histogram_suffixes_node.getAttribute('name'), placement) - raise Error() + suffixes_name = histogram_suffixes_node.getAttribute('name') + errors.AppendAndLog( + f'Prefix histogram_suffixes expansions require histogram names which ' + f'include a dot separator. Histogram name is {histogram_name}, ' + f'histogram_suffixes is {suffixes_name}, and placment is {placement}') + return None, errors cluster = '.'.join(sections[0:placement]) + '.' remainder = '.'.join(sections[placement:]) - return cluster + suffix_name + separator + remainder + return cluster + suffix_name + separator + remainder, errors def ExtractEnumsFromXmlTree(tree): - """Extracts all <enum> nodes in the tree into a dictionary.""" + """Extracts all <enum> nodes in the tree into a dictionary. + Args: + tree: The XML dom tree. + + Returns: + A tuple with: + * A mapping of name -> enum metadata proto. + * Any errors accumulated during extraction. + + An enum metadata dictionary looks like this: + { + 'name': string + 'values': { + (int cast to string) : { + 'summary': string, + 'label': string + } + ... + } + ... + }, + """ enums = {} - have_errors = False + errors = ExtractionErrors() for enum in xml_utils.IterElementsWithTag(tree, 'enum'): name = enum.getAttribute('name') if name in enums: - logging.error('Duplicate enum %s', name) - have_errors = True + errors.AppendAndLog(f'Duplicate enum {name}') continue enum_dict = {} @@ -164,21 +194,19 @@ obsolete_nodes = list(xml_utils.IterElementsWithTag(enum, 'obsolete', 1)) if not nodes and not obsolete_nodes: - logging.error('Non-obsolete enum %s should have at least one <int>', name) - have_errors = True + errors.AppendAndLog( + f'Non-obsolete enum {name} should have at least one <int>') continue for int_tag in nodes: value_dict = {} int_value = int(int_tag.getAttribute('value')) if int_value in enum_dict['values']: - logging.error('Duplicate enum value %d for enum %s', int_value, name) - have_errors = True + errors.AppendAndLog(f'Duplicate enum value {int_value} for enum {name}') continue label = int_tag.getAttribute('label') if label in labels: - logging.error('Duplicate enum label "%s" for enum %s', label, name) - have_errors = True + errors.AppendAndLog(f'Duplicate enum label "{label}" for enum {name}') continue labels.add(label) value_dict['label'] = label @@ -191,9 +219,8 @@ for int_tag in nodes: int_value = int(int_tag.getAttribute('value')) if last_int_value is not None and int_value < last_int_value: - logging.error('Enum %s int values %d and %d are not in numerical order', - name, last_int_value, int_value) - have_errors = True + errors.AppendAndLog(f'Enum {name} int values {last_int_value} and ' + f'{int_value} are not in numerical order') left_item_index = bisect.bisect_left(enum_int_values, int_value) if left_item_index == 0: logging.warning('Insert value %d at the beginning', int_value) @@ -211,7 +238,7 @@ enums[name] = enum_dict - return enums, have_errors + return enums, errors def _ExtractOwners(node): @@ -250,27 +277,27 @@ A tuple, where the first element is the improvement direction, if any; the second element is an error message if the given direction is invalid. """ - direction = None - error = None + errors = ExtractionErrors() improvement_nodes = histogram_node.getElementsByTagName('improvement') if not improvement_nodes: - return None, None + return None, errors if len(improvement_nodes) > 1: histogram_name = histogram_node.getAttribute('name') - error = f'Histogram "{histogram_name}" has multiple <improvement> tags.' - return None, error + errors.AppendAndLog( + f'Histogram "{histogram_name}" has multiple <improvement> tags.') + return None, errors improvement_node = improvement_nodes[0] direction = improvement_node.getAttribute('direction') if (direction not in histogram_configuration_model.IMPROVEMENT_DIRECTION_VALID_VALUES): histogram_name = histogram_node.getAttribute('name') - error = ( - f'Histogram "{histogram_name}" has an invalid direction "{direction}" ' - f'in its <improvement> tag.') - return None, error + errors.AppendAndLog( + f'Histogram "{histogram_name}" has an invalid direction ' + f'"{direction}" in its <improvement> tag.') + return None, errors - return direction, None + return direction, errors def _ExtractComponents(histogram): @@ -357,26 +384,24 @@ """ tokens_seen = set() tokens = [] - have_error = False + errors = ExtractionErrors() histogram_name = histogram.getAttribute('name') for token_node in xml_utils.IterElementsWithTag(histogram, 'token', 1): token_key = token_node.getAttribute('key') if token_key in tokens_seen: - logging.error( - "Histogram %s contains duplicate token key %s, please ensure token " - "keys are unique." % (histogram_name, token_key)) - have_error = True + errors.AppendAndLog( + f'Histogram {histogram_name} contains duplicate token key ' + f'{token_key}, please ensure token keys are unique.') continue tokens_seen.add(token_key) token_key_format = '{' + token_key + '}' if token_key_format not in histogram_name: - logging.error( - "Histogram %s includes a token tag but the token key is not present " - "in histogram name. Please insert the token key into the histogram " - "name in order for the token to be added." % histogram_name) - have_error = True + errors.AppendAndLog( + f'Histogram {histogram_name} includes a token tag but the token key ' + f'is not present in histogram name. Please insert the token key into ' + f'the histogram name in order for the token to be added.') continue token = dict(key=token_key) @@ -391,12 +416,11 @@ if variant_list: token['variants'] = variant_list[:] else: - logging.error( - "The variants attribute %s of token key %s of histogram %s does " - "not have a corresponding <variants> tag." % - (variants_name, token_key, histogram_name)) + errors.AppendAndLog( + f'The variants attribute {variants_name} of token key {token_key} ' + f'of histogram {histogram_name} does not have a corresponding ' + f'<variants> tag.') token['variants'] = [] - have_error = True # Inline and out-of-line variants can be combined. token['variants'].extend(_ExtractVariantNodes(token_node)) @@ -415,14 +439,14 @@ tokens_seen.add(token_key) variant_list = variants_dict.get(token_key) if not variant_list: - logging.error("Could not find variant '%s' specified by histogram '%s'." % - (token_key, histogram_name)) + errors.AppendAndLog( + f'Could not find variant "{token_key}" specified by histogram' + f' "{histogram_name}".') variant_list = [] - have_error = True token = dict(key=token_key, variants=variant_list) tokens.append(token) - return tokens, have_error + return tokens, errors def _ExtractVariantNodes(node): @@ -459,15 +483,12 @@ # Process the histograms. The descriptions can include HTML tags. histograms = {} - have_errors = False - variants_dict, variants_errors = ExtractVariantsFromXmlTree(tree) - have_errors = have_errors or variants_errors + variants_dict, errors = ExtractVariantsFromXmlTree(tree) for histogram in xml_utils.IterElementsWithTag(tree, 'histogram'): name = histogram.getAttribute('name') if name in histograms: - logging.error('Duplicate histogram definition %s', name) - have_errors = True + errors.AppendAndLog(f'Duplicate histogram definition {name}') continue histograms[name] = histogram_entry = {} @@ -478,31 +499,24 @@ _ValidateDateString(expiry_str)): histogram_entry['expires_after'] = expiry_str else: - logging.error( - 'Expiry of histogram %s does not match expected date format ("%s"),' - ' milestone format (M*), or "never": found %s.', name, - EXPIRY_DATE_PATTERN, expiry_str) - have_errors = True + errors.AppendAndLog( + f'Expiry of histogram {name} does not match expected date format ' + f'("{EXPIRY_DATE_PATTERN}"), milestone format (M*), or "never": ' + 'found {expiry_str}') else: - logging.error( - 'Your histogram %s must have an expiry date. If you are marking a ' - 'histogram as obsolete, please set the expiry date to the current ' - 'date.', name) - have_errors = True + errors.AppendAndLog(f'Your histogram {name} must have an expiry date.') - # Find <owner> tag. + # Handle <owner> tags. owners, has_owner = _ExtractOwners(histogram) if owners: histogram_entry['owners'] = owners - # Find the <improvement> tag, if any. - improvement_direction, improvement_error = _ExtractImprovementDirection( + # Handle <improvement> tags. + improvement_direction, improvement_errors = _ExtractImprovementDirection( histogram) + errors.extend(improvement_errors) if improvement_direction: histogram_entry['improvement'] = improvement_direction - if improvement_error: - logging.error(improvement_error) - have_errors = True # Find <component> tag. components = _ExtractComponents(histogram) @@ -528,25 +542,22 @@ # Non-obsolete histograms should provide a non-empty <summary>. if not obsolete_nodes and (not summary_nodes or not histogram_entry['summary']): - logging.error('histogram %s should provide a <summary>', name) - have_errors = True + errors.AppendAndLog(f'histogram {name} should provide a <summary>') # Non-obsolete histograms should specify <owner>s. if not obsolete_nodes and not has_owner: - logging.error('histogram %s should specify <owner>s', name) - have_errors = True + errors.AppendAndLog(f'histogram {name} should specify <owner>s') # Histograms should have either units or enum. if (not histogram.hasAttribute('units') and not histogram.hasAttribute('enum')): - logging.error('histogram %s should have either units or enum', name) - have_errors = True + errors.AppendAndLog(f'histogram {name} should have either units or enum') # Histograms should not have both units and enum. if (histogram.hasAttribute('units') and histogram.hasAttribute('enum')): - logging.error('histogram %s should not have both units and enum', name) - have_errors = True + errors.AppendAndLog( + f'histogram {name} should not have both units and enum') # Handle units. if histogram.hasAttribute('units'): @@ -556,20 +567,19 @@ if histogram.hasAttribute('enum'): enum_name = histogram.getAttribute('enum') if enum_name not in enums: - logging.error('Unknown enum %s in histogram %s', enum_name, name) - have_errors = True + errors.AppendAndLog(f'Unknown enum {enum_name} in histogram {name}') else: histogram_entry['enum'] = enums[enum_name] # Find <token> tag. - tokens, have_token_errors = ExtractTokens(histogram, variants_dict) - have_errors = have_errors or have_token_errors + tokens, token_errors = ExtractTokens(histogram, variants_dict) if tokens: histogram_entry['tokens'] = tokens + errors.extend(token_errors) _ProcessBaseHistogramAttribute(histogram, histogram_entry) - return histograms, have_errors + return histograms, errors def ExtractVariantsFromXmlTree(tree): @@ -585,17 +595,16 @@ extracting them. """ variants_dict = {} - have_errors = False + errors = ExtractionErrors() for variants_node in xml_utils.IterElementsWithTag(tree, 'variants'): variants_name = variants_node.getAttribute('name') if variants_name in variants_dict: - logging.error('Duplicate variants definition %s', variants_name) - have_errors = True + errors.AppendAndLog(f'Duplicate variants definition {variants_name}') continue variants_dict[variants_name] = _ExtractVariantNodes(variants_node) - return variants_dict, have_errors + return variants_dict, errors def _GetObsoleteReason(node): @@ -613,7 +622,7 @@ return None -def _UpdateHistogramsWithSuffixes(tree, histograms): +def _UpdateHistogramsWithSuffixes(tree, histograms) -> ExtractionErrors: """Processes <histogram_suffixes> tags and combines with affected histograms. The histograms dictionary will be updated in-place by adding new histograms @@ -625,9 +634,9 @@ histograms: a dictionary of histograms previously extracted from the tree; Returns: - True if any errors were found. + A list of error messages if any errors were found. """ - have_errors = False + errors = ExtractionErrors() histogram_suffix_tag = 'histogram_suffixes' suffix_tag = 'suffix' @@ -663,10 +672,10 @@ reprocess_queue.append((reprocess_count + 1, histogram_suffixes)) continue else: - logging.error('histogram_suffixes %s is missing its dependency %s', - histogram_suffixes.getAttribute('name'), - missing_dependency) - have_errors = True + suffixes_name = histogram_suffixes.getAttribute('name') + errors.AppendAndLog( + f'histogram_suffixes {suffixes_name} is missing its ' + f'dependency {missing_dependency}') continue # If the suffix group has an obsolete tag, all suffixes it generates inherit @@ -680,9 +689,8 @@ for suffix in suffix_nodes: suffix_name = suffix.getAttribute('name') if not suffix.hasAttribute('label'): - logging.error('suffix %s in histogram_suffixes %s should have a label', - suffix_name, name) - have_errors = True + errors.AppendAndLog(f'suffix {suffix_name} in histogram_suffixes ' + f'{name} should have a label') suffix_labels[suffix_name] = suffix.getAttribute('label') # Find owners list under current histogram_suffixes tag. owners, _ = _ExtractOwners(histogram_suffixes) @@ -698,48 +706,47 @@ histogram_name = affected_histogram.getAttribute('name') for suffix in suffixes_to_add: suffix_name = suffix.getAttribute('name') - try: - new_histogram_name = _ExpandHistogramNameWithSuffixes( - suffix_name, histogram_name, histogram_suffixes) - if new_histogram_name != histogram_name: - new_histogram = copy.deepcopy(histograms[histogram_name]) - # Do not copy forward base histogram state to suffixed - # histograms. Any suffixed histograms that wish to remain base - # histograms must explicitly re-declare themselves as base - # histograms. - if new_histogram.get('base', False): - del new_histogram['base'] - histograms[new_histogram_name] = new_histogram + new_histogram_name, expansion_errors = _ExpandHistogramNameWithSuffixes( + suffix_name, histogram_name, histogram_suffixes) + errors.extend(expansion_errors) + if new_histogram_name is None: + continue + if new_histogram_name != histogram_name: + new_histogram = copy.deepcopy(histograms[histogram_name]) + # Do not copy forward base histogram state to suffixed + # histograms. Any suffixed histograms that wish to remain base + # histograms must explicitly re-declare themselves as base + # histograms. + if new_histogram.get('base', False): + del new_histogram['base'] + histograms[new_histogram_name] = new_histogram - suffix_label = suffix_labels.get(suffix_name, '') + suffix_label = suffix_labels.get(suffix_name, '') - histogram_entry = histograms[new_histogram_name] + histogram_entry = histograms[new_histogram_name] - # If no owners are added for this histogram-suffixes, it inherits the - # owners of its parents. - if owners: - histogram_entry['owners'] = owners + # If no owners are added for this histogram-suffixes, it inherits the + # owners of its parents. + if owners: + histogram_entry['owners'] = owners - # If a suffix has an obsolete node, it's marked as obsolete for the - # specified reason, overwriting its group's obsoletion reason if the - # group itself was obsolete as well. - obsolete_reason = _GetObsoleteReason(suffix) - if not obsolete_reason: - obsolete_reason = _GetObsoleteReason(affected_histogram) - if not obsolete_reason: - obsolete_reason = group_obsolete_reason + # If a suffix has an obsolete node, it's marked as obsolete for the + # specified reason, overwriting its group's obsoletion reason if the + # group itself was obsolete as well. + obsolete_reason = _GetObsoleteReason(suffix) + if not obsolete_reason: + obsolete_reason = _GetObsoleteReason(affected_histogram) + if not obsolete_reason: + obsolete_reason = group_obsolete_reason - # If the suffix has an obsolete tag, all histograms it generates - # inherit it. - if obsolete_reason: - histogram_entry['obsolete'] = obsolete_reason + # If the suffix has an obsolete tag, all histograms it generates + # inherit it. + if obsolete_reason: + histogram_entry['obsolete'] = obsolete_reason - _ProcessBaseHistogramAttribute(suffix, histogram_entry) + _ProcessBaseHistogramAttribute(suffix, histogram_entry) - except Error: - have_errors = True - - return have_errors + return errors class TokenAssignment(object): @@ -772,7 +779,7 @@ def _AddHistogramOrExpandedVariants(histogram_name, histograms_dict, - new_histograms_dict) -> bool: + new_histograms_dict) -> ExtractionErrors: """Adds histogram or all variant expanded histograms to |new_histograms_dict|. If the histogram does not reference any variants, it's added directly to the @@ -785,15 +792,15 @@ new_histograms_dict: The dictionary of histograms to add to. Returns: - True if any error was encountered. + List of errors, if any. """ - have_error = False + errors = ExtractionErrors() histogram_node = histograms_dict[histogram_name] if 'tokens' not in histogram_node: # If the histogram references no variants, simply copy it over. new_histograms_dict[histogram_name] = histogram_node - return False + return errors # |token_assignments| contains all the cross-product combinations of token # variants, representing all the possible histogram names that could be @@ -824,11 +831,10 @@ # Replace token in histogram name with variant name. new_histogram_name = histogram_name.format(**token_name_pairings) if new_histogram_name in new_histograms_dict: - logging.error( - "Duplicate histogram name %s generated. Please remove identical " - "variants in different tokens in %s." % - (new_histogram_name, histogram_name)) - have_error = True + errors.AppendAndLog( + f'Duplicate histogram name {new_histogram_name} generated.' + f'Please remove identical variants in different tokens in ' + f'{histogram_name}.') continue # Replace token in summary with variant summary. @@ -837,11 +843,10 @@ except: if histogram_name not in summary_errors: summary_errors.add(histogram_name) - logging.error( + errors.AppendAndLog( "Could not format summary text when expanding histogram %s. Please " "check that it's not using {Token} syntax for unknown tokens." % (histogram_name)) - have_error = True continue new_histogram_node = dict(histogram_node, summary=new_summary_text) @@ -853,7 +858,7 @@ new_histograms_dict[new_histogram_name] = new_histogram_node - return have_error + return errors def _UpdateHistogramsWithTokens(histograms_dict): @@ -864,19 +869,20 @@ Returns: A tuple where the first element is the replacement histograms dictionary, - containing the original histograms without tokens and histograms - whose tokens are replaced by newly variant combinations. - The second element is a boolean is there is error. + containing the original histograms without tokens and histograms whose + tokens are replaced by newly variant combinations. The second element is a + list of errors detected while extracting them. """ - have_error = False + errors = ExtractionErrors() # Create new dict instead of modify in place because newly generated # histograms will be added when iterating through |histograms_dict|. new_histograms_dict = {} for histogram_name, histogram_node in histograms_dict.items(): - have_error = have_error or _AddHistogramOrExpandedVariants( - histogram_name, histograms_dict, new_histograms_dict) + errors.extend( + _AddHistogramOrExpandedVariants(histogram_name, histograms_dict, + new_histograms_dict)) - return new_histograms_dict, have_error + return new_histograms_dict, errors def ExtractHistogramsFromDom(tree): @@ -886,9 +892,9 @@ tree: A DOM tree of XML content. Returns: - a tuple of (histograms, status) where histograms is a dictionary mapping - histogram names to dictionaries containing histogram descriptions and status - is a boolean indicating if errros were encountered in processing. + a tuple of (histograms, errors) where histograms is a dictionary mapping + histogram names to dictionaries containing histogram descriptions and + errors is a list of errors encountered in processing, if any. """ xml_utils.NormalizeAllAttributeValues(tree) @@ -902,12 +908,19 @@ histograms_tree, enums) histograms, update_token_errors = _UpdateHistogramsWithTokens(histograms) # Only expand expand suffixes if there were no token errors. - update_suffix_errors = (update_token_errors or _UpdateHistogramsWithSuffixes( - histogram_suffixes_tree, histograms)) + if not update_token_errors: + update_suffix_errors = _UpdateHistogramsWithSuffixes( + histogram_suffixes_tree, histograms) + else: + update_suffix_errors = ExtractionErrors() + errors = ExtractionErrors([ + *enum_errors, + *histogram_errors, + *update_token_errors, + *update_suffix_errors, + ]) - return histograms, (enum_errors or histogram_errors or update_suffix_errors - or update_token_errors) - + return histograms, errors def ExtractHistograms(filename): """Loads histogram definitions from a disk file. @@ -923,8 +936,8 @@ """ with open(filename, 'r') as f: tree = xml.dom.minidom.parse(f) - histograms, had_errors = ExtractHistogramsFromDom(tree) - if had_errors: + histograms, errors = ExtractHistogramsFromDom(tree) + if errors: logging.error('Error parsing %s', filename) raise Error() return histograms
diff --git a/tools/metrics/histograms/extract_histograms_test.py b/tools/metrics/histograms/extract_histograms_test.py index fbfb6ec2..9d4e815c 100644 --- a/tools/metrics/histograms/extract_histograms_test.py +++ b/tools/metrics/histograms/extract_histograms_test.py
@@ -194,44 +194,44 @@ """ chrome_histogram_correct_expiry_date = chrome_histogram_pattern.format( 'expires_after="2211-11-22"') - _, had_errors = extract_histograms.ExtractHistogramsFromDom( + _, errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(chrome_histogram_correct_expiry_date)) - self.assertFalse(had_errors) + self.assertFalse(errors) chrome_histogram_wrong_expiry_date_format = chrome_histogram_pattern.format( 'expires_after="2211/11/22"') - _, had_errors = extract_histograms.ExtractHistogramsFromDom( + _, errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(chrome_histogram_wrong_expiry_date_format)) - self.assertTrue(had_errors) + self.assertTrue(errors) chrome_histogram_wrong_expiry_date_value = chrome_histogram_pattern.format( 'expires_after="2211-22-11"') - _, had_errors = extract_histograms.ExtractHistogramsFromDom( + _, errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(chrome_histogram_wrong_expiry_date_value)) - self.assertTrue(had_errors) + self.assertTrue(errors) chrome_histogram_correct_expiry_milestone = chrome_histogram_pattern.format( 'expires_after="M22"') - _, had_errors = extract_histograms.ExtractHistogramsFromDom( + _, errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(chrome_histogram_correct_expiry_milestone)) - self.assertFalse(had_errors) + self.assertFalse(errors) chrome_histogram_wrong_expiry_milestone = chrome_histogram_pattern.format( 'expires_after="22"') - _, had_errors = extract_histograms.ExtractHistogramsFromDom( + _, errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(chrome_histogram_wrong_expiry_milestone)) - self.assertTrue(had_errors) + self.assertTrue(errors) chrome_histogram_wrong_expiry_milestone = chrome_histogram_pattern.format( 'expires_after="MM22"') _, had_errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(chrome_histogram_wrong_expiry_milestone)) - self.assertTrue(had_errors) + self.assertTrue(errors) chrome_histogram_no_expiry = chrome_histogram_pattern.format('') _, had_errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(chrome_histogram_no_expiry)) - self.assertTrue(had_errors) + self.assertTrue(errors) def testExpiryDateExtraction(self): chrome_histogram_pattern = """<histogram-configuration> @@ -347,9 +347,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_without_summary, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testNewHistogramWithEmptySummary(self): histogram_with_empty_summary = xml.dom.minidom.parseString(""" @@ -362,9 +362,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_with_empty_summary, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testNewHistogramWithoutEnumOrUnit(self): histogram_without_enum_or_unit = xml.dom.minidom.parseString(""" @@ -377,9 +377,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_without_enum_or_unit, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testNewHistogramWithEnumAndUnit(self): histogram_with_enum_and_unit = xml.dom.minidom.parseString(""" @@ -393,9 +393,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_with_enum_and_unit, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testEmptyEnum(self): empty_enum = xml.dom.minidom.parseString(""" @@ -407,8 +407,8 @@ </enums> </histogram-configuration> """) - _, have_errors = extract_histograms.ExtractEnumsFromXmlTree(empty_enum) - self.assertTrue(have_errors) + _, errors = extract_histograms.ExtractEnumsFromXmlTree(empty_enum) + self.assertTrue(errors) def testNewHistogramWithEnum(self): histogram_with_enum = xml.dom.minidom.parseString(""" @@ -430,9 +430,8 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms.ExtractHistogramsFromDom( - histogram_with_enum) - self.assertFalse(have_errors) + _, errors = extract_histograms.ExtractHistogramsFromDom(histogram_with_enum) + self.assertFalse(errors) def testEnumWithDuplicateValues(self): bad_enum = xml.dom.minidom.parseString(""" @@ -445,8 +444,8 @@ </enums> </histogram-configuration> """) - _, have_errors = extract_histograms.ExtractEnumsFromXmlTree(bad_enum) - self.assertTrue(have_errors) + _, errors = extract_histograms.ExtractEnumsFromXmlTree(bad_enum) + self.assertTrue(errors) def testEnumWithDuplicateLabels(self): bad_enum = xml.dom.minidom.parseString(""" @@ -459,8 +458,8 @@ </enums> </histogram-configuration> """) - _, have_errors = extract_histograms.ExtractEnumsFromXmlTree(bad_enum) - self.assertTrue(have_errors) + _, errors = extract_histograms.ExtractEnumsFromXmlTree(bad_enum) + self.assertTrue(errors) def testNewHistogramWithUnits(self): histogram_with_units = xml.dom.minidom.parseString(""" @@ -473,9 +472,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_with_units, {}) - self.assertFalse(have_errors) + self.assertFalse(errors) def testNewHistogramWithEmptyOwnerTag(self): histogram_with_empty_owner_tag = xml.dom.minidom.parseString(""" @@ -488,9 +487,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_with_empty_owner_tag, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testNewHistogramWithoutOwnerTag(self): histogram_without_owner_tag = xml.dom.minidom.parseString(""" @@ -502,9 +501,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_without_owner_tag, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testNewHistogramWithCommaSeparatedOwners(self): histogram_with_comma_separated_owners = xml.dom.minidom.parseString(""" @@ -517,9 +516,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_with_comma_separated_owners, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testNewHistogramWithInvalidOwner(self): histogram_with_invalid_owner = xml.dom.minidom.parseString(""" @@ -532,9 +531,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_with_invalid_owner, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testHistogramWithEscapeCharacters(self): histogram_with_owner_placeholder = xml.dom.minidom.parseString(""" @@ -547,9 +546,9 @@ </histograms> </histogram-configuration> """) - hists, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + hists, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_with_owner_placeholder, {}) - self.assertFalse(have_errors) + self.assertFalse(errors) self.assertIn('Test.Histogram', hists) self.assertIn('summary', hists['Test.Histogram']) self.assertEqual('This is a summary with & and " and \'', @@ -565,9 +564,9 @@ </histogram_suffixes_list> </histogram-configuration> """) - _, have_errors = extract_histograms.ExtractHistogramsFromDom( + _, errors = extract_histograms.ExtractHistogramsFromDom( suffix_without_label) - self.assertTrue(have_errors) + self.assertTrue(errors) def testNewSuffixWithLabel(self): suffix_with_label = xml.dom.minidom.parseString(""" @@ -579,9 +578,9 @@ </histogram_suffixes_list> </histogram-configuration> """) - have_errors = extract_histograms._UpdateHistogramsWithSuffixes( + errors = extract_histograms._UpdateHistogramsWithSuffixes( suffix_with_label, {}) - self.assertFalse(have_errors) + self.assertFalse(errors) @parameterized.expand([ ('InlineTokens', TEST_HISTOGRAM_WITH_TOKENS), @@ -657,9 +656,8 @@ histogram_with_duplicate_variant = xml.dom.minidom.parseString(input_xml) histograms_dict, _ = extract_histograms._ExtractHistogramsFromXmlTree( histogram_with_duplicate_variant, {}) - _, have_errors = extract_histograms._UpdateHistogramsWithTokens( - histograms_dict) - self.assertTrue(have_errors) + _, errors = extract_histograms._UpdateHistogramsWithTokens(histograms_dict) + self.assertTrue(errors) def testVariantsNotExists(self): histogram_without_corresponding_variants = xml.dom.minidom.parseString(""" @@ -681,9 +679,9 @@ </histograms> </histogram-configuration> """) - _, have_errors = extract_histograms._ExtractHistogramsFromXmlTree( + _, errors = extract_histograms._ExtractHistogramsFromXmlTree( histogram_without_corresponding_variants, {}) - self.assertTrue(have_errors) + self.assertTrue(errors) def testSuffixCanExtendPatternedHistograms(self): patterned_suffix = (""" @@ -711,9 +709,9 @@ </histogram-configuration>""") # Only when the histogram is first extended by the token, can the # histogram_suffixes find those affected histograms. - histograms_dict, had_errors = extract_histograms.ExtractHistogramsFromDom( + histograms_dict, errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(patterned_suffix)) - self.assertFalse(had_errors) + self.assertFalse(errors) self.assertIn('Test.First.Found', histograms_dict) self.assertIn('Test.Last.Found', histograms_dict) @@ -742,18 +740,18 @@ config_bad = config.format(histogram_name=histogram_name, improvement_tag=improvement_tag_bad) - histograms_dict, had_errors = extract_histograms.ExtractHistogramsFromDom( + histograms_dict, errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(config_good)) - self.assertFalse(had_errors) + self.assertFalse(errors) self.assertIn(histogram_name, histograms_dict) self.assertIn('improvement', histograms_dict[histogram_name]) self.assertEqual( histogram_configuration_model.IMPROVEMENT_DIRECTION_HIGHER_IS_BETTER, histograms_dict[histogram_name]['improvement']) - histograms_dict, had_errors = extract_histograms.ExtractHistogramsFromDom( + histograms_dict, errors = extract_histograms.ExtractHistogramsFromDom( xml.dom.minidom.parseString(config_bad)) - self.assertTrue(had_errors) + self.assertTrue(errors) self.assertNotIn('improvement', histograms_dict[histogram_name])
diff --git a/tools/metrics/histograms/metadata/autofill/histograms.xml b/tools/metrics/histograms/metadata/autofill/histograms.xml index 1f0157b..5e11f4c9e 100644 --- a/tools/metrics/histograms/metadata/autofill/histograms.xml +++ b/tools/metrics/histograms/metadata/autofill/histograms.xml
@@ -604,6 +604,11 @@ summary="Standalone CVC form for a card saved on file"/> </variants> +<variants name="AutofillImage"> + <variant name="CreditCardImage" summary="credit card image"/> + <variant name="PixAccountImage" summary="Pix account image"/> +</variants> + <variants name="AutofillPopupInteractionLevel"> <variant name="0" summary="a root popup suggestion(s) was either shown or interacted with @@ -3548,20 +3553,6 @@ variants="Autofill.PaymentsSigninState"/> </histogram> -<histogram name="Autofill.ImageFetcher.CreditCardArt.Result" - enum="BooleanSuccess" expires_after="2025-07-01"> - <owner>siyua@chromium.org</owner> - <owner>vishwasuppoor@google.org</owner> - <owner>payments-autofill-team@google.com</owner> - <summary> - Records the image fetching result for a credit card with card art. Logged - once for each credit card with card art either when the fetching was - successful or when a preset maximum number of fetching attempts were made. - Logs true if the image was fetched successfully, and false if the image - fetching was unsuccessful after a preset maximum number of attempts. - </summary> -</histogram> - <histogram name="Autofill.ImageFetcher.RequestLatency" units="ms" expires_after="2025-10-19"> <owner>vishwasuppoor@chromium.org</owner> @@ -3583,6 +3574,22 @@ </summary> </histogram> +<histogram + name="Autofill.ImageFetcher.{AutofillImage}.OverallResultOnBrowserStart" + enum="BooleanSuccess" expires_after="2025-07-01"> + <owner>siyua@chromium.org</owner> + <owner>vishwasuppoor@google.org</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + Records the image fetching overall result for a {AutofillImage} on browser + startup. Logged once for each {AutofillImage} either when the fetching was + successful or when a preset maximum number of fetching attempts were made. + Logs true if the image was fetched successfully, and false if the image + fetching was unsuccessful after a preset maximum number of attempts. + </summary> + <token key="AutofillImage" variants="AutofillImage"/> +</histogram> + <histogram name="Autofill.iOS.FormActivity.SendRatio" units="%" expires_after="2025-09-07"> <owner>vincb@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/blink/enums.xml b/tools/metrics/histograms/metadata/blink/enums.xml index 1f1cdec..1443a603 100644 --- a/tools/metrics/histograms/metadata/blink/enums.xml +++ b/tools/metrics/histograms/metadata/blink/enums.xml
@@ -6172,6 +6172,7 @@ <int value="5545" label="RoleAttributeTreeitem"/> <int value="5546" label="InputParsedParentSelect"/> <int value="5547" label="InputParsedAncestorSelect"/> + <int value="5548" label="CSSSelectorPseudoHasSlotted"/> </enum> <!-- LINT.ThenChange(//third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom:WebFeature) --> @@ -8170,6 +8171,9 @@ <int value="315" label="CompressionDictionaryTransport"/> <int value="316" label="Http3"/> <int value="317" label="SpeculationRules"/> + <int value="318" label="TextBox"/> + <int value="319" label="ScrollInitialTarget"/> + <int value="320" label="HasSlotted"/> </enum> <!-- LINT.ThenChange(//third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom:WebDXFeature) -->
diff --git a/tools/metrics/histograms/metadata/content/histograms.xml b/tools/metrics/histograms/metadata/content/histograms.xml index 032ea6e..8b3508a 100644 --- a/tools/metrics/histograms/metadata/content/histograms.xml +++ b/tools/metrics/histograms/metadata/content/histograms.xml
@@ -23,6 +23,7 @@ <histograms> <variants name="ContentAllProviderTypes"> + <variant name="ComponentExtensionProvider"/> <variant name="CustomExtensionProvider"/> <variant name="DefaultProvider"/> <variant name="InstalledWebappProvider"/>
diff --git a/tools/metrics/histograms/metadata/extensions/histograms.xml b/tools/metrics/histograms/metadata/extensions/histograms.xml index 042ffb7..18d7c66 100644 --- a/tools/metrics/histograms/metadata/extensions/histograms.xml +++ b/tools/metrics/histograms/metadata/extensions/histograms.xml
@@ -1165,7 +1165,7 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.ReadDynamicRulesJSONStatus" - enum="ReadDynamicRulesJSONStatus" expires_after="2025-06-01"> + enum="ReadDynamicRulesJSONStatus" expires_after="2026-06-01"> <owner>kelvinjiang@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary> @@ -1234,7 +1234,7 @@ </histogram> <histogram name="Extensions.DeclarativeNetRequest.RegexRuleSize" units="bytes" - expires_after="2025-06-01"> + expires_after="2026-06-01"> <owner>kelvinjiang@chromium.org</owner> <owner>extensions-core@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index da805837..b1c0033 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -996,6 +996,18 @@ </summary> </histogram> +<histogram + name="Media.Audio.Mac.VoiceProcessedInputStreamDetectedWithoutNativeAEC" + enum="BooleanDetected" expires_after="2026-04-23"> + <owner>brandstrom@chromium.org</owner> + <owner>webrtc-audio-uma@google.com</owner> + <summary> + If we detect voice processing input streams. Logged at calls to + media::core_audio_mac::IsInputDevice. Used for debugging + crbug.com/392938088. + </summary> +</histogram> + <histogram name="Media.Audio.MakeAudioInputStreamStatus" enum="MakeAudioStreamStatus" expires_after="2025-10-10"> <owner>yuhsuan@chromium.org</owner> @@ -5442,7 +5454,7 @@ </histogram> <histogram name="Media.RtcLowLatencyVideoRenderer.TotalFrames" units="frames" - expires_after="2025-05-11"> + expires_after="2026-05-11"> <owner>kron@chromium.org</owner> <owner>webrtc-video@google.com</owner> <summary> @@ -5514,7 +5526,7 @@ </histogram> <histogram name="Media.RTCVideoDecoderInitializationLatencyMs" units="ms" - expires_after="2025-05-11"> + expires_after="2026-05-11"> <owner>kron@chromium.org</owner> <owner>webrtc-video@google.com</owner> <summary> @@ -5547,7 +5559,7 @@ </histogram> <histogram name="Media.RTCVideoDecoderReinitializationLatencyMs" units="ms" - expires_after="2025-04-27"> + expires_after="2026-04-27"> <owner>kron@chromium.org</owner> <owner>webrtc-video@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/page/histograms.xml b/tools/metrics/histograms/metadata/page/histograms.xml index 87beae99..c925d19 100644 --- a/tools/metrics/histograms/metadata/page/histograms.xml +++ b/tools/metrics/histograms/metadata/page/histograms.xml
@@ -245,6 +245,7 @@ <variant name=".LensOverlayUntrusted"/> <variant name=".LensSidePanelUntrusted"/> <variant name=".MakoUntrusted"/> + <variant name=".NewTabFooter"/> <variant name=".PerformanceSidePanel"/> <variant name=".ReadAnythingUntrusted"/> <variant name=".ReadingList"/>
diff --git a/tools/metrics/histograms/metadata/sync/enums.xml b/tools/metrics/histograms/metadata/sync/enums.xml index 7fe30a57..c3830a0eb 100644 --- a/tools/metrics/histograms/metadata/sync/enums.xml +++ b/tools/metrics/histograms/metadata/sync/enums.xml
@@ -1174,8 +1174,8 @@ <int value="0" label="Metadata consistent"/> <int value="1" label="Cache guid mismatch"/> <int value="2" label="Data type id mismatch"/> - <int value="3" label="Empty persisted authenticated account id"/> - <int value="4" label="Authenticated account id mismatch"/> + <int value="3" label="Empty persisted authenticated gaia id"/> + <int value="4" label="Authenticated gaia id mismatch"/> </enum> <!-- LINT.ThenChange(/components/sync/model/client_tag_based_data_type_processor.cc:SyncMetadataConsistency) -->
diff --git a/tools/metrics/histograms/metadata/ui/histograms.xml b/tools/metrics/histograms/metadata/ui/histograms.xml index 384bb415..72ef4ff 100644 --- a/tools/metrics/histograms/metadata/ui/histograms.xml +++ b/tools/metrics/histograms/metadata/ui/histograms.xml
@@ -66,6 +66,7 @@ <variant name=".LensOverlayUntrusted"/> <variant name=".LensSidePanelUntrusted"/> <variant name=".MakoUntrusted"/> + <variant name=".NewTabFooter"/> <variant name=".PerformanceSidePanel"/> <variant name=".ReadAnythingUntrusted"/> <variant name=".ReadingList"/>
diff --git a/tools/metrics/histograms/metadata/web_rtc/histograms.xml b/tools/metrics/histograms/metadata/web_rtc/histograms.xml index fee2ca5d9..ceb543ff 100644 --- a/tools/metrics/histograms/metadata/web_rtc/histograms.xml +++ b/tools/metrics/histograms/metadata/web_rtc/histograms.xml
@@ -2317,12 +2317,13 @@ <histogram name="WebRTC.Video.HardwareDecodedFramesBetweenSoftwareFallbacks{WebRtcCodecs}" - units="frames" expires_after="2025-03-09"> + units="frames" expires_after="2026-03-09"> <owner>kron@chromium.org</owner> <owner>webrtc-video@google.com</owner> <summary> The number of hardware decoded frames between fallbacks to software decoder - for a received video stream. {WebRtcCodecs} + for a received video stream. {WebRtcCodecs} Warning: this histogram was + expired from 2025-03-09 to 2025-04-24; data may be missing. </summary> <token key="WebRtcCodecs"> <variant name=".Av1" summary=""/> @@ -3764,7 +3765,7 @@ </histogram> <histogram name="WebRTC.Video.TotalReceiveDelay" units="ms" - expires_after="2025-04-01"> + expires_after="2026-04-01"> <owner>kron@chromium.org</owner> <owner>video-performance-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/validate_format.py b/tools/metrics/histograms/validate_format.py index ec6401b..5e5127d 100755 --- a/tools/metrics/histograms/validate_format.py +++ b/tools/metrics/histograms/validate_format.py
@@ -77,12 +77,12 @@ tree = xml.dom.minidom.parse(path) variants, variants_errors = extract_histograms.ExtractVariantsFromXmlTree( tree) - has_errors = has_errors or variants_errors + has_errors = has_errors or bool(variants_errors) for histogram in xml_utils.IterElementsWithTag(tree, 'histogram', depth=3): tokens, tokens_errors = extract_histograms.ExtractTokens( histogram, variants) - has_errors = has_errors or tokens_errors + has_errors = has_errors or bool(tokens_errors) token_keys = [token['key'] for token in tokens] token_keys.extend(variants.keys()) @@ -116,7 +116,7 @@ _, errors = extract_histograms.ExtractHistogramsFromDom(doc) errors = errors or CheckNamespaces(paths_to_check) errors = errors or _CheckVariantsRegistered(paths_to_check) - sys.exit(errors) + sys.exit(bool(errors)) if __name__ == '__main__':
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index bee67a41..c88e13d 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,8 +5,8 @@ "full_remote_path": "perfetto-luci-artifacts/v50.1/linux-arm64/trace_processor_shell" }, "win": { - "hash": "8f315b6f710f5e42e667bcbdabf020cab910c99a", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/be417778d0eb6100497ece9d059b4ca8e0a1a4d7/trace_processor_shell.exe" + "hash": "fa53ec450ba354d04e1c56c06bc8e45fb5ac450d", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/86ffe81a57cee5ebefffb8ebacc2d7125998627e/trace_processor_shell.exe" }, "linux_arm": { "hash": "99f971ca131f6d11c73f4b918099d434bdd8093c", @@ -21,8 +21,8 @@ "full_remote_path": "perfetto-luci-artifacts/v50.1/mac-arm64/trace_processor_shell" }, "linux": { - "hash": "98f0e9a8d71c7934203a8c0e11ba5f1253daed75", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/be417778d0eb6100497ece9d059b4ca8e0a1a4d7/trace_processor_shell" + "hash": "e99027657763ab5b2187b7e300a5abdf6dcb84b0", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/86ffe81a57cee5ebefffb8ebacc2d7125998627e/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/perf/process_perf_results.pydeps b/tools/perf/process_perf_results.pydeps index 4deaf270..158b557 100644 --- a/tools/perf/process_perf_results.pydeps +++ b/tools/perf/process_perf_results.pydeps
@@ -124,7 +124,6 @@ ../../third_party/catapult/devil/devil/utils/run_tests_helper.py ../../third_party/catapult/devil/devil/utils/timeout_retry.py ../../third_party/catapult/devil/devil/utils/watchdog_timer.py -../../third_party/catapult/devil/devil/utils/zip_utils.py ../../third_party/catapult/systrace/systrace/__init__.py ../../third_party/catapult/systrace/systrace/trace_result.py ../../third_party/catapult/systrace/systrace/tracing_agents/__init__.py
diff --git a/tools/rust/update_rust.py b/tools/rust/update_rust.py index c9a4f2f..183e234 100755 --- a/tools/rust/update_rust.py +++ b/tools/rust/update_rust.py
@@ -31,7 +31,7 @@ # These fields are written by //tools/clang/scripts/upload_revision.py, and # should not be changed manually. -RUST_REVISION = '3f690c2257b7080cd3a8cce64e082fc972148990' +RUST_REVISION = 'c8f94230282a8e8c1148f3e657f0199aad909228' RUST_SUB_REVISION = 1 # The revision of Crubit to use from https://github.com/google/crubit @@ -46,7 +46,7 @@ # Hash of src/stage0.json, which itself contains the stage0 toolchain hashes. # We trust the Rust build system checks, but to ensure it is not tampered with # itself check the hash. -STAGE0_JSON_SHA256 = 'ad3095f23fe55ef1d86bc8ee8b5d31eb4e98eb3d8a6d163c295625ffa18ca35a' +STAGE0_JSON_SHA256 = '1113296e1412c791d09f3033355001061e7ca36e06e796ff0f1f798791a6d93b' THIS_DIR = os.path.abspath(os.path.dirname(__file__)) CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..'))
diff --git a/ui/accessibility/android/java/src/org/chromium/ui/accessibility/AccessibilityState.java b/ui/accessibility/android/java/src/org/chromium/ui/accessibility/AccessibilityState.java index 58318c4..72eafd5 100644 --- a/ui/accessibility/android/java/src/org/chromium/ui/accessibility/AccessibilityState.java +++ b/ui/accessibility/android/java/src/org/chromium/ui/accessibility/AccessibilityState.java
@@ -26,7 +26,6 @@ import android.os.Handler; import android.os.SystemClock; import android.provider.Settings; -import android.util.Pair; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.autofill.AutofillManager; @@ -402,6 +401,11 @@ return sHighContrastEnabled; } + public static int getNumberOfRunningServices() { + if (!sInitialized) updateAccessibilityServices(); + return assumeNonNull(sServiceIds).size(); + } + /** * The current font weight adjustment set at the Android-OS level. Initialized to be 0, the * default font weight. If a user has the bold text setting enabled, this will be 300. This is @@ -838,27 +842,6 @@ } /** - * Checks the current enabled state of TalkBack. TalkBack can either be disabled, enabled with - * other services running, or be the only enabled service. - * - * @return A {@link Pair} where the first boolean indicates whether or not TalkBack is enabled - * at all, and the second boolean indicates whether or not TalkBack is the only running - * accessibility service. - */ - public static Pair<Boolean, Boolean> getTalkBackEnabledState() { - if (!sInitialized) updateAccessibilityServices(); - if (sServiceIds == null || sServiceIds.isEmpty()) { - return new Pair<Boolean, Boolean>(false, false); - } - - boolean isTalkBackEnabled = sServiceIds.contains(KNOWN_SCREEN_READER_SERVICE_IDS); - boolean isOnlyOneServiceEnabled = sServiceIds.size() == 1; - - return new Pair<Boolean, Boolean>( - isTalkBackEnabled, isTalkBackEnabled && isOnlyOneServiceEnabled); - } - - /** * Return a bitmask containing the union of all event types that running accessibility services * listen to. */ @@ -1324,6 +1307,7 @@ private static void initializeForTesting() { sState = new State(false, false, false, false, false, false, false, false, false); + sServiceIds = new ArrayList<String>(); fetchAccessibilityManager(); sInitialized = true; sIsInTestingMode = true; @@ -1331,6 +1315,7 @@ protected static void uninitializeForTesting() { sState = null; + sServiceIds = null; sAccessibilityManager = null; sInitialized = false; sIsInTestingMode = false;
diff --git a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java index 55927472..3458ddb 100644 --- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java +++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
@@ -798,6 +798,10 @@ return mIsTopResumedActivity; } + public boolean isActivityTopResumedSupported() { + return mActivityTopResumedSupported; + } + /** * @return Current state of the associated {@link Activity}. Can be overridden to return the * correct state. {@code ActivityState.DESTROYED} by default.
diff --git a/ui/aura/native_window_occlusion_tracker.cc b/ui/aura/native_window_occlusion_tracker.cc index 1aa13cbb4..75ebfa8a 100644 --- a/ui/aura/native_window_occlusion_tracker.cc +++ b/ui/aura/native_window_occlusion_tracker.cc
@@ -60,11 +60,9 @@ return false; } -#if BUILDFLAG(IS_WIN) if (!base::FeatureList::IsEnabled(features::kCalculateNativeWinOcclusion)) { return false; } -#endif const std::string type = features::kApplyNativeOcclusionToCompositorType.Get(); @@ -74,7 +72,7 @@ features::kApplyNativeOcclusionToCompositorTypeThrottleAndRelease; #else return false; -#endif +#endif // BUILDFLAG(IS_WIN) } } // namespace aura
diff --git a/ui/base/models/list_selection_model.h b/ui/base/models/list_selection_model.h index 7ee8ede..8216b15 100644 --- a/ui/base/models/list_selection_model.h +++ b/ui/base/models/list_selection_model.h
@@ -86,7 +86,7 @@ // anchor indices. void RemoveIndexFromSelection(size_t index); - // Extends the selection from the anchor to |index|. If the anchor is empty, + // Sets the selection from the anchor to |index|. If the anchor is empty, // this sets the anchor, selection and active indices to |index|. void SetSelectionFromAnchorTo(size_t index);
diff --git a/ui/base/win/hwnd_metrics.cc b/ui/base/win/hwnd_metrics.cc index 521e6fd..33f72f0 100644 --- a/ui/base/win/hwnd_metrics.cc +++ b/ui/base/win/hwnd_metrics.cc
@@ -25,14 +25,17 @@ } // namespace +int GetResizeFrameOnlyThickness(HMONITOR monitor) { + return display::win::GetScreenWin()->GetSystemMetricsForMonitor( + monitor, SM_CXSIZEFRAME); +} + int GetFrameThickness(HMONITOR monitor) { // On Windows 10 the visible frame border is one pixel thick, but there is // some additional non-visible space: SM_CXSIZEFRAME (the resize handle) // and SM_CXPADDEDBORDER (additional border space that isn't part of the // resize handle). - const int resize_frame_thickness = - display::win::GetScreenWin()->GetSystemMetricsForMonitor(monitor, - SM_CXSIZEFRAME); + const int resize_frame_thickness = GetResizeFrameOnlyThickness(monitor); const int padding_thickness = display::win::GetScreenWin()->GetSystemMetricsForMonitor( monitor, SM_CXPADDEDBORDER);
diff --git a/ui/base/win/hwnd_metrics.h b/ui/base/win/hwnd_metrics.h index 2e840a8..139e087 100644 --- a/ui/base/win/hwnd_metrics.h +++ b/ui/base/win/hwnd_metrics.h
@@ -13,8 +13,13 @@ namespace ui { // Returns the thickness, in pixels, of the non-client frame's left, right, and +// bottom borders around a resizble (WS_THICKFRAME) window on the given monitor, +// with no visible border. +COMPONENT_EXPORT(UI_BASE) int GetResizeFrameOnlyThickness(HMONITOR monitor); + +// Returns the thickness, in pixels, of the non-client frame's left, right, and // bottom borders around a resizble (WS_THICKFRAME) window on the given monitor. -// This frame consists of: +// In contrast to `GetResizeFrameOnlyThickness`, this frame consists of both: // - A non-visible resize handle. // - A visible border. // This thickness *excludes* the top border (title bar), which is typically
diff --git a/ui/views/controls/scrollbar/scroll_bar.cc b/ui/views/controls/scrollbar/scroll_bar.cc index 8087399..128a0ac 100644 --- a/ui/views/controls/scrollbar/scroll_bar.cc +++ b/ui/views/controls/scrollbar/scroll_bar.cc
@@ -9,11 +9,10 @@ #include <string> #include "base/compiler_specific.h" -#include "base/containers/flat_map.h" +#include "base/containers/fixed_flat_map.h" #include "base/functional/bind.h" #include "base/functional/callback.h" #include "base/functional/callback_helpers.h" -#include "base/no_destructor.h" #include "base/numerics/safe_conversions.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" @@ -517,9 +516,8 @@ return ScrollAmount::kNone; } - static const base::NoDestructor< - base::flat_map<ui::KeyboardCode, ScrollAmount>> - kMap({ + static constexpr auto kMap = + base::MakeFixedFlatMap<ui::KeyboardCode, ScrollAmount>({ {ui::VKEY_LEFT, ScrollAmount::kPrevLine}, {ui::VKEY_RIGHT, ScrollAmount::kNextLine}, {ui::VKEY_UP, ScrollAmount::kPrevLine}, @@ -530,8 +528,8 @@ {ui::VKEY_END, ScrollAmount::kEnd}, }); - const auto i = kMap->find(keycode); - return (i == kMap->end()) ? ScrollAmount::kNone : i->second; + const auto i = kMap.find(keycode); + return (i == kMap.end()) ? ScrollAmount::kNone : i->second; } std::optional<int> ScrollBar::GetDesiredScrollOffset(ScrollAmount amount) {
diff --git a/v8 b/v8 index 2267845..63b423f 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit 2267845644deca2b35d41fd0ccb02a7ddf5263d2 +Subproject commit 63b423f435cb087182badeb9d4df1cf57f03af1d