#include "content/public/browser/site_isolation_policy.h"
#include <algorithm>
#include <iterator>
#include <string>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/containers/flat_set.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/metrics/field_trial_params.h"
#include "base/no_destructor.h"
#include "base/strings/string_split.h"
#include "build/build_config.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/site_isolation_mode.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/switches.h"
#include "url/origin.h"
namespace content {
namespace {
bool g_disable_flag_caching_for_tests = …;
bool IsDisableSiteIsolationFlagPresent() { … }
#if BUILDFLAG(IS_ANDROID)
bool IsDisableSiteIsolationForPolicyFlagPresent() {
static const bool site_isolation_disabled_by_policy =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableSiteIsolationForPolicy);
if (g_disable_flag_caching_for_tests) {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableSiteIsolationForPolicy);
}
return site_isolation_disabled_by_policy;
}
#endif
bool IsSiteIsolationDisabled(SiteIsolationMode site_isolation_mode) { … }
}
bool SiteIsolationPolicy::UseDedicatedProcessesForAllSites() { … }
bool SiteIsolationPolicy::AreIsolatedSandboxedIframesEnabled() { … }
bool SiteIsolationPolicy::AreIsolatedOriginsEnabled() { … }
bool SiteIsolationPolicy::IsStrictOriginIsolationEnabled() { … }
bool SiteIsolationPolicy::IsErrorPageIsolationEnabled(bool in_main_frame) { … }
bool SiteIsolationPolicy::AreDynamicIsolatedOriginsEnabled() { … }
bool SiteIsolationPolicy::ArePreloadedIsolatedOriginsEnabled() { … }
bool SiteIsolationPolicy::IsProcessIsolationForOriginAgentClusterEnabled() { … }
bool SiteIsolationPolicy::IsOriginAgentClusterEnabled() { … }
bool SiteIsolationPolicy::AreOriginKeyedProcessesEnabledByDefault() { … }
bool SiteIsolationPolicy::AreOriginAgentClustersEnabledByDefault(
BrowserContext* browser_context) { … }
bool SiteIsolationPolicy::IsSiteIsolationForCOOPEnabled() { … }
bool SiteIsolationPolicy::ShouldPersistIsolatedCOOPSites() { … }
std::string SiteIsolationPolicy::GetIsolatedOriginsFromCommandLine() { … }
std::string SiteIsolationPolicy::GetIsolatedOriginsFromFieldTrial() { … }
void SiteIsolationPolicy::ApplyGlobalIsolatedOrigins() { … }
bool SiteIsolationPolicy::ShouldUrlUseApplicationIsolationLevel(
BrowserContext* browser_context,
const GURL& url) { … }
void SiteIsolationPolicy::DisableFlagCachingForTesting() { … }
bool SiteIsolationPolicy::IsProcessIsolationForFencedFramesEnabled() { … }
}