Commit f3538a2f authored by Alex Moshchuk's avatar Alex Moshchuk Committed by Commit Bot

Disable Opt-in origin isolation on Android Webview.

This CL makes ShouldDisableSiteIsolation() return true on Android
Webview.  This will turns off features like opt-in origin isolation that
rely on site isolation and OOPIFs on that platform, much like we also
turn them off on Chrome for Android when below a memory threshold.

Change-Id: I827ff79bd9955b90a58986ec0e1552743c194331
Bug: 1147327
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2528307
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Reviewed-by: default avatarJames MacLean <wjmaclean@chromium.org>
Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826051}
parent c23db0bf
......@@ -881,14 +881,22 @@ bool AwContentBrowserClient::ShouldEnableStrictSiteIsolation() {
// TODO(lukasza): When/if we eventually add OOPIF support for AW we should
// consider running AW tests with and without site-per-process (and this might
// require returning true below). Adding OOPIF support for AW is tracked by
// https://crbug.com/869494.
// https://crbug.com/806404.
return false;
}
bool AwContentBrowserClient::ShouldDisableSiteIsolation() {
// Since AW does not yet support OOPIFs, we must return true here to disable
// features that may trigger OOPIFs, such as origin isolation.
//
// Adding OOPIF support for AW is tracked by https://crbug.com/806404.
return true;
}
bool AwContentBrowserClient::ShouldLockProcessToSite(
content::BrowserContext* browser_context,
const GURL& effective_url) {
// TODO(lukasza): https://crbug.cmo/869494: Once Android WebView supports
// TODO(lukasza): https://crbug.com/806404: Once Android WebView supports
// OOPIFs, we should remove this ShouldLockProcess overload. Till then,
// returning false helps avoid accidentally applying citadel-style Site
// Isolation enforcement to Android WebView (and causing incorrect renderer
......
......@@ -189,6 +189,7 @@ class AwContentBrowserClient : public content::ContentBrowserClient {
NonNetworkURLLoaderFactoryMap* factories) override;
bool ShouldIsolateErrorPage(bool in_main_frame) override;
bool ShouldEnableStrictSiteIsolation() override;
bool ShouldDisableSiteIsolation() override;
bool ShouldLockProcessToSite(content::BrowserContext* browser_context,
const GURL& effective_url) override;
bool WillCreateURLLoaderFactory(
......
......@@ -552,14 +552,17 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual std::vector<url::Origin> GetOriginsRequiringDedicatedProcess();
// Allows the embedder to programmatically control whether the
// --site-per-process mode of Site Isolation should be used.
// --site-per-process mode of Site Isolation should be used. Note that
// returning true here will only take effect if ShouldDisableSiteIsolation()
// below returns false.
//
// Note that for correctness, the same value should be consistently returned.
// See also https://crbug.com/825369
virtual bool ShouldEnableStrictSiteIsolation();
// Allows the embedder to programmatically control whether Site Isolation
// should be disabled.
// should be disabled. Note that this takes precedence over
// ShouldEnableStrictSiteIsolation() if both return true.
//
// Note that for correctness, the same value should be consistently returned.
virtual bool ShouldDisableSiteIsolation();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment