Thorium Browser added
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
--- a/build/linux/unbundle/openh264.gn
|
||||
+++ b/build/linux/unbundle/openh264.gn
|
||||
@@ -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("//build/buildflag_header.gni")
|
||||
import("//build/config/linux/pkg_config.gni")
|
||||
import("//build/shim_headers.gni")
|
||||
|
||||
@@ -34,3 +35,9 @@ source_set("encoder") {
|
||||
deps = [ ":openh264_shim" ]
|
||||
public_configs = [ ":config" ]
|
||||
}
|
||||
+
|
||||
+buildflag_header("buildflags") {
|
||||
+ header = "buildflags.h"
|
||||
+ header_dir = "third_party/openh264"
|
||||
+ flags = [ "OPENH264_API_WELS=1" ]
|
||||
+}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
|
||||
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
|
||||
@@ -19,7 +19,6 @@ limitations under the License.
|
||||
#include <cstdio>
|
||||
|
||||
#include "absl/strings/string_view.h" // from @com_google_absl
|
||||
-#include "third_party/zlib/contrib/minizip/ioapi.h"
|
||||
|
||||
namespace tflite {
|
||||
namespace metadata {
|
||||
@@ -0,0 +1,25 @@
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/2959890
|
||||
|
||||
--- a/ui/views/animation/ink_drop_host.h
|
||||
+++ b/ui/views/animation/ink_drop_host.h
|
||||
@@ -238,6 +238,11 @@ class VIEWS_EXPORT InkDropHost {
|
||||
// Used to observe View and inform the InkDrop of host-transform changes.
|
||||
ViewLayerTransformObserver host_view_transform_observer_;
|
||||
|
||||
+ // Declared before |ink_drop_|, because InkDropImpl may call
|
||||
+ // RemoveInkDropLayer on partly destructed InkDropHost. In
|
||||
+ // that case |ink_drop_mask_| must be still valid.
|
||||
+ std::unique_ptr<views::InkDropMask> ink_drop_mask_;
|
||||
+
|
||||
// Should not be accessed directly. Use GetInkDrop() instead.
|
||||
std::unique_ptr<InkDrop> ink_drop_;
|
||||
|
||||
@@ -261,8 +266,6 @@ class VIEWS_EXPORT InkDropHost {
|
||||
int ink_drop_small_corner_radius_ = 2;
|
||||
int ink_drop_large_corner_radius_ = 4;
|
||||
|
||||
- std::unique_ptr<views::InkDropMask> ink_drop_mask_;
|
||||
-
|
||||
base::RepeatingCallback<std::unique_ptr<InkDrop>()> create_ink_drop_callback_;
|
||||
base::RepeatingCallback<std::unique_ptr<InkDropRipple>()>
|
||||
create_ink_drop_ripple_callback_;
|
||||
@@ -0,0 +1,40 @@
|
||||
--- chromium-118.0.5993.54/media/filters/ffmpeg_demuxer.cc.orig 2023-10-04 23:53:53.691762700 +0200
|
||||
+++ chromium-118.0.5993.54/media/filters/ffmpeg_demuxer.cc 2023-10-08 16:56:57.616681160 +0200
|
||||
@@ -398,7 +398,11 @@
|
||||
// TODO(crbug.com/1471504): This is now broken without side data; remove.
|
||||
buffer = DecoderBuffer::CopyFrom(packet->data, packet->size);
|
||||
} else {
|
||||
+#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T
|
||||
size_t side_data_size = 0;
|
||||
+#else
|
||||
+ int side_data_size = 0;
|
||||
+#endif
|
||||
uint8_t* side_data = av_packet_get_side_data(
|
||||
packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
|
||||
|
||||
@@ -461,7 +465,11 @@
|
||||
packet->size - data_offset);
|
||||
}
|
||||
|
||||
+#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T
|
||||
size_t skip_samples_size = 0;
|
||||
+#else
|
||||
+ int skip_samples_size = 0;
|
||||
+#endif
|
||||
const uint32_t* skip_samples_ptr =
|
||||
reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
|
||||
packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
|
||||
--- chromium-118.0.5993.54/media/filters/audio_decoder_unittest.cc.orig 2023-10-04 23:53:53.683762000 +0200
|
||||
+++ chromium-118.0.5993.54/media/filters/audio_decoder_unittest.cc 2023-10-08 16:58:23.727519824 +0200
|
||||
@@ -108,7 +108,11 @@
|
||||
}
|
||||
|
||||
// If the timestamp is positive, try to use FFmpeg's discard data.
|
||||
+#if defined FF_API_BUFFER_SIZE_T && ! FF_API_BUFFER_SIZE_T
|
||||
size_t skip_samples_size = 0;
|
||||
+#else
|
||||
+ int skip_samples_size = 0;
|
||||
+#endif
|
||||
const uint32_t* skip_samples_ptr =
|
||||
reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
|
||||
packet, AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
|
||||
@@ -0,0 +1,68 @@
|
||||
--- a/components/qr_code_generator/BUILD.gn
|
||||
+++ b/components/qr_code_generator/BUILD.gn
|
||||
@@ -38,24 +38,11 @@
|
||||
"qr_code_generator.h",
|
||||
]
|
||||
deps = [
|
||||
- ":qr_code_generator_ffi_glue",
|
||||
"//base",
|
||||
]
|
||||
public_deps = [
|
||||
":error",
|
||||
"//base",
|
||||
- ]
|
||||
-}
|
||||
-
|
||||
-rust_static_library("qr_code_generator_ffi_glue") {
|
||||
- allow_unsafe = true # Needed for FFI that underpins the `cxx` crate.
|
||||
- crate_root = "qr_code_generator_ffi_glue.rs"
|
||||
- sources = [ "qr_code_generator_ffi_glue.rs" ]
|
||||
- cxx_bindings = [ "qr_code_generator_ffi_glue.rs" ]
|
||||
- visibility = [ ":qr_code_generator" ]
|
||||
- deps = [
|
||||
- ":error",
|
||||
- "//third_party/rust/qr_code/v2:lib",
|
||||
]
|
||||
}
|
||||
|
||||
--- a/components/qr_code_generator/qr_code_generator.cc
|
||||
+++ b/components/qr_code_generator/qr_code_generator.cc
|
||||
@@ -8,9 +8,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/check_op.h"
|
||||
-#include "base/containers/span_rust.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
-#include "components/qr_code_generator/qr_code_generator_ffi_glue.rs.h"
|
||||
|
||||
namespace qr_code_generator {
|
||||
|
||||
@@ -22,27 +20,7 @@
|
||||
base::expected<GeneratedCode, Error> GenerateCode(
|
||||
base::span<const uint8_t> in,
|
||||
std::optional<int> min_version) {
|
||||
- rust::Slice<const uint8_t> rs_in = base::SpanToRustSlice(in);
|
||||
-
|
||||
- // `min_version` might come from a fuzzer and therefore we use a lenient
|
||||
- // `saturated_cast` instead of a `checked_cast`.
|
||||
- int16_t rs_min_version =
|
||||
- base::saturated_cast<int16_t>(min_version.value_or(0));
|
||||
-
|
||||
- std::vector<uint8_t> result_pixels;
|
||||
- size_t result_width = 0;
|
||||
- Error result_error = Error::kUnknownError;
|
||||
- bool result_is_success = generate_qr_code_using_rust(
|
||||
- rs_in, rs_min_version, result_pixels, result_width, result_error);
|
||||
-
|
||||
- if (!result_is_success) {
|
||||
- return base::unexpected(result_error);
|
||||
- }
|
||||
- GeneratedCode code;
|
||||
- code.data = std::move(result_pixels);
|
||||
- code.qr_size = base::checked_cast<int>(result_width);
|
||||
- CHECK_EQ(code.data.size(), static_cast<size_t>(code.qr_size * code.qr_size));
|
||||
- return code;
|
||||
+ return base::unexpected(Error::kUnknownError);
|
||||
}
|
||||
|
||||
} // namespace qr_code_generator
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/chrome/browser/webauthn/BUILD.gn
|
||||
+++ b/chrome/browser/webauthn/BUILD.gn
|
||||
@@ -26,6 +26,5 @@
|
||||
"//url",
|
||||
]
|
||||
|
||||
- data_deps = [ "//third_party/cloud_authenticator/test/local_service:cloud_authenticator_test_service" ]
|
||||
}
|
||||
}
|
||||
--- a/chrome/test/BUILD.gn
|
||||
+++ b/chrome/test/BUILD.gn
|
||||
@@ -7112,7 +7112,6 @@
|
||||
"//third_party/metrics_proto",
|
||||
"//third_party/microsoft_webauthn",
|
||||
"//third_party/re2",
|
||||
- "//third_party/rust/fend_core/v1/wrapper:unit_tests",
|
||||
"//third_party/webrtc_overrides:webrtc_component",
|
||||
"//third_party/widevine/cdm:headers",
|
||||
"//third_party/zlib/google:compression_utils",
|
||||
@@ -0,0 +1,45 @@
|
||||
From b6cda4bc2283a02a5b5209c0f4282a8365f6f33e Mon Sep 17 00:00:00 2001
|
||||
From: Matt Jolly <Matt.Jolly@footclan.ninja>
|
||||
Date: Tue, 21 May 2024 10:04:24 +1000
|
||||
Subject: [PATCH] www-client/chromium: work around dead oauth2 credentials -
|
||||
126 update
|
||||
|
||||
126 changed the function proto; patch rebased.
|
||||
|
||||
Google doesn't let us bake in OAuth2 credentials, and for some time,
|
||||
Google sign-in has been broken. Arch dealt with this in March, and so
|
||||
did we to some degree, but in the last few months, our sign-in
|
||||
credentials have been broken. It appears that we actually did remove API
|
||||
credentials in March around Chrome 89, but they got added back, perhaps
|
||||
when rotating newer versions to replace older versions. Work around this
|
||||
by following Arch's lead: we remove the predefined credentials, as
|
||||
before, but also we patch Chromium so that people can use their own
|
||||
easily, using Arch's patch for that.
|
||||
|
||||
For more info, see:
|
||||
|
||||
https://archlinux.org/news/chromium-losing-sync-support-in-early-march/
|
||||
https://bodhi.fedoraproject.org/updates/FEDORA-2021-48866282e5
|
||||
https://hackaday.com/2021/01/26/whats-the-deal-with-chromium-on-linux-google-at-odds-with-package-maintainers/
|
||||
|
||||
Bug: https://bugs.gentoo.org/791871
|
||||
Signed-off-by: Matt Jolly <kangie@gentoo.org>
|
||||
--- a/google_apis/google_api_keys-inc.cc
|
||||
+++ b/google_apis/google_api_keys-inc.cc
|
||||
@@ -193,11 +193,11 @@ class APIKeyCache {
|
||||
std::string default_client_id = CalculateKeyValue(
|
||||
GOOGLE_DEFAULT_CLIENT_ID,
|
||||
STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), std::string(),
|
||||
- nullptr, std::string(), environment.get(), command_line, gaia_config);
|
||||
+ ::switches::kOAuth2ClientID, std::string(), environment.get(), command_line, gaia_config);
|
||||
std::string default_client_secret = CalculateKeyValue(
|
||||
GOOGLE_DEFAULT_CLIENT_SECRET,
|
||||
STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), std::string(),
|
||||
- nullptr, std::string(), environment.get(), command_line, gaia_config);
|
||||
+ ::switches::kOAuth2ClientSecret, std::string(), environment.get(), command_line, gaia_config);
|
||||
|
||||
// We currently only allow overriding the baked-in values for the
|
||||
// default OAuth2 client ID and secret using a command-line
|
||||
--
|
||||
2.45.1
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--- a/build/rust/cargo_crate.gni
|
||||
+++ b/build/rust/cargo_crate.gni
|
||||
@@ -5,6 +5,8 @@
|
||||
import("//build/rust/rust_executable.gni")
|
||||
import("//build/rust/rust_macro.gni")
|
||||
import("//build/rust/rust_static_library.gni")
|
||||
+
|
||||
+rust_sysroot=""
|
||||
|
||||
# This template allows for building Cargo crates within gn.
|
||||
#
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
--- a/third_party/blink/renderer/platform/image-decoders/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/image-decoders/BUILD.gn
|
||||
@@ -74,12 +74,9 @@
|
||||
sources += [
|
||||
"avif/avif_image_decoder.cc",
|
||||
"avif/avif_image_decoder.h",
|
||||
- "avif/crabbyavif_image_decoder.cc",
|
||||
- "avif/crabbyavif_image_decoder.h",
|
||||
]
|
||||
|
||||
deps += [
|
||||
- "//third_party/crabbyavif",
|
||||
"//third_party/libavif",
|
||||
"//third_party/libavifinfo",
|
||||
]
|
||||
--- a/third_party/blink/renderer/platform/image-decoders/image_decoder.cc
|
||||
+++ b/third_party/blink/renderer/platform/image-decoders/image_decoder.cc
|
||||
@@ -47,7 +47,6 @@
|
||||
|
||||
#if BUILDFLAG(ENABLE_AV1_DECODER)
|
||||
#include "third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.h"
|
||||
-#include "third_party/blink/renderer/platform/image-decoders/avif/crabbyavif_image_decoder.h"
|
||||
#endif
|
||||
|
||||
namespace blink {
|
||||
@@ -192,9 +191,7 @@
|
||||
return "image/bmp";
|
||||
}
|
||||
#if BUILDFLAG(ENABLE_AV1_DECODER)
|
||||
- if (base::FeatureList::IsEnabled(blink::features::kCrabbyAvif)
|
||||
- ? CrabbyAVIFImageDecoder::MatchesAVIFSignature(fast_reader)
|
||||
- : AVIFImageDecoder::MatchesAVIFSignature(fast_reader)) {
|
||||
+ if (AVIFImageDecoder::MatchesAVIFSignature(fast_reader)) {
|
||||
return "image/avif";
|
||||
}
|
||||
#endif
|
||||
@@ -300,11 +300,7 @@
|
||||
max_decoded_bytes);
|
||||
#if BUILDFLAG(ENABLE_AV1_DECODER)
|
||||
} else if (mime_type == "image/avif") {
|
||||
- if (base::FeatureList::IsEnabled(blink::features::kCrabbyAvif)) {
|
||||
- decoder = std::make_unique<CrabbyAVIFImageDecoder>(
|
||||
- alpha_option, high_bit_depth_decoding_option, color_behavior,
|
||||
- max_decoded_bytes, animation_option);
|
||||
- } else {
|
||||
+ if (true) {
|
||||
decoder = std::make_unique<AVIFImageDecoder>(
|
||||
alpha_option, high_bit_depth_decoding_option, color_behavior,
|
||||
max_decoded_bytes, animation_option);
|
||||
@@ -0,0 +1,53 @@
|
||||
From 1c8472c1a44e63c96da7b7cb3873a2822635c18b Mon Sep 17 00:00:00 2001
|
||||
From: Rune Lillesveen <futhark@chromium.org>
|
||||
Date: Fri, 03 Dec 2021 12:28:22 +0100
|
||||
Subject: [PATCH] Make dark theme Gtk affect preferred color scheme.
|
||||
|
||||
Selecting a dark Gtk theme gives a dark NativeThemeGtk and UI, but it
|
||||
didn't affect the preferred color scheme on the web instance. Hence, the
|
||||
prefers-color-scheme media query still matched 'light', not 'dark'.
|
||||
|
||||
Observe the ui native theme instance to propagate any theme changes to
|
||||
the web instance. Code copied from the NativeThemeWin implementation.
|
||||
|
||||
This is a reland of:
|
||||
|
||||
https://chromium-review.googlesource.com/c/chromium/src/+/1774922
|
||||
|
||||
Bug: 998903
|
||||
Change-Id: Id8147ecfbda1f3f5899a1e35b97f36382e63e899
|
||||
---
|
||||
|
||||
diff --git a/ui/gtk/native_theme_gtk.cc b/ui/gtk/native_theme_gtk.cc
|
||||
index 4afa399..fbaaf06e 100644
|
||||
--- a/ui/gtk/native_theme_gtk.cc
|
||||
+++ b/ui/gtk/native_theme_gtk.cc
|
||||
@@ -96,6 +96,12 @@
|
||||
NativeThemeGtk::NativeThemeGtk()
|
||||
: NativeThemeBase(/*should_only_use_dark_colors=*/false,
|
||||
ui::SystemTheme::kGtk) {
|
||||
+ // Add the web native theme as an observer to stay in sync with dark mode,
|
||||
+ // high contrast, and preferred color scheme changes.
|
||||
+ color_scheme_observer_ =
|
||||
+ std::make_unique<NativeTheme::ColorSchemeNativeThemeObserver>(
|
||||
+ NativeTheme::GetInstanceForWeb());
|
||||
+ AddObserver(color_scheme_observer_.get());
|
||||
OnThemeChanged(gtk_settings_get_default(), nullptr);
|
||||
}
|
||||
|
||||
diff --git a/ui/gtk/native_theme_gtk.h b/ui/gtk/native_theme_gtk.h
|
||||
index 876a738..ad3b88d41 100644
|
||||
--- a/ui/gtk/native_theme_gtk.h
|
||||
+++ b/ui/gtk/native_theme_gtk.h
|
||||
@@ -93,6 +93,11 @@
|
||||
mutable absl::optional<SkColor> color_cache_[kColorId_NumColors];
|
||||
|
||||
ScopedCssProvider theme_css_override_;
|
||||
+
|
||||
+ // Used to notify the web native theme of changes to dark mode, high
|
||||
+ // contrast, and preferred color scheme.
|
||||
+ std::unique_ptr<NativeTheme::ColorSchemeNativeThemeObserver>
|
||||
+ color_scheme_observer_;
|
||||
};
|
||||
|
||||
} // namespace gtk
|
||||
@@ -0,0 +1,63 @@
|
||||
--- a/chrome/renderer/chrome_render_frame_observer.cc
|
||||
+++ b/chrome/renderer/chrome_render_frame_observer.cc
|
||||
@@ -69,7 +69,6 @@
|
||||
#include "url/gurl.h"
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
-#include "chrome/renderer/accessibility/read_anything_app_controller.h"
|
||||
#include "chrome/renderer/searchbox/searchbox_extension.h"
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
@@ -320,21 +319,6 @@ void ChromeRenderFrameObserver::DidCommi
|
||||
}
|
||||
|
||||
void ChromeRenderFrameObserver::DidClearWindowObject() {
|
||||
-#if !BUILDFLAG(IS_ANDROID)
|
||||
- const base::CommandLine& command_line =
|
||||
- *base::CommandLine::ForCurrentProcess();
|
||||
- if (command_line.HasSwitch(switches::kInstantProcess))
|
||||
- SearchBoxExtension::Install(render_frame()->GetWebFrame());
|
||||
-
|
||||
- // Install ReadAnythingAppController on render frames with the Read Anything
|
||||
- // url, which is chrome-untrusted. ReadAnythingAppController installs v8
|
||||
- // bindings in the chrome.readingMode namespace which are consumed by
|
||||
- // read_anything/app.ts, the resource of the Read Anything WebUI.
|
||||
- if (render_frame()->GetWebFrame()->GetDocument().Url() ==
|
||||
- chrome::kChromeUIUntrustedReadAnythingSidePanelURL) {
|
||||
- ReadAnythingAppController::Install(render_frame());
|
||||
- }
|
||||
-#endif // !BUILDFLAG(IS_ANDROID)
|
||||
}
|
||||
|
||||
void ChromeRenderFrameObserver::DidMeaningfulLayout(
|
||||
--- a/chrome/renderer/BUILD.gn
|
||||
+++ b/chrome/renderer/BUILD.gn
|
||||
@@ -383,18 +383,6 @@ static_library("renderer") {
|
||||
]
|
||||
} else {
|
||||
sources += [
|
||||
- "accessibility/ax_tree_distiller.cc",
|
||||
- "accessibility/ax_tree_distiller.h",
|
||||
- "accessibility/read_aloud_app_model.cc",
|
||||
- "accessibility/read_aloud_app_model.h",
|
||||
- "accessibility/read_aloud_traversal_utils.cc",
|
||||
- "accessibility/read_aloud_traversal_utils.h",
|
||||
- "accessibility/read_anything_app_controller.cc",
|
||||
- "accessibility/read_anything_app_controller.h",
|
||||
- "accessibility/read_anything_app_model.cc",
|
||||
- "accessibility/read_anything_app_model.h",
|
||||
- "accessibility/read_anything_node_utils.cc",
|
||||
- "accessibility/read_anything_node_utils.h",
|
||||
"media/chrome_speech_recognition_client.cc",
|
||||
"media/chrome_speech_recognition_client.h",
|
||||
"searchbox/searchbox.cc",
|
||||
--- a/services/passage_embeddings/passage_embeddings_service.cc
|
||||
+++ b/services/passage_embeddings/passage_embeddings_service.cc
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
#include "base/files/file.h"
|
||||
#include "components/optimization_guide/machine_learning_tflite_buildflags.h"
|
||||
-#include "services/passage_embeddings/passage_embedder.h"
|
||||
|
||||
namespace passage_embeddings {
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
diff '--color=auto' -urN chromium-130.0.6723.174.orig/chrome/browser/ui/browser_commands.cc chromium-130.0.6723.174/chrome/browser/ui/browser_commands.cc
|
||||
--- chromium-130.0.6723.174.orig/chrome/browser/ui/browser_commands.cc 2024-12-20 16:23:12.000000000 +0100
|
||||
+++ chromium-130.0.6723.174/chrome/browser/ui/browser_commands.cc 2025-07-08 16:23:07.925563618 +0200
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "chrome/browser/ui/browser_commands.h"
|
||||
|
||||
#include <memory>
|
||||
+#include <numeric>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
diff '--color=auto' -urN chromium-130.0.6723.174.orig/chrome/browser/ui/lens/lens_overlay_controller.cc chromium-130.0.6723.174/chrome/browser/ui/lens/lens_overlay_controller.cc
|
||||
--- chromium-130.0.6723.174.orig/chrome/browser/ui/lens/lens_overlay_controller.cc 2024-12-20 16:23:12.000000000 +0100
|
||||
+++ chromium-130.0.6723.174/chrome/browser/ui/lens/lens_overlay_controller.cc 2025-07-08 16:23:07.925373915 +0200
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/system/sys_info.h"
|
||||
#include "base/task/bind_post_task.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
+#include "base/task/thread_pool.h"
|
||||
#include "chrome/browser/feedback/show_feedback_page.h"
|
||||
#include "chrome/browser/lens/core/mojom/geometry.mojom.h"
|
||||
#include "chrome/browser/lens/core/mojom/overlay_object.mojom.h"
|
||||
diff '--color=auto' -urN chromium-130.0.6723.174.orig/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc chromium-130.0.6723.174/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
|
||||
--- chromium-130.0.6723.174.orig/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc 2024-12-20 16:23:12.000000000 +0100
|
||||
+++ chromium-130.0.6723.174/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc 2025-07-08 16:23:07.925657709 +0200
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
#include "base/functional/bind.h"
|
||||
+#include "base/metrics/histogram_functions.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "chrome/browser/accessibility/accessibility_state_utils.h"
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
diff '--color=auto' -urN chromium-130.0.6723.174.orig/chrome/browser/ui/webui/searchbox/searchbox_handler.cc chromium-130.0.6723.174/chrome/browser/ui/webui/searchbox/searchbox_handler.cc
|
||||
--- chromium-130.0.6723.174.orig/chrome/browser/ui/webui/searchbox/searchbox_handler.cc 2024-12-20 16:23:12.000000000 +0100
|
||||
+++ chromium-130.0.6723.174/chrome/browser/ui/webui/searchbox/searchbox_handler.cc 2025-07-08 16:23:07.925476942 +0200
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "base/base64.h"
|
||||
#include "base/base64url.h"
|
||||
+#include "base/containers/contains.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
diff '--color=auto' -urN chromium-130.0.6723.174.orig/third_party/re2/src/re2/re2.h chromium-130.0.6723.174/third_party/re2/src/re2/re2.h
|
||||
--- chromium-130.0.6723.174.orig/third_party/re2/src/re2/re2.h 2024-12-20 16:23:12.000000000 +0100
|
||||
+++ chromium-130.0.6723.174/third_party/re2/src/re2/re2.h 2025-07-08 16:20:41.135306190 +0200
|
||||
@@ -220,7 +220,7 @@
|
||||
#include "absl/base/call_once.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/types/optional.h"
|
||||
-#include "re2/stringpiece.h"
|
||||
+#include "stringpiece.h"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <TargetConditionals.h>
|
||||
@@ -0,0 +1,93 @@
|
||||
--- a/skia/BUILD.gn
|
||||
+++ b/skia/BUILD.gn
|
||||
@@ -8,7 +8,6 @@
|
||||
import("//build/config/freetype/freetype.gni")
|
||||
import("//build/config/rust.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
-import("//build/rust/rust_static_library.gni")
|
||||
import("//gpu/vulkan/features.gni")
|
||||
import("//testing/test.gni")
|
||||
import("//third_party/skia/gn/shared_sources.gni")
|
||||
@@ -47,27 +46,6 @@
|
||||
]
|
||||
}
|
||||
|
||||
-source_set("path_bridge") {
|
||||
- sources = skia_fontations_path_bridge_sources
|
||||
-}
|
||||
-
|
||||
-rust_static_library("bridge_rust_side") {
|
||||
- allow_unsafe = true
|
||||
- crate_root = skia_fontations_bridge_root
|
||||
- sources = skia_fontations_bridge_sources
|
||||
- cxx_bindings = skia_fontations_bridge_sources
|
||||
- deps = [
|
||||
- ":path_bridge",
|
||||
- "//third_party/rust/font_types/v0_7:lib",
|
||||
- "//third_party/rust/read_fonts/v0_22:lib",
|
||||
- "//third_party/rust/skrifa/v0_22:lib",
|
||||
- ]
|
||||
- configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
- configs += [
|
||||
- ":skia_config",
|
||||
- "//build/config/compiler:no_chromium_code",
|
||||
- ]
|
||||
-}
|
||||
|
||||
# External-facing config for dependent code.
|
||||
config("skia_config") {
|
||||
@@ -394,15 +373,9 @@
|
||||
# See SK_TYPEFACE_FACTORY_FREETYPE
|
||||
sources += skia_ports_freetype_sources
|
||||
sources += skia_ports_fontmgr_custom_sources
|
||||
- sources += skia_ports_typeface_fontations_sources
|
||||
sources += skia_ports_fontmgr_empty_sources
|
||||
public += skia_ports_fontmgr_empty_public
|
||||
|
||||
- # Fontations Rust/C++ bridge interfaces.
|
||||
- deps += [
|
||||
- ":bridge_rust_side",
|
||||
- ":path_bridge",
|
||||
- ]
|
||||
}
|
||||
|
||||
if (is_win) {
|
||||
--- a/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/web_font_typeface_factory.cc
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "third_party/blink/renderer/platform/fonts/opentype/font_format_check.h"
|
||||
#include "third_party/skia/include/core/SkStream.h"
|
||||
#include "third_party/skia/include/core/SkTypeface.h"
|
||||
-#include "third_party/skia/include/ports/SkTypeface_fontations.h"
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "third_party/blink/renderer/platform/fonts/win/dwrite_font_format_support.h"
|
||||
@@ -54,7 +53,7 @@
|
||||
}
|
||||
|
||||
sk_sp<SkTypeface> MakeTypefaceDefaultFontMgr(sk_sp<SkData> data) {
|
||||
-#if !(BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE))
|
||||
+#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE))
|
||||
if (RuntimeEnabledFeatures::FontationsFontBackendEnabled()) {
|
||||
std::unique_ptr<SkStreamAsset> stream(new SkMemoryStream(data));
|
||||
return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments());
|
||||
@@ -82,10 +81,6 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
-sk_sp<SkTypeface> MakeTypefaceFontations(sk_sp<SkData> data) {
|
||||
- std::unique_ptr<SkStreamAsset> stream(new SkMemoryStream(data));
|
||||
- return SkTypeface_Make_Fontations(std::move(stream), SkFontArguments());
|
||||
-}
|
||||
|
||||
sk_sp<SkTypeface> MakeVariationsTypeface(
|
||||
sk_sp<SkData> data,
|
||||
@@ -187,7 +182,6 @@
|
||||
const FontFormatCheck format_check(data);
|
||||
const FontInstantiator instantiator = {
|
||||
MakeTypefaceDefaultFontMgr,
|
||||
- MakeTypefaceFontations,
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE)
|
||||
MakeTypefaceFallback,
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
diff -r -u chromium-120.0.6099.129old/components/viz/service/display/surface_aggregator.cc chromium-120.0.6099.129/components/viz/service/display/surface_aggregator.cc
|
||||
--- chromium-120.0.6099.129old/components/viz/service/display/surface_aggregator.cc 2023-12-21 01:49:05.646315300 +0100
|
||||
+++ chromium-120.0.6099.129/components/viz/service/display/surface_aggregator.cc 2023-12-21 15:28:15.668850824 +0100
|
||||
@@ -2228,7 +2228,7 @@
|
||||
root_surface_id_ = surface_id;
|
||||
|
||||
// Start recording new stats for this aggregation.
|
||||
- stats_.emplace();
|
||||
+ stats_.emplace(AggregateStatistics{});
|
||||
|
||||
base::ElapsedTimer prewalk_timer;
|
||||
ResolvedFrameData* resolved_frame = GetResolvedFrame(surface_id);
|
||||
diff -r -u chromium-120.0.6099.129old/gpu/command_buffer/service/shared_image/shared_image_backing.cc chromium-120.0.6099.129/gpu/command_buffer/service/shared_image/shared_image_backing.cc
|
||||
--- chromium-120.0.6099.129old/gpu/command_buffer/service/shared_image/shared_image_backing.cc 2023-12-21 01:49:08.186538700 +0100
|
||||
+++ chromium-120.0.6099.129/gpu/command_buffer/service/shared_image/shared_image_backing.cc 2023-12-21 15:59:04.210747172 +0100
|
||||
@@ -343,7 +343,7 @@
|
||||
|
||||
void SharedImageBacking::OnWriteSucceeded() {
|
||||
AutoLock auto_lock(this);
|
||||
- scoped_write_uma_.emplace();
|
||||
+ scoped_write_uma_.emplace(gpu::SharedImageBacking::ScopedWriteUMA{});
|
||||
}
|
||||
|
||||
size_t SharedImageBacking::GetEstimatedSize() const {
|
||||
diff -r -u chromium-120.0.6099.129old/gpu/command_buffer/service/shared_image/shared_image_backing.h chromium-120.0.6099.129/gpu/command_buffer/service/shared_image/shared_image_backing.h
|
||||
--- chromium-120.0.6099.129old/gpu/command_buffer/service/shared_image/shared_image_backing.h 2023-12-21 01:49:08.186538700 +0100
|
||||
+++ chromium-120.0.6099.129/gpu/command_buffer/service/shared_image/shared_image_backing.h 2023-12-21 15:57:27.336515319 +0100
|
||||
@@ -340,8 +340,8 @@
|
||||
public:
|
||||
ScopedWriteUMA() = default;
|
||||
|
||||
- ScopedWriteUMA(const ScopedWriteUMA&) = delete;
|
||||
- ScopedWriteUMA& operator=(const ScopedWriteUMA&) = delete;
|
||||
+ ScopedWriteUMA(const ScopedWriteUMA&) = default;
|
||||
+ ScopedWriteUMA& operator=(const ScopedWriteUMA&) = default;
|
||||
|
||||
~ScopedWriteUMA() {
|
||||
UMA_HISTOGRAM_BOOLEAN("GPU.SharedImage.ContentConsumed",
|
||||
diff -r -u chromium-120.0.6099.129old/mojo/public/cpp/bindings/lib/multiplex_router.cc chromium-120.0.6099.129/mojo/public/cpp/bindings/lib/multiplex_router.cc
|
||||
--- chromium-120.0.6099.129old/mojo/public/cpp/bindings/lib/multiplex_router.cc 2023-12-21 01:49:10.754764600 +0100
|
||||
+++ chromium-120.0.6099.129/mojo/public/cpp/bindings/lib/multiplex_router.cc 2023-12-21 13:19:27.412481231 +0100
|
||||
@@ -870,7 +870,7 @@
|
||||
DCHECK(!exclusive_sync_wait_);
|
||||
|
||||
scoped_refptr<MultiplexRouter> keep_alive(this);
|
||||
- exclusive_sync_wait_.emplace();
|
||||
+ exclusive_sync_wait_.emplace(ExclusiveSyncWaitInfo{});
|
||||
exclusive_sync_wait_->interface_id = interface_id;
|
||||
exclusive_sync_wait_->request_id = request_id;
|
||||
while (!exclusive_sync_wait_->finished) {
|
||||
--- a/third_party/blink/common/interest_group/auction_config_mojom_traits.cc
|
||||
+++ b/third_party/blink/common/interest_group/auction_config_mojom_traits.cc
|
||||
@@ -207,8 +207,6 @@
|
||||
!data.ReadAllBuyersPrioritySignals(&out->all_buyers_priority_signals) ||
|
||||
!data.ReadAuctionReportBuyerKeys(&out->auction_report_buyer_keys) ||
|
||||
!data.ReadAuctionReportBuyers(&out->auction_report_buyers) ||
|
||||
- !data.ReadAuctionReportBuyerDebugModeConfig(
|
||||
- &out->auction_report_buyer_debug_mode_config) ||
|
||||
!data.ReadRequiredSellerCapabilities(
|
||||
&out->required_seller_capabilities) ||
|
||||
!data.ReadRequestedSize(&out->requested_size) ||
|
||||
--- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h
|
||||
+++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h
|
||||
@@ -594,7 +594,7 @@
|
||||
mojom::blink::ScrollBehavior scroll_behavior) override {
|
||||
if (!should_restore_scroll)
|
||||
return;
|
||||
- pending_view_state_.emplace();
|
||||
+ pending_view_state_.emplace(PendingViewState{});
|
||||
pending_view_state_->state = view_state;
|
||||
pending_view_state_->scroll_behavior = scroll_behavior;
|
||||
}
|
||||
--- a/third_party/blink/renderer/platform/wtf/text/string_view.h
|
||||
+++ b/third_party/blink/renderer/platform/wtf/text/string_view.h
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/get_ptr.h"
|
||||
#include "third_party/blink/renderer/platform/wtf/text/string_impl.h"
|
||||
+#include "third_party/blink/renderer/platform/wtf/text/code_point_iterator.h"
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
@@ -0,0 +1,288 @@
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -311,9 +311,6 @@
|
||||
|
||||
configs += [
|
||||
# See the definitions below.
|
||||
- ":clang_revision",
|
||||
- ":rustc_revision",
|
||||
- ":compiler_cpu_abi",
|
||||
":compiler_codegen",
|
||||
":compiler_deterministic",
|
||||
]
|
||||
@@ -587,63 +584,6 @@
|
||||
ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
|
||||
}
|
||||
|
||||
- if (is_clang && !is_nacl) {
|
||||
- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ]
|
||||
- if (save_reproducers_on_lld_crash && use_lld) {
|
||||
- ldflags += [
|
||||
- "-fcrash-diagnostics=all",
|
||||
- "-fcrash-diagnostics-dir=" + clang_diagnostic_dir,
|
||||
- ]
|
||||
- }
|
||||
-
|
||||
- # TODO(hans): Remove this once Clang generates better optimized debug info
|
||||
- # by default. https://crbug.com/765793
|
||||
- cflags += [
|
||||
- "-mllvm",
|
||||
- "-instcombine-lower-dbg-declare=0",
|
||||
- ]
|
||||
- if (!is_debug && use_thin_lto && is_a_target_toolchain) {
|
||||
- if (is_win) {
|
||||
- ldflags += [ "-mllvm:-instcombine-lower-dbg-declare=0" ]
|
||||
- } else {
|
||||
- ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ]
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- # TODO(crbug.com/40283598): This causes binary size growth and potentially
|
||||
- # other problems.
|
||||
- # TODO(crbug.com/40284925): This isn't supported by Cronet's mainline llvm version.
|
||||
- if (default_toolchain != "//build/toolchain/cros:target" &&
|
||||
- !llvm_android_mainline) {
|
||||
- cflags += [
|
||||
- # "-mllvm",
|
||||
- # "-split-threshold-for-reg-with-hint=0",
|
||||
- ]
|
||||
- if (use_thin_lto && is_a_target_toolchain) {
|
||||
- if (is_win) {
|
||||
- # ldflags += [ "-mllvm:-split-threshold-for-reg-with-hint=0" ]
|
||||
- } else {
|
||||
- # ldflags += [ "-Wl,-mllvm,-split-threshold-for-reg-with-hint=0" ]
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (use_avx2 || use_avx512 || use_fma || current_cpu == "arm64" || is_mac) {
|
||||
- if (is_win) {
|
||||
- cflags += [ "/clang:-ffp-contract=fast" ]
|
||||
- } else {
|
||||
- cflags += [ "-ffp-contract=fast" ]
|
||||
- }
|
||||
- } else {
|
||||
- # TODO(crbug.com/40192287): Investigate why/if this should be needed.
|
||||
- if (is_win) {
|
||||
- cflags += [ "/clang:-ffp-contract=off" ]
|
||||
- } else {
|
||||
- cflags += [ "-ffp-contract=off" ]
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
# C11/C++11 compiler flags setup.
|
||||
# ---------------------------
|
||||
if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) ||
|
||||
@@ -1748,52 +1688,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- # Makes builds independent of absolute file path.
|
||||
- if (is_clang && strip_absolute_paths_from_debug_symbols) {
|
||||
- # If debug option is given, clang includes $cwd in debug info by default.
|
||||
- # For such build, this flag generates reproducible obj files even we use
|
||||
- # different build directory like "out/feature_a" and "out/feature_b" if
|
||||
- # we build same files with same compile flag.
|
||||
- # Other paths are already given in relative, no need to normalize them.
|
||||
- if (is_nacl) {
|
||||
- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
|
||||
- cflags += [
|
||||
- "-Xclang",
|
||||
- "-fdebug-compilation-dir",
|
||||
- "-Xclang",
|
||||
- ".",
|
||||
- ]
|
||||
- } else {
|
||||
- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir=
|
||||
- # and -fcoverage-compilation-dir=.
|
||||
- cflags += [ "-ffile-compilation-dir=." ]
|
||||
-
|
||||
- # Convert absolute paths to relative paths. Expands to, for example:
|
||||
- # -file-prefix-map /path/to/chromium/src=../..
|
||||
- swiftflags += [
|
||||
- "-file-prefix-map",
|
||||
- rebase_path("//.", "") + "=" + rebase_path("//.", root_build_dir),
|
||||
- ]
|
||||
- }
|
||||
- if (!is_win) {
|
||||
- # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
|
||||
- asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
|
||||
- }
|
||||
-
|
||||
- if (is_win && use_lld) {
|
||||
- if (symbol_level == 2 || (is_clang && using_sanitizer)) {
|
||||
- # Absolutize source file paths for PDB. Pass the real build directory
|
||||
- # if the pdb contains source-level debug information and if linker
|
||||
- # reproducibility is not critical.
|
||||
- ldflags += [ "/PDBSourcePath:" + rebase_path(root_build_dir) ]
|
||||
- } else {
|
||||
- # Use a fake fixed base directory for paths in the pdb to make the pdb
|
||||
- # output fully deterministic and independent of the build directory.
|
||||
- ldflags += [ "/PDBSourcePath:o:\fake\prefix" ]
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
-
|
||||
# Tells the compiler not to use absolute paths when passing the default
|
||||
# paths to the tools it invokes. We don't want this because we don't
|
||||
# really need it and it can mess up the RBE cache entries.
|
||||
@@ -1812,40 +1706,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
-config("clang_revision") {
|
||||
- if (is_clang && clang_base_path == default_clang_base_path &&
|
||||
- current_os != "zos") {
|
||||
- update_args = [
|
||||
- "--print-revision",
|
||||
- "--verify-version=$clang_version",
|
||||
- ]
|
||||
- if (llvm_force_head_revision) {
|
||||
- update_args += [ "--llvm-force-head-revision" ]
|
||||
- }
|
||||
- clang_revision = exec_script("//tools/clang/scripts/update.py",
|
||||
- update_args,
|
||||
- "trim string")
|
||||
-
|
||||
- # This is here so that all files get recompiled after a clang roll and
|
||||
- # when turning clang on or off. (defines are passed via the command line,
|
||||
- # and build system rebuild things when their commandline changes). Nothing
|
||||
- # should ever read this define.
|
||||
- defines = [ "CR_CLANG_REVISION=\"$clang_revision\"" ]
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-config("rustc_revision") {
|
||||
- if (rustc_revision != "") {
|
||||
- # Similar to the above config, this is here so that all files get recompiled
|
||||
- # after a rustc roll. Nothing should ever read this cfg. This will not be
|
||||
- # set if a custom toolchain is used.
|
||||
- rustflags = [
|
||||
- "--cfg",
|
||||
- "cr_rustc_revision=\"$rustc_revision\"",
|
||||
- ]
|
||||
- }
|
||||
-}
|
||||
-
|
||||
config("compiler_arm_fpu") {
|
||||
if (current_cpu == "arm" && !is_ios && !is_nacl) {
|
||||
cflags = [ "-mfpu=$arm_fpu" ]
|
||||
@@ -2252,11 +2112,7 @@
|
||||
defines = [ "_HAS_NODISCARD" ]
|
||||
}
|
||||
} else {
|
||||
- cflags = [ "-Wall" ]
|
||||
- if (is_clang) {
|
||||
- # Enable extra warnings for chromium_code when we control the compiler.
|
||||
- cflags += [ "-Wextra" ]
|
||||
- }
|
||||
+ cflags = []
|
||||
|
||||
# In Chromium code, we define __STDC_foo_MACROS in order to get the
|
||||
# C99 macros on Mac and Linux.
|
||||
@@ -2265,24 +2121,6 @@
|
||||
"__STDC_FORMAT_MACROS",
|
||||
]
|
||||
|
||||
- if (!is_debug && !using_sanitizer && current_cpu != "s390x" &&
|
||||
- current_cpu != "s390" && current_cpu != "ppc64" &&
|
||||
- current_cpu != "mips" && current_cpu != "mips64" &&
|
||||
- current_cpu != "riscv64" && current_cpu != "loong64") {
|
||||
- # Non-chromium code is not guaranteed to compile cleanly with
|
||||
- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
|
||||
- # disabled, so only do that for Release build.
|
||||
- fortify_level = "2"
|
||||
-
|
||||
- # ChromeOS's toolchain supports a high-quality _FORTIFY_SOURCE=3
|
||||
- # implementation with a few custom glibc patches. Use that if it's
|
||||
- # available.
|
||||
- if (is_chromeos_device && !lacros_use_chromium_toolchain) {
|
||||
- fortify_level = "3"
|
||||
- }
|
||||
- defines += [ "_FORTIFY_SOURCE=" + fortify_level ]
|
||||
- }
|
||||
-
|
||||
if (is_apple) {
|
||||
cflags_objc = [ "-Wimplicit-retain-self" ]
|
||||
cflags_objcc = [ "-Wimplicit-retain-self" ]
|
||||
@@ -2950,7 +2788,8 @@
|
||||
# [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000
|
||||
# [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000
|
||||
# [2]: https://crrev.com/c/5447532
|
||||
-config("optimize") {
|
||||
+config("optimize") { }
|
||||
+config("xoptimize") {
|
||||
if (is_win) {
|
||||
# clang-cl's /O2 corresponds to clang's -O3, and really want -O2 for
|
||||
# consistency with the other platforms.
|
||||
@@ -3000,7 +2839,8 @@
|
||||
}
|
||||
|
||||
# Turn off optimizations.
|
||||
-config("no_optimize") {
|
||||
+config("no_optimize") { }
|
||||
+config("xno_optimize") {
|
||||
if (is_win) {
|
||||
cflags = [
|
||||
"/Od", # Disable optimization.
|
||||
@@ -3040,7 +2880,8 @@
|
||||
# Turns up the optimization level. Used to explicitly enable -O2 instead of
|
||||
# -Os for select targets on platforms that use optimize_for_size. No-op
|
||||
# elsewhere.
|
||||
-config("optimize_max") {
|
||||
+config("optimize_max") { }
|
||||
+config("xoptimize_max") {
|
||||
if (is_nacl && is_nacl_irt) {
|
||||
# The NaCl IRT is a special case and always wants its own config.
|
||||
# Various components do:
|
||||
@@ -3076,7 +2917,8 @@
|
||||
#
|
||||
# TODO(crbug.com/41259697) - rework how all of these configs are related
|
||||
# so that we don't need this disclaimer.
|
||||
-config("optimize_speed") {
|
||||
+config("optimize_speed") { }
|
||||
+config("xoptimize_speed") {
|
||||
if (is_nacl && is_nacl_irt) {
|
||||
# The NaCl IRT is a special case and always wants its own config.
|
||||
# Various components do:
|
||||
@@ -3105,7 +2947,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
-config("optimize_fuzzing") {
|
||||
+config("optimize_fuzzing") { }
|
||||
+config("xoptimize_fuzzing") {
|
||||
cflags = [ "-O3" ] + common_optimize_on_cflags
|
||||
rustflags = [ "-Copt-level=3", ]
|
||||
ldflags = common_optimize_on_ldflags
|
||||
@@ -3271,7 +3114,8 @@
|
||||
}
|
||||
|
||||
# Full symbols.
|
||||
-config("symbols") {
|
||||
+config("symbols") { }
|
||||
+config("xsymbols") {
|
||||
rustflags = []
|
||||
configs = []
|
||||
if (is_win) {
|
||||
@@ -3433,7 +3277,8 @@
|
||||
# Minimal symbols.
|
||||
# This config guarantees to hold symbol for stack trace which are shown to user
|
||||
# when crash happens in unittests running on buildbot.
|
||||
-config("minimal_symbols") {
|
||||
+config("minimal_symbols") { }
|
||||
+config("xminimal_symbols") {
|
||||
rustflags = []
|
||||
if (is_win) {
|
||||
# Functions, files, and line tables only.
|
||||
@@ -3518,7 +3363,8 @@
|
||||
# This configuration contains function names only. That is, the compiler is
|
||||
# told to not generate debug information and the linker then just puts function
|
||||
# names in the final debug information.
|
||||
-config("no_symbols") {
|
||||
+config("no_symbols") { }
|
||||
+config("xno_symbols") {
|
||||
if (is_win) {
|
||||
ldflags = [ "/DEBUG" ]
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -206,7 +206,7 @@
|
||||
# Set to true to use icf, Identical Code Folding.
|
||||
use_icf = (is_posix || is_fuchsia) && !is_debug && !using_sanitizer &&
|
||||
!use_clang_coverage && current_os != "zos" &&
|
||||
- !(is_android && use_order_profiling) && use_lld
|
||||
+ !(is_android && use_order_profiling) && (use_lld || use_mold)
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
@@ -377,7 +377,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (use_lld) {
|
||||
+ if (use_mold) {
|
||||
+ ldflags += [ "-fuse-ld=mold" ]
|
||||
+ } else if (use_lld) {
|
||||
ldflags += [ "-fuse-ld=lld" ]
|
||||
if (lld_path != "") {
|
||||
ldflags += [ "-B$lld_path" ]
|
||||
@@ -430,7 +432,7 @@
|
||||
# links.
|
||||
ldflags += [ "-Wl,--build-id=sha1" ]
|
||||
} else if (current_os != "aix" && current_os != "zos") {
|
||||
- if (use_lld && !is_nacl) {
|
||||
+ if ((use_lld || use_mold) && !is_nacl) {
|
||||
ldflags += [ "-Wl,--build-id=fast" ]
|
||||
} else {
|
||||
ldflags += [ "-Wl,--build-id" ]
|
||||
@@ -511,7 +513,7 @@
|
||||
|
||||
# Linux-specific compiler flags setup.
|
||||
# ------------------------------------
|
||||
- if (use_icf && (!is_apple || use_lld)) {
|
||||
+ if (use_icf && (!is_apple || use_lld || use_mold)) {
|
||||
ldflags += [ "-Wl,--icf=all" ]
|
||||
}
|
||||
|
||||
@@ -549,7 +551,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if (use_lld) {
|
||||
+ if (use_lld || use_mold) {
|
||||
# TODO(thakis): Make the driver pass --color-diagnostics to the linker
|
||||
# if -fcolor-diagnostics is passed to it, and pass -fcolor-diagnostics
|
||||
# in ldflags instead.
|
||||
@@ -564,7 +566,7 @@
|
||||
|
||||
# Enable text section splitting only on linux when using lld for now. Other
|
||||
# platforms can be added later if needed.
|
||||
- if ((is_linux || is_chromeos) && use_lld && use_text_section_splitting) {
|
||||
+ if ((is_linux || is_chromeos) && (use_lld || use_mold) && use_text_section_splitting) {
|
||||
ldflags += [ "-Wl,-z,keep-text-section-prefix" ]
|
||||
}
|
||||
|
||||
@@ -732,7 +734,7 @@
|
||||
# [0]: https://pinpoint-dot-chromeperf.appspot.com/job/15efb0313e0000
|
||||
# [1]: https://pinpoint-dot-chromeperf.appspot.com/job/157f0b42be0000
|
||||
if (!is_debug && use_thin_lto && is_a_target_toolchain) {
|
||||
- assert(use_lld, "LTO is only supported with lld")
|
||||
+ assert(use_lld || use_mold, "LTO is only supported with lld or mold")
|
||||
|
||||
cflags += [
|
||||
"-flto=thin",
|
||||
@@ -774,7 +776,9 @@
|
||||
# [0]: https://pinpoint-dot-chromeperf.appspot.com/job/16984a18be0000
|
||||
# [1]: https://pinpoint-dot-chromeperf.appspot.com/job/11984a18be0000
|
||||
# [2]: https://ci.chromium.org/ui/p/chromium/builders/try/android-binary-size/1848442
|
||||
+ if (!use_mold) {
|
||||
import_instr_limit = 100
|
||||
+ }
|
||||
|
||||
if (is_win) {
|
||||
ldflags += [
|
||||
@@ -807,7 +811,9 @@
|
||||
import_instr_limit = 5
|
||||
}
|
||||
|
||||
+ if (!use_mold) {
|
||||
ldflags += [ "-Wl,-mllvm,-import-instr-limit=$import_instr_limit" ]
|
||||
+ }
|
||||
|
||||
if (is_apple) {
|
||||
ldflags += [ "-Wcrl,object_path_lto" ]
|
||||
@@ -815,7 +821,9 @@
|
||||
|
||||
# We only use one version of LLVM within a build so there's no need to
|
||||
# upgrade debug info, which can be expensive since it runs the verifier.
|
||||
+ if (!use_mold) {
|
||||
ldflags += [ "-Wl,-mllvm,-disable-auto-upgrade-debug-info" ]
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!optimize_for_size) {
|
||||
@@ -827,7 +835,7 @@
|
||||
]
|
||||
if (is_win) {
|
||||
ldflags += [ "-mllvm:-inlinehint-threshold=360" ]
|
||||
- } else {
|
||||
+ } else if (!use_mold) {
|
||||
ldflags += [ "-Wl,-mllvm,-inlinehint-threshold=360" ]
|
||||
}
|
||||
}
|
||||
@@ -888,7 +896,7 @@
|
||||
|
||||
# TODO(crbug.com/40242425): Cleanup undefined symbol errors caught by
|
||||
# --no-undefined-version.
|
||||
- if (use_lld && !is_win && !is_mac && !is_ios) {
|
||||
+ if ((use_lld || use_mold) && !is_win && !is_mac && !is_ios) {
|
||||
ldflags += [ "-Wl,--undefined-version" ]
|
||||
}
|
||||
|
||||
@@ -948,7 +956,7 @@
|
||||
assert(
|
||||
is_android && host_os == "linux",
|
||||
"MLGO is currently only supported for targeting Android on a linux host")
|
||||
- if (use_thin_lto) {
|
||||
+ if (use_thin_lto && !use_mold ) {
|
||||
ldflags += [ "-Wl,-mllvm,-enable-ml-inliner=release" ]
|
||||
if (is_high_end_android) {
|
||||
# Besides using the arm64 - trained model, instruct the inline advisor
|
||||
@@ -1545,7 +1553,9 @@
|
||||
# This can be removed once https://bugs.llvm.org/show_bug.cgi?id=40348
|
||||
# has been resolved, and -mno-outline is obeyed by the linker during
|
||||
# ThinLTO.
|
||||
+ if (!use_mold) {
|
||||
ldflags += [ "-Wl,-mllvm,-enable-machine-outliner=never" ]
|
||||
+ }
|
||||
}
|
||||
|
||||
asmflags = cflags
|
||||
@@ -2928,7 +2938,7 @@
|
||||
# sections" there. Maybe just a bug in nacl_switch_32.S.
|
||||
_enable_gdb_index =
|
||||
symbol_level == 2 && !is_apple && !is_nacl && current_cpu != "x86" &&
|
||||
- current_os != "zos" && use_lld &&
|
||||
+ current_os != "zos" && (use_lld || use_mold) &&
|
||||
# Disable on non-fission 32-bit Android because it pushes
|
||||
# libcomponents_unittests over the 4gb size limit.
|
||||
!(is_android && !use_debug_fission && current_cpu != "x64" &&
|
||||
--- a/build/config/compiler/pgo/BUILD.gn
|
||||
+++ b/build/config/compiler/pgo/BUILD.gn
|
||||
@@ -150,7 +150,7 @@
|
||||
if (use_thin_lto) {
|
||||
if (is_win) {
|
||||
ldflags = [ "-mllvm:-enable-ext-tsp-block-placement=1" ]
|
||||
- } else {
|
||||
+ } else if (!use_mold) {
|
||||
ldflags = [ "-Wl,-mllvm,-enable-ext-tsp-block-placement=1" ]
|
||||
}
|
||||
} else {
|
||||
--- a/build/config/compiler/compiler.gni.orig
|
||||
+++ b/build/config/compiler/compiler.gni
|
||||
@@ -36,6 +36,9 @@
|
||||
# The default linker everywhere else.
|
||||
use_lld = is_clang && current_os != "zos"
|
||||
|
||||
+ # Set to true to use mold, the modern linker.
|
||||
+ use_mold = false
|
||||
+
|
||||
# If true, optimize for size.
|
||||
# Default to favoring speed over size for platforms not listed below.
|
||||
optimize_for_size =
|
||||
@@ -74,7 +77,7 @@
|
||||
# gcc >= 4.8 or clang.
|
||||
# http://gcc.gnu.org/wiki/DebugFission
|
||||
use_debug_fission = !is_android && !is_fuchsia && !is_apple && !is_win &&
|
||||
- use_lld && cc_wrapper == ""
|
||||
+ (use_lld || use_mold) && cc_wrapper == ""
|
||||
|
||||
# Enables support for ThinLTO, which links 3x-10x faster than full LTO. See
|
||||
# also http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html
|
||||
@@ -0,0 +1,16 @@
|
||||
--- a/build/config/clang/BUILD.gn
|
||||
+++ b/build/config/clang/BUILD.gn
|
||||
@@ -237,7 +237,12 @@
|
||||
|
||||
# Adds a dependency on the Clang runtime library clang_rt.builtins.
|
||||
clang_lib("compiler_builtins") {
|
||||
- if (is_mac) {
|
||||
+ if (!toolchain_has_rust) {
|
||||
+ # Since there's no Rust in the toolchain, there's no concern that we'll use
|
||||
+ # the Rust stdlib's intrinsics here.
|
||||
+ #
|
||||
+ # Don't define libname which makes this target do nothing.
|
||||
+ } else if (is_mac) {
|
||||
libname = "osx"
|
||||
} else if (is_ios) {
|
||||
if (target_environment == "simulator") {
|
||||
@@ -0,0 +1,133 @@
|
||||
https://chromium.googlesource.com/chromium/src/+/0d8d0e0943489b59e452b4d0214959821880ad7f
|
||||
From: Matt Jolly <kangie@gentoo.org>
|
||||
Date: Tue, 28 Jan 2025 12:00:57 -0800
|
||||
Subject: [PATCH] UI: make QT5 optional
|
||||
|
||||
To build with `use_qt6`, QT5 (`use_qt`) is also required.
|
||||
This is undesirable for downstreams who are actively working
|
||||
to drop support for QT5 (e.g. Gentoo).
|
||||
|
||||
To resolve this:
|
||||
|
||||
- Add `use_qt5`
|
||||
- Replace most `use_qt` conditionals with this option;
|
||||
these appear to be from before QT6 support was added.
|
||||
- Use `use_qt5` to gate some previously unconditional QT5-related
|
||||
items in chrome/installer/linux
|
||||
- Remove `use_qt` as an argument, instead set to `use_qt5 || use_qt6`.
|
||||
|
||||
This change should not impact the current behaviour; if no options
|
||||
are selected QT5 and QT6 support will be enabled, using existing logic
|
||||
unless one is explicitly disabled with `use_qt{x}=false`.
|
||||
|
||||
See-also: https://bugs.gentoo.org/926166, https://bugs.gentoo.org/948836
|
||||
Signed-off-by: Matt Jolly <kangie@gentoo.org>
|
||||
Fixed: 328182252
|
||||
Change-Id: I22ec7a068356412d3f9fce68a19aee4f8c89892c
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6205488
|
||||
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
|
||||
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
||||
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1412471}
|
||||
--- a/chrome/installer/linux/BUILD.gn
|
||||
+++ b/chrome/installer/linux/BUILD.gn
|
||||
@@ -77,10 +77,10 @@ if (enable_swiftshader) {
|
||||
packaging_files += [ "$root_out_dir/vk_swiftshader_icd.json" ]
|
||||
}
|
||||
|
||||
-if (use_qt) {
|
||||
- # Even though this is a shared library, add it to `packaging_files` instead of
|
||||
- # `packaging_files_shlibs` to skip the dependency check. This is intentional
|
||||
- # to prevent a hard dependency on QT for the package.
|
||||
+# Even though this is a shared library, add it to `packaging_files` instead of
|
||||
+# `packaging_files_shlibs` to skip the dependency check. This is intentional
|
||||
+# to prevent a hard dependency on QT for the package.
|
||||
+if (use_qt5) {
|
||||
packaging_files += [ "$root_out_dir/libqt5_shim.so" ]
|
||||
}
|
||||
if (use_qt6) {
|
||||
@@ -206,7 +206,7 @@ if (build_with_internal_optimization_guide) {
|
||||
}
|
||||
}
|
||||
|
||||
-if (use_qt) {
|
||||
+if (use_qt5) {
|
||||
strip_binary("strip_qt5_shim") {
|
||||
binary_input = "$root_out_dir/libqt5_shim.so"
|
||||
deps = [ "//ui/qt:qt5_shim" ]
|
||||
@@ -399,7 +399,7 @@ group("installer_deps") {
|
||||
"//components/optimization_guide/internal:optimization_guide_internal",
|
||||
]
|
||||
}
|
||||
- if (use_qt) {
|
||||
+ if (use_qt5) {
|
||||
public_deps += [
|
||||
":strip_qt5_shim",
|
||||
"//ui/qt:qt5_shim",
|
||||
--- a/ui/qt/BUILD.gn
|
||||
+++ b/ui/qt/BUILD.gn
|
||||
@@ -101,10 +101,12 @@ template("qt_shim") {
|
||||
}
|
||||
}
|
||||
}
|
||||
-qt_shim("qt5_shim") {
|
||||
- qt_version = "5"
|
||||
- if (!use_sysroot) {
|
||||
- moc_qt_path = "$moc_qt5_path"
|
||||
+if (use_qt5) {
|
||||
+ qt_shim("qt5_shim") {
|
||||
+ qt_version = "5"
|
||||
+ if (!use_sysroot) {
|
||||
+ moc_qt_path = "$moc_qt5_path"
|
||||
+ }
|
||||
}
|
||||
}
|
||||
if (use_qt6) {
|
||||
@@ -122,7 +124,10 @@ component("qt") {
|
||||
defines = [ "IS_QT_IMPL" ]
|
||||
|
||||
# qt_shim is in data_deps since we want to load it manually.
|
||||
- data_deps = [ ":qt5_shim" ]
|
||||
+ data_deps = []
|
||||
+ if (use_qt5) {
|
||||
+ data_deps += [ ":qt5_shim" ]
|
||||
+ }
|
||||
if (use_qt6) {
|
||||
data_deps += [ ":qt6_shim" ]
|
||||
}
|
||||
--- a/ui/qt/qt.gni
|
||||
+++ b/ui/qt/qt.gni
|
||||
@@ -6,27 +6,20 @@ import("//build/config/cast.gni")
|
||||
import("//build/config/sanitizers/sanitizers.gni")
|
||||
import("//build/config/sysroot.gni")
|
||||
|
||||
+# TODO(crbug.com/40260415): Allow QT in MSAN builds once QT is
|
||||
+# added to the instrumented libraries.
|
||||
declare_args() {
|
||||
- # TODO(crbug.com/40260415): Allow QT in MSAN builds once QT is
|
||||
- # added to the instrumented libraries.
|
||||
- use_qt = is_linux && !is_castos && !is_msan
|
||||
+ use_qt5 = use_sysroot && is_linux && !is_castos && !is_msan
|
||||
+ use_qt6 = use_sysroot && is_linux && !is_castos && !is_msan
|
||||
}
|
||||
|
||||
declare_args() {
|
||||
- if (!use_sysroot && use_qt) {
|
||||
+ if (!use_sysroot && use_qt5) {
|
||||
moc_qt5_path = ""
|
||||
}
|
||||
-}
|
||||
-
|
||||
-declare_args() {
|
||||
- use_qt6 = use_qt && use_sysroot
|
||||
-}
|
||||
-
|
||||
-declare_args() {
|
||||
if (!use_sysroot && use_qt6) {
|
||||
moc_qt6_path = ""
|
||||
}
|
||||
}
|
||||
|
||||
-# use_qt6 => use_qt
|
||||
-assert(!use_qt6 || use_qt)
|
||||
+use_qt = use_qt5 || use_qt6
|
||||
@@ -0,0 +1,28 @@
|
||||
https://bugs.gentoo.org/953436#c5
|
||||
--- a/third_party/blink/renderer/build/scripts/gperf.py
|
||||
+++ b/third_party/blink/renderer/build/scripts/gperf.py
|
||||
@@ -28,24 +28,6 @@
|
||||
stdout=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
gperf_output = gperf.communicate(gperf_input)[0]
|
||||
- # Massage gperf output to be more palatable for modern compilers.
|
||||
- # TODO(thakis): Upstream these to gperf so we don't need massaging.
|
||||
- # `register` is deprecated in C++11 and removed in C++17, so remove
|
||||
- # it from gperf's output.
|
||||
- # https://savannah.gnu.org/bugs/index.php?53028
|
||||
- gperf_output = re.sub(r'\bregister ', '', gperf_output)
|
||||
- # -Wimplicit-fallthrough needs an explicit fallthrough statement,
|
||||
- # so replace gperf's /*FALLTHROUGH*/ comment with the statement.
|
||||
- # https://savannah.gnu.org/bugs/index.php?53029
|
||||
- gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
|
||||
- ' [[fallthrough]];')
|
||||
- # -Wpointer-to-int-cast warns about casting pointers to smaller ints
|
||||
- # Replace {(int)(long)&(foo), bar} with
|
||||
- # {static_cast<int>(reinterpret_cast<uintptr_t>(&(foo)), bar}
|
||||
- gperf_output = re.sub(
|
||||
- r'\(int\)\(long\)(.*?),',
|
||||
- r'static_cast<int>(reinterpret_cast<uintptr_t>(\1)),',
|
||||
- gperf_output)
|
||||
script = 'third_party/blink/renderer/build/scripts/gperf.py'
|
||||
return '// Generated by %s\n' % script + gperf_output
|
||||
except OSError:
|
||||
@@ -0,0 +1,12 @@
|
||||
--- a/chrome/browser/renderer_preferences_util.cc 2025-06-09 23:43:12.302027536 +0700
|
||||
+++ b/chrome/browser/renderer_preferences_util.cc 2025-06-09 23:43:38.084028322 +0700
|
||||
@@ -183,7 +183,8 @@
|
||||
#if defined(USE_AURA) && BUILDFLAG(IS_LINUX)
|
||||
auto* linux_ui_theme = ui::LinuxUiTheme::GetForProfile(profile);
|
||||
if (linux_ui_theme) {
|
||||
- if (ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) {
|
||||
+ if (ThemeServiceFactory::GetForProfile(profile) &&
|
||||
+ ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) {
|
||||
linux_ui_theme->GetFocusRingColor(&prefs->focus_ring_color);
|
||||
linux_ui_theme->GetActiveSelectionBgColor(
|
||||
&prefs->active_selection_bg_color);
|
||||
@@ -0,0 +1,12 @@
|
||||
diff -up chromium-99.0.4818.0/media/audio/audio_opus_encoder.h.omv~ chromium-99.0.4818.0/media/audio/audio_opus_encoder.h
|
||||
--- chromium-99.0.4818.0/media/audio/audio_opus_encoder.h.omv~ 2022-01-13 05:42:57.571250471 +0100
|
||||
+++ chromium-99.0.4818.0/media/audio/audio_opus_encoder.h 2022-01-13 05:43:06.233291236 +0100
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "media/base/audio_encoder.h"
|
||||
#include "media/base/audio_push_fifo.h"
|
||||
#include "media/base/audio_timestamp_helper.h"
|
||||
-#include "third_party/opus/src/include/opus.h"
|
||||
+#include <opus/opus.h>
|
||||
|
||||
namespace media {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--- a/build/toolchain/linux/unbundle/BUILD.gn
|
||||
+++ b/build/toolchain/linux/unbundle/BUILD.gn
|
||||
@@ -35,7 +35,7 @@ gcc_toolchain("host") {
|
||||
extra_ldflags = getenv("BUILD_LDFLAGS")
|
||||
|
||||
toolchain_args = {
|
||||
- current_cpu = current_cpu
|
||||
- current_os = current_os
|
||||
+ current_cpu = host_cpu
|
||||
+ current_os = host_os
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
--- a/media/filters/ffmpeg_glue.cc
|
||||
+++ b/media/filters/ffmpeg_glue.cc
|
||||
@@ -123,7 +123,8 @@
|
||||
// We don't allow H.264 parsing during demuxing since we have our own parser
|
||||
// and the ffmpeg one increases memory usage unnecessarily.
|
||||
if (base::FeatureList::IsEnabled(kForbidH264ParsingDuringDemuxing)) {
|
||||
- format_context_->flags |= AVFMT_FLAG_NOH264PARSE;
|
||||
+ // TODO(crbug.com/355485812): Re-enable this flag.
|
||||
+ // format_context_->flags |= AVFMT_FLAG_NOH264PARSE;
|
||||
}
|
||||
|
||||
// Ensures format parsing errors will bail out. From an audit on 11/2017, all
|
||||
@@ -0,0 +1,22 @@
|
||||
===================================================================
|
||||
--- a/media/base/libaom_thread_wrapper.cc
|
||||
+++ b/media/base/libaom_thread_wrapper.cc
|
||||
@@ -4,18 +4,11 @@
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "media/base/codec_worker_impl.h"
|
||||
#include "media/base/libvpx_thread_wrapper.h"
|
||||
-#include "third_party/libaom/source/libaom/aom_util/aom_thread.h"
|
||||
|
||||
namespace media {
|
||||
|
||||
void InitLibAomThreadWrapper() {
|
||||
- const AVxWorkerInterface interface =
|
||||
- CodecWorkerImpl<AVxWorkerInterface, AVxWorkerImpl, AVxWorker,
|
||||
- AVxWorkerStatus, AVX_WORKER_STATUS_NOT_OK,
|
||||
- AVX_WORKER_STATUS_OK,
|
||||
- AVX_WORKER_STATUS_WORKING>::GetCodecWorkerInterface();
|
||||
- CHECK(aom_set_worker_interface(&interface));
|
||||
}
|
||||
|
||||
} // namespace media
|
||||
@@ -0,0 +1,23 @@
|
||||
===================================================================
|
||||
--- a/media/base/libvpx_thread_wrapper.cc
|
||||
+++ b/media/base/libvpx_thread_wrapper.cc
|
||||
@@ -4,19 +4,11 @@
|
||||
|
||||
#include "media/base/libvpx_thread_wrapper.h"
|
||||
|
||||
#include "media/base/codec_worker_impl.h"
|
||||
-#include "third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h"
|
||||
|
||||
namespace media {
|
||||
|
||||
void InitLibVpxThreadWrapper() {
|
||||
- const VPxWorkerInterface interface =
|
||||
- CodecWorkerImpl<VPxWorkerInterface, VPxWorkerImpl, VPxWorker,
|
||||
- VPxWorkerStatus, VPX_WORKER_STATUS_NOT_OK,
|
||||
- VPX_WORKER_STATUS_OK,
|
||||
- VPX_WORKER_STATUS_WORKING>::GetCodecWorkerInterface();
|
||||
-
|
||||
- CHECK(vpx_set_worker_interface(&interface));
|
||||
}
|
||||
|
||||
} // namespace media
|
||||
@@ -0,0 +1,35 @@
|
||||
description: build using system openjpeg
|
||||
author: Michael Gilbert <mgilbert@debian.org>
|
||||
|
||||
--- a/third_party/pdfium/BUILD.gn
|
||||
+++ b/third_party/pdfium/BUILD.gn
|
||||
@@ -25,7 +25,7 @@
|
||||
cflags = []
|
||||
cflags_cc = []
|
||||
ldflags = []
|
||||
- include_dirs = [ "." ]
|
||||
+ include_dirs = [ ".", "/usr/include/openjpeg-2.4", "/usr/include/openjpeg-2.5" ]
|
||||
defines = []
|
||||
|
||||
if (!use_system_libopenjpeg2) {
|
||||
--- a/third_party/pdfium/core/fpdfapi/render/BUILD.gn
|
||||
+++ b/third_party/pdfium/core/fpdfapi/render/BUILD.gn
|
||||
@@ -49,6 +49,7 @@ source_set("render") {
|
||||
"../../../:pdfium_noshorten_config",
|
||||
]
|
||||
deps = [
|
||||
+ "../../../third_party:libopenjpeg2",
|
||||
"../../../constants",
|
||||
"../../fxcodec",
|
||||
"../../fxcrt",
|
||||
--- a/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.h
|
||||
+++ b/third_party/pdfium/core/fxcodec/jpx/cjpx_decoder.h
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "core/fxcrt/unowned_ptr.h"
|
||||
#include "third_party/base/span.h"
|
||||
|
||||
-#if defined(USE_SYSTEM_LIBOPENJPEG2)
|
||||
+#if 1
|
||||
#include <openjpeg.h>
|
||||
#else
|
||||
#include "third_party/libopenjpeg20/openjpeg.h"
|
||||
@@ -0,0 +1,112 @@
|
||||
Taken from
|
||||
https://github.com/qvint/ungoogled-chromium-fedora/commit/a68fdd679566da5134d916776f14e00c8e6a8042
|
||||
|
||||
--- a/chrome/tools/convert_dict/convert_dict.cc
|
||||
+++ b/chrome/tools/convert_dict/convert_dict.cc
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/tools/convert_dict/aff_reader.h"
|
||||
#include "chrome/tools/convert_dict/dic_reader.h"
|
||||
+#include "components/spellcheck/common/spellcheck_common.h"
|
||||
#include "third_party/hunspell/google/bdict_reader.h"
|
||||
#include "third_party/hunspell/google/bdict_writer.h"
|
||||
|
||||
@@ -76,13 +77,32 @@ bool VerifyWords(const convert_dict::Dic
|
||||
}
|
||||
|
||||
int PrintHelp() {
|
||||
- printf("Usage: convert_dict <dicfile base name>\n\n");
|
||||
- printf("Example:\n");
|
||||
- printf(" convert_dict en-US\nwill read en-US.dic, en-US.dic_delta, and "
|
||||
- "en-US.aff from the current directory and generate en-US.bdic\n\n");
|
||||
+ printf(
|
||||
+ "Usage:\n"
|
||||
+ " dict-utility list\n"
|
||||
+ " dict-utility convert <aff_path> <dic_path> <out_path>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
+int PrintList() {
|
||||
+ base::FilePath root("/");
|
||||
+ std::vector<std::string> languages = spellcheck::SpellCheckLanguages();
|
||||
+
|
||||
+ for (auto &language : languages) {
|
||||
+ std::string language_region =
|
||||
+ spellcheck::GetSpellCheckLanguageRegion(language);
|
||||
+ base::FilePath language_bdic_path =
|
||||
+ spellcheck::GetVersionedFileName(language, root).BaseName();
|
||||
+
|
||||
+ printf("%s\t%s\t%s\n",
|
||||
+ language.c_str(),
|
||||
+ language_region.c_str(),
|
||||
+ language_bdic_path.value().c_str());
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@@ -91,16 +111,15 @@ int wmain(int argc, wchar_t* argv[]) {
|
||||
int main(int argc, char* argv[]) {
|
||||
#endif
|
||||
base::EnableTerminationOnHeapCorruption();
|
||||
- if (argc != 2)
|
||||
+ if (argc == 2 && strcmp(argv[1], "list") == 0)
|
||||
+ return PrintList();
|
||||
+ if (argc != 5 || strcmp(argv[1], "convert") != 0)
|
||||
return PrintHelp();
|
||||
|
||||
base::AtExitManager exit_manager;
|
||||
base::i18n::InitializeICU();
|
||||
|
||||
- base::FilePath file_base = base::FilePath(argv[1]);
|
||||
-
|
||||
- base::FilePath aff_path =
|
||||
- file_base.ReplaceExtension(FILE_PATH_LITERAL(".aff"));
|
||||
+ base::FilePath aff_path = base::FilePath(argv[2]);
|
||||
printf("Reading %" PRFilePath " ...\n", aff_path.value().c_str());
|
||||
convert_dict::AffReader aff_reader(aff_path);
|
||||
if (!aff_reader.Read()) {
|
||||
@@ -108,8 +127,7 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- base::FilePath dic_path =
|
||||
- file_base.ReplaceExtension(FILE_PATH_LITERAL(".dic"));
|
||||
+ base::FilePath dic_path = base::FilePath(argv[3]);
|
||||
printf("Reading %" PRFilePath " ...\n", dic_path.value().c_str());
|
||||
// DicReader will also read the .dic_delta file.
|
||||
convert_dict::DicReader dic_reader(dic_path);
|
||||
@@ -135,8 +153,7 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
- base::FilePath out_path =
|
||||
- file_base.ReplaceExtension(FILE_PATH_LITERAL(".bdic"));
|
||||
+ base::FilePath out_path = base::FilePath(argv[4]);
|
||||
printf("Writing %" PRFilePath " ...\n", out_path.value().c_str());
|
||||
FILE* out_file = base::OpenFile(out_path, "wb");
|
||||
if (!out_file) {
|
||||
--- a/chrome/tools/convert_dict/BUILD.gn
|
||||
+++ b/chrome/tools/convert_dict/BUILD.gn
|
||||
@@ -34,6 +34,7 @@ executable("convert_dict") {
|
||||
"//base",
|
||||
"//base:i18n",
|
||||
"//build/win:default_exe_manifest",
|
||||
+ "//components/spellcheck/common",
|
||||
"//third_party/hunspell",
|
||||
]
|
||||
}
|
||||
--- a/components/spellcheck/common/spellcheck_common.h
|
||||
+++ b/components/spellcheck/common/spellcheck_common.h
|
||||
@@ -34,6 +34,8 @@
|
||||
// chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
|
||||
static const size_t kMaxCustomDictionaryWordBytes = 99;
|
||||
|
||||
+std::string GetSpellCheckLanguageRegion(std::string_view input_language);
|
||||
+
|
||||
base::FilePath GetVersionedFileName(std::string_view input_language,
|
||||
const base::FilePath& dict_dir);
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
From: PF4Public@users.noreply.github.com
|
||||
License: BSD
|
||||
Subject: Fix building with use_bluez=false
|
||||
|
||||
This is a quick and dirty fix for building chromium with use_bluez=false
|
||||
It prevents initialization and usage of Bluetooth by the browser
|
||||
It is not supposed to be applied for use_bluez=true
|
||||
The browser will SEGFAULT upon accessing chrome://bluetooth-internals/
|
||||
It also breaks WebAuthn: https://github.com/PF4Public/gentoo-overlay/issues/254
|
||||
|
||||
---
|
||||
--- a/headless/lib/browser/headless_browser_main_parts_posix.cc
|
||||
+++ b/headless/lib/browser/headless_browser_main_parts_posix.cc
|
||||
@@ -25,9 +25,8 @@
|
||||
#include "components/os_crypt/sync/os_crypt.h"
|
||||
#include "headless/public/switches.h"
|
||||
|
||||
-#if defined(USE_DBUS)
|
||||
-#include "device/bluetooth/dbus/bluez_dbus_manager.h"
|
||||
-#endif
|
||||
+#include "device/bluetooth/bluetooth_adapter_factory.h"
|
||||
+#include "device/bluetooth/dbus/dbus_bluez_manager_wrapper_linux.h"
|
||||
|
||||
#endif // BUILDFLAG(IS_LINUX)
|
||||
|
||||
@@ -134,7 +133,7 @@
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
|
||||
#if defined(USE_DBUS)
|
||||
- bluez::BluezDBusManager::Initialize(/*system_bus=*/nullptr);
|
||||
+ bluez::DBusBluezManagerWrapperLinux::Initialize();
|
||||
#endif
|
||||
|
||||
// Set up crypt config. This needs to be done before anything starts the
|
||||
--- a/chrome/browser/chrome_browser_main_linux.cc
|
||||
+++ b/chrome/browser/chrome_browser_main_linux.cc
|
||||
@@ -35,6 +35,11 @@
|
||||
#include "chrome/browser/dbus_memory_pressure_evaluator_linux.h"
|
||||
#endif
|
||||
|
||||
+#if BUILDFLAG(IS_LINUX)
|
||||
+#include "device/bluetooth/bluetooth_adapter_factory.h"
|
||||
+#include "device/bluetooth/dbus/dbus_bluez_manager_wrapper_linux.h"
|
||||
+#endif
|
||||
+
|
||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
#include "base/command_line.h"
|
||||
#include "base/linux_util.h"
|
||||
@@ -59,7 +64,9 @@
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
#if !BUILDFLAG(IS_CHROMEOS)
|
||||
- bluez::BluezDBusManager::Initialize(nullptr /* system_bus */);
|
||||
+ #if BUILDFLAG(IS_LINUX)
|
||||
+ bluez::DBusBluezManagerWrapperLinux::Initialize();
|
||||
+ #endif
|
||||
|
||||
// Set up crypt config. This needs to be done before anything starts the
|
||||
// network service, as the raw encryption key needs to be shared with the
|
||||
@@ -117,7 +124,7 @@
|
||||
#endif // defined(USE_DBUS) && !BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
void ChromeBrowserMainPartsLinux::PostDestroyThreads() {
|
||||
-#if BUILDFLAG(IS_CHROMEOS)
|
||||
+#if BUILDFLAG(IS_LINUX)
|
||||
// No-op; per PostBrowserStart() comment, this is done elsewhere.
|
||||
#else
|
||||
bluez::BluezDBusManager::Shutdown();
|
||||
--- a/chrome/browser/metrics/bluetooth_metrics_provider.cc
|
||||
+++ b/chrome/browser/metrics/bluetooth_metrics_provider.cc
|
||||
@@ -16,9 +16,7 @@
|
||||
|
||||
bool BluetoothMetricsProvider::ProvideHistograms() {
|
||||
base::UmaHistogramEnumeration("Bluetooth.StackName",
|
||||
- floss::features::IsFlossEnabled()
|
||||
- ? BluetoothStackName::kFloss
|
||||
- : BluetoothStackName::kBlueZ);
|
||||
+ BluetoothStackName::kBlueZ);
|
||||
return true;
|
||||
}
|
||||
|
||||
--- a/device/bluetooth/adapter.cc
|
||||
+++ b/device/bluetooth/adapter.cc
|
||||
@@ -115,7 +115,7 @@
|
||||
adapter_info->system_name = adapter_->GetSystemName();
|
||||
#endif
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
- adapter_info->floss = floss::features::IsFlossEnabled();
|
||||
+ adapter_info->floss = false;
|
||||
adapter_info->extended_advertisement_support =
|
||||
adapter_->IsExtendedAdvertisementsAvailable();
|
||||
#endif
|
||||
@@ -0,0 +1,24 @@
|
||||
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
|
||||
index a55e4ab51d5b353..6049c6edb6a1ff3 100644
|
||||
--- a/media/ffmpeg/ffmpeg_common.cc
|
||||
+++ b/media/ffmpeg/ffmpeg_common.cc
|
||||
@@ -762,7 +762,7 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
|
||||
type.codec = VideoCodec::kDolbyVision;
|
||||
type.level = dovi->dv_level;
|
||||
type.color_space = color_space;
|
||||
- type.hdr_metadata_type = gfx::HdrMetadataType::kSmpteSt2094_10;
|
||||
+ type.hdr_metadata_type = gfx::HdrMetadataType::kNone;
|
||||
switch (dovi->dv_profile) {
|
||||
case 0:
|
||||
type.profile = VideoCodecProfile::DOLBYVISION_PROFILE0;
|
||||
@@ -796,8 +796,8 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
|
||||
break;
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_PLATFORM_DOLBY_VISION)
|
||||
- default:
|
||||
- break;
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
From 84d1d7adcd1697348e3f821811179c525d3b5717 Mon Sep 17 00:00:00 2001
|
||||
From: Dale Curtis <dalecurtis@chromium.org>
|
||||
Date: Tue, 28 Nov 2023 00:41:42 +0000
|
||||
Subject: [PATCH] Roll src/third_party/ffmpeg/ c1d0dc413..866768f35 (492
|
||||
commits)
|
||||
|
||||
|
||||
---
|
||||
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
|
||||
index 3c97e4a6cf4c781..a55e4ab51d5b353 100644
|
||||
--- a/media/ffmpeg/ffmpeg_common.cc
|
||||
+++ b/media/ffmpeg/ffmpeg_common.cc
|
||||
@@ -653,15 +653,6 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
|
||||
profile = ProfileIDToVideoCodecProfile(codec_context->profile);
|
||||
}
|
||||
|
||||
- void* display_matrix =
|
||||
- av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr);
|
||||
-
|
||||
- VideoTransformation video_transformation = VideoTransformation();
|
||||
- if (display_matrix) {
|
||||
- video_transformation = VideoTransformation::FromFFmpegDisplayMatrix(
|
||||
- static_cast<int32_t*>(display_matrix));
|
||||
- }
|
||||
-
|
||||
if (!color_space.IsSpecified()) {
|
||||
// VP9 frames may have color information, but that information cannot
|
||||
// express new color spaces, like HDR. For that reason, color space
|
||||
@@ -718,88 +709,92 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
|
||||
codec_context->extradata + codec_context->extradata_size);
|
||||
}
|
||||
|
||||
- if (stream->nb_side_data) {
|
||||
- for (int i = 0; i < stream->nb_side_data; ++i) {
|
||||
- AVPacketSideData side_data = stream->side_data[i];
|
||||
- switch (side_data.type) {
|
||||
- case AV_PKT_DATA_MASTERING_DISPLAY_METADATA: {
|
||||
- AVMasteringDisplayMetadata* mdcv =
|
||||
- reinterpret_cast<AVMasteringDisplayMetadata*>(side_data.data);
|
||||
- gfx::HdrMetadataSmpteSt2086 smpte_st_2086;
|
||||
- if (mdcv->has_primaries) {
|
||||
- smpte_st_2086.primaries = {
|
||||
- static_cast<float>(av_q2d(mdcv->display_primaries[0][0])),
|
||||
- static_cast<float>(av_q2d(mdcv->display_primaries[0][1])),
|
||||
- static_cast<float>(av_q2d(mdcv->display_primaries[1][0])),
|
||||
- static_cast<float>(av_q2d(mdcv->display_primaries[1][1])),
|
||||
- static_cast<float>(av_q2d(mdcv->display_primaries[2][0])),
|
||||
- static_cast<float>(av_q2d(mdcv->display_primaries[2][1])),
|
||||
- static_cast<float>(av_q2d(mdcv->white_point[0])),
|
||||
- static_cast<float>(av_q2d(mdcv->white_point[1])),
|
||||
- };
|
||||
- }
|
||||
- if (mdcv->has_luminance) {
|
||||
- smpte_st_2086.luminance_max = av_q2d(mdcv->max_luminance);
|
||||
- smpte_st_2086.luminance_min = av_q2d(mdcv->min_luminance);
|
||||
- }
|
||||
-
|
||||
- // TODO(https://crbug.com/1446302): Consider rejecting metadata that
|
||||
- // does not specify all values.
|
||||
- if (mdcv->has_primaries || mdcv->has_luminance) {
|
||||
- hdr_metadata.smpte_st_2086 = smpte_st_2086;
|
||||
- }
|
||||
- break;
|
||||
+ VideoTransformation video_transformation = VideoTransformation();
|
||||
+ for (int i = 0; i < stream->codecpar->nb_coded_side_data; ++i) {
|
||||
+ const auto& side_data = stream->codecpar->coded_side_data[i];
|
||||
+ switch (side_data.type) {
|
||||
+ case AV_PKT_DATA_DISPLAYMATRIX: {
|
||||
+ CHECK_EQ(side_data.size, sizeof(int32_t) * 3 * 3);
|
||||
+ video_transformation = VideoTransformation::FromFFmpegDisplayMatrix(
|
||||
+ reinterpret_cast<int32_t*>(side_data.data));
|
||||
+ break;
|
||||
+ }
|
||||
+ case AV_PKT_DATA_MASTERING_DISPLAY_METADATA: {
|
||||
+ AVMasteringDisplayMetadata* mdcv =
|
||||
+ reinterpret_cast<AVMasteringDisplayMetadata*>(side_data.data);
|
||||
+ gfx::HdrMetadataSmpteSt2086 smpte_st_2086;
|
||||
+ if (mdcv->has_primaries) {
|
||||
+ smpte_st_2086.primaries = {
|
||||
+ static_cast<float>(av_q2d(mdcv->display_primaries[0][0])),
|
||||
+ static_cast<float>(av_q2d(mdcv->display_primaries[0][1])),
|
||||
+ static_cast<float>(av_q2d(mdcv->display_primaries[1][0])),
|
||||
+ static_cast<float>(av_q2d(mdcv->display_primaries[1][1])),
|
||||
+ static_cast<float>(av_q2d(mdcv->display_primaries[2][0])),
|
||||
+ static_cast<float>(av_q2d(mdcv->display_primaries[2][1])),
|
||||
+ static_cast<float>(av_q2d(mdcv->white_point[0])),
|
||||
+ static_cast<float>(av_q2d(mdcv->white_point[1])),
|
||||
+ };
|
||||
}
|
||||
- case AV_PKT_DATA_CONTENT_LIGHT_LEVEL: {
|
||||
- AVContentLightMetadata* clli =
|
||||
- reinterpret_cast<AVContentLightMetadata*>(side_data.data);
|
||||
- hdr_metadata.cta_861_3 =
|
||||
- gfx::HdrMetadataCta861_3(clli->MaxCLL, clli->MaxFALL);
|
||||
- break;
|
||||
+ if (mdcv->has_luminance) {
|
||||
+ smpte_st_2086.luminance_max = av_q2d(mdcv->max_luminance);
|
||||
+ smpte_st_2086.luminance_min = av_q2d(mdcv->min_luminance);
|
||||
+ }
|
||||
+
|
||||
+ // TODO(https://crbug.com/1446302): Consider rejecting metadata that
|
||||
+ // does not specify all values.
|
||||
+ if (mdcv->has_primaries || mdcv->has_luminance) {
|
||||
+ hdr_metadata.smpte_st_2086 = smpte_st_2086;
|
||||
}
|
||||
+ break;
|
||||
+ }
|
||||
+ case AV_PKT_DATA_CONTENT_LIGHT_LEVEL: {
|
||||
+ AVContentLightMetadata* clli =
|
||||
+ reinterpret_cast<AVContentLightMetadata*>(side_data.data);
|
||||
+ hdr_metadata.cta_861_3 =
|
||||
+ gfx::HdrMetadataCta861_3(clli->MaxCLL, clli->MaxFALL);
|
||||
+ break;
|
||||
+ }
|
||||
#if BUILDFLAG(ENABLE_PLATFORM_DOLBY_VISION)
|
||||
- case AV_PKT_DATA_DOVI_CONF: {
|
||||
- AVDOVIDecoderConfigurationRecord* dovi =
|
||||
- reinterpret_cast<AVDOVIDecoderConfigurationRecord*>(
|
||||
- side_data.data);
|
||||
- VideoType type;
|
||||
- type.codec = VideoCodec::kDolbyVision;
|
||||
- type.level = dovi->dv_level;
|
||||
- type.color_space = color_space;
|
||||
- type.hdr_metadata_type = gfx::HdrMetadataType::kSmpteSt2094_10;
|
||||
- switch (dovi->dv_profile) {
|
||||
- case 0:
|
||||
- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE0;
|
||||
- break;
|
||||
- case 5:
|
||||
- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE5;
|
||||
- break;
|
||||
- case 7:
|
||||
- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE7;
|
||||
- break;
|
||||
- case 8:
|
||||
- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE8;
|
||||
- break;
|
||||
- case 9:
|
||||
- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE9;
|
||||
- break;
|
||||
- default:
|
||||
- type.profile = VideoCodecProfile::VIDEO_CODEC_PROFILE_UNKNOWN;
|
||||
- break;
|
||||
- }
|
||||
- // Treat dolby vision contents as dolby vision codec only if the
|
||||
- // device support clear DV decoding, otherwise use the original
|
||||
- // HEVC or AVC codec and profile.
|
||||
- if (media::IsSupportedVideoType(type)) {
|
||||
- codec = type.codec;
|
||||
- profile = type.profile;
|
||||
- }
|
||||
- break;
|
||||
+ case AV_PKT_DATA_DOVI_CONF: {
|
||||
+ AVDOVIDecoderConfigurationRecord* dovi =
|
||||
+ reinterpret_cast<AVDOVIDecoderConfigurationRecord*>(side_data.data);
|
||||
+ VideoType type;
|
||||
+ type.codec = VideoCodec::kDolbyVision;
|
||||
+ type.level = dovi->dv_level;
|
||||
+ type.color_space = color_space;
|
||||
+ type.hdr_metadata_type = gfx::HdrMetadataType::kSmpteSt2094_10;
|
||||
+ switch (dovi->dv_profile) {
|
||||
+ case 0:
|
||||
+ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE0;
|
||||
+ break;
|
||||
+ case 5:
|
||||
+ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE5;
|
||||
+ break;
|
||||
+ case 7:
|
||||
+ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE7;
|
||||
+ break;
|
||||
+ case 8:
|
||||
+ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE8;
|
||||
+ break;
|
||||
+ case 9:
|
||||
+ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE9;
|
||||
+ break;
|
||||
+ default:
|
||||
+ type.profile = VideoCodecProfile::VIDEO_CODEC_PROFILE_UNKNOWN;
|
||||
+ break;
|
||||
+ }
|
||||
+ // Treat dolby vision contents as dolby vision codec only if the
|
||||
+ // device support clear DV decoding, otherwise use the original
|
||||
+ // HEVC or AVC codec and profile.
|
||||
+ if (media::IsSupportedVideoType(type)) {
|
||||
+ codec = type.codec;
|
||||
+ profile = type.profile;
|
||||
}
|
||||
+ break;
|
||||
+ }
|
||||
#endif // BUILDFLAG(ENABLE_PLATFORM_DOLBY_VISION)
|
||||
default:
|
||||
break;
|
||||
- }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/media/filters/audio_video_metadata_extractor.cc b/media/filters/audio_video_metadata_extractor.cc
|
||||
index cb002490a6322bf..e841b4ad13383ac 100644
|
||||
--- a/media/filters/audio_video_metadata_extractor.cc
|
||||
+++ b/media/filters/audio_video_metadata_extractor.cc
|
||||
@@ -113,13 +113,16 @@ bool AudioVideoMetadataExtractor::Extract(DataSource* source,
|
||||
if (!stream)
|
||||
continue;
|
||||
|
||||
- void* display_matrix =
|
||||
- av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr);
|
||||
- if (display_matrix) {
|
||||
- rotation_ = VideoTransformation::FromFFmpegDisplayMatrix(
|
||||
- static_cast<int32_t*>(display_matrix))
|
||||
- .rotation;
|
||||
- info.tags["rotate"] = base::NumberToString(rotation_);
|
||||
+ for (int j = 0; j < stream->codecpar->nb_coded_side_data; j++) {
|
||||
+ const AVPacketSideData& sd = stream->codecpar->coded_side_data[j];
|
||||
+ if (sd.type == AV_PKT_DATA_DISPLAYMATRIX) {
|
||||
+ CHECK_EQ(sd.size, sizeof(int32_t) * 3 * 3);
|
||||
+ rotation_ = VideoTransformation::FromFFmpegDisplayMatrix(
|
||||
+ reinterpret_cast<int32_t*>(sd.data))
|
||||
+ .rotation;
|
||||
+ info.tags["rotate"] = base::NumberToString(rotation_);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
// Extract dictionary from streams also. Needed for containers that attach
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
--- a/third_party/blink/renderer/platform/fonts/font_face_creation_params.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font_face_creation_params.h
|
||||
@@ -64,7 +64,7 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
- FontFaceCreationParams(const std::string& filename,
|
||||
+ FontFaceCreationParams(const WTF::String& filename,
|
||||
int fontconfig_interface_id,
|
||||
int ttc_index = 0)
|
||||
: creation_type_(kCreateFontByFciIdAndTtcIndex),
|
||||
@@ -77,7 +77,7 @@
|
||||
DCHECK_EQ(creation_type_, kCreateFontByFamily);
|
||||
return family_;
|
||||
}
|
||||
- const std::string& Filename() const {
|
||||
+ const WTF::String& Filename() const {
|
||||
DCHECK_EQ(creation_type_, kCreateFontByFciIdAndTtcIndex);
|
||||
#if defined(ADDRESS_SANITIZER)
|
||||
DCHECK(filename_.has_value());
|
||||
@@ -105,7 +105,7 @@
|
||||
std::tuple<int, int, unsigned> hash_data = {
|
||||
ttc_index_, fontconfig_interface_id_,
|
||||
HasFilename() ? StringHasher::HashMemory(
|
||||
- Filename().data(),
|
||||
+ Filename().Utf8().data(),
|
||||
static_cast<unsigned>(Filename().length()))
|
||||
: 0};
|
||||
return StringHasher::HashMemory(&hash_data, sizeof(hash_data));
|
||||
@@ -130,7 +130,7 @@
|
||||
FontFaceCreationType creation_type_;
|
||||
AtomicString family_;
|
||||
|
||||
- void SetFilename(std::string& filename) {
|
||||
+ void SetFilename(WTF::String& filename) {
|
||||
#if defined(ADDRESS_SANITIZER)
|
||||
*filename_ = filename;
|
||||
#else
|
||||
@@ -167,7 +167,7 @@
|
||||
// See crbug.com/346174906.
|
||||
std::optional<std::string> filename_;
|
||||
#else
|
||||
- std::string filename_;
|
||||
+ WTF::String filename_;
|
||||
#endif
|
||||
int fontconfig_interface_id_ = 0;
|
||||
int ttc_index_ = 0;
|
||||
--- a/third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
FontFaceCreationParams creation_params;
|
||||
creation_params = FontFaceCreationParams(
|
||||
- fallback_font.filepath.value(), fallback_font.fontconfig_interface_id,
|
||||
+ WTF::String(fallback_font.filepath.value()), fallback_font.fontconfig_interface_id,
|
||||
fallback_font.ttc_index);
|
||||
|
||||
// Changes weight and/or italic of given FontDescription depends on
|
||||
--- a/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc
|
||||
@@ -234,7 +234,7 @@
|
||||
creation_params.FontconfigInterfaceId(), creation_params.TtcIndex());
|
||||
}
|
||||
return SkTypeface_Factory::FromFilenameAndTtcIndex(
|
||||
- creation_params.Filename().data(), creation_params.TtcIndex());
|
||||
+ creation_params.Filename().Utf8().data(), creation_params.TtcIndex());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# 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.
|
||||
|
||||
import("//build/config/linux/pkg_config.gni")
|
||||
import("//build/shim_headers.gni")
|
||||
|
||||
pkg_config("system_libusb") {
|
||||
packages = [ "libusb-1.0" ]
|
||||
}
|
||||
|
||||
shim_headers("libusb_shim") {
|
||||
root_path = "src/libusb"
|
||||
headers = [
|
||||
"libusb.h",
|
||||
]
|
||||
}
|
||||
|
||||
source_set("libusb") {
|
||||
deps = [
|
||||
":libusb_shim",
|
||||
]
|
||||
public_configs = [ ":system_libusb" ]
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
From acc24608c84d2d2d8d684f40a110d0a6f4eddc51 Mon Sep 17 00:00:00 2001
|
||||
From: Daniele Di Proietto <ddiproietto@google.com>
|
||||
Date: Mon, 6 Jan 2025 15:30:23 +0000
|
||||
Subject: [PATCH] Small fixes for libstdc++
|
||||
|
||||
Change-Id: I054305ff3de0007f98f9713347f72d63d69569e8
|
||||
---
|
||||
include/perfetto/tracing/track.h | 1 +
|
||||
src/profiling/common/producer_support.cc | 1 +
|
||||
src/trace_processor/importers/common/tracks.h | 4 ++--
|
||||
src/trace_processor/importers/common/tracks_internal.h | 8 ++++----
|
||||
.../perfetto_sql/engine/created_function.cc | 4 ++--
|
||||
src/trace_processor/util/regex.h | 2 +-
|
||||
src/traceconv/pprof_reader.cc | 2 +-
|
||||
7 files changed, 12 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/include/perfetto/tracing/track.h b/include/perfetto/tracing/track.h
|
||||
index 43a8de13d4299387bc1c77582d33542371ffd74f..2a857298c7f4769a05d0db309aca59b72c22b115 100644
|
||||
--- a/include/perfetto/tracing/track.h
|
||||
+++ b/include/perfetto/tracing/track.h
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <stdint.h>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
+#include <optional>
|
||||
|
||||
namespace perfetto {
|
||||
namespace internal {
|
||||
diff --git a/src/profiling/common/producer_support.cc b/src/profiling/common/producer_support.cc
|
||||
index 5303658d7b7bb0d4b08c00a1decc5c757b006ecb..e9e193db81f87b5c48eefc5aa5a3cfa307baafdb 100644
|
||||
--- a/src/profiling/common/producer_support.cc
|
||||
+++ b/src/profiling/common/producer_support.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "src/profiling/common/producer_support.h"
|
||||
|
||||
+#include <algorithm>
|
||||
#include <optional>
|
||||
|
||||
#include "perfetto/ext/base/android_utils.h"
|
||||
diff --git a/src/trace_processor/perfetto_sql/engine/created_function.cc b/src/trace_processor/perfetto_sql/engine/created_function.cc
|
||||
index 1c01c1787ea9ab1972159ce4efd65e225040cee6..e6cef14909d7dab58d1c4abbbe3e536c696910fb 100644
|
||||
--- a/src/trace_processor/perfetto_sql/engine/created_function.cc
|
||||
+++ b/src/trace_processor/perfetto_sql/engine/created_function.cc
|
||||
@@ -109,7 +109,7 @@ struct StoredSqlValue {
|
||||
// the destructors run correctly for non-trivial members of the
|
||||
// union.
|
||||
using Data =
|
||||
- std::variant<int64_t, double, OwnedString, OwnedBytes, nullptr_t>;
|
||||
+ std::variant<int64_t, double, OwnedString, OwnedBytes, std::nullptr_t>;
|
||||
|
||||
StoredSqlValue(SqlValue value) {
|
||||
switch (value.type) {
|
||||
@@ -134,7 +134,7 @@ struct StoredSqlValue {
|
||||
}
|
||||
|
||||
SqlValue AsSqlValue() {
|
||||
- if (std::holds_alternative<nullptr_t>(data)) {
|
||||
+ if (std::holds_alternative<std::nullptr_t>(data)) {
|
||||
return SqlValue();
|
||||
} else if (std::holds_alternative<int64_t>(data)) {
|
||||
return SqlValue::Long(std::get<int64_t>(data));
|
||||
diff --git a/src/trace_processor/util/regex.h b/src/trace_processor/util/regex.h
|
||||
index 120e4c968279d75d8b8f341a96a1f6402a9c4e41..167af55d9bebe4c3c7febf1be91d0bdd01910282 100644
|
||||
--- a/src/trace_processor/util/regex.h
|
||||
+++ b/src/trace_processor/util/regex.h
|
||||
@@ -48,7 +48,7 @@ class Regex {
|
||||
regfree(®ex_.value());
|
||||
}
|
||||
}
|
||||
- Regex(Regex&) = delete;
|
||||
+ Regex(const Regex&) = delete;
|
||||
Regex(Regex&& other) {
|
||||
regex_ = std::move(other.regex_);
|
||||
other.regex_ = std::nullopt;
|
||||
diff --git a/src/traceconv/pprof_reader.cc b/src/traceconv/pprof_reader.cc
|
||||
index f14cca73778b14505cce7d4f99848fae67a111c0..612b7c7a40e7127109550a7d0bcfed3685afa2b6 100644
|
||||
--- a/src/traceconv/pprof_reader.cc
|
||||
+++ b/src/traceconv/pprof_reader.cc
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
#include "src/traceconv/pprof_reader.h"
|
||||
|
||||
+#include <algorithm>
|
||||
#include <cinttypes>
|
||||
-#include <fstream>
|
||||
|
||||
#include "perfetto/ext/base/file_utils.h"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/third_party/perfetto/gn/BUILD.gn
|
||||
+++ b/third_party/perfetto/gn/BUILD.gn
|
||||
@@ -382,7 +382,7 @@
|
||||
if (enable_perfetto_zlib) {
|
||||
group("zlib") {
|
||||
if (perfetto_use_system_zlib) {
|
||||
- public_configs = [ "//gn:system_zlib_config" ]
|
||||
+ public_configs = [ ":system_zlib_config" ]
|
||||
} else if (perfetto_root_path == "//") {
|
||||
public_configs = [ "//buildtools:zlib_config" ]
|
||||
public_deps = [ "//buildtools:zlib" ]
|
||||
@@ -0,0 +1,287 @@
|
||||
--- b/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc
|
||||
+++ a/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc
|
||||
@@ -74,7 +74,7 @@
|
||||
codec_context->sample_fmt = AV_SAMPLE_FMT_NONE;
|
||||
}
|
||||
|
||||
+ codec_context->channels = config.channel_count;
|
||||
- codec_context->ch_layout.nb_channels = config.channel_count;
|
||||
codec_context->sample_rate = config.samples_per_second;
|
||||
|
||||
if (config.extra_data) {
|
||||
@@ -124,8 +124,8 @@
|
||||
case cdm::kAudioFormatPlanarS16:
|
||||
case cdm::kAudioFormatPlanarF32: {
|
||||
const int decoded_size_per_channel =
|
||||
+ decoded_audio_size / av_frame.channels;
|
||||
+ for (int i = 0; i < av_frame.channels; ++i) {
|
||||
- decoded_audio_size / av_frame.ch_layout.nb_channels;
|
||||
- for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) {
|
||||
memcpy(output_buffer, av_frame.extended_data[i],
|
||||
decoded_size_per_channel);
|
||||
output_buffer += decoded_size_per_channel;
|
||||
@@ -185,14 +185,13 @@
|
||||
// Success!
|
||||
decoding_loop_ = std::make_unique<FFmpegDecodingLoop>(codec_context_.get());
|
||||
samples_per_second_ = config.samples_per_second;
|
||||
+ bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8;
|
||||
- bytes_per_frame_ =
|
||||
- codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8;
|
||||
output_timestamp_helper_ =
|
||||
std::make_unique<AudioTimestampHelper>(config.samples_per_second);
|
||||
is_initialized_ = true;
|
||||
|
||||
// Store initial values to guard against midstream configuration changes.
|
||||
+ channels_ = codec_context_->channels;
|
||||
- channels_ = codec_context_->ch_layout.nb_channels;
|
||||
av_sample_format_ = codec_context_->sample_fmt;
|
||||
|
||||
return true;
|
||||
@@ -292,19 +291,17 @@
|
||||
for (auto& frame : audio_frames) {
|
||||
int decoded_audio_size = 0;
|
||||
if (frame->sample_rate != samples_per_second_ ||
|
||||
+ frame->channels != channels_ || frame->format != av_sample_format_) {
|
||||
- frame->ch_layout.nb_channels != channels_ ||
|
||||
- frame->format != av_sample_format_) {
|
||||
DLOG(ERROR) << "Unsupported midstream configuration change!"
|
||||
<< " Sample Rate: " << frame->sample_rate << " vs "
|
||||
+ << samples_per_second_ << ", Channels: " << frame->channels
|
||||
+ << " vs " << channels_ << ", Sample Format: " << frame->format
|
||||
+ << " vs " << av_sample_format_;
|
||||
- << samples_per_second_
|
||||
- << ", Channels: " << frame->ch_layout.nb_channels << " vs "
|
||||
- << channels_ << ", Sample Format: " << frame->format << " vs "
|
||||
- << av_sample_format_;
|
||||
return cdm::kDecodeError;
|
||||
}
|
||||
|
||||
decoded_audio_size = av_samples_get_buffer_size(
|
||||
+ nullptr, codec_context_->channels, frame->nb_samples,
|
||||
- nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples,
|
||||
codec_context_->sample_fmt, 1);
|
||||
if (!decoded_audio_size)
|
||||
continue;
|
||||
@@ -323,9 +320,9 @@
|
||||
size_t* total_size,
|
||||
std::vector<std::unique_ptr<AVFrame, ScopedPtrAVFreeFrame>>* audio_frames,
|
||||
AVFrame* frame) {
|
||||
+ *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels,
|
||||
+ frame->nb_samples,
|
||||
+ codec_context_->sample_fmt, 1);
|
||||
- *total_size += av_samples_get_buffer_size(
|
||||
- nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples,
|
||||
- codec_context_->sample_fmt, 1);
|
||||
audio_frames->emplace_back(av_frame_clone(frame));
|
||||
return true;
|
||||
}
|
||||
--- b/media/ffmpeg/ffmpeg_common.cc
|
||||
+++ a/media/ffmpeg/ffmpeg_common.cc
|
||||
@@ -345,11 +345,10 @@
|
||||
codec_context->sample_fmt, codec_context->codec_id);
|
||||
|
||||
ChannelLayout channel_layout =
|
||||
+ codec_context->channels > 8
|
||||
- codec_context->ch_layout.nb_channels > 8
|
||||
? CHANNEL_LAYOUT_DISCRETE
|
||||
+ : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout,
|
||||
+ codec_context->channels);
|
||||
- : ChannelLayoutToChromeChannelLayout(
|
||||
- codec_context->ch_layout.u.mask,
|
||||
- codec_context->ch_layout.nb_channels);
|
||||
|
||||
int sample_rate = codec_context->sample_rate;
|
||||
switch (codec) {
|
||||
@@ -402,7 +401,7 @@
|
||||
extra_data, encryption_scheme, seek_preroll,
|
||||
codec_context->delay);
|
||||
if (channel_layout == CHANNEL_LAYOUT_DISCRETE)
|
||||
+ config->SetChannelsForDiscrete(codec_context->channels);
|
||||
- config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels);
|
||||
|
||||
#if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO)
|
||||
// These are bitstream formats unknown to ffmpeg, so they don't have
|
||||
@@ -471,7 +470,7 @@
|
||||
|
||||
// TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses
|
||||
// said information to decode.
|
||||
+ codec_context->channels = config.channels();
|
||||
- codec_context->ch_layout.nb_channels = config.channels();
|
||||
codec_context->sample_rate = config.samples_per_second();
|
||||
|
||||
if (config.extra_data().empty()) {
|
||||
--- b/media/filters/audio_file_reader.cc
|
||||
+++ a/media/filters/audio_file_reader.cc
|
||||
@@ -113,15 +113,14 @@
|
||||
|
||||
// Verify the channel layout is supported by Chrome. Acts as a sanity check
|
||||
// against invalid files. See http://crbug.com/171962
|
||||
+ if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout,
|
||||
+ codec_context_->channels) ==
|
||||
- if (ChannelLayoutToChromeChannelLayout(
|
||||
- codec_context_->ch_layout.u.mask,
|
||||
- codec_context_->ch_layout.nb_channels) ==
|
||||
CHANNEL_LAYOUT_UNSUPPORTED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Store initial values to guard against midstream configuration changes.
|
||||
+ channels_ = codec_context_->channels;
|
||||
- channels_ = codec_context_->ch_layout.nb_channels;
|
||||
audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id);
|
||||
sample_rate_ = codec_context_->sample_rate;
|
||||
av_sample_format_ = codec_context_->sample_fmt;
|
||||
@@ -224,7 +223,7 @@
|
||||
if (frames_read < 0)
|
||||
return false;
|
||||
|
||||
+ const int channels = frame->channels;
|
||||
- const int channels = frame->ch_layout.nb_channels;
|
||||
if (frame->sample_rate != sample_rate_ || channels != channels_ ||
|
||||
frame->format != av_sample_format_) {
|
||||
DLOG(ERROR) << "Unsupported midstream configuration change!"
|
||||
--- b/media/filters/audio_file_reader_unittest.cc
|
||||
+++ a/media/filters/audio_file_reader_unittest.cc
|
||||
@@ -121,11 +121,11 @@
|
||||
EXPECT_FALSE(reader_->Open());
|
||||
}
|
||||
|
||||
+ void RunTestFailingDecode(const char* fn) {
|
||||
- void RunTestFailingDecode(const char* fn, int expect_read = 0) {
|
||||
Initialize(fn);
|
||||
EXPECT_TRUE(reader_->Open());
|
||||
std::vector<std::unique_ptr<AudioBus>> decoded_audio_packets;
|
||||
+ EXPECT_EQ(reader_->Read(&decoded_audio_packets), 0);
|
||||
- EXPECT_EQ(reader_->Read(&decoded_audio_packets), expect_read);
|
||||
}
|
||||
|
||||
void RunTestPartialDecode(const char* fn) {
|
||||
@@ -219,7 +219,7 @@
|
||||
}
|
||||
|
||||
TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) {
|
||||
+ RunTestFailingDecode("midstream_config_change.mp3");
|
||||
- RunTestFailingDecode("midstream_config_change.mp3", 42624);
|
||||
}
|
||||
#endif
|
||||
|
||||
--- b/media/filters/audio_video_metadata_extractor.cc
|
||||
+++ a/media/filters/audio_video_metadata_extractor.cc
|
||||
@@ -113,15 +113,6 @@
|
||||
if (!stream)
|
||||
continue;
|
||||
|
||||
- void* display_matrix =
|
||||
- av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr);
|
||||
- if (display_matrix) {
|
||||
- rotation_ = VideoTransformation::FromFFmpegDisplayMatrix(
|
||||
- static_cast<int32_t*>(display_matrix))
|
||||
- .rotation;
|
||||
- info.tags["rotate"] = base::NumberToString(rotation_);
|
||||
- }
|
||||
-
|
||||
// Extract dictionary from streams also. Needed for containers that attach
|
||||
// metadata to contained streams instead the container itself, like OGG.
|
||||
ExtractDictionary(stream->metadata, &info.tags);
|
||||
@@ -264,6 +255,8 @@
|
||||
if (raw_tags->find(tag->key) == raw_tags->end())
|
||||
(*raw_tags)[tag->key] = tag->value;
|
||||
|
||||
+ if (ExtractInt(tag, "rotate", &rotation_))
|
||||
+ continue;
|
||||
if (ExtractString(tag, "album", &album_))
|
||||
continue;
|
||||
if (ExtractString(tag, "artist", &artist_))
|
||||
--- b/media/filters/ffmpeg_aac_bitstream_converter.cc
|
||||
+++ a/media/filters/ffmpeg_aac_bitstream_converter.cc
|
||||
@@ -195,15 +195,14 @@
|
||||
if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id ||
|
||||
audio_profile_ != stream_codec_parameters_->profile ||
|
||||
sample_rate_index_ != sample_rate_index ||
|
||||
+ channel_configuration_ != stream_codec_parameters_->channels ||
|
||||
- channel_configuration_ !=
|
||||
- stream_codec_parameters_->ch_layout.nb_channels ||
|
||||
frame_length_ != header_plus_packet_size) {
|
||||
header_generated_ =
|
||||
GenerateAdtsHeader(stream_codec_parameters_->codec_id,
|
||||
0, // layer
|
||||
stream_codec_parameters_->profile, sample_rate_index,
|
||||
0, // private stream
|
||||
+ stream_codec_parameters_->channels,
|
||||
- stream_codec_parameters_->ch_layout.nb_channels,
|
||||
0, // originality
|
||||
0, // home
|
||||
0, // copyrighted_stream
|
||||
@@ -215,7 +214,7 @@
|
||||
codec_ = stream_codec_parameters_->codec_id;
|
||||
audio_profile_ = stream_codec_parameters_->profile;
|
||||
sample_rate_index_ = sample_rate_index;
|
||||
+ channel_configuration_ = stream_codec_parameters_->channels;
|
||||
- channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels;
|
||||
frame_length_ = header_plus_packet_size;
|
||||
}
|
||||
|
||||
--- b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc
|
||||
+++ a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc
|
||||
@@ -34,7 +34,7 @@
|
||||
memset(&test_parameters_, 0, sizeof(AVCodecParameters));
|
||||
test_parameters_.codec_id = AV_CODEC_ID_AAC;
|
||||
test_parameters_.profile = FF_PROFILE_AAC_MAIN;
|
||||
+ test_parameters_.channels = 2;
|
||||
- test_parameters_.ch_layout.nb_channels = 2;
|
||||
test_parameters_.extradata = extradata_header_;
|
||||
test_parameters_.extradata_size = sizeof(extradata_header_);
|
||||
}
|
||||
--- b/media/filters/ffmpeg_audio_decoder.cc
|
||||
+++ a/media/filters/ffmpeg_audio_decoder.cc
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
// Return the number of channels from the data in |frame|.
|
||||
static inline int DetermineChannels(AVFrame* frame) {
|
||||
+ return frame->channels;
|
||||
- return frame->ch_layout.nb_channels;
|
||||
}
|
||||
|
||||
// Called by FFmpeg's allocation routine to allocate a buffer. Uses
|
||||
@@ -231,7 +231,7 @@
|
||||
// Translate unsupported into discrete layouts for discrete configurations;
|
||||
// ffmpeg does not have a labeled discrete configuration internally.
|
||||
ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout(
|
||||
+ codec_context_->channel_layout, codec_context_->channels);
|
||||
- codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels);
|
||||
if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED &&
|
||||
config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) {
|
||||
channel_layout = CHANNEL_LAYOUT_DISCRETE;
|
||||
@@ -348,11 +348,11 @@
|
||||
// Success!
|
||||
av_sample_format_ = codec_context_->sample_fmt;
|
||||
|
||||
+ if (codec_context_->channels != config.channels()) {
|
||||
- if (codec_context_->ch_layout.nb_channels != config.channels()) {
|
||||
MEDIA_LOG(ERROR, media_log_)
|
||||
<< "Audio configuration specified " << config.channels()
|
||||
<< " channels, but FFmpeg thinks the file contains "
|
||||
+ << codec_context_->channels << " channels";
|
||||
- << codec_context_->ch_layout.nb_channels << " channels";
|
||||
ReleaseFFmpegResources();
|
||||
state_ = DecoderState::kUninitialized;
|
||||
return false;
|
||||
@@ -403,7 +403,7 @@
|
||||
if (frame->nb_samples <= 0)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
+ if (s->channels != channels) {
|
||||
- if (s->ch_layout.nb_channels != channels) {
|
||||
DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count.";
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
@@ -436,8 +436,7 @@
|
||||
ChannelLayout channel_layout =
|
||||
config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE
|
||||
? CHANNEL_LAYOUT_DISCRETE
|
||||
+ : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels);
|
||||
- : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask,
|
||||
- s->ch_layout.nb_channels);
|
||||
|
||||
if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) {
|
||||
DLOG(ERROR) << "Unsupported channel layout.";
|
||||
@@ -0,0 +1,15 @@
|
||||
--- a/media/filters/audio_file_reader.cc
|
||||
+++ b/media/filters/audio_file_reader.cc
|
||||
@@ -243,10 +243,10 @@ bool AudioFileReader::OnNewFrame(
|
||||
// silence from being output. In the case where we are also discarding some
|
||||
// portion of the packet (as indicated by a negative pts), we further want to
|
||||
// adjust the duration downward by however much exists before zero.
|
||||
- if (audio_codec_ == AudioCodec::kAAC && frame->duration) {
|
||||
+ if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) {
|
||||
const base::TimeDelta pkt_duration = ConvertFromTimeBase(
|
||||
glue_->format_context()->streams[stream_index_]->time_base,
|
||||
- frame->duration + std::min(static_cast<int64_t>(0), frame->pts));
|
||||
+ frame->pkt_duration + std::min(static_cast<int64_t>(0), frame->pts));
|
||||
const base::TimeDelta frame_duration =
|
||||
base::Seconds(frames_read / static_cast<double>(sample_rate_));
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
--- a/third_party/blink/public/public_features.gni
|
||||
+++ b/third_party/blink/public/public_features.gni
|
||||
@@ -4,6 +4,11 @@
|
||||
|
||||
import("//build/config/ui.gni")
|
||||
|
||||
+declare_args() {
|
||||
+ # Thorium internal flag
|
||||
+ is_thorium_build = true
|
||||
+}
|
||||
+
|
||||
# Unhandled Tap enable means Contextual Search aka Touch to Search.
|
||||
# TODO(donnd): remove all unhandled-tap handling after the Long-press experiment
|
||||
# is fully launched.
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -8928,12 +8928,6 @@
|
||||
"LauncherDynamicAnimations")},
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
|
||||
-#if BUILDFLAG(ENABLE_JXL_DECODER)
|
||||
- {"enable-jxl", flag_descriptions::kEnableJXLName,
|
||||
- flag_descriptions::kEnableJXLDescription, kOsAll,
|
||||
- FEATURE_VALUE_TYPE(blink::features::kJXL)},
|
||||
-#endif // BUILDFLAG(ENABLE_JXL_DECODER)
|
||||
-
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
{"incognito-reauthentication-for-android",
|
||||
flag_descriptions::kIncognitoReauthenticationForAndroidName,
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE default-apps SYSTEM "gnome-da-list.dtd">
|
||||
<default-apps>
|
||||
<web-browsers>
|
||||
<web-browser>
|
||||
<name>Thorium</name>
|
||||
<executable>thorium-browser</executable>
|
||||
<command>thorium-browser %s</command>
|
||||
<icon-name>thorium-browser</icon-name>
|
||||
<run-in-terminal>false</run-in-terminal>
|
||||
</web-browser>
|
||||
</web-browsers>
|
||||
</default-apps>
|
||||
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Allow the user to override command-line flags, bug #357629.
|
||||
# This is based on Debian's chromium-browser package, and is intended
|
||||
# to be consistent with Debian.
|
||||
for f in /etc/thorium/*; do
|
||||
[[ -f ${f} ]] && source "${f}"
|
||||
done
|
||||
|
||||
# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system
|
||||
# default CHROMIUM_FLAGS (from /etc/thorium/default).
|
||||
CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
|
||||
|
||||
# Let the wrapped binary know that it has been run through the wrapper
|
||||
export CHROME_WRAPPER=$(readlink -f "$0")
|
||||
|
||||
PROGDIR=${CHROME_WRAPPER%/*}
|
||||
|
||||
case ":$PATH:" in
|
||||
*:$PROGDIR:*)
|
||||
# $PATH already contains $PROGDIR
|
||||
;;
|
||||
*)
|
||||
# Append $PROGDIR to $PATH
|
||||
export PATH="$PATH:$PROGDIR"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ ${EUID} == 0 && -O ${XDG_CONFIG_HOME:-${HOME}} ]]; then
|
||||
# Running as root with HOME owned by root.
|
||||
# Pass --user-data-dir to work around upstream failsafe.
|
||||
CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/thorium
|
||||
${CHROMIUM_FLAGS}"
|
||||
fi
|
||||
|
||||
# Select session type and platform
|
||||
if @@OZONE_AUTO_SESSION@@; then
|
||||
platform=
|
||||
if [[ ${XDG_SESSION_TYPE} == x11 ]]; then
|
||||
platform=x11
|
||||
elif [[ ${XDG_SESSION_TYPE} == wayland ]]; then
|
||||
platform=wayland
|
||||
else
|
||||
if [[ -n ${WAYLAND_DISPLAY} ]]; then
|
||||
platform=wayland
|
||||
else
|
||||
platform=x11
|
||||
fi
|
||||
fi
|
||||
if ${DISABLE_OZONE_PLATFORM:-false}; then
|
||||
platform=x11
|
||||
fi
|
||||
CHROMIUM_FLAGS="--ozone-platform=${platform} ${CHROMIUM_FLAGS}"
|
||||
fi
|
||||
|
||||
# Set the .desktop file name
|
||||
export CHROME_DESKTOP="thorium-browser-thorium.desktop"
|
||||
|
||||
exec -a "thorium-browser" "$PROGDIR/thorium" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@"
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Allow the user to override command-line flags, bug #357629.
|
||||
# This is based on Debian's chromium-browser package, and is intended
|
||||
# to be consistent with Debian.
|
||||
for f in /etc/thorium-shell/*; do
|
||||
[[ -f ${f} ]] && source "${f}"
|
||||
done
|
||||
|
||||
# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system
|
||||
# default CHROMIUM_FLAGS (from /etc/thorium-shell/default).
|
||||
CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
|
||||
|
||||
# Let the wrapped binary know that it has been run through the wrapper
|
||||
export CHROME_WRAPPER=$(readlink -f "$0")
|
||||
|
||||
PROGDIR=${CHROME_WRAPPER%/*}
|
||||
|
||||
case ":$PATH:" in
|
||||
*:$PROGDIR:*)
|
||||
# $PATH already contains $PROGDIR
|
||||
;;
|
||||
*)
|
||||
# Append $PROGDIR to $PATH
|
||||
export PATH="$PATH:$PROGDIR"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ ${EUID} == 0 && -O ${XDG_CONFIG_HOME:-${HOME}} ]]; then
|
||||
# Running as root with HOME owned by root.
|
||||
# Pass --user-data-dir to work around upstream failsafe.
|
||||
CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/thorium-shell
|
||||
${CHROMIUM_FLAGS}"
|
||||
fi
|
||||
|
||||
CHROMIUM_FLAGS="--enable-experimental-web-platform-features --debug --enable-clear-hevc-for-testing
|
||||
${CHROMIUM_FLAGS}"
|
||||
|
||||
# Set the .desktop file name
|
||||
export CHROME_DESKTOP="thorium-shell.desktop"
|
||||
|
||||
exec -a "thorium-shell" "$PROGDIR/thorium_shell" ${CHROMIUM_FLAGS} "$@"
|
||||
@@ -0,0 +1,7 @@
|
||||
# Default settings for thorium_shell. This file is sourced by /bin/bash
|
||||
# from the thorium_shell launcher.
|
||||
|
||||
# Options to pass to thorium_shell.
|
||||
# See https://github.com/Alex313031/thorium/blob/main/docs/PATCHES.md for additional
|
||||
# command-line switches.
|
||||
#CHROMIUM_FLAGS=""
|
||||
@@ -0,0 +1,15 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=Thorium Shell
|
||||
GenericName=Blink Core
|
||||
Comment=Run Thorium Tests in content_shell
|
||||
Exec=/usr/bin/thorium-shell %U
|
||||
Terminal=false
|
||||
X-MultipleArgs=True
|
||||
Keywords=shell
|
||||
Type=Application
|
||||
Icon=thorium-shell
|
||||
Categories=Network;WebBrowser;
|
||||
MimeType=text/html;text/xml;application/xhtml_xml;application/x-mimearchive;x-scheme-handler/http;x-scheme-handler/https;
|
||||
StartupWMClass=thorium_shell
|
||||
StartupNotify=true
|
||||
@@ -0,0 +1,7 @@
|
||||
# Default settings for thorium. This file is sourced by /bin/bash
|
||||
# from the chromium launcher.
|
||||
|
||||
# Options to pass to thorium.
|
||||
# See https://github.com/Alex313031/thorium/blob/main/docs/PATCHES.md for additional
|
||||
# command-line switches.
|
||||
#CHROMIUM_FLAGS=""
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn
|
||||
index 16e20744706..6a079b32221 100644
|
||||
--- a/build/linux/unbundle/ffmpeg.gn
|
||||
+++ b/build/linux/unbundle/ffmpeg.gn
|
||||
@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") {
|
||||
"libavformat",
|
||||
"libavutil",
|
||||
]
|
||||
+ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ]
|
||||
}
|
||||
|
||||
buildflag_header("ffmpeg_features") {
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Taken from
|
||||
# https://github.com/qvint/ungoogled-chromium-fedora/commit/a68fdd679566da5134d916776f14e00c8e6a8042
|
||||
|
||||
self="$(readlink -f "${0}")"
|
||||
self_dir="$(dirname "${self}")"
|
||||
dict_utility="${self_dir}/convert_dict"
|
||||
|
||||
# Defaults.
|
||||
hunspell_dicts_dir="/usr/share/myspell"
|
||||
user_data_dir="${HOME}/.config/thorium"
|
||||
|
||||
# Parse command-line arguments.
|
||||
while [[ $# -gt 0 ]]; do
|
||||
arg_name="${1}"
|
||||
|
||||
case "${arg_name}" in
|
||||
"--hunspell-dicts-dir")
|
||||
hunspell_dicts_dir="${2}"
|
||||
shift; shift
|
||||
;;
|
||||
"--user-data-dir")
|
||||
user_data_dir="${2}"
|
||||
shift; shift
|
||||
;;
|
||||
*)
|
||||
echo -n "Usage: ungoogled-chromium-update-dicts "
|
||||
echo "[--hunspell-dicts-dir DIR] [--user-data-dir DIR]"
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
# List all chromium language entries.
|
||||
chromium_language_entries="$("${dict_utility}" list)"
|
||||
|
||||
# Iterate through chromium language entries and make *.bdic files.
|
||||
chromium_dicts_dir="${user_data_dir}/Dictionaries"
|
||||
mkdir -p "${chromium_dicts_dir}"
|
||||
while read -r chromium_language_entry; do
|
||||
while read \
|
||||
chromium_language \
|
||||
chromium_language_region \
|
||||
chromium_bdic_basename; do
|
||||
|
||||
hunspell_language_region="${chromium_language_region//-/_}"
|
||||
aff_path="${hunspell_dicts_dir}/${hunspell_language_region}.aff"
|
||||
dic_path="${hunspell_dicts_dir}/${hunspell_language_region}.dic"
|
||||
bdic_path="${chromium_dicts_dir}/${chromium_bdic_basename}"
|
||||
|
||||
if \
|
||||
[[ -f "${aff_path}" ]] && \
|
||||
[[ -f "${dic_path}" ]] && \
|
||||
[[ ! -f "${bdic_path}" ]]; then
|
||||
"${dict_utility}" convert "${aff_path}" "${dic_path}" "${bdic_path}"
|
||||
fi
|
||||
done <<< "${chromium_language_entry}"
|
||||
done <<< "${chromium_language_entries}"
|
||||
Reference in New Issue
Block a user