0
Commit Graph

51 Commits

Author SHA1 Message Date
Emily Andrews
d15fd76ecb Change RenderProcessHost::GetID to RenderProcessHost::GetDeprecatedID
This change bulk changes RenderProcessHost::GetID to
RenderProcessHost::GetDeprecatedID to support the transition to a
strongly typed ChildProcessId.

Bug: 379869738
Change-Id: Ib0c991536486ef29702ea166cdcf12ea68ed70ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6065543
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Emily Andrews <emiled@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1394500}
2024-12-10 20:41:54 +00:00
Alex Moshchuk
989aa22c05 Add committed origin tracking and enforcements to ChildProcessSecurityPolicy.
ChildProcessSecurityPolicy::CanAccessDataForOrigin is the main API for
performing site isolation enforcements, deciding whether a renderer
process is allowed to access data for a particular origin. The
implementation of this check (in CanAccessMaybeOpaqueOrigin) is
currently shared for three different kinds of checks and has gotten
very complicated over the years, trying to compute an expected process
lock from the provided URL and compare it to the actual process lock,
while accounting for things like whether the URL's origin should use
origin vs site isolation.

This CL is a first step towards simplifying this implementation by
providing an alternate mechanism for implementing
CanAccessDataForOrigin (CADFO). Namely, we can track all origins ever
committed for a particular process, and then only allow access to data
for origins that have been committed, because they have already been
validated at commit time. This subsumes the current process lock
checks, since CADFO only ever used the origin comparison and ignored
the other ProcessLock/SiteInfo bits, artificially making them match in
the expected and actual locks (see
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/child_process_security_policy_impl.cc;l=2050-2065;drc=f522344e45882da4c7f7cb1b3a0a7bd747d654bb).

This new check is only useful for kHostsOrigin and
kCanAccessDataForCommittedOrigin checks (i.e., whether an origin was
previously committed in a process, and whether the process can access
data belonging to an already committed origin). It cannot be used for
kCanCommitNewOrigin checks that decide whether a new origin should be
allowed to commit in a particular process. These will still use the
process lock comparisons for now.

For implementation, SecurityState now tracks a set of committed
origins. Committed origins for navigations are added in
RFHI::UpdatePermissionsForNavigation() at ready-to-commit time and in
Navigator::DidNavigate() at DidCommit time. The former is sufficient
in vast majority of cases, but the latter is still needed in cases
like adding a sandboxed about:blank iframe, where a new opaque origin
is introduced into the parent's process (OOPSIFs aren't used in this
case), but this doesn't go through the full navigation flow and
doesn't hit UpdatePermissionsForNavigation(). Committed origins are
also added when creating ServiceWorkers. For now, other workers are
assumed to stay in the origin of their creator document; there is a
corner case where this isn't true (workers created via a data: URL),
but this will be fixed in a followup.

The set of committed origins can only grow; for simplicity, there is
currently no provision to revoke a committed origin. The hope is that
this set won't grow overly large; but this may need to be
revisited. Metrics to track the size of this set will be added in a
followup CL.

This does cause a slight behavior change where a process that no
longer has any documents or workers could be denied access with the
older checks, but would still be allowed access for the older origins
with the new checks. This is covered in
DynamicIsolatedOriginTest.NewBrowsingInstanceInOldProcess, where an
origin becomes dynamically isolated, and a process previously lost
access to that origin as soon as the last BrowsingInstance where the
origin was not isolated is removed from the process, but now that
access is maintained. For now, we don't consider this to be a
meaningful decrease in security, as it's hard for the attacker to take
advantage of, but this could be revisited in the future, e.g., by
marking newly isolated origins as needing revocation when their last
instance goes away from a process.

The new checks are also slightly stricter than the old checks because
they will compare the full origins, rather than the ProcessLocks
computed from them. So, for example, if https://foo.com/ was committed
and isolated at a site granularity, requests for data from
https://sub.foo.com would now be blocked. Also, port mismatches in
origins are no longer ignored. So, if https://foo.com:1234 has
committed, requests for https://foo.com:5678 would now be denied,
whereas they would be allowed by jail/citadel checks previously (since
the ProcessLock computation ignores ports).

The enforcements of the new checks (where they replace jail and
citadel checks) are behind a feature which is off by default.
Nonetheless, all affected existing tests have been fixed to pass with
the checks on. ChildProcessSecurityPolicy tests have been
parameterized to run both with and without the new checks. When the
new checks disagree with the jail/citadel checks, we generate a
DumpWithoutCrashing report to collect more information. (Some of these
cases, like port mismatches, will be expected, as explained above.)

Bug: 40148776
Change-Id: Id31c4130ef1f8b9936b27bddb4658641fca7ffde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5410347
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1378730}
2024-11-06 02:09:07 +00:00
Avi Drissman
bbf980f853 Eliminate IPC no longer needed on macOS
In macOS 10.14 and earlier, ftruncate was not allowed from the
sandbox. Starting with macOS 10.15, it has been.

To work around this issue, an IPC was added to Chromium to do an
ftruncate outside of the sandbox on behalf of a renderer unable to do
so due to this sandbox issue.

Chromium requires macOS 10.15+, so this IPC is no longer needed.
Therefore, remove it.

Bug: 40693199
Bug: 40254578
Change-Id: I3405a26cdf507a5a1c26c265dfadcb738a2bfecb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756685
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1336256}
2024-08-01 21:06:14 +00:00
Alison Gale
770f3fce37 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ibc66b8c440e4bcdef414e77fef4d9874d2ea9951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5493800
Auto-Submit: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1293330}
2024-04-27 00:39:58 +00:00
Ayu Ishii
466bc808af WebSQL: Remove session data logic
On Profile destruction, currently there is a race with
the DatabaseTracker shutdown. DatabaseTracker shutdown
will post task[1] on the database task runner because
it needs to do file I/O. However it also has some logic
to retrieve info for special storage policies from the
Profile which may already be destroyed by that time.

This change removes logic for special storage policy from
DatabaseTracker. DatabaseTracker(WebSQL) is removed
from all platforms as of M119 except for WebView, which does
not utilize the special storage policy. All policy and
deprecation support have ended with M123. Therefore cleaning
up the code to avoid the race.

[1]https://source.chromium.org/chromium/chromium/src/+/main:content/browser/storage_partition_impl.cc;l=1200;drc=be92f4cc2f137460213d52a926c9477275a456c5

Bug: 323898565, 325476286
Change-Id: Ie2ef898c558308439a8b0d3fdf67f7157440b20a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5288855
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1276451}
2024-03-21 20:06:29 +00:00
Jeff Yoon
d1328c4408 [buganizer] Migrate DIR_METADATA in content/browser/
Migrate all metadata files for content/browser.

Verify components with http://b/components/{id} or at
go/chrome-on-buganizer-prod-components.

Bug: chromium:1518875
Change-Id: I555b9fe40952a5707e167b3dcbaf2858bbdf1f34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5284095
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258966}
2024-02-11 19:24:26 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Peter Kasting
4184e2582e Use new facilities for base::expected: content/
Bug: 1424513
Change-Id: Ib5159f8ff5e2f23a6d30ea0d5885f0524f71e64d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4754959
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1180050}
2023-08-06 12:39:40 +00:00
Nathan Memmott
b0724f02ea Fix content_unittests leaving behind db files
Passes a temp path to the db tracker so that the files it creates aren't
left behind.

Fixed: 1465884
Change-Id: I91828d92ac5e73c90cfa26fcd6fb4172af8b159f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4695437
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1171922}
2023-07-18 19:23:05 +00:00
W. James MacLean
e66843c983 Refactor to store default isolation state in IsolationContext.
This CL is a refactor to store the default OriginAgentIsolationState
in the IsolationContext owned by a BrowsingInstance. By doing this at
the creation of the BrowsingInstance, we snapshot the default in case it
dynamically changes (e.g. via a change in the value of the enterprise
policy OriginAgentClusterDefaultEnabled).

This refactor also allows CanAccessDataForOrigin access to a
BrowsingInstance's default isolation state so that it can appropriately
construct the expected_process_lock. This is potentially a behavior
change, but only after we introduce process-isolated default OAC in a
follow-on CL.

Bug: 1421329
Change-Id: I7829c151365b685c724f79e8d40c56dd27ec5819
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4427512
Commit-Queue: James Maclean <wjmaclean@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1136085}
2023-04-26 19:15:57 +00:00
Peter Kasting
9bae86fcdb Misc. cleanup.
* Use local lambdas to avoid code duplication on exit paths.
* Checking the value() or error() of an `expected` or `optional` must
  ASSERT whether it has_value() first, or the test can crash.
* Shorten code.
* Use `expected` monadic ops.

Bug: none
Change-Id: Ic784142d865f1b748c53b45f0f005e9d746d6ad3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4475965
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1136026}
2023-04-26 17:50:33 +00:00
Alex Moshchuk
71ca2903b6 Run ChildProcessSecurityPolicyTests with and without Citadel enforcements.
Until the kill switch for citadel enforcements is removed, this will
provide some test coverage both with and without Citadel enforcements.

This also involves tweaking some tests to do proper cleanup, to allow
them to run twice in a row without breaking.

Bug: 764958
Change-Id: Icd4b4dee0d80ac4247b2badd40db5c3b82039d7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4396425
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1127681}
2023-04-07 18:08:37 +00:00
Claudio DeSouza
708aede884 [CodeHealth] Converting QuotaErrorOr to base::expected
This CL replaces the use of the existing QuotaErrorOr class with a
simpler base::expected alias.

Bug: 1380088
Change-Id: I2866f189b11efb1bb7862adf901375b3862ab2c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4266333
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Claudio DeSouza <cdesouza@igalia.com>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1109721}
2023-02-24 19:32:58 +00:00
Ari Chivukula
c81e13e937 [StorageKey Cleanup] (2) Rename CreateFirstParty constructors
FOR REVIEWERS - This is a large CL, sorry about that. Please review just
the files you're an owner for. In almost all cases, the changes should
be minimal and straightforward.

There's a need to keep StorageKey and BlinkStorageKey partial sync, but
as each organically grew this has gotten lost. As we wrap up and launch
storage partitioning, we should leave this code in a good state.

This CL swaps out the origin constructor for a new static function
called CreateFirstParty. The reason for this is to ensure callsites know
that they are explicitly creating a first-party only StorageKey and
might be missing context important to partition storage. Further, if in
the future we were to want to deprecate this construction method in
prod, we would need a static function we could re-name like this
and so migrating to this style of syntax will make that easier.

This CL is part of a series:
(1) Organize public functions and map work
(2) Rename CreateFirstParty constructors
(3) Rename CreateWithNonce constructors
(4) Rename Create constructors
(5) Remove old test constructors
(6) Define opaque origin behavior

Bug: 1410254
Change-Id: I0be1305f91a454484c68d0faf4015bad3afe05ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4251237
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Steven Bingler <bingler@chromium.org>
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1105850}
2023-02-15 20:44:57 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +00:00
Sean Maher
e672a665ff task posting v3: remove includes of runner handles and IWYU task runners
Turns out there's a lot of includes, so these will have to be removed
before deleting the implementation of the task runner handles.

To allow the deletion of the task runner handle headers, add
the sequenced/thread task runner handles where they are used in
the codebase with scripts.

This was done with an automated change, with a few touchups afterwards.
The code for the mass-refactor changes are here:
python:
https://paste.googleplex.com/5534570878337024
shell:
https://paste.googleplex.com/6466750748033024

In terms of touchups:
- add sequenced/thread task runner handles to
  the third_party/blink/public/DEPS, because multiple files were using
  it transitively anyways.
- rewrite certain parts of the codebase which used
  ThreadTaskRunnerHandles instead of CurrentDefaultHandles.
- fix a compile issue with forward-declaration in
  extensions/browser/extension_file_task_runner.h.

AX-Relnotes: n/a.
Bug: 1026641
Change-Id: I737ef32aee4e77c21eaa3a2bdc403a28322cf1b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4133323
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sean Maher <spvw@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1090532}
2023-01-09 21:42:28 +00:00
Sean Maher
5b9af51fdd task posting v3: moving away from ThreadTaskRunnerHandle
To continue the migration away from TaskRunnerHandles, the codebase
was refactored using the following scripts:
shell script:
https://paste.googleplex.com/4673967729147904
python:
https://paste.googleplex.com/5824001174667264

This will do a few sed-like modifications, changing calls to methods of
ThreadTaskRunnerHandle to calls to methods of
SingleThreadTaskRunner::CurrentDefaultHandle, and swapping includes.

Bug: 1026641
AX-Relnotes: n/a.
Change-Id: Ia33b6dfebb15937481c619f5c838720ce7bb2676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4031817
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1074085}
2022-11-21 15:32:47 +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
Adithya Srinivasan
f6377b1af5 [FencedFrames] Implement process isolation for fenced frames
This CL implements process isolation for fenced frames (isolating
fenced frames from their embedders) behind a flag. It adds an
'is_fenced' attribute to SiteInfo and IsolationContext to help enforce
this isolation. Having the is_fenced bit in IsolationContext is used to
maintain the same value of is_fenced for all related SiteInstances
created in a particular BrowsingInstance (e.g., for subframes of a
fenced frame).

The changes here currently only have an effect when
the flag is enabled and strict site isolation is enabled. Changes for
other site isolation modes will be in future CLs. See attached bug for
more details on design (design doc, explainer).

Bug: 1340662
Change-Id: I821943158286c9fa69639ad1156112bd74a4410e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3821704
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041755}
2022-08-31 21:58:44 +00:00
Evan Stade
08ebfd8e28 Storage buckets: plumb policy values through to database.
This also implements updating of policy values for pre-existing
buckets. Specifically, expiration and persistence can change if
they're specified in the buckets `open` API. Thus `GetOrCreateBucket`
becomes `UpdateOrCreateBucket`.

Test coverage is partially provided by WPT, e.g.
wpt_internal/storage/buckets/storage_bucket_object.tentative.https.any.sharedworker.html

Upcoming TODOs (for later patches):
* we should determine whether opening the "default" bucket with the
  API is allowed, and if so which operations it supports.
* expiration should be respected when `open` is called. That is, the
  bucket and its data should be clobbered and re-created if it's
  expired.

Bug: 1315393,1176774,1315392
Change-Id: Iaa57393f330434685e0b72b59037887768d5fb28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3609049
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1004971}
2022-05-18 21:42:13 +00:00
Evan Stade
ac470f52c0 Storage Buckets: introduce BucketInitParams
This struct is used to pass bucket metadata including policies
to the database on bucket creation. This facilitates non-default
buckets for Buckets API's open().

Change-Id: I232a2a29106b722758816b764ec38035219eeae6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3601258
Reviewed-by: Ben Kelly <wanderview@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999514}
2022-05-04 18:29:50 +00:00
Ayu Ishii
ae8dabae37 StorageBuckets: Re-add Error on GetOrCreateBucket
Revert of https://crbug.com/1306279

This change re-adds strict coupling of the QuotaDatabase
to Storage APIs originally added here (https://crbug.com/1266013)
Allowing Storage API access only on a successful bucket
retrieval/creation.

This unblocks storage API bucket integration development on main.

Between the revert and now, we have added mitigations to
reduce and better handle database corruption errors.
We have observed metrics that show that corruption rates
are in normal range starting M101 in Beta.
Summary: https://docs.google.com/document/d/1KSVw5wYqeBo7frlOreVzhFQaQQDMd377qX6yvy5LOgs/edit?usp=sharing

Bug: 1317419
Change-Id: Ibe8f361030f8fcb676e393d0d95fa2d6f983ea45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3531351
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#995349}
2022-04-22 21:15:13 +00:00
Ayu Ishii
a6856b5aee StorageBuckets: Ignore GetOrCreateBucket error for WebSQL
Reverts: https://crrev.com/c/3274860

Bug: 1306279
Change-Id: I0ad45b6b77530a54444a635c1b949e5a1fe2a776
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3522750
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#980891}
2022-03-15 00:49:25 +00:00
Victor Costan
b022702f77 Quota: Use MockSpecialStoragePolicy instead of a null policy.
QuotaManagerImpl (and its dependencies UsageTracker and
ClientUsageTracker) currently accept a null SpecialStoragePolicy. In the
interest of having tests match production as much as possible, the
allowance for null SpecialStoragePolicy is getting removed.

This CL switches some tests away from passing null SpecialStoragePolicy
to QuotaManagerImpl. Instead, a default-constructed
MockSpecialStoragePolicy is used. This should result in the same
behavior.

Bug: 1303409
Change-Id: Ife79f9594ba47cd93ae1bd0b47a26c57760d42f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3507394
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#978416}
2022-03-07 20:23:06 +00:00
Alex Moshchuk
df15d8e3c4 Introduce a feature for site isolation in <webview> guests
This CL adds initial support for enabling site isolation inside
<webview> guests.  This mode is behind a new feature called
SiteIsolationForGuests.

The overall approach is to stop using special chrome-guest: site URLs
when creating SiteInfos for guests.  Instead, site-isolated guests use
real site URLs that are computed with the existing process model code,
and rely on SiteInfo::storage_partition_config to keep navigations
within guests in the same StoragePartition and in guest SiteInstances.

This CL supports cross-process navigations in guests, OOPIFs, and
cross-BrowsingInstance navigations in guests.  A particular guest will
no longer be restricted to a single SiteInstance and BrowsingInstance,
though it will always stay in the same StoragePartition, and for all
SiteInstances in a guest, SiteInstance::IsGuest() will be true.

In the current SiteInstance assignment paths, there are various early
returns that make guests always in the same SiteInstance.  Those are
now only used when the new feature is off.  Since guests will now
descend much deeper into the SiteInstance assignment paths, we needed
an additional signal as to whether the new SiteInstance/SiteInfo would
be for a guest.  To do this, instead of plumbing an additional flag to
places like SiteInfo::CreateInternal, is_guest is added to
IsolationContext which is already plumbed into all the needed code
paths (see SiteInfo::CreateInternal for how it's used).  Conceptually,
IsolationContext::is_guest just says whether a particular
BrowsingInstance is for a guest or not, so that any related
SiteInstances within it stay in the guest.

To handle cross-BrowsingInstance navigations in guests,
SiteInstanceImpl::CreateForUrlInfo (which is normally used to create
a new SiteInstance in a new BrowsingInstance) is updated to be able to
handle guests, in which case the StoragePartition info needs to be
transferred into the new SiteInstance/BrowsingInstance.

The following are some things that are not part of this CL and will be
addressed in future CLs:
- converting <webview> tests to run in both the legacy and site
  isolation modes.  (This CL does add standalone tests to validate
  site isolation properties.)
- embedder navigating <webview> to about:blank and siteless
  SiteInstances.
- error page navigations, WebViewRendererState, loadDataWithBaseURL.

Bug: 1267977
Change-Id: I3b747640c083a302dc07ee4106af4f6d33928165
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3380343
Reviewed-by: James Maclean <wjmaclean@chromium.org>
Reviewed-by: Charles Reis <creis@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#965525}
2022-02-01 04:43:49 +00:00
Victor Costan
ed1a22af9a WebSQL: Clean up WebDatabaseHostImpl access control.
This CL makes WebDatabaseHostImpl's overridden method declarations
public, whereas they were previously private. The private access control
specifier is misleading, because WebDatabaseHostImpl uses public
inheritance (as mandated by the Google C++ style guide), so outside code
can always call into the overridden methods by creating a superclass
pointer from a WebDatabaseHostImpl instance.

Making the overridden methods public is sufficient for removing
FRIEND_TEST_ALL_PREFIXES from FRIEND_TEST_ALL_PREFIXES, which unlocks a
minor cleanup in testing code.

Change-Id: I63e679d72c390be03590457aa4406311dbbdce55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3316976
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#948571}
2021-12-06 17:25:30 +00:00
Ayu Ishii
ea8c3b702c StorageBuckets: WebSQL to return invalid File on GetOrCreateBucket error
This change updates WebSQL OpenFile to return an invalid file
if GetOrCreateBucket fails. This is necessary because we do not
want to store any data for a StorageKey unless there is a
StorageBucket associated with it. Eventually when WebSQL integrates
with buckets, the data directory for default buckets will change
to a path with a bucket_id. It will not be able to store data
without a bucket. We enforce rule now, before we bootstrap
QuotaDatabase to create buckets for all existing data for
storage keys, and QuotaDatabase becomes the source of truth for
all stored data for quota managed Storage APIs.

Bug: 1267042
Change-Id: Ibac62187e8d82eb6bc2bd6ae794f5da21af5629f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3274860
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941248}
2021-11-12 19:17:03 +00:00
Peter Boström
9b036533b6 Remove DISALLOW_* macros from content/
This inlines all remaining DISALLOW_* macros in content/. This is done
manually (vim regex + manually finding insertion position).

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: I8b5ea6dd9f8a3f584cf3eef82634017a38b15be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193883
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#936160}
2021-10-28 23:37:28 +00:00
Patrick Monette
643cdf6190 Replace base/task/ temporary forward headers with their final locations
Note to QA: This merely changes includes and should not be blamed
for files it touched.

Bug: 1255932
Change-Id: I1ce4e31efd5792ebf2080812e665cae838a54972
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226943
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932153}
2021-10-15 19:13:42 +00:00
Patrick Monette
3d7d70920a Replace task-related headers to their equivalent in base/task/
This CL was generated by using tools/git/move_source_file.py to change
the includes for those files:
base/bind_post_task.h
base/deferred_sequenced_task_runner.h
base/post_task_and_reply_with_result_internal.h
base/sequenced_task_runner.h
base/sequenced_task_runner_helpers.h
base/single_thread_task_runner.h
base/task_runner.h
base/task_runner_util.h
base/updateable_sequenced_task_runner.h

Then formatted using "git cl format". DEPS files were fixed with a
simple search and replace script.

Bug: 1255932
Change-Id: I0d9b5ddd9260fde5e4581e6c6e0080bdb0ed2c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3209175
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929867}
2021-10-08 20:27:23 +00:00
Peter Kasting
e5a38eddbd Migrate "base::TimeDelta::FromX" to "base:X".
All changes were done automatically with git grep, sed, xargs, etc.

No-Presubmit: true
No-Try: true
Bug: 1243777
Change-Id: I7cc197e9027f7837cd36afc67a209079f85ec364
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198824
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#927512}
2021-10-02 03:06:35 +00:00
Ben Kelly
03e7726967 Mojo: Move FakeMojoMessageDispatchContext out of //content and into //mojo.
This also changes the class to live in the mojo namespace and removes
the duplicate "Mojo" string from the class name itself.

Fixed: 1249981
Change-Id: I3ae48da5b1cfa92d9095f5a180978d31e35e04ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3163419
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Auto-Submit: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#922326}
2021-09-16 22:06:33 +00:00
Ayu Ishii
7db78ef1f4 StorageBuckets: Create bucket on access for WebSQL
This change ensures that a default bucket for an
origin/storage key exists on OpenFile. This will
call to get or create a default bucket for the storage
key to make sure there is an entry in the QuotaDatabase
buckets table. This is a requirement for migrating
Storage APIs to Buckets.

Bug: 1240334
Change-Id: I8dabe3f6d3d94faca4f05dab9930c846978b855b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3099255
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#919563}
2021-09-09 01:38:28 +00:00
Daniel Cheng
d4c3eabae8 Fix IWYU violations of base/gtest_prod_util.h.
This is in preparation for a followup change which removes the
aforementioned include from base/memory/ref_counted.h.

This CL was automatically generated with:

python tools/clang/pass_to_move/add_header.py \
    --header '"base/gtest_prod_util.h"' \
    $(grep -L gtest_prod_util $(git gs FRIEND_TEST_ALL_PREFIXES | cut -d: -f1 | uniq))

add_header.py is an unlanded helper script from
https://codereview.chromium.org/1505823003/

Change-Id: I35d75a74a80b3bcdd9ad76cfeef98b2b64e26cfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3132241
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Wez <wez@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#916900}
2021-08-31 18:39:01 +00:00
Ali Beyad
e79c9ed9eb Refactor the QuotaManagerProxy to use StorageKey
This is part of an effort to move the storage APIs to use StorageKey
instead of Origin.  For now, the call sites of QuotaManagerProxy (of
which there are many) have been changed to convert an Origin to a
StorageKey, in the cases where the call site does not already have a
StorageKey object created.

Bug: 1215208
Change-Id: I212bed36f8a371d13afc4a55a464684889b5fe8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2971803
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Ali Beyad <abeyad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#894400}
2021-06-21 20:59:51 +00:00
Victor Costan
cd40ac2821 WebSQL: Minor test fixes.
This CL makes the following test improvements. No functional changes are
introduced.

1. Unit tests that instantiate DatabaseTracker now call
   DatabaseTracker::Shutdown() on the expected sequence before the
   DatabaseTracker is destroyed. Shutdown() has been in the
   DatabaseTracker API contract before this CL, so the tests have been
   incorrect. The fix is needed because a follow-up CL will DCHECK
   consistently if Shutdown() is not called before the destructor.

2. TestQuotaManagerProxy::reset() -> ResetRecordedTestState(). The
   method does not meet the style guide requirements for snake_case()
   methods. Also, the reset() name is typically used for clearing smart
   pointers.

Bug: 1163048
Change-Id: I50af6ea6381de3d9db8db0e6959d3c1f04e4ada7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2939390
Commit-Queue: Victor Costan <pwnall@chromium.org>
Commit-Queue: enne <enne@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#889432}
2021-06-04 20:36:23 +00:00
Victor Costan
c6970d5477 WebSQL: Add factory method for DatabaseTracker.
This CL adds a DatabaseTracker::Create() method that must be used to
instantiate the class.

The DatabaseTracker constructor remains public, so base::MakeRefCounted
can still be used with DatabaseTracker. Access to the constructor is
restricted with a base::PassKey.

This CL also turns DatabaseTracker constructor arguments from raw
pointers to scoped_refptr when the DatabaseTracker constructor holds a
reference to the instances.

This CL does not introduce any functional changes.

Bug: 1163048
Change-Id: I7b0074af323a4e7712ec0754544f53244d5feab3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2927932
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#888083}
2021-06-01 19:18:07 +00:00
Anton Bikineev
f62d1bf48e content: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
  ->
  include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional

Bug: 1202909
Change-Id: Ie9f37bcbf6115632a19f4d063387d07b3723926f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897246
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883270}
2021-05-15 17:56:07 +00:00
W. James MacLean
723a5df6dd Improve BadMessage strings for WebDatabaseHost.
The BadMessage strings in WebDatabaseHostImpl make it hard to recognize
the source of the messages in crash dumps. This CL makes those strings
a little more informative.

Bug: 1148542
Change-Id: I4dbb50166e576a5a256638b5967d87ed7b4f139e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2792347
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#867726}
2021-03-30 19:38:57 +00:00
Jan Wilken Dörrie
8aeb574da9 [LSC] Remove base::ASCIIToUTF16("...") in //content and //ui
This change removes calls to base::ASCIIToUTF16 in //content and //ui
with a single-line string literal and replaces them with a u"..."
literal instead. Files where this change would cause compilation errors
were not changed.

This is a mechanical change:

$ git grep -lw ASCIIToUTF16 content ui | xargs \
    sed -i 's/\(base::\)\?ASCIIToUTF16(\("\(\\.\|[^\\"]\)*"\))/u\2/g'
$ git cl format

Bug: 1189439
Change-Id: I0d5601dc15324c43012b8d26260405f1efdca07e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2780265
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865766}
2021-03-23 19:27:02 +00:00
Gabriel Charette
a6b6f55521 IWYU for callback_helpers.h
Prereq for https://chromium-review.googlesource.com/c/chromium/src/+/2773408
as we previously had
task_traits.h=>thread_pool.h=>callback_helpers.h

Users that should be including thread_pool.h explicitly did so in
https://chromium-review.googlesource.com/c/chromium/src/+/2775891

These are the remaining users of types in callback_helpers.h that
weren't properly IWYU. e.g.:
../../media/video/software_video_encoder_test.cc:92:54: error: no member named 'NullCallback' in namespace 'base'
std::move(output_cb), base::NullCallback());

Script:

def Fix(file_path):
  content = refactor_lib.ReadFile(file_path)

  # Assume fwd-decls are correct in first pass.
  if 'class ScopedClosureRunner;' in content:
    return False

  # Using base:: prefix ensures we don't match fwd-decls and other
  # things. Will require a few fixups for missing includes in //base
  # proper. Complex prefix in regex attempts to skip comments.
  matches = re.compile(
      r'(\n *[^/\n][^/\n][^/\n]*'
      r'(base::ScopedClosureRunner|base::NullCallback|base::DoNothing)'
      r'\b[^*])',
      re.DOTALL).findall(content)

  if not matches:
    return False

  updated_content = refactor_lib.AddInclude(file_path, content,
                                            "base/callback_helpers.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

  return True

Bug: 1026641
Change-Id: Ic7cfec226f1a13b05f4244d5ffcdd2ad8c4e4c3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2774781
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: François Doray <fdoray@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865177}
2021-03-22 15:50:35 +00:00
Victor Costan
e7771666d4 WebSQL: Ignore estimatedSize passed to openDatabase().
The `estimatedSize` parameter passed to window.openDatabase() is
persisted in WebSQL's metadata database, but is not used anywhere.

This CL removes the parameter plumbing from Chrome. The parameter
remains in WebIDL and the interface implementation.

Bug: 1188773
Change-Id: I4514a2f93f941393cbb693f8aaac235e25b2af90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2763192
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#863815}
2021-03-17 17:03:39 +00:00
Victor Costan
dc66b5e128 WebSQL: Remove estimated_size from the browser-side implementation.
The `estimatedSize` parameter passed to window.openDatabase() is
persisted in WebSQL's metadata database, but is not used anywhere.

This CL removes the parameter from the browser side. This is done
separately from the Blink-side removal, to make it easier to see that
the estimated size is not used anywhere.

Bug: 1188773
Change-Id: I9b114f86bf2a1d52550d451eefcbfe5d013a8d20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2763335
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#863753}
2021-03-17 14:44:03 +00:00
Victor Costan
4ce50f6cfc WebSQL: Remove unused mojo call WebDatabaseHost::GetFileSize.
Change-Id: Ia6703e710fd1f67ffea74ff55892484bd01be4a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2758969
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#863111}
2021-03-16 02:38:58 +00:00
Jan Wilken Dörrie
09a4396a44 [LSC] Remove base/strings/string16.h #includes
This change removes #includes of base/strings/string16.h from the
codebase.

Bug: 1184339
Change-Id: I3b29dd94c6955d01029d24f88177b755863c865d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2756167
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Owners-Override: Jan Wilken Dörrie <jdoerrie@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862683}
2021-03-14 19:20:08 +00:00
Alex Moshchuk
ef8c256d03 Rename AddIsolatedOrigins to AddFutureIsolatedOrigins
This better conveys the difference between that method and
AddIsolatedOriginsForBrowsingInstance, now that we have a growing
number of use cases for each of these, with COOP isolation using both.

Bug: 1018656
Change-Id: I79ffe77d4c83deb7efee9398951d935f06acae8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2753527
Reviewed-by: Charlie Reis <creis@chromium.org>
Owners-Override: Charlie Reis <creis@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862325}
2021-03-12 06:37:45 +00:00
Jan Wilken Dörrie
aace0cfef2 [LSC] Replace base::string16 with std::u16string in //{chrome*,content}
This change replaces base::string16 with std::u16string in //chrome,
//chromecast, //chromeos and //content.

Reproduction steps:
$ git grep -lw 'base::string16' chrome* content | \
      xargs sed -i 's/\bbase::string16\b/std::u16string/g'
$ git cl format

Bug: 1184339
Change-Id: I8fae0ab25b5d9bf1cb416ae5f47d7f680fb8f3ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752229
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862152}
2021-03-11 22:01:58 +00:00
Darwin Huang
fb42943177 content: Use base::DoNothing.
Throughout //content, identified via:
https://source.chromium.org/search?q=f:^content%20\[\]\(.*\{\}\)

Refactoring change only. No functional changes intended.

Bug: 1186751
Change-Id: I9ee245b25ac2dc8252ea8a7caa42aa6f655a90bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2744166
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Darwin Huang <huangdarwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#861728}
2021-03-10 22:18:33 +00:00
Victor Costan
d8f401beb5 Quota: Fix QuotaManagerProxy::GetUsageAndQuota() parameter.
GetUsageAndQuota() takes a base::SequencedTaskRunner as a raw pointer.
However, in some cases, it may take a reference to this argument. This
CL converts the argument to a scoped_refptr, to show the fact that
GetUsageAndQuota() may extend the argument's lifetime.

Change-Id: I7b7a8e1a708b82fc96084a01122f5f2227400022
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644682
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Jarryd Goodman <jarrydg@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#848060}
2021-01-28 10:51:37 +00:00
Victor Costan
89e4a67bfa WebSQL: Replace off_the_record with incognito.
The majority of the storage code uses incognito instead of
off_the_record. This CL gets WebSQL in line, to reduce cognitive
overhead for readers.

Change-Id: I8fcce58f82da24e22aa7b14b201dc7ed935b1114
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2634551
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844845}
2021-01-19 19:44:22 +00:00