Update to Chromium version 134.0.6998.0 (#1415337)

This commit is contained in:
Marshall Greenblatt
2025-02-12 12:35:33 -05:00
parent c8be96d15c
commit c7c6a109c9
88 changed files with 736 additions and 793 deletions

View File

@ -1,24 +1,24 @@
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
index f8530b82f9fe4..ea235f7747807 100644
index 078a4b1a1e350..65ac56b910d9d 100644
--- chrome/app/chrome_main_delegate.cc
+++ chrome/app/chrome_main_delegate.cc
@@ -42,6 +42,7 @@
#include "base/timer/timer.h"
#include "base/trace_event/trace_event_impl.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/buildflags.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_resource_bundle_helper.h"
@@ -571,6 +572,7 @@ struct MainFunction {
@@ -544,6 +545,7 @@ struct MainFunction {
int (*function)(content::MainFunctionParams);
};
+#if !BUILDFLAG(ENABLE_CEF)
// Initializes the user data dir. Must be called before InitializeLocalState().
void InitializeUserDataDir(base::CommandLine* command_line) {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
@@ -654,6 +656,7 @@ void InitializeUserDataDir(base::CommandLine* command_line) {
#if BUILDFLAG(IS_WIN)
@@ -621,6 +623,7 @@ void InitializeUserDataDir(base::CommandLine* command_line) {
command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
#endif // BUILDFLAG(IS_WIN)
}
@ -26,7 +26,7 @@ index f8530b82f9fe4..ea235f7747807 100644
#if !BUILDFLAG(IS_ANDROID)
void InitLogging(const std::string& process_type) {
@@ -789,6 +792,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
@@ -740,6 +743,10 @@ ChromeMainDelegate::~ChromeMainDelegate() {
ChromeMainDelegate::~ChromeMainDelegate() = default;
#endif // !BUILDFLAG(IS_ANDROID)
@ -37,7 +37,7 @@ index f8530b82f9fe4..ea235f7747807 100644
std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
InvokedIn invoked_in) {
DUMP_WILL_BE_CHECK(base::ThreadPoolInstance::Get());
@@ -814,7 +821,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -765,7 +772,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
// future session's metrics.
DeferBrowserMetrics(user_data_dir);
@ -46,7 +46,7 @@ index f8530b82f9fe4..ea235f7747807 100644
// In the case the process is not the singleton process, the uninstall tasks
// need to be executed here. A window will be displayed asking to close all
// running instances.
@@ -966,7 +973,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -850,7 +857,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
// Initializes the resource bundle and determines the locale.
std::string actual_locale = LoadLocalState(
@ -56,7 +56,7 @@ index f8530b82f9fe4..ea235f7747807 100644
chrome_feature_list_creator->SetApplicationLocale(actual_locale);
chrome_feature_list_creator->OverrideCachedUIStrings();
@@ -983,6 +991,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -865,6 +873,8 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
new net::NetworkChangeNotifierFactoryAndroid());
#endif
@ -65,7 +65,7 @@ index f8530b82f9fe4..ea235f7747807 100644
if (base::FeatureList::IsEnabled(
features::kWriteBasicSystemProfileToPersistentHistogramsFile)) {
bool record = true;
@@ -993,6 +1003,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
@@ -875,6 +885,7 @@ std::optional<int> ChromeMainDelegate::PostEarlyInitialization(
if (record)
chrome_content_browser_client_->startup_data()->RecordCoreSystemProfile();
}
@ -73,7 +73,7 @@ index f8530b82f9fe4..ea235f7747807 100644
#if BUILDFLAG(IS_ANDROID)
UmaSessionStats::OnStartup();
@@ -1036,8 +1047,8 @@ void ChromeMainDelegate::CreateThreadPool(std::string_view name) {
@@ -921,8 +932,8 @@ void ChromeMainDelegate::CreateThreadPool(std::string_view name) {
std::make_unique<ChromeThreadProfilerClient>());
// `ChromeMainDelegateAndroid::PreSandboxStartup` creates the profiler a little
@ -84,7 +84,7 @@ index f8530b82f9fe4..ea235f7747807 100644
// Start the sampling profiler as early as possible - namely, once the thread
// pool has been created.
sampling_profiler_ = std::make_unique<MainThreadStackSamplingProfiler>();
@@ -1435,6 +1446,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1312,6 +1323,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
@ -92,7 +92,7 @@ index f8530b82f9fe4..ea235f7747807 100644
crash_reporter::InitializeCrashKeys();
#if BUILDFLAG(IS_POSIX)
@@ -1450,6 +1462,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1327,6 +1339,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
if (chrome::ProcessNeedsProfileDir(process_type)) {
InitializeUserDataDir(base::CommandLine::ForCurrentProcess());
}
@ -100,7 +100,7 @@ index f8530b82f9fe4..ea235f7747807 100644
// Register component_updater PathProvider after DIR_USER_DATA overridden by
// command line flags. Maybe move the chrome PathProvider down here also?
@@ -1553,7 +1566,8 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1423,7 +1436,8 @@ void ChromeMainDelegate::PreSandboxStartup() {
#else
const std::string loaded_locale =
ui::ResourceBundle::InitSharedInstanceWithLocale(
@ -110,7 +110,7 @@ index f8530b82f9fe4..ea235f7747807 100644
base::FilePath resources_pack_path;
base::PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
@@ -1563,6 +1577,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1433,6 +1447,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
}
@ -118,7 +118,7 @@ index f8530b82f9fe4..ea235f7747807 100644
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
// Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != switches::kZygoteProcess &&
@@ -1599,6 +1614,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1469,6 +1484,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
// After all the platform Breakpads have been initialized, store the command
// line for crash reporting.
crash_keys::SetCrashKeysFromCommandLine(command_line);
@ -126,7 +126,7 @@ index f8530b82f9fe4..ea235f7747807 100644
#if BUILDFLAG(ENABLE_PDF)
MaybePatchGdiGetFontData();
@@ -1717,6 +1733,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1587,6 +1603,7 @@ void ChromeMainDelegate::ZygoteForked() {
SetUpProfilingShutdownHandler();
}
@ -134,7 +134,7 @@ index f8530b82f9fe4..ea235f7747807 100644
// Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
// this up for the browser process in a different manner.
const base::CommandLine* command_line =
@@ -1729,6 +1746,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1599,6 +1616,7 @@ void ChromeMainDelegate::ZygoteForked() {
// Reset the command line for the newly spawned process.
crash_keys::SetCrashKeysFromCommandLine(*command_line);
@ -142,7 +142,7 @@ index f8530b82f9fe4..ea235f7747807 100644
}
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
@@ -1839,6 +1857,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
@@ -1709,6 +1727,7 @@ void ChromeMainDelegate::InitializeMemorySystem() {
: memory_system::DispatcherParameters::
AllocationTraceRecorderInclusion::kIgnore;
@ -150,7 +150,7 @@ index f8530b82f9fe4..ea235f7747807 100644
memory_system::Initializer()
.SetGwpAsanParameters(gwp_asan_boost_sampling, process_type)
.SetProfilingClientParameters(chrome::GetChannel(),
@@ -1846,5 +1865,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
@@ -1716,5 +1735,5 @@ void ChromeMainDelegate::InitializeMemorySystem() {
.SetDispatcherParameters(memory_system::DispatcherParameters::
PoissonAllocationSamplerInclusion::kEnforce,
allocation_recorder_inclusion, process_type)
@ -158,10 +158,10 @@ index f8530b82f9fe4..ea235f7747807 100644
+ .Initialize(*memory_system_);
}
diff --git chrome/app/chrome_main_delegate.h chrome/app/chrome_main_delegate.h
index 521d5710b6387..8a5f3e6a312d2 100644
index 4c70555277148..63300fe191e5e 100644
--- chrome/app/chrome_main_delegate.h
+++ chrome/app/chrome_main_delegate.h
@@ -17,6 +17,7 @@
@@ -16,6 +16,7 @@
#include "chrome/common/chrome_content_client.h"
#include "components/memory_system/memory_system.h"
#include "content/public/app/content_main_delegate.h"
@ -169,7 +169,7 @@ index 521d5710b6387..8a5f3e6a312d2 100644
namespace base {
class CommandLine;
@@ -55,6 +56,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
@@ -50,6 +51,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
~ChromeMainDelegate() override;
@ -178,7 +178,7 @@ index 521d5710b6387..8a5f3e6a312d2 100644
protected:
// content::ContentMainDelegate:
std::optional<int> BasicStartupComplete() override;
@@ -99,13 +102,17 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
@@ -94,13 +97,17 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
void InitializeMemorySystem();
@ -195,8 +195,8 @@ index 521d5710b6387..8a5f3e6a312d2 100644
- memory_system::MemorySystem memory_system_;
+ std::unique_ptr<memory_system::MemorySystem> memory_system_;
#if BUILDFLAG(IS_CHROMEOS_LACROS)
std::unique_ptr<chromeos::LacrosService> lacros_service_;
#if !BUILDFLAG(IS_ANDROID)
// The sampling profiler exists until the `ChromeContentBrowserClient` is
diff --git chrome/app_shim/BUILD.gn chrome/app_shim/BUILD.gn
index db17714f74137..7119e5dba649a 100644
--- chrome/app_shim/BUILD.gn
@ -232,7 +232,7 @@ index 8f5c477acba39..ff2f90a8bf27b 100644
base::PathService::OverrideAndCreateIfNeeded(
diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc
index a6ecd483d6428..251faf73f46dd 100644
index af2f0398d633e..598d57e22fdd4 100644
--- chrome/browser/chrome_browser_main.cc
+++ chrome/browser/chrome_browser_main.cc
@@ -52,6 +52,7 @@
@ -465,7 +465,7 @@ index e26e3625c99c8..c0d4a95607e37 100644
+#endif
}
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index a1a8e77a2ef3f..cdbae8a69a450 100644
index 678e42c96fe4a..3e61f6e714e5c 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -47,6 +47,7 @@
@ -476,7 +476,7 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
#include "chrome/browser/after_startup_task_utils.h"
#include "chrome/browser/ai/ai_manager.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
@@ -1493,6 +1494,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
@@ -1483,6 +1484,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() {
}
ChromeContentBrowserClient::ChromeContentBrowserClient() {
@ -485,7 +485,7 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
#if BUILDFLAG(ENABLE_PLUGINS)
extra_parts_.push_back(
std::make_unique<ChromeContentBrowserClientPluginsPart>());
@@ -1530,6 +1533,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
@@ -1520,6 +1523,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() {
}
}
@ -497,55 +497,7 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
// static
void ChromeContentBrowserClient::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) {
@@ -3940,30 +3948,25 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
web_prefs->preferred_color_scheme;
}
#else
- // Update based on native theme scheme.
- web_prefs->preferred_color_scheme =
- ToBlinkPreferredColorScheme(native_theme->GetPreferredColorScheme());
-
- bool using_different_colored_frame = false;
- if (Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext())) {
- if (ThemeService* theme_service =
- ThemeServiceFactory::GetForProfile(profile)) {
- using_different_colored_frame =
- !theme_service->UsingDefaultTheme() ||
- theme_service->GetUserColor().has_value() ||
- theme_service->UsingDeviceTheme();
- }
+ auto preferred_color_scheme = native_theme->GetPreferredColorScheme();
+
+ auto* profile = Profile::FromBrowserContext(
+ web_contents->GetBrowserContext());
+ const auto* theme_service = ThemeServiceFactory::GetForProfile(profile);
+
+ const auto browser_color_scheme = theme_service->GetBrowserColorScheme();
+ if (browser_color_scheme != ThemeService::BrowserColorScheme::kSystem) {
+ // Override the native theme.
+ preferred_color_scheme =
+ browser_color_scheme == ThemeService::BrowserColorScheme::kLight
+ ? ui::NativeTheme::PreferredColorScheme::kLight
+ : ui::NativeTheme::PreferredColorScheme::kDark;
}
- // Update based on the ColorProvider associated with `web_contents`. Depends
- // on the browser color mode settings and whether the user profile has set a
- // custom coloring for the browser ui.
- web_prefs->preferred_root_scrollbar_color_scheme =
- web_contents->GetColorMode() == ui::ColorProviderKey::ColorMode::kLight ||
- using_different_colored_frame
- ? blink::mojom::PreferredColorScheme::kLight
- : blink::mojom::PreferredColorScheme::kDark;
+ // Update based on native theme scheme.
+ web_prefs->preferred_color_scheme =
+ web_prefs->preferred_root_scrollbar_color_scheme =
+ ToBlinkPreferredColorScheme(preferred_color_scheme);
#endif // BUILDFLAG(IS_ANDROID)
// Reauth WebUI doesn't support dark mode yet because it shares the dialog
@@ -4717,9 +4720,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
@@ -4722,9 +4730,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite);
#endif // BUILDFLAG(IS_ANDROID)
@ -557,7 +509,7 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
}
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
@@ -6783,7 +6788,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
@@ -6799,7 +6809,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated(
}
}
@ -566,7 +518,7 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -6801,6 +6806,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
@@ -6817,6 +6827,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams(
network_context_params->user_agent = GetUserAgentBasedOnPolicy(context);
network_context_params->accept_language = GetApplicationLocale();
}
@ -575,7 +527,7 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
}
std::vector<base::FilePath>
@@ -7911,11 +7918,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
@@ -7925,11 +7937,11 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted(
const auto now = base::TimeTicks::Now();
const auto timeout = GetKeepaliveTimerTimeout(context);
keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout);
@ -589,7 +541,7 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
FROM_HERE, keepalive_deadline_ - now,
base::BindOnce(
&ChromeContentBrowserClient::OnKeepaliveTimerFired,
@@ -7937,7 +7944,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
@@ -7951,7 +7963,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
--num_keepalive_requests_;
if (num_keepalive_requests_ == 0) {
DVLOG(1) << "Stopping the keepalive timer";
@ -599,7 +551,7 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
// This deletes the keep alive handle attached to the timer function and
// unblock the shutdown sequence.
}
@@ -8112,7 +8120,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
@@ -8129,7 +8142,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired(
const auto now = base::TimeTicks::Now();
const auto then = keepalive_deadline_;
if (now < then) {
@ -609,10 +561,10 @@ index a1a8e77a2ef3f..cdbae8a69a450 100644
base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired,
weak_factory_.GetWeakPtr(),
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index 7e866a09fc060..0b7403c116151 100644
index 388954e9b504a..7fd8d7b36fa04 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -155,6 +155,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -157,6 +157,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
~ChromeContentBrowserClient() override;
@ -621,7 +573,7 @@ index 7e866a09fc060..0b7403c116151 100644
// TODO(crbug.com/41356866): This file is about calls from content/ out
// to chrome/ to get values or notify about events, but both of these
// functions are from chrome/ to chrome/ and don't involve content/ at all.
@@ -721,7 +723,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -726,7 +728,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
override;
void OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) override;
@ -630,7 +582,7 @@ index 7e866a09fc060..0b7403c116151 100644
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
@@ -1319,7 +1321,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
@@ -1339,7 +1341,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
#if !BUILDFLAG(IS_ANDROID)
uint64_t num_keepalive_requests_ = 0;
@ -640,7 +592,7 @@ index 7e866a09fc060..0b7403c116151 100644
#endif
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
index 48d8f868628b1..c0e765902a76e 100644
index dc8800d422a2c..675410378cc6f 100644
--- chrome/browser/prefs/browser_prefs.cc
+++ chrome/browser/prefs/browser_prefs.cc
@@ -16,6 +16,7 @@
@ -651,7 +603,7 @@ index 48d8f868628b1..c0e765902a76e 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/invert_bubble_prefs.h"
@@ -209,6 +210,10 @@
@@ -213,6 +214,10 @@
#include "extensions/browser/pref_names.h"
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
@ -662,17 +614,7 @@ index 48d8f868628b1..c0e765902a76e 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/accessibility/animation_policy_prefs.h"
#include "chrome/browser/apps/platform_apps/shortcut_manager.h"
@@ -1949,7 +1954,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif // BUILDFLAG(IS_WIN)
-#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
+#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) && \
+ BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING)
downgrade::RegisterPrefs(registry);
#endif
@@ -2010,6 +2016,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
@@ -1940,6 +1945,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
// This is intentionally last.
RegisterLocalStatePrefsForMigration(registry);
@ -684,7 +626,7 @@ index 48d8f868628b1..c0e765902a76e 100644
}
// Register prefs applicable to all profiles.
@@ -2458,6 +2469,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
@@ -2390,6 +2400,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
const std::string& locale) {
RegisterProfilePrefs(registry, locale);