diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/site_isolation/features.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/site_isolation/features.cc')
-rw-r--r-- | chromium/components/site_isolation/features.cc | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/chromium/components/site_isolation/features.cc b/chromium/components/site_isolation/features.cc new file mode 100644 index 00000000000..7d180987b95 --- /dev/null +++ b/chromium/components/site_isolation/features.cc @@ -0,0 +1,44 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/site_isolation/features.h" + +#include "build/build_config.h" + +namespace site_isolation { +namespace features { + +// Controls a mode for dynamically process-isolating sites where the user has +// entered a password. This is intended to be used primarily when full site +// isolation is turned off. To check whether this mode is enabled, use +// SiteIsolationPolicy::IsIsolationForPasswordSitesEnabled() rather than +// checking the feature directly, since that decision is influenced by other +// factors as well. +const base::Feature kSiteIsolationForPasswordSites { + "site-isolation-for-password-sites", +// Enabled by default on Android; see https://crbug.com/849815. Note that this +// should not affect Android Webview, which does not include this code. +#if defined(OS_ANDROID) + base::FEATURE_ENABLED_BY_DEFAULT +#else + base::FEATURE_DISABLED_BY_DEFAULT +#endif +}; + +// kSitePerProcessOnlyForHighMemoryClients is checked before kSitePerProcess, +// and (if enabled) can restrict if kSitePerProcess feature is checked at all - +// no check will be made on devices with low memory (these devices will have no +// Site Isolation via kSitePerProcess trials and won't activate either the +// control or the experiment group). The threshold for what is considered a +// "low memory" device is set (in MB) via a field trial param with the name +// defined below ("site-per-process-low-memory-cutoff-mb") and compared against +// base::SysInfo::AmountOfPhysicalMemoryMB(). +const base::Feature kSitePerProcessOnlyForHighMemoryClients{ + "site-per-process-only-for-high-memory-clients", + base::FEATURE_DISABLED_BY_DEFAULT}; +const char kSitePerProcessOnlyForHighMemoryClientsParamName[] = + "site-per-process-low-memory-cutoff-mb"; + +} // namespace features +} // namespace site_isolation |