M122 stage 2

This commit is contained in:
Alexander Frick 2024-03-11 12:41:31 -05:00
parent b6eccac242
commit 40f78f2fab
14 changed files with 268 additions and 892 deletions

View file

@ -62,7 +62,6 @@
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.127:net/url_request/url_request_http_job.cc;bpv=1" ADD_DATE="1661054752" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">url_request_http_job.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.127:sandbox/policy/linux/bpf_audio_policy_linux.cc;bpv=1" ADD_DATE="1661054752" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">bpf_audio_policy_linux.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.127:ui/base/x/x11_util.cc;bpv=1" ADD_DATE="1661054752" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">x11_util.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/_/chromium/v8/v8.git/+/6ac54d1cdc0e26ab1d73a740fd9ec6a9698e39fd:src/objects/js-display-names.cc;bpv=1" ADD_DATE="1661054752" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">js-display-names.cc - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.127:third_party/widevine/cdm/widevine_cdm_version.h;bpv=1" ADD_DATE="1661054752" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">widevine_cdm_version.h - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.127:third_party/widevine/cdm/BUILD.gn;bpv=1" ADD_DATE="1661054752" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">BUILD.gn - Chromium Code Search</A>
<DT><A HREF="https://source.chromium.org/chromium/chromium/src/+/refs/tags/122.0.6261.127:third_party/widevine/cdm/widevine.gni;bpv=1" ADD_DATE="1661054752" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADIUlEQVQ4jW1TXWwUZRQ955ufnZ3dlm4VpE2Q+lND1cSQYDBaKY2VEkUFa1d9K4laBROEIg+mDfvkg5Bu9MWoD/hkTJdqJBFCMRENEqONRkMbIiWGWn5SjWw7OzO7szPf9UFCCnrebu7JuTc55xA3QURYKkEtXw7+1gDm0mDWBtMm+GcAnb+P0VI+lw4fTIp7C6O7dU3nlKFyisxp0TmDRpMmmyDSCqLY96D1HUQIUsxrd9nfD3VrHDbDTi/ENi5V/TCdtmlQ0Y60dmwANNXT0HpodEx+2kNUb/4e45PSUhBR/1lcw6Gvf3fGf4gmJn6NBgGgUBBFAHj+vepdKSvp2r5m/pPu7juqA4fEOTcXvhaG2KAMVjOp5MjJ4eynBOTIz7Vnzs5Jcfoiej9+1TlHAHjyneArKrl/XcVtnQLcS/A/b23J9DzUBgQRcPo84JX90VOF7JCIGFsOBLMCTB/dl3lc9b+7uA1O+jHb4OuFAvVl+oOtLZmekc1JbUc36nt7pb6zK0mslL2n6+3wUZJJyuIuOm7Ps8Xyc8qP3Q+TMDj+2W73MABUatK5vg26vcVQf3navOqL+Ui7kay53dJeEG8AgPE33PEkDI6HSfZ9BRFAQJF/LSVYDSIQEBiKsE0lsRaGNSiTEl43X4SAQKWN8GUj427qG/XyAJB15IvTM+CJKW04FuoiEpd+1Grmj8BvzPIYAGwten2mm9mUsauDBIAnDvgnAHQMrHZX5/NMOguLBy07NXTPKhvVGnDhb0BH3pvfDjcelDExnpoNLormmS/3uT0KAFY0xDs2dhiLqXZsBoBThca9QK1z8mxlZPpCZZeq+2dMqi2AcGYtzOZG9dayrHoFACgiJCkTU9FAJZCtCxX7he3dvCFl60b8ta6lh2/T2Rdf2oam3gc4f2MXRLi7NOd0tq34iFS/aNFHIwBhJLGVSLRqZd3rWNYQfj+L5igOdb6YvoISNEC5LgBSDk9G6ynYScgVrbGgFMsQKSdiLIhIWSe6rGifzz/M8H/bCABjU2L781BeOCMrK5FcvfNeuexB8M1J7N+/MSEpS/n/AGH0clblBN69AAAAAElFTkSuQmCC">widevine.gni - Chromium Code Search</A>

View file

@ -55,11 +55,6 @@ if (is_android) {
}
declare_args() {
# Indicates whether keystone registration framework should be enabled (see
# action("keystone_registration_framework") below). There are some tests
# where we'd like for it to be disabled. (https://crbug.com/909080)
enable_keystone_registration_framework = true
# On macOS, `is_chrome_branded` builds that have been signed locally will not
# launch because certain entitlements are tied to the official Google code
# signing identity. If `include_branded_entitlements` is set to false, these
@ -106,7 +101,7 @@ group("assert_no_deps") {
if (is_android) {
deps += [ "//chrome/android:chrome_public_apk" ]
} else {
} else if (!is_fuchsia) {
deps += [ ":chrome" ]
}
@ -129,7 +124,7 @@ group("assert_no_deps") {
}
}
if (!is_android && !is_mac) {
if (!is_android && !is_mac && !is_fuchsia) {
group("chrome") {
public_deps = [ ":chrome_initial" ]
data_deps = [ ":chrome_initial" ]
@ -204,7 +199,7 @@ if (!is_android && !is_mac) {
":chrome_dll",
":chrome_exe_version",
":copy_first_run",
":packed_resources_integrity",
":packed_resources_integrity_header",
":visual_elements_resources",
"//base",
"//build:branding_buildflags",
@ -471,7 +466,8 @@ if (is_win) {
chrome_framework_name = chrome_product_full_name + " Framework"
chrome_framework_version = chrome_version_full
verify_dynamic_libraries = !is_component_build && !is_asan
verify_dynamic_libraries = !is_component_build && !is_asan && !is_ubsan &&
!is_ubsan_vptr && !is_ubsan_security
if (host_os == "mac") {
objdump_path = mac_bin_path
} else {
@ -963,13 +959,6 @@ if (is_win) {
"//chrome/browser/mac:install",
]
if (is_chrome_branded) {
sources += [
"browser/mac/keystone_promote_postflight.sh",
"browser/mac/keystone_promote_preflight.sh",
]
}
if (icu_use_data_file) {
sources += [ "$root_out_dir/icudtl.dat" ]
public_deps += [ "//third_party/icu:icudata" ]
@ -1093,17 +1082,6 @@ if (is_win) {
}
}
if (is_chrome_branded && enable_keystone_registration_framework) {
bundle_data("keystone_registration_framework") {
sources = [ "//third_party/googlemac/Releases/Keystone/KeystoneRegistration.framework" ]
outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
}
} else {
group("keystone_registration_framework") {
}
}
if (build_with_internal_optimization_guide) {
# Add the optimization guide .dylib in the MODULE_DIR of Chromium.app
bundle_data("optimization_guide_library") {
@ -1218,10 +1196,6 @@ if (is_win) {
if (is_chrome_branded) {
framework_contents += [ "Default Apps" ]
if (enable_keystone_registration_framework) {
# For KeystoneRegistration.framework.
framework_contents += [ "Frameworks" ]
}
}
if (enable_nacl) {
@ -1245,7 +1219,6 @@ if (is_win) {
":chrome_framework_helpers",
":chrome_framework_plugins",
":chrome_framework_resources",
":keystone_registration_framework",
":optimization_guide_library",
":swiftshader_library",
":widevine_cdm_library",
@ -1621,6 +1594,7 @@ if (!is_android) {
public_deps = [ ":preinstalled_apps" ]
}
# This needs to be in-sync with //chrome/app/packed_resources_integrity.h.
files_to_hash = [
"resources.pak",
"chrome_100_percent.pak",
@ -1629,6 +1603,15 @@ if (!is_android) {
files_to_hash += [ "chrome_200_percent.pak" ]
}
}
# This is extracted to deserialize build dependency around
# :packed_resources_integrity_hash and improve build parallelism.
source_set("packed_resources_integrity_header") {
sources = [ "app/packed_resources_integrity.h" ]
# chrome/app/packed_resources_integrity.cc file is generated in dependency.
deps = [ ":packed_resources_integrity" ]
}
}
if (!is_android) {
@ -1726,10 +1709,6 @@ if (is_android) {
if (is_chromeos_ash) {
public_deps += [ "//ui/lottie" ]
}
if (enable_vr) {
deps += [ "//third_party/gvr-android-sdk:gvr_shim" ]
}
}
}

View file

@ -55,11 +55,6 @@ if (is_android) {
}
declare_args() {
# Indicates whether keystone registration framework should be enabled (see
# action("keystone_registration_framework") below). There are some tests
# where we'd like for it to be disabled. (https://crbug.com/909080)
enable_keystone_registration_framework = true
# On macOS, `is_chrome_branded` builds that have been signed locally will not
# launch because certain entitlements are tied to the official Google code
# signing identity. If `include_branded_entitlements` is set to false, these
@ -106,7 +101,7 @@ group("assert_no_deps") {
if (is_android) {
deps += [ "//chrome/android:chrome_public_apk" ]
} else {
} else if (!is_fuchsia) {
deps += [ ":chrome" ]
}
@ -129,7 +124,7 @@ group("assert_no_deps") {
}
}
if (!is_android && !is_mac) {
if (!is_android && !is_mac && !is_fuchsia) {
group("chrome") {
public_deps = [ ":chrome_initial" ]
data_deps = [ ":chrome_initial" ]
@ -204,7 +199,7 @@ if (!is_android && !is_mac) {
":chrome_dll",
":chrome_exe_version",
":copy_first_run",
":packed_resources_integrity",
":packed_resources_integrity_header",
":visual_elements_resources",
"//base",
"//build:branding_buildflags",
@ -471,7 +466,8 @@ if (is_win) {
chrome_framework_name = chrome_product_full_name + " Framework"
chrome_framework_version = chrome_version_full
verify_dynamic_libraries = !is_component_build && !is_asan
verify_dynamic_libraries = !is_component_build && !is_asan && !is_ubsan &&
!is_ubsan_vptr && !is_ubsan_security
if (host_os == "mac") {
objdump_path = mac_bin_path
} else {
@ -963,13 +959,6 @@ if (is_win) {
"//chrome/browser/mac:install",
]
if (is_chrome_branded) {
sources += [
"browser/mac/keystone_promote_postflight.sh",
"browser/mac/keystone_promote_preflight.sh",
]
}
if (icu_use_data_file) {
sources += [ "$root_out_dir/icudtl.dat" ]
public_deps += [ "//third_party/icu:icudata" ]
@ -1093,17 +1082,6 @@ if (is_win) {
}
}
if (is_chrome_branded && enable_keystone_registration_framework) {
bundle_data("keystone_registration_framework") {
sources = [ "//third_party/googlemac/Releases/Keystone/KeystoneRegistration.framework" ]
outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}" ]
}
} else {
group("keystone_registration_framework") {
}
}
if (build_with_internal_optimization_guide) {
# Add the optimization guide .dylib in the MODULE_DIR of Chromium.app
bundle_data("optimization_guide_library") {
@ -1218,10 +1196,6 @@ if (is_win) {
if (is_chrome_branded) {
framework_contents += [ "Default Apps" ]
if (enable_keystone_registration_framework) {
# For KeystoneRegistration.framework.
framework_contents += [ "Frameworks" ]
}
}
if (enable_nacl) {
@ -1245,7 +1219,6 @@ if (is_win) {
":chrome_framework_helpers",
":chrome_framework_plugins",
":chrome_framework_resources",
":keystone_registration_framework",
":optimization_guide_library",
":swiftshader_library",
":widevine_cdm_library",
@ -1621,6 +1594,7 @@ if (!is_android) {
public_deps = [ ":preinstalled_apps" ]
}
# This needs to be in-sync with //chrome/app/packed_resources_integrity.h.
files_to_hash = [
"resources.pak",
"chrome_100_percent.pak",
@ -1629,6 +1603,15 @@ if (!is_android) {
files_to_hash += [ "chrome_200_percent.pak" ]
}
}
# This is extracted to deserialize build dependency around
# :packed_resources_integrity_hash and improve build parallelism.
source_set("packed_resources_integrity_header") {
sources = [ "app/packed_resources_integrity.h" ]
# chrome/app/packed_resources_integrity.cc file is generated in dependency.
deps = [ ":packed_resources_integrity" ]
}
}
if (!is_android) {
@ -1726,10 +1709,6 @@ if (is_android) {
if (is_chromeos_ash) {
public_deps += [ "//ui/lottie" ]
}
if (enable_vr) {
deps += [ "//third_party/gvr-android-sdk:gvr_shim" ]
}
}
}

View file

@ -112,7 +112,7 @@
<if expr="not is_android">
<structure type="chrome_scaled_image" name="IDR_INCOGNITO_DATA_NOT_SAVED_HEADER_DARK" file="common/incognito_data_not_saved_header_dark.png" />
<structure type="chrome_scaled_image" name="IDR_INCOGNITO_DATA_NOT_SAVED_HEADER_LIGHT" file="common/incognito_data_not_saved_header_light.png" />
</if>
</if>
<structure type="chrome_scaled_image" name="IDR_INCOGNITO_WHITE_CIRCLE" file="common/incognito_white_circle.png" />
<structure type="chrome_scaled_image" name="IDR_INPUT_ALERT" file="common/input_alert.png" />
<structure type="chrome_scaled_image" name="IDR_INPUT_ALERT_MENU" file="common/input_alert_menu.png" />
@ -284,6 +284,8 @@
<structure type="chrome_scaled_image" name="IDR_SAVE_CARD_DARK" file="common/save_card_dark.png" />
<structure type="chrome_scaled_image" name="IDR_SAVE_CARD_SECURELY_DARK" file="common/save_card_securely_dark.png" />
<structure type="chrome_scaled_image" name="IDR_SAVE_CARD_SECURELY" file="common/save_card_securely.png" />
<structure type="chrome_scaled_image" name="IDR_SAVE_CVC" file="common/save_cvc.png" />
<structure type="chrome_scaled_image" name="IDR_SAVE_CVC_DARK" file="common/save_cvc_dark.png" />
<structure type="chrome_scaled_image" name="IDR_MIGRATE_ADDRESS_AVATAR50_X135_Y54" file="common/migrate_address_avatar50_x135_y54.png" />
<structure type="chrome_scaled_image" name="IDR_MIGRATE_ADDRESS_AVATAR50_X135_Y54_DARK" file="common/migrate_address_avatar50_x135_y54_dark.png" />
<structure type="chrome_scaled_image" name="IDR_PRIVACY_SANDBOX_CONFIRMATION_BANNER" file="common/privacy_sandbox_confirmation_banner.png" />

View file

@ -156,7 +156,7 @@ void AddSoftwareSecureWidevine(std::vector<content::CdmInfo>* cdms) {
// devices. Register Widevine without any capabilities so that it will be
// checked the first time some page attempts to play protected content.
cdms->emplace_back(
kWidevineKeySystem, Robustness::kSoftwareSecure, absl::nullopt,
kWidevineKeySystem, Robustness::kSoftwareSecure, std::nullopt,
/*supports_sub_key_systems=*/false, kWidevineCdmDisplayName,
kWidevineCdmType, base::Version(), base::FilePath());
@ -218,7 +218,7 @@ void AddHardwareSecureWidevine(std::vector<content::CdmInfo>* cdms) {
// devices. Register Widevine without any capabilities so that it will be
// checked the first time some page attempts to play protected content.
cdms->emplace_back(
kWidevineKeySystem, Robustness::kHardwareSecure, absl::nullopt,
kWidevineKeySystem, Robustness::kHardwareSecure, std::nullopt,
/*supports_sub_key_systems=*/false, kWidevineCdmDisplayName,
kWidevineCdmType, base::Version(), base::FilePath());

View file

@ -30,8 +30,6 @@ chrome_child.dll: %(VersionDir)s\
chrome_elf.dll: %(VersionDir)s\
chrome_pwa_launcher.exe: %(VersionDir)s\
chrome_wer.dll: %(VersionDir)s\
thorium_shell.exe: %(VersionDir)s\
thorium_shell.ico: %(VersionDir)s\
content_resources.pak: %(VersionDir)s\
content_shell.pak: %(VersionDir)s\
d3dcompiler_47.dll: %(VersionDir)s\
@ -44,6 +42,8 @@ notification_helper.exe: %(VersionDir)s\
optimization_guide_internal.dll: %(VersionDir)s\
resources.pak: %(VersionDir)s\
shell_resources.pak: %(VersionDir)s\
thorium_shell.exe: %(VersionDir)s\
thorium_shell.ico: %(VersionDir)s\
ui_resources_100_percent.pak: %(VersionDir)s\
resources\*.*: %(VersionDir)s\resources\
vk_swiftshader.dll: %(VersionDir)s\

View file

@ -77,7 +77,7 @@ target(link_target_type, "gpu_sources") {
"//services/service_manager/public/mojom",
"//services/tracing/public/cpp",
"//services/viz/privileged/mojom",
"//services/webnn",
"//services/webnn:webnn_service",
"//services/webnn/public/mojom",
"//skia",
"//third_party/angle:angle_gpu_info_util",

View file

@ -133,6 +133,10 @@ const char kSystemAecEnabled[] = "system-aec-enabled";
const char kUnsafelyAllowProtectedMediaIdentifierForDomain[] =
"unsafely-allow-protected-media-identifier-for-domain";
// Skip the permission prompt for Captured Surface Control.
const char kAutoGrantCapturedSurfaceControlPrompt[] =
"auto-grant-captured-surface-control-prompt";
// Use fake device for Media Stream to replace actual camera and microphone.
// For the list of allowed parameters, see
// FakeVideoCaptureDeviceFactory::ParseFakeDevicesConfigFromOptionsString().
@ -163,20 +167,10 @@ const char kUseFakeMjpegDecodeAccelerator[] =
const char kDisableAcceleratedMjpegDecode[] =
"disable-accelerated-mjpeg-decode";
// When running tests on a system without the required hardware or libraries,
// this flag will cause the tests to fail. Otherwise, they silently succeed.
const char kRequireAudioHardwareForTesting[] =
"require-audio-hardware-for-testing";
// Mutes audio sent to the audio device so it is not audible during
// automated testing.
const char kMuteAudio[] = "mute-audio";
// Allows clients to override the threshold for when the media renderer will
// declare the underflow state for the video stream when audio is present.
// TODO(dalecurtis): Remove once experiments for http://crbug.com/470940 finish.
const char kVideoUnderflowThresholdMs[] = "video-underflow-threshold-ms";
// Disables the new rendering algorithm for webrtc, which is designed to improve
// the rendering smoothness.
const char kDisableRTCSmoothnessAlgorithm[] =
@ -270,20 +264,14 @@ const char kUserGestureRequiredPolicy[] = "user-gesture-required";
// This provides a mechanism during testing to lock the decoder framerate
// to a specific value.
const char kHardwareVideoDecodeFrameRate[] = "hardware-video-decode-framerate";
// Set the task runner strategy used for hardware video decoding on ChromeOS.
// If the option value of --chromeos-decoder-task-runner is
// * OneThreadPoolSequenceSharedByAllDecoders, then SequencedTaskRunner.
// * OneThreadPoolThreadSharedByAllDecoders, then SingleThreadTaskRunner
// (one of the threads in ThreadPool).
// * OneDedicatedThreadSharedByAllDecoders, then SingleThreadTaskRunner of
// base::Thread("VDdecThread"), which is unique and only used for video
// decoders.
// * OneThreadPoolThreadPerDecoder (default), then SingleThreadTaskRunner
// of a dedicated thread newly created in ThreadPool per decoder.
// TODO(b/195769334): Propagate this to Chrome utility process for
// Out-of-Process video decoding.
const char kChromeOSVideoDecoderTaskRunner[] =
"chromeos-video-decoder-task-runner";
#endif
#if BUILDFLAG(USE_V4L2_CODEC)
// This is needed for V4L2 testing using VISL (virtual driver) on cros VM with
// arm64-generic-vm. Minigbm buffer allocation is done using dumb driver with
// vkms.
const char kEnablePrimaryNodeAccessForVkmsTesting[] =
"enable-primary-node-access-for-vkms-testing";
#endif
const char kCastStreamingForceDisableHardwareH264[] =
@ -300,9 +288,6 @@ const char kCastMirroringTargetPlayoutDelay[] =
"cast-mirroring-target-playout-delay";
#endif // !BUILDFLAG(IS_ANDROID)
const char kDisableUseSharedImagesForPepperVideo[] =
"disable-use-shared-images-for-pepper-video";
} // namespace switches
namespace media {
@ -382,7 +367,19 @@ BASE_FEATURE(kMacLoopbackAudioForCast,
BASE_FEATURE(kMacLoopbackAudioForScreenShare,
"MacLoopbackAudioForScreenShare",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
#endif // BUILDFLAG(IS_MAC)
#if BUILDFLAG(IS_LINUX)
// Enables system audio mirroring using pulseaudio.
BASE_FEATURE(kPulseaudioLoopbackForCast,
"PulseaudioLoopbackForCast",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables system audio sharing using pulseaudio.
BASE_FEATURE(kPulseaudioLoopbackForScreenShare,
"PulseaudioLoopbackForScreenShare",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_LINUX)
// When enabled, MediaCapabilities will check with GPU Video Accelerator
// Factories to determine isPowerEfficient = true/false.
@ -451,21 +448,31 @@ BASE_FEATURE(kCdmProcessSiteIsolation,
"CdmProcessSiteIsolation",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables the "Copy Video Frame" context menu item.
BASE_FEATURE(kContextMenuCopyVideoFrame,
"ContextMenuCopyVideoFrame",
#if BUILDFLAG(IS_ANDROID)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
#endif
);
// Enables the "Save Video Frame As" context menu item.
BASE_FEATURE(kContextMenuSaveVideoFrameAs,
"ContextMenuSaveVideoFrameAs",
base::FEATURE_ENABLED_BY_DEFAULT);
#if BUILDFLAG(IS_ANDROID)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
#endif
);
// Enables the "Search Video Frame with <Search Provider>" context menu item.
BASE_FEATURE(kContextMenuSearchForVideoFrame,
"ContextMenuSearchForVideoFrame",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables the "Copy Video Frame" context menu item.
BASE_FEATURE(kContextMenuCopyVideoFrame,
"ContextMenuCopyVideoFrame",
base::FEATURE_ENABLED_BY_DEFAULT);
#if BUILDFLAG(CHROME_WIDE_ECHO_CANCELLATION)
// If echo cancellation for a mic signal is requested, mix and cancel all audio
// playback going to a specific output device in the audio service.
@ -597,7 +604,8 @@ BASE_FEATURE(kUseWritePixelsYUV,
// hardware video decoders.
BASE_FEATURE(kUseMultiPlaneFormatForHardwareVideo,
"UseMultiPlaneFormatForHardwareVideo",
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA)
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FUCHSIA) || \
BUILDFLAG(IS_LINUX)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
@ -646,12 +654,6 @@ BASE_FEATURE(kMultiPlaneVideoCaptureSharedImages,
#endif
);
// Controls whether the Open Screen libcast SenderSession is used for
// initializing and managing streaming sessions, or the legacy implementation.
BASE_FEATURE(kOpenscreenCastStreamingSession,
"OpenscreenCastStreamingSession",
base::FEATURE_ENABLED_BY_DEFAULT);
// Controls whether the Mirroring Service will fetch, analyze, and store
// information on the quality of the session using RTCP logs.
BASE_FEATURE(kEnableRtcpReporting,
@ -755,11 +757,6 @@ BASE_FEATURE(kGlobalMediaControlsSeamlessTransfer,
"GlobalMediaControlsSeamlessTransfer",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enable an updated version of the Global Media Controls UI.
BASE_FEATURE(kGlobalMediaControlsModernUI,
"GlobalMediaControlsModernUI",
base::FEATURE_DISABLED_BY_DEFAULT);
// CanPlayThrough issued according to standard.
BASE_FEATURE(kSpecCompliantCanPlayThrough,
"SpecCompliantCanPlayThrough",
@ -880,13 +877,18 @@ BASE_FEATURE(kVideoBlitColorAccuracy,
"video-blit-color-accuracy",
base::FEATURE_ENABLED_BY_DEFAULT);
// A client (e.g. cast mirroring) can allow a video encoder to drop a frame.
BASE_FEATURE(kVideoEncoderFrameDrop,
"VideoEncoderFrameDrop",
base::FEATURE_DISABLED_BY_DEFAULT);
#if BUILDFLAG(IS_APPLE)
// Use VideoToolbox for AV1 hardware decoding.
// Owner: dalecurtis@chromium.org, sandersd@chromium.org
// Expiry: When enabled by default for a full release cycle
BASE_FEATURE(kVideoToolboxAv1Decoding,
"VideoToolboxAv1Decoding",
base::FEATURE_DISABLED_BY_DEFAULT);
base::FEATURE_ENABLED_BY_DEFAULT);
// Use the new VideoToolboxVideoDecoder for hardware decoding.
// Owner: sandersd@chromium.org
@ -1131,6 +1133,11 @@ BASE_FEATURE(kAllowNonSecureOverlays,
"AllowNonSecureOverlays",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables support for playback of encrypted AV1 content.
BASE_FEATURE(kEnableEncryptedAV1,
"EnableEncryptedAV1",
base::FEATURE_DISABLED_BY_DEFAULT);
// Allow FrameInfoHelper to guess coded size information for MediaCodec frames.
BASE_FEATURE(kMediaCodecCodedSizeGuessing,
"MediaCodecCodedSizeGuessing",
@ -1164,6 +1171,12 @@ BASE_FEATURE(kMediaDrmPreprovisioningAtStartup,
"MediaDrmPreprovisioningAtStartup",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables MediaDrmBridge to call into MediaDrm API to query HDCP Status to
// support the CDM API GetStatusForPolicy.
BASE_FEATURE(kMediaDrmGetStatusForPolicy,
"MediaDrmGetStatusForPolicy",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables CanPlayType() (and other queries) for HLS MIME types. Note that
// disabling this also causes navigation to .m3u8 files to trigger downloading
// instead of playback.
@ -1218,6 +1231,18 @@ BASE_FEATURE(kChromeOSHWAV1Decoder,
// ChromeOS.
BASE_FEATURE(kChromeOSHWVBREncoding,
"ChromeOSHWVBREncoding",
#if defined(ARCH_CPU_X86_FAMILY)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
// Use a dedicated thread for hardware video decoding in Video decoder process.
// If this is disabled, a sequenced task runner in base::ThreadPool is used for
// hardware video decoding.
BASE_FEATURE(kUseDedicatedDecoderThreadInVideoDecoderProcess,
"UseDedicatedDecoderThreadInVideoDecoderProcess",
base::FEATURE_DISABLED_BY_DEFAULT);
#if !BUILDFLAG(USE_VAAPI)
@ -1242,6 +1267,14 @@ BASE_FEATURE(kUSeSequencedTaskRunnerForVEA,
base::FEATURE_DISABLED_BY_DEFAULT);
#if defined(ARCH_CPU_ARM_FAMILY)
// Experimental support for GL based scaling for NV12 on Trogdor.
// Normally LibYUV is used to scale these frames. This flag enables
// an experimental GL-based scaling method.
// Owner: bchoobineh@chromium.org
// Expiry: When GLImageProcessor is deleted
BASE_FEATURE(kUseGLForScaling,
"UseGLForScaling",
base::FEATURE_DISABLED_BY_DEFAULT);
// Experimental support for GL based image processing. On some architectures,
// the hardware accelerated video decoder outputs frames in a format not
// understood by the display controller. We usually use LibYUV to convert these
@ -1284,8 +1317,9 @@ BASE_FEATURE(kIncludeIRCamerasInDeviceEnumeration,
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables software rate controller encoding acceleration for Windows.
const base::Feature MEDIA_EXPORT kMediaFoundationUseSoftwareRateCtrl{
"MediaFoundationUseSoftwareRateCtrl", base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kMediaFoundationUseSoftwareRateCtrl,
"MediaFoundationUseSoftwareRateCtrl",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables MediaFoundation based video capture
BASE_FEATURE(kMediaFoundationVideoCapture,
@ -1305,8 +1339,9 @@ BASE_FEATURE(kMediaFoundationD3D11VideoCaptureZeroCopy,
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables VP8 decode acceleration for Windows.
const base::Feature MEDIA_EXPORT kMediaFoundationVP8Decoding{
"MediaFoundationVP8Decoding", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kMediaFoundationVP8Decoding,
"MediaFoundationVP8Decoding",
base::FEATURE_DISABLED_BY_DEFAULT);
// Enables the use of MediaFoundationRenderer for clear content on supported
// systems.
@ -1385,29 +1420,30 @@ BASE_FEATURE(kAllowClearDolbyVisionInMseWhenPlatformEncryptedDvEnabled,
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Expose the out-of-process video decoding feature from ash-chrome to
// lacros-chrome through the crosapi.
const base::Feature MEDIA_EXPORT kExposeOutOfProcessVideoDecodingToLacros{
"ExposeOutOfProcessVideoDecodingToLacros",
base::FEATURE_ENABLED_BY_DEFAULT};
BASE_FEATURE(kExposeOutOfProcessVideoDecodingToLacros,
"ExposeOutOfProcessVideoDecodingToLacros",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ALLOW_OOP_VIDEO_DECODER)
// Spawn utility processes to perform hardware decode acceleration instead of
// using the GPU process.
const base::Feature MEDIA_EXPORT kUseOutOfProcessVideoDecoding{
"UseOutOfProcessVideoDecoding",
BASE_FEATURE(kUseOutOfProcessVideoDecoding,
"UseOutOfProcessVideoDecoding",
#if BUILDFLAG(IS_CHROMEOS_LACROS)
base::FEATURE_ENABLED_BY_DEFAULT
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
);
#endif // BUILDFLAG(ALLOW_OOP_VIDEO_DECODER)
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
// Spawn utility processes to perform hardware encode acceleration instead of
// using the GPU process.
const base::Feature MEDIA_EXPORT kUseOutOfProcessVideoEncoding{
"UseOutOfProcessVideoEncoding", base::FEATURE_DISABLED_BY_DEFAULT};
BASE_FEATURE(kUseOutOfProcessVideoEncoding,
"UseOutOfProcessVideoEncoding",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
// Use SequencedTaskRunner for MediaService.
@ -1492,21 +1528,22 @@ BASE_FEATURE(kRecordWebAudioEngagement,
// - PreloadMediaEngagementData: enables a list of origins to be considered as
// having a high MEI until there is enough local data to determine the user's
// preferred behaviour.
BASE_FEATURE(kMediaEngagementBypassAutoplayPolicies,
"MediaEngagementBypassAutoplayPolicies",
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
BASE_FEATURE(kMediaEngagementBypassAutoplayPolicies,
"MediaEngagementBypassAutoplayPolicies",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kPreloadMediaEngagementData,
"PreloadMediaEngagementData",
base::FEATURE_DISABLED_BY_DEFAULT);
base::FEATURE_DISABLED_BY_DEFAULT
#else
BASE_FEATURE(kMediaEngagementBypassAutoplayPolicies,
"MediaEngagementBypassAutoplayPolicies",
base::FEATURE_ENABLED_BY_DEFAULT);
base::FEATURE_ENABLED_BY_DEFAULT
#endif
);
BASE_FEATURE(kPreloadMediaEngagementData,
"PreloadMediaEngagementData",
base::FEATURE_ENABLED_BY_DEFAULT);
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS)
base::FEATURE_DISABLED_BY_DEFAULT
#else
base::FEATURE_ENABLED_BY_DEFAULT
#endif
);
BASE_FEATURE(kMediaEngagementHTTPSOnly,
"MediaEngagementHTTPSOnly",
@ -1596,6 +1633,13 @@ BASE_FEATURE(kCameraMicEffects,
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) &&
// !BUILDFLAG(IS_FUCHSIA)
// Controls whether system loopback audio can be Cast to audio-only Cast
// receivers, e.g. speakers.
// TODO(crbug.com/849335): Remove once launched.
BASE_FEATURE(kCastLoopbackAudioToAudioReceivers,
"CastLoopbackAudioToAudioReceivers",
base::FEATURE_ENABLED_BY_DEFAULT);
// Controls whether mirroring negotiations will include the AV1 codec for video
// encoding.
//
@ -1644,22 +1688,36 @@ BASE_FEATURE(kUseWindowBoundsForPip,
"UseWindowBoundsForPip",
base::FEATURE_ENABLED_BY_DEFAULT);
// Use SharedImages instead of legacy mailboxes to copy VideoFrames to for
// pepper video decode.
BASE_FEATURE(kUseSharedImagesForPepperVideo,
"UseSharedImagesForPepperVideo",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables FFmpeg allow lists for supported codecs / containers.
BASE_FEATURE(kFFmpegAllowLists,
"FFmpegAllowLists",
base::FEATURE_ENABLED_BY_DEFAULT);
// Enables sending MediaLog to the log stream, which is useful for easier
// development by ensuring logs can be seen without a remote desktop session.
// Only affects builds when DCHECK is on for non-ERROR logs (ERROR logs are
// always sent to the log stream). Enabled by default on Android and ChromeOS.
BASE_FEATURE(kMediaLogToConsole,
"MediaLogToConsole",
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_CHROMEOS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
BASE_FEATURE(kLibvpxUseChromeThreads,
"LibvpxUseChromeThreads",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kLibaomUseChromeThreads,
"LibaomUseChromeThreads",
base::FEATURE_DISABLED_BY_DEFAULT);
#if BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
// Allows decoding of theora / vp3 content.
BASE_FEATURE(kTheoraVideoCodec,
"TheoraVideoCodec",
base::FEATURE_ENABLED_BY_DEFAULT);
base::FEATURE_DISABLED_BY_DEFAULT);
#if BUILDFLAG(IS_CHROMEOS)
// Allows demuxing of AVI and decoding of MPEG4 streams. These should not be

View file

@ -62,8 +62,9 @@ LOAD_FLAG(BYPASS_PROXY, 1 << 7)
// page is loaded.
LOAD_FLAG(MAIN_FRAME_DEPRECATED, 1 << 8)
// Indicates that this load was motivated by the rel=prefetch feature,
// and is (in theory) not intended for the current frame.
// Indicates that this load was motivated by the rel=prefetch feature, or the
// speculationrules prefetch feature, and is (in theory) not intended for the
// current frame.
LOAD_FLAG(PREFETCH, 1 << 9)
// Indicates that this load could cause deadlock if it has to wait for another
@ -116,7 +117,7 @@ LOAD_FLAG(DISABLE_SHARED_DICTIONARY_AFTER_CROSS_ORIGIN_REDIRECT, 1 << 18)
LOAD_FLAG(SHOULD_BYPASS_HSTS, 1 << 19)
// This load will not send Accept-Language or User-Agent headers, and not
// advertise brotli encoding.
// advertise brotli or zstd encoding.
// Used to comply with IETF (draft) DNS-over-HTTPS:
// "Implementors SHOULD NOT set non-essential HTTP headers in DoH client requests."
LOAD_FLAG(MINIMAL_HEADERS, 1 << 20)

View file

@ -5,6 +5,7 @@
#include "net/dns/dns_client.h"
#include <memory>
#include <optional>
#include <string>
#include <utility>
@ -34,7 +35,7 @@ namespace net {
namespace {
bool IsEqual(const absl::optional<DnsConfig>& c1, const DnsConfig* c2) {
bool IsEqual(const std::optional<DnsConfig>& c1, const DnsConfig* c2) {
if (!c1.has_value() && c2 == nullptr)
return true;
@ -133,7 +134,7 @@ class DnsClientImpl : public DnsClient {
insecure_fallback_failures_ >= kMaxInsecureFallbackFailures;
}
bool SetSystemConfig(absl::optional<DnsConfig> system_config) override {
bool SetSystemConfig(std::optional<DnsConfig> system_config) override {
if (system_config == system_config_)
return false;
@ -176,11 +177,11 @@ class DnsClientImpl : public DnsClient {
return &config->hosts;
}
absl::optional<std::vector<IPEndPoint>> GetPresetAddrs(
std::optional<std::vector<IPEndPoint>> GetPresetAddrs(
const url::SchemeHostPort& endpoint) const override {
DCHECK(endpoint.IsValid());
if (!session_)
return absl::nullopt;
return std::nullopt;
const auto& servers = session_->config().doh_config.servers();
auto it = base::ranges::find_if(servers, [&](const auto& server) {
std::string uri;
@ -191,7 +192,7 @@ class DnsClientImpl : public DnsClient {
return url::SchemeHostPort(gurl) == endpoint;
});
if (it == servers.end())
return absl::nullopt;
return std::nullopt;
std::vector<IPEndPoint> combined;
for (const IPAddressList& ips : it->endpoints()) {
for (const IPAddress& ip : ips) {
@ -226,7 +227,7 @@ class DnsClientImpl : public DnsClient {
return dict;
}
absl::optional<DnsConfig> GetSystemConfigForTesting() const override {
std::optional<DnsConfig> GetSystemConfigForTesting() const override {
return system_config_;
}
@ -240,7 +241,7 @@ class DnsClientImpl : public DnsClient {
}
private:
absl::optional<DnsConfig> BuildEffectiveConfig() const {
std::optional<DnsConfig> BuildEffectiveConfig() const {
DnsConfig config;
// in Bromite it is sufficient to have secure DoH enabled to give the overrides priority
if (config_overrides_.dns_over_https_config && config_overrides_.secure_dns_mode) {
@ -248,7 +249,7 @@ class DnsClientImpl : public DnsClient {
} else {
if (!system_config_) {
LOG(WARNING) << "BuildEffectiveConfig(): no system configuration";
return absl::nullopt;
return std::nullopt;
}
config = config_overrides_.ApplyOverrides(system_config_.value());
@ -266,14 +267,14 @@ class DnsClientImpl : public DnsClient {
if (!config.IsValid()) {
LOG(WARNING) << "BuildEffectiveConfig(): invalid configuration";
return absl::nullopt;
return std::nullopt;
}
return config;
}
bool UpdateDnsConfig() {
absl::optional<DnsConfig> new_effective_config = BuildEffectiveConfig();
std::optional<DnsConfig> new_effective_config = BuildEffectiveConfig();
if (IsEqual(new_effective_config, GetEffectiveConfig()))
return false;
@ -290,7 +291,7 @@ class DnsClientImpl : public DnsClient {
return true;
}
void UpdateSession(absl::optional<DnsConfig> new_effective_config) {
void UpdateSession(std::optional<DnsConfig> new_effective_config) {
factory_.reset();
session_ = nullptr;
@ -308,7 +309,7 @@ class DnsClientImpl : public DnsClient {
bool can_query_additional_types_via_insecure_ = false;
int insecure_fallback_failures_ = 0;
absl::optional<DnsConfig> system_config_;
std::optional<DnsConfig> system_config_;
DnsConfigOverrides config_overrides_;
scoped_refptr<DnsSession> session_;

View file

@ -6,6 +6,7 @@
#include <cstdint>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <unordered_map>
@ -79,7 +80,6 @@
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/url_constants.h"
namespace net {
@ -426,7 +426,7 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
if (is_probe) {
return NetLogStartParams("(probe)", query_->qtype());
}
absl::optional<std::string> hostname =
std::optional<std::string> hostname =
dns_names_util::NetworkToDottedName(query_->qname());
DCHECK(hostname.has_value());
return NetLogStartParams(*hostname, query_->qtype());
@ -986,7 +986,7 @@ class DnsOverHttpsProbeRunner : public DnsProbeRunner {
DCHECK(!session_->config().doh_config.servers().empty());
DCHECK(context_);
absl::optional<std::vector<uint8_t>> qname =
std::optional<std::vector<uint8_t>> qname =
dns_names_util::DottedNameToNetwork(kDohProbeHostname);
DCHECK(qname.has_value());
formatted_probe_qname_ = std::move(qname).value();
@ -1269,7 +1269,7 @@ class DnsTransactionImpl : public DnsTransaction,
int PrepareSearch() {
const DnsConfig& config = session_->config();
absl::optional<std::vector<uint8_t>> labeled_qname =
std::optional<std::vector<uint8_t>> labeled_qname =
dns_names_util::DottedNameToNetwork(
hostname_,
/*require_valid_internet_hostname=*/true);
@ -1298,7 +1298,7 @@ class DnsTransactionImpl : public DnsTransaction,
}
for (const auto& suffix : config.search) {
absl::optional<std::vector<uint8_t>> qname =
std::optional<std::vector<uint8_t>> qname =
dns_names_util::DottedNameToNetwork(
hostname_ + "." + suffix,
/*require_valid_internet_hostname=*/true);
@ -1522,7 +1522,7 @@ class DnsTransactionImpl : public DnsTransaction,
// Begins query for the current name. Makes the first attempt.
AttemptResult StartQuery() {
absl::optional<std::string> dotted_qname =
std::optional<std::string> dotted_qname =
dns_names_util::NetworkToDottedName(qnames_.front());
net_log_.BeginEventWithStringParams(
NetLogEventType::DNS_TRANSACTION_QUERY, "qname",

View file

@ -106,6 +106,20 @@
namespace {
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class TpcdHeaderStatus {
kSet = 0,
kNoLabel = 1,
kNoCookie = 2,
kMaxValue = kNoCookie,
};
void RecordTpcdHeaderStatus(TpcdHeaderStatus status) {
base::UmaHistogramEnumeration("Privacy.3PCD.SecCookieDeprecationHeaderStatus",
status);
}
base::Value::Dict FirstPartySetMetadataNetLogParams(
const net::FirstPartySetMetadata& first_party_set_metadata,
const int64_t* const fps_cache_filter) {
@ -771,6 +785,14 @@ void URLRequestHttpJob::SetCookieHeaderAndStart(
AnnotateAndMoveUserBlockedCookies(maybe_included_cookies, excluded_cookies);
}
const bool cookie_deprecation_testing_enabled =
request_->context()->cookie_deprecation_label().has_value();
const bool cookie_deprecation_testing_has_label =
cookie_deprecation_testing_enabled &&
!request_->context()->cookie_deprecation_label().value().empty();
bool may_set_sec_cookie_deprecation_header =
cookie_deprecation_testing_has_label;
if (!maybe_included_cookies.empty()) {
std::string cookie_line =
CanonicalCookie::BuildCookieLine(maybe_included_cookies);
@ -778,8 +800,6 @@ void URLRequestHttpJob::SetCookieHeaderAndStart(
cookie_line);
size_t n_partitioned_cookies = 0;
bool may_set_sec_cookie_deprecation_header =
!request_->context()->cookie_deprecation_label().value_or("").empty();
// TODO(crbug.com/1031664): Reduce the number of times the cookie list
// is iterated over. Get metrics for every cookie which is included.
@ -829,6 +849,15 @@ void URLRequestHttpJob::SetCookieHeaderAndStart(
n_partitioned_cookies);
}
}
if (cookie_deprecation_testing_enabled) {
if (!cookie_deprecation_testing_has_label) {
RecordTpcdHeaderStatus(TpcdHeaderStatus::kNoLabel);
} else if (may_set_sec_cookie_deprecation_header) {
RecordTpcdHeaderStatus(TpcdHeaderStatus::kNoCookie);
} else {
RecordTpcdHeaderStatus(TpcdHeaderStatus::kSet);
}
}
CookieAccessResultList maybe_sent_cookies = std::move(excluded_cookies);
maybe_sent_cookies.insert(
@ -1713,6 +1742,46 @@ void URLRequestHttpJob::RecordCompletionHistograms(CompletionCause reason) {
UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeCancel", total_time);
}
// These metrics are intended to replace some of the later IP
// Protection-focused metrics below which require response_info_. These
// metrics are only concerned with data that actually hits or perhaps should
// have hit the network.
//
// We count towards these metrics even if the job has been aborted. Jobs
// aborted before an end-to-end connection is established will have both
// sent and received equal to zero.
//
// In addition, we don't want to ignore jobs where response_info_->was_cached
// is true but the network was used to trigger cache usage as part of a 304
// Not Modified response. However, cache hits which bypass the network
// entirely should not be counted.
//
// GetTotalReceivedBytes measures HTTP stream bytes, which is more
// comprehensive than PrefilterBytesRead, which measures (possibly compressed)
// content's length only.
const bool bypassedNetwork = response_info_ && response_info_->was_cached &&
!response_info_->network_accessed &&
GetTotalSentBytes() == 0 &&
GetTotalReceivedBytes() == 0;
if (!bypassedNetwork) {
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.BytesSent2", GetTotalSentBytes(),
1, 50000000, 50);
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.BytesReceived2",
GetTotalReceivedBytes(), 1, 50000000, 50);
// Having a transaction_ does not imply having a response_info_. This is
// particularly the case in some aborted/cancelled jobs. The transaction is
// the primary source of MDL match information.
if ((transaction_ && transaction_->IsMdlMatchForMetrics()) ||
(response_info_ && response_info_->was_mdl_match)) {
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Net.HttpJob.IpProtection.AllowListMatch.BytesSent2",
GetTotalSentBytes(), 1, 50000000, 50);
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Net.HttpJob.IpProtection.AllowListMatch.BytesReceived2",
GetTotalReceivedBytes(), 1, 50000000, 50);
}
}
if (response_info_) {
// QUIC (by default) supports https scheme only, thus track https URLs only
// for QUIC.

View file

@ -46,7 +46,6 @@
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/screensaver.h"
#include "ui/gfx/x/shm.h"
#include "ui/gfx/x/visual_manager.h"
#include "ui/gfx/x/xproto.h"
#if BUILDFLAG(IS_FREEBSD)
@ -577,44 +576,6 @@ bool SuspendX11ScreenSaver(bool suspend) {
return true;
}
gfx::ICCProfile GetICCProfileForMonitor(int monitor) {
gfx::ICCProfile icc_profile;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless)) {
return icc_profile;
}
std::string atom_name = monitor == 0
? "_ICC_PROFILE"
: base::StringPrintf("_ICC_PROFILE_%d", monitor);
scoped_refptr<base::RefCountedMemory> data;
if (GetRawBytesOfProperty(GetX11RootWindow(), x11::GetAtom(atom_name.c_str()),
&data, nullptr)) {
icc_profile = gfx::ICCProfile::FromData(data->data(), data->size());
}
return icc_profile;
}
bool IsSyncExtensionAvailable() {
// Chrome for ChromeOS can be run with X11 on a Linux desktop. In this case,
// NotifySwapAfterResize is never called as the compositor does not notify about
// swaps after resize. Thus, simply disable usage of XSyncCounter on ChromeOS
// builds.
//
// TODO(https://crbug.com/1036285): Also, disable sync extension for all ozone
// builds as long as our EGL impl for Ozone/X11 is not mature enough and we do
// not receive swap completions on time, which results in weird resize behaviour
// as X Server waits for the XSyncCounter changes.
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_OZONE)
return false;
#else
static bool result =
x11::Connection::Get()
->sync()
.Initialize({x11::Sync::major_version, x11::Sync::minor_version})
.Sync();
return result;
#endif
}
SkColorType ColorTypeForVisual(x11::VisualId visual) {
struct {
SkColorType color_type;
@ -681,19 +642,6 @@ bool IsVulkanSurfaceSupported() {
return false;
}
bool DoesVisualHaveAlphaForTest() {
uint8_t depth = 0;
bool visual_has_alpha = false;
x11::Connection::Get()->GetOrCreateVisualManager().ChooseVisualForWindow(
true, nullptr, &depth, nullptr, &visual_has_alpha);
if (visual_has_alpha) {
DCHECK_EQ(32, depth);
}
return visual_has_alpha;
}
gfx::ImageSkia GetNativeWindowIcon(intptr_t target_window_id) {
std::vector<uint32_t> data;
if (!x11::Connection::Get()->GetArrayProperty(

View file

@ -1,660 +0,0 @@
// Copyright 2024 the V8 project authors and Alex313031. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_INTL_SUPPORT
#error Internationalization is expected to be enabled.
#endif // V8_INTL_SUPPORT
#include "src/objects/js-display-names.h"
#include <memory>
#include <vector>
#include "src/execution/isolate.h"
#include "src/heap/factory.h"
#include "src/objects/intl-objects.h"
#include "src/objects/js-display-names-inl.h"
#include "src/objects/managed-inl.h"
#include "src/objects/objects-inl.h"
#include "src/objects/option-utils.h"
#include "unicode/dtfmtsym.h"
#include "unicode/dtptngen.h"
#include "unicode/localebuilder.h"
#include "unicode/locdspnm.h"
#include "unicode/measfmt.h"
#include "unicode/timezone.h"
#include "unicode/tznames.h"
#include "unicode/uloc.h"
#include "unicode/unistr.h"
#include "unicode/uscript.h"
namespace v8 {
namespace internal {
namespace {
// Type: identifying the types of the display names.
//
// ecma402/#sec-properties-of-intl-displaynames-instances
enum class Type {
kUndefined,
kLanguage,
kRegion,
kScript,
kCurrency,
kCalendar,
kDateTimeField
};
bool IsUnicodeScriptSubtag(const std::string& value) {
UErrorCode status = U_ZERO_ERROR;
icu::LocaleBuilder builder;
builder.setScript(value).build(status);
return U_SUCCESS(status);
}
bool IsUnicodeRegionSubtag(const std::string& value) {
UErrorCode status = U_ZERO_ERROR;
icu::LocaleBuilder builder;
builder.setRegion(value).build(status);
return U_SUCCESS(status);
}
UDisplayContext ToUDisplayContext(JSDisplayNames::Style style) {
switch (style) {
case JSDisplayNames::Style::kLong:
return UDISPCTX_LENGTH_FULL;
case JSDisplayNames::Style::kShort:
case JSDisplayNames::Style::kNarrow:
return UDISPCTX_LENGTH_SHORT;
}
}
} // anonymous namespace
// Abstract class for all different types.
class DisplayNamesInternal {
public:
DisplayNamesInternal() = default;
virtual ~DisplayNamesInternal() = default;
virtual const char* type() const = 0;
virtual icu::Locale locale() const = 0;
virtual Maybe<icu::UnicodeString> of(Isolate* isolate,
const char* code) const = 0;
};
namespace {
class LocaleDisplayNamesCommon : public DisplayNamesInternal {
public:
LocaleDisplayNamesCommon(const icu::Locale& locale,
JSDisplayNames::Style style, bool fallback,
bool dialect)
: style_(style) {
UDisplayContext sub =
fallback ? UDISPCTX_SUBSTITUTE : UDISPCTX_NO_SUBSTITUTE;
UDisplayContext dialect_context =
dialect ? UDISPCTX_DIALECT_NAMES : UDISPCTX_STANDARD_NAMES;
UDisplayContext display_context[] = {ToUDisplayContext(style_),
dialect_context,
UDISPCTX_CAPITALIZATION_NONE, sub};
ldn_.reset(
icu::LocaleDisplayNames::createInstance(locale, display_context, 4));
}
~LocaleDisplayNamesCommon() override = default;
icu::Locale locale() const override { return ldn_->getLocale(); }
protected:
icu::LocaleDisplayNames* locale_display_names() const { return ldn_.get(); }
private:
std::unique_ptr<icu::LocaleDisplayNames> ldn_;
JSDisplayNames::Style style_;
};
class LanguageNames : public LocaleDisplayNamesCommon {
public:
LanguageNames(const icu::Locale& locale, JSDisplayNames::Style style,
bool fallback, bool dialect)
: LocaleDisplayNamesCommon(locale, style, fallback, dialect) {}
~LanguageNames() override = default;
const char* type() const override { return "language"; }
Maybe<icu::UnicodeString> of(Isolate* isolate,
const char* code) const override {
UErrorCode status = U_ZERO_ERROR;
// 1.a If code does not match the unicode_language_id production, throw a
// RangeError exception.
// 1.b If IsStructurallyValidLanguageTag(code) is false, throw a RangeError
// exception.
icu::Locale l =
icu::Locale::createCanonical(icu::Locale::forLanguageTag(code, status).getBaseName());
std::string checked = l.toLanguageTag<std::string>(status);
if (U_FAILURE(status)) {
THROW_NEW_ERROR_RETURN_VALUE(
isolate, NewRangeError(MessageTemplate::kInvalidArgument),
Nothing<icu::UnicodeString>());
}
icu::UnicodeString result;
locale_display_names()->localeDisplayName(checked.c_str(), result);
return Just(result);
}
};
class RegionNames : public LocaleDisplayNamesCommon {
public:
RegionNames(const icu::Locale& locale, JSDisplayNames::Style style,
bool fallback, bool dialect)
: LocaleDisplayNamesCommon(locale, style, fallback, dialect) {}
~RegionNames() override = default;
const char* type() const override { return "region"; }
Maybe<icu::UnicodeString> of(Isolate* isolate,
const char* code) const override {
std::string code_str(code);
if (!IsUnicodeRegionSubtag(code_str)) {
THROW_NEW_ERROR_RETURN_VALUE(
isolate, NewRangeError(MessageTemplate::kInvalidArgument),
Nothing<icu::UnicodeString>());
}
icu::UnicodeString result;
locale_display_names()->regionDisplayName(code_str.c_str(), result);
return Just(result);
}
};
class ScriptNames : public LocaleDisplayNamesCommon {
public:
ScriptNames(const icu::Locale& locale, JSDisplayNames::Style style,
bool fallback, bool dialect)
: LocaleDisplayNamesCommon(locale, style, fallback, dialect) {}
~ScriptNames() override = default;
const char* type() const override { return "script"; }
Maybe<icu::UnicodeString> of(Isolate* isolate,
const char* code) const override {
std::string code_str(code);
if (!IsUnicodeScriptSubtag(code_str)) {
THROW_NEW_ERROR_RETURN_VALUE(
isolate, NewRangeError(MessageTemplate::kInvalidArgument),
Nothing<icu::UnicodeString>());
}
icu::UnicodeString result;
locale_display_names()->scriptDisplayName(code_str.c_str(), result);
return Just(result);
}
};
class KeyValueDisplayNames : public LocaleDisplayNamesCommon {
public:
KeyValueDisplayNames(const icu::Locale& locale, JSDisplayNames::Style style,
bool fallback, bool dialect, const char* key,
bool prevent_fallback)
: LocaleDisplayNamesCommon(locale, style, fallback, dialect),
key_(key),
prevent_fallback_(prevent_fallback) {}
~KeyValueDisplayNames() override = default;
const char* type() const override { return key_.c_str(); }
Maybe<icu::UnicodeString> of(Isolate* isolate,
const char* code) const override {
std::string code_str(code);
icu::UnicodeString result;
locale_display_names()->keyValueDisplayName(key_.c_str(), code_str.c_str(),
result);
// Work around the issue that the keyValueDisplayNames ignore no
// substituion and always fallback.
if (prevent_fallback_ && (result.length() == 3) &&
(code_str.length() == 3) &&
(result == icu::UnicodeString(code_str.c_str(), -1, US_INV))) {
result.setToBogus();
}
return Just(result);
}
private:
std::string key_;
bool prevent_fallback_;
};
class CurrencyNames : public KeyValueDisplayNames {
public:
CurrencyNames(const icu::Locale& locale, JSDisplayNames::Style style,
bool fallback, bool dialect)
: KeyValueDisplayNames(locale, style, fallback, dialect, "currency",
fallback == false) {}
~CurrencyNames() override = default;
Maybe<icu::UnicodeString> of(Isolate* isolate,
const char* code) const override {
std::string code_str(code);
if (!Intl::IsWellFormedCurrency(code_str)) {
THROW_NEW_ERROR_RETURN_VALUE(
isolate, NewRangeError(MessageTemplate::kInvalidArgument),
Nothing<icu::UnicodeString>());
}
return KeyValueDisplayNames::of(isolate, code);
}
};
class CalendarNames : public KeyValueDisplayNames {
public:
CalendarNames(const icu::Locale& locale, JSDisplayNames::Style style,
bool fallback, bool dialect)
: KeyValueDisplayNames(locale, style, fallback, dialect, "calendar",
false) {}
~CalendarNames() override = default;
Maybe<icu::UnicodeString> of(Isolate* isolate,
const char* code) const override {
std::string code_str(code);
if (!Intl::IsWellFormedCalendar(code_str)) {
THROW_NEW_ERROR_RETURN_VALUE(
isolate, NewRangeError(MessageTemplate::kInvalidArgument),
Nothing<icu::UnicodeString>());
}
return KeyValueDisplayNames::of(isolate, strcmp(code, "gregory") == 0
? "gregorian"
: strcmp(code, "ethioaa") == 0
? "ethiopic-amete-alem"
: code);
}
};
UDateTimePGDisplayWidth StyleToUDateTimePGDisplayWidth(
JSDisplayNames::Style style) {
switch (style) {
case JSDisplayNames::Style::kLong:
return UDATPG_WIDE;
case JSDisplayNames::Style::kShort:
return UDATPG_ABBREVIATED;
case JSDisplayNames::Style::kNarrow:
return UDATPG_NARROW;
}
}
UDateTimePatternField StringToUDateTimePatternField(const char* code) {
switch (code[0]) {
case 'd':
if (strcmp(code, "day") == 0) return UDATPG_DAY_FIELD;
if (strcmp(code, "dayPeriod") == 0) return UDATPG_DAYPERIOD_FIELD;
break;
case 'e':
if (strcmp(code, "era") == 0) return UDATPG_ERA_FIELD;
break;
case 'h':
if (strcmp(code, "hour") == 0) return UDATPG_HOUR_FIELD;
break;
case 'm':
if (strcmp(code, "minute") == 0) return UDATPG_MINUTE_FIELD;
if (strcmp(code, "month") == 0) return UDATPG_MONTH_FIELD;
break;
case 'q':
if (strcmp(code, "quarter") == 0) return UDATPG_QUARTER_FIELD;
break;
case 's':
if (strcmp(code, "second") == 0) return UDATPG_SECOND_FIELD;
break;
case 't':
if (strcmp(code, "timeZoneName") == 0) return UDATPG_ZONE_FIELD;
break;
case 'w':
if (strcmp(code, "weekOfYear") == 0) return UDATPG_WEEK_OF_YEAR_FIELD;
if (strcmp(code, "weekday") == 0) return UDATPG_WEEKDAY_FIELD;
break;
case 'y':
if (strcmp(code, "year") == 0) return UDATPG_YEAR_FIELD;
break;
default:
break;
}
return UDATPG_FIELD_COUNT;
}
class DateTimeFieldNames : public DisplayNamesInternal {
public:
DateTimeFieldNames(const icu::Locale& locale, JSDisplayNames::Style style,
bool fallback)
: locale_(locale), width_(StyleToUDateTimePGDisplayWidth(style)) {
UErrorCode status = U_ZERO_ERROR;
generator_.reset(
icu::DateTimePatternGenerator::createInstance(locale_, status));
DCHECK(U_SUCCESS(status));
}
~DateTimeFieldNames() override = default;
const char* type() const override { return "dateTimeField"; }
icu::Locale locale() const override { return locale_; }
Maybe<icu::UnicodeString> of(Isolate* isolate,
const char* code) const override {
UDateTimePatternField field = StringToUDateTimePatternField(code);
if (field == UDATPG_FIELD_COUNT) {
THROW_NEW_ERROR_RETURN_VALUE(
isolate, NewRangeError(MessageTemplate::kInvalidArgument),
Nothing<icu::UnicodeString>());
}
return Just(generator_->getFieldDisplayName(field, width_));
}
private:
icu::Locale locale_;
UDateTimePGDisplayWidth width_;
std::unique_ptr<icu::DateTimePatternGenerator> generator_;
};
DisplayNamesInternal* CreateInternal(const icu::Locale& locale,
JSDisplayNames::Style style, Type type,
bool fallback, bool dialect) {
switch (type) {
case Type::kLanguage:
return new LanguageNames(locale, style, fallback, dialect);
case Type::kRegion:
return new RegionNames(locale, style, fallback, false);
case Type::kScript:
return new ScriptNames(locale, style, fallback, false);
case Type::kCurrency:
return new CurrencyNames(locale, style, fallback, false);
case Type::kCalendar:
return new CalendarNames(locale, style, fallback, false);
case Type::kDateTimeField:
return new DateTimeFieldNames(locale, style, fallback);
default:
UNREACHABLE();
}
}
} // anonymous namespace
// ecma402 #sec-Intl.DisplayNames
MaybeHandle<JSDisplayNames> JSDisplayNames::New(Isolate* isolate,
Handle<Map> map,
Handle<Object> locales,
Handle<Object> input_options) {
const char* service = "Intl.DisplayNames";
Factory* factory = isolate->factory();
Handle<JSReceiver> options;
// 3. Let requestedLocales be ? CanonicalizeLocaleList(locales).
Maybe<std::vector<std::string>> maybe_requested_locales =
Intl::CanonicalizeLocaleList(isolate, locales);
MAYBE_RETURN(maybe_requested_locales, Handle<JSDisplayNames>());
std::vector<std::string> requested_locales =
maybe_requested_locales.FromJust();
// 4. Let options be ? GetOptionsObject(options).
ASSIGN_RETURN_ON_EXCEPTION(isolate, options,
GetOptionsObject(isolate, input_options, service),
JSDisplayNames);
// Note: No need to create a record. It's not observable.
// 5. Let opt be a new Record.
// 6. Let localeData be %DisplayNames%.[[LocaleData]].
// 7. Let matcher be ? GetOption(options, "localeMatcher", "string", «
// "lookup", "best fit" », "best fit").
Maybe<Intl::MatcherOption> maybe_locale_matcher =
Intl::GetLocaleMatcher(isolate, options, service);
MAYBE_RETURN(maybe_locale_matcher, MaybeHandle<JSDisplayNames>());
// 8. Set opt.[[localeMatcher]] to matcher.
Intl::MatcherOption matcher = maybe_locale_matcher.FromJust();
// ecma402/#sec-Intl.DisplayNames-internal-slots
// The value of the [[RelevantExtensionKeys]] internal slot is
// « ».
std::set<std::string> relevant_extension_keys = {};
// 9. Let r be ResolveLocale(%DisplayNames%.[[AvailableLocales]],
// requestedLocales, opt, %DisplayNames%.[[RelevantExtensionKeys]]).
Maybe<Intl::ResolvedLocale> maybe_resolve_locale =
Intl::ResolveLocale(isolate, JSDisplayNames::GetAvailableLocales(),
requested_locales, matcher, relevant_extension_keys);
if (maybe_resolve_locale.IsNothing()) {
THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kIcuError),
JSDisplayNames);
}
Intl::ResolvedLocale r = maybe_resolve_locale.FromJust();
icu::Locale icu_locale = r.icu_locale;
// 10. Let s be ? GetOption(options, "style", "string",
// «"long", "short", "narrow"», "long").
Maybe<Style> maybe_style = GetStringOption<Style>(
isolate, options, "style", service, {"long", "short", "narrow"},
{Style::kLong, Style::kShort, Style::kNarrow}, Style::kLong);
MAYBE_RETURN(maybe_style, MaybeHandle<JSDisplayNames>());
Style style_enum = maybe_style.FromJust();
// 11. Set displayNames.[[Style]] to style.
// 12. Let type be ? GetOption(options, "type", "string", « "language",
// "region", "script", "currency" , "calendar", "dateTimeField", "unit"»,
// undefined).
Maybe<Type> maybe_type = GetStringOption<Type>(
isolate, options, "type", service,
{"language", "region", "script", "currency", "calendar", "dateTimeField"},
{Type::kLanguage, Type::kRegion, Type::kScript, Type::kCurrency,
Type::kCalendar, Type::kDateTimeField},
Type::kUndefined);
MAYBE_RETURN(maybe_type, MaybeHandle<JSDisplayNames>());
Type type_enum = maybe_type.FromJust();
// 13. If type is undefined, throw a TypeError exception.
if (type_enum == Type::kUndefined) {
THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kInvalidArgument),
JSDisplayNames);
}
// 14. Set displayNames.[[Type]] to type.
// 15. Let fallback be ? GetOption(options, "fallback", "string",
// « "code", "none" », "code").
Maybe<Fallback> maybe_fallback = GetStringOption<Fallback>(
isolate, options, "fallback", service, {"code", "none"},
{Fallback::kCode, Fallback::kNone}, Fallback::kCode);
MAYBE_RETURN(maybe_fallback, MaybeHandle<JSDisplayNames>());
Fallback fallback_enum = maybe_fallback.FromJust();
// 16. Set displayNames.[[Fallback]] to fallback.
LanguageDisplay language_display_enum = LanguageDisplay::kDialect;
// 24. Let languageDisplay be ? GetOption(options, "languageDisplay",
// "string", « "dialect", "standard" », "dialect").
Maybe<LanguageDisplay> maybe_language_display =
GetStringOption<LanguageDisplay>(
isolate, options, "languageDisplay", service, {"dialect", "standard"},
{LanguageDisplay::kDialect, LanguageDisplay::kStandard},
LanguageDisplay::kDialect);
MAYBE_RETURN(maybe_language_display, MaybeHandle<JSDisplayNames>());
// 25. If type is "language", then
if (type_enum == Type::kLanguage) {
// a. Set displayNames.[[LanguageDisplay]] to languageDisplay.
language_display_enum = maybe_language_display.FromJust();
}
// Set displayNames.[[Fallback]] to fallback.
// 17. Set displayNames.[[Locale]] to the value of r.[[Locale]].
// Let dataLocale be r.[[dataLocale]].
// Let dataLocaleData be localeData.[[<dataLocale>]].
// Let types be dataLocaleData.[[types]].
// Assert: types is a Record (see 1.3.3).
// Let typeFields be types.[[<type>]].
// Assert: typeFields is a Record (see 1.3.3).
// Let styleFields be typeFields.[[<style>]].
// Assert: styleFields is a Record (see 1.3.3).
// Set displayNames.[[Fields]] to styleFields.
DisplayNamesInternal* internal = CreateInternal(
icu_locale, style_enum, type_enum, fallback_enum == Fallback::kCode,
language_display_enum == LanguageDisplay::kDialect);
if (internal == nullptr) {
THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIcuError),
JSDisplayNames);
}
Handle<Managed<DisplayNamesInternal>> managed_internal =
Managed<DisplayNamesInternal>::FromRawPtr(isolate, 0, internal);
Handle<JSDisplayNames> display_names =
Handle<JSDisplayNames>::cast(factory->NewFastOrSlowJSObjectFromMap(map));
display_names->set_flags(0);
display_names->set_style(style_enum);
display_names->set_fallback(fallback_enum);
display_names->set_language_display(language_display_enum);
DisallowGarbageCollection no_gc;
display_names->set_internal(*managed_internal);
// Return displayNames.
return display_names;
}
// ecma402 #sec-Intl.DisplayNames.prototype.resolvedOptions
Handle<JSObject> JSDisplayNames::ResolvedOptions(
Isolate* isolate, Handle<JSDisplayNames> display_names) {
Factory* factory = isolate->factory();
// 4. Let options be ! ObjectCreate(%ObjectPrototype%).
Handle<JSObject> options = factory->NewJSObject(isolate->object_function());
DisplayNamesInternal* internal = display_names->internal()->raw();
Maybe<std::string> maybe_locale = Intl::ToLanguageTag(internal->locale());
DCHECK(maybe_locale.IsJust());
Handle<String> locale = isolate->factory()->NewStringFromAsciiChecked(
maybe_locale.FromJust().c_str());
Handle<String> style = display_names->StyleAsString();
Handle<String> type = factory->NewStringFromAsciiChecked(internal->type());
Handle<String> fallback = display_names->FallbackAsString();
Handle<String> language_display = display_names->LanguageDisplayAsString();
Maybe<bool> maybe_create_locale = JSReceiver::CreateDataProperty(
isolate, options, factory->locale_string(), locale, Just(kDontThrow));
DCHECK(maybe_create_locale.FromJust());
USE(maybe_create_locale);
Maybe<bool> maybe_create_style = JSReceiver::CreateDataProperty(
isolate, options, factory->style_string(), style, Just(kDontThrow));
DCHECK(maybe_create_style.FromJust());
USE(maybe_create_style);
Maybe<bool> maybe_create_type = JSReceiver::CreateDataProperty(
isolate, options, factory->type_string(), type, Just(kDontThrow));
DCHECK(maybe_create_type.FromJust());
USE(maybe_create_type);
Maybe<bool> maybe_create_fallback = JSReceiver::CreateDataProperty(
isolate, options, factory->fallback_string(), fallback, Just(kDontThrow));
DCHECK(maybe_create_fallback.FromJust());
USE(maybe_create_fallback);
if (std::strcmp("language", internal->type()) == 0) {
Maybe<bool> maybe_create_language_display =
JSReceiver::CreateDataProperty(isolate, options,
factory->languageDisplay_string(),
language_display, Just(kDontThrow));
DCHECK(maybe_create_language_display.FromJust());
USE(maybe_create_language_display);
}
return options;
}
// ecma402 #sec-Intl.DisplayNames.prototype.of
MaybeHandle<Object> JSDisplayNames::Of(Isolate* isolate,
Handle<JSDisplayNames> display_names,
Handle<Object> code_obj) {
Handle<String> code;
ASSIGN_RETURN_ON_EXCEPTION(isolate, code, Object::ToString(isolate, code_obj),
Object);
DisplayNamesInternal* internal = display_names->internal()->raw();
Maybe<icu::UnicodeString> maybe_result =
internal->of(isolate, code->ToCString().get());
MAYBE_RETURN(maybe_result, Handle<Object>());
icu::UnicodeString result = maybe_result.FromJust();
if (result.isBogus()) {
return isolate->factory()->undefined_value();
}
return Intl::ToString(isolate, result).ToHandleChecked();
}
namespace {
struct CheckCalendar {
static const char* key() { return "calendar"; }
static const char* path() { return nullptr; }
};
} // namespace
const std::set<std::string>& JSDisplayNames::GetAvailableLocales() {
static base::LazyInstance<Intl::AvailableLocales<CheckCalendar>>::type
available_locales = LAZY_INSTANCE_INITIALIZER;
return available_locales.Pointer()->Get();
}
Handle<String> JSDisplayNames::StyleAsString() const {
switch (style()) {
case Style::kLong:
return GetReadOnlyRoots().long_string_handle();
case Style::kShort:
return GetReadOnlyRoots().short_string_handle();
case Style::kNarrow:
return GetReadOnlyRoots().narrow_string_handle();
}
UNREACHABLE();
}
Handle<String> JSDisplayNames::FallbackAsString() const {
switch (fallback()) {
case Fallback::kCode:
return GetReadOnlyRoots().code_string_handle();
case Fallback::kNone:
return GetReadOnlyRoots().none_string_handle();
}
UNREACHABLE();
}
Handle<String> JSDisplayNames::LanguageDisplayAsString() const {
switch (language_display()) {
case LanguageDisplay::kDialect:
return GetReadOnlyRoots().dialect_string_handle();
case LanguageDisplay::kStandard:
return GetReadOnlyRoots().standard_string_handle();
}
UNREACHABLE();
}
} // namespace internal
} // namespace v8