0
Commit Graph

876 Commits

Author SHA1 Message Date
Dylan Cutler
ef0eba18e4 Have ClearData called with StorageKey only delete matching partitioned cookies
Bug: 40849455
Change-Id: I9544b20c7666c20a4c9a712f6719c7129489817b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6006719
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1381913}
2024-11-12 19:25:16 +00:00
Yao Xiao
5fe0299684 [shared storage] Rename SharedStorageWorkletHostManager to SharedStorageRuntimeManager
The SharedStorageWorkletHostManager class has expanded beyond just
managing worklet hosts to include lock management. Rename it to better
reflect its broader responsibilities.

The name "SharedStorageRuntimeManager" is chosen because:
1. It avoids confusion with SharedStorageManager (which manages the
   persistent database).
2. "Runtime" emphasizes that it manages ephemeral/in-memory components
   like the worklet hosts and the locks.

Bug: 373899210
Change-Id: I8e64ae6df876c0f43a6096e4b8b2ab43a4cac3c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6003136
Reviewed-by: Cammie Smith Barnes <cammie@chromium.org>
Auto-Submit: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1381418}
2024-11-11 22:02:26 +00:00
Vikram Pasupathy
bda8b474d3 Revert "media: Remove MediaLicense* code and usage"
This reverts commit e307cce88c.

Reason for revert: will come up with a strategy and discussion for
handling privacy concerns regarding being able to delete MediaLicense
data.

Original change's description:
> media: Remove MediaLicense* code and usage
>
> This CL deletes a lot of the MediaLicense* code and usages of it from
> the codebase.
>
> OBSOLETE_HISTOGRAMS=No longer using the MediaLicense* code.
>
> Bug: 40272342
> Change-Id: I46a2d8bf53ca684467255b6e21e3cd7e1441c4c4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904345
> Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
> Reviewed-by: Evan Liu <evliu@google.com>
> Reviewed-by: Evan Stade <estade@chromium.org>
> Reviewed-by: John Rummell <jrummell@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1372190}

Bug: 40272342
Change-Id: I1cbb4669d932ec153b1aae59a6b5164a6afde2ea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5955369
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Evan Liu <evliu@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372853}
2024-10-23 18:46:30 +00:00
Vikram Pasupathy
e307cce88c media: Remove MediaLicense* code and usage
This CL deletes a lot of the MediaLicense* code and usages of it from
the codebase.

OBSOLETE_HISTOGRAMS=No longer using the MediaLicense* code.

Bug: 40272342
Change-Id: I46a2d8bf53ca684467255b6e21e3cd7e1441c4c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904345
Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
Reviewed-by: Evan Liu <evliu@google.com>
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1372190}
2024-10-22 18:24:24 +00:00
Liang Zhao
11eecbbd95 Use clearer parameter name in CreateLoginDelegate
The is_request_for_primary_main_frame parameter of CreateLoginDelegate()
could mean whether the request is for any resources in the primary main
frame, or whether the request is for primary main frame navigation.

The current name has confused people and caused bugs. The bugs were
fixed in http://crrev.com/c/5882129. As a follow up of that change, this
change adds _navigation to the parameter name to make it clear so that
we don't have this confusion in the future.

Bug: 40792637
Change-Id: I6cb8f729b703ad2ca23488287436424a10a3ace8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910076
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Liang Zhao <lzhao@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1367732}
2024-10-11 20:11:51 +00:00
Vikram Pasupathy
84b36cccd4 media: Remove use of kCdmStorageDatabase* flags
As we move on to using just the CdmStorageDatabase, remove the flags for
cleanup.

testing: tests pass, I also verified storage functionality works by
playing with persistent state required in Integration Console.

OBSOLETE_HISTOGRAMS=No longer doing the migration.

Bug: 40272342
Change-Id: I1029ff67b35639040a9abbc564725eac4d069149
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5905186
Reviewed-by: Evan Liu <evliu@google.com>
Reviewed-by: John Rummell <jrummell@chromium.org>
Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1364241}
2024-10-04 15:46:48 +00:00
Liang Zhao
df26ee6b96 Fix basic auth issues for sub frame and sub resources
There is a is_main_frame parameter used by basic authentication handling
code to interact with WebRequestAPI and login dialog showing code, and
that parameter is not set correctly for certain scenarios.

For WebRequestAPI, the parameter is used to adjust child_id to -1 of
proxied_request_id in WebRequestAPI::MaybeProxyAuthRequest for correctly
identifying the request. However, WebRequestAPI code uses -1 as
render_process_id not by whether it is main frame, but by whether it is
navigation. Therefore, with current code, we will not receive
onAuthRequired for sub frame navigations.

For login dialog showing code, it behaves differently by whether it is
main frame navigation or other requests. However, basic authentication
handling code in StoragePartitionImpl::OnAuthRequired treat this
parameter as meaning requests for main frame navigation or subresource
requests in main frame when the frame is under service worker.
Therefore, with current code, we will not show login dialog for
subresources when the page is under service worker control.

To fix the issues, we add another parameter to indicate whether it is a
request for navigation and use that when interacting with WebRequestAPI,
and correctly set is_main_frame as false for subresource requests when
the page is under service worker control.

Added WebRequestAPI tests for sub frame navigation and sub resource
request, for the cases where the page is under service worker control
and where it is not under service worker control.

Also updated ServiceWorkerBasicAuthTest to reflect the correct
expectation for subresource requests, and expand the tests to cover both
the case where the page is under service worker control and not under
service worker control.

Bug: 40676156,40792637,41459173
Change-Id: I6a716ec0228fcb2332a985c15c9bffbabb4a4dde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5882129
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Liang Zhao <lzhao@microsoft.com>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363749}
2024-10-03 18:16:53 +00:00
Yao Xiao
54360bec74 [locks] Template the LockManager class on LockGroupIdType
This allows lock requests to be identified by types beyond just storage
bucket IDs. This generalization supports use cases like the shared
storage web locks proposal ([1]), which requires its own lock scope
(i.e. per-origin) without integrating with storage buckets or the quota
database. The term "bucket" has been replaced with the more generic
"lock_group" throughout the code.

[1] https://github.com/WICG/shared-storage/pull/199

Bug: 368816425
Change-Id: Iaabd48c4fc5e64d302b2efdadba5cac6f99ebe3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5879028
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1362083}
2024-09-30 23:17:39 +00:00
Evan Stade
cbb1e00cda IDB: legibility-focused cleanups, part 2.
Add indexed_db namespace and remove IndexedDB prefix from many classes.

The indexed_db namespace already existed but was used sparingly. Use it
more thoroughly in //content/browser/indexed_db and
//components/services/storage/indexed_db

Bug: none
Change-Id: Id4bb701a86bd25645737bd045b71d4964adef422
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5854146
Reviewed-by: Mike Wasserman <msw@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: John Lee <johntlee@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1355379}
2024-09-13 20:06:57 +00:00
Evan Stade
753e745fd8 IDB: cap the number of backend threads at the number of cores.
This limitation is set to roughly the largest number of threads that a
legitimate site could want to use.

This defines a "site" as a storage key's `top_level_site()` rather than
a storage key, in case a single site tries to get around this cap by
embedding a lot of iframes. But mostly this limitation is designed to
keep honest sites honest and not to defend against bad actors, as there
are many other ways to use up a lot of system resources and a DOS is
not normally considered a security bug.

Bug: 40279485
Change-Id: Ibbdc9a64c980910e84317631feea3ebd93b95221
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5827820
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1353425}
2024-09-10 17:05:14 +00:00
Mark Rowe
90ae26e224 Shut down PlatformNotificationContext before BrowserContext is destroyed
PlatformNotificationContext, and the PlatformNotificationServiceProxy
that it owns, hold pointers to the BrowserContext and
PlatformNotificationService that need to be cleaned up before those
objects are destroyed.

Fixed: 40278076
Change-Id: Icb47cc325fa433e4415bc0cd0b45bc84dfc00f9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5824940
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Mark Rowe <markrowe@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1350442}
2024-09-03 22:27:17 +00:00
Andrew Verge
5bded18ec5 Clean up stale nonces used for network revocation after a delay.
When a fenced frame has its network access revoked, the associated
partition and credentialless iframe nonces are sent to the
network service. There, the nonces are stored and used to prevent
requests from being sent. When a fenced frame is destroyed, those
nonces will now be removed from the network service and the
associated data structure in StoragePartitionImpl.

The removal occurs after a one-minute delay in order to prevent a
race, where a fenced frame could sent requests while it is being
torn down because the nonce was cleaned up immediately.

This CL contains a fairly simple unit test in the network context,
but the browsertest is unfortunately much more involved; I had to
add some kinda gross test-only code to shorten the delay and
notify that cleanup was finished, as well code to manually send
network requests with the fenced frame nonce after the frame
is destroyed.

Change-Id: I15718fa0daa540c25f268418fa217bad8770b8be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5787550
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Andrew Verge <averge@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344298}
2024-08-20 18:48:30 +00:00
Abhishek Shanthkumar
76a4eeee4b IDB: Use strongly-typed tokens to identify IndexedDB clients
Currently, `IndexedDBClientStateCheckerFactory::InitializePendingRemote`
generates an `UnguessableToken` tied to the "associated RFH" of the
`BucketContext` if it exists, else a random one per call.

Conceptually, this token represents the "client" of an IndexedDB factory
which can be a render frame, a dedicated worker, a shared worker, or a
service worker. However, we need dedicated workers and their parent
render frames to be represented by the same token since the main use of
this token is to prevent a page (along with its dedicated workers) from
blocking itself from the BFCache - see https://crbug.com/343519262.

But this requirement is buried in the nuances of the implementations of
`BucketContext::GetAssociatedRenderFrameHostId()` and
`InitializePendingRemote()`, which led to the above bug. In addition,
because this token is not derived from one of the existing Blink tokens
that represent the above potential clients of IndexedDB, we had to add
an explicit method to get the DevTools token for the client from the
`IndexedDBClientStateChecker` to implement additional functionality in
https://chromium-review.googlesource.com/c/chromium/src/+/5607565.

This CL addresses both these problems by formalizing the concept of an
IndexedDB client in terms of existing tokens defined by Blink. This
"`BucketClientInfo`" is plumbed through to those IndexedDB classes that
already know the concept of a storage "Bucket" through existing classes
such as `BucketInfo` and `BucketId`.

Because the tokens used in `BucketClientInfo` are now derived from
existing Blink tokens, we don't need an explicit `GetDevToolsToken()`
method anymore and `IndexedDBInternalsUI` can get a handle to the
`DevToolsAgentHost` directly from `BucketClientInfo`.
Also, since `BucketClientInfo` is passed down to the indexeddb-internals
page, we can expose additional information about the clients (such as
the type - tab or specific worker), URL, etc. in future CLs.

Bug: 349019967, 336960312
Change-Id: I173dc836a1616b574368e8c65c98fc70b1a5ec09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5708948
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Abhishek Shanthkumar <abhishek.shanthkumar@microsoft.com>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Brad Triebwasser <btriebw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344284}
2024-08-20 18:26:40 +00:00
Hiroshige Hayashizaki
0ea108755f Rename to reconnectable_url_loader_factory.h/cc
Bug: 346686150
Change-Id: I9e72208c4861b46d18657eff20b12c37ce5e593e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5627157
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1332264}
2024-07-24 12:26:35 +00:00
Hiroshige Hayashizaki
9e5b4df742 Introduce ReconnectableURLLoaderFactoryForIOThreadWrapper
This CL introduces `ReconnectableURLLoaderFactoryForIOThreadWrapper`,
to merge `StoragePartitionImpl::url_loader_factory_getter_`
and `shared_url_loader_factory_for_browser_process_`.

This is preparation for [1] that creates two sets of
`ReconnectableURLLoaderFactory*`s for internal/WebPlatform requests,
and merging two `ReconnectableURLLoaderFactory*` members into one
in `StoragePartitionImpl` makes [1] easier.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/5649232

This CL also adds comments and thread checks.

Bug: 41497033, 346686150
Change-Id: Ie2fdd3ab9303eb1017b9f9d475201c2036b10936
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5627156
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1332262}
2024-07-24 12:22:19 +00:00
Hiroshige Hayashizaki
8cff22e453 Rename URLLoaderFactoryGetter to ReconnectableURLLoaderFactoryForIOThread
Mechanical changes that don't change the behavior as a preparation
for https://chromium-review.googlesource.com/c/chromium/src/+/5627156.

Also
- Makes CONTENT_EXPORT per-class.
- Adds `using CreateCallback`, `final`, `default`.
- Renames methods to align with `ReconnectableURLLoaderFactory`:
  `FlushNetworkInterfaceForTesting` -> `FlushOnIOThreadForTesting`,
  `FlushNetworkInterfaceOnIOThreadForTesting` -> `FlushForTesting`,
  `GetPendingNetworkFactory` -> `CloneForIOThread`.

Bug: 346686150
Change-Id: I1a3e0ee9b6bbf2b9b2fdf01712376ff826abb6ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5700712
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1329323}
2024-07-18 05:11:10 +00:00
Hiroshige Hayashizaki
2e22653bda Create service_worker_client.h/cc
Split from service_worker_container_host.h/cc.

Mostly mechanical changes + minor fixes around includes and forward
declarations.

Bug: 336154571
Change-Id: I472c7cd0e9ac46866b84fcddf677decf8522bc72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5715662
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1329281}
2024-07-18 02:30:31 +00:00
Dan McArdle
a9fa67478c GlobalRequestID: Avoid unwanted inlining and narrowing int conversions
This CL moves the definition of GlobalRequestID::MakeBrowserInitiated()
out of the header file to prevent inlining. The method relies on a
static local atomic to guarantee that it vends unique IDs. Although a
statically-linked binary would only have a single definition for
MakeBrowserInitiated(), component builds could be problematic. If there
were multiple copies of MakeBrowserInitiated(), it would not be
guaranteed to vend unique IDs.

Separately, this CL also sidesteps some implementation-defined narrowing
integer conversions related to the `child_id` and `request_id` fields.

Bug: 352690892, 40065303
Change-Id: I49ac933a663bbce225b1098f38c8d4e5dfe3d237
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5702737
Reviewed-by: Joe Downing <joedow@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1328175}
2024-07-16 15:13:50 +00:00
Hiroshige Hayashizaki
1824b2518c Introduce StoragePartitionImpl::FlushNetworkInterfaceOnIOThreadForTesting()
To remove direct references to `URLLoaderFactoryGetter`
in content/browser/network_service_restart_browsertest.cc.

Bug: 346686150
Change-Id: I6d629da0c57d09eaac134d74b644714d283aef94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5648548
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1326814}
2024-07-12 16:30:42 +00:00
Hiroshige Hayashizaki
1b0ca5a9b0 Create shared_url_loader_factory_for_browser_process_ eagerly
So that `url_loader_factory_getter_` and
`shared_url_loader_factory_for_browser_process_`
(that will be merged in
https://chromium-review.googlesource.com/c/chromium/src/+/5627156)
have similar lifetime and initialization timing.

The behavior should be observably the same, as constructing
`ReconnectableURLLoaderFactory` itself is merely lightweight
initialization.

Bug: 346686150
Change-Id: I4a6617529bc2321d4e84a0b7801485a144d14498
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5641880
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1326805}
2024-07-12 16:20:46 +00:00
Hiroshige Hayashizaki
d0f54aac6a [4] Use CreateURLLoaderFactoryForBrowserProcessInternal in URLLoaderFactoryGetter
To unify how the underlying URLLoaderFactory is created
in two similar paths:

- ReconnectableURLLoaderFactory /
  StoragePartitionImpl::GetURLLoaderFactoryForBrowserProcess()
- URLLoaderFactoryGetter /
  StoragePartitionImpl::GetURLLoaderFactoryForBrowserProcessIOThread()

This CL makes URLLoaderFactoryGetter to call
StoragePartitionImpl::CreateURLLoaderFactoryForBrowserProcessInternal
via `CreateCallback`, just like the
GetURLLoaderFactoryForBrowserProcess path does.

The diff from the previous
`URLLoaderFactoryGetter::HandleNetworkFactoryRequestOnUIThread()`
is to add the URLLoaderInterceptor on the UI thread.

Therefore this CL removes the URLLoaderFactoryGetter interceptor:
Instead of intercepting
`URLLoaderFactoryGetter::GetURLLoaderFactory()` on IO thread,
the general UI thread interceptor intercepts the requests on
UI thread.

Bug: 346686150
Change-Id: I3018c1b95a4490758bd1886c61888de200c36e30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5624793
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1326765}
2024-07-12 14:45:50 +00:00
janiceliu
2457d49d76 Remove SupportPartitionedBlobUrl feature flag
The flag now acts as always-enabled.

Bug: 346498600
Change-Id: Ifb4c977a748149e9e10ae68066cd960d137a5e4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5647510
Reviewed-by: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: David Baron <dbaron@chromium.org>
Auto-Submit: Janice Liu <janiceliu@google.com>
Commit-Queue: Janice Liu <janiceliu@google.com>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1324991}
2024-07-09 18:15:57 +00:00
Hiroshige Hayashizaki
b745cdb363 Introduce ReconnectableURLLoaderFactory
This CL decouples
`StoragePartitionImpl::URLLoaderFactoryForBrowserProcess`
from `StoragePartitionImpl` and introduces it as a general
URLLoaderFactory with reconnection support.

Instead of calling Shutdown() explicitly,
`ReconnectableURLLoaderFactory` relies on `WeakPtr` invalidation.

ReconnectableURLLoaderFactory is placed in
content/browser/url_loader_factory_getter.h/cc
because ReconnectableURLLoaderFactory and
URLLoaderFactoryGetter will be merged in
https://chromium-review.googlesource.com/c/chromium/src/+/5627156.

This CL shouldn't change the behavior.

Bug: 346686150
Change-Id: I0528ea2c6bd1364ae375f297de6ba7ee57e7a362
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5624790
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1324727}
2024-07-09 08:15:14 +00:00
Devlin Cronin
df260f5e98 [Extensions] Allow service worker requests to continue without a cert
Certain requests may request, but not require, a client cert. Today,
this will result in one of three things happening if there isn't a
client cert available (either from a previous request or from
enterprise policy):
1) The request will fail
2) The user will be shown a cert picker dialog
3) The request will continue without a certificate

On desktop platforms for WebContents-based requesting contexts:
* If there are no certs to choose from, the request will continue
  without a cert.
* If there are client certs and the WebContents supports showing
  dialogs, the cert picker will be shown.
* If there are certs and the WebContents does not support showing
  dialogs, the request will fail.

On Android for WebContents-based requesting contexts:
* We will always call out to the native cert-picker, which may or
  may not show a dialog (depending on other device configurations
  which Chrome doesn't know about).

On desktop and Android platforms for service worker requesting
contexts:
* The request will always fail.

This CL changes this behavior to allow requests from extension
background service workers to proceed without a client cert if there
are no certs to choose from; this then matches the behavior for
extension background and offscreen WebContents (which do not support
showing dialogs).

Bug: 333954429
Change-Id: Ia6111f3bd499998d6244945daa13ac67774804bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5455480
Reviewed-by: Emily Stark <estark@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1322530}
2024-07-03 02:13:39 +00:00
Mariam Ali
40020cda88 [Code Health] Add LINT.IfChange to BrowsingData TracingDataType
Since multiline/multipath is currently unsupported; for enums that
require multiple file changes (e.g. histograms.xml and enums.xml) I've
used the following chain:
C++ declaration > enums.xml > histograms.xml > C++ declaration

NO_IFTTT=Adding linter not changing it.

Bug: 348206841
Change-Id: I97f4741f40592c7bd4be32e5de17236acc2bb34c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645378
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Auto-Submit: Mariam Ali <alimariam@google.com>
Commit-Queue: Mariam Ali <alimariam@google.com>
Cr-Commit-Position: refs/heads/main@{#1320198}
2024-06-27 06:56:11 +00:00
Hiroshige Hayashizaki
29a5e219a9 Introduce ServiceWorkerClientOwner
To allow updating the key of `service_worker_clients_by_uuid_`
correctly from `ServiceWorkerClient::UpdateUrls()`
even after `ServiceWorkerContextWrapper::DidDeleteAndStartOver()`,
this CL splits the client-ownership-related members from
`ServiceWorkerContextCore` into a new class
`ServiceWorkerClientOwner`.

`ServiceWorkerClient::owner_` keeps access to
`ServiceWorkerClientOwner` while `ServiceWorkerClient::context_` is
still cleared on `DidDeleteAndStartOver`.
A regression test will be added in
https://chromium-review.googlesource.com/c/chromium/src/+/5590788.

The DCHECK() in OnContainerHostReceiverDisconnected()
(that would fail with the regression test without this CL)
is turned to CHECK() to confirm the correctness.

Bug: 336154571, 344130634
Change-Id: If772d4f38749ed0ead3937084287e1c1c26259ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5587598
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1313606}
2024-06-11 19:46:52 +00:00
Abhishek Shanthkumar
0d9abbe3f3 Revert "Use the ReceiverId from IndexedDBBucketContext as the client token in IndexedDBConnection"
This reverts commit 492d39da83.
Reason for revert: Caused bug 343519262.

Bug: 343519262
Change-Id: I82c6092265fce7cc141a732af3e403ecc8ef1138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5587236
Commit-Queue: Abhishek Shanthkumar <abhishek.shanthkumar@microsoft.com>
Reviewed-by: Brad Triebwasser <btriebw@chromium.org>
Auto-Submit: Abhishek Shanthkumar <abhishek.shanthkumar@microsoft.com>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1311685}
2024-06-07 01:28:00 +00:00
Ari Chivukula
13c99716e4 [Cookies] Prototype clearing stale session cookies on browser startup
Currently, session cookies can be retained indefinitely as long as
session restore is on (which is true by default).

This may not be desirable or expected, and is not behavior replicated
by WebKit or Firefox.

This CL implements one potential approach to clearing stale session
cookies. It defines stale as not read or written within 7 days and
clears session cookies after the session restore has completed.

This is off by default and will not be turned on by default for some
time.

Bug: 40285083
Change-Id: I30a209e4b20f5283ab015c311887c943a3e3976e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5580590
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@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@{#1308720}
2024-05-31 17:02:16 +00:00
Maks Orlovich
b3b49c576f Add a metric to try to detect when something breaks cookies incremental load.
...since that's easy to break by accident, and would slow down loading
of pages right after startup by making them block until all cookies are
loaded.

This is expressed a a time metric since it actually happens for the
special safe browsing cookiejar, but it doesn't matter there since
that has ~1 cookie.

... And remove kPreloadCookies experiment which did that for field
trial config, but thankfully not for real world, while trying to
accomplish the exact opposite.

Bug: 40225126
Change-Id: I602572844a17e5e56ed2a11868598cdd6db51712
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5581882
Reviewed-by: Steven Bingler <bingler@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1308631}
2024-05-31 14:58:53 +00:00
Abhishek Shanthkumar
492d39da83 Use the ReceiverId from IndexedDBBucketContext as the client token in IndexedDBConnection
`IndexedDBConnection` maintains a token identifying the client that
initiated the connection to support certain BFCache scenarios.
See https://chromium-review.googlesource.com/c/chromium/src/+/5203165.
This token is currently generated by
`IndexedDBClientStateCheckerFactory` based on the RFH ID of the client.

However, `IndexedDBBucketContext` - which implements the `IDBFactory`
interface and creates the IDB connections - can uniquely identify the
client by the `ReceiverId` of the mojo call creating the connection.
Hence, this CL passes the `ReceiverId` returned by `current_receiver()`
as the `client_token_` to `IndexedDBConnection`.

This CL has no functional changes and will help with further planned
work in this space, as discussed in the linked bug.

Bug: 336960312
Change-Id: Ibd10331f8034db5b076f8c9525dde027e55cb505
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5529157
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Brad Triebwasser <btriebw@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Brad Triebwasser <btriebw@chromium.org>
Auto-Submit: Abhishek Shanthkumar <abhishek.shanthkumar@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1299392}
2024-05-10 18:40:58 +00:00
Hiroshige Hayashizaki
e5cf92d846 [ServiceWorkerClient] Rename method names
Mechanical: Follow-up of
https://chromium-review.googlesource.com/c/chromium/src/+/5451439.

AddServiceWorkerContainerHost -> AddServiceWorkerClient
CanFindClientContainerHost -> CanFindServiceWorkerClient
ContainerHostByClientUUIDMap -> ServiceWorkerClientByClientUUIDMap
ContainerHostPredicate -> ServiceWorkerClientPredicate
CreateContainerHost* -> CreateServiceWorkerClient*
GetContainerHostByClientID -> GetServiceWorkerClientByClientID
GetContainerHostByWindowId -> GetServiceWorkerClientByWindowId
GetLastCommittedServiceWorkerHost -> GetLastCommittedServiceWorkerClient
InitializeContainerHost -> InitializeServiceWorkerClient
PrepareServiceWorkerContainerHost* -> PrepareServiceWorkerClient*
RemoveServiceWorkerContainerHost -> RemoveServiceWorkerClient
UpdateContainerHostClientID -> UpdateServiceWorkerClientClientID

Bug: 336154571
Change-Id: Ied46f421a3c3e4926e5f25eebfbdec7918c67460
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5504405
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1297687}
2024-05-07 18:59:01 +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
1b714a9e4f WebSQL: Restrict WebSQL service creation to Android only
This change restricts WebSQL service creation to Android
only. WebSQL is fully removed from all platforms in M119
except for Android WebView(crbug.com/333756088). Next step
will be to delete WebSQL data for removed platforms.

Intent thread: https://groups.google.com/a/chromium.org/g/blink-dev/c/fWYb6evVA-w/m/wGI863zaAAAJ

Bug: 40910849
Change-Id: I9a52cfe900f041d57b301faa6584077c19be6137
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459367
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1291927}
2024-04-24 16:41:04 +00:00
Sharon Yang
417a5df82b Add NavigationStateKeepAlive map to StoragePartition
Move the map of PolicyContainerHosts keyed by LocalFrameToken from
PolicyContainerHost to StoragePartition. This changes how
PolicyContainerHosts are accessed. Previously there was a global map of
LocalFrameTokens to PolicyContainerHosts. Now there is a map on
StoragePartition of LocalFrameTokens to NavigationStateKeepAlives, from
which the PolicyContainerHost can be accessed. If there is not a
NavigationStateKeepAlive, the PolicyContainerHost should be accessed
directly from the RenderFrameHost.

This also introduces a source SiteInstance to NavigationStateKeepAlive
to be kept alive. This also implicitly keeps the associated
SiteInstanceGroup alive.

Navigations initiated from a different StoragePartition do not inherit
origins or policies across StoragePartitions, so the PolicyContainerHost
and source SiteInstance will not be leaked across StoragePartition
boundaries (e.g. in <webview> tags).

some NavigationPolicyContainerBuilder unit tests to browser tests
PERFETTO_TESTS=`autoninja -C out/Default perfetto_diff_tests && out/Default/bin/run_perfetto_diff_tests`

Test: Enable NavigationBrowserTest that was added previously, move
Bug: 323753235
Change-Id: I8924a8f75831e3b3da2922024349632fe057bfe6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5311170
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Sharon Yang <yangsharon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1291412}
2024-04-23 17:57:15 +00:00
Xiaochen Zhou
feaf33a36f Fenced frames: Restore network revocation nonces when Network
Service crashes.

NetworkContext has a member `network_revocation_nonces_`, which is a
set of nonces whose network access is revoked. When NetworkService
crashes, it will destroy its NetworkContext.

When NetworkContext is recreated, `network_revocation_nonces_` must be
restored to the state before the crash. This is done using the copy of
nonces saved in StoragePartition. Otherwise, fenced frames that
previously have network disabled and got access to cross-site data,
will regain network access.

Bug: 41488151
Change-Id: If84d1b592b6c2500fa90439c5db7fe1ec6f60ca7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5440136
Reviewed-by: mmenke <mmenke@chromium.org>
Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Commit-Queue: Xiaochen Zhou <xiaochenzh@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1291270}
2024-04-23 14:51:51 +00:00
Chris Fredrickson
20b0dd0054 Move RuntimeFeatureStateDocumentData to //content/public
This is required for callers outside of //content to be able to use
this state.

Bug: 330574529, 40243430
Change-Id: If31bcb3c38a0111ce9d01fd2189e629810e34e4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5472791
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290802}
2024-04-22 18:39:17 +00:00
Alison Gale
d94ce4fa45 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: Iebe070b9ed793ecdfc43c3a3570f1808b7ddd221
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5470014
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290677}
2024-04-22 15:20:39 +00:00
Alison Gale
47d1537de7 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: Ieeb461e2d489e86fd50b87a2a0721a2be34520c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5467317
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Darryl James <dljames@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290198}
2024-04-19 21:31:46 +00:00
Christian Dullweber
2fa80d1b88 StoragePartition: Replace BarrierClosure with ConcurrentClosures
ConcurrentClosures doesn't require to know the callback count ahead
of time and therefore reduces the risk of errors or unnecessary
Run() calls for branches that don't actually have a task to run.
This CL replaces a couple of tricky barriers with concurrent closures.

Change-Id: Idad3e9e03882c66560ceb340ba0cc65b0ec39fff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5453661
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Auto-Submit: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1289819}
2024-04-19 09:06:20 +00:00
Vikram Pasupathy
c09a869ea3 chrome: Move deletion splitting logic into CdmStorageManager
This CL moves the business logic from the already long function
ClearDataOnUIThread to the CdmStorageManager so the splitting is done
closer down and the long function doesn't become longer.

Bug: 40272342
Change-Id: Ib680cee549c4f27b4243b8f174762e0bc9f9c188
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5377658
Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1281350}
2024-04-02 18:56:03 +00:00
Evan Stade
1fd200cfc9 Reapply "IndexedDB: simplify IndexedDBControlWrapper"
This reverts commit 983fc08f8c.

The difference to the original version of this patch is that
`IndexedDBControlWrapper` no longer observes `IndexedDBContextImpl`
via mojo.

Bug: 40947125,717812
Change-Id: I40a01b4579830eca4ff89c44bceade2e4244ca68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5393295
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1278591}
2024-03-26 21:06:00 +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
Vikram Pasupathy
e72010228a media: Add Deletion functionality by Filter
Some clear browsing history / data functionality use filters rather
than specifying storage_keys to delete. This CL now adds the delete
by filter functionality to the CdmStorageDatabase data, along with
enabling the browsing_data_remover browsertests for Filter, and unit
tests to test the deletion by filter functionality.

chrome: Populate CdmStorageDatabase data in Site Data Counter
Bug: 1454512, 40926576
Change-Id: I8223aafbd28544309f01d92891f8fbceb8a439db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5365810
Reviewed-by: Evan Liu <evliu@google.com>
Reviewed-by: John Rummell <jrummell@chromium.org>
Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1275284}
2024-03-19 23:21:08 +00:00
Vikram Pasupathy
2ce676b02a chrome: Populate CdmStorageDatabase data in Site Data Counter
CdmStorageDatabase data is now counted via the site_data_counting_helper
so now we can enable browsing_data_remover_browsertest to test out the
deletion and counting usage functions of the CdmStorageDatabase.

There is a TODO to implement deletion via filter, and to enable the test
once the deletion via filter is implemented. A stub method is added for
now, the CL to implement that will come soon.

Bug: 1454512
Change-Id: I9970b82260cfe095c78f4a86f9623a98c3e70719
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5366261
Reviewed-by: John Rummell <jrummell@chromium.org>
Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1275282}
2024-03-19 23:19:57 +00:00
Arno Renevier
7376778a32 Remove incorrect DCHECK in SSLClientAuthDelegate::ContinueWithCertificate
There are multiple ways by which private key can fail from being acquired.

Bug: 1521511
Change-Id: Ic02cc8271e85524f477219d98e8c4ee4c6d0dce8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5248207
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274435}
2024-03-18 21:00:14 +00:00
Jonathan Hao
3e33cb08b8 [Private Network Access] Log UseCounter for WebSocket
Delegate the OnConnected from net to the network service, which then
makes an IPC call to content browser which can then log the use counter
to the right frame.

Bug: 40234396
Change-Id: Ie9cf91aad6614ac28b117a5c51009e096d1fed7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5291080
Auto-Submit: Jonathan Hao <phao@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Commit-Queue: Jonathan Hao <phao@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269153}
2024-03-06 19:36:01 +00:00
Sharon Yang
302213dc65 Introduce a general navigation state keep alive object
This moves the keepalive behaviour that was previously on
PolicyContainerHost to a separate NavigationStateKeepAlive class. The
Blink mirror mojo remote mechanism remains the same, but the definitions
have moved.
There is now one mojo UniqueReceiverSet per storage partition.
Previously, there was one per PolicyContainerHost (and thus
RenderFrameHost). This UniqueReceiverSet can have receivers for multiple
RenderFrameHosts, and multiple receivers per RenderFrameHost (e.g., for
multiple queued navigations).

behaviour change

Test: Covered by NavigationBrowserTest.FormSubmission* tests, minimal
Bug: 323753235
Change-Id: If120e495c228d687e3624d53344e72b5e8cacbeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5278216
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Antonio Sartori <antoniosartori@chromium.org>
Commit-Queue: Sharon Yang <yangsharon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269131}
2024-03-06 19:03:44 +00:00
Vikram Pasupathy
edd7591f93 [Browsing Data Model] Add CdmStorageDataModel interface
As part of the effort to integrate the CdmStorageDatabase with the
BrowsingDataModel, we add an interface CdmStorageDataModel to expose
functions that are requisite in the integration with BrowsingDataModel.

Implementation will be done in another CL.

Bug: 1454512
Change-Id: I848a9d9610a68026bde6c3a5e10d5588af2c1ba6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5296881
Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1263755}
2024-02-22 02:28:58 +00:00
Daniel Vogelheim
be92f4cc2f Rename URLLoaderFactoryParams::is_corb_enabled to is_orb_enabled.
This is part of cleanup work to remove CORB code, now that its successor ORB has been enabled. This particular CL is a rename, and should be functionally neutral.

Bug: 324418206
Change-Id: I77143b897e4957a41e21c59630f1dd5a2575866a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5277040
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Alex Turner <alexmt@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Matt Mueller <mattm@chromium.org>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1260357}
2024-02-14 10:03:33 +00:00
John Abd-El-Malek
f2592dba26 Reduce large includes in storage_partition_impl.h
The issue is that render_frame_host_impl.h is very large [1], and the biggest include by an order of a magnitude is storage_partition_impl.h. The biggest two includes there by more than an order of a magnitude are network_context.mojom and cert_verifier_service.mojom [2]. The former is needed because StoragePartitionImpl derives from NetworkContextClient, which this cl moves to a separate mojom, and mojo::Remote<NetworkContext> which is moved to a forward declared inner class. The latter is needed for CertVerifierServiceUpdater which is likewise moved to its own file.

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/chrome_includes_2024-02-08_120812.html#view=edges&filter=%5Econtent%2Fbrowser%2Frenderer_host%2Frender_frame_host_impl%5C.h%24&sort=asize&reverse=&includer=%5Econtent%2Fbrowser%2Frenderer_host%2Frender_frame_host_impl%5C.h%24&included=&limit=1000
[2] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Econtent%2Fbrowser%2Fstorage_partition_impl%5C.h%24&sort=asize&reverse=&includer=%5Econtent%2Fbrowser%2Fstorage_partition_impl%5C.h%24&included=&limit=1000

Bug: 324512302
Change-Id: I9ed249738f9a15f3415f8bae26c58565d9fbda78
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5280714
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Owners-Override: John Abd-El-Malek <jam@chromium.org>
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1259050}
2024-02-12 07:20:23 +00:00