diff --git a/dev-qt/qtwebengine/patches/qtwebengine-5.15.16-build-fixes-python3.patchset b/dev-qt/qtwebengine/patches/qtwebengine-5.15.17-build-fixes-python3.patchset similarity index 100% rename from dev-qt/qtwebengine/patches/qtwebengine-5.15.16-build-fixes-python3.patchset rename to dev-qt/qtwebengine/patches/qtwebengine-5.15.17-build-fixes-python3.patchset diff --git a/dev-qt/qtwebengine/patches/qtwebengine-5.15.16-x86-fixes.patchset b/dev-qt/qtwebengine/patches/qtwebengine-5.15.17-x86-fixes.patchset similarity index 100% rename from dev-qt/qtwebengine/patches/qtwebengine-5.15.16-x86-fixes.patchset rename to dev-qt/qtwebengine/patches/qtwebengine-5.15.17-x86-fixes.patchset diff --git a/dev-qt/qtwebengine/patches/qtwebengine-5.15.16.patchset b/dev-qt/qtwebengine/patches/qtwebengine-5.15.17.patchset similarity index 73% rename from dev-qt/qtwebengine/patches/qtwebengine-5.15.16.patchset rename to dev-qt/qtwebengine/patches/qtwebengine-5.15.17.patchset index f8f959468..f8889e04b 100644 --- a/dev-qt/qtwebengine/patches/qtwebengine-5.15.16.patchset +++ b/dev-qt/qtwebengine/patches/qtwebengine-5.15.17.patchset @@ -1,8 +1,13 @@ -From f818e7050e1671aff2a61fed683bfe68f478ef5d Mon Sep 17 00:00:00 2001 +From 923f115cbb1a207af05f76e159acdbd11c211d76 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Thu, 7 Dec 2023 18:33:47 +1000 -Subject: Patchset based on qtwebengine patches for FreeBSD, as well as patches - by Kacper Kasper (Kapix), Jérôme Duval (korli) and Gerasim Troeglazov (3dEyes). +Subject: =?UTF-8?q?Patchset=20based=20on=20qtwebengine=20patches=20for=20F?= + =?UTF-8?q?reeBSD,=20as=20well=20as=20patches=20by=20Kacper=20Kasper=20(Ka?= + =?UTF-8?q?pix),=20J=C3=A9r=C3=B4me=20Duval=20(korli)=20and=20Gerasim=20Tr?= + =?UTF-8?q?oeglazov=20(3dEyes).?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit diff --git a/configure.pri b/configure.pri @@ -11325,10 +11330,10 @@ index 9e087c8..decafe8 100644 qtConfig(separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)" } -- -2.42.1 +2.45.2 -From c5e673acc778e70e87995cd7912454023e9147b4 Mon Sep 17 00:00:00 2001 +From 7a382ae77e274c3026c4fc6a113b812228eb6f11 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 31 Dec 2023 23:28:53 +1000 Subject: Implement CloseSuperfluousFds @@ -11395,10 +11400,10 @@ index d29e675..935d60c 100644 size_t GetMaxFds() { -- -2.42.1 +2.45.2 -From c59d03dcaf036d06b5bf0c5a247d90e55b7a98a3 Mon Sep 17 00:00:00 2001 +From 4b430ad51f7cf684bff93ea707c887266b66d545 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 7 Jan 2024 12:12:49 +1000 Subject: Fix fstat @@ -11418,10 +11423,10 @@ index a521ef0..7ab80df 100644 int64_t last_modified_nsec = stat_info.st_mtim.tv_nsec; time_t last_accessed_sec = stat_info.st_atim.tv_sec; -- -2.42.1 +2.45.2 -From 3023e2180a83f46b4398472ee5328e80573e595c Mon Sep 17 00:00:00 2001 +From d9b904efad7b465dd5876de9fc291c5d9b206a5a Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 7 Jan 2024 12:13:39 +1000 Subject: Check FD acess mode @@ -11441,5 +11446,3482 @@ index cabf383..63feaad 100644 mode == Mode::kReadOnly ? O_RDONLY : O_RDWR)) { return false; -- -2.42.1 +2.45.2 + + +From 8e5b33e5272aeb03952cb21d28969df4f1476126 Mon Sep 17 00:00:00 2001 +From: Ken Moffat +Date: Sat, 16 Dec 2023 18:57:13 +1000 +Subject: patches from Arch via gentoo to use python3 + + +diff --git a/configure.pri b/configure.pri +index 8be641c..c55ec5f 100644 +--- a/configure.pri ++++ b/configure.pri +@@ -7,20 +7,7 @@ QTWEBENGINE_SOURCE_TREE = $$PWD + equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe + + defineTest(isPythonVersionSupported) { +- python = $$system_quote($$system_path($$1)) +- python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"') +- python_version ~= s/[()]//g +- python_version = $$split(python_version, ',') +- python_major_version = $$first(python_version) +- greaterThan(python_major_version, 2) { +- qtLog("Python version 3 is not supported by Chromium.") +- return(false) +- } +- python_minor_version = $$member(python_version, 1) +- python_patch_version = $$member(python_version, 2) +- greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true) +- qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") +- return(false) ++ return(true) + } + + defineTest(qtConfTest_detectJumboBuild) { +@@ -52,22 +39,21 @@ defineTest(qtConfReport_jumboBuild) { + qtConfReportPadded($${1}, $$mergeLimit) + } + +-defineTest(qtConfTest_detectPython2) { +- python = $$qtConfFindInPath("python2$$EXE_SUFFIX") +- isEmpty(python) { +- qtLog("'python2$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.") +- python = $$qtConfFindInPath("python$$EXE_SUFFIX") ++defineTest(qtConfTest_detectPython) { ++ python = $$qtConfFindInPath("python3$$EXE_SUFFIX") ++ isEmpty(python) { ++ qtLog("'python3$$EXE_SUFFIX' not found in PATH. Checking for 'python3$$EXE_SUFFIX'.") + } + isEmpty(python) { +- qtLog("'python$$EXE_SUFFIX' not found in PATH. Giving up.") ++ qtLog("'python3$$EXE_SUFFIX' not found in PATH. Giving up.") + return(false) + } + !isPythonVersionSupported($$python) { +- qtLog("A suitable Python 2 executable could not be located.") ++ qtLog("A suitable Python3 executable could not be located.") + return(false) + } + +- # Make tests.python2.location available in configure.json. ++ # Make tests.python.location available in configure.json. + $${1}.location = $$clean_path($$python) + export($${1}.location) + $${1}.cache += location +diff --git a/src/3rdparty/chromium/BUILD.gn b/src/3rdparty/chromium/BUILD.gn +index 5f6954b..e69038f 100644 +--- a/src/3rdparty/chromium/BUILD.gn ++++ b/src/3rdparty/chromium/BUILD.gn +@@ -239,7 +239,6 @@ group("gn_all") { + "//media/capture:capture_unittests", + "//media/cast:cast_unittests", + "//third_party/angle/src/tests:angle_white_box_tests", +- "//third_party/catapult/telemetry:bitmaptools($host_toolchain)", + ] + } else if (is_ios && !use_qt) { + deps += [ +@@ -354,7 +353,6 @@ group("gn_all") { + "//net/android:net_junit_tests", + "//services:services_junit_tests", + "//testing/android/junit:junit_unit_tests", +- "//third_party/catapult/devil", + "//third_party/smhasher:murmurhash3", + "//tools/android:android_tools", + "//tools/android:memconsumer", +@@ -948,7 +946,6 @@ if (is_chromeos) { + "//third_party/dawn/src/tests:dawn_unittests", + + # Blocked on https://github.com/catapult-project/catapult/issues/2297 +- #"//third_party/catapult/telemetry:bitmaptools", + "//tools/perf/clear_system_cache", + "//ui/ozone/gl:ozone_gl_unittests", + ] +@@ -1026,7 +1023,6 @@ if (!is_ios && !use_qt) { + data_deps = [ + "//chrome:chrome", + "//chrome/test/chromedriver", +- "//third_party/catapult/third_party/typ", + ] + if (is_win) { + data_deps += [ "//build/win:copy_cdb_to_output" ] +@@ -1073,7 +1069,6 @@ if (!is_ios && !use_qt) { + "//third_party/blink/public:blink_devtools_inspector_resources", + "//third_party/blink/public/mojom:mojom_platform_js_data_deps", + "//third_party/blink/renderer/core/html:js_files_for_form_controls_web_tests", +- "//third_party/catapult/third_party/typ", + "//third_party/mesa_headers", + "//tools/imagediff", + ] +@@ -1141,7 +1136,6 @@ if (!is_ios && !use_qt) { + + if (is_android) { + data += [ +- "//third_party/catapult/", + "//build/android/", + ] + } +@@ -1248,11 +1242,6 @@ if (!is_ios && !use_qt) { + "//third_party/blink/web_tests/StaleTestExpectations", + "//third_party/blink/web_tests/TestExpectations", + "//third_party/blink/web_tests/VirtualTestSuites", +- "//third_party/catapult/common/py_utils/", +- "//third_party/catapult/devil/", +- "//third_party/catapult/dependency_manager/", +- "//third_party/catapult/third_party/zipfile/", +- "//third_party/catapult/third_party/typ/", + "//third_party/depot_tools/pylint", + "//third_party/depot_tools/pylint-1.5", + "//third_party/depot_tools/pylint_main.py", +diff --git a/src/3rdparty/chromium/build/print_python_deps.py b/src/3rdparty/chromium/build/print_python_deps.py +index fd29c09..69af247 100755 +--- a/src/3rdparty/chromium/build/print_python_deps.py ++++ b/src/3rdparty/chromium/build/print_python_deps.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2.7 ++#!/usr/bin/python + # Copyright 2016 The Chromium Authors. All rights reserved. + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. +@@ -80,7 +80,7 @@ def _GetTargetPythonVersion(module): + if shebang.startswith('#!'): + # Examples: + # '#!/usr/bin/python' +- # '#!/usr/bin/python2.7' ++ # '#!/usr/bin/python' + # '#!/usr/bin/python3' + # '#!/usr/bin/env python3' + # '#!/usr/bin/env vpython' +@@ -152,7 +152,7 @@ def main(): + + # Trybots run with vpython as default Python, but with a different config + # from //.vpython. To make the is_vpython test work, and to match the behavior +- # of dev machines, the shebang line must be run with python2.7. ++ # of dev machines, the shebang line must be run with python. + # + # E.g. $HOME/.vpython-root/dd50d3/bin/python + # E.g. /b/s/w/ir/cache/vpython/ab5c79/bin/python +diff --git a/src/3rdparty/chromium/chrome/chrome_paks.gni b/src/3rdparty/chromium/chrome/chrome_paks.gni +index 9323a77..0362b65 100644 +--- a/src/3rdparty/chromium/chrome/chrome_paks.gni ++++ b/src/3rdparty/chromium/chrome/chrome_paks.gni +@@ -94,7 +94,6 @@ template("chrome_extra_paks") { + "$root_gen_dir/chrome/common_resources.pak", + "$root_gen_dir/components/autofill/core/browser/autofill_address_rewriter_resources.pak", + "$root_gen_dir/components/components_resources.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", + "$root_gen_dir/net/net_resources.pak", +@@ -110,7 +109,6 @@ template("chrome_extra_paks") { + "//components/autofill/core/browser:autofill_address_rewriter_resources", + "//components/resources", + "//content:content_resources", +- "//content/browser/tracing:resources", + "//mojo/public/js:resources", + "//net:net_resources", + "//skia:skia_resources", +diff --git a/src/3rdparty/chromium/chrome/test/BUILD.gn b/src/3rdparty/chromium/chrome/test/BUILD.gn +index 3c53323..38be116 100644 +--- a/src/3rdparty/chromium/chrome/test/BUILD.gn ++++ b/src/3rdparty/chromium/chrome/test/BUILD.gn +@@ -7103,8 +7103,6 @@ if (!is_fuchsia && !is_android) { + "//chrome/test/data/password/captured_sites/", + "//chrome/test/data/web_page_replay_go_helper_scripts/automation_helper.js", + "//components/test/data/autofill/web_page_replay_support_files/", +- "//third_party/catapult/telemetry/telemetry/bin/", +- "//third_party/catapult/web_page_replay_go/deterministic.js", + ] + + if (is_linux || is_chromeos || is_win) { +@@ -7141,7 +7139,6 @@ if (!is_fuchsia && !is_android) { + + # TODO(uwyiming@chromium.org) create a gn target for Web Page Replay Go (WPR Go) and only WPR Go. + # So that test targets requiring WPR Go does not pull down the whole telemetry tool chain. +- "//third_party/catapult:telemetry_chrome_test_support", + "//third_party/hunspell", + "//third_party/icu", + "//third_party/libpng", +@@ -7171,7 +7168,6 @@ if (!is_fuchsia && !is_android) { + deps = [ "//tools/perf/chrome_telemetry_build:telemetry_chrome_test" ] + + data = [ +- "//third_party/catapult/telemetry/telemetry/internal/bin/", + "//tools/perf/run_telemetry_tests", + + # For isolate contract. +@@ -7189,7 +7185,6 @@ if (!is_fuchsia && !is_android) { + group("telemetry_gpu_unittests") { + testonly = true + deps = [ +- "//third_party/catapult:telemetry_chrome_test_support", + "//tools/metrics:metrics_python_tests", + ] + data = [ +@@ -7313,7 +7308,6 @@ if (is_mac || is_win || is_android) { + "//testing/scripts", + "//testing/test_env.py", + "//testing/xvfb.py", +- "//third_party/catapult", + "//tools", + ] + } +diff --git a/src/3rdparty/chromium/components/bookmarks/browser/base_bookmark_model_observer.cc b/src/3rdparty/chromium/components/bookmarks/browser/base_bookmark_model_observer.cc +index 657a3c9..ad641a0 100644 +--- a/src/3rdparty/chromium/components/bookmarks/browser/base_bookmark_model_observer.cc ++++ b/src/3rdparty/chromium/components/bookmarks/browser/base_bookmark_model_observer.cc +@@ -2,6 +2,8 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. + ++#include ++ + #include "components/bookmarks/browser/base_bookmark_model_observer.h" + + namespace bookmarks { +diff --git a/src/3rdparty/chromium/components/bookmarks/browser/bookmark_expanded_state_tracker.cc b/src/3rdparty/chromium/components/bookmarks/browser/bookmark_expanded_state_tracker.cc +index 4ad2afa..5c4596e 100644 +--- a/src/3rdparty/chromium/components/bookmarks/browser/bookmark_expanded_state_tracker.cc ++++ b/src/3rdparty/chromium/components/bookmarks/browser/bookmark_expanded_state_tracker.cc +@@ -2,6 +2,7 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. + ++#include + #include "components/bookmarks/browser/bookmark_expanded_state_tracker.h" + + #include +diff --git a/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py b/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py +index 7422ead..1636551 100755 +--- a/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py ++++ b/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py +@@ -7,7 +7,7 @@ + Converts a given ASCII proto into a binary resource. + + """ +- ++from __future__ import print_function + import abc + import imp + import optparse +@@ -196,12 +196,12 @@ class BinaryProtoGenerator: + self._ImportProtoModules(opts.path) + + if not self.VerifyArgs(opts): +- print "Wrong arguments" ++ print("Wrong arguments") + return 1 + + try: + self._GenerateBinaryProtos(opts) + except Exception as e: +- print "ERROR: Failed to render binary version of %s:\n %s\n%s" % ( +- opts.infile, str(e), traceback.format_exc()) ++ print("ERROR: Failed to render binary version of %s:\n %s\n%s" % ++ (opts.infile, str(e), traceback.format_exc())) + return 1 +diff --git a/src/3rdparty/chromium/content/browser/BUILD.gn b/src/3rdparty/chromium/content/browser/BUILD.gn +index e9e1d56..00f4184 100644 +--- a/src/3rdparty/chromium/content/browser/BUILD.gn ++++ b/src/3rdparty/chromium/content/browser/BUILD.gn +@@ -2169,7 +2169,6 @@ jumbo_static_library("browser") { + if (!is_android) { + deps += [ + "//components/vector_icons", +- "//content/browser/tracing:resources", + ] + } + +diff --git a/src/3rdparty/chromium/content/browser/tracing/BUILD.gn b/src/3rdparty/chromium/content/browser/tracing/BUILD.gn +deleted file mode 100644 +index eac0599..0000000 +--- a/src/3rdparty/chromium/content/browser/tracing/BUILD.gn ++++ /dev/null +@@ -1,51 +0,0 @@ +-# Copyright 2014 The Chromium Authors. All rights reserved. +-# Use of this source code is governed by a BSD-style license that can be +-# found in the LICENSE file. +- +-import("//tools/grit/grit_rule.gni") +- +-# generate_about_tracing puts its files in this directory +-tracing_gen_dir = "$root_gen_dir/content/browser/tracing" +- +-# The script just writes filename with no dirs to the .grd, so we always need +-# this file to be in the same directory as the inputs. +-tracing_grd = "$tracing_gen_dir/tracing_resources.grd" +- +-action("generate_tracing_grd") { +- visibility = [ ":*" ] # Depend on ":resources" to get this. +- script = "generate_trace_viewer_grd.py" +- +- input_pages = [ +- "$tracing_gen_dir/about_tracing.html", +- "$tracing_gen_dir/about_tracing.js", +- ] +- inputs = input_pages +- outputs = [ tracing_grd ] +- +- args = rebase_path(input_pages, target_gen_dir) + [ +- "--output", +- rebase_path(tracing_grd, root_build_dir), +- ] +- +- deps = [ "//third_party/catapult/tracing:generate_about_tracing" ] +-} +- +-grit("resources") { +- source = tracing_grd +- +- # Required because the .grd is generated. +- enable_input_discovery_for_gn_analyze = false +- +- outputs = [ +- "grit/tracing_resources.h", +- "tracing_resources.pak", +- ] +- +- # resource_ids has an entry for our .grd file that looks like: +- # "<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd" +- # and what we pass here should make that resolve to our .grd file. +- defines = +- [ "SHARED_INTERMEDIATE_DIR=" + rebase_path(root_gen_dir, root_build_dir) ] +- +- deps = [ ":generate_tracing_grd" ] +-} +diff --git a/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py b/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py +index 037f949..be393d2 100755 +--- a/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py ++++ b/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py +@@ -74,7 +74,7 @@ def main(argv): + for filename in parsed_args.source_files: + add_file_to_grd(doc, os.path.basename(filename)) + +- with open(parsed_args.output_filename, 'w') as output_file: ++ with open(parsed_args.output_filename, 'wb') as output_file: + output_file.write(doc.toxml(encoding='UTF-8')) + + +diff --git a/src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc b/src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc +index 2bffb5e..8965922 100644 +--- a/src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc ++++ b/src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc +@@ -27,7 +27,6 @@ + #include "base/strings/stringprintf.h" + #include "base/trace_event/trace_event.h" + #include "base/values.h" +-#include "content/browser/tracing/grit/tracing_resources.h" + #include "content/browser/tracing/tracing_controller_impl.h" + #include "content/public/browser/browser_context.h" + #include "content/public/browser/browser_thread.h" +@@ -242,8 +241,6 @@ TracingUI::TracingUI(WebUI* web_ui) + WebUIDataSource* source = WebUIDataSource::Create(kChromeUITracingHost); + source->DisableTrustedTypesCSP(); + source->UseStringsJs(); +- source->SetDefaultResource(IDR_TRACING_HTML); +- source->AddResourcePath("tracing.js", IDR_TRACING_JS); + source->SetRequestFilter(base::BindRepeating(OnShouldHandleRequest), + base::BindRepeating(OnTracingRequest)); + WebUIDataSource::Add(browser_context, source); +diff --git a/src/3rdparty/chromium/content/shell/BUILD.gn b/src/3rdparty/chromium/content/shell/BUILD.gn +index f7a0c95..e7e8932 100644 +--- a/src/3rdparty/chromium/content/shell/BUILD.gn ++++ b/src/3rdparty/chromium/content/shell/BUILD.gn +@@ -396,7 +396,6 @@ repack("pak") { + sources = [ + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", + "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", +@@ -419,7 +418,6 @@ repack("pak") { + "//content:dev_ui_content_resources", + "//content/app/resources", + "//content/browser/resources/media:media_internals_resources", +- "//content/browser/tracing:resources", + "//content/browser/webrtc/resources", + "//mojo/public/js:resources", + "//net:net_resources", +diff --git a/src/3rdparty/chromium/fuchsia/engine/BUILD.gn b/src/3rdparty/chromium/fuchsia/engine/BUILD.gn +index a502b7f..39df2a7 100644 +--- a/src/3rdparty/chromium/fuchsia/engine/BUILD.gn ++++ b/src/3rdparty/chromium/fuchsia/engine/BUILD.gn +@@ -43,7 +43,6 @@ repack("web_engine_pak") { + "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/components/strings/components_strings_en-US.pak", + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", + "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", +@@ -66,7 +65,6 @@ repack("web_engine_pak") { + "//content:content_resources", + "//content:dev_ui_content_resources", + "//content/app/resources", +- "//content/browser/tracing:resources", + "//gpu/command_buffer/service", + "//mojo/public/js:resources", + "//net:net_resources", +diff --git a/src/3rdparty/chromium/headless/BUILD.gn b/src/3rdparty/chromium/headless/BUILD.gn +index fb3cfde..fb54a15 100644 +--- a/src/3rdparty/chromium/headless/BUILD.gn ++++ b/src/3rdparty/chromium/headless/BUILD.gn +@@ -37,7 +37,6 @@ repack("pak") { + "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/components/strings/components_strings_en-US.pak", + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", + "$root_gen_dir/headless/headless_lib_resources.pak", +@@ -65,7 +64,6 @@ repack("pak") { + "//content:content_resources", + "//content:dev_ui_content_resources", + "//content/app/resources", +- "//content/browser/tracing:resources", + "//mojo/public/js:resources", + "//net:net_resources", + "//third_party/blink/public:resources", +diff --git a/src/3rdparty/chromium/mojo/public/tools/BUILD.gn b/src/3rdparty/chromium/mojo/public/tools/BUILD.gn +index 4c68350..1cc0125 100644 +--- a/src/3rdparty/chromium/mojo/public/tools/BUILD.gn ++++ b/src/3rdparty/chromium/mojo/public/tools/BUILD.gn +@@ -14,5 +14,4 @@ group("mojo_python_unittests") { + "//testing/xvfb.py", + ] + deps = [ "//mojo/public/tools/mojom/mojom:tests" ] +- data_deps = [ "//third_party/catapult/third_party/typ/" ] + } +diff --git a/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn b/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn +index fc04b5d..708958e 100644 +--- a/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn ++++ b/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn +@@ -2,9 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/python.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//third_party/jinja2/jinja2.gni") + ++# TODO(crbug.com/1194274): Investigate nondeterminism in Py3 builds. + action("precompile_templates") { + sources = mojom_generator_sources + sources += [ +diff --git a/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py b/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py +index 79c9e50..8b78d09 100644 +--- a/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py ++++ b/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py +@@ -18,7 +18,6 @@ import os + import re + import sys + +-from cStringIO import StringIO + from optparse import OptionParser + + sys.path.insert( +@@ -41,12 +40,9 @@ def main(): + pattern = re.compile(options.pattern) + files = [f for f in os.listdir(options.directory) if pattern.match(f)] + +- stream = StringIO() +- for f in files: +- print(f, file=stream) ++ contents = '\n'.join(f for f in files) + '\n' ++ WriteFile(contents, options.output) + +- WriteFile(stream.getvalue(), options.output) +- stream.close() + + if __name__ == '__main__': + sys.exit(main()) +diff --git a/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py b/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py +index 96b2fdf..00b9dcc 100644 +--- a/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py ++++ b/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py +@@ -25,6 +25,10 @@ sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, + 'build', 'android', 'gyp')) + from util import build_utils + ++# TODO(crbug.com/1174969): Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str ++ long = int + + GENERATOR_PREFIX = 'java' + +diff --git a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py +index de62260..4a1c73f 100644 +--- a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py ++++ b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py +@@ -136,9 +136,14 @@ class Stylizer(object): + + def WriteFile(contents, full_path): + # If |contents| is same with the file content, we skip updating. ++ if not isinstance(contents, bytes): ++ data = contents.encode('utf8') ++ else: ++ data = contents ++ + if os.path.isfile(full_path): + with open(full_path, 'rb') as destination_file: +- if destination_file.read() == contents: ++ if destination_file.read() == data: + return + + # Make sure the containing directory exists. +@@ -146,11 +151,8 @@ def WriteFile(contents, full_path): + fileutil.EnsureDirectoryExists(full_dir) + + # Dump the data to disk. +- with open(full_path, "wb") as f: +- if not isinstance(contents, bytes): +- f.write(contents.encode('utf-8')) +- else: +- f.write(contents) ++ with open(full_path, 'wb') as f: ++ f.write(data) + + + def AddComputedData(module): +diff --git a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py +index ebbc9b3..3d02642 100644 +--- a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py ++++ b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py +@@ -398,7 +398,8 @@ class Field(object): + + + class StructField(Field): +- pass ++ def __hash__(self): ++ return super(Field, self).__hash__() + + + class UnionField(Field): +diff --git a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py +index 7a30056..8d9e26f 100644 +--- a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py ++++ b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py +@@ -75,9 +75,9 @@ def PrecompileTemplates(generator_modules, output_dir): + os.path.dirname(module.__file__), generator.GetTemplatePrefix()) + ])) + jinja_env.filters.update(generator.GetFilters()) +- jinja_env.compile_templates( +- os.path.join(output_dir, "%s.zip" % generator.GetTemplatePrefix()), +- extensions=["tmpl"], +- zip="stored", +- py_compile=True, +- ignore_errors=False) ++ jinja_env.compile_templates(os.path.join( ++ output_dir, "%s.zip" % generator.GetTemplatePrefix()), ++ extensions=["tmpl"], ++ zip="stored", ++ py_compile=sys.version_info.major < 3, ++ ignore_errors=False) +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +index 5e650d9..6ed415a 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +@@ -158,7 +158,15 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, + return Allow(); + #endif + +- if (SyscallSets::IsClockApi(sysno)) { ++ if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep ++#if defined(__NR_clock_gettime64) ++ || sysno == __NR_clock_gettime64 ++#endif ++#if defined(__NR_clock_nanosleep_time64) ++ || sysno == __NR_clock_nanosleep_time64 ++#endif ++ ) { ++ + return RestrictClockID(); + } + +diff --git a/src/3rdparty/chromium/testing/BUILD.gn b/src/3rdparty/chromium/testing/BUILD.gn +index 56ebf8d..7d51bc0 100644 +--- a/src/3rdparty/chromium/testing/BUILD.gn ++++ b/src/3rdparty/chromium/testing/BUILD.gn +@@ -27,7 +27,6 @@ group("run_perf_test") { + + data_deps = [ + ":test_scripts_shared", +- "//third_party/catapult/tracing:convert_chart_json", + ] + + if (is_android) { +diff --git a/src/3rdparty/chromium/third_party/angle/src/libANGLE/HandleAllocator.cpp b/src/3rdparty/chromium/third_party/angle/src/libANGLE/HandleAllocator.cpp +index 013f1df..3ce63c1 100644 +--- a/src/3rdparty/chromium/third_party/angle/src/libANGLE/HandleAllocator.cpp ++++ b/src/3rdparty/chromium/third_party/angle/src/libANGLE/HandleAllocator.cpp +@@ -9,6 +9,7 @@ + + #include "libANGLE/HandleAllocator.h" + ++#include + #include + #include + +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py +index 3225ecc..fc078d3 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py +@@ -344,7 +344,7 @@ def make_default_value_expr(idl_type, default_value): + """ + assert default_value.is_type_compatible_with(idl_type) + +- class DefaultValueExpr: ++ class DefaultValueExpr(object): + _ALLOWED_SYMBOLS_IN_DEPS = ("isolate") + + def __init__(self, initializer_expr, initializer_deps, +@@ -502,7 +502,7 @@ def make_v8_to_blink_value(blink_var_name, + assert isinstance(blink_var_name, str) + assert isinstance(v8_value_expr, str) + assert isinstance(idl_type, web_idl.IdlType) +- assert (argument_index is None or isinstance(argument_index, (int, long))) ++ assert (argument_index is None or isinstance(argument_index, int)) + assert (default_value is None + or isinstance(default_value, web_idl.LiteralConstant)) + +@@ -622,7 +622,7 @@ def make_v8_to_blink_value_variadic(blink_var_name, v8_array, + """ + assert isinstance(blink_var_name, str) + assert isinstance(v8_array, str) +- assert isinstance(v8_array_start_index, (int, long)) ++ assert isinstance(v8_array_start_index, int) + assert isinstance(idl_type, web_idl.IdlType) + + pattern = ("auto&& ${{{_1}}} = " +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py +index 4a6df51..8b51f23 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py +@@ -177,7 +177,7 @@ def generate_callback_interface(callback_interface_identifier): + prop_install_mode=PropInstallMode.UNCONDITIONAL, + trampoline_var_name=None, + attribute_entries=[], +- constant_entries=filter(is_unconditional, constant_entries), ++ constant_entries=list(filter(is_unconditional, constant_entries)), + exposed_construct_entries=[], + operation_entries=[]) + (install_interface_template_decl, install_interface_template_def, +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py +index 52972fe..e5ae9d9 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py +@@ -503,13 +503,13 @@ class CompositeNode(CodeNode): + gensym_kwargs = {} + template_vars = {} + for arg in args: +- assert isinstance(arg, (CodeNode, int, long, str)) ++ assert isinstance(arg, (CodeNode, int, str)) + gensym = CodeNode.gensym() + gensym_args.append("${{{}}}".format(gensym)) + template_vars[gensym] = arg + for key, value in kwargs.items(): +- assert isinstance(key, (int, long, str)) +- assert isinstance(value, (CodeNode, int, long, str)) ++ assert isinstance(key, (int, str)) ++ assert isinstance(value, (CodeNode, int, str)) + gensym = CodeNode.gensym() + gensym_kwargs[key] = "${{{}}}".format(gensym) + template_vars[gensym] = value +@@ -602,7 +602,7 @@ class ListNode(CodeNode): + def insert(self, index, node): + if node is None: + return +- assert isinstance(index, (int, long)) ++ assert isinstance(index, int) + assert isinstance(node, CodeNode) + assert node.outer is None and node.prev is None + +@@ -721,7 +721,7 @@ class SymbolScopeNode(SequenceNode): + if not scope_chains: + return counts + +- self_index = iter(scope_chains).next().index(self) ++ self_index = next(iter(scope_chains)).index(self) + scope_chains = map( + lambda scope_chain: scope_chain[self_index + 1:], scope_chains) + scope_to_likeliness = {} +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py +index a229a6c..5fa288d 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py +@@ -109,7 +109,7 @@ def expr_and(terms): + + if any(term.is_always_false for term in terms): + return _Expr(False) +- terms = filter(lambda x: not x.is_always_true, terms) ++ terms = list(filter(lambda x: not x.is_always_true, terms)) + if not terms: + return _Expr(True) + if len(terms) == 1: +@@ -124,7 +124,7 @@ def expr_or(terms): + + if any(term.is_always_true for term in terms): + return _Expr(True) +- terms = filter(lambda x: not x.is_always_false, terms) ++ terms = list(filter(lambda x: not x.is_always_false, terms)) + if not terms: + return _Expr(False) + if len(terms) == 1: +@@ -222,7 +222,7 @@ def expr_from_exposure(exposure, + elif exposure.only_in_secure_contexts is False: + secure_context_term = _Expr(True) + else: +- terms = map(ref_enabled, exposure.only_in_secure_contexts) ++ terms = list(map(ref_enabled, exposure.only_in_secure_contexts)) + secure_context_term = expr_or( + [_Expr("${is_in_secure_context}"), + expr_not(expr_and(terms))]) +@@ -275,10 +275,11 @@ def expr_from_exposure(exposure, + + # [ContextEnabled] + if exposure.context_enabled_features: +- terms = map( +- lambda feature: _Expr( +- "${{context_feature_settings}}->is{}Enabled()".format( +- feature)), exposure.context_enabled_features) ++ terms = list( ++ map( ++ lambda feature: _Expr( ++ "${{context_feature_settings}}->is{}Enabled()".format( ++ feature)), exposure.context_enabled_features)) + context_enabled_terms.append( + expr_and([_Expr("${context_feature_settings}"), + expr_or(terms)])) +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py +index 87d26ee..f3e9d38 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py +@@ -23,7 +23,7 @@ class _TemplateFormatter(string.Formatter): + self._template_formatter_indexing_count_ = 0 + + def get_value(self, key, args, kwargs): +- if isinstance(key, (int, long)): ++ if isinstance(key, int): + return args[key] + assert isinstance(key, str) + if not key: +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py +index 2bcc4fe..e72282a 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py +@@ -116,4 +116,4 @@ def write_code_node_to_file(code_node, filepath): + # stderr=format_result.error_message)) + # + # web_idl.file_io.write_to_file_if_changed(filepath, format_result.contents) +- web_idl.file_io.write_to_file_if_changed(filepath, rendered_text) ++ web_idl.file_io.write_to_file_if_changed(filepath, rendered_text.encode('utf-8')) +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py +index b39f010..4d68202 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py +@@ -993,7 +993,7 @@ def make_dict_trace_func(cg_context): + _2 = _blink_member_name(member).value_var + return TextNode(_format(pattern, _1=_1, _2=_2)) + +- body.extend(map(make_trace_member_node, own_members)) ++ body.extend(list(map(make_trace_member_node, own_members))) + body.append(TextNode("BaseClass::Trace(visitor);")) + + return func_decl, func_def +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +index 10ff306..bfdf712 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +@@ -582,7 +582,7 @@ def _make_blink_api_call(code_node, + overriding_args=None): + assert isinstance(code_node, SymbolScopeNode) + assert isinstance(cg_context, CodeGenContext) +- assert num_of_args is None or isinstance(num_of_args, (int, long)) ++ assert num_of_args is None or isinstance(num_of_args, int) + assert (overriding_args is None + or (isinstance(overriding_args, (list, tuple)) + and all(isinstance(arg, str) for arg in overriding_args))) +@@ -1196,8 +1196,10 @@ def make_overload_dispatcher(cg_context): + did_use_break = did_use_break or can_fail + + conditional = expr_or( +- map(lambda item: expr_from_exposure(item.function_like.exposure), +- items)) ++ list( ++ map( ++ lambda item: expr_from_exposure(item.function_like.exposure ++ ), items))) + if not conditional.is_always_true: + node = CxxUnlikelyIfNode(cond=conditional, body=node) + +@@ -4642,7 +4644,7 @@ class _PropEntryConstructorGroup(_PropEntryBase): + def __init__(self, is_context_dependent, exposure_conditional, world, + constructor_group, ctor_callback_name, ctor_func_length): + assert isinstance(ctor_callback_name, str) +- assert isinstance(ctor_func_length, (int, long)) ++ assert isinstance(ctor_func_length, int) + + _PropEntryBase.__init__(self, is_context_dependent, + exposure_conditional, world, constructor_group) +@@ -4670,7 +4672,7 @@ class _PropEntryOperationGroup(_PropEntryBase): + op_func_length, + no_alloc_direct_callback_name=None): + assert isinstance(op_callback_name, str) +- assert isinstance(op_func_length, (int, long)) ++ assert isinstance(op_func_length, int) + + _PropEntryBase.__init__(self, is_context_dependent, + exposure_conditional, world, operation_group) +@@ -5175,9 +5177,9 @@ def make_install_interface_template(cg_context, function_name, class_name, api_c + ]) + + if class_like.identifier == "CSSStyleDeclaration": +- css_properties = filter( +- lambda attr: "CSSProperty" in attr.extended_attributes, +- class_like.attributes) ++ css_properties = list( ++ filter(lambda attr: "CSSProperty" in attr.extended_attributes, ++ class_like.attributes)) + if css_properties: + prop_name_list = "".join( + map(lambda attr: "\"{}\", ".format(attr.identifier), +@@ -5567,8 +5569,8 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As();\ + "V8DOMConfiguration::InstallConstants(${isolate}, " + "${interface_template}, ${prototype_template}, " + "kConstantCallbackTable, base::size(kConstantCallbackTable));") +- constant_callback_entries = filter(lambda entry: entry.const_callback_name, +- constant_entries) ++ constant_callback_entries = list(filter(lambda entry: entry.const_callback_name, ++ constant_entries)) + install_properties(table_name, constant_callback_entries, + _make_constant_callback_registration_table, + installer_call_text) +@@ -5584,8 +5586,8 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As();\ + "V8DOMConfiguration::InstallConstants(${isolate}, " + "${interface_template}, ${prototype_template}, " + "kConstantValueTable, base::size(kConstantValueTable));") +- constant_value_entries = filter( +- lambda entry: not entry.const_callback_name, constant_entries) ++ constant_value_entries = list(filter( ++ lambda entry: not entry.const_callback_name, constant_entries)) + install_properties(table_name, constant_value_entries, + _make_constant_value_registration_table, + installer_call_text) +@@ -6336,8 +6338,8 @@ def make_v8_context_snapshot_api(cg_context, component, attribute_entries, + assert isinstance(component, web_idl.Component) + + derived_interfaces = cg_context.interface.deriveds +- derived_names = map(lambda interface: interface.identifier, +- derived_interfaces) ++ derived_names = list( ++ map(lambda interface: interface.identifier, derived_interfaces)) + derived_names.append(cg_context.interface.identifier) + if not ("Window" in derived_names or "HTMLDocument" in derived_names): + return None, None +@@ -6411,9 +6413,11 @@ def _make_v8_context_snapshot_get_reference_table_function( + collect_callbacks(named_properties_object_callback_defs) + collect_callbacks(cross_origin_property_callback_defs) + +- entry_nodes = map( +- lambda name: TextNode("reinterpret_cast({}),".format(name)), +- filter(None, callback_names)) ++ entry_nodes = list( ++ map( ++ lambda name: TextNode("reinterpret_cast({}),".format(name ++ )), ++ filter(None, callback_names))) + table_node = ListNode([ + TextNode("using namespace ${class_name}Callbacks;"), + TextNode("static const intptr_t kReferenceTable[] = {"), +@@ -6451,10 +6455,11 @@ def _make_v8_context_snapshot_install_props_per_context_function( + class_name=None, + prop_install_mode=PropInstallMode.V8_CONTEXT_SNAPSHOT, + trampoline_var_name=None, +- attribute_entries=filter(selector, attribute_entries), +- constant_entries=filter(selector, constant_entries), +- exposed_construct_entries=filter(selector, exposed_construct_entries), +- operation_entries=filter(selector, operation_entries)) ++ attribute_entries=list(filter(selector, attribute_entries)), ++ constant_entries=list(filter(selector, constant_entries)), ++ exposed_construct_entries=list( ++ filter(selector, exposed_construct_entries)), ++ operation_entries=list(filter(selector, operation_entries))) + + return func_decl, func_def + +@@ -6810,11 +6815,11 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.UNCONDITIONAL, + trampoline_var_name=tp_install_unconditional_props, +- attribute_entries=filter(is_unconditional, attribute_entries), +- constant_entries=filter(is_unconditional, constant_entries), +- exposed_construct_entries=filter(is_unconditional, +- exposed_construct_entries), +- operation_entries=filter(is_unconditional, operation_entries)) ++ attribute_entries=list(filter(is_unconditional, attribute_entries)), ++ constant_entries=list(filter(is_unconditional, constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_unconditional, exposed_construct_entries)), ++ operation_entries=list(filter(is_unconditional, operation_entries))) + (install_context_independent_props_decl, + install_context_independent_props_def, + install_context_independent_props_trampoline) = make_install_properties( +@@ -6823,11 +6828,14 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.CONTEXT_INDEPENDENT, + trampoline_var_name=tp_install_context_independent_props, +- attribute_entries=filter(is_context_independent, attribute_entries), +- constant_entries=filter(is_context_independent, constant_entries), +- exposed_construct_entries=filter(is_context_independent, +- exposed_construct_entries), +- operation_entries=filter(is_context_independent, operation_entries)) ++ attribute_entries=list( ++ filter(is_context_independent, attribute_entries)), ++ constant_entries=list(filter(is_context_independent, ++ constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_context_independent, exposed_construct_entries)), ++ operation_entries=list( ++ filter(is_context_independent, operation_entries))) + (install_context_dependent_props_decl, install_context_dependent_props_def, + install_context_dependent_props_trampoline) = make_install_properties( + cg_context, +@@ -6835,11 +6843,13 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.CONTEXT_DEPENDENT, + trampoline_var_name=tp_install_context_dependent_props, +- attribute_entries=filter(is_context_dependent, attribute_entries), +- constant_entries=filter(is_context_dependent, constant_entries), +- exposed_construct_entries=filter(is_context_dependent, +- exposed_construct_entries), +- operation_entries=filter(is_context_dependent, operation_entries)) ++ attribute_entries=list(filter(is_context_dependent, ++ attribute_entries)), ++ constant_entries=list(filter(is_context_dependent, constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_context_dependent, exposed_construct_entries)), ++ operation_entries=list(filter(is_context_dependent, ++ operation_entries))) + (install_interface_template_decl, install_interface_template_def, + install_interface_template_trampoline) = make_install_interface_template( + cg_context, +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py +index b4c7055..f3a2fcd 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py +@@ -105,7 +105,7 @@ class MakoRenderer(object): + on_error = self._caller_stack_on_error + if (len(current) <= len(on_error) + and all(current[i] == on_error[i] +- for i in xrange(len(current)))): ++ for i in range(len(current)))): + pass # Error happened in a deeper caller. + else: + self._caller_stack_on_error = list(self._caller_stack) +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py +index f37b40a..899a85e 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py +@@ -73,8 +73,13 @@ def gn_format(contents, filename=None): + + + def _invoke_format_command(command_line, filename, contents): +- proc = subprocess.Popen( +- command_line, stdin=subprocess.PIPE, stdout=subprocess.PIPE) ++ kwargs = {} ++ if sys.version_info.major != 2: ++ kwargs['encoding'] = 'utf-8' ++ proc = subprocess.Popen(command_line, ++ stdin=subprocess.PIPE, ++ stdout=subprocess.PIPE, ++ **kwargs) + stdout_output, stderr_output = proc.communicate(input=contents) + exit_code = proc.wait() + +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py +index 0d8f4c0..e666a9b 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import functools + import multiprocessing + + from .package_initializer import package_initializer +@@ -76,7 +77,7 @@ class TaskQueue(object): + if not report_progress: + return + +- done_count = reduce( ++ done_count = functools.reduce( + lambda count, worker_task: count + bool(worker_task.ready()), + self._worker_tasks, 0) + report_progress(len(self._worker_tasks), done_count) +@@ -85,4 +86,4 @@ class TaskQueue(object): + def _task_queue_run_tasks(tasks): + for task in tasks: + func, args, kwargs = task +- apply(func, args, kwargs) ++ func(*args, **kwargs) +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py +index e8280be..e49e6eb 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py +@@ -13,6 +13,7 @@ import re + import sys + + from idl_types import set_ancestors, IdlType ++from itertools import groupby + from v8_globals import includes + from v8_interface import constant_filters + from v8_types import set_component_dirs +@@ -43,6 +44,7 @@ TEMPLATES_DIR = os.path.normpath( + # after path[0] == invoking script dir + sys.path.insert(1, THIRD_PARTY_DIR) + import jinja2 ++from jinja2.filters import make_attrgetter, environmentfilter + + + def generate_indented_conditional(code, conditional): +@@ -88,6 +90,13 @@ def runtime_enabled_if(code, name): + return generate_indented_conditional(code, function) + + ++@environmentfilter ++def do_stringify_key_group_by(environment, value, attribute): ++ expr = make_attrgetter(environment, attribute) ++ key = lambda item: '' if expr(item) is None else str(expr(item)) ++ return groupby(sorted(value, key=key), expr) ++ ++ + def initialize_jinja_env(cache_dir): + jinja_env = jinja2.Environment( + loader=jinja2.FileSystemLoader(TEMPLATES_DIR), +@@ -117,6 +126,7 @@ def initialize_jinja_env(cache_dir): + }) + jinja_env.filters.update(constant_filters()) + jinja_env.filters.update(method_filters()) ++ jinja_env.filters["stringifykeygroupby"] = do_stringify_key_group_by + return jinja_env + + +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py +index 130004e..04c0fab 100755 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py +@@ -80,7 +80,7 @@ def read_idl_file(reader, idl_filename): + assert len(interfaces) == 1, ( + "Expected one interface in file %r, found %d" % + (idl_filename, len(interfaces))) +- return (interfaces.values()[0], includes) ++ return (list(interfaces.values())[0], includes) + + + def interface_is_global(interface): +@@ -281,7 +281,7 @@ def main(): + + info_provider = create_component_info_provider( + os.path.normpath(options.info_dir), options.target_component) +- idl_filenames = map(str.strip, open(options.idl_files_list)) ++ idl_filenames = list(map(str.strip, open(options.idl_files_list))) + + generate_origin_trial_features(info_provider, options, idl_filenames) + return 0 +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py +index 14e6e9d..b027818 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py +@@ -394,7 +394,8 @@ class IdlInterface(object): + else: + raise ValueError('Unrecognized node class: %s' % child_class) + +- if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1: ++ if len(list(filter(None, ++ [self.iterable, self.maplike, self.setlike]))) > 1: + raise ValueError( + 'Interface can only have one of iterable<>, maplike<> and setlike<>.' + ) +@@ -512,6 +513,9 @@ class IdlAttribute(TypedObject): + def accept(self, visitor): + visitor.visit_attribute(self) + ++ def __lt__(self, other): ++ return self.name < other.name ++ + + ################################################################################ + # Constants +@@ -852,7 +856,7 @@ class IdlIncludes(object): + ################################################################################ + + +-class Exposure: ++class Exposure(object): + """An Exposure holds one Exposed or RuntimeEnabled condition. + Each exposure has two properties: exposed and runtime_enabled. + Exposure(e, r) corresponds to [Exposed(e r)]. Exposure(e) corresponds to +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py +index 8d72865..b80eebd 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py +@@ -55,8 +55,8 @@ def validate_blink_idl_definitions(idl_filename, idl_file_basename, + definitions. There is no filename convention in this case. + - Otherwise, an IDL file is invalid. + """ +- targets = ( +- definitions.interfaces.values() + definitions.dictionaries.values()) ++ targets = (list(definitions.interfaces.values()) + ++ list(definitions.dictionaries.values())) + number_of_targets = len(targets) + if number_of_targets > 1: + raise Exception( +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py +index cd4f0c3..ab95e9c 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py +@@ -349,7 +349,7 @@ class IdlUnionType(IdlTypeBase): + return True + + def single_matching_member_type(self, predicate): +- matching_types = filter(predicate, self.flattened_member_types) ++ matching_types = list(filter(predicate, self.flattened_member_types)) + if len(matching_types) > 1: + raise ValueError('%s is ambiguous.' % self.name) + return matching_types[0] if matching_types else None +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py +index e1677ee..3c5006f 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py +@@ -196,8 +196,9 @@ class ComponentInfoProviderModules(ComponentInfoProvider): + + @property + def callback_functions(self): +- return dict(self._component_info_core['callback_functions'].items() + +- self._component_info_modules['callback_functions'].items()) ++ return dict( ++ list(self._component_info_core['callback_functions'].items()) + ++ list(self._component_info_modules['callback_functions'].items())) + + @property + def specifier_for_export(self): +@@ -209,8 +210,8 @@ class ComponentInfoProviderModules(ComponentInfoProvider): + + + def load_interfaces_info_overall_pickle(info_dir): +- with open(os.path.join(info_dir, +- 'interfaces_info.pickle')) as interface_info_file: ++ with open(os.path.join(info_dir, 'interfaces_info.pickle'), ++ mode='rb') as interface_info_file: + return pickle.load(interface_info_file) + + +@@ -236,23 +237,20 @@ def merge_dict_recursively(target, diff): + + def create_component_info_provider_core(info_dir): + interfaces_info = load_interfaces_info_overall_pickle(info_dir) +- with open( +- os.path.join(info_dir, 'core', +- 'component_info_core.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'), ++ mode='rb') as component_info_file: + component_info = pickle.load(component_info_file) + return ComponentInfoProviderCore(interfaces_info, component_info) + + + def create_component_info_provider_modules(info_dir): + interfaces_info = load_interfaces_info_overall_pickle(info_dir) +- with open( +- os.path.join(info_dir, 'core', +- 'component_info_core.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'), ++ mode='rb') as component_info_file: + component_info_core = pickle.load(component_info_file) +- with open( +- os.path.join( +- info_dir, 'modules', +- 'component_info_modules.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'modules', ++ 'component_info_modules.pickle'), ++ mode='rb') as component_info_file: + component_info_modules = pickle.load(component_info_file) + return ComponentInfoProviderModules(interfaces_info, component_info_core, + component_info_modules) +@@ -356,7 +354,7 @@ def write_pickle_file(pickle_filename, data): + pickle_filename = abs(pickle_filename) + # If |data| is same with the file content, we skip updating. + if os.path.isfile(pickle_filename): +- with open(pickle_filename) as pickle_file: ++ with open(pickle_filename, 'rb') as pickle_file: + try: + if pickle.load(pickle_file) == data: + return +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py +index a432604..a85b03a 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py +@@ -189,7 +189,7 @@ def context_enabled_features(attributes): + return sorted([ + member for member in members + if member.get(KEY) and not member.get('exposed_test') +- ]) ++ ], key=lambda item: item['name']) + + def member_filter_by_name(members, name): + return [member for member in members if member[KEY] == name] +@@ -612,7 +612,8 @@ def interface_context(interface, interfaces, component_info): + sorted( + origin_trial_features(interface, context['constants'], + context['attributes'], context['methods']) + +- context_enabled_features(context['attributes'])), ++ context_enabled_features(context['attributes']), ++ key=lambda item: item['name']), + }) + if context['optional_features']: + includes.add('platform/bindings/v8_per_context_data.h') +@@ -1356,9 +1357,9 @@ def resolution_tests_methods(effective_overloads): + + # Extract argument and IDL type to simplify accessing these in each loop. + arguments = [method['arguments'][index] for method in methods] +- arguments_methods = zip(arguments, methods) ++ arguments_methods = list(zip(arguments, methods)) + idl_types = [argument['idl_type_object'] for argument in arguments] +- idl_types_methods = zip(idl_types, methods) ++ idl_types_methods = list(zip(idl_types, methods)) + + # We can’t do a single loop through all methods or simply sort them, because + # a method may be listed in multiple steps of the resolution algorithm, and +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py +index 5f1f89a..6ee8a40 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py +@@ -46,6 +46,10 @@ import v8_types + import v8_utilities + from v8_utilities import (has_extended_attribute_value, is_unforgeable) + ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str ++ + + def method_is_visible(method, interface_is_partial): + if 'overloads' in method: +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py +index 2ecd692..fcfc483 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py +@@ -271,7 +271,7 @@ EXPOSED_WORKERS = set([ + ]) + + +-class ExposureSet: ++class ExposureSet(object): + """An ExposureSet is a collection of Exposure instructions.""" + + def __init__(self, exposures=None): +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py +index 13fb7c7..b73b771 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py +@@ -91,11 +91,13 @@ class CallbackInterface(UserDefinedType, WithExtendedAttributes, + for operation_ir in ir.operations + ]) + self._operation_groups = tuple([ +- OperationGroup( +- operation_group_ir, +- filter(lambda x: x.identifier == operation_group_ir.identifier, +- self._operations), +- owner=self) for operation_group_ir in ir.operation_groups ++ OperationGroup(operation_group_ir, ++ list( ++ filter( ++ lambda x: x.identifier == operation_group_ir ++ .identifier, self._operations)), ++ owner=self) ++ for operation_group_ir in ir.operation_groups + ]) + + @property +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py +index c92cf48..f5d5912 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py +@@ -156,4 +156,4 @@ class Database(object): + return self._view_by_kind(Database._Kind.UNION) + + def _view_by_kind(self, kind): +- return self._impl.find_by_kind(kind).values() ++ return list(self._impl.find_by_kind(kind).values()) +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py +index abaeef3..e36cf74 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py +@@ -8,8 +8,11 @@ from .runtime_enabled_features import RuntimeEnabledFeatures + class _Feature(str): + """Represents a runtime-enabled feature.""" + ++ def __new__(cls, value): ++ return str.__new__(cls, value) ++ + def __init__(self, value): +- str.__init__(self, value) ++ str.__init__(self) + self._is_context_dependent = ( + RuntimeEnabledFeatures.is_context_dependent(self)) + +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py +index 648c70d..1712f19 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py +@@ -71,8 +71,9 @@ class FunctionLike(WithIdentifier): + def num_of_required_arguments(self): + """Returns the number of required arguments.""" + return len( +- filter(lambda arg: not (arg.is_optional or arg.is_variadic), +- self.arguments)) ++ list( ++ filter(lambda arg: not (arg.is_optional or arg.is_variadic), ++ self.arguments))) + + + class OverloadGroup(WithIdentifier): +@@ -171,8 +172,7 @@ class OverloadGroup(WithIdentifier): + Returns the effective overload set. + https://heycam.github.io/webidl/#compute-the-effective-overload-set + """ +- assert argument_count is None or isinstance(argument_count, +- (int, long)) ++ assert argument_count is None or isinstance(argument_count, int) + + N = argument_count + S = [] +@@ -188,21 +188,21 @@ class OverloadGroup(WithIdentifier): + + S.append( + OverloadGroup.EffectiveOverloadItem( +- X, map(lambda arg: arg.idl_type, X.arguments), +- map(lambda arg: arg.optionality, X.arguments))) ++ X, list(map(lambda arg: arg.idl_type, X.arguments)), ++ list(map(lambda arg: arg.optionality, X.arguments)))) + + if X.is_variadic: +- for i in xrange(n, max(maxarg, N)): +- t = map(lambda arg: arg.idl_type, X.arguments) +- o = map(lambda arg: arg.optionality, X.arguments) +- for _ in xrange(n, i + 1): ++ for i in range(n, max(maxarg, N)): ++ t = list(map(lambda arg: arg.idl_type, X.arguments)) ++ o = list(map(lambda arg: arg.optionality, X.arguments)) ++ for _ in range(n, i + 1): + t.append(X.arguments[-1].idl_type) + o.append(X.arguments[-1].optionality) + S.append(OverloadGroup.EffectiveOverloadItem(X, t, o)) + +- t = map(lambda arg: arg.idl_type, X.arguments) +- o = map(lambda arg: arg.optionality, X.arguments) +- for i in xrange(n - 1, -1, -1): ++ t = list(map(lambda arg: arg.idl_type, X.arguments)) ++ o = list(map(lambda arg: arg.optionality, X.arguments)) ++ for i in range(n - 1, -1, -1): + if X.arguments[i].optionality == IdlType.Optionality.REQUIRED: + break + S.append(OverloadGroup.EffectiveOverloadItem(X, t[:i], o[:i])) +@@ -222,7 +222,7 @@ class OverloadGroup(WithIdentifier): + for item in items) + assert len(items) > 1 + +- for index in xrange(len(items[0].type_list)): ++ for index in range(len(items[0].type_list)): + # Assume that the given items are valid, and we only need to test + # the two types. + if OverloadGroup.are_distinguishable_types( +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py +index c5ee2bd..5831507 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py +@@ -149,8 +149,8 @@ class IdlCompiler(object): + for old_ir in old_irs: + new_ir = make_copy(old_ir) + self._ir_map.add(new_ir) +- new_ir.attributes = filter(not_disabled, new_ir.attributes) +- new_ir.operations = filter(not_disabled, new_ir.operations) ++ new_ir.attributes = list(filter(not_disabled, new_ir.attributes)) ++ new_ir.operations = list(filter(not_disabled, new_ir.operations)) + + def _record_defined_in_partial_and_mixin(self): + old_irs = self._ir_map.irs_of_kinds( +@@ -231,7 +231,7 @@ class IdlCompiler(object): + only_to_members_of_partial_or_mixin=False) + propagate_to_exposure(propagate) + +- map(process_member_like, ir.iter_all_members()) ++ list(map(process_member_like, ir.iter_all_members())) + + def process_member_like(ir): + propagate = functools.partial(propagate_extattr, ir=ir) +@@ -257,7 +257,7 @@ class IdlCompiler(object): + + self._ir_map.move_to_new_phase() + +- map(process_interface_like, old_irs) ++ list(map(process_interface_like, old_irs)) + + def _determine_blink_headers(self): + irs = self._ir_map.irs_of_kinds( +@@ -422,9 +422,9 @@ class IdlCompiler(object): + assert not new_interface.deriveds + derived_set = identifier_to_derived_set.get( + new_interface.identifier, set()) +- new_interface.deriveds = map( +- lambda id_: self._ref_to_idl_def_factory.create(id_), +- sorted(derived_set)) ++ new_interface.deriveds = list( ++ map(lambda id_: self._ref_to_idl_def_factory.create(id_), ++ sorted(derived_set))) + + def _supplement_missing_html_constructor_operation(self): + # Temporary mitigation of misuse of [HTMLConstructor] +@@ -553,7 +553,8 @@ class IdlCompiler(object): + self._ir_map.add(new_ir) + + for group in new_ir.iter_all_overload_groups(): +- exposures = map(lambda overload: overload.exposure, group) ++ exposures = list(map(lambda overload: overload.exposure, ++ group)) + + # [Exposed] + if any(not exposure.global_names_and_features +@@ -653,8 +654,8 @@ class IdlCompiler(object): + constructs = set() + for global_name in global_names: + constructs.update(exposed_map.get(global_name, [])) +- new_ir.exposed_constructs = map( +- self._ref_to_idl_def_factory.create, sorted(constructs)) ++ new_ir.exposed_constructs = list( ++ map(self._ref_to_idl_def_factory.create, sorted(constructs))) + + assert not new_ir.legacy_window_aliases + if new_ir.identifier != 'Window': +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py +index 65d24e5..067ef2e 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py +@@ -180,8 +180,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + self._constructor_groups = tuple([ + ConstructorGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._constructors), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._constructors)), + owner=self) for group_ir in ir.constructor_groups + ]) + assert len(self._constructor_groups) <= 1 +@@ -192,8 +193,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + self._named_constructor_groups = tuple([ + ConstructorGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._named_constructors), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._named_constructors)), + owner=self) for group_ir in ir.named_constructor_groups + ]) + self._operations = tuple([ +@@ -203,22 +205,23 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=self) for group_ir in ir.operation_groups + ]) + self._exposed_constructs = tuple(ir.exposed_constructs) + self._legacy_window_aliases = tuple(ir.legacy_window_aliases) + self._indexed_and_named_properties = None +- indexed_and_named_property_operations = filter( +- lambda x: x.is_indexed_or_named_property_operation, +- self._operations) ++ indexed_and_named_property_operations = list( ++ filter(lambda x: x.is_indexed_or_named_property_operation, ++ self._operations)) + if indexed_and_named_property_operations: + self._indexed_and_named_properties = IndexedAndNamedProperties( + indexed_and_named_property_operations, owner=self) + self._stringifier = None +- stringifier_operation_irs = filter(lambda x: x.is_stringifier, +- ir.operations) ++ stringifier_operation_irs = list( ++ filter(lambda x: x.is_stringifier, ir.operations)) + if stringifier_operation_irs: + assert len(stringifier_operation_irs) == 1 + op_ir = make_copy(stringifier_operation_irs[0]) +@@ -231,8 +234,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + attribute = None + if operation.stringifier_attribute: + attr_id = operation.stringifier_attribute +- attributes = filter(lambda x: x.identifier == attr_id, +- self._attributes) ++ attributes = list( ++ filter(lambda x: x.identifier == attr_id, ++ self._attributes)) + assert len(attributes) == 1 + attribute = attributes[0] + self._stringifier = Stringifier(operation, attribute, owner=self) +@@ -578,8 +582,9 @@ class Iterable(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +@@ -666,8 +671,9 @@ class Maplike(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +@@ -755,8 +761,9 @@ class Setlike(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py +index e9aeff4..d80554d 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import sys ++ + from .argument import Argument + from .ast_group import AstGroup + from .attribute import Attribute +@@ -30,6 +32,11 @@ from .operation import Operation + from .typedef import Typedef + + ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ long = int ++ ++ + def load_and_register_idl_definitions(filepaths, register_ir, + create_ref_to_idl_def, idl_type_factory): + """ +@@ -160,7 +167,7 @@ class _IRBuilder(object): + child_nodes = list(node.GetChildren()) + extended_attributes = self._take_extended_attributes(child_nodes) + +- members = map(self._build_interface_member, child_nodes) ++ members = list(map(self._build_interface_member, child_nodes)) + attributes = [] + constants = [] + operations = [] +@@ -302,7 +309,7 @@ class _IRBuilder(object): + child_nodes = list(node.GetChildren()) + inherited = self._take_inheritance(child_nodes) + extended_attributes = self._take_extended_attributes(child_nodes) +- own_members = map(self._build_dictionary_member, child_nodes) ++ own_members = list(map(self._build_dictionary_member, child_nodes)) + + return Dictionary.IR( + identifier=Identifier(node.GetName()), +@@ -336,7 +343,7 @@ class _IRBuilder(object): + + child_nodes = list(node.GetChildren()) + extended_attributes = self._take_extended_attributes(child_nodes) +- members = map(self._build_interface_member, child_nodes) ++ members = list(map(self._build_interface_member, child_nodes)) + constants = [] + operations = [] + for member in members: +@@ -456,8 +463,8 @@ class _IRBuilder(object): + assert len(child_nodes) == 1 + child = child_nodes[0] + if child.GetClass() == 'Arguments': +- arguments = map(build_extattr_argument, +- child.GetChildren()) ++ arguments = list( ++ map(build_extattr_argument, child.GetChildren())) + elif child.GetClass() == 'Call': + assert len(child.GetChildren()) == 1 + grand_child = child.GetChildren()[0] +@@ -486,7 +493,9 @@ class _IRBuilder(object): + + assert node.GetClass() == 'ExtAttributes' + return ExtendedAttributes( +- filter(None, map(build_extended_attribute, node.GetChildren()))) ++ list( ++ filter(None, map(build_extended_attribute, ++ node.GetChildren())))) + + def _build_inheritance(self, node): + assert node.GetClass() == 'Inherit' +@@ -506,7 +515,7 @@ class _IRBuilder(object): + + def _build_iterable(self, node): + assert node.GetClass() == 'Iterable' +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 1 or len(types) == 2 + if len(types) == 1: # value iterator + key_type, value_type = (None, types[0]) +@@ -584,7 +593,7 @@ class _IRBuilder(object): + def _build_maplike(self, node, interface_identifier): + assert node.GetClass() == 'Maplike' + assert isinstance(interface_identifier, Identifier) +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 2 + key_type, value_type = types + is_readonly = bool(node.GetProperty('READONLY')) +@@ -676,7 +685,7 @@ class _IRBuilder(object): + def _build_setlike(self, node, interface_identifier): + assert node.GetClass() == 'Setlike' + assert isinstance(interface_identifier, Identifier) +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 1 + value_type = types[0] + is_readonly = bool(node.GetProperty('READONLY')) +@@ -838,7 +847,7 @@ class _IRBuilder(object): + + def build_union_type(node, extended_attributes): + return self._idl_type_factory.union_type( +- member_types=map(self._build_type, node.GetChildren()), ++ member_types=list(map(self._build_type, node.GetChildren())), + is_optional=is_optional, + extended_attributes=extended_attributes, + debug_info=self._build_debug_info(node)) +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py +index a7a2b11..2f6b613 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py +@@ -3,6 +3,13 @@ + # found in the LICENSE file. + + ++import sys ++ ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ long = int ++ basestring = str ++ + def make_copy(obj, memo=None): + """ + Creates a copy of the given object, which should be an IR or part of IR. +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py +index eeabef9..bd7e989 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py +@@ -107,11 +107,13 @@ class Namespace(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + for operation_ir in ir.operations + ]) + self._operation_groups = tuple([ +- OperationGroup( +- operation_group_ir, +- filter(lambda x: x.identifier == operation_group_ir.identifier, +- self._operations), +- owner=self) for operation_group_ir in ir.operation_groups ++ OperationGroup(operation_group_ir, ++ list( ++ filter( ++ lambda x: x.identifier == operation_group_ir ++ .identifier, self._operations)), ++ owner=self) ++ for operation_group_ir in ir.operation_groups + ]) + + @property +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl b/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl +index 0add9c4..dc910f6 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl ++++ b/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl +@@ -59,9 +59,9 @@ void {{v8_class}}::ToImpl(v8::Isolate* isolate, v8::Local v8_value, { + DCHECK(executionContext); + {% endif %}{# has_origin_trial_members #} + {% endif %}{# members #} +- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %} ++ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %} + {% filter origin_trial_enabled(origin_trial_test, "executionContext") %} +- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %} ++ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %} + {% filter runtime_enabled(feature_name) %} + {% for member in member_list %} + v8::Local {{member.v8_value}}; +@@ -147,9 +147,9 @@ bool toV8{{cpp_class}}(const {{cpp_class}}* impl, v8::Local dictiona + DCHECK(executionContext); + {% endif %}{# has_origin_trial_members #} + {% endif %}{# members #} +- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %} ++ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %} + {% filter origin_trial_enabled(origin_trial_test, "executionContext") %} +- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %} ++ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %} + {% filter runtime_enabled(feature_name) %} + {% for member in member_list %} + v8::Local {{member.v8_value}}; +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py +index 1799cd5..5f43ffa 100755 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py +@@ -71,7 +71,7 @@ class Expansion(object): + def enabled_longhands(self): + include = lambda longhand: not longhand[ + 'runtime_flag'] or self.is_enabled(longhand['runtime_flag']) +- return filter(include, self._longhands) ++ return list(filter(include, self._longhands)) + + @property + def index(self): +@@ -87,8 +87,9 @@ class Expansion(object): + + def create_expansions(longhands): + flags = collect_runtime_flags(longhands) +- expansions = map(lambda mask: Expansion(longhands, flags, mask), +- range(1 << len(flags))) ++ expansions = list( ++ map(lambda mask: Expansion(longhands, flags, mask), ++ range(1 << len(flags)))) + assert len(expansions) > 0 + # We generate 2^N expansions for N flags, so enforce some limit. + assert len(flags) <= 4, 'Too many runtime flags for a single shorthand' +@@ -114,14 +115,14 @@ class StylePropertyShorthandWriter(json5_generator.Writer): + + self._longhand_dictionary = defaultdict(list) + for property_ in json5_properties.shorthands: +- property_['longhand_enum_keys'] = map(enum_key_for_css_property, +- property_['longhands']) +- property_['longhand_property_ids'] = map(id_for_css_property, +- property_['longhands']) +- +- longhands = map( +- lambda name: json5_properties.properties_by_name[name], +- property_['longhands']) ++ property_['longhand_enum_keys'] = list( ++ map(enum_key_for_css_property, property_['longhands'])) ++ property_['longhand_property_ids'] = list( ++ map(id_for_css_property, property_['longhands'])) ++ ++ longhands = list( ++ map(lambda name: json5_properties.properties_by_name[name], ++ property_['longhands'])) + property_['expansions'] = create_expansions(longhands) + for longhand_enum_key in property_['longhand_enum_keys']: + self._longhand_dictionary[longhand_enum_key].append(property_) +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py +index 75030ac..f72aade 100755 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py +@@ -42,8 +42,8 @@ class CSSPropertyInstancesWriter(json5_generator.Writer): + aliases = self._css_properties.aliases + + # Lists of PropertyClassData. +- self._property_classes_by_id = map(self.get_class, properties) +- self._alias_classes_by_id = map(self.get_class, aliases) ++ self._property_classes_by_id = list(map(self.get_class, properties)) ++ self._alias_classes_by_id = list(map(self.get_class, aliases)) + + # Sort by enum value. + self._property_classes_by_id.sort(key=lambda t: t.enum_value) +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py +index 5ee4905..db72660 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py +@@ -95,7 +95,7 @@ def main(): + + open(args.output_file, 'wb').write( + generate_gperf(gperf_path, +- open(infile).read(), gperf_args)) ++ open(infile).read(), gperf_args).encode('utf-8')) + + + if __name__ == '__main__': +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py +index 28adc05..5811348 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py +@@ -66,7 +66,7 @@ class InFile(object): + self._defaults = defaults + self._valid_values = copy.deepcopy( + valid_values if valid_values else {}) +- self._parse(map(str.strip, lines)) ++ self._parse(list(map(str.strip, lines))) + + @classmethod + def load_from_files(self, file_paths, defaults, valid_values, +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py +index e46740a..ab1981a 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py +@@ -32,10 +32,15 @@ import os + import os.path + import shlex + import shutil ++import sys + import optparse + + from in_file import InFile + ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str ++ + + ######################################################### + # This is now deprecated - use json5_generator.py instead +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py +index cafe8d9..6925a4f 100755 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py +@@ -138,7 +138,7 @@ class RuntimeFeatureWriter(BaseRuntimeFeatureWriter): + except Exception: + # If trouble unpickling, overwrite + pass +- with open(os.path.abspath(file_name), 'w') as pickle_file: ++ with open(os.path.abspath(file_name), 'wb') as pickle_file: + pickle.dump(features_map, pickle_file) + + def _template_inputs(self): +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl +index dc3f44c..3eefcf9 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl +@@ -26,7 +26,7 @@ using {{namespace}}FunctionMap = HashMapGetExecutionContext())) { +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl +index 1b5297d..edecc81 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl +@@ -15,7 +15,7 @@ namespace blink { + class Document; + + // Type checking. +-{% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} ++{% for tag in tags|sort(attribute='name') if not tag.multipleTagNames and not tag.noTypeHelpers %} + class {{tag.interface}}; + template <> + inline bool IsElementOfType(const Node& node) { +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl +index 0244433..dcdbb02 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl +@@ -25,7 +25,7 @@ + + + {% macro trie_leaf(index, object, return_macro, lowercase_data) %} +-{% set name, value = object.items()[0] %} ++{% set name, value = (object.items()|list)[0] %} + {% if name|length %} + if ( + {%- for c in name -%} +@@ -45,7 +45,7 @@ return {{ return_macro(value) }}; + + + {% macro trie_switch(trie, index, return_macro, lowercase_data) %} +-{% if trie|length == 1 and trie.values()[0] is string %} ++{% if trie|length == 1 and (trie.values()|list)[0] is string %} + {{ trie_leaf(index, trie, return_macro, lowercase_data) -}} + {% else %} + {% if lowercase_data %} +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl +index cb05c6c..bd5566b 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl +@@ -24,12 +24,12 @@ namespace {{cpp_namespace}} { + {{symbol_export}}extern const WTF::AtomicString& {{namespace_prefix}}NamespaceURI; + + // Tags +-{% for tag in tags|sort %} ++{% for tag in tags|sort(attribute='name') %} + {{symbol_export}}extern const blink::{{namespace}}QualifiedName& {{tag|symbol}}Tag; + {% endfor %} + + // Attributes +-{% for attr in attrs|sort %} ++{% for attr in attrs|sort(attribute='name') %} + {{symbol_export}}extern const blink::QualifiedName& {{attr|symbol}}Attr; + {% endfor %} + +diff --git a/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py b/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py +index 5e3734d..e3d46bd 100644 +--- a/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py ++++ b/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py +@@ -201,6 +201,10 @@ def _compute_python_dependencies(root_dir=None): + + paths = set() + for path in module_paths: ++ # Builtin/namespaced modules may return None for the file path. ++ if not path: ++ continue ++ + path = os.path.abspath(path) + + if not path.startswith(root_dir): +diff --git a/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn b/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn +index cd488e8..ea1dc3d 100644 +--- a/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn ++++ b/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/python.gni") ++ + import("//third_party/blink/public/public_features.gni") + import("./all_devtools_files.gni") + import("./all_devtools_modules.gni") +diff --git a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py +index d6666e8..0f7a661 100644 +--- a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py ++++ b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py +@@ -45,7 +45,8 @@ def rollup(input_path, output_path, filename, max_size, rollup_plugin): + ['--format', 'iife', '-n', 'InspectorOverlay'] + ['--input', target] + + ['--plugin', rollup_plugin], + stdout=subprocess.PIPE, +- stderr=subprocess.PIPE) ++ stderr=subprocess.PIPE, ++ text=True) + out, error = rollup_process.communicate() + if not out: + raise Exception("rollup failed: " + error) +diff --git a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py +index fa8e73d..7d0b84b 100644 +--- a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py ++++ b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py +@@ -10,7 +10,7 @@ Builds applications in release mode: + and the application loader into a single script. + """ + +-from cStringIO import StringIO ++from io import StringIO + from os import path + from os.path import join + import copy +@@ -145,8 +145,7 @@ class ReleaseBuilder(object): + resource_content = read_file(path.join(self.application_dir, resource_name)) + if not (resource_name.endswith('.html') + or resource_name.endswith('md')): +- resource_content += resource_source_url(resource_name).encode( +- 'utf-8') ++ resource_content += resource_source_url(resource_name) + resource_content = resource_content.replace('\\', '\\\\') + resource_content = resource_content.replace('\n', '\\n') + resource_content = resource_content.replace('"', '\\"') +@@ -173,7 +172,9 @@ class ReleaseBuilder(object): + def _concatenate_application_script(self, output): + output.write('Root.allDescriptors.push(...%s);' % self._release_module_descriptors()) + if self.descriptors.extends: +- output.write('Root.applicationDescriptor.modules.push(...%s);' % json.dumps(self.descriptors.application.values())) ++ output.write( ++ 'Root.applicationDescriptor.modules.push(...%s);' % ++ json.dumps(list(self.descriptors.application.values()))) + else: + output.write('Root.applicationDescriptor = %s;' % self.descriptors.application_json()) + +diff --git a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py +index be510c4..c6a59c9 100644 +--- a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py ++++ b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py +@@ -123,7 +123,7 @@ def main(argv): + + try: + os.makedirs(path.join(output_directory, 'Images')) +- except OSError, e: ++ except OSError as e: + if e.errno != errno.EEXIST: + raise e + +@@ -147,7 +147,7 @@ def main(argv): + shutil.copy(path.join(dirname, filename), path.join(output_directory, 'Images')) + add_file_to_grd(doc, path.join('Images', filename)) + +- with open(parsed_args.output_filename, 'w') as output_file: ++ with open(parsed_args.output_filename, 'wb') as output_file: + output_file.write(doc.toxml(encoding='UTF-8')) + + +diff --git a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py +index 0ba695d..bb1da2f 100644 +--- a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py ++++ b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py +@@ -7,6 +7,8 @@ + Utilities for the modular DevTools build. + """ + ++from __future__ import print_function ++ + import collections + from os import path + import os +@@ -40,7 +42,7 @@ def load_and_parse_json(filename): + try: + return json.loads(read_file(filename)) + except: +- print 'ERROR: Failed to parse %s' % filename ++ print('ERROR: Failed to parse %s' % filename) + raise + + class Descriptors: +@@ -57,7 +59,7 @@ class Descriptors: + + def application_json(self): + result = dict() +- result['modules'] = self.application.values() ++ result['modules'] = list(self.application.values()) + return json.dumps(result) + + def all_compiled_files(self): +diff --git a/src/3rdparty/chromium/third_party/jinja2/tests.py b/src/3rdparty/chromium/third_party/jinja2/tests.py +index 0adc3d4..b14f85f 100644 +--- a/src/3rdparty/chromium/third_party/jinja2/tests.py ++++ b/src/3rdparty/chromium/third_party/jinja2/tests.py +@@ -10,7 +10,7 @@ + """ + import operator + import re +-from collections import Mapping ++from collections.abc import Mapping + from jinja2.runtime import Undefined + from jinja2._compat import text_type, string_types, integer_types + import decimal +diff --git a/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh b/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh +index 626d6a2..b1008cf 100755 +--- a/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh ++++ b/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh +@@ -519,8 +519,3 @@ rm -rf $TEMP_DIR + + gn format --in-place $BASE_DIR/BUILD.gn + gn format --in-place $BASE_DIR/libvpx_srcs.gni +- +-cd $BASE_DIR/$LIBVPX_SRC_DIR +-update_readme +- +-cd $BASE_DIR +diff --git a/src/3rdparty/chromium/third_party/libxml/src/encoding.c b/src/3rdparty/chromium/third_party/libxml/src/encoding.c +index 101eba9..085705b 100644 +--- a/src/3rdparty/chromium/third_party/libxml/src/encoding.c ++++ b/src/3rdparty/chromium/third_party/libxml/src/encoding.c +@@ -40,6 +40,7 @@ + #include + #include + ++#include + #include "private/buf.h" + #include "private/enc.h" + #include "private/error.h" +@@ -1999,7 +2000,7 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen, + *inlen = ucv_in - (const char*) in; + *outlen = ucv_out - (char *) out; + if (U_SUCCESS(err)) { +- /* reset pivot buf if this is the last call for input (flush==TRUE) */ ++ /* reset pivot buf if this is the last call for input (flush==true) */ + if (flush) + cd->pivot_source = cd->pivot_target = cd->pivot_buf; + return 0; +diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.cc +index fd65195..1e8d060 100644 +--- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.cc ++++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.cc +@@ -14,9 +14,9 @@ + * limitations under the License. + */ + ++#include + #include "src/trace_processor/containers/string_pool.h" + +-#include + + #include "perfetto/base/logging.h" + #include "perfetto/ext/base/utils.h" +diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/db/column.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/db/column.cc +index 00496b3..0dccfeb 100644 +--- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/db/column.cc ++++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/db/column.cc +@@ -14,6 +14,7 @@ + * limitations under the License. + */ + ++#include + #include "src/trace_processor/db/column.h" + + #include "src/trace_processor/db/compare.h" +diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/types/variadic.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/types/variadic.cc +index 837bfeb..cdd5681 100644 +--- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/types/variadic.cc ++++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/types/variadic.cc +@@ -14,6 +14,7 @@ + * limitations under the License. + */ + ++#include + #include "src/trace_processor/types/variadic.h" + + namespace perfetto { +diff --git a/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp b/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp +index 25e63f7..deb5e38 100644 +--- a/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp ++++ b/src/3rdparty/chromium/third_party/skia/src/utils/SkParseColor.cpp +@@ -7,6 +7,7 @@ + + #include + ++#include + #include "include/utils/SkParse.h" + + #include // std::lower_bound +diff --git a/src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn b/src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn +index 58d3dab..4832829 100644 +--- a/src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn ++++ b/src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn +@@ -258,10 +258,6 @@ rtc_library("perf_test") { + absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] + if (rtc_enable_protobuf) { + sources += [ "testsupport/perf_test_histogram_writer.cc" ] +- deps += [ +- "//third_party/catapult/tracing/tracing:histogram", +- "//third_party/catapult/tracing/tracing:reserved_infos", +- ] + } else { + sources += [ "testsupport/perf_test_histogram_writer_no_protobuf.cc" ] + } +@@ -566,7 +562,6 @@ if (rtc_include_tests) { + + if (rtc_enable_protobuf) { + sources += [ "testsupport/perf_test_histogram_writer_unittest.cc" ] +- deps += [ "//third_party/catapult/tracing/tracing:histogram" ] + } + + data = test_support_unittests_resources +diff --git a/src/3rdparty/chromium/tools/binary_size/BUILD.gn b/src/3rdparty/chromium/tools/binary_size/BUILD.gn +index e6806bf..2c985d1 100644 +--- a/src/3rdparty/chromium/tools/binary_size/BUILD.gn ++++ b/src/3rdparty/chromium/tools/binary_size/BUILD.gn +@@ -18,7 +18,6 @@ python_library("binary_size_trybot_py") { + python_library("sizes_py") { + testonly = true + pydeps_file = "sizes.pydeps" +- data_deps = [ "//third_party/catapult/tracing:convert_chart_json" ] + } + + if (is_linux || is_chromeos) { +diff --git a/src/3rdparty/chromium/tools/grit/BUILD.gn b/src/3rdparty/chromium/tools/grit/BUILD.gn +index 1cd3c75..60c4cf2 100644 +--- a/src/3rdparty/chromium/tools/grit/BUILD.gn ++++ b/src/3rdparty/chromium/tools/grit/BUILD.gn +@@ -33,7 +33,6 @@ group("grit_python_unittests") { + "//testing/scripts/run_isolated_script_test.py", + "//testing/xvfb.py", + "//tools/grit/", +- "//third_party/catapult/third_party/typ/", + ] + } + +diff --git a/src/3rdparty/chromium/tools/gritsettings/resource_ids.spec b/src/3rdparty/chromium/tools/gritsettings/resource_ids.spec +index d0a4545..80b0bf1 100644 +--- a/src/3rdparty/chromium/tools/gritsettings/resource_ids.spec ++++ b/src/3rdparty/chromium/tools/gritsettings/resource_ids.spec +@@ -499,12 +499,6 @@ + "content/shell/shell_resources.grd": { + "includes": [2940], + }, +- +- # This file is generated during the build. +- "<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd": { +- "META": {"sizes": {"includes": [20],}}, +- "includes": [2960], +- }, + # END content/ section. + + # START ios/web/ section. +diff --git a/src/3rdparty/chromium/tools/metrics/BUILD.gn b/src/3rdparty/chromium/tools/metrics/BUILD.gn +index 846d524..cb57d2b 100644 +--- a/src/3rdparty/chromium/tools/metrics/BUILD.gn ++++ b/src/3rdparty/chromium/tools/metrics/BUILD.gn +@@ -56,7 +56,6 @@ group("metrics_python_tests") { + "//testing/scripts/common.py", + "//testing/xvfb.py", + "//testing/test_env.py", +- "//third_party/catapult/third_party/typ/", + + # Scripts we depend on. Their unit tests are also included. + "//tools/json_comment_eater/json_comment_eater.py", +diff --git a/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py b/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py +index f9f61d9..44e46fa 100755 +--- a/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py ++++ b/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py +@@ -48,9 +48,10 @@ def ReadFilteredData(path): + data = ukm_model.UKM_XML_TYPE.Parse(ukm_file.read()) + event_tag = ukm_model._EVENT_TYPE.tag + metric_tag = ukm_model._METRIC_TYPE.tag +- data[event_tag] = filter(ukm_model.IsNotObsolete, data[event_tag]) ++ data[event_tag] = list(filter(ukm_model.IsNotObsolete, data[event_tag])) + for event in data[event_tag]: +- event[metric_tag] = filter(ukm_model.IsNotObsolete, event[metric_tag]) ++ event[metric_tag] = list( ++ filter(ukm_model.IsNotObsolete, event[metric_tag])) + return data + + +diff --git a/src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn b/src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn +index 4868810..70ebd4d 100644 +--- a/src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn ++++ b/src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn +@@ -107,7 +107,6 @@ group("telemetry_chrome_test_without_chrome") { + "//tools/perf/core/", # chrome_telemetry_build/ depends on core/ + ] + data_deps = [ +- "//third_party/catapult:telemetry_chrome_test_support", + "//tools/metrics:metrics_python_tests", + ] + +@@ -151,7 +150,5 @@ group("telemetry_chrome_test_without_chrome") { + "//build/android:devil_chromium_py", + "//build/android:stack_tools", + ] +- } else if (!is_fuchsia) { +- data_deps += [ "//third_party/catapult/telemetry:bitmaptools" ] + } + } +diff --git a/src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn b/src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn +index 7fe48cb..e9c7f02 100644 +--- a/src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn ++++ b/src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn +@@ -7,7 +7,6 @@ import("//build/util/generate_wrapper.gni") + generate_wrapper("upload_trace_processor") { + testonly = true + data_deps = [ +- "//third_party/catapult:telemetry_chrome_test_support", + "//third_party/perfetto/src/trace_processor:trace_processor_shell", + ] + data = [ +diff --git a/src/3rdparty/chromium/tools/polymer/BUILD.gn b/src/3rdparty/chromium/tools/polymer/BUILD.gn +index 092066b..d115144 100644 +--- a/src/3rdparty/chromium/tools/polymer/BUILD.gn ++++ b/src/3rdparty/chromium/tools/polymer/BUILD.gn +@@ -10,6 +10,5 @@ group("polymer_tools_python_unittests") { + "//testing/scripts/run_isolated_script_test.py", + "//testing/xvfb.py", + "//tools/polymer/", +- "//third_party/catapult/third_party/typ/", + ] + } +diff --git a/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_atk_hyperlink.cc b/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_atk_hyperlink.cc +index be91def..73f2023 100644 +--- a/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_atk_hyperlink.cc ++++ b/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_atk_hyperlink.cc +@@ -245,7 +245,7 @@ static void AXPlatformAtkHyperlinkInit(AXPlatformAtkHyperlink* self, gpointer) { + } + + GType ax_platform_atk_hyperlink_get_type() { +- static volatile gsize type_volatile = 0; ++ static gsize type_volatile = 0; + + AXPlatformNodeAuraLinux::EnsureGTypeInit(); + +diff --git a/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc b/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc +index 5c51478..35d02ce 100644 +--- a/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc ++++ b/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc +@@ -2274,7 +2274,7 @@ void ClassInit(gpointer class_pointer, gpointer /* class_data */) { + GType GetType() { + AXPlatformNodeAuraLinux::EnsureGTypeInit(); + +- static volatile gsize type_volatile = 0; ++ static gsize type_volatile = 0; + if (g_once_init_enter(&type_volatile)) { + static const GTypeInfo type_info = { + sizeof(AXPlatformNodeAuraLinuxClass), // class_size +diff --git a/src/3rdparty/chromium/ui/gtk/gtk_key_bindings_handler.cc b/src/3rdparty/chromium/ui/gtk/gtk_key_bindings_handler.cc +index c663a20..38a3424 100644 +--- a/src/3rdparty/chromium/ui/gtk/gtk_key_bindings_handler.cc ++++ b/src/3rdparty/chromium/ui/gtk/gtk_key_bindings_handler.cc +@@ -141,7 +141,7 @@ void GtkKeyBindingsHandler::HandlerClassInit(HandlerClass* klass) { + } + + GType GtkKeyBindingsHandler::HandlerGetType() { +- static volatile gsize type_id_volatile = 0; ++ static gsize type_id_volatile = 0; + if (g_once_init_enter(&type_id_volatile)) { + GType type_id = g_type_register_static_simple( + GTK_TYPE_TEXT_VIEW, g_intern_static_string("GtkKeyBindingsHandler"), +diff --git a/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py b/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py +index 8d80063..04fa18e 100755 +--- a/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py ++++ b/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py +@@ -45,12 +45,15 @@ Example Output: ./ui/ozone/generate_constructor_list.py \ + } // namespace ui + """ + ++try: ++ from StringIO import StringIO # for Python 2 ++except ImportError: ++ from io import StringIO # for Python 3 + import optparse + import os + import collections + import re + import sys +-import string + + + def GetTypedefName(typename): +@@ -68,7 +71,7 @@ def GetConstructorName(typename, platform): + This is just "Create" + typename + platform. + """ + +- return 'Create' + typename + string.capitalize(platform) ++ return 'Create' + typename + platform.capitalize() + + + def GenerateConstructorList(out, namespace, export, typenames, platforms, +@@ -163,12 +166,14 @@ def main(argv): + sys.exit(1) + + # Write to standard output or file specified by --output_cc. +- out_cc = sys.stdout ++ out_cc = getattr(sys.stdout, 'buffer', sys.stdout) + if options.output_cc: + out_cc = open(options.output_cc, 'wb') + +- GenerateConstructorList(out_cc, options.namespace, options.export, ++ out_cc_str = StringIO() ++ GenerateConstructorList(out_cc_str, options.namespace, options.export, + typenames, platforms, includes, usings) ++ out_cc.write(out_cc_str.getvalue().encode('utf-8')) + + if options.output_cc: + out_cc.close() +diff --git a/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py b/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py +index d47c398..2702b68 100755 +--- a/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py ++++ b/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py +@@ -49,12 +49,15 @@ Example Output: ./generate_ozone_platform_list.py --default wayland dri wayland + + """ + ++try: ++ from StringIO import StringIO # for Python 2 ++except ImportError: ++ from io import StringIO # for Python 3 + import optparse + import os + import collections + import re + import sys +-import string + + + def GetConstantName(name): +@@ -63,7 +66,7 @@ def GetConstantName(name): + We just capitalize the platform name and prepend "CreateOzonePlatform". + """ + +- return 'kPlatform' + string.capitalize(name) ++ return 'kPlatform' + name.capitalize() + + + def GeneratePlatformListText(out, platforms): +@@ -149,9 +152,9 @@ def main(argv): + platforms.insert(0, options.default) + + # Write to standard output or file specified by --output_{cc,h}. +- out_cc = sys.stdout +- out_h = sys.stdout +- out_txt = sys.stdout ++ out_cc = getattr(sys.stdout, 'buffer', sys.stdout) ++ out_h = getattr(sys.stdout, 'buffer', sys.stdout) ++ out_txt = getattr(sys.stdout, 'buffer', sys.stdout) + if options.output_cc: + out_cc = open(options.output_cc, 'wb') + if options.output_h: +@@ -159,9 +162,16 @@ def main(argv): + if options.output_txt: + out_txt = open(options.output_txt, 'wb') + +- GeneratePlatformListText(out_txt, platforms) +- GeneratePlatformListHeader(out_h, platforms) +- GeneratePlatformListSource(out_cc, platforms) ++ out_txt_str = StringIO() ++ out_h_str = StringIO() ++ out_cc_str = StringIO() ++ ++ GeneratePlatformListText(out_txt_str, platforms) ++ out_txt.write(out_txt_str.getvalue().encode('utf-8')) ++ GeneratePlatformListHeader(out_h_str, platforms) ++ out_h.write(out_h_str.getvalue().encode('utf-8')) ++ GeneratePlatformListSource(out_cc_str, platforms) ++ out_cc.write(out_cc_str.getvalue().encode('utf-8')) + + if options.output_cc: + out_cc.close() +diff --git a/src/3rdparty/chromium/v8/tools/BUILD.gn b/src/3rdparty/chromium/v8/tools/BUILD.gn +index 2f8197d..83304b6 100644 +--- a/src/3rdparty/chromium/v8/tools/BUILD.gn ++++ b/src/3rdparty/chromium/v8/tools/BUILD.gn +@@ -31,10 +31,6 @@ group("v8_android_test_runner_deps") { + + if (is_android && !build_with_chromium) { + data_deps = [ "//build/android:test_runner_py" ] +- data = [ +- # This is used by android.py, but not included by test_runner_py above. +- "//third_party/catapult/devil/devil/android/perf/", +- ] + } + } + +diff --git a/src/3rdparty/chromium/weblayer/shell/BUILD.gn b/src/3rdparty/chromium/weblayer/shell/BUILD.gn +index 66984a7..1815fad 100644 +--- a/src/3rdparty/chromium/weblayer/shell/BUILD.gn ++++ b/src/3rdparty/chromium/weblayer/shell/BUILD.gn +@@ -161,7 +161,6 @@ repack("support_pak") { + "$root_gen_dir/components/strings/components_locale_settings_en-US.pak", + "$root_gen_dir/components/strings/components_strings_en-US.pak", + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", + "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", +@@ -182,7 +181,6 @@ repack("support_pak") { + "//content:content_resources", + "//content:dev_ui_content_resources", + "//content/app/resources", +- "//content/browser/tracing:resources", + "//mojo/public/js:resources", + "//net:net_resources", + "//third_party/blink/public:resources", +diff --git a/src/buildtools/configure.json b/src/buildtools/configure.json +index 053468f..1fac600 100644 +--- a/src/buildtools/configure.json ++++ b/src/buildtools/configure.json +@@ -316,9 +316,9 @@ + "label": "system ninja", + "type": "detectNinja" + }, +- "webengine-python2": { +- "label": "python2", +- "type": "detectPython2", ++ "webengine-python": { ++ "label": "python3", ++ "type": "detectPython", + "log": "location" + }, + "webengine-winversion": { +@@ -395,7 +395,7 @@ + && features.webengine-gperf + && features.webengine-bison + && features.webengine-flex +- && features.webengine-python2 ++ && features.webengine-python + && features.webengine-nodejs + && (!config.sanitizer || features.webengine-sanitizer) + && (!config.unix || features.pkg-config) +@@ -420,7 +420,7 @@ + && features.webengine-gperf + && features.webengine-bison + && features.webengine-flex +- && features.webengine-python2 ++ && features.webengine-python + && (!config.sanitizer || features.webengine-sanitizer) + && (!config.linux || features.pkg-config) + && (!config.linux || features.webengine-host-pkg-config) +@@ -443,12 +443,12 @@ + "autoDetect": "features.private_tests", + "output": [ "privateFeature" ] + }, +- "webengine-python2": { +- "label": "python2", +- "condition": "tests.webengine-python2", ++ "webengine-python": { ++ "label": "python3", ++ "condition": "tests.webengine-python", + "output": [ + "privateFeature", +- { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" } ++ { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python.location" } + ] + }, + "webengine-gperf": { +diff --git a/src/core/qtwebengine_resources.gni b/src/core/qtwebengine_resources.gni +index 3bf1a5d..29fd260 100644 +--- a/src/core/qtwebengine_resources.gni ++++ b/src/core/qtwebengine_resources.gni +@@ -27,7 +27,6 @@ repack("qtwebengine_repack_resources") { + "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/components/dev_ui_components_resources.pak", + "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", + "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", +@@ -44,7 +43,6 @@ repack("qtwebengine_repack_resources") { + "//components/resources:components_resources_grit", + "//components/resources:dev_ui_components_resources_grit", + "//content/browser/resources/media:media_internals_resources", +- "//content/browser/tracing:resources", + "//content:content_resources_grit", + "//content:dev_ui_content_resources_grit", + "//mojo/public/js:resources", +-- +2.45.2 + + +From 786d8ebf83327bab3506b8ae278f0d1c4ef35c19 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sat, 16 Dec 2023 18:56:29 +1000 +Subject: Fixes build for x86 arch + + +diff --git a/src/3rdparty/chromium/base/atomicops.h b/src/3rdparty/chromium/base/atomicops.h +index 5fa27a4..1122b5f 100644 +--- a/src/3rdparty/chromium/base/atomicops.h ++++ b/src/3rdparty/chromium/base/atomicops.h +@@ -57,7 +57,11 @@ typedef intptr_t Atomic64; + + // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or + // Atomic64 routines below, depending on your architecture. ++#if defined(ARCH_CPU_64_BITS) + typedef intptr_t AtomicWord; ++#else ++typedef int32_t AtomicWord; ++#endif + + // Atomically execute: + // result = *ptr; +diff --git a/src/3rdparty/chromium/base/memory/discardable_shared_memory.cc b/src/3rdparty/chromium/base/memory/discardable_shared_memory.cc +index 4aa6229..cdfde4f 100644 +--- a/src/3rdparty/chromium/base/memory/discardable_shared_memory.cc ++++ b/src/3rdparty/chromium/base/memory/discardable_shared_memory.cc +@@ -178,7 +178,11 @@ bool DiscardableSharedMemory::CreateAndMap(size_t size) { + DCHECK(last_known_usage_.is_null()); + SharedState new_state(SharedState::LOCKED, Time()); + subtle::Release_Store( ++#if defined(ARCH_CPU_64_BITS) + &SharedStateFromSharedMemory(shared_memory_mapping_)->value.i, ++#else ++ (base::subtle::Atomic32*)&SharedStateFromSharedMemory(shared_memory_mapping_)->value.i, ++#endif + new_state.value.i); + return true; + } +@@ -239,7 +243,11 @@ DiscardableSharedMemory::LockResult DiscardableSharedMemory::Lock( + SharedState old_state(SharedState::UNLOCKED, last_known_usage_); + SharedState new_state(SharedState::LOCKED, Time()); + SharedState result(subtle::Acquire_CompareAndSwap( ++#if defined(ARCH_CPU_64_BITS) + &SharedStateFromSharedMemory(shared_memory_mapping_)->value.i, ++#else ++ (base::subtle::Atomic32*)&SharedStateFromSharedMemory(shared_memory_mapping_)->value.i, ++#endif + old_state.value.i, new_state.value.i)); + if (result.value.u != old_state.value.u) { + // Update |last_known_usage_| in case the above CAS failed because of +@@ -354,7 +362,11 @@ void DiscardableSharedMemory::Unlock(size_t offset, size_t length) { + DCHECK_EQ((new_state.GetTimestamp() - Time::UnixEpoch()).InSeconds(), + (current_time - Time::UnixEpoch()).InSeconds()); + SharedState result(subtle::Release_CompareAndSwap( ++#if defined(ARCH_CPU_64_BITS) + &SharedStateFromSharedMemory(shared_memory_mapping_)->value.i, ++#else ++ (base::subtle::Atomic32*)&SharedStateFromSharedMemory(shared_memory_mapping_)->value.i, ++#endif + old_state.value.i, new_state.value.i)); + + DCHECK_EQ(old_state.value.u, result.value.u); +@@ -375,7 +387,11 @@ bool DiscardableSharedMemory::Purge(Time current_time) { + SharedState old_state(SharedState::UNLOCKED, last_known_usage_); + SharedState new_state(SharedState::UNLOCKED, Time()); + SharedState result(subtle::Acquire_CompareAndSwap( ++#if defined(ARCH_CPU_64_BITS) + &SharedStateFromSharedMemory(shared_memory_mapping_)->value.i, ++#else ++ (base::subtle::Atomic32*)&SharedStateFromSharedMemory(shared_memory_mapping_)->value.i, ++#endif + old_state.value.i, new_state.value.i)); + + // Update |last_known_usage_| to |current_time| if the memory is locked. This +@@ -466,7 +482,11 @@ bool DiscardableSharedMemory::IsMemoryResident() const { + DCHECK(shared_memory_mapping_.IsValid()); + + SharedState result(subtle::NoBarrier_Load( ++#if defined(ARCH_CPU_64_BITS) + &SharedStateFromSharedMemory(shared_memory_mapping_)->value.i)); ++#else ++ (base::subtle::Atomic32*)&SharedStateFromSharedMemory(shared_memory_mapping_)->value.i)); ++#endif + + return result.GetLockState() == SharedState::LOCKED || + !result.GetTimestamp().is_null(); +@@ -476,7 +496,11 @@ bool DiscardableSharedMemory::IsMemoryLocked() const { + DCHECK(shared_memory_mapping_.IsValid()); + + SharedState result(subtle::NoBarrier_Load( ++#if defined(ARCH_CPU_64_BITS) + &SharedStateFromSharedMemory(shared_memory_mapping_)->value.i)); ++#else ++ (base::subtle::Atomic32*)&SharedStateFromSharedMemory(shared_memory_mapping_)->value.i)); ++#endif + + return result.GetLockState() == SharedState::LOCKED; + } +diff --git a/src/3rdparty/chromium/base/process/internal_linux.cc b/src/3rdparty/chromium/base/process/internal_linux.cc +index 41cae83..48f76d3 100644 +--- a/src/3rdparty/chromium/base/process/internal_linux.cc ++++ b/src/3rdparty/chromium/base/process/internal_linux.cc +@@ -47,13 +47,17 @@ pid_t ProcDirSlotToPid(const char* d_name) { + return 0; + + // Read the process's command line. ++#if defined(ARCH_CPU_64_BITS) + pid_t pid; ++#else ++ int pid; ++#endif + std::string pid_string(d_name); + if (!StringToInt(pid_string, &pid)) { + NOTREACHED(); + return 0; + } +- return pid; ++ return (pid_t)pid; + } + + bool ReadProcFile(const FilePath& file, std::string* buffer) { +diff --git a/src/3rdparty/chromium/base/process/internal_linux.h b/src/3rdparty/chromium/base/process/internal_linux.h +index 10fa85a..cfd5647 100644 +--- a/src/3rdparty/chromium/base/process/internal_linux.h ++++ b/src/3rdparty/chromium/base/process/internal_linux.h +@@ -121,8 +121,15 @@ void ForEachProcessTask(base::ProcessHandle process, Lambda&& lambda) { + continue; + + PlatformThreadId tid; ++#if defined(ARCH_CPU_64_BITS) + if (!StringToInt(tid_str, &tid)) + continue; ++#else ++ int tid_int; ++ if (!StringToInt(tid_str, &tid_int)) ++ continue; ++ tid = (PlatformThreadId)tid_int; ++#endif + + FilePath task_path = fd_path.Append(tid_str); + lambda(tid, task_path); +diff --git a/src/3rdparty/chromium/base/process/process_handle.h b/src/3rdparty/chromium/base/process/process_handle.h +index d7e185a..4b49da5 100644 +--- a/src/3rdparty/chromium/base/process/process_handle.h ++++ b/src/3rdparty/chromium/base/process/process_handle.h +@@ -36,6 +36,11 @@ typedef zx_handle_t ProcessHandle; + typedef zx_koid_t ProcessId; + const ProcessHandle kNullProcessHandle = ZX_HANDLE_INVALID; + const ProcessId kNullProcessId = ZX_KOID_INVALID; ++#elif defined(OS_HAIKU) ++typedef int32_t ProcessHandle; ++typedef int32_t ProcessId; ++const ProcessHandle kNullProcessHandle = 0; ++const ProcessId kNullProcessId = 0; + #elif defined(OS_POSIX) + // On POSIX, our ProcessHandle will just be the PID. + typedef pid_t ProcessHandle; +diff --git a/src/3rdparty/chromium/base/system/sys_info_posix.cc b/src/3rdparty/chromium/base/system/sys_info_posix.cc +index 9a58b6d..e018730 100644 +--- a/src/3rdparty/chromium/base/system/sys_info_posix.cc ++++ b/src/3rdparty/chromium/base/system/sys_info_posix.cc +@@ -219,7 +219,7 @@ std::string SysInfo::OperatingSystemArchitecture() { + return std::string(); + } + std::string arch(info.machine); +- if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686") { ++ if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686" || arch == "BePC") { + arch = "x86"; + } else if (arch == "amd64") { + arch = "x86_64"; +diff --git a/src/3rdparty/chromium/content/browser/zygote_host/zygote_host_impl_linux.cc b/src/3rdparty/chromium/content/browser/zygote_host/zygote_host_impl_linux.cc +index 6870307..2664266 100644 +--- a/src/3rdparty/chromium/content/browser/zygote_host/zygote_host_impl_linux.cc ++++ b/src/3rdparty/chromium/content/browser/zygote_host/zygote_host_impl_linux.cc +@@ -177,7 +177,11 @@ pid_t ZygoteHostImpl::LaunchZygote( + close(fds[1]); + control_fd->reset(fds[0]); + ++#if defined(ARCH_CPU_64_BITS) + pid_t pid = process.Pid(); ++#else ++ int32_t pid = process.Pid(); ++#endif + + if (is_sandboxed_zygote && (use_namespace_sandbox_ || use_suid_sandbox_)) { + // The namespace and SUID sandbox will execute the zygote in a new +@@ -200,7 +204,11 @@ pid_t ZygoteHostImpl::LaunchZygote( + + // Now receive the message that the zygote's ready to go, along with the + // main zygote process's ID. ++#if defined(ARCH_CPU_64_BITS) + pid_t real_pid; ++#else ++ int32_t real_pid; ++#endif + CHECK(ReceiveFixedMessage(fds[0], kZygoteHelloMessage, + sizeof(kZygoteHelloMessage), &real_pid)); + CHECK_GT(real_pid, 1); +diff --git a/src/3rdparty/chromium/content/common/zygote/zygote_communication_linux.cc b/src/3rdparty/chromium/content/common/zygote/zygote_communication_linux.cc +index 474be46..9ec8402 100644 +--- a/src/3rdparty/chromium/content/common/zygote/zygote_communication_linux.cc ++++ b/src/3rdparty/chromium/content/common/zygote/zygote_communication_linux.cc +@@ -123,7 +123,11 @@ pid_t ZygoteCommunication::ForkRequest( + // Sanity check that we've populated |fds| correctly. + DCHECK_EQ(num_fds_to_send, fds.size()); + ++#if defined(ARCH_CPU_64_BITS) + pid_t pid; ++#else ++ int32_t pid; ++#endif + { + base::AutoLock lock(control_lock_); + if (!SendMessage(pickle, &fds)) +diff --git a/src/3rdparty/chromium/gpu/ipc/common/memory_stats_mojom_traits.h b/src/3rdparty/chromium/gpu/ipc/common/memory_stats_mojom_traits.h +index e76b61b..97a3e17 100644 +--- a/src/3rdparty/chromium/gpu/ipc/common/memory_stats_mojom_traits.h ++++ b/src/3rdparty/chromium/gpu/ipc/common/memory_stats_mojom_traits.h +@@ -37,7 +37,7 @@ struct StructTraits { + static std::map + process_map(const gpu::VideoMemoryUsageStats& stats) { +-#if defined(OS_WIN) || defined(OS_FUCHSIA) ++#if defined(OS_WIN) || defined(OS_FUCHSIA) || defined(OS_HAIKU) + std::map map; + for (const auto& pair : stats.process_map) + map[static_cast(pair.first)] = pair.second; +@@ -53,7 +53,7 @@ struct StructTraits process_map; + if (!data.ReadProcessMap(&process_map)) + return false; +diff --git a/src/3rdparty/chromium/third_party/blink/public/platform/web_vector.h b/src/3rdparty/chromium/third_party/blink/public/platform/web_vector.h +index 2cc291d..83b2538 100644 +--- a/src/3rdparty/chromium/third_party/blink/public/platform/web_vector.h ++++ b/src/3rdparty/chromium/third_party/blink/public/platform/web_vector.h +@@ -81,7 +81,7 @@ class WebVector { + // The vector can be populated using reserve() and emplace_back(). + WebVector() = default; + +-#if defined(ARCH_CPU_64_BITS) ++#if defined(ARCH_CPU_64_BITS) || defined(__HAIKU__) + // Create a vector with |size| default-constructed elements. We define + // a constructor with size_t otherwise we'd have a duplicate define. + explicit WebVector(size_t size) : data_(size) {} +diff --git a/src/3rdparty/chromium/v8/src/base/atomicops.h b/src/3rdparty/chromium/v8/src/base/atomicops.h +index 5d6422b..9299d4c 100644 +--- a/src/3rdparty/chromium/v8/src/base/atomicops.h ++++ b/src/3rdparty/chromium/v8/src/base/atomicops.h +@@ -73,6 +73,8 @@ using Atomic64 = intptr_t; + // Atomic64 routines below, depending on your architecture. + #if defined(V8_OS_STARBOARD) + using AtomicWord = SbAtomicPtr; ++#elif defined(V8_TARGET_ARCH_IA32) ++using AtomicWord = int32_t; + #else + using AtomicWord = intptr_t; + #endif +diff --git a/src/3rdparty/gn/tools/gn/args.cc b/src/3rdparty/gn/tools/gn/args.cc +index a2f49b1..0d79586 100644 +--- a/src/3rdparty/gn/tools/gn/args.cc ++++ b/src/3rdparty/gn/tools/gn/args.cc +@@ -336,7 +336,7 @@ void Args::SetSystemVarsLocked(Scope* dest) const { + // Set the host CPU architecture based on the underlying OS, not + // whatever the current bit-tedness of the GN binary is. + std::string os_arch = OperatingSystemArchitecture(); +- if (os_arch == "x86") ++ if (os_arch == "x86" || os_arch == "BePC") + arch = kX86; + else if (os_arch == "x86_64") + arch = kX64; +-- +2.45.2 + + +From a4102618b5e8f8c9e77a458ccb59358e50953935 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 29 Aug 2024 09:35:54 +1000 +Subject: Use internal ffmpeg + + +diff --git a/src/3rdparty/chromium/media/audio/audio_features.cc b/src/3rdparty/chromium/media/audio/audio_features.cc +index af2faa4..e486542 100644 +--- a/src/3rdparty/chromium/media/audio/audio_features.cc ++++ b/src/3rdparty/chromium/media/audio/audio_features.cc +@@ -12,7 +12,7 @@ namespace features { + const base::Feature kAudioServiceOutOfProcessKillAtHang{ + "AudioServiceOutOfProcessKillAtHang", + #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \ +- defined(OS_CHROMEOS) ++ defined(OS_CHROMEOS) || defined(OS_HAIKU) + base::FEATURE_ENABLED_BY_DEFAULT + #else + base::FEATURE_DISABLED_BY_DEFAULT +diff --git a/src/3rdparty/chromium/media/audio/audio_input_device.cc b/src/3rdparty/chromium/media/audio/audio_input_device.cc +index 64dadc3..e9c2a6f 100644 +--- a/src/3rdparty/chromium/media/audio/audio_input_device.cc ++++ b/src/3rdparty/chromium/media/audio/audio_input_device.cc +@@ -253,7 +253,7 @@ void AudioInputDevice::OnStreamCreated( + // here. See comments in AliveChecker and PowerObserverHelper for details and + // todos. + if (detect_dead_stream_ == DeadStreamDetection::kEnabled) { +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + const bool stop_at_first_alive_notification = true; + const bool pause_check_during_suspend = false; + #else +diff --git a/src/3rdparty/chromium/media/audio/audio_manager.cc b/src/3rdparty/chromium/media/audio/audio_manager.cc +index 01ccb57..1b469f6 100644 +--- a/src/3rdparty/chromium/media/audio/audio_manager.cc ++++ b/src/3rdparty/chromium/media/audio/audio_manager.cc +@@ -48,7 +48,7 @@ class AudioManagerHelper { + } + #endif + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + void set_app_name(const std::string& app_name) { app_name_ = app_name; } + const std::string& app_name() const { return app_name_; } + #endif +@@ -59,7 +59,7 @@ class AudioManagerHelper { + std::unique_ptr com_initializer_for_testing_; + #endif + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + std::string app_name_; + #endif + +@@ -130,7 +130,7 @@ std::unique_ptr AudioManager::CreateForTesting( + return Create(std::move(audio_thread), GetHelper()->fake_log_factory()); + } + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // static + void AudioManager::SetGlobalAppName(const std::string& app_name) { + GetHelper()->set_app_name(app_name); +diff --git a/src/3rdparty/chromium/media/audio/audio_manager.h b/src/3rdparty/chromium/media/audio/audio_manager.h +index c89151d..d7c60ac 100644 +--- a/src/3rdparty/chromium/media/audio/audio_manager.h ++++ b/src/3rdparty/chromium/media/audio/audio_manager.h +@@ -60,7 +60,7 @@ class MEDIA_EXPORT AudioManager { + static std::unique_ptr CreateForTesting( + std::unique_ptr audio_thread); + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // Sets the name of the audio source as seen by external apps. Only actually + // used with PulseAudio and MPRIS as of this writing. + static void SetGlobalAppName(const std::string& app_name); +diff --git a/src/3rdparty/chromium/media/base/audio_latency.cc b/src/3rdparty/chromium/media/base/audio_latency.cc +index c181ec4..1e1e106 100644 +--- a/src/3rdparty/chromium/media/base/audio_latency.cc ++++ b/src/3rdparty/chromium/media/base/audio_latency.cc +@@ -114,7 +114,7 @@ int AudioLatency::GetRtcBufferSize(int sample_rate, int hardware_buffer_size) { + } + + #if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) || \ +- defined(OS_FUCHSIA) ++ defined(OS_FUCHSIA) || defined(OS_HAIKU) + // On Linux, MacOS and Fuchsia, the low level IO implementations on the + // browser side supports all buffer size the clients want. We use the native + // peer connection buffer size (10ms) to achieve best possible performance. +diff --git a/src/3rdparty/chromium/media/base/media_switches.cc b/src/3rdparty/chromium/media/base/media_switches.cc +index 22101ed..94c9a82 100644 +--- a/src/3rdparty/chromium/media/base/media_switches.cc ++++ b/src/3rdparty/chromium/media/base/media_switches.cc +@@ -361,7 +361,7 @@ const base::Feature kGav1VideoDecoder{"Gav1VideoDecoder", + const base::Feature kGlobalMediaControls { + "GlobalMediaControls", + #if defined(OS_WIN) || defined(OS_MAC) || \ +- (defined(OS_LINUX) && !defined(OS_CHROMEOS)) ++ (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_HAIKU) + base::FEATURE_ENABLED_BY_DEFAULT + #else + base::FEATURE_DISABLED_BY_DEFAULT +diff --git a/src/3rdparty/chromium/media/base/status.cc b/src/3rdparty/chromium/media/base/status.cc +index 1e30c22..9f9d902 100644 +--- a/src/3rdparty/chromium/media/base/status.cc ++++ b/src/3rdparty/chromium/media/base/status.cc +@@ -70,7 +70,9 @@ Status&& Status::AddCause(Status&& cause) && { + + void Status::AddFrame(const base::Location& location) { + DCHECK(data_); ++#if SUPPORTS_LOCATION_BUILTINS + data_->frames.push_back(MediaSerialize(location)); ++#endif + } + + Status OkStatus() { +diff --git a/src/3rdparty/chromium/media/base/video_frame.cc b/src/3rdparty/chromium/media/base/video_frame.cc +index e889678..94cbeaa 100644 +--- a/src/3rdparty/chromium/media/base/video_frame.cc ++++ b/src/3rdparty/chromium/media/base/video_frame.cc +@@ -60,7 +60,7 @@ std::string VideoFrame::StorageTypeToString( + return "OWNED_MEMORY"; + case VideoFrame::STORAGE_SHMEM: + return "SHMEM"; +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + case VideoFrame::STORAGE_DMABUFS: + return "DMABUFS"; + #endif +@@ -77,7 +77,7 @@ std::string VideoFrame::StorageTypeToString( + // static + bool VideoFrame::IsStorageTypeMappable(VideoFrame::StorageType storage_type) { + return +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // This is not strictly needed but makes explicit that, at VideoFrame + // level, DmaBufs are not mappable from userspace. + storage_type != VideoFrame::STORAGE_DMABUFS && +@@ -262,7 +262,7 @@ static base::Optional GetDefaultLayout( + return VideoFrameLayout::CreateWithPlanes(format, coded_size, planes); + } + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // This class allows us to embed a vector into a scoped_refptr, and + // thus to have several VideoFrames share the same set of DMABUF FDs. + class VideoFrame::DmabufHolder +@@ -607,7 +607,7 @@ scoped_refptr VideoFrame::WrapExternalGpuMemoryBuffer( + } + + uint64_t modifier = gfx::NativePixmapHandle::kNoModifier; +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + if (gpu_memory_buffer->GetType() == gfx::NATIVE_PIXMAP) { + const auto gmb_handle = gpu_memory_buffer->CloneHandle(); + if (gmb_handle.is_null() || +@@ -645,7 +645,7 @@ scoped_refptr VideoFrame::WrapExternalGpuMemoryBuffer( + return frame; + } + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // static + scoped_refptr VideoFrame::WrapExternalDmabufs( + const VideoFrameLayout& layout, +@@ -847,7 +847,7 @@ scoped_refptr VideoFrame::WrapVideoFrame( + } + } + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + DCHECK(frame->dmabuf_fds_); + // If there are any |dmabuf_fds_| plugged in, we should refer them too. + wrapping_frame->dmabuf_fds_ = frame->dmabuf_fds_; +@@ -1190,7 +1190,7 @@ VideoFrame::mailbox_holder(size_t texture_index) const { + : mailbox_holders_[texture_index]; + } + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + const std::vector& VideoFrame::DmabufFds() const { + DCHECK_EQ(storage_type_, STORAGE_DMABUFS); + +@@ -1273,7 +1273,7 @@ VideoFrame::VideoFrame(const VideoFrameLayout& layout, + storage_type_(storage_type), + visible_rect_(Intersection(visible_rect, gfx::Rect(layout.coded_size()))), + natural_size_(natural_size), +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + dmabuf_fds_(base::MakeRefCounted()), + #endif + timestamp_(timestamp), +diff --git a/src/3rdparty/chromium/media/base/video_frame.h b/src/3rdparty/chromium/media/base/video_frame.h +index e31d70d..b61acc3 100644 +--- a/src/3rdparty/chromium/media/base/video_frame.h ++++ b/src/3rdparty/chromium/media/base/video_frame.h +@@ -41,7 +41,7 @@ + #include "base/mac/scoped_cftyperef.h" + #endif // defined(OS_MAC) + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + #include "base/files/scoped_file.h" + #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) + +@@ -83,7 +83,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe { + STORAGE_UNOWNED_MEMORY = 2, // External, non owned data pointers. + STORAGE_OWNED_MEMORY = 3, // VideoFrame has allocated its own data buffer. + STORAGE_SHMEM = 4, // Backed by unsafe (writable) shared memory. +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // TODO(mcasas): Consider turning this type into STORAGE_NATIVE + // based on the idea of using this same enum value for both DMA + // buffers on Linux and CVPixelBuffers on Mac (which currently use +@@ -260,7 +260,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe { + ReleaseMailboxCB mailbox_holder_release_cb, + base::TimeDelta timestamp); + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // Wraps provided dmabufs + // (https://www.kernel.org/doc/html/latest/driver-api/dma-buf.html) with a + // VideoFrame. The frame will take ownership of |dmabuf_fds|, and will +@@ -507,7 +507,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe { + // mailbox, the caller must wait for the included sync point. + const gpu::MailboxHolder& mailbox_holder(size_t texture_index) const; + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // Returns a vector containing the backing DmaBufs for this frame. The number + // of returned DmaBufs will be equal or less than the number of planes of + // the frame. If there are less, this means that the last FD contains the +@@ -696,7 +696,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe { + // GPU memory buffer, if this frame is STORAGE_GPU_MEMORY_BUFFER. + std::unique_ptr gpu_memory_buffer_; + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + class DmabufHolder; + + // Dmabufs for the frame, used when storage is STORAGE_DMABUFS. Size is either +diff --git a/src/3rdparty/chromium/media/blink/webmediaplayer_impl.cc b/src/3rdparty/chromium/media/blink/webmediaplayer_impl.cc +index 28ada62..d148d8d 100644 +--- a/src/3rdparty/chromium/media/blink/webmediaplayer_impl.cc ++++ b/src/3rdparty/chromium/media/blink/webmediaplayer_impl.cc +@@ -280,8 +280,11 @@ void CreateAllocation(base::trace_event::ProcessMemoryDump* pmd, + + auto* std_allocator = base::trace_event::MemoryDumpManager::GetInstance() + ->system_allocator_pool_name(); +- if (std_allocator) ++ if (std_allocator == nullptr) { ++ pmd->AddSuballocation(dump->guid(), std::string()); ++ } else { + pmd->AddSuballocation(dump->guid(), std_allocator); ++ } + } + + // Determine whether we should update MediaPosition in |delegate_|. +diff --git a/src/3rdparty/chromium/media/gpu/buffer_validation.cc b/src/3rdparty/chromium/media/gpu/buffer_validation.cc +index 3b7921b..8793774 100644 +--- a/src/3rdparty/chromium/media/gpu/buffer_validation.cc ++++ b/src/3rdparty/chromium/media/gpu/buffer_validation.cc +@@ -12,7 +12,7 @@ + #include "ui/gfx/geometry/size.h" + #include "ui/gfx/gpu_memory_buffer.h" + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + #include + #include + #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) +@@ -20,7 +20,7 @@ + namespace media { + + bool GetFileSize(const int fd, size_t* size) { +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + if (fd < 0) { + VLOGF(1) << "Invalid file descriptor"; + return false; +@@ -56,7 +56,7 @@ bool VerifyGpuMemoryBufferHandle(media::VideoPixelFormat pixel_format, + VLOGF(1) << "Unexpected GpuMemoryBufferType: " << gmb_handle.type; + return false; + } +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + const size_t num_planes = media::VideoFrame::NumPlanes(pixel_format); + if (num_planes != gmb_handle.native_pixmap_handle.planes.size() || + num_planes == 0) { +diff --git a/src/3rdparty/chromium/media/mojo/clients/mojo_video_encode_accelerator.cc b/src/3rdparty/chromium/media/mojo/clients/mojo_video_encode_accelerator.cc +index 57e6015..be7246e 100644 +--- a/src/3rdparty/chromium/media/mojo/clients/mojo_video_encode_accelerator.cc ++++ b/src/3rdparty/chromium/media/mojo/clients/mojo_video_encode_accelerator.cc +@@ -134,7 +134,7 @@ void MojoVideoEncodeAccelerator::Encode(scoped_refptr frame, + DCHECK_EQ(num_planes, frame->layout().num_planes()); + DCHECK(vea_.is_bound()); + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + // TODO(crbug.com/1003197): Remove this once we stop supporting STORAGE_DMABUF + // in VideoEncodeAccelerator. + if (frame->storage_type() == VideoFrame::STORAGE_DMABUFS) { +diff --git a/src/3rdparty/chromium/media/mojo/mojom/video_frame_mojom_traits.cc b/src/3rdparty/chromium/media/mojo/mojom/video_frame_mojom_traits.cc +index 1f50120..aa421a7 100644 +--- a/src/3rdparty/chromium/media/mojo/mojom/video_frame_mojom_traits.cc ++++ b/src/3rdparty/chromium/media/mojo/mojom/video_frame_mojom_traits.cc +@@ -21,7 +21,7 @@ + #include "ui/gfx/mojom/color_space_mojom_traits.h" + #include "ui/gl/mojom/hdr_metadata_mojom_traits.h" + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + #include "base/posix/eintr_wrapper.h" + #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) + +@@ -63,7 +63,7 @@ media::mojom::VideoFrameDataPtr MakeVideoFrameData( + std::move(offsets))); + } + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + if (input->storage_type() == media::VideoFrame::STORAGE_DMABUFS) { + std::vector dmabuf_fds; + +@@ -166,7 +166,7 @@ bool StructTraits gpu_task_runner, + base::WeakPtr media_gpu_channel_manager, +@@ -299,7 +299,7 @@ std::unique_ptr GpuMojoMediaClient::CreateVideoDecoder( + } + + #elif defined(OS_MAC) || defined(OS_WIN) || defined(OS_LINUX) || \ +- defined(OS_CHROMEOS) ++ defined(OS_CHROMEOS) || defined(OS_HAIKU) + #if defined(OS_WIN) + // Don't instantiate the DXVA decoder if it's not supported. + if (gpu_workarounds_.disable_dxva_video_decoder) +diff --git a/src/3rdparty/chromium/media/video/fake_gpu_memory_buffer.cc b/src/3rdparty/chromium/media/video/fake_gpu_memory_buffer.cc +index 891bcbb..1abf309 100644 +--- a/src/3rdparty/chromium/media/video/fake_gpu_memory_buffer.cc ++++ b/src/3rdparty/chromium/media/video/fake_gpu_memory_buffer.cc +@@ -10,7 +10,7 @@ + #include "media/base/format_utils.h" + #include "media/base/video_frame.h" + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + #include + #include + #include +@@ -48,7 +48,7 @@ class FakeGpuMemoryBufferImpl : public gpu::GpuMemoryBufferImpl { + + } // namespace + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + base::ScopedFD GetDummyFD() { + base::ScopedFD fd(open("/dev/zero", O_RDWR)); + DCHECK(fd.is_valid()); +@@ -78,7 +78,7 @@ FakeGpuMemoryBuffer::FakeGpuMemoryBuffer(const gfx::Size& size, + static base::NoDestructor buffer_id_generator; + handle_.id = gfx::GpuMemoryBufferId(buffer_id_generator->GetNext()); + +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + for (size_t i = 0; i < VideoFrame::NumPlanes(video_pixel_format_); i++) { + const gfx::Size plane_size_in_bytes = + VideoFrame::PlaneSize(video_pixel_format_, i, size_); +@@ -135,7 +135,7 @@ gfx::GpuMemoryBufferHandle FakeGpuMemoryBuffer::CloneHandle() const { + gfx::GpuMemoryBufferHandle handle; + handle.type = gfx::NATIVE_PIXMAP; + handle.id = handle_.id; +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + handle.native_pixmap_handle = + gfx::CloneHandleForIPC(handle_.native_pixmap_handle); + #endif +diff --git a/src/3rdparty/chromium/media/video/gpu_memory_buffer_video_frame_pool.cc b/src/3rdparty/chromium/media/video/gpu_memory_buffer_video_frame_pool.cc +index cff6651..761c1c2 100644 +--- a/src/3rdparty/chromium/media/video/gpu_memory_buffer_video_frame_pool.cc ++++ b/src/3rdparty/chromium/media/video/gpu_memory_buffer_video_frame_pool.cc +@@ -573,7 +573,7 @@ void GpuMemoryBufferVideoFramePool::PoolImpl::CreateHardwareFrame( + } + + bool is_software_backed_video_frame = !video_frame->HasTextures(); +-#if defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + is_software_backed_video_frame &= !video_frame->HasDmaBufs(); + #endif + +diff --git a/src/3rdparty/chromium/third_party/ffmpeg/BUILD.gn b/src/3rdparty/chromium/third_party/ffmpeg/BUILD.gn +old mode 100755 +new mode 100644 +index 8dacfa7..4ebf9c2 +--- a/src/3rdparty/chromium/third_party/ffmpeg/BUILD.gn ++++ b/src/3rdparty/chromium/third_party/ffmpeg/BUILD.gn +@@ -15,7 +15,7 @@ platform_config_root = + + has_nasm_deps = + ffmpeg_asm_sources != [] && +- (current_cpu == "x86" || current_cpu == "x64") && os_config != "linux-noasm" ++ (current_cpu == "x86" || current_cpu == "x64") && os_config != "linux-noasm" && os_config != "haiku" + if (has_nasm_deps) { + import("//third_party/nasm/nasm_assemble.gni") + +@@ -336,7 +336,7 @@ target(link_target_type, "ffmpeg_internal") { + "-L", + rebase_path(target_gen_dir, root_build_dir), + ] +- if (!is_android && !is_fuchsia) { ++ if (!is_android && !is_fuchsia && !is_haiku) { + # OS=android requires that both -lz and -lm occur after + # -lc++_shared on the link command line. Android link rules + # already include -lm, and we get -lz as a transitive dependency +diff --git a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py +index 0f606df..d774e17 100755 +--- a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py ++++ b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py +@@ -54,7 +54,7 @@ ffmpeg_c_sources = [] + ffmpeg_gas_sources = [] + ffmpeg_asm_sources = [] + +-use_linux_config = is_linux || is_chromeos || is_fuchsia ++use_linux_config = is_linux || is_chromeos || is_fuchsia || is_haiku + + """ + GN_CONDITION_BEGIN = """if (%s) { +diff --git a/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg_generated.gni b/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg_generated.gni +index 41bccf9..8570592 100644 +--- a/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg_generated.gni ++++ b/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg_generated.gni +@@ -12,7 +12,7 @@ ffmpeg_c_sources = [] + ffmpeg_gas_sources = [] + ffmpeg_asm_sources = [] + +-use_linux_config = is_linux || is_chromeos || is_fuchsia ++use_linux_config = is_linux || is_chromeos || is_fuchsia || is_haiku + + if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && current_cpu == "arm64") || (is_android && current_cpu == "mips64el") || (is_android && current_cpu == "mipsel") || (is_android && current_cpu == "x64") || (is_android && current_cpu == "x86") || (is_mac) || (is_win) || (use_linux_config)) { + ffmpeg_c_sources += [ +diff --git a/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg_options.gni b/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg_options.gni +index 0654f3d..11704a0 100644 +--- a/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg_options.gni ++++ b/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg_options.gni +@@ -66,7 +66,7 @@ if (current_cpu == "x86") { + } + + os_config = current_os +-if ((is_linux || is_chromeos) && is_msan) { ++if ((is_linux || is_chromeos || is_haiku) && is_msan) { + os_config = "linux-noasm" + } else if (is_chromeos || is_fuchsia) { + os_config = "linux" +diff --git a/src/3rdparty/chromium/third_party/ffmpeg/libavutil/cpu.c b/src/3rdparty/chromium/third_party/ffmpeg/libavutil/cpu.c +index 52f6b9a..9504fc2 100644 +--- a/src/3rdparty/chromium/third_party/ffmpeg/libavutil/cpu.c ++++ b/src/3rdparty/chromium/third_party/ffmpeg/libavutil/cpu.c +@@ -41,8 +41,10 @@ + #include + #endif + #include ++#ifndef __HAIKU__ + #include + #endif ++#endif + #if HAVE_UNISTD_H + #include + #endif +-- +2.45.2 + + +From 433574ac2262db326775d440ac205b587fe72867 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 29 Aug 2024 09:37:18 +1000 +Subject: Use ICU 74 + + +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator.cc +index e34b073..c0f9268 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator.cc ++++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator.cc +@@ -162,7 +162,9 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar + }; + // clang-format on + +-#if U_ICU_VERSION_MAJOR_NUM >= 58 ++#if U_ICU_VERSION_MAJOR_NUM >= 74 ++#define BA_LB_COUNT (U_LB_COUNT - 8) ++#elif U_ICU_VERSION_MAJOR_NUM >= 58 + #define BA_LB_COUNT (U_LB_COUNT - 3) + #else + #define BA_LB_COUNT U_LB_COUNT +-- +2.45.2 + + +From 748d584b33eaea0a9ccd9d53ee66cb365d4b3d56 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 29 Aug 2024 09:38:00 +1000 +Subject: Fix discardable memory + + +diff --git a/src/3rdparty/chromium/base/memory/discardable_memory.cc b/src/3rdparty/chromium/base/memory/discardable_memory.cc +index 6ef3f1f..c77288d 100644 +--- a/src/3rdparty/chromium/base/memory/discardable_memory.cc ++++ b/src/3rdparty/chromium/base/memory/discardable_memory.cc +@@ -23,7 +23,7 @@ const base::Feature kMadvFreeDiscardableMemory{ + "MadvFreeDiscardableMemory", base::FEATURE_DISABLED_BY_DEFAULT}; + #endif // defined(OS_POSIX) + +-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + const base::Feature kDiscardableMemoryBackingTrial{ + "DiscardableMemoryBackingTrial", base::FEATURE_DISABLED_BY_DEFAULT}; + +@@ -41,13 +41,13 @@ const base::FeatureParam + DiscardableMemoryTrialGroup::kEmulatedSharedMemory, + &kDiscardableMemoryBackingParamOptions}; + +-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + + } // namespace features + + namespace { + +-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + + DiscardableMemoryBacking GetBackingForFieldTrial() { + DiscardableMemoryTrialGroup trial_group = +@@ -61,11 +61,11 @@ DiscardableMemoryBacking GetBackingForFieldTrial() { + } + NOTREACHED(); + } +-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + + } // namespace + +-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + + // Probe capabilities of this device to determine whether we should participate + // in the discardable memory backing trial. +@@ -87,18 +87,18 @@ DiscardableMemoryTrialGroup GetDiscardableMemoryBackingFieldTrialGroup() { + DCHECK(DiscardableMemoryBackingFieldTrialIsEnabled()); + return features::kDiscardableMemoryBackingParam.Get(); + } +-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + + DiscardableMemory::DiscardableMemory() = default; + + DiscardableMemory::~DiscardableMemory() = default; + + DiscardableMemoryBacking GetDiscardableMemoryBacking() { +-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + if (DiscardableMemoryBackingFieldTrialIsEnabled()) { + return GetBackingForFieldTrial(); + } +-#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#endif // defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + + #if defined(OS_ANDROID) + if (ashmem_device_is_supported()) +diff --git a/src/3rdparty/chromium/base/memory/discardable_memory_internal.h b/src/3rdparty/chromium/base/memory/discardable_memory_internal.h +index eccf20b..79f1fff 100644 +--- a/src/3rdparty/chromium/base/memory/discardable_memory_internal.h ++++ b/src/3rdparty/chromium/base/memory/discardable_memory_internal.h +@@ -10,7 +10,7 @@ + #include "base/metrics/field_trial_params.h" + #include "build/build_config.h" + +-#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) ++#if defined(OS_ANDROID) || defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_HAIKU) + + namespace base { + +@@ -47,6 +47,6 @@ GetDiscardableMemoryBackingFieldTrialGroup(); + + } // namespace base + +-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) ++#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_HAIKU) + + #endif // BASE_MEMORY_DISCARDABLE_MEMORY_INTERNAL_H_ +-- +2.45.2 diff --git a/dev-qt/qtwebengine/qtwebengine-5.15.16.recipe b/dev-qt/qtwebengine/qtwebengine-5.15.17.recipe similarity index 89% rename from dev-qt/qtwebengine/qtwebengine-5.15.16.recipe rename to dev-qt/qtwebengine/qtwebengine-5.15.17.recipe index 760a5c744..d02adc412 100644 --- a/dev-qt/qtwebengine/qtwebengine-5.15.16.recipe +++ b/dev-qt/qtwebengine/qtwebengine-5.15.17.recipe @@ -2,13 +2,13 @@ SUMMARY="Chromium-based rendering library for the Qt5 framework" DESCRIPTION="QtWebEngine provides a Web browser engine that integrates \ Chromium's fast moving web capabilities into Qt. " HOMEPAGE="https://www.qt.io" -COPYRIGHT="2015-2023 The Qt Company Ltd." +COPYRIGHT="2015-2024 The Qt Company Ltd." LICENSE="BSD (3-clause) GNU LGPL v2.1" -REVISION="4" -SOURCE_URI="https://pkg.freebsd.org/ports-distfiles/KDE/Qt/${portVersion}/kde-qtwebengine-${portVersion}p5.tar.xz" -CHECKSUM_SHA256="a35887269d3e060859d00f399aa19dfb9e004d6bbf0dbb6daf1c60708c9dee78" -SOURCE_DIR="kde-qtwebengine-${portVersion}p5" +REVISION="1" +SOURCE_URI="https://anduin.linuxfromscratch.org/BLFS/qtwebengine/qtwebengine-${portVersion}.tar.xz" +CHECKSUM_SHA256="95af410a77799d25447744477f6d09ede5120e2b27e87afa56d91101c2a13543" +SOURCE_DIR="qtwebengine-${portVersion}" PATCHES=" qtwebengine-$portVersion.patchset qtwebengine-$portVersion-build-fixes-python3.patchset @@ -21,12 +21,12 @@ SECONDARY_ARCHITECTURES="?x86" libVersion="$portVersion" libVersionCompat="$libVersion compat >= ${libVersion%%.*}" -Qt5Version="5.15.11" +Qt5Version="5.15.14" WebEngineApiVersion="5.15.17" PROVIDES=" qtwebengine$secondaryArchSuffix = $portVersion compat >= 5 - cmd:qwebengine_convert_dict = $portVersion compat >= 5 + cmd:qwebengine_convert_dict$secondaryArchSuffix = $portVersion compat >= 5 lib:libQt5Pdf$secondaryArchSuffix = $libVersionCompat lib:libQt5PdfWidgets$secondaryArchSuffix = $libVersionCompat lib:libQt5WebEngine$secondaryArchSuffix = $libVersionCompat @@ -35,14 +35,13 @@ PROVIDES=" " REQUIRES=" haiku$secondaryArchSuffix - lib:libavcodec$secondaryArchSuffix - lib:libavformat$secondaryArchSuffix - lib:libavutil$secondaryArchSuffix lib:libexecinfo$secondaryArchSuffix lib:libexpat$secondaryArchSuffix lib:libfontconfig$secondaryArchSuffix lib:libfreetype$secondaryArchSuffix lib:libgl$secondaryArchSuffix + lib:libharfbuzz$secondaryArchSuffix + lib:libharfbuzz_subset$secondaryArchSuffix lib:libicuuc$secondaryArchSuffix lib:libicui18n$secondaryArchSuffix lib:libicudata$secondaryArchSuffix @@ -91,14 +90,13 @@ REQUIRES_devel=" BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel - devel:libavcodec$secondaryArchSuffix >= 58 devel:libexecinfo$secondaryArchSuffix devel:libexpat$secondaryArchSuffix devel:libfontconfig$secondaryArchSuffix devel:libfreetype$secondaryArchSuffix devel:libglib_2.0$secondaryArchSuffix devel:libharfbuzz$secondaryArchSuffix - devel:libicuuc$secondaryArchSuffix >= 66 + devel:libicuuc$secondaryArchSuffix >= 74 devel:libjpeg$secondaryArchSuffix devel:libjsoncpp$secondaryArchSuffix devel:liblcms2$secondaryArchSuffix @@ -118,7 +116,7 @@ BUILD_REQUIRES=" devel:libQt5WebChannel$secondaryArchSuffix devel:libre2$secondaryArchSuffix devel:libsnappy$secondaryArchSuffix - devel:libssl$secondaryArchSuffix + devel:libssl$secondaryArchSuffix >= 3 devel:libvpx$secondaryArchSuffix devel:libvulkan$secondaryArchSuffix devel:libwebp$secondaryArchSuffix >= 7 @@ -134,11 +132,11 @@ BUILD_PREREQUIRES=" cmd:gcc$secondaryArchSuffix cmd:gperf cmd:ld$secondaryArchSuffix - cmd:lld >= 16 + cmd:lld >= 18 cmd:make cmd:nasm cmd:ninja - cmd:node >= 16 + cmd:node >= 20 cmd:perl pkgconfig$secondaryArchSuffix cmd:pkg_config$secondaryArchSuffix @@ -159,9 +157,8 @@ BUILD() qmake QMAKE_LFLAGS+="-fuse-ld=lld -Wl,--no-keep-memory -Wl,--undefined-version" \ .. -- \ -proprietary-codecs \ - -system-ffmpeg \ - -system-opus \ -system-webp \ + -qt-webengine-ffmpeg \ -webengine-icu NINJAJOBS=$jobArgs make