0
Commit Graph

14 Commits

Author SHA1 Message Date
Robbie McElrath
eeda890542 Speculative fix for SiteIsolationPolicyTest on android
This adds a SiteIsolationPolicy::DisableFlagCachingForTesting(); call
that has fixed similar flag-related flakiness on other platforms.

Bug: 351023623
Change-Id: Ic56aa73a29a4c8239494746b947a9a9ed5baea3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5677330
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1323089}
2024-07-03 23:18:00 +00:00
Robbie McElrath
4e8596dd9e iwa: Remove --isolated-app-origins flag
This flag is deprecated now that IWAs are properly supported by dPWA
infrastructure.

Bug: 1412210
Change-Id: Iab2183e366ae682aa2abc2348b5bb37413e514e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4219393
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: Yann Dago <ydago@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1102400}
2023-02-07 21:59:13 +00:00
Dmitrii Kuragin
b7f90da446 iwa: Enable isolation level APIs for isolated-app:// URL Scheme
In browser client, define new `ShouldSchemeUseApplicationIsolationLevel`
method which force-enable application isolation level for
isolated-app:// scheme in Chrome.

Bug: 1333966
Change-Id: Ib0f568653a3e16fca30827b2b545c1d1b5d7a057
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3976550
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Auto-Submit: Dmitrii Kuragin <kuragin@chromium.org>
Commit-Queue: Dmitrii Kuragin <kuragin@chromium.org>
Reviewed-by: Chase Phillips <cmp@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1066725}
2022-11-02 22:09:30 +00:00
Dmitrii Kuragin
e2a9e69ce3 iwa: Remove IsApplicationIsolationLevelEnabled()
The --isolated-app-origins flag is being replaced by a feature
flag to enable Isolated Web Apps and the isolated-app:// scheme,
which will always indicate an origin is an IWA.

This means the IsApplicationIsolationLevelEnabled() method is
redundant and can be replaced with the kIsolatedWebApps feature
flag.

Existing tests which only set the original flag are updated.

Bug: 1333966
Change-Id: I0f2b0ab9fb9e3711396d7a437778572d6db5a226
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3971977
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Auto-Submit: Dmitrii Kuragin <kuragin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1065053}
2022-10-28 21:49:07 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Reilly Grant
8a471ec271 Rename kRestrictedApiOrigins to kIsolatedAppOrigins
This flag is now broader than enabling in-development APIs. It enables
all the Isolated App behaviors for a set of origins.

Bug: 1266823
Change-Id: Ied096794e3b44a18d34a151aebf15d00f5d82520
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3589082
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#993448}
2022-04-18 21:37:35 +00:00
Robbie McElrath
8fa4c93628 Move kRestrictedApiOrigins parsing logic to SiteIsolationPolicy::ShouldUrlUseApplicationIsolationLevel
This CL moves the kRestrictedApiOrigins parsing logic from
ChromeContentBrowserClient to content::SiteIsolationPolicy, and updates
all isolated app runtime enforcement logic to be gated on the new
function.

After this CL, enabling isolated apps will require passing the app's
origin in the --restricted-api-origins flag, as well as having installed
a PWA on that origin with the isolated_storage flag set to true in its
manifest.

The new SiteIsolationPolicy::ShouldUrlUseApplicationIsolationLevel
function will check whether the given URL matches an origin specified in
kRestrictedApiOrigins, and then will delegate to
ContentBrowserClient::ShouldUrlUseApplicationIsolationLevel, which
allows content embedders to provide additional requirements, such as
having an installed PWA for //chrome.

Finally, this updates the kRestrictedApiOrigins parsing logic to remove
the port from any origins specified. This means that if localhost:1234
is specified, any localhost port could be treated as matching the flag's
value. This change was made because the site isolation system ignores
ports when computing site urls by default. Long term this requirement
will go away, but this will allow for shorter term testing.

Bug: 1280777
Change-Id: Id71aed55ffc564443544615113b50dbfa3b40cbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3434586
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Phillis Tang <phillis@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/main@{#971028}
2022-02-15 03:55:11 +00:00
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Robbie McElrath
478985129b Disable SiteIsolationPolicy flag caching in unit tests.
This CL fixes flakiness introduced by caching the kDisableSiteIsolation
flag in SiteIsolationPolicy. See crbug.com/1231659 for more details.

Bug: 1231659, 1223206
Change-Id: I6e69e7e80af65d674b25c796f37087a3574d3a44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3044234
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#904049}
2021-07-21 21:09:39 +00:00
John Abd-El-Malek
59eacd67e9 Move a few test files out of content/public.
This keeps the public directory just for the API. Tests, like other implementation details, are hidden out of it. Also add comment to document this.

Also remove injection_test_win.h which is no longer used.

Change-Id: I89d43d6f473253a6fb890df9e50728169aac2389
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2739143
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#866931}
2021-03-26 07:26:16 +00:00
Nick Carter
bf6264a504 Allow extension process reuse in --site-per-process;
make SiteIsolationPolicy public.

The problem was that --site-per-process disabled extension
process sharing, but the site-per-process base::Feature (which
we've been field trialing) did not. This was due to the
extensions code checking only for the flag, and not considering
the field trial state as well.

components/printing actually got the logic right, but only by
reproducing a lot of business logic. Thus, it seems
appropriate to move SiteIsolationPolicy to content/public,
so that we can centralize the "what kind of oopifs are there"
logic. For printing, this change adds a new getter function
specific to oopif compositor, since that's basically a
derived policy of the process model.

For extensions, we've decided to disable LockToOrigin in
--site-per-process (rather than to enable it in the feature),
since origin-locking extensions doesn't help with the spectre
threat, and --site-per-process is about spectre these days.
[Charlie suggests we develop some kind of "extension isolation v2"
proposal, maybe reviving the --isolate-extension flag for that
purpose!]

Bug: 824966, 766267

Change-Id: Ibf7592c9d522fd0c99057358bcc34b5881780db8
Reviewed-on: https://chromium-review.googlesource.com/949966
Commit-Queue: Nick Carter <nick@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Wei Li <weili@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548645}
2018-04-06 02:39:33 +00:00
Lukasz Anforowicz
bb0cfd5e6b [reland] Move site_isolation_policy from content/common to .../browser.
The move allows returning
ContentBrowserClient::GetOriginsRequiringDedicatedProcess from
SiteIsolationPolicy::GetIsolatedOrigins.

No expected behavior change.

This is a "reland" of r521893 (which got reverted in r521907).

Bug: 792162
Change-Id: I87cd203a12f1f5784dd9aa2745064a2b96532336
Tbr: alexmos@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/827537
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524208}
2017-12-14 22:39:46 +00:00
Charlie Reis
a2e1ab5c19 Revert "Move site_isolation_policy from content/common to content/browser."
This reverts commit 1aed2aaf6d.

Reason for revert: Causing merge conflicts on a CL that needs to be merged.  (See https://crbug.com/786505.)  Can land again afterward.

Original change's description:
> Move site_isolation_policy from content/common to content/browser.
> 
> The move allows returning
> ContentBrowserClient::GetOriginsRequiringDedicatedProcess from
> SiteIsolationPolicy::GetIsolatedOrigins.
> 
> No expected behavior change.
> 
> Bug: 792162
> Change-Id: Idd79fbddf138c2043ff1811a2d3d58165bcb198b
> Reviewed-on: https://chromium-review.googlesource.com/794303
> Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#521893}

TBR=alexmos@chromium.org,lukasza@chromium.org

Change-Id: I419b78c56adb2126eb93367e29bc569a004308f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 792162
Reviewed-on: https://chromium-review.googlesource.com/810012
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521907}
2017-12-06 00:03:13 +00:00
Lukasz Anforowicz
1aed2aaf6d Move site_isolation_policy from content/common to content/browser.
The move allows returning
ContentBrowserClient::GetOriginsRequiringDedicatedProcess from
SiteIsolationPolicy::GetIsolatedOrigins.

No expected behavior change.

Bug: 792162
Change-Id: Idd79fbddf138c2043ff1811a2d3d58165bcb198b
Reviewed-on: https://chromium-review.googlesource.com/794303
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521893}
2017-12-05 23:30:14 +00:00