0
Commit Graph

331 Commits

Author SHA1 Message Date
Camillia Smith Barnes
7164360554 Shared Storage: Partial refactor of event params static creators
We refactor several of the static creator methods for
SharedStorageEventParams in preparation for adding several new members
to the class.

Bug: 401011862
Change-Id: Idfafcccce0f8ecd3d530e3223fc0036b79efd654
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6351803
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1432387}
2025-03-13 14:48:10 -07:00
Camillia Smith Barnes
5662c56494 Shared Storage: Assign ID to each worklet host for DevTools
At construction, we assign a monotonically increasing ID to each
SharedStorageWorkletHost, which will be reported to DevTools for
each worklet event.

The current CL only partially plumbs the worklet ID to DevTools by
setting it in the event params for addModule, createWorklet, run, and
selectURL.

Followups will have to send the ID for the remaining worklet events,
as well as update the DevTools protocol and forward to the DevTools
frontend.

Bug: 401011862
Change-Id: I554d3c2ac3b6ce9f239dddcebe71a7b52359517f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6348125
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1432308}
2025-03-13 12:56:33 -07:00
Yao Xiao
df00323ff3 [shared storage] Add AbsoluteUsefulResourceDuration UKM
Why: This helps to see which sites contain long-running worklets,
which can impact performance or be exploited for side-channel
attacks.

UKM Collection Privacy Review (approved):
https://docs.google.com/document/d/11iuC98oCFEi0m9twSsRYKjxvJ1X7DwMUb18EnBZFfv8

Bug: 398173023
Change-Id: I2c9099cc0eceadf2dcfd8c667af032fa9f128426
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6324509
Reviewed-by: Sun Yueru <yrsun@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431672}
2025-03-12 12:05:18 -07:00
Camillia Smith Barnes
4ccde534f5 Shared Storage: Plumb resolve_to_config to browser process for DevTools
We send the `resolve_to_config` bool to the SharedStorageWorkletHost
in preparation for adding it to SharedStorageEventParams, so that
it can be reported to DevTools sharedStorageAccessed events.

Bug: 401011862
Change-Id: I8e28232bcc4a7b5d3630173582cfa76c9e77d139
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6344311
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431224}
2025-03-11 16:32:12 -07:00
Camillia Smith Barnes
aa40398eeb Shared Storage: Use cross product of enums for DevTools events, part 1
This is part 1 of a multi-CL change intended to update the
DevTools sharedStorageAccessed events so that instead of using
a single long *AccessType enum, they use the cross product of shorter
*AccessScope and *AccessMethod enums.

The current CL addresses the bulk of the content/browser changes.
The next followup will make the necessary changes to the
browser_protocol.pdl file and finish updating content::protocol::
StorageHandler. Subsequently, one or more CLs will be needed to roll
the protocol changes to the frontend, and to make the existing
frontend compatible.

Bug: 401011862
Change-Id: I8a97fdf36b9bce7a9c77b56caf8baa6a4933d075
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6335479
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1430450}
2025-03-10 13:30:25 -07:00
Camillia Smith Barnes
1accf183a3 Shared Storage: Send data origin type to browser process for DevTools
For createWorklet, while we are already sending the data origin itself
from the renderer process to the browser process, we don't currently
notify the browser process whether this origin was calculated as a
context origin, script origin, or custom origin.

For DevTools createWorklet event notifications, we would like to report
which parameters were used in the call (up to defaults and
canonicalization). While we could work backwards in the browser
process to estimate which parameter was used by JavaScript, doing so
would give information that would be inaccurate in some instances.

A followup will actually pass this new information to DevTools
backend as part of an updated `content::SharedStorageEventParams`.
Further followups will update the DevTools protocol and the frontend
so that this will be visible from the relevant subview of the
Application Panel.

Bug: 401011862
Change-Id: I13998b9034130e7bb5559db95efea07522cbca1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6330825
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1430337}
2025-03-10 10:32:11 -07:00
Camillia Smith Barnes
4cae409564 Shared Storage: Remove unused NotifySharedStorageAccessed in Observer
longer used. We remove it.

SharedStorageHeaderObserver: :NotifySharedStorageAccessed() is no
Change-Id: Ia86d2a0e115e84a774f618b5f67b53e809218cee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6332343
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1429851}
2025-03-07 20:43:51 -08:00
Camillia Smith Barnes
7b361016e7 Shared Storage: Simplify TestSharedStorageObserver error logging
In preparation for using a cross product of shorter enums instead of
the existing enum SharedStorageRuntimeManager::
SharedStorageObserverInterface::AccessType, as well as for adding
further members to SharedStorageEventParams, we simplify the error
logging in TestSharedStorageObserver.

Previously this logging relied on LOG(ERROR) statements when
expected values did not match actual values. Instead, we implement
an operator== and an operator<< for SharedStorageEventParams. This
is cleaner and will be easier to extend when we make future changes.

Bug: 401011862
Change-Id: I053905bba8e30f2b8300e61735edc49ac2e6a6e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6329731
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1429765}
2025-03-07 14:36:35 -08:00
Avi Drissman
50c2b835a1 Remove RenderFrame/View/WidgetHostImpl header includes
In headers, swap in forward declarations of
RenderFrame/View/WidgetHostImpl rather than includes. Fix up missing
includes.

Bug: none
Change-Id: I56b0b7e0e1336b43dda48ee2ec734bd0a6aad94e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6336226
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1429704}
2025-03-07 13:15:29 -08:00
Camillia Smith Barnes
6083c3304b Shared Storage: Move AccessScope enum so it can be used for events
We move SharedStorageLockManager::AccessScope to
third_party/blink/public/common/shared_storage/shared_storage_utils,
and now call it blink::SharedStorageAccessScope.

This is in preparation for replacing the current
SharedStorageRuntimeManager::SharedStorageObserverInterface::AccessType
enum with a shorter ::AccessMethod enum listing only methods, and then
using a pair of enum values from SharedStorageAccessScope and
AccessMethod, respectively to denote the access type. (In other words,
we will use a cross product of two shorter enums.)

Bug: 401011862
Change-Id: I7c084b919f4126bde61b3c1f4b28e955d65aa94e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6331098
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1429002}
2025-03-06 09:51:49 -08:00
Sandor Major
edc3cb823a Remove network::ResourceRequest from PermissionsPolicy
This is needed to break a circular dependency between the request and
the policy that would appear in an upcoming CL where the policy will be
added onto the request.

This was a hack anyway that was added when requests had no access to
permissions policies but after crrev.com/c/6320262 they will have access
to them and all functions like this should be moved to the request
object. Ideally `PermissionsPolicy` shouldn't read flags from the
request and change behavior based on them, the request object should
handle things like this. A todo bug was created for this.

Bug: 382291442
Change-Id: Idca4d34bb30cf4bc44c87695fdcf72ea623d98c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6332329
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1428943}
2025-03-06 08:15:17 -08:00
Devon Loehr
c0138d8d14 Stringify bools consistently
This changes instances of `b ? "true" : "false"` to use `base::ToString(b)`
instead. It's a followup to previous changes to address things that were missed
or regressed in the meantime.

This change applies to the following directories: content

This CL was uploaded by an experimental version of git cl split
(https://crbug.com/389069356).

R=creis@chromium.org

Bug: 335797528
Change-Id: I4d4ec7cd9e8c13d09c91637bca88de27bb637842
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6318187
Auto-Submit: Devon Loehr <dloehr@google.com>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1427485}
2025-03-03 17:11:42 -08:00
Sandor Major
07aa8b0689 Move PermissionsPolicy to the network service
The network service needs access to the permissions policy. Previous CLs
moved all the dependencies so it is now safe to move this class.

The following files need to include permissions_policy.h because
otherwise they want to have access into incomplete `PermissionsPolicy`:
* components/permissions/permission_uma_util.cc
* third_party/blink/common/manifest/manifest_util.cc
* third_party/blink/renderer/core/html/client_hints_util.cc
* third_party/blink/renderer/modules/payments/payment_app_service_worker_registration.cc
* third_party/blink/renderer/modules/payments/payment_instruments.cc

Bug: 382291442
Low-Coverage-Reason: LARGE_SCALE_REFACTOR
Change-Id: Ifcf52df3bc5c035e8f6a45df02cf93f304b748c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6310821
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Owners-Override: Rick Byers <rbyers@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426391}
2025-02-28 09:24:35 -08:00
Sandor Major
f42e6bd64c Move permissions_policy.cc-used feature flags to the Network service
Permissions Policy code is being moved to the Network service so these
flags need to move as well.

Bug: 382291442
Low-Coverage-Reason: LARGE_SCALE_REFACTOR
Change-Id: I2d6135ef1350f21e08de9053c69c762bfb1fd7ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6287505
Owners-Override: Rick Byers <rbyers@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426039}
2025-02-27 16:12:04 -08:00
Yao Xiao
effa1d6cf0 [shared storage] Add AbsoluteUsefulResourceDuration UMA
Why: This helps to see if there are long-running worklets, which can
impact performance or be exploited for side-channel attacks. If the
result reveals such instances, we will further add UKM to investigate
the specific use cases.

Given that the existing 'UsefulResourceDuration' represents a
percentage, we add 'AbsoluteUsefulResourceDuration' for a distinction.

Bug: 398173023
Change-Id: I8b69362158a35b0861033f8f58a0aa335edb4241
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6287655
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423455}
2025-02-21 15:31:37 -08:00
Roger McFarlane
8952859c39 Use bounded ranges (string_view) for histogram names.
This CL changes the histogram creation APIs to take a durable
string view (i.e., a pointer+size pair referring to memory that
the programmer has annotated that it will not be freed) instead
of just an implicit pointer. The HistogramBase class internally
represents the name's length and the histogram's flags using
16 bits in order to not grow the in-memory size of Histogram
objects. The name of the histogram is subsequently exposed by
HistogramBase as a string_view.

This CL updates consumers of the histogram name's to use a
string_view of the name. This removes many string length
calculations and string copy operations. For histograms
allocated in shared memory, it also avoids potential out-of-
bounds reads if the underlying string data is modified or
corrupted such that it no longer has a trailing NUL char
at the end of the string.

Lastly, this CL updates a number of call-sites where the
histogram names were being copied into short-lived string
objects for use as search keys into various containers to
perform the functionality without making any unnecessary
copies.

Low-Coverage-Reason: TRIVIAL_CHANGE Use of string_view instead of string/char* in some error/logging paths have low coverage.
AX-Relnotes: n/a
Bug: 393394360, 40818143
Change-Id: Iee9ee5ae62335b9e7815f4ae11bde4ff80cfd4a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6231451
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Antonio Rivera <antoniori@google.com>
Commit-Queue: Roger McFarlane <rogerm@chromium.org>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422750}
2025-02-20 12:50:27 -08:00
Yao Xiao
2c68650592 [shared storage] Add lock usage UMAs
Why: this helps to understand web locks adoptions.

What:
- When a worklet is destroyed, record whether navigator.locks was
  requested.
- When an update method is triggered (for individual method and for
  batchUpdate() separately), record whether the 'withLock' option is
  specified.

Bug: 373899210
Change-Id: I3ce97533345393c833b2861794bc52aad83573f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6277481
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1421614}
2025-02-18 13:18:11 -08:00
Sandor Major
878f835180 Move ParsedPermissionsPolicyDeclaration from Blink to Network service
The network service is going to need access to the "storage-access"
Permissions Policy. This is the third step of moving some of the
Permissions Policy logic out of Blink to maintain a single
implementation of https://w3c.github.io/webappsec-permissions-policy
across Chromium.

Bug: 382291442
Low-Coverage-Reason: LARGE_SCALE_REFACTOR
Change-Id: Ic6ad87dd4bd6f882a135a0c580d481dc1b219831
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6254141
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Owners-Override: Rick Byers <rbyers@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1421574}
2025-02-18 12:16:02 -08:00
Sandor «Alex» Major
c41217fd82 Reland "Fix Permissions Policy includes"
This reverts commit 720f465c92.

Reason for revert: https://crrev.com/c/6269804 shouldn't affect tests

Original change's description:
> Revert "Fix Permissions Policy includes"
>
> This reverts commit 989865934e.
>
> Reason for revert: Causing SharedStorageFencedFrameChromeBrowserTest failure (crbug/396718068)
>
> Original change's description:
> > Fix Permissions Policy includes
> >
> > This should make reviews of https://crrev.com/c/6254141 easier
> >
> > Bug: 382291442
> > Change-Id: Ibf1b3b0d17914c457074f9d39e054654822109ad
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6269804
> > Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> > Reviewed-by: Rick Byers <rbyers@chromium.org>
> > Commit-Queue: Rick Byers <rbyers@chromium.org>
> > Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> > Owners-Override: Rick Byers <rbyers@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1420643}
>
> Bug: 382291442, 396718068
> Change-Id: I5654fa7f5cdb6a5e086e18161ffe39176b43b630
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6271463
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Owners-Override: Wenyu Fu <wenyufu@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Wenyu Fu <wenyufu@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1420743}

Bug: 382291442, 396718068
Change-Id: Id1d4b3fd098df7c5aa61daa1b1b247a016ec1472
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6271184
Commit-Queue: Wenyu Fu <wenyufu@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Wenyu Fu <wenyufu@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Wenyu Fu <wenyufu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420774}
2025-02-14 15:33:13 -08:00
Wenyu Fu
720f465c92 Revert "Fix Permissions Policy includes"
This reverts commit 989865934e.

Reason for revert: Causing SharedStorageFencedFrameChromeBrowserTest failure (crbug/396718068)

Original change's description:
> Fix Permissions Policy includes
>
> This should make reviews of https://crrev.com/c/6254141 easier
>
> Bug: 382291442
> Change-Id: Ibf1b3b0d17914c457074f9d39e054654822109ad
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6269804
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Rick Byers <rbyers@chromium.org>
> Commit-Queue: Rick Byers <rbyers@chromium.org>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Owners-Override: Rick Byers <rbyers@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1420643}

Bug: 382291442, 396718068
Change-Id: I5654fa7f5cdb6a5e086e18161ffe39176b43b630
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6271463
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Wenyu Fu <wenyufu@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Wenyu Fu <wenyufu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420743}
2025-02-14 14:14:07 -08:00
Sandor Major
989865934e Fix Permissions Policy includes
This should make reviews of https://crrev.com/c/6254141 easier

Bug: 382291442
Change-Id: Ibf1b3b0d17914c457074f9d39e054654822109ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6269804
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Rick Byers <rbyers@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Owners-Override: Rick Byers <rbyers@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420643}
2025-02-14 11:49:01 -08:00
Sandor Major
ca47512a38 Reland "Move OriginWithPossibleWildcards from Blink to the Network service"
This is a reland of commit 0ea18895e7
Original change is in Patchset 1

The trait for `OriginWithPossibleWildcards` was depending on
`url_loader_base_shared` but it should depend on `url_loader_base`
I also got some hints how to reproduce this locally and it seems to
build properly now.

Original change's description:
> Reland "Move `OriginWithPossibleWildcards` from Blink to the Network service"
>
> This is a reland of commit 8cd5274221
> Original change is in Patchset 1
> The revert CL can be found here: https://crrev.com/c/6234523
>
>
> Original change's description:
> > Move `OriginWithPossibleWildcards` from Blink to the Network service
> >
> > The network service is going to need access to the "storage-access"
> > Permissions Policy. This is the second step of moving some of the
> > Permissions Policy logic out of Blink to maintain a single
> > implementation of https://w3c.github.io/webappsec-permissions-policy
> > across Chromium.
> >
> > The previous cl is under https://crrev.com/c/6219635
> >
> > Some files got a new include for
> > permissions_policy_feature.mojom-shared.h without content change. This
> > was required because previously the shared mojom header was probably
> > included transitively and now it's not anymore.
> >
> > Bug: 382291442
> > Change-Id: Ib83df88471dd45dcda00235a55113d7283b8814e
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226434
> > Reviewed-by: Jeremy Roman <jbroman@chromium.org>
> > Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> > Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> > Commit-Queue: Jeremy Roman <jbroman@chromium.org>
> > Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> > Reviewed-by: Joe Mason <joenotcharles@google.com>
> > Owners-Override: Jeremy Roman <jbroman@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1416344}
>
> Bug: 382291442
> Change-Id: I540867ed61dbe858ee59cce96643692c01fc8f3b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6238257
> Owners-Override: Jeremy Roman <jbroman@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Commit-Queue: Jeremy Roman <jbroman@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Jeremy Roman <jbroman@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1418188}

Bug: 382291442
Change-Id: If50327575954864dfe0638ed6d8d946a122beebc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6250085
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Owners-Override: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1418692}
2025-02-11 08:58:04 -08:00
Jiacheng Guo
10600c26fe Add ProcessAllocationContext when allocating renderer processes
The CL adds ProcessAllocationContext to track the context when
allocating a renderer process. The context information will be used to
log UMAs when the browser fails to find a spare renderer for the allocation
request.

The design doc can be found at:
https://docs.google.com/document/d/1E3_3BUvSmQCz7XsRKAYyZn0uXWIeNuEWMsJsH-Gl2PI/edit?usp=sharing&resourcekey=0-SRNb8I8YuGz3HFJJZ1lG5w

Bug: 388998723
Change-Id: I69b012c12967dc34df26eb67ec9ab1145595a6a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6217682
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1418401}
2025-02-10 17:10:17 -08:00
Yao Xiao
4b5842c9a4 Revert "Reland "Move OriginWithPossibleWildcards from Blink to the Network service""
This reverts commit 0ea18895e7.

Reason for revert: caused build failure: https://ci.chromium.org/ui/p/chromium/builders/ci/win32-archive-rel/47925/overview

Original change's description:
> Reland "Move `OriginWithPossibleWildcards` from Blink to the Network service"
>
> This is a reland of commit 8cd5274221
> Original change is in Patchset 1
> The revert CL can be found here: https://crrev.com/c/6234523
>
>
> Original change's description:
> > Move `OriginWithPossibleWildcards` from Blink to the Network service
> >
> > The network service is going to need access to the "storage-access"
> > Permissions Policy. This is the second step of moving some of the
> > Permissions Policy logic out of Blink to maintain a single
> > implementation of https://w3c.github.io/webappsec-permissions-policy
> > across Chromium.
> >
> > The previous cl is under https://crrev.com/c/6219635
> >
> > Some files got a new include for
> > permissions_policy_feature.mojom-shared.h without content change. This
> > was required because previously the shared mojom header was probably
> > included transitively and now it's not anymore.
> >
> > Bug: 382291442
> > Change-Id: Ib83df88471dd45dcda00235a55113d7283b8814e
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226434
> > Reviewed-by: Jeremy Roman <jbroman@chromium.org>
> > Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> > Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> > Commit-Queue: Jeremy Roman <jbroman@chromium.org>
> > Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> > Reviewed-by: Joe Mason <joenotcharles@google.com>
> > Owners-Override: Jeremy Roman <jbroman@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1416344}
>
> Bug: 382291442
> Change-Id: I540867ed61dbe858ee59cce96643692c01fc8f3b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6238257
> Owners-Override: Jeremy Roman <jbroman@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Commit-Queue: Jeremy Roman <jbroman@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Jeremy Roman <jbroman@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1418188}

Bug: 382291442
Change-Id: I4bf4fa5e3034e15791e1acae63cc665a4e3d12bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6248599
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Owners-Override: Yao Xiao <yaoxia@chromium.org>
Auto-Submit: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1418238}
2025-02-10 10:34:15 -08:00
Sandor Major
0ea18895e7 Reland "Move OriginWithPossibleWildcards from Blink to the Network service"
This is a reland of commit 8cd5274221
Original change is in Patchset 1
The revert CL can be found here: https://crrev.com/c/6234523


Original change's description:
> Move `OriginWithPossibleWildcards` from Blink to the Network service
>
> The network service is going to need access to the "storage-access"
> Permissions Policy. This is the second step of moving some of the
> Permissions Policy logic out of Blink to maintain a single
> implementation of https://w3c.github.io/webappsec-permissions-policy
> across Chromium.
>
> The previous cl is under https://crrev.com/c/6219635
>
> Some files got a new include for
> permissions_policy_feature.mojom-shared.h without content change. This
> was required because previously the shared mojom header was probably
> included transitively and now it's not anymore.
>
> Bug: 382291442
> Change-Id: Ib83df88471dd45dcda00235a55113d7283b8814e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226434
> Reviewed-by: Jeremy Roman <jbroman@chromium.org>
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Commit-Queue: Jeremy Roman <jbroman@chromium.org>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Owners-Override: Jeremy Roman <jbroman@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1416344}

Bug: 382291442
Change-Id: I540867ed61dbe858ee59cce96643692c01fc8f3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6238257
Owners-Override: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1418188}
2025-02-10 08:54:55 -08:00
Anton Maliev
666c9c8203 Revert "Move OriginWithPossibleWildcards from Blink to the Network service"
This reverts commit 8cd5274221.

Reason for revert: Tree is closed due to compile error: https://ci.chromium.org/ui/p/chromium/builders/ci/mac-arm64-archive-rel/43617/overview

Original change's description:
> Move `OriginWithPossibleWildcards` from Blink to the Network service
>
> The network service is going to need access to the "storage-access"
> Permissions Policy. This is the second step of moving some of the
> Permissions Policy logic out of Blink to maintain a single
> implementation of https://w3c.github.io/webappsec-permissions-policy
> across Chromium.
>
> The previous cl is under https://crrev.com/c/6219635
>
> Some files got a new include for
> permissions_policy_feature.mojom-shared.h without content change. This
> was required because previously the shared mojom header was probably
> included transitively and now it's not anymore.
>
> Bug: 382291442
> Change-Id: Ib83df88471dd45dcda00235a55113d7283b8814e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226434
> Reviewed-by: Jeremy Roman <jbroman@chromium.org>
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Commit-Queue: Jeremy Roman <jbroman@chromium.org>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Owners-Override: Jeremy Roman <jbroman@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1416344}

Bug: 382291442
Change-Id: I8a8749ea77398bce5a1c6c3e2d0dfd5e06945b97
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6234523
Auto-Submit: Anton Maliev <amaliev@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Anton Maliev <amaliev@chromium.org>
Owners-Override: Anton Maliev <amaliev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416362}
2025-02-05 11:50:33 -08:00
Sandor Major
8cd5274221 Move OriginWithPossibleWildcards from Blink to the Network service
The network service is going to need access to the "storage-access"
Permissions Policy. This is the second step of moving some of the
Permissions Policy logic out of Blink to maintain a single
implementation of https://w3c.github.io/webappsec-permissions-policy
across Chromium.

The previous cl is under https://crrev.com/c/6219635

Some files got a new include for
permissions_policy_feature.mojom-shared.h without content change. This
was required because previously the shared mojom header was probably
included transitively and now it's not anymore.

Bug: 382291442
Change-Id: Ib83df88471dd45dcda00235a55113d7283b8814e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226434
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Owners-Override: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416344}
2025-02-05 11:20:26 -08:00
Dan McArdle
c82203c16d Shared Storage: Move browsertests for Fenced Frame to new file
This is a behavior-preserving refactor.

Bug: 392049826
Low-Coverage-Reason: TRIVIAL_CHANGE
Change-Id: I2e2c6a324e43ad246a58a5d1f1e022fe07a5bd16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219380
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Auto-Submit: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1415780}
2025-02-04 13:05:02 -08:00
David Sanders
f583e506ff Add missing includes of //base/metrics/histogram_functions.h (1/N)
Bug: 40216326
Change-Id: Iba3932754d47e887dda53052b82a58d5cd4d92a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6183272
Owners-Override: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414729}
2025-02-02 17:55:00 -08:00
Alex Turner
116d390d65 Create PrivateAggregationPendingContributions and wrapper classes
We plan to use the new class to support the new
`kPrivateAggregationApiErrorReporting` feature, which is currently
disabled by default (and not yet implemented).  In this cl, the main
class is empty, with a TODO to implement the logic.

However, the nested Wrapper class is a fairly basic union type that
conditionally contains either the main class (if the error reporting
feature is enabled) or a vector of contributions (if the feature is
disabled). This cl also switches some plumbing to use this new Wrapper
class, which will simplify future implementation work. It also moves the
definition of ContributionMergeKey to the new class to reflect the new
class's intended (eventual) role.

This cl should be a no-op, given the disabled feature.

Bug: 381788013
Change-Id: I92e4dcebfa786e0327cd12c9104b4dbc9760dc1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6079892
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Alex Turner <alexmt@chromium.org>
Reviewed-by: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414416}
2025-01-31 14:44:54 -08:00
Sandor «Alex» Major
e9545a72e6 Reland "Move PermissionsPolicyFeature from Blink to the Network service"
This is a reland of commit 1b851527a0

A new usage of `PermissionsPolicyFeature` appeared in the meantime.
Fixed in this CL.

Original change's description:
> Move `PermissionsPolicyFeature` from Blink to the Network service
>
> The network service is going to need access to the "storage-access"
> Permissions Policy. This is the first step of moving some of the
> Permissions Policy logic out of Blink to maintain a single
> implementation of https://w3c.github.io/webappsec-permissions-policy
> across Chromium.
>
> Tha main change here is moving the `PermissionsPolicyFeature` type from
> `blink.mojom` to `network.mojom`:
> https://crrev.com/c/6180431/7/services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom
>
> Bug: 382291442
> Change-Id: Ib99fbd285031936dbf40d5f210816cc775c51dfa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180431
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Owners-Override: Rick Byers <rbyers@chromium.org>
> Reviewed-by: Rick Byers <rbyers@chromium.org>
> Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1414133}

Bug: 382291442
Change-Id: I853b73f61ab7ecd807fc3d16cd2895c353ebd126
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219635
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Owners-Override: Rick Byers <rbyers@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414345}
2025-01-31 12:40:46 -08:00
Kevin McNee
4a02d170a9 Revert "Move PermissionsPolicyFeature from Blink to the Network service"
This reverts commit 1b851527a0.

Reason for revert: Broke the build https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Builder/86647/overview

Original change's description:
> Move `PermissionsPolicyFeature` from Blink to the Network service
>
> The network service is going to need access to the "storage-access"
> Permissions Policy. This is the first step of moving some of the
> Permissions Policy logic out of Blink to maintain a single
> implementation of https://w3c.github.io/webappsec-permissions-policy
> across Chromium.
>
> Tha main change here is moving the `PermissionsPolicyFeature` type from
> `blink.mojom` to `network.mojom`:
> https://crrev.com/c/6180431/7/services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom
>
> Bug: 382291442
> Change-Id: Ib99fbd285031936dbf40d5f210816cc775c51dfa
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180431
> Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Owners-Override: Rick Byers <rbyers@chromium.org>
> Reviewed-by: Rick Byers <rbyers@chromium.org>
> Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1414133}

Bug: 382291442
Change-Id: I068a9cbfb77057ded4295dc214aee51bee8a503c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219376
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Kevin McNee <mcnee@chromium.org>
Owners-Override: Kevin McNee <mcnee@google.com>
Cr-Commit-Position: refs/heads/main@{#1414150}
2025-01-31 08:22:14 -08:00
Sandor Major
1b851527a0 Move PermissionsPolicyFeature from Blink to the Network service
The network service is going to need access to the "storage-access"
Permissions Policy. This is the first step of moving some of the
Permissions Policy logic out of Blink to maintain a single
implementation of https://w3c.github.io/webappsec-permissions-policy
across Chromium.

Tha main change here is moving the `PermissionsPolicyFeature` type from
`blink.mojom` to `network.mojom`:
https://crrev.com/c/6180431/7/services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom

Bug: 382291442
Change-Id: Ib99fbd285031936dbf40d5f210816cc775c51dfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180431
Auto-Submit: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Owners-Override: Rick Byers <rbyers@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414133}
2025-01-31 07:48:32 -08:00
Dan McArdle
e53ee3b96e Shared Storage: Move browsertests for Private Aggregation to new file
This is a behavior-preserving refactor.

Bug: 392049826
Change-Id: I4acc3b214d0d104b59638258813c82c30a9b9966
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6216758
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414094}
2025-01-31 06:57:09 -08:00
Dan McArdle
84617d1b40 Shared Storage: Move SharedStorageBrowserTestBase out of browser test
This is a behavior-preserving refactor.

This CL moves SharedStorageBrowserTestBase and
TestSharedStorageRuntimeManager out of the monolithic
shared_storage_browsertest.cc and into their own source files.

Bug: 392049826
Change-Id: Ibd9fb26c51f250284ed63d63ee210c39f061a656
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6216404
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414093}
2025-01-31 06:56:53 -08:00
Dan McArdle
920026e19f Shared Storage: Move TestSharedStorageObserver out of browser test
This is a behavior-preserving refactor.

Bug: 392049826
Change-Id: I41da253a95645c89beeda846b65dee53236f30b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6213916
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414092}
2025-01-31 06:55:55 -08:00
Dan McArdle
f0d28e506e Shared Storage: Move TestSharedStorageWorkletHost out of browser test
This is a behavior-preserving refactor.

This CL starts the process of chipping away at our currently-monolithic
shared_storage_browsertest.cc by pulling out classes into their own
source files. It also fixes a number of missing includes.

Next, we can move TestSharedStorageRuntimeManager, after which we should
be able to move SharedStorageBrowserTestBase. Once the base class is
moved, we'll be ready to move thousands of lines of tests into
shared_storage_private_aggregation_browser_test.cc, which I expect will
have a noticeable impact on build times for anyone working on these
browser tests.

Bug: 392049826
Change-Id: Ibdef9d18d26778304a307d4c8b22f611cdcd1f90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6214056
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414091}
2025-01-31 06:55:42 -08:00
Dan McArdle
7831ea3752 Shared Storage: Implement Private Aggregation per-context limits
This CL implements the Shared Storage side of Private Aggregation's
per-context limits feature, gated behind the blink feature flag
`kPrivateAggregationApiMaxContributions`, which is disabled by default.

Specifically, this CL makes the following changes:

* Adds a runtime-enabled `maxContributions` field to the
  `SharedStoragePrivateAggregationConfig` IDL dictionary.

* Handles `maxContributions` in `CheckPrivateAggregationConfig()`.
  Paired with the IDL change, this enables JS to set `maxContributions`.

* Adds browser test coverage. Primarily, we're testing that the field is
  ignored when the feature is disabled, and that it actually affects the
  number of contributions per report when the feature is enabled.

This CL contains no web-visible behavior changes.

Bug: 376707230
Change-Id: Icf883015af3cb00c8d72e1dc63114f2656b51b3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6175278
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Alex Turner <alexmt@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1413558}
2025-01-30 09:17:21 -08:00
Josh Karlin
bd5130d2b8 [Shared Storage] Enable web locks for Shared Storage by default
Chrome Status Entry: https://chromestatus.com/feature/5133950203461632


Bug: 373899210
Change-Id: I8fb0e5548eb6f0d3128b4debf1d3e8f1e5420721
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6179702
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Josh Karlin <jkarlin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1413102}
2025-01-29 12:35:36 -08:00
Josh Karlin
027984eae9 [Shared Storage] Downgrade console error to info
There is a console error posted when a selectURL call does not have
enough budget. Since this is an expected behavior and not indicative
of a problem with the page itself, this should be downgraded to kInfo.

Bug: 392828497
Change-Id: Id62715bf5de0c768a7f7a24fdcdf423943b476ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6206929
Reviewed-by: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Josh Karlin <jkarlin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412928}
2025-01-29 07:56:17 -08:00
Jiacheng Guo
914790cab9 Reland "Add SiteInstance::GetOrCreateProcess for creating a renderer process"
This is a reland of commit 6ae65e31a3

Some test case failures are not captured by the CQ and happens only in
the CI. To avoid back-and-forth reverts, the reland splits the field
trial config into another CL.

Original change's description:
> Add SiteInstance::GetOrCreateProcess for creating a renderer process
>
> The CL replaces SiteInstance::GetProcess with
> SiteInstance::GetOrCreateProcess.
> Calling GetProcess() without an process shall cause a CHECK failure
> instead. To avoid introducing extra crashes, a feature flag
> TraceSiteInstanceGetProcessCreation is introduced to call
> DumpWithoutCrashing instead. After verifying and fixing the captured
> tracebacks, a CHECK will be added to GetProcess().
>
> Design doc:
> https://docs.google.com/document/d/1E3_3BUvSmQCz7XsRKAYyZn0uXWIeNuEWMsJsH-Gl2PI/edit?usp=sharing&resourcekey=0-SRNb8I8YuGz3HFJJZ1lG5w
>
> Bug: 388998723, 41452811, 391970626
> Change-Id: I5cc1efec7289c8751939e0a57681da5e0e1721ab
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6166588
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Reviewed-by: Erik Chen <erikchen@chromium.org>
> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Reviewed-by: Emilia Paz <emiliapaz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1412113}

Bug: 388998723, 41452811, 391970626
Change-Id: Iec6db7950a55da2d8297e51d2ae563488ae2023d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6207368
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Emilia Paz <emiliapaz@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412676}
2025-01-28 18:20:30 -08:00
Dan McArdle
f1b2827b0e PrivateAggregation: Optimize special case of maxContributions
This CL implements an optimization for per-context limits, which are
still gated by a feature and disabled by default.

We're making `ShouldSendReportDeterministically()` a little more clever,
with the goal of enabling Private Aggregation to send fewer null reports
without loss of privacy. Rather than requiring determinism whenever the
`std::optional<size_t> max_contributions` parameter has a value, we will
now additionally require that it would make the aggregatable report
stick out. This resembles the semantics of the `filtering_id_max_bytes`
parameter.

This CL should not contain any web-visible behavior changes, primarily
because none of the calling APIs have defined the `maxContributions`
field yet.

Bug: 376707230
Change-Id: Iee0d849170e728fd9cdc540daa83881ce96a21dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6183147
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412280}
2025-01-28 06:56:08 -08:00
Florian Jacky
05c4b5c28e Revert "Add SiteInstance::GetOrCreateProcess for creating a renderer process"
This reverts commit 6ae65e31a3.

Reason for revert: Potential culprit for builder failures.

Bug: 392790046

Original change's description:
> Add SiteInstance::GetOrCreateProcess for creating a renderer process
>
> The CL replaces SiteInstance::GetProcess with
> SiteInstance::GetOrCreateProcess.
> Calling GetProcess() without an process shall cause a CHECK failure
> instead. To avoid introducing extra crashes, a feature flag
> TraceSiteInstanceGetProcessCreation is introduced to call
> DumpWithoutCrashing instead. After verifying and fixing the captured
> tracebacks, a CHECK will be added to GetProcess().
>
> Design doc:
> https://docs.google.com/document/d/1E3_3BUvSmQCz7XsRKAYyZn0uXWIeNuEWMsJsH-Gl2PI/edit?usp=sharing&resourcekey=0-SRNb8I8YuGz3HFJJZ1lG5w
>
> Bug: 388998723, 41452811, 391970626
> Change-Id: I5cc1efec7289c8751939e0a57681da5e0e1721ab
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6166588
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Reviewed-by: Erik Chen <erikchen@chromium.org>
> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Reviewed-by: Emilia Paz <emiliapaz@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1412113}

Bug: 388998723, 41452811, 391970626
Change-Id: I44bfd3db0f1de0d20c79c18b502889d2b72f5624
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6206286
Auto-Submit: Florian Jacky <fjacky@chromium.org>
Owners-Override: Florian Jacky <fjacky@chromium.org>
Commit-Queue: Florian Jacky <fjacky@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1412153}
2025-01-28 00:54:42 -08:00
Jiacheng Guo
6ae65e31a3 Add SiteInstance::GetOrCreateProcess for creating a renderer process
The CL replaces SiteInstance::GetProcess with
SiteInstance::GetOrCreateProcess.
Calling GetProcess() without an process shall cause a CHECK failure
instead. To avoid introducing extra crashes, a feature flag
TraceSiteInstanceGetProcessCreation is introduced to call
DumpWithoutCrashing instead. After verifying and fixing the captured
tracebacks, a CHECK will be added to GetProcess().

Design doc:
https://docs.google.com/document/d/1E3_3BUvSmQCz7XsRKAYyZn0uXWIeNuEWMsJsH-Gl2PI/edit?usp=sharing&resourcekey=0-SRNb8I8YuGz3HFJJZ1lG5w

Bug: 388998723, 41452811, 391970626
Change-Id: I5cc1efec7289c8751939e0a57681da5e0e1721ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6166588
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Reviewed-by: Emilia Paz <emiliapaz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412113}
2025-01-27 22:49:49 -08:00
Dan McArdle
146dc341fb PrivateAggregation: Rename api_for_budgeting parameter to caller_api
Bug: 376707230
Change-Id: Ief9ef08c5b4e90d025ebbad4665548291e1dfe8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6176162
Reviewed-by: Alex Turner <alexmt@chromium.org>
Auto-Submit: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1410512}
2025-01-23 12:52:14 -08:00
Dan McArdle
5244c2f4d6 PrivateAggregation: Implement per-context limits gated by feature
This CL takes the following steps towards implementing per-context
contribution limits:

* Adds `blink::features::kPrivateAggregationApiMaxContributions`,
  disabled by default.

* Implements the Private Aggregation logic for the `maxContributions`
  config field and adds unit tests.

* Hardcodes `maxContributions` as `std::nullopt` in Shared Storage and
  Protected Audience.

This should not contain any web-visible behavior changes, primarily
because none of the calling APIs have defined the `maxContributions`
field yet.

Bug: 376707230
Change-Id: I0b065ab8fb2383ec502cd018e6e66862ebba1ba1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172853
Reviewed-by: Mike Taylor <miketaylr@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1410414}
2025-01-23 09:36:31 -08:00
Ramon Cano Aparicio
6797d4e5e1 Rename HistogramBase::Sample to Sample32 in content.
Add size to type name so the size is known without needing to lookup
the typedef.
Continuation of https://chromium-review.googlesource.com/c/chromium/src/+/6163590

Changed occurrences under chromium/content

Bug: 40899968
Change-Id: I18af5c2d8d86656d0afc3a6094ab1aa5cb1b2f4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6164150
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Roman Arora <romanarora@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Commit-Queue: Ramon Cano Aparicio <rcanoaparicio@google.com>
Cr-Commit-Position: refs/heads/main@{#1404808}
2025-01-10 08:09:02 -08:00
Sandor Major
d1bbf7751c Deduplicate permissions policy getter
RFHI's permissions_policy() and GetPermissionsPolicy() are doing the
same thing, keeping the latter as that's exposed on the RFH as well.

Bug: 382291442
Change-Id: I846764815f6adb72c6906c59d6d6810e02a5d611
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6164805
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1404447}
2025-01-09 14:49:30 -08:00
Yao Xiao
08d1543f81 [shared storage] Implement the batch with_lock option for response header
Parse "options;with_lock=xxx" into the `with_lock` parameter. If
multiple "options" Items appear in the List, the last one will be
used. The parsed value is passed to the browser process's
`BatchUpdate()` API in the lock manager.

This allows developers to perform multiple Shared Storage operations
atomically within a single lock, as part of the Web Lock integration
proposal:
- https://github.com/WICG/shared-storage/pull/199
- https://github.com/WICG/shared-storage/pull/205

Bug: 373899210
Change-Id: Id041e92075b22988656a3db4f1a74792312ee422
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6072742
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1397664}
2024-12-17 16:56:36 -08:00
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