Update chrome_content_browser_client.cc

This commit is contained in:
Alexander David Frick 2022-07-30 13:32:30 -05:00 committed by GitHub
parent 2070459eb6
commit f4a4ad0826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,7 +58,6 @@
#include "chrome/browser/extensions/chrome_extension_cookies.h"
#include "chrome/browser/external_protocol/external_protocol_handler.h"
#include "chrome/browser/favicon/favicon_utils.h"
#include "chrome/browser/first_party_sets/first_party_sets_pref_names.h"
#include "chrome/browser/font_family_cache.h"
#include "chrome/browser/gpu/chrome_browser_main_extra_parts_gpu.h"
#include "chrome/browser/hid/chrome_hid_delegate.h"
@ -87,16 +86,16 @@
#include "chrome/browser/plugins/plugin_utils.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/prefetch/prefetch_prefs.h"
#include "chrome/browser/prefetch/prefetch_proxy/chrome_prefetch_service_delegate.h"
#include "chrome/browser/prefetch/prefetch_proxy/chrome_speculation_host_delegate.h"
#include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_features.h"
#include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_service.h"
#include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_service_factory.h"
#include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_url_loader_interceptor.h"
#include "chrome/browser/preloading/navigation_ablation_throttle.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/chrome_no_state_prefetch_contents_delegate.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_manager_factory.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_navigation_throttle.h"
#include "chrome/browser/preloading/prefetch/prefetch_proxy/chrome_prefetch_service_delegate.h"
#include "chrome/browser/preloading/prefetch/prefetch_proxy/chrome_speculation_host_delegate.h"
#include "chrome/browser/preloading/prefetch/prefetch_proxy/prefetch_proxy_features.h"
#include "chrome/browser/preloading/prefetch/prefetch_proxy/prefetch_proxy_service.h"
#include "chrome/browser/preloading/prefetch/prefetch_proxy/prefetch_proxy_service_factory.h"
#include "chrome/browser/preloading/prefetch/prefetch_proxy/prefetch_proxy_url_loader_interceptor.h"
#include "chrome/browser/preloading/prefetch/search_prefetch/field_trial_settings.h"
#include "chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_url_loader.h"
#include "chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_url_loader_interceptor.h"
@ -580,7 +579,6 @@
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/child_accounts/time_limits/web_time_limit_navigation_throttle.h"
#include "chrome/browser/chromeos/app_mode/kiosk_settings_navigation_throttle.h"
#include "chrome/browser/speech/tts_controller_delegate_impl.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@ -4257,11 +4255,14 @@ bool ChromeContentBrowserClient::PreSpawnChild(
if (result != sandbox::SBOX_ALL_OK)
return false;
if (policy->GetConfig()->IsConfigured())
return true;
// Allow loading Chrome's DLLs.
for (const auto* dll : {chrome::kBrowserResourcesDll, chrome::kElfDll}) {
result = policy->AddRule(sandbox::SubSystem::kSignedBinary,
sandbox::Semantics::kSignedAllowLoad,
GetModulePath(dll).value().c_str());
result = policy->GetConfig()->AddRule(sandbox::SubSystem::kSignedBinary,
sandbox::Semantics::kSignedAllowLoad,
GetModulePath(dll).value().c_str());
if (result != sandbox::SBOX_ALL_OK)
return false;
}
@ -4369,12 +4370,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
page_load_metrics::MetricsNavigationThrottle::Create(handle));
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
MaybeAddThrottle(
ash::WebTimeLimitNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
MaybeAddThrottle(
SupervisedUserNavigationThrottle::MaybeCreateThrottleFor(handle),
@ -6642,21 +6637,6 @@ bool ChromeContentBrowserClient::WillProvidePublicFirstPartySets() {
base::FeatureList::IsEnabled(features::kFirstPartySets);
}
base::Value::Dict ChromeContentBrowserClient::GetFirstPartySetsOverrides() {
if (!g_browser_process) {
// If browser process doesn't exist (e.g. in minimal mode on Android),
// we can't provide any overrides.
return base::Value::Dict();
}
PrefService* local_state = g_browser_process->local_state();
if (!local_state || !local_state->FindPreference(
first_party_sets::kFirstPartySetsOverrides)) {
return base::Value::Dict();
}
return local_state->GetValueDict(first_party_sets::kFirstPartySetsOverrides)
.Clone();
}
content::mojom::AlternativeErrorPageOverrideInfoPtr
ChromeContentBrowserClient::GetAlternativeErrorPageOverrideInfo(
const GURL& url,