M123 stage 7

This commit is contained in:
Alexander Frick 2024-04-17 04:19:12 -05:00
parent 567533a7e4
commit e3653497d1
10 changed files with 102 additions and 86 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2024 The Chromium Authors and Alex313031
// Copyright 2024 The Chromium Authors, Alex313031, and midzer
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@ -335,8 +335,12 @@ bool IsDefaultSupportedVideoType(const VideoType& type) {
case VideoCodec::kTheora:
return IsBuiltInVideoCodec(type.codec);
case VideoCodec::kH264:
case VideoCodec::kVP8:
return true;
case VideoCodec::kVP8:
return IsBuiltInVideoCodec(type.codec)
? true
: GetSupplementalProfileCache()->IsProfileSupported(
type.profile);
case VideoCodec::kAV1:
return IsAV1Supported(type);
case VideoCodec::kVP9:
@ -400,8 +404,10 @@ bool IsBuiltInVideoCodec(VideoCodec codec) {
#if BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
if (codec == VideoCodec::kTheora)
return base::FeatureList::IsEnabled(kTheoraVideoCodec);
if (codec == VideoCodec::kVP8)
if (codec == VideoCodec::kVP8 &&
base::FeatureList::IsEnabled(kFFmpegDecodeOpaqueVP8)) {
return true;
}
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
if (codec == VideoCodec::kH264 || codec == VideoCodec::kHEVC)
return true;

View file

@ -843,12 +843,18 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
return CHANNEL_LAYOUT_MONO;
case AV_CH_LAYOUT_STEREO:
return CHANNEL_LAYOUT_STEREO;
case AV_CH_LAYOUT_2POINT1:
return CHANNEL_LAYOUT_2POINT1;
case AV_CH_LAYOUT_2_1:
return CHANNEL_LAYOUT_2_1;
case AV_CH_LAYOUT_SURROUND:
return CHANNEL_LAYOUT_SURROUND;
case AV_CH_LAYOUT_3POINT1:
return CHANNEL_LAYOUT_3_1;
case AV_CH_LAYOUT_4POINT0:
return CHANNEL_LAYOUT_4_0;
case AV_CH_LAYOUT_4POINT1:
return CHANNEL_LAYOUT_4_1;
case AV_CH_LAYOUT_2_2:
return CHANNEL_LAYOUT_2_2;
case AV_CH_LAYOUT_QUAD:
@ -861,20 +867,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
return CHANNEL_LAYOUT_5_0_BACK;
case AV_CH_LAYOUT_5POINT1_BACK:
return CHANNEL_LAYOUT_5_1_BACK;
case AV_CH_LAYOUT_7POINT0:
return CHANNEL_LAYOUT_7_0;
case AV_CH_LAYOUT_7POINT1:
return CHANNEL_LAYOUT_7_1;
case AV_CH_LAYOUT_7POINT1_WIDE:
return CHANNEL_LAYOUT_7_1_WIDE;
case AV_CH_LAYOUT_STEREO_DOWNMIX:
return CHANNEL_LAYOUT_STEREO_DOWNMIX;
case AV_CH_LAYOUT_2POINT1:
return CHANNEL_LAYOUT_2POINT1;
case AV_CH_LAYOUT_3POINT1:
return CHANNEL_LAYOUT_3_1;
case AV_CH_LAYOUT_4POINT1:
return CHANNEL_LAYOUT_4_1;
case AV_CH_LAYOUT_6POINT0:
return CHANNEL_LAYOUT_6_0;
case AV_CH_LAYOUT_6POINT0_FRONT:
@ -887,14 +879,22 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
return CHANNEL_LAYOUT_6_1_BACK;
case AV_CH_LAYOUT_6POINT1_FRONT:
return CHANNEL_LAYOUT_6_1_FRONT;
case AV_CH_LAYOUT_7POINT0:
return CHANNEL_LAYOUT_7_0;
case AV_CH_LAYOUT_7POINT0_FRONT:
return CHANNEL_LAYOUT_7_0_FRONT;
case AV_CH_LAYOUT_7POINT1:
return CHANNEL_LAYOUT_7_1;
case AV_CH_LAYOUT_7POINT1_WIDE:
return CHANNEL_LAYOUT_7_1_WIDE;
#ifdef AV_CH_LAYOUT_7POINT1_WIDE_BACK
case AV_CH_LAYOUT_7POINT1_WIDE_BACK:
return CHANNEL_LAYOUT_7_1_WIDE_BACK;
#endif
case AV_CH_LAYOUT_OCTAGONAL:
return CHANNEL_LAYOUT_OCTAGONAL;
case AV_CH_LAYOUT_STEREO_DOWNMIX:
return CHANNEL_LAYOUT_STEREO_DOWNMIX;
default:
// FFmpeg channel_layout is 0 for .wav and .mp3. Attempt to guess layout
// based on the channel count.
@ -946,13 +946,14 @@ VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
case AV_PIX_FMT_YUV444P12LE:
return PIXEL_FORMAT_YUV444P12;
case AV_PIX_FMT_P016LE:
return PIXEL_FORMAT_P016LE;
// When compiled without decoders, FFmpeg won't know the pixel format.
case AV_PIX_FMT_NONE:
return PIXEL_FORMAT_UNKNOWN;
default:
DVLOG(1) << "Unsupported AVPixelFormat: " << pixel_format;
NOTREACHED() << "Unsupported pixel format: " << pixel_format;
return PIXEL_FORMAT_UNKNOWN;
}
return PIXEL_FORMAT_UNKNOWN;
}
std::string AVErrorToString(int errnum) {

View file

@ -295,6 +295,7 @@ if (current_toolchain == default_toolchain) {
"//base/version_info/android:version_constants_java",
"//cc:cc_java",
"//cc/mojom:mojom_java",
"//chrome/android/features/jank_tracker:jank_tracker_java",
"//chrome/android/features/keyboard_accessory:public_java",
"//chrome/android/features/start_surface:java_resources",
"//chrome/android/features/start_surface:public_java",
@ -335,6 +336,7 @@ if (current_toolchain == default_toolchain) {
"//chrome/browser/commerce/price_tracking/proto:proto_java",
"//chrome/browser/commerce/subscriptions/android:subscriptions_java",
"//chrome/browser/consent_auditor/android:java",
"//chrome/browser/content_extraction/android:java",
"//chrome/browser/contextmenu:java",
"//chrome/browser/creator/android:java",
"//chrome/browser/data_sharing:factory_java",
@ -357,7 +359,6 @@ if (current_toolchain == default_toolchain) {
"//chrome/browser/gsa:java",
"//chrome/browser/history:java",
"//chrome/browser/history_clusters:java",
"//chrome/browser/history_clusters:java_resources",
"//chrome/browser/hub:factory_java",
"//chrome/browser/hub:java",
"//chrome/browser/image_descriptions:java",
@ -578,6 +579,7 @@ if (current_toolchain == default_toolchain) {
"//components/sync/android:sync_java",
"//components/sync/protocol:protocol_java",
"//components/sync_device_info:sync_device_info_java",
"//components/tab_groups:tab_groups_java",
"//components/thin_webview:factory_java",
"//components/thin_webview:java",
"//components/translate/content/android:java",
@ -680,7 +682,7 @@ if (current_toolchain == default_toolchain) {
"//components/dom_distiller/core:distiller_type_java",
"//components/ntp_tiles:ntp_tiles_enums_java",
"//components/offline_pages/core:offline_page_model_enums_java",
"//components/supervised_user/core/common:supervised_user_utils_enum_javagen",
"//components/supervised_user/core/browser:supervised_user_utils_enum_javagen",
"//net:effective_connection_type_java",
]
@ -707,8 +709,11 @@ if (current_toolchain == default_toolchain) {
jar_excluded_patterns = [ "*/AppHooksImpl.class" ]
annotation_processor_deps = [
"//components/module_installer/android:module_interface_processor",
# Dagger must come first so that when enable_chrome_android_internal=true,
# the bundled version of Guava is not shadowed by the one in android_deps.
# https://crbug.com/325425527
"//third_party/android_deps:dagger_processor",
"//components/module_installer/android:module_interface_processor",
]
processor_args_javac = [ "dagger.fastInit=enabled" ]
@ -1194,6 +1199,7 @@ if (current_toolchain == default_toolchain) {
"//components/sync/android:sync_java",
"//components/sync/protocol:protocol_java",
"//components/sync_device_info:sync_device_info_java",
"//components/tab_groups:tab_groups_java",
"//components/translate/content/android:junit",
"//components/ukm/android:java",
"//components/url_formatter/android:url_formatter_java",
@ -3514,7 +3520,7 @@ generate_jni("chrome_jni_headers") {
"../browser/share/android/java/src/org/chromium/chrome/browser/share/link_to_text/LinkToTextBridge.java",
"../browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/LongScreenshotsTabService.java",
"../browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/LongScreenshotsTabServiceFactory.java",
"../browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QRCodeGenerationRequest.java",
"../browser/share/android/java/src/org/chromium/chrome/browser/share/qrcode/QRCodeGenerator.java",
"../browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/EditorScreenshotTask.java",
"../browser/share/android/java/src/org/chromium/chrome/browser/share/send_tab_to_self/MetricsRecorder.java",
"../browser/share/android/java/src/org/chromium/chrome/browser/share/send_tab_to_self/NotificationManager.java",
@ -3711,6 +3717,7 @@ generate_jni("chrome_jni_headers") {
"java/src/org/chromium/chrome/browser/webapps/WebApkInstallService.java",
"java/src/org/chromium/chrome/browser/webapps/WebApkInstaller.java",
"java/src/org/chromium/chrome/browser/webapps/WebApkPostShareTargetNavigator.java",
"java/src/org/chromium/chrome/browser/webapps/WebApkSyncService.java",
"java/src/org/chromium/chrome/browser/webapps/WebApkUpdateDataFetcher.java",
"java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java",
"java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java",

View file

@ -14,7 +14,6 @@ import("//chrome/android/trichrome.gni")
import("//chrome/common/features.gni")
import("//chrome/version.gni")
import("//components/crash/android/silent_java_assert_reporting.gni")
import("//components/optimization_guide/features.gni")
import("//device/vr/buildflags/buildflags.gni")
import("channel.gni")
@ -499,6 +498,8 @@ template("chrome_common_apk_or_module_tmpl") {
# androidx middleware.
# See //third_party/android_sdk/window_extensions/README.md
assert_no_deps = [
"//third_party/android_deps:org_jetbrains_kotlin_kotlin_parcelize_runtime",
"//third_party/android_deps:org_jetbrains_kotlinx_atomicfu_jvm_java",
"//third_party/androidx:androidx_window_extensions_core_core_java",
"//third_party/androidx:androidx_window_sidecar_sidecar_java",
"//third_party/androidx:androidx_window_window_java_java",
@ -682,19 +683,6 @@ template("chrome_common_apk_or_module_tmpl") {
}
}
if (build_with_internal_optimization_guide) {
if (android_64bit_target_cpu && !_is_64_bit_browser) {
_secondary_optimization_guide = "//components/optimization_guide/internal:optimization_guide_internal($android_secondary_abi_toolchain)"
deps += [ _secondary_optimization_guide ]
secondary_abi_loadable_modules +=
[ "$_secondary_out_dir/liboptimization_guide_internal.so" ]
} else {
deps += [ "//components/optimization_guide/internal:optimization_guide_internal" ]
loadable_modules +=
[ "$root_out_dir/liboptimization_guide_internal.so" ]
}
}
if (_is_trichrome) {
if (android_64bit_target_cpu && !_is_64_bit_browser) {
static_library_provider_use_secondary_abi = true
@ -711,15 +699,6 @@ template("chrome_common_apk_or_module_tmpl") {
if (_include_secondary_abi && secondary_abi_loadable_modules == []) {
secondary_native_lib_placeholders = [ "libplaceholder.so" ]
}
# http://crbug.com/1042107.
if (is_component_build) {
if (_is_64_bit_browser) {
main_component_library = "libmonochrome_64.cr.so"
} else {
main_component_library = "libmonochrome.cr.so"
}
}
}
if (_is_test) {

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2023 The Chromium Authors and Alex313031. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<!--
Copyright 2024 The Chromium Authors and Alex313031
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="90dp"

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2023 The Chromium Authors and Alex313031. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<!--
Copyright 2024 The Chromium Authors and Alex313031
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The application name displayed to the user. -->
@ -9,5 +11,4 @@
<string name="bookmark_widget_title" translatable="false">Thorium Bookmarks</string>
<string name="search_widget_title" translatable="false">Thorium Search</string>
<string name="quick_action_search_widget_title" translatable="false">Thorium Quick Action Search</string>
<string name="dino_widget_title" translatable="false">Thorium Dino</string>
</resources>

View file

@ -39,6 +39,7 @@
#include "components/variations/proto/variations_seed.pb.h"
#include "components/variations/seed_response.h"
#include "components/variations/service/limited_entropy_synthetic_trial.h"
#include "components/variations/synthetic_trial_registry.h"
#include "components/variations/variations_safe_seed_store_local_state.h"
#include "components/variations/variations_seed_simulator.h"
#include "components/variations/variations_switches.h"
@ -327,9 +328,11 @@ VariationsService::VariationsService(
std::unique_ptr<web_resource::ResourceRequestAllowedNotifier> notifier,
PrefService* local_state,
metrics::MetricsStateManager* state_manager,
const UIStringOverrider& ui_string_overrider)
const UIStringOverrider& ui_string_overrider,
SyntheticTrialRegistry* synthetic_trial_registry)
: client_(std::move(client)),
local_state_(local_state),
synthetic_trial_registry_(synthetic_trial_registry),
state_manager_(state_manager),
limited_entropy_synthetic_trial_(local_state),
policy_pref_service_(local_state),
@ -562,14 +565,16 @@ std::unique_ptr<VariationsService> VariationsService::Create(
const char* disable_network_switch,
const UIStringOverrider& ui_string_overrider,
web_resource::ResourceRequestAllowedNotifier::NetworkConnectionTrackerGetter
network_connection_tracker_getter) {
network_connection_tracker_getter,
SyntheticTrialRegistry* synthetic_trial_registry) {
std::unique_ptr<VariationsService> result;
result.reset(new VariationsService(
std::move(client),
std::make_unique<web_resource::ResourceRequestAllowedNotifier>(
local_state, disable_network_switch,
std::move(network_connection_tracker_getter)),
local_state, state_manager, ui_string_overrider));
local_state, state_manager, ui_string_overrider,
synthetic_trial_registry));
return result;
}
@ -634,7 +639,7 @@ bool VariationsService::DoFetchFromURL(const GURL& url, bool is_http_retry) {
if (!EncryptString(serial_number, &serial_number)) {
return false;
}
base::Base64Encode(serial_number, &serial_number);
serial_number = base::Base64Encode(serial_number);
}
resource_request->headers.SetHeader("If-None-Match", serial_number);
}
@ -903,7 +908,11 @@ void VariationsService::PerformSimulationWithVersion(
if (!version.IsValid())
return;
auto entropy_providers = state_manager_->CreateEntropyProviders();
auto entropy_providers = state_manager_->CreateEntropyProviders(
VariationsFieldTrialCreatorBase::
IsLimitedEntropyRandomizationSourceEnabled(
client()->GetChannelForVariations(),
&limited_entropy_synthetic_trial_));
std::unique_ptr<ClientFilterableState> client_state =
field_trial_creator_.GetClientFilterableStateForVersion(version);
@ -943,8 +952,9 @@ bool VariationsService::SetUpFieldTrials(
return field_trial_creator_.SetUpFieldTrials(
variation_ids, command_line_variation_ids, extra_overrides,
std::move(feature_list), state_manager_, platform_field_trials,
&safe_seed_manager_, /*add_entropy_source_to_variations_ids=*/true);
std::move(feature_list), state_manager_, synthetic_trial_registry_,
platform_field_trials, &safe_seed_manager_,
/*add_entropy_source_to_variations_ids=*/true);
}
std::vector<StudyGroupNames> VariationsService::GetStudiesAvailableToForce() {
@ -956,8 +966,13 @@ std::vector<StudyGroupNames> VariationsService::GetStudiesAvailableToForce() {
return {};
}
// TODO(crbug.com/1519232): chrome://field-trial-internals will not support
// studies that are constrained to a layer with LIMITED entropy mode before
// limited entropy randomization fully lands.
auto entropy_providers = state_manager_->CreateEntropyProviders(
/*enable_limited_entropy_mode=*/false);
return variations::GetStudiesAvailableToForce(
std::move(seed), *state_manager_->CreateEntropyProviders(),
std::move(seed), *entropy_providers,
*GetClientFilterableStateForVersion());
}

View file

@ -335,7 +335,12 @@ bool IsDefaultSupportedVideoType(const VideoType& type) {
case VideoCodec::kTheora:
return IsBuiltInVideoCodec(type.codec);
case VideoCodec::kH264:
return true;
case VideoCodec::kVP8:
return IsBuiltInVideoCodec(type.codec)
? true
: GetSupplementalProfileCache()->IsProfileSupported(
type.profile);
case VideoCodec::kMPEG2:
return true;
case VideoCodec::kAV1:
@ -400,8 +405,10 @@ bool IsBuiltInVideoCodec(VideoCodec codec) {
#if BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
if (codec == VideoCodec::kTheora)
return base::FeatureList::IsEnabled(kTheoraVideoCodec);
if (codec == VideoCodec::kVP8)
if (codec == VideoCodec::kVP8 &&
base::FeatureList::IsEnabled(kFFmpegDecodeOpaqueVP8)) {
return true;
}
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
if (codec == VideoCodec::kH264 || codec == VideoCodec::kHEVC)
return true;

View file

@ -847,12 +847,18 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
return CHANNEL_LAYOUT_MONO;
case AV_CH_LAYOUT_STEREO:
return CHANNEL_LAYOUT_STEREO;
case AV_CH_LAYOUT_2POINT1:
return CHANNEL_LAYOUT_2POINT1;
case AV_CH_LAYOUT_2_1:
return CHANNEL_LAYOUT_2_1;
case AV_CH_LAYOUT_SURROUND:
return CHANNEL_LAYOUT_SURROUND;
case AV_CH_LAYOUT_3POINT1:
return CHANNEL_LAYOUT_3_1;
case AV_CH_LAYOUT_4POINT0:
return CHANNEL_LAYOUT_4_0;
case AV_CH_LAYOUT_4POINT1:
return CHANNEL_LAYOUT_4_1;
case AV_CH_LAYOUT_2_2:
return CHANNEL_LAYOUT_2_2;
case AV_CH_LAYOUT_QUAD:
@ -865,20 +871,6 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
return CHANNEL_LAYOUT_5_0_BACK;
case AV_CH_LAYOUT_5POINT1_BACK:
return CHANNEL_LAYOUT_5_1_BACK;
case AV_CH_LAYOUT_7POINT0:
return CHANNEL_LAYOUT_7_0;
case AV_CH_LAYOUT_7POINT1:
return CHANNEL_LAYOUT_7_1;
case AV_CH_LAYOUT_7POINT1_WIDE:
return CHANNEL_LAYOUT_7_1_WIDE;
case AV_CH_LAYOUT_STEREO_DOWNMIX:
return CHANNEL_LAYOUT_STEREO_DOWNMIX;
case AV_CH_LAYOUT_2POINT1:
return CHANNEL_LAYOUT_2POINT1;
case AV_CH_LAYOUT_3POINT1:
return CHANNEL_LAYOUT_3_1;
case AV_CH_LAYOUT_4POINT1:
return CHANNEL_LAYOUT_4_1;
case AV_CH_LAYOUT_6POINT0:
return CHANNEL_LAYOUT_6_0;
case AV_CH_LAYOUT_6POINT0_FRONT:
@ -891,14 +883,22 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels) {
return CHANNEL_LAYOUT_6_1_BACK;
case AV_CH_LAYOUT_6POINT1_FRONT:
return CHANNEL_LAYOUT_6_1_FRONT;
case AV_CH_LAYOUT_7POINT0:
return CHANNEL_LAYOUT_7_0;
case AV_CH_LAYOUT_7POINT0_FRONT:
return CHANNEL_LAYOUT_7_0_FRONT;
case AV_CH_LAYOUT_7POINT1:
return CHANNEL_LAYOUT_7_1;
case AV_CH_LAYOUT_7POINT1_WIDE:
return CHANNEL_LAYOUT_7_1_WIDE;
#ifdef AV_CH_LAYOUT_7POINT1_WIDE_BACK
case AV_CH_LAYOUT_7POINT1_WIDE_BACK:
return CHANNEL_LAYOUT_7_1_WIDE_BACK;
#endif
case AV_CH_LAYOUT_OCTAGONAL:
return CHANNEL_LAYOUT_OCTAGONAL;
case AV_CH_LAYOUT_STEREO_DOWNMIX:
return CHANNEL_LAYOUT_STEREO_DOWNMIX;
default:
// FFmpeg channel_layout is 0 for .wav and .mp3. Attempt to guess layout
// based on the channel count.
@ -950,13 +950,14 @@ VideoPixelFormat AVPixelFormatToVideoPixelFormat(AVPixelFormat pixel_format) {
case AV_PIX_FMT_YUV444P12LE:
return PIXEL_FORMAT_YUV444P12;
case AV_PIX_FMT_P016LE:
return PIXEL_FORMAT_P016LE;
// When compiled without decoders, FFmpeg won't know the pixel format.
case AV_PIX_FMT_NONE:
return PIXEL_FORMAT_UNKNOWN;
default:
DVLOG(1) << "Unsupported AVPixelFormat: " << pixel_format;
NOTREACHED() << "Unsupported pixel format: " << pixel_format;
return PIXEL_FORMAT_UNKNOWN;
}
return PIXEL_FORMAT_UNKNOWN;
}
std::string AVErrorToString(int errnum) {

View file

@ -1,7 +1,7 @@
#!special-case-list-v1
# Copyright 2024 The Chromium Authors, RobRich999, and Alex313031
# TODO(https://crbug.com/1515966): update to glob patterns
# Copyright (c) 2024 Alex313031 and RobRich999
# This file defines which warnings should be ignored while running clang's
# control flow integrity sanitizer, as run by the cfi_flags build target.
@ -272,9 +272,6 @@ fun:*InvokeAccessorGetterCallback*
src:*third_party/pthreadpool/src/src/fastpath.c
src:*third_party/pthreadpool/src/src/portable-api.c
# XNNPack casts incorrect function signature.
src:*third_party/xnnpack/src/src/operators/deconvolution-nhwc.c
######### Uncategorized
src:*native_client/*