From 60cd5f2570eac778c796466c85883c5f2e4b8b5a Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Tue, 19 Nov 2024 14:37:14 -0600 Subject: [PATCH] M130 stage 1 --- arm/build/config/compiler/BUILD.gn | 4 +- .../installer/linux/common/installer.include | 2 +- infra/THORIUM_DEV_BOOKMARKS.html | 9 +- src/build/config/android/BUILD.gn | 1 + src/build/config/compiler/BUILD.gn | 5 +- src/build/config/compiler/pgo/BUILD.gn | 1 + .../config/{simd_opt.gni => compiler_opt.gni} | 50 ++- src/build/config/mac/BUILD.gn | 1 + src/build/config/win/BUILD.gn | 2 +- .../default_dns_over_https_config_source.cc | 75 +++++ .../net/profile_network_context_service.cc | 118 +++++-- .../net/stub_resolver_config_reader.cc | 142 +++----- src/chrome/browser/ui/browser_ui_prefs.cc | 5 + .../default_browser_prompt.cc | 2 +- src/chrome/installer/linux/BUILD.gn | 6 +- .../installer/linux/common/installer.include | 2 +- .../installer/linux/debian/additional_deps | 33 ++ src/chrome/installer/linux/debian/build.sh | 12 +- .../installer/linux/debian/control.template | 6 +- .../installer/mini_installer/chrome.release | 3 +- .../mini_installer/mini_installer_exe_main.cc | 9 +- .../privacy_sandbox_settings_impl.cc | 65 +++- .../tracking_protection_prefs.cc | 24 +- .../search_engines/prepopulated_engines.json | 305 +++++++++++++++--- .../search_engine_countries-inc.cc | 5 + src/v8/BUILD.gn | 2 +- 26 files changed, 664 insertions(+), 225 deletions(-) rename src/build/config/{simd_opt.gni => compiler_opt.gni} (63%) create mode 100644 src/chrome/browser/net/default_dns_over_https_config_source.cc create mode 100644 src/chrome/installer/linux/debian/additional_deps diff --git a/arm/build/config/compiler/BUILD.gn b/arm/build/config/compiler/BUILD.gn index e5613484..85d8f8e3 100644 --- a/arm/build/config/compiler/BUILD.gn +++ b/arm/build/config/compiler/BUILD.gn @@ -5,6 +5,7 @@ import("//build/buildflag_header.gni") import("//build/config/android/config.gni") import("//build/config/c++/c++.gni") +import("//build/config/compiler_opt.gni") import("//build/config/chrome_build.gni") import("//build/config/chromeos/args.gni") import("//build/config/chromeos/ui_mode.gni") @@ -67,9 +68,6 @@ declare_args() { # Requires profiling to be set to true. enable_full_stack_frames_for_profiling = false - # Whether to enable LLVM's Polly optimizations. See https://polly.llvm.org/ - use_polly = false - # Whether to use Raspberry Pi specific optimizations. is_raspi = false diff --git a/arm/raspi/chrome/installer/linux/common/installer.include b/arm/raspi/chrome/installer/linux/common/installer.include index e762a37f..617027c4 100644 --- a/arm/raspi/chrome/installer/linux/common/installer.include +++ b/arm/raspi/chrome/installer/linux/common/installer.include @@ -92,7 +92,7 @@ process_template() ( -e "s#@@PRODUCTURL@@#${PRODUCTURL}#g" \ -e "s#@@PREDEPENDS@@#${PREDEPENDS}#g" \ -e "s#@@DEPENDS@@#${DEPENDS}#g" \ - -e "s#@@RECOMMENDS@@#${RECOMMENDS}#g" \ + # -e "s#@@RECOMMENDS@@#${RECOMMENDS}#g" \ -e "s#@@PROVIDES@@#${PROVIDES}#g" \ -e "s#@@ARCHITECTURE@@#${ARCHITECTURE}#g" \ -e "s#@@MAINTNAME@@#${MAINTNAME}#g" \ diff --git a/infra/THORIUM_DEV_BOOKMARKS.html b/infra/THORIUM_DEV_BOOKMARKS.html index 1fcdd17f..ddea06b8 100644 --- a/infra/THORIUM_DEV_BOOKMARKS.html +++ b/infra/THORIUM_DEV_BOOKMARKS.html @@ -38,8 +38,13 @@
default_browser_prompt.cc - Chromium Code Search
bad_flags_prompt.cc - Chromium Code Search
installer/linux - Chromium Code Search +
BUILD.gn - Chromium Code Search
chrome.release - Chromium Code Search +
mini_installer_constants.cc - Chromium Code Search
mini_installer_exe_main.cc - Chromium Code Search +
mini_installer_exe_version.rc.version - Chromium Code Search +
shell_util.cc - Chromium Code Search +
util_constants.cc - Chromium Code Search
download_features.cc - Chromium Code Search
prepopulated_engines.json - Chromium Code Search
search_engine_countries-inc.cc - Chromium Code Search @@ -119,15 +124,11 @@
chrome_proxy_main_win.cc - Chromium Code Search
chrome_exe.ver - Chromium Code Search
chrome_exe.vsprops - Chromium Code Search -
shell_util.cc - Chromium Code Search -
util_constants.cc - Chromium Code Search
BUILD.gn - Chromium Code Search
BUILD.gn - Chromium Code Search
shell_main_delegate.cc - Chromium Code Search
channel_info_posix.cc - Chromium Code Search
shell_integration_linux.cc - Chromium Code Search -
BUILD.gn - Chromium Code Search -
mini_installer_exe_version.rc.version - Chromium Code Search
launch_as_mojo_client_browsertest.cc - Chromium Code Search
reorder-imports.py - Chromium Code Search
vs_toolchain.py - Chromium Code Search diff --git a/src/build/config/android/BUILD.gn b/src/build/config/android/BUILD.gn index 0d7acb39..2a7559d1 100644 --- a/src/build/config/android/BUILD.gn +++ b/src/build/config/android/BUILD.gn @@ -4,6 +4,7 @@ import("//build/config/android/rules.gni") import("//build/config/c++/c++.gni") +import("//build/config/compiler_opt.gni") import("//build/config/compiler/compiler.gni") import("//build/config/sanitizers/sanitizers.gni") diff --git a/src/build/config/compiler/BUILD.gn b/src/build/config/compiler/BUILD.gn index 39c19eed..5d072b6b 100644 --- a/src/build/config/compiler/BUILD.gn +++ b/src/build/config/compiler/BUILD.gn @@ -5,6 +5,7 @@ import("//build/buildflag_header.gni") import("//build/config/android/config.gni") import("//build/config/c++/c++.gni") +import("//build/config/compiler_opt.gni") import("//build/config/chrome_build.gni") import("//build/config/chromeos/args.gni") import("//build/config/chromeos/ui_mode.gni") @@ -16,7 +17,6 @@ import("//build/config/gclient_args.gni") import("//build/config/host_byteorder.gni") import("//build/config/pch.gni") import("//build/config/rust.gni") -import("//build/config/simd_opt.gni") import("//build/config/ui.gni") import("//build/config/unwind.gni") import("//build/toolchain/cc_wrapper.gni") @@ -68,9 +68,6 @@ declare_args() { # Requires profiling to be set to true. enable_full_stack_frames_for_profiling = false - # Whether to enable LLVM's Polly optimizations. See https://polly.llvm.org/ - use_polly = false - # Enable fatal linker warnings. Building Chromium with certain versions # of binutils can cause linker warning. fatal_linker_warnings = true diff --git a/src/build/config/compiler/pgo/BUILD.gn b/src/build/config/compiler/pgo/BUILD.gn index cea90d56..792f5eb2 100644 --- a/src/build/config/compiler/pgo/BUILD.gn +++ b/src/build/config/compiler/pgo/BUILD.gn @@ -4,6 +4,7 @@ import("//build/config/chromeos/ui_mode.gni") import("//build/config/clang/clang.gni") +import("//build/config/compiler_opt.gni") import("//build/config/compiler/compiler.gni") import("//build/config/compiler/pgo/pgo.gni") import("//build/config/features.gni") diff --git a/src/build/config/simd_opt.gni b/src/build/config/compiler_opt.gni similarity index 63% rename from src/build/config/simd_opt.gni rename to src/build/config/compiler_opt.gni index 49e93798..624435b0 100644 --- a/src/build/config/simd_opt.gni +++ b/src/build/config/compiler_opt.gni @@ -2,8 +2,21 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +## For information about compiler flags and optimizations +## that this uses, see https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html + +import("//build/config/BUILDCONFIG.gn") + declare_args() { + # Whether to enable LLVM's Polly optimizations. + # See https://polly.llvm.org/ + use_polly = false + + # Whether to enable LLVM's BOLT optimizations. + # See https://github.com/llvm/llvm-project/blob/main/bolt/README.md + use_bolt = false + # SIMD compiler optimization flags # Propagated to //build/config/* to allow controlling # x86_64 SIMD optimization levels. This was done to refactor @@ -18,7 +31,6 @@ declare_args() { # and AMD SanDiego (2nd Gen. Opteron). # Only applicable to 32 Bit Windows and Linux builds, where # setting it to false allows making an SSE2 build. (`-mmmx -msse2`) - # Baseline for Windows since a Windows 7 update. # `-msse3` use_sse3 = true @@ -51,11 +63,10 @@ declare_args() { # AVX2 (x86-64-v3) # Second generation AVX, expanded to 256-bit registers. - # Used in much professional software. # Present since Haswell (4th Gen. Core i series), and # AMD Excavator (4th Gen. refinement of Bulldozer cores) and # Zen (1st Gen. Ryzen). - # Includes FMA3 `-mfma -mavx2` (`-ffp-contract` see below at FMA) + # Includes FMA3 `-mfma -mavx2` (`-ffp-contract` see below at FMA section) use_avx2 = false # AVX-512 @@ -75,6 +86,11 @@ declare_args() { use_fma = use_avx2 } +if (is_debug || !use_thin_lto) { + assert(!use_polly, "use_polly only works with non-debug builds") + assert(!use_bolt, "use_bolt only works with non-debug builds") +} + # 32 Bit OSes cant use anything above SSE4.2, and 32 Bit Apps can't benefit # from anything higher usually. if (use_avx || use_avx2 || use_fma) { @@ -82,9 +98,29 @@ if (use_avx || use_avx2 || use_fma) { assert(!target_cpu == "x86", "AVX, AVX2, and FMA require x64. Set target_cpu to x64") } -# AVX2 always requires FMA, however, there are times one might want -# use_fma = true even with AVX2 off, such as when making a build for +# AVX2 always should have FMA, however, there are times one might want +# to set use_fma = true even with AVX2 off, such as when making a build for # an AMD Piledriver or Steamroller CPU. -if (use_avx2) { - assert(use_fma, "use_fma must be true when AVX2 is enabled") +if (use_avx2 && !use_fma) { + print("WARNING: Use_avx2 is true while use_fma is false. This will create a + build compiled with AVX2, but without FMA or floating point contraction.") + print("This should only be set intentionally for testing.") +} + +# Not a normal configuration, that normally means a mistake was made configuring +# your args. However, there are a few CPUs out there for which this makes sense. +# Alex313031 TODO: Maybe add -mfma3 -mfma4 for this config? +if (!use_avx2 && use_fma) { + print("WARNING: Use_avx2 is false while use_fma true. This will + create an AVX build with FMA.") + print("This should only be set intentionally for testing, or for specific CPUs + that have AVX and FMA, but not AVX2, such as AMD Piledriver.") +} + +if (use_fma) { + assert(use_avx, "ERROR: use_fma is true while use_avx is false. FMA requires AVX.") +} + +if (!use_sse3 && current_cpu == "x64") { + print("use_sse3 is disabled. This should only be done for 32 Bit builds.") } diff --git a/src/build/config/mac/BUILD.gn b/src/build/config/mac/BUILD.gn index 1ee90911..9d60b822 100644 --- a/src/build/config/mac/BUILD.gn +++ b/src/build/config/mac/BUILD.gn @@ -4,6 +4,7 @@ import("//build/config/apple/symbols.gni") import("//build/config/c++/c++.gni") +import("//build/config/compiler_opt.gni") import("//build/config/mac/mac_sdk.gni") import("//build/config/sysroot.gni") import("//build/toolchain/rbe.gni") diff --git a/src/build/config/win/BUILD.gn b/src/build/config/win/BUILD.gn index cf4ec70e..7e2be9df 100644 --- a/src/build/config/win/BUILD.gn +++ b/src/build/config/win/BUILD.gn @@ -3,12 +3,12 @@ # found in the LICENSE file. import("//build/config/c++/c++.gni") +import("//build/config/compiler_opt.gni") import("//build/config/chrome_build.gni") import("//build/config/clang/clang.gni") import("//build/config/compiler/compiler.gni") import("//build/config/rust.gni") import("//build/config/sanitizers/sanitizers.gni") -import("//build/config/simd_opt.gni") import("//build/config/win/control_flow_guard.gni") import("//build/config/win/visual_studio_version.gni") import("//build/timestamp.gni") diff --git a/src/chrome/browser/net/default_dns_over_https_config_source.cc b/src/chrome/browser/net/default_dns_over_https_config_source.cc new file mode 100644 index 00000000..f1e93ed5 --- /dev/null +++ b/src/chrome/browser/net/default_dns_over_https_config_source.cc @@ -0,0 +1,75 @@ +// 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. + +#include "chrome/browser/net/default_dns_over_https_config_source.h" + +#include + +#include "build/build_config.h" +#include "chrome/browser/net/secure_dns_config.h" +#include "chrome/common/pref_names.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" + +DefaultDnsOverHttpsConfigSource::DefaultDnsOverHttpsConfigSource( + PrefService* local_state, + bool set_up_pref_defaults) { + pref_change_registrar_.Init(local_state); + + // Update the DoH default preferences based on the corresponding + // features before registering change callbacks for these preferences. + // Changing prefs or defaults after registering change callbacks could + // result in reentrancy and mess up registration between this code and + // NetworkService creation. + if (set_up_pref_defaults) { + local_state->SetDefaultPrefValue(prefs::kDnsOverHttpsMode, + base::Value(SecureDnsConfig::ModeToString( + net::SecureDnsMode::kSecure))); + } +} + +DefaultDnsOverHttpsConfigSource::~DefaultDnsOverHttpsConfigSource() = default; + +// static +void DefaultDnsOverHttpsConfigSource::RegisterPrefs( + PrefRegistrySimple* registry) { + registry->RegisterStringPref(prefs::kDnsOverHttpsMode, std::string()); + registry->RegisterStringPref(prefs::kDnsOverHttpsTemplates, std::string()); +#if BUILDFLAG(IS_CHROMEOS) + registry->RegisterStringPref(prefs::kDnsOverHttpsEffectiveTemplatesChromeOS, + std::string()); +#endif +} + +std::string DefaultDnsOverHttpsConfigSource::GetDnsOverHttpsMode() const { + return pref_change_registrar_.prefs()->GetString(prefs::kDnsOverHttpsMode); +} + +std::string DefaultDnsOverHttpsConfigSource::GetDnsOverHttpsTemplates() const { +#if BUILDFLAG(IS_CHROMEOS_LACROS) + return pref_change_registrar_.prefs()->GetString( + prefs::kDnsOverHttpsEffectiveTemplatesChromeOS); +#else + return pref_change_registrar_.prefs()->GetString( + prefs::kDnsOverHttpsTemplates); +#endif +} + +bool DefaultDnsOverHttpsConfigSource::IsConfigManaged() const { + return pref_change_registrar_.prefs() + ->FindPreference(prefs::kDnsOverHttpsMode) + ->IsManaged(); +} + +void DefaultDnsOverHttpsConfigSource::SetDohChangeCallback( + base::RepeatingClosure callback) { + CHECK(pref_change_registrar_.IsEmpty()); + pref_change_registrar_.Add(prefs::kDnsOverHttpsMode, callback); +#if BUILDFLAG(IS_CHROMEOS_LACROS) + pref_change_registrar_.Add(prefs::kDnsOverHttpsEffectiveTemplatesChromeOS, + callback); +#else + pref_change_registrar_.Add(prefs::kDnsOverHttpsTemplates, callback); +#endif +} diff --git a/src/chrome/browser/net/profile_network_context_service.cc b/src/chrome/browser/net/profile_network_context_service.cc index 093f0984..7e8173cb 100644 --- a/src/chrome/browser/net/profile_network_context_service.cc +++ b/src/chrome/browser/net/profile_network_context_service.cc @@ -11,6 +11,7 @@ #include "base/base64.h" #include "base/check_op.h" #include "base/command_line.h" +#include "base/containers/flat_map.h" #include "base/feature_list.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -22,6 +23,8 @@ #include "base/notreached.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" +#include "base/task/sequenced_task_runner.h" +#include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" @@ -33,7 +36,7 @@ #include "chrome/browser/domain_reliability/service_factory.h" #include "chrome/browser/first_party_sets/first_party_sets_policy_service.h" #include "chrome/browser/first_party_sets/first_party_sets_policy_service_factory.h" -#include "chrome/browser/ip_protection/ip_protection_config_provider.h" +#include "chrome/browser/ip_protection/ip_protection_core_host.h" #include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_settings_factory.h" #include "chrome/browser/privacy_sandbox/tracking_protection_settings_factory.h" @@ -76,6 +79,7 @@ #include "crypto/crypto_buildflags.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "net/base/features.h" +#include "net/cert/asn1_util.h" #include "net/http/http_auth_preferences.h" #include "net/http/http_util.h" #include "net/net_buildflags.h" @@ -89,10 +93,6 @@ #include "services/network/public/mojom/network_service.mojom.h" #include "third_party/blink/public/common/features.h" -#if BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED) -#include "net/cert/asn1_util.h" -#endif - #if BUILDFLAG(IS_CHROMEOS) #include "chrome/browser/certificate_provider/certificate_provider.h" #include "chrome/browser/certificate_provider/certificate_provider_service.h" @@ -106,10 +106,10 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/constants/ash_switches.h" +#include "chrome/browser/ash/kcer/kcer_factory_ash.h" #include "chrome/browser/ash/net/client_cert_store_ash.h" #include "chrome/browser/ash/net/client_cert_store_kcer.h" #include "chrome/browser/ash/profiles/profile_helper.h" -#include "chrome/browser/chromeos/kcer/kcer_factory.h" #include "chrome/browser/policy/profile_policy_connector.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" @@ -319,7 +319,6 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) certificate_transparency::prefs::kCTExcludedSPKIs, base::BindRepeating(&ProfileNetworkContextService::ScheduleUpdateCTPolicy, base::Unretained(this))); -#if BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED) // When any of the following Certificate preferences change, we schedule an // update to aggregate the actual update using a |cert_policy_update_timer_|. base::RepeatingClosure schedule_update_cert_policy = base::BindRepeating( @@ -337,7 +336,6 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) pref_change_registrar_.Add(prefs::kCAPlatformIntegrationEnabled, schedule_update_cert_policy); #endif -#endif // BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED) pref_change_registrar_.Add( prefs::kGloballyScopeHTTPAuthCacheEnabled, @@ -349,6 +347,26 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) base::BindRepeating(&ProfileNetworkContextService:: UpdateCorsNonWildcardRequestHeadersSupport, base::Unretained(this))); + +#if BUILDFLAG(ENABLE_REPORTING) + if (base::FeatureList::IsEnabled( + net::features::kReportingApiEnableEnterpriseCookieIssues)) { + pref_change_registrar_.Add( + prefs::kReportingEndpoints, + base::BindRepeating( + &ProfileNetworkContextService::UpdateEnterpriseReportingEndpoints, + base::Unretained(this))); + } +#endif // BUILDFLAG(ENABLE_REPORTING) +#if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI) + if (base::FeatureList::IsEnabled(features::kEnableCertManagementUIV2Write)) { + server_cert_database_ = base::SequenceBound( + base::ThreadPool::CreateSequencedTaskRunner( + {base::MayBlock(), base::TaskPriority::USER_BLOCKING, + base::TaskShutdownBehavior::BLOCK_SHUTDOWN}), + profile->GetPath()); + } +#endif // BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI) } ProfileNetworkContextService::~ProfileNetworkContextService() = default; @@ -387,7 +405,6 @@ void ProfileNetworkContextService::RegisterProfilePrefs( registry->RegisterBooleanPref(prefs::kGloballyScopeHTTPAuthCacheEnabled, false); registry->RegisterListPref(prefs::kHSTSPolicyBypassList); -#if BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED) registry->RegisterListPref(prefs::kCACertificates); registry->RegisterListPref(prefs::kCACertificatesWithConstraints); registry->RegisterListPref(prefs::kCADistrustedCertificates); @@ -396,7 +413,6 @@ void ProfileNetworkContextService::RegisterProfilePrefs( // Include user added platform certs by default. registry->RegisterBooleanPref(prefs::kCAPlatformIntegrationEnabled, true); #endif -#endif // BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED) } // static @@ -517,7 +533,6 @@ void ProfileNetworkContextService::ScheduleUpdateCTPolicy() { &ProfileNetworkContextService::UpdateCTPolicy); } -#if BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED) cert_verifier::mojom::AdditionalCertificatesPtr ProfileNetworkContextService::GetCertificatePolicy( const base::FilePath& storage_partition_path) { @@ -743,7 +758,6 @@ ProfileNetworkContextService::GetCertificatePolicyForView() { #endif return policies; } -#endif // BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED) bool ProfileNetworkContextService::ShouldSplitAuthCacheByNetworkIsolationKey() const { @@ -778,6 +792,38 @@ void ProfileNetworkContextService:: }); } +#if BUILDFLAG(ENABLE_REPORTING) +base::flat_map +ProfileNetworkContextService::GetEnterpriseReportingEndpoints() const { + using FlatMap = base::flat_map; + // Create the underlying container first to allow sorting to + // be done in a single pass. + FlatMap::container_type pairs; + const base::Value::Dict& pref_dict = + profile_->GetPrefs()->GetDict(prefs::kReportingEndpoints); + pairs.reserve(pref_dict.size()); + // The iterator for base::Value::Dict returns a temporary value when + // dereferenced, so a const reference is not used below. + for (const auto [endpoint_name, endpoint_url] : pref_dict) { + GURL endpoint(endpoint_url.GetString()); + if (endpoint.is_valid() && endpoint.SchemeIsCryptographic()) { + pairs.emplace_back(endpoint_name, std::move(endpoint)); + } + } + return FlatMap(std::move(pairs)); +} + +void ProfileNetworkContextService::UpdateEnterpriseReportingEndpoints() { + base::flat_map endpoints = + GetEnterpriseReportingEndpoints(); + profile_->ForEachLoadedStoragePartition( + [&](content::StoragePartition* storage_partition) { + storage_partition->GetNetworkContext()->SetEnterpriseReportingEndpoints( + endpoints); + }); +} +#endif + // static network::mojom::CookieManagerParamsPtr ProfileNetworkContextService::CreateCookieManagerParams( @@ -896,7 +942,8 @@ ProfileNetworkContextService::CreateClientCertStore() { if (ash::features::ShouldUseKcerClientCertStore()) { return std::make_unique( - std::move(certificate_provider), kcer::KcerFactory::GetKcer(profile_)); + std::move(certificate_provider), + kcer::KcerFactoryAsh::GetKcer(profile_)); } else { std::string username_hash; const user_manager::User* user = @@ -981,6 +1028,24 @@ bool GetHttpCacheBackendResetParam(PrefService* local_state) { current_field_trial_status += (field_trial ? field_trial->group_name() : "None"); + // For the HTTP Cache keying experiments, if a flag indicates that the user is + // in an experiment group, modify `current_field_trial_status` to ensure that + // the cache gets cleared. If the user is not a part of the experiment, don't + // make any changes so as not to invalidate the existing cache. + if (base::FeatureList::IsEnabled( + net::features::kSplitCacheByCrossSiteMainFrameNavigationBoolean)) { + current_field_trial_status += " 20240814-CrossSiteNavBool"; + } else if (base::FeatureList::IsEnabled( + net::features::kSplitCacheByMainFrameNavigationInitiator)) { + current_field_trial_status += " 20240814-MainFrameNavigationInitiator"; + } else if (base::FeatureList::IsEnabled( + net::features::kSplitCacheByNavigationInitiator)) { + current_field_trial_status += " 20240814-NavigationInitiator"; + } else if (base::FeatureList::IsEnabled( + net::features::kHttpCacheKeyingExperimentControlGroup2024)) { + current_field_trial_status += " 20240814-ExperimentControlGroup"; + } + std::string previous_field_trial_status = local_state->GetString(kHttpCacheFinchExperimentGroups); local_state->SetString(kHttpCacheFinchExperimentGroups, @@ -1092,6 +1157,12 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( #if BUILDFLAG(ENABLE_REPORTING) network_context_params->file_paths->reporting_and_nel_store_database_name = base::FilePath(chrome::kReportingAndNelStoreFilename); + + if (base::FeatureList::IsEnabled( + net::features::kReportingApiEnableEnterpriseCookieIssues)) { + network_context_params->enterprise_reporting_endpoints = + GetEnterpriseReportingEndpoints(); + } #endif // BUILDFLAG(ENABLE_REPORTING) if (relative_partition_path.empty()) { // This is the main partition. @@ -1210,13 +1281,21 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( } #endif -#if BUILDFLAG(CHROME_CERTIFICATE_POLICIES_SUPPORTED) // TODO(crbug.com/40928765): check to see if IsManaged() ensures the pref // isn't set in user profiles, or if that does something else. If that's true, // add an isManaged() check here. + // TODO(crbug.com/40928765): add async calls to get the User Certs from + // server_cert_database_ and then feed it to the CertVerifiers + // through the cert_verifier_updater + // (storage_partition->GetCertVerifierServiceUpdater()). + // verifications need to wait for for these certs to get to the cert verifier. + // + // Will have to think about if separate mojom call should be used or if the + // currently existing one should be repurposed. + // Will also have to consider any caching/reuse to reduce amount of DB reads + // necessary. cert_verifier_creation_params->initial_additional_certificates = GetCertificatePolicy(GetPartitionPath(relative_partition_path)); -#endif #if BUILDFLAG(IS_CHROMEOS) // Disable idle sockets close on memory pressure if configured by finch or @@ -1266,16 +1345,15 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( profile_->GetPrefs()->GetBoolean( prefs::kAccessControlAllowMethodsInCORSPreflightSpecConformant); - IpProtectionConfigProvider* ipp_config_provider = - IpProtectionConfigProvider::Get(profile_); - if (ipp_config_provider) { - ipp_config_provider->AddNetworkService( + IpProtectionCoreHost* ipp_core_host = IpProtectionCoreHost::Get(profile_); + if (ipp_core_host) { + ipp_core_host->AddNetworkService( network_context_params->ip_protection_config_getter .InitWithNewPipeAndPassReceiver(), network_context_params->ip_protection_proxy_delegate .InitWithNewPipeAndPassRemote()); network_context_params->enable_ip_protection = - ipp_config_provider->IsIpProtectionEnabled(); + ipp_core_host->IsIpProtectionEnabled(); } network_context_params->device_bound_sessions_enabled = diff --git a/src/chrome/browser/net/stub_resolver_config_reader.cc b/src/chrome/browser/net/stub_resolver_config_reader.cc index a38044aa..badf20c3 100644 --- a/src/chrome/browser/net/stub_resolver_config_reader.cc +++ b/src/chrome/browser/net/stub_resolver_config_reader.cc @@ -21,6 +21,8 @@ #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/net/default_dns_over_https_config_source.h" +#include "chrome/browser/net/dns_over_https_config_source.h" #include "chrome/browser/net/secure_dns_config.h" #include "chrome/browser/net/secure_dns_util.h" #include "chrome/browser/policy/chrome_browser_policy_connector.h" @@ -42,12 +44,6 @@ #include "chrome/browser/enterprise/util/android_enterprise_info.h" #endif -#if BUILDFLAG(IS_CHROMEOS_ASH) -#include - -#include "chrome/browser/ash/net/dns_over_https/templates_uri_resolver_impl.h" -#endif - #if BUILDFLAG(IS_WIN) #include "base/enterprise_util.h" #include "base/win/win_util.h" @@ -83,7 +79,7 @@ enum class SecureDnsModeDetailsForHistogram { #if BUILDFLAG(IS_WIN) bool ShouldDisableDohForWindowsParentalControls() { - return GetWinParentalControls().web_filter; + return false; } #endif // BUILDFLAG(IS_WIN) @@ -109,35 +105,25 @@ constexpr base::TimeDelta StubResolverConfigReader::kParentalControlsCheckDelay; StubResolverConfigReader::StubResolverConfigReader(PrefService* local_state, bool set_up_pref_defaults) : local_state_(local_state) { + default_doh_source_ = std::make_unique( + local_state_, set_up_pref_defaults); + if (set_up_pref_defaults) { + // Update the DnsClient based on the corresponding features before + // registering change callbacks for these preferences. Changing prefs or + // defaults after registering change callbacks could result in reentrancy + // and mess up registration between this code and NetworkService creation. + local_state->SetDefaultPrefValue(prefs::kBuiltInDnsClientEnabled, + base::Value(ShouldEnableAsyncDns())); + } base::RepeatingClosure pref_callback = base::BindRepeating(&StubResolverConfigReader::UpdateNetworkService, base::Unretained(this), false /* record_metrics */); + default_doh_source_->SetDohChangeCallback(pref_callback); pref_change_registrar_.Init(local_state_); - - // Update the DnsClient and DoH default preferences based on the corresponding - // features before registering change callbacks for these preferences. - // Changing prefs or defaults after registering change callbacks could result - // in reentrancy and mess up registration between this code and NetworkService - // creation. - if (set_up_pref_defaults) { - local_state_->SetDefaultPrefValue(prefs::kBuiltInDnsClientEnabled, - base::Value(ShouldEnableAsyncDns())); - local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsMode, - base::Value(SecureDnsConfig::ModeToString( - net::SecureDnsMode::kSecure))); - } - pref_change_registrar_.Add(prefs::kBuiltInDnsClientEnabled, pref_callback); - pref_change_registrar_.Add(prefs::kDnsOverHttpsMode, pref_callback); pref_change_registrar_.Add(prefs::kAdditionalDnsQueryTypesEnabled, pref_callback); -#if BUILDFLAG(IS_CHROMEOS) - pref_change_registrar_.Add(prefs::kDnsOverHttpsEffectiveTemplatesChromeOS, - pref_callback); -#else - pref_change_registrar_.Add(prefs::kDnsOverHttpsTemplates, pref_callback); -#endif parental_controls_delay_timer_.Start( FROM_HERE, kParentalControlsCheckDelay, @@ -145,7 +131,7 @@ StubResolverConfigReader::StubResolverConfigReader(PrefService* local_state, base::Unretained(this))); #if BUILDFLAG(IS_ANDROID) - chrome::enterprise_util::AndroidEnterpriseInfo::GetInstance() + enterprise_util::AndroidEnterpriseInfo::GetInstance() ->GetAndroidEnterpriseInfoState(base::BindOnce( &StubResolverConfigReader::OnAndroidOwnedStateCheckComplete, weak_factory_.GetWeakPtr())); @@ -163,16 +149,7 @@ void StubResolverConfigReader::RegisterPrefs(PrefRegistrySimple* registry) { // captured). Thus, the preference defaults are updated in the constructor // for SystemNetworkContextManager, at which point the feature list is ready. registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, false); - registry->RegisterStringPref(prefs::kDnsOverHttpsMode, std::string()); - registry->RegisterStringPref(prefs::kDnsOverHttpsTemplates, std::string()); registry->RegisterBooleanPref(prefs::kAdditionalDnsQueryTypesEnabled, true); -#if BUILDFLAG(IS_CHROMEOS) - registry->RegisterStringPref(prefs::kDnsOverHttpsTemplatesWithIdentifiers, - std::string()); - registry->RegisterStringPref(prefs::kDnsOverHttpsEffectiveTemplatesChromeOS, - std::string()); - registry->RegisterStringPref(prefs::kDnsOverHttpsSalt, std::string()); -#endif } SecureDnsConfig StubResolverConfigReader::GetSecureDnsConfiguration( @@ -189,42 +166,31 @@ void StubResolverConfigReader::UpdateNetworkService(bool record_metrics) { } bool StubResolverConfigReader::ShouldDisableDohForManaged() { -// This function ignores cloud policies which are loaded on a per-profile basis. -#if BUILDFLAG(IS_ANDROID) - // Check for MDM/management/owner apps. android_has_owner_ is true if either a - // device or policy owner app is discovered by - // GetAndroidEnterpriseInfoState(). If android_has_owner_ is nullopt, take a - // value of false so that we don't disable DoH during the async check. - - // Because Android policies can only be loaded with owner apps this is - // sufficient to check for the prescences of policies as well. - if (android_has_owner_.value_or(false)) - return true; -#elif BUILDFLAG(IS_WIN) - // TODO(crbug.com/40229843): What is the correct function to use here? (This - // may or may not obsolete the following TODO) - // TODO(crbug.com/40223626): For legacy compatibility, this uses - // IsEnterpriseDevice() which effectively equates to a domain join check. - // Consider whether this should use IsManagedDevice() instead. - if (base::win::IsEnrolledToDomain()) - return true; -#endif -#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS) - if (g_browser_process->browser_policy_connector()->HasMachineLevelPolicies()) - return true; -#endif return false; } bool StubResolverConfigReader::ShouldDisableDohForParentalControls() { - if (parental_controls_testing_override_.has_value()) - return parental_controls_testing_override_.value(); - -#if BUILDFLAG(IS_WIN) - return ShouldDisableDohForWindowsParentalControls(); -#else return false; -#endif +} + +void StubResolverConfigReader::SetOverrideDnsOverHttpsConfigSource( + std::unique_ptr doh_source) { + override_doh_source_ = std::move(doh_source); + + if (override_doh_source_) { + override_doh_source_->SetDohChangeCallback(base::BindRepeating( + &StubResolverConfigReader::UpdateNetworkService, + weak_factory_.GetWeakPtr(), /*record_metrics=*/false)); + } + UpdateNetworkService(/*record_metrics=*/false); +} + +const DnsOverHttpsConfigSource* +StubResolverConfigReader::GetDnsOverHttpsConfigSource() const { + if (override_doh_source_) { + return override_doh_source_.get(); + } + return default_doh_source_.get(); } void StubResolverConfigReader::OnParentalControlsDelayTimer() { @@ -255,14 +221,13 @@ SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration( SecureDnsModeDetailsForHistogram mode_details; SecureDnsConfig::ManagementMode forced_management_mode = SecureDnsConfig::ManagementMode::kNoOverride; - bool is_managed = - local_state_->FindPreference(prefs::kDnsOverHttpsMode)->IsManaged(); + bool is_managed = GetDnsOverHttpsConfigSource()->IsConfigManaged(); if (!is_managed && ShouldDisableDohForManaged()) { secure_dns_mode = net::SecureDnsMode::kOff; forced_management_mode = SecureDnsConfig::ManagementMode::kDisabledManaged; } else { secure_dns_mode = SecureDnsConfig::ParseMode( - local_state_->GetString(prefs::kDnsOverHttpsMode)) + GetDnsOverHttpsConfigSource()->GetDnsOverHttpsMode()) .value_or(net::SecureDnsMode::kOff); } @@ -316,6 +281,19 @@ SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration( // Check parental controls last because it can be expensive and should only be // checked if necessary for the otherwise-determined mode. if (check_parental_controls) { + if (ShouldDisableDohForParentalControls()) { + forced_management_mode = + SecureDnsConfig::ManagementMode::kDisabledParentalControls; + secure_dns_mode = net::SecureDnsMode::kOff; + mode_details = + SecureDnsModeDetailsForHistogram::kOffByDetectedParentalControls; + + // If parental controls had not previously been checked, need to update + // network service. + if (!parental_controls_checked_) + update_network_service = true; + } + parental_controls_checked_ = true; } @@ -332,13 +310,8 @@ SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration( net::DnsOverHttpsConfig doh_config; if (secure_dns_mode != net::SecureDnsMode::kOff) { -#if BUILDFLAG(IS_CHROMEOS) - doh_config = net::DnsOverHttpsConfig::FromStringLax(local_state_->GetString( - prefs::kDnsOverHttpsEffectiveTemplatesChromeOS)); -#else doh_config = net::DnsOverHttpsConfig::FromStringLax( - local_state_->GetString(prefs::kDnsOverHttpsTemplates)); -#endif + GetDnsOverHttpsConfigSource()->GetDnsOverHttpsTemplates()); } if (update_network_service) { content::GetNetworkService()->ConfigureStubHostResolver( @@ -361,16 +334,3 @@ void StubResolverConfigReader::OnAndroidOwnedStateCheckComplete( UpdateNetworkService(false /* record_metrics */); } #endif - -#if BUILDFLAG(IS_CHROMEOS_ASH) -std::optional -StubResolverConfigReader::GetDohWithIdentifiersDisplayServers() { - ash::dns_over_https::TemplatesUriResolverImpl doh_template_uri_resolver; - doh_template_uri_resolver.Update(local_state_); - - if (doh_template_uri_resolver.GetDohWithIdentifiersActive()) - return doh_template_uri_resolver.GetDisplayTemplates(); - - return std::nullopt; -} -#endif diff --git a/src/chrome/browser/ui/browser_ui_prefs.cc b/src/chrome/browser/ui/browser_ui_prefs.cc index 3a299187..aaa3c6cd 100644 --- a/src/chrome/browser/ui/browser_ui_prefs.cc +++ b/src/chrome/browser/ui/browser_ui_prefs.cc @@ -19,6 +19,8 @@ #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" +#include "components/sharing_message/buildflags.h" +#include "components/sharing_message/pref_names.h" #include "components/translate/core/browser/translate_pref_names.h" #include "media/media_buildflags.h" #include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h" @@ -170,6 +172,9 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref( prefs::kHttpsOnlyModeEnabled, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref( + prefs::kHttpsFirstBalancedMode, false, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterBooleanPref( prefs::kHttpsFirstModeIncognito, true, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); diff --git a/src/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.cc b/src/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.cc index 4ff8e6f8..4baf8a4b 100644 --- a/src/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.cc +++ b/src/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.cc @@ -39,7 +39,7 @@ namespace { void ShowPrompt() { - return; + continue; } // Do not show the prompt if "suppress_default_browser_prompt_for_version" in diff --git a/src/chrome/installer/linux/BUILD.gn b/src/chrome/installer/linux/BUILD.gn index 82f5ed27..6a92dcf1 100644 --- a/src/chrome/installer/linux/BUILD.gn +++ b/src/chrome/installer/linux/BUILD.gn @@ -277,7 +277,7 @@ copy("deb_packaging_files") { "debian/changelog.template", "debian/control.template", "debian/debian.menu", - "debian/manual_recommends", + # "debian/manual_recommends", "debian/postinst", "debian/postrm", "debian/prerm", @@ -449,6 +449,8 @@ template("linux_package") { deb_arch = "mips64el" } else if (current_cpu == "loong64") { deb_arch = "loong64" + } else if (current_cpu == "riscv64") { + deb_arch = "riscv64" } else { assert(false, "Linux installer not configured for this architecture.") } @@ -500,6 +502,8 @@ template("linux_package") { rpm_arch = "mips64el" } else if (current_cpu == "loong64") { rpm_arch = "loongarch64" + } else if (current_cpu == "riscv64") { + rpm_arch = "riscv64" } else { assert(false, "Linux installer not configured for this architecture.") } diff --git a/src/chrome/installer/linux/common/installer.include b/src/chrome/installer/linux/common/installer.include index 4fac0a22..9fb82568 100644 --- a/src/chrome/installer/linux/common/installer.include +++ b/src/chrome/installer/linux/common/installer.include @@ -92,7 +92,7 @@ process_template() ( -e "s#@@PRODUCTURL@@#${PRODUCTURL}#g" \ -e "s#@@PREDEPENDS@@#${PREDEPENDS}#g" \ -e "s#@@DEPENDS@@#${DEPENDS}#g" \ - -e "s#@@RECOMMENDS@@#${RECOMMENDS}#g" \ + # -e "s#@@RECOMMENDS@@#${RECOMMENDS}#g" \ -e "s#@@PROVIDES@@#${PROVIDES}#g" \ -e "s#@@ARCHITECTURE@@#${ARCHITECTURE}#g" \ -e "s#@@MAINTNAME@@#${MAINTNAME}#g" \ diff --git a/src/chrome/installer/linux/debian/additional_deps b/src/chrome/installer/linux/debian/additional_deps new file mode 100644 index 00000000..2962f2fa --- /dev/null +++ b/src/chrome/installer/linux/debian/additional_deps @@ -0,0 +1,33 @@ +# 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. +# +# Additional dependencies not in the dpkg-shlibdeps output. + +# Make sure users have SSL certificates. +ca-certificates + +# Make sure users have compatible fonts for viewing PDFs. +fonts-liberation + +# GTK is dlopen()'ed. Versions 3 or 4 are supported. +libgtk-3-0 (>= 3.9.10) | libgtk-4-1 + +# Pull a more recent version of NSS than required by runtime linking, for +# security and stability updates in NSS. +libnss3 (>= 2:3.35) + +# For uploading crash reports with Breakpad. +wget +libcurl3-gnutls | libcurl3-nss | libcurl4 | libcurl3 + +# u2f udev rules have moved from being installed by default by systemd on Debian +# systems to a separate package called libu2f-udev. Pull it in manually so that +# u2f keys will work. +libu2f-udev + +# Try to use Vulkan when possible. +libvulkan1 + +# For OS integration. +xdg-utils (>= 1.0.2) diff --git a/src/chrome/installer/linux/debian/build.sh b/src/chrome/installer/linux/debian/build.sh index ad09f0f2..486725e6 100755 --- a/src/chrome/installer/linux/debian/build.sh +++ b/src/chrome/installer/linux/debian/build.sh @@ -112,7 +112,7 @@ do_package() { log_cmd echo "Packaging ${ARCHITECTURE}..." PREDEPENDS="$COMMON_PREDEPS" DEPENDS="${COMMON_DEPS}" - RECOMMENDS="${COMMON_RECOMMENDS}" + # RECOMMENDS="${COMMON_RECOMMENDS}" PROVIDES="www-browser" gen_changelog process_template "${SCRIPTDIR}/control.template" "${DEB_CONTROL}" @@ -159,15 +159,15 @@ verify_channel() { case $CHANNEL in stable ) CHANNEL=stable - RELEASENOTES="https://chromereleases.googleblog.com/search/label/Stable%20updates" + RELEASENOTES="https://github.com/Alex313031/Thorium/releases" ;; beta|testing ) CHANNEL=beta - RELEASENOTES="https://chromereleases.googleblog.com/search/label/Beta%20updates" + RELEASENOTES="https://github.com/Alex313031/Thorium/releases" ;; dev|unstable|alpha ) CHANNEL=unstable - RELEASENOTES="https://chromereleases.googleblog.com/search/label/Dev%20updates" + RELEASENOTES="https://github.com/Alex313031/Thorium/releases" ;; # Canary is released twice a day automatically, so no release notes # attached. @@ -272,8 +272,8 @@ export ARCHITECTURE="${ARCHITECTURE}" DEB_COMMON_DEPS="${OUTPUTDIR}/deb_common.deps" COMMON_DEPS=$(sed ':a;N;$!ba;s/\n/, /g' "${DEB_COMMON_DEPS}") COMMON_PREDEPS="dpkg (>= 1.14.0)" -MANUAL_RECOMMENDS="${SCRIPTDIR}/manual_recommends" -COMMON_RECOMMENDS=$(grep -v ^$ "${MANUAL_RECOMMENDS}" | grep -v ^# | +# MANUAL_RECOMMENDS="${SCRIPTDIR}/manual_recommends" +# COMMON_RECOMMENDS=$(grep -v ^$ "${MANUAL_RECOMMENDS}" | grep -v ^# | sed ':a;N;$!ba;s/\n/, /g') # Make everything happen in the OUTPUTDIR. diff --git a/src/chrome/installer/linux/debian/control.template b/src/chrome/installer/linux/debian/control.template index dfd56f46..78e723e7 100644 --- a/src/chrome/installer/linux/debian/control.template +++ b/src/chrome/installer/linux/debian/control.template @@ -2,14 +2,14 @@ Source: @@PACKAGE@@ Section: web Priority: optional Maintainer: @@MAINTNAME@@ <@@MAINTMAIL@@> -Build-Depends: dpkg-dev, devscripts, fakeroot, xz-utils -Standards-Version: 3.8.0 +Build-Depends: dpkg-dev, devscripts, fakeroot, xz-utils, zip +Standards-Version: 3.9.8 Package: @@PACKAGE@@ Provides: @@PROVIDES@@ Pre-Depends: @@PREDEPENDS@@ Depends: @@DEPENDS@@ -Recommends: @@RECOMMENDS@@ +Recommends: vdpau-driver-all Conflicts: thorium-browser-unstable Replaces: thorium-browser-unstable Architecture: @@ARCHITECTURE@@ diff --git a/src/chrome/installer/mini_installer/chrome.release b/src/chrome/installer/mini_installer/chrome.release index 6626be8b..84900b9f 100644 --- a/src/chrome/installer/mini_installer/chrome.release +++ b/src/chrome/installer/mini_installer/chrome.release @@ -22,7 +22,7 @@ thor_ver: %(ChromeDir)s\ # # Chrome version dir entries, sorted alphabetically. # -blink_test_plugin.dll: %(VersionDir)s\ +# blink_test_plugin.dll: %(VersionDir)s\ chrome.dll: %(VersionDir)s\ chrome_100_percent.pak: %(VersionDir)s\ chromedriver.exe: %(VersionDir)s\ @@ -37,7 +37,6 @@ eventlog_provider.dll: %(VersionDir)s\ icudtl.dat: %(VersionDir)s\ libEGL.dll: %(VersionDir)s\ libGLESv2.dll: %(VersionDir)s\ -mojo_core.dll: %(VersionDir)s\ notification_helper.exe: %(VersionDir)s\ optimization_guide_internal.dll: %(VersionDir)s\ resources.pak: %(VersionDir)s\ diff --git a/src/chrome/installer/mini_installer/mini_installer_exe_main.cc b/src/chrome/installer/mini_installer/mini_installer_exe_main.cc index a6dd4411..f14f80aa 100644 --- a/src/chrome/installer/mini_installer/mini_installer_exe_main.cc +++ b/src/chrome/installer/mini_installer/mini_installer_exe_main.cc @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifdef UNSAFE_BUFFERS_BUILD +// TODO(crbug.com/40285824): Remove this and convert code to safer constructs. +#pragma allow_unsafe_buffers +#endif + #include #include "base/clang_profiling_buildflags.h" @@ -54,13 +59,13 @@ void* memset(void* dest, int c, size_t count) { return dest; } +// SET BY ALEX313031 FOR ALL BUILDS BECAUSE IT CAUSES ERRORS +// DURING CROSS-BUILDING IF UNSET. //#if defined(_DEBUG) && defined(ARCH_CPU_ARM64) // The compiler generates calls to memcpy for ARM64 debug builds so we need to // supply a memcpy implementation in that configuration. // See comments above for why we do this incantation. -// SET BY ALEX313031 FOR ALL BUILDS BECAUSE IT CAUSES ERRORS -// DURING CROSS-BUILDING IF UNSET. __attribute__((used)) void* memcpy(void* destination, const void* source, size_t count) { auto* dst = reinterpret_cast(destination); diff --git a/src/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/src/components/privacy_sandbox/privacy_sandbox_settings_impl.cc index f7b54e3d..05c74ec7 100644 --- a/src/components/privacy_sandbox/privacy_sandbox_settings_impl.cc +++ b/src/components/privacy_sandbox/privacy_sandbox_settings_impl.cc @@ -77,6 +77,8 @@ constexpr char kIsSharedStorageAllowedHistogram[] = "PrivacySandbox.IsSharedStorageAllowed"; constexpr char kIsSharedStorageSelectURLAllowedHistogram[] = "PrivacySandbox.IsSharedStorageSelectURLAllowed"; +constexpr char kIsLocalUnpartitionedDataAccessAllowedHistogram[] = + "PrivacySandbox.IsLocalUnpartitionedDataAccessAllowed"; constexpr char kIsPrivateAggregationAllowedHistogram[] = "PrivacySandbox.IsPrivateAggregationAllowed"; @@ -712,6 +714,40 @@ bool PrivacySandboxSettingsImpl::IsSharedStorageSelectURLAllowed( return IsAllowed(status); } +bool PrivacySandboxSettingsImpl::IsLocalUnpartitionedDataAccessAllowed( + const url::Origin& top_frame_origin, + const url::Origin& accessing_origin, + content::RenderFrameHost* console_frame) const { + // TODO(crbug.com/365788691): Before checking the attestation status, check + // the 3PC setting here. If the toggle "Block all third-party cookies" is + // enabled, the local unpartitioned data access feature will be disabled. + Status attestation_status = + PrivacySandboxAttestations::GetInstance()->IsSiteAttested( + net::SchemefulSite(accessing_origin), + PrivacySandboxAttestationsGatedAPI::kLocalUnpartitionedDataAccess); + if (!IsAllowed(attestation_status)) { + JoinHistogram(kIsLocalUnpartitionedDataAccessAllowedHistogram, + attestation_status); + if (console_frame) { + console_frame->AddMessageToConsole( + blink::mojom::ConsoleMessageLevel::kError, + base::StrCat( + {"Attestation check for local unpartitioned data access on ", + accessing_origin.Serialize(), " failed."})); + } + return false; + } + + Status status = GetPrivacySandboxAllowedStatus(); + if (IsAllowed(status)) { + status = + GetSiteAccessAllowedStatus(top_frame_origin, accessing_origin.GetURL()); + } + JoinHistogram(kIsLocalUnpartitionedDataAccessAllowedHistogram, status); + + return IsAllowed(status); +} + bool PrivacySandboxSettingsImpl::IsPrivateAggregationAllowed( const url::Origin& top_frame_origin, const url::Origin& reporting_origin, @@ -745,13 +781,24 @@ bool PrivacySandboxSettingsImpl::IsPrivateAggregationDebugModeAllowed( return false; } + // If this feature is disabled, provide a top-frame origin anyway to match + // previous behavior. + std::optional top_frame_origin_to_query; + if (!base::FeatureList::IsEnabled( + kPrivateAggregationDebugReportingIgnoreSiteExceptions)) { + top_frame_origin_to_query = top_frame_origin; + } + // Third party cookies must also be available for this context. An empty site - // for cookies is provided so the context is always treated as a third party. + // for cookies and empty top-frame origin is provided so the context is always + // treated as a third party. That is, we ignore any top-level site cookie + // exceptions (see crbug.com/364318217). content_settings::CookieSettingsBase::CookieSettingWithMetadata cookie_setting_with_metadata; if (cookie_settings_->IsFullCookieAccessAllowed( - reporting_origin.GetURL(), net::SiteForCookies(), top_frame_origin, - net::CookieSettingOverrides(), &cookie_setting_with_metadata)) { + reporting_origin.GetURL(), net::SiteForCookies(), + top_frame_origin_to_query, net::CookieSettingOverrides(), + &cookie_setting_with_metadata)) { return true; } @@ -839,12 +886,12 @@ PrivacySandboxSettingsImpl::GetSiteAccessAllowedStatus( PrivacySandboxSettingsImpl::Status PrivacySandboxSettingsImpl::GetPrivacySandboxAllowedStatus( - bool should_ignore_restriction /*=false*/) const { - if (delegate_->IsIncognitoProfile()) { - return Status::kIncognitoProfile; - } - // Always return restricted in Thorium - return Status::kRestricted; + bool should_ignore_restriction /*=false*/) const { + if (delegate_->IsIncognitoProfile()) { + return Status::kIncognitoProfile; + } + // Always return restricted in Thorium + return Status::kRestricted; } PrivacySandboxSettingsImpl::Status diff --git a/src/components/privacy_sandbox/tracking_protection_prefs.cc b/src/components/privacy_sandbox/tracking_protection_prefs.cc index 1b495995..51c1e270 100644 --- a/src/components/privacy_sandbox/tracking_protection_prefs.cc +++ b/src/components/privacy_sandbox/tracking_protection_prefs.cc @@ -46,29 +46,21 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterTimePref(prefs::kTrackingProtectionSilentOnboardedSince, base::Time()); - // Full 3PCD prefs. - registry->RegisterTimePref(prefs::kTrackingProtectionFull3PCDOnboarded, - base::Time()); + registry->RegisterBooleanPref( + prefs::kEnableDoNotTrack, true, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kUserBypass3pcExceptionsMigrated, false); - // Tracking Protection Reminder Prefs - registry->RegisterIntegerPref( - prefs::kTrackingProtectionReminderStatus, - static_cast(TrackingProtectionReminderStatus::kUnset)); - - // Tracking Protection Survey Prefs - registry->RegisterTimePref(prefs::kTrackingProtectionSurveyWindowStartTime, - base::Time()); - - // Tracking Protection Settings Prefs + // TODO(https://b/333527273): Deprecate registry->RegisterBooleanPref( prefs::kBlockAll3pcToggleEnabled, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false); registry->RegisterBooleanPref(prefs::kAllowAll3pcToggleEnabled, false); registry->RegisterIntegerPref( prefs::kTrackingProtectionLevel, static_cast(TrackingProtectionLevel::kStandard), user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); - registry->RegisterBooleanPref(prefs::kTrackingProtection3pcdEnabled, false); registry->RegisterBooleanPref( prefs::kIpProtectionEnabled, true, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); @@ -77,10 +69,6 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterBooleanPref( prefs::kFingerprintingProtectionEnabled, true, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); - registry->RegisterBooleanPref( - prefs::kEnableDoNotTrack, true, - user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); - registry->RegisterBooleanPref(prefs::kUserBypass3pcExceptionsMigrated, false); } } // namespace privacy_sandbox::tracking_protection diff --git a/src/components/search_engines/prepopulated_engines.json b/src/components/search_engines/prepopulated_engines.json index 11bba151..e34398d1 100644 --- a/src/components/search_engines/prepopulated_engines.json +++ b/src/components/search_engines/prepopulated_engines.json @@ -1,4 +1,4 @@ -// Copyright 2024 The Chromium Authors and Alex313031 and tomByrer +// Copyright 2024 The Chromium Authors, Alex313031, and tomByrer // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -18,6 +18,8 @@ // - Use HTTPS URLs when adding new search engines or adding URLs to existing // ones. It's not the 90s anymore. +// LINT.IfChange(prepopulated_engines.json) + { "int_variables": { // When adding new engines, increment this number and use it as the new @@ -29,7 +31,7 @@ // existing data should get a new version. Otherwise, existing data may // continue to be used and updates made here will not always appear. // Also then run tools/search_engine_choice/generate_search_engine_icons.py. - "kCurrentDataVersion": 165 + "kCurrentDataVersion": 167 }, // The following engines are included in country lists and are added to the @@ -64,13 +66,25 @@ "name": "Bing", "keyword": "bing.com", "favicon_url": "https://www.bing.com/sa/simg/bing_p_rr_teal_min.ico", - "search_url": "https://www.bing.com/search?q={searchTerms}&PC=U316&FORM=CHROMN", - "suggest_url": "https://www.bing.com/osjson.aspx?query={searchTerms}&language={language}&PC=U316", + "search_url": "https://www.bing.com/search?q={searchTerms}", + "suggest_url": "https://www.bing.com/osjson.aspx?query={searchTerms}&language={language}", "image_url": "https://www.bing.com/images/detail/search?iss=sbiupload&FORM=CHROMI#enterInsights", "new_tab_url": "https://www.bing.com/chrome/newtab", "image_url_post_params": "imageBin={google:imageThumbnailBase64}", "type": "SEARCH_ENGINE_BING", - "id": 3 + "id": 3, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "PC=U316&FORM=CHROMN", + "suggest_params": "PC=U316" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "PC=U534&FORM=U534DF", + "suggest_params": "PC=U534&FORM=U534SS" + } + ] }, "brave": { @@ -110,18 +124,30 @@ "suggest_url": "https://duckduckgo.com/ac/?q={searchTerms}&type=list", "new_tab_url": "https://duckduckgo.com/chrome_newtab", "type": "SEARCH_ENGINE_DUCKDUCKGO", - "id": 92 + "id": 92, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "t=euandroid" + } + ] }, "ecosia": { "name": "Ecosia", "keyword": "ecosia.org", "favicon_url": "https://cdn.ecosia.org/assets/images/ico/favicon.ico", - "search_url": "https://www.ecosia.org/search?q={searchTerms}&addon=opensearch", - "suggest_url": "https://ac.ecosia.org/autocomplete?q={searchTerms}&type=list", + "search_url": "https://www.ecosia.org/search?q={searchTerms}", + "suggest_url": "https://ac.ecosia.org?q={searchTerms}&mkt={language}&type=list&language={language}", "new_tab_url": "https://www.ecosia.org/newtab/", "type": "SEARCH_ENGINE_ECOSIA", - "id": 101 + "id": 101, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "addon=opensearch" + } + ] }, // *** *** *** *** WARNING *** *** *** *** @@ -268,10 +294,22 @@ "name": "Qwant", "keyword": "qwant.com", "favicon_url": "https://www.qwant.com/favicon.ico", - "search_url": "https://www.qwant.com/?q={searchTerms}&client=opensearch", - "suggest_url": "https://api.qwant.com/api/suggest/?q={searchTerms}&client=opensearch", + "search_url": "https://www.qwant.com/?q={searchTerms}", + "suggest_url": "https://api.qwant.com/api/suggest/?q={searchTerms}", "type": "SEARCH_ENGINE_QWANT", - "id": 94 + "id": 94, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "client=cs-chrome", + "suggest_params": "client=opensearch" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "client=acs", + "suggest_params": "client=opensearch" + } + ] }, "seznam_cz": { @@ -282,7 +320,13 @@ "suggest_url": "https://suggest.seznam.cz/fulltext_ff?phrase={searchTerms}", "new_tab_url": "https://search.seznam.cz/newtab", "type": "SEARCH_ENGINE_SEZNAM", - "id": 25 + "id": 25, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "sourceid=srch_ga_cs" + } + ] }, // TODO(b/335397380): Remove this entry once b/322513019 is fixed. @@ -294,7 +338,13 @@ "suggest_url": "https://suggest.seznam.cz/fulltext_ff?phrase={searchTerms}", "new_tab_url": "https://search.seznam.cz/newtab", "type": "SEARCH_ENGINE_SEZNAM", - "id": 25 + "id": 25, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "sourceid=srch_ga_cs" + } + ] }, "so_360": { @@ -349,10 +399,22 @@ "name": "Yahoo! \u00d6sterreich", "keyword": "at.yahoo.com", "favicon_url": "https://at.search.yahoo.com/favicon.ico", - "search_url": "https://at.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", - "suggest_url": "https://at.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", + "search_url": "https://at.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", + "suggest_url": "https://at.search.yahoo.com/sugg/chrome?output=fxjson&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_au": { @@ -419,10 +481,22 @@ "name": "Yahoo! Deutschland", "keyword": "de.yahoo.com", "favicon_url": "https://de.search.yahoo.com/favicon.ico", - "search_url": "https://de.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", - "suggest_url": "https://de.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", + "search_url": "https://de.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", + "suggest_url": "https://de.search.yahoo.com/sugg/chrome?output=fxjson&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, // For regional Yahoo variants without a region-specific suggestion service, @@ -432,48 +506,108 @@ "name": "Yahoo! Danmark", "keyword": "dk.yahoo.com", "favicon_url": "https://dk.search.yahoo.com/favicon.ico", - "search_url": "https://dk.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://dk.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_emea": { "name": "Yahoo Search", "keyword": "emea.yahoo.com", "favicon_url": "https://search.yahoo.com/favicon.ico", - "search_url": "https://emea.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", - "suggest_url": "https://emea.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", + "search_url": "https://emea.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", + "suggest_url": "https://emea.search.yahoo.com/sugg/chrome?output=fxjson&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_es": { "name": "Yahoo Búsquedas", "keyword": "es.yahoo.com", "favicon_url": "https://es.search.yahoo.com/favicon.ico", - "search_url": "https://es.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", - "suggest_url": "https://es.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", + "search_url": "https://es.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", + "suggest_url": "https://es.search.yahoo.com/sugg/chrome?output=fxjson&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_fi": { "name": "Yahoo! Suomi", "keyword": "fi.yahoo.com", "favicon_url": "https://fi.search.yahoo.com/favicon.ico", - "search_url": "https://fi.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://fi.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_fr": { "name": "Yahoo Recherche", "keyword": "fr.yahoo.com", "favicon_url": "https://fr.search.yahoo.com/favicon.ico", - "search_url": "https://fr.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", - "suggest_url": "https://fr.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", + "search_url": "https://fr.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", + "suggest_url": "https://fr.search.yahoo.com/sugg/chrome?output=fxjson&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_hk": { @@ -510,10 +644,22 @@ "name": "Ricerca di Yahoo", "keyword": "it.yahoo.com", "favicon_url": "https://it.search.yahoo.com/favicon.ico", - "search_url": "https://it.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", - "suggest_url": "https://it.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", + "search_url": "https://it.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", + "suggest_url": "https://it.search.yahoo.com/sugg/chrome?output=fxjson&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_jp": { @@ -550,10 +696,22 @@ "name": "Yahoo! Nederland", "keyword": "nl.yahoo.com", "favicon_url": "https://nl.search.yahoo.com/favicon.ico", - "search_url": "https://nl.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", - "suggest_url": "https://nl.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", + "search_url": "https://nl.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", + "suggest_url": "https://nl.search.yahoo.com/sugg/chrome?output=fxjson&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_nz": { @@ -590,9 +748,21 @@ "name": "Yahoo! Sverige", "keyword": "se.yahoo.com", "favicon_url": "https://se.search.yahoo.com/favicon.ico", - "search_url": "https://se.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://se.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_sg": { @@ -638,10 +808,22 @@ "name": "Yahoo Search", "keyword": "uk.yahoo.com", "favicon_url": "https://uk.search.yahoo.com/favicon.ico", - "search_url": "https://uk.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", - "suggest_url": "https://uk.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", + "search_url": "https://uk.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&p={searchTerms}", + "suggest_url": "https://uk.search.yahoo.com/sugg/chrome?output=fxjson&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", - "id": 2 + "id": 2, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "fr=crmas", + "suggest_params": "appid=crmas" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=yset_eu_chr_googchoic", + "suggest_params": "appid=gglandreucrmas" + } + ] }, "yahoo_ve": { @@ -682,12 +864,24 @@ "name": "Yandex", "keyword": "yandex.com", "favicon_url": "https://yastatic.net/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico", - "search_url": "https://yandex.com/search/?text={searchTerms}&from=os&clid=1836588", - "suggest_url": "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}&uil=en&v=3&sn=5", + "search_url": "https://yandex.com/{yandex:searchPath}?text={searchTerms}", + "suggest_url": "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}", "image_url": "https://yandex.com/images/search?rpt=imageview", "image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1", "type": "SEARCH_ENGINE_YANDEX", - "id": 15 + "id": 15, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kDefault", + "search_params": "from=os&clid=1836588", + "suggest_params": "uil=en&v=3&sn=5" + }, + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "clid=5143284", + "suggest_params": "uil=en" + } + ] }, "yandex_kz": { @@ -790,7 +984,7 @@ "favicon_url": "http://static.mediacentrum.sk/katalog/atlas.sk/images/favicon.ico", "search_url": "https://hladaj.atlas.sk/fulltext/?phrase={searchTerms}", "alternate_urls": [ - "http://hladaj.atlas.sk/fulltext/?phrase={searchTerms}" + "http://hladaj.atlas.sk/fulltext/?phrase={searchTerms}" ], "type": "SEARCH_ENGINE_ATLAS", "id": 27 @@ -841,7 +1035,7 @@ "favicon_url": "https://www.delfi.lt/favicon.ico", "search_url": "https://www.delfi.lt/paieska/?q={searchTerms}", "alternate_urls": [ - "http://www.delfi.lt/paieska/?q={searchTerms}" + "http://www.delfi.lt/paieska/?q={searchTerms}" ], "type": "SEARCH_ENGINE_DELFI", "id": 45 @@ -895,6 +1089,7 @@ "favicon_url": "https://www.givero.com/favicon.ico", "search_url": "https://www.givero.com/search?q={searchTerms}", "suggest_url": "https://www.givero.com/suggest?q={searchTerms}", + "new_tab_url": "https://givero.com/new_tab", "type": "SEARCH_ENGINE_GIVERO", "id": 95 }, @@ -1090,7 +1285,14 @@ "suggest_url": "https://api.oceanhero.today/suggestions?q={searchTerms}", "new_tab_url": "https://oceanhero.today/home", "type": "SEARCH_ENGINE_OCEANHERO", - "id": 99 + "id": 99, + "regulatory_extensions": [ + { + "variant": "RegulatoryExtensionType::kAndroidEEA", + "search_params": "fr=ch_om", + "suggest_params": "fr=ch_om" + } + ] }, "ok": { @@ -1302,3 +1504,6 @@ "array_name": "kAllEngines" } } + +// LINT.ThenChange(//depot/google3/chrome/webstore/manifest/prepopulated_engines.json) +// Override using NO_IFTTT=cl/ diff --git a/src/components/search_engines/search_engine_countries-inc.cc b/src/components/search_engines/search_engine_countries-inc.cc index 48b8fa10..8c1cc21b 100644 --- a/src/components/search_engines/search_engine_countries-inc.cc +++ b/src/components/search_engines/search_engine_countries-inc.cc @@ -2,6 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifdef UNSAFE_BUFFERS_BUILD +// TODO(crbug.com/40285824): Remove this and convert code to safer constructs. +#pragma allow_unsafe_buffers +#endif + // NOTE: You should probably not change the data in this file without changing // |kCurrentDataVersion| in prepopulated_engines.json. See comments in // GetDataVersion() below! diff --git a/src/v8/BUILD.gn b/src/v8/BUILD.gn index 281df3c5..e02b7d2b 100644 --- a/src/v8/BUILD.gn +++ b/src/v8/BUILD.gn @@ -4,7 +4,7 @@ import("//build/config/android/config.gni") import("//build/config/arm.gni") -import("//build/config/simd_opt.gni") +import("//build/config/compiler_opt.gni") import("//build/config/coverage/coverage.gni") import("//build/config/dcheck_always_on.gni") import("//build/config/host_byteorder.gni")