0
Commit Graph

528 Commits

Author SHA1 Message Date
Aaron Selya
7b7b3bad72 Remove usages of feature that disabled ancestor chain bit
Following the successful deployment of the feature
kAncestorChainBitEnabledInPartitionedCookies being enabled by default
and metrics showing that there is no longer usage of users disabling it.
Usages of the flag are being removed and all code that utilized the
feature is being refactored to reflect a state in which the feature is
enabled.

OBSOLETE_HISTOGRAM[Cookie.FirstPartyPartitioned.HasCrossSiteAncestor]=
Feature that metric was tracking has been removed.

Bug: 328043119
Change-Id: Ifc0ccfba6cbac610c3c26370c0393b4a005fbbbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6316346
Reviewed-by: Steven Bingler <bingler@chromium.org>
Reviewed-by: Dylan Cutler <dylancutler@google.com>
Auto-Submit: Aaron Selya <selya@google.com>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Aaron Selya <selya@google.com>
Reviewed-by: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1427719}
2025-03-04 07:31:54 -08:00
Ari Chivukula
ad58ed0ff7 [Clear-Site-Data] Switch parsing issues from kError to kWarning
JS metrics are being skewed by parsing errors in the Clear-Site-Data
header. It's reasonable to bump these down to warnings since
they are basically notices that a header was ignored.

Bug: 399862589
Change-Id: I9298899d58e27d29b82275b50d01e240595faf76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6311715
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426550}
2025-02-28 13:55:29 -08:00
Ryan Tarpine
a9bdd13cde [BTM] Rename files/directories prefixed with "dips" to "btm".
Fixed: 399868999
Change-Id: Ibef87018728bad5e5deafbf4a76a25b6b08dba8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6309330
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426513}
2025-02-28 12:29:34 -08:00
Ayu Ishii
6ecd458052 Quota: Cleanup StorageType in QuotaManagerProxy
This change removes some usages of StorageType in QuotaManagerProxy.
After StorageType::kSyncable deprecation, all other storage types
except kTemporary are deprecated. So we no longer need to specify
StorageType. Further cleanup to remove usage from QuotaManager,
QuotaDatabase, etc. will follow.

Bug: 40211051
Change-Id: Iba5caa5aefcc346cbcf9e7aac3f05ab33ca53d61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6306646
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426466}
2025-02-28 11:05:45 -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
Ayu Ishii
e5aa2112ed Quota: Cleanup usages of StorageType in QuotaManagerProxy
This change removes some usages of StorageType from
QuotaManagerProxy. All other StorageTypes except
StorageType::kTemporary have been deprecated. Therefore
no longer need to pass this value around. Further cleanup
to remove usages from
QuotaManagerProxy/QuotaManager/QuotaDatabase will follow.

Bug: 40211051
Change-Id: I0aa5413fc6ced600d25ad446ec0281fbd1181074
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6279419
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Ming-Ying Chung <mych@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1424923}
2025-02-25 18:43:20 -08:00
Steven Wei
893cb02c28 Cancels prerenders when browsing data removal is run.
This change cancels all the existing prerenders when browsing data
removal is run on cached data. This can be triggered by the Delete Browsing Data option or with Clear-Site-Data response headers. Developer Tools will now also show the previously successful prerender(s) as failed. A new PrerenderFinalStatus is added specifically for this case.

nav-speculation spec PR: https://github.com/WICG/nav-speculation/pull/361

NO_IFTTT=Changes for PrerenderFinalStatus will be done in separate repositories.

Bug: 40262311
Change-Id: Ie82895e555f3a9d4e2576686223e67443d198353
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6173154
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Steven Wei <stevenwei@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1419494}
2025-02-12 12:51:30 -08:00
Vikram Pasupathy
03242d760f media: More MediaLicense cleanup
More cleanup to remove references and masks that are not needed.

Bug: 40264778
Change-Id: I9fba404c4b5424136b645f0f30f544817139fe5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6214294
Commit-Queue: Vikram Pasupathy <vpasupathy@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414158}
2025-01-31 08:29:47 -08:00
Tom Sepez
8726d30ed0 Suppress unsafe_libc_call warning for initial identified files.
See docs/unsafe_buffers.md for details. Enforcement is not yet
enabled, but this set of files are not in compliance with the
new warnings.

Bug: 390223051
Change-Id: I4e24c2141b9399f572678302c833947494098b29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6187925
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412673}
2025-01-28 18:11:08 -08:00
Peter Kasting
1557e5fbe4 [cleanup] Replace base::ranges with std::ranges: content/
Done entirely with `git grep` and `sed` + `git cl format`, no
hand-editing.

Bug: 386918226
Change-Id: I8561612cb02c9d62c455836dba414ab402e40694
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6199140
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412009}
2025-01-27 17:14:08 -08:00
Andrew Liu
e34d893b5a [DIPS] Properly label interactions as user activations
This also renames the "user interaction" columns in the DIPS database.
We avoid changing references to interaction that legitimately refer to
both user activations and webauthn assertions, and navigationflow naming
is unchanged to maintain consistency with the UKM naming.

Bug: 371304526
Change-Id: I2cccf0701a51c6653f1ad4baa92d61b6051315ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6176303
Reviewed-by: Elias Klim <elklm@chromium.org>
Commit-Queue: Andrew Liu <liu@chromium.org>
Reviewed-by: Svend Larsen <svend@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Ryan Tarpine <rtarpine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1410696}
2025-01-23 18:52:49 -08:00
Aleksei Khoroshilov
648ae54f53 Remove DATA_TYPE_AVOID_CLOSING_CONNECTIONS from HttpAuthCache cleanup.
HttpAuthCache cleanup now only triggers disconnects when data is
actually removed (see [1]). This means we can safely trigger cache
cleanup without worrying about unnecessary connection drops, since
connections will only be closed if HTTP auth was actually used. In such
cases, the connection drop is acceptable.

1. https://chromium-review.googlesource.com/c/chromium/src/+/6163789

Bug: 388844113
Change-Id: Icf5ff4332da467efe2097836faf41ff8d8392784
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6185082
Reviewed-by: Nidhi Jaju <nidhijaju@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Aleksei Khoroshilov <akhoroshilov@brave.com>
Cr-Commit-Position: refs/heads/main@{#1408961}
2025-01-21 04:21:34 -08:00
sbingler
342e1e1952 Fix tests that break when enabling HstsTopLevelNavigationsOnly
This CL fixes or disables tests that break when
HstsTopLevelNavigationsOnly is enabled.

NetworkContextConfigurationBrowserTest.*Hsts needed to use a main frame
IsolationInfo to signify a top-level navigation.

ExtensionWebRequestApiTestWithContextType*.ExtraHeadersWithHSTSUpgrade
&
WebSocketBrowserTest*.*WebSocketAppliesHSTS
depended upon HSTS upgrades for sub-resource requests, so they were
modified to only run with the feature disabled.

ChromeNavigationBrowserTest.ErrorPageDoesNotInheritCSP seemingly has
unintentionally depended on HSTS for a while now. The fake site,
invalid.foo, gets HSTS upgraded, due to foo being on the HSTS preload list, which results in an error as the embedded server doesn't support
HTTPS. When HstsTopLevelNavigationsOnly is enabled the iframe doesn't
get upgraded and so the request for http://invalid.foo gets serviced by
the lighttpd server which returns a 403 forbidden error. Since this
isn't the error the test was expecting it fails as a result. So the
test, and it's data page, are updated so the iframe requests
https://invalid.test.

BrowsingDataRemoverImplBrowserTest.ClearTransportSecurityState
&
BrowsingDataRemoverImplBrowserTest.PreserveTransportSecurityState
needed to use a main frame IsolationInfo in their helper function.

NetworkContextIncludeRequestCookiesWithResponseTest.
HSTSRedirectClearsCookie
had a URLLoaderFactory that indicated an internal request. This was
removed and the request itself was given a main frame IsolationInfo.

The change necessary to fix
DevToolsTest.TestRawHeadersWithRedirectAndHSTS is in the DevTools repo
and will be fixed in another CL.

Bug: 40725781
Change-Id: I1f807e0e72443375f91d895bfa06ffe3b19f5a38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868542
Commit-Queue: Steven Bingler <bingler@chromium.org>
Reviewed-by: mmenke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1407958}
2025-01-17 08:42:12 -08:00
Ryan Tarpine
07610a642b Reland "[DIPS] Rename DIPS prefix to Btm."
This reverts commit f8849ddbca.

Reason for revert: Fixed bad merge with crrev.com/c/6174062

Original change's description:
> Revert "[DIPS] Rename DIPS prefix to Btm."
>
> This reverts commit 4d4b33ce5c.
>
> Reason for revert: Tree closure for compile failure
>
> Original change's description:
> > [DIPS] Rename DIPS prefix to Btm.
> >
> > This makes it match the external name (Bounce Tracking Mitigations) and
> > comply with the C++ style guide, which says "prefer to capitalize
> > abbreviations as single words".
> >
> > A followup CL will rename filename prefixes from dips_ to btm_ (and the
> > directories from dips/ to btm/).
> >
> > Bug: 388538934
> > Change-Id: I43d3f1c24632919ac8985aea5b7f2d945d2a9628
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172859
> > Owners-Override: Avi Drissman <avi@chromium.org>
> > Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
> > Reviewed-by: Avi Drissman <avi@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1406975}
>
> Bug: 388538934
> Change-Id: Ic86e19c9c3a23d7dcb014bab5bc6bc13419a0ae0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6173773
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Joey Arhar <jarhar@chromium.org>
> Owners-Override: Joey Arhar <jarhar@google.com>
> Commit-Queue: Joey Arhar <jarhar@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1406979}

Bug: 388538934
Change-Id: I9a269534fb7bd8b35dc721ed7e2b851d248133eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6180157
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1407417}
2025-01-16 10:09:29 -08:00
Joey Arhar
f8849ddbca Revert "[DIPS] Rename DIPS prefix to Btm."
This reverts commit 4d4b33ce5c.

Reason for revert: Tree closure for compile failure

Original change's description:
> [DIPS] Rename DIPS prefix to Btm.
>
> This makes it match the external name (Bounce Tracking Mitigations) and
> comply with the C++ style guide, which says "prefer to capitalize
> abbreviations as single words".
>
> A followup CL will rename filename prefixes from dips_ to btm_ (and the
> directories from dips/ to btm/).
>
> Bug: 388538934
> Change-Id: I43d3f1c24632919ac8985aea5b7f2d945d2a9628
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172859
> Owners-Override: Avi Drissman <avi@chromium.org>
> Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1406975}

Bug: 388538934
Change-Id: Ic86e19c9c3a23d7dcb014bab5bc6bc13419a0ae0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6173773
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Joey Arhar <jarhar@chromium.org>
Owners-Override: Joey Arhar <jarhar@google.com>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406979}
2025-01-15 14:35:33 -08:00
Ryan Tarpine
4d4b33ce5c [DIPS] Rename DIPS prefix to Btm.
This makes it match the external name (Bounce Tracking Mitigations) and
comply with the C++ style guide, which says "prefer to capitalize
abbreviations as single words".

A followup CL will rename filename prefixes from dips_ to btm_ (and the
directories from dips/ to btm/).

Bug: 388538934
Change-Id: I43d3f1c24632919ac8985aea5b7f2d945d2a9628
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172859
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406975}
2025-01-15 14:13:30 -08:00
Ryan Tarpine
85cecc9e8b Move ShouldDeleteInteractionRecords and delete DipsDelegate.
Move ShouldDeleteInteractionRecords() from DipsDelegate to
ContentBrowserClient, renaming it ShouldDipsDeleteInteractionRecords().

Now that there are no methods left on DipsDelegate, delete it (and
ChromeDipsDelegate).

Bug: 387281262
Change-Id: I020b806a1526a46095425a0a637ec273ca50b4f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6142815
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Joshua Hood <jdh@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1404371}
2025-01-09 12:27:06 -08:00
Steven Valdez
d037e46c96 Split out PST metrics for per-site limits.
Change-Id: I0583ab4f2f50bad454d3662473a84bc9898de243
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6133673
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Steven Valdez <svaldez@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Reviewed-by: Aykut Bulut <aykutb@google.com>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1402392}
2025-01-06 08:21:55 -08:00
Ryan Tarpine
35c4db2b9a Reland "[DIPS] Move from //chrome to //content."
This reverts commit 5783b19dd0.

Reason for revert: Fix failing bot.

Original change's description:
> Revert "[DIPS] Move from //chrome to //content."
>
> This reverts commit 8915d9509c.
>
> Reason for revert:
> https://ci.chromium.org/ui/p/chromium/builders/ci/linux-cast-x64-rel/6859/overview
>
> Original change's description:
> > [DIPS] Move from //chrome to //content.
> >
> > By moving DIPS (Bounce Tracking Mitigations) into //content, it will be
> > available for all content embedders, such as Android WebView.
> >
> > Aside from the obvious file moves, the main changes are:
> > - DIPS-related WebContentsObservers are created in
> >   WebContentsImpl::Init() instead of TabHelpers::AttachTabHelpers()
> > - No more DIPSServiceFactory: BrowserContextImpl creates and owns the
> >   DIPSServiceImpl directly
> > - No more DIPSCleanupService (nor its factory): BrowserContextImpl
> >   deletes the DIPS database file if necessary
> > - The logic to trigger DIPS data deletion moved from
> >   ChromeBrowsingDataRemoverDelegate to BrowsingDataRemoverImpl
> > - Tests have to override the ContentBrowserClient instead of setting
> >   prefs and modifying the HostContentSettingsMap to test 3PC behavior
> > - The OpenerHeuristicService was split into two pieces: the part that
> >   creates cookie grants was moved into //content as the new method
> >   BrowserContext::BackfillPopupHeuristicGrants(); and the part that
> >   observes the tracking protection settings stays in //chrome and calls
> >   that method.
> > - Many FeatureParams were moved from tpcd_experiment_features.h in
> >   //chrome to //components/content_settings/core/common/features.h
> > - components/content_settings/core/common was added to content/DEPS
> > - Renamed SiteDataAccessType to DIPSDataAccessType
> >
> > In followup CLs, we will
> > (1) Put all of the DIPS classes, functions, etc into the content namespace (crrev.com/c/6039087)
> > (2) Rename DIPS prefixes to Dips to comply with the style guide
> > (3) Change b/ bug references to crbug.com/
> > (4) Delete DipsDelegate, moving its methods to ContentBrowserClient
> >
> > Bug: 40883201
> > Change-Id: I3c07e867ae00e6817ff286a71722473c08ead624
> > Fuchsia-Binary-Size: Size increase is unavoidable - moving feature from //chrome to //content
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000406
> > Reviewed-by: Avi Drissman <avi@chromium.org>
> > Reviewed-by: Joshua Hood <jdh@chromium.org>
> > Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
> > Reviewed-by: Adam Langley <agl@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1399855}
>
> Bug: 40883201
> Change-Id: I7c74ccf088a40075dd2134d855dc4ad5ea08ae58
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6117354
> Owners-Override: Owen Min <zmin@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Owen Min <zmin@chromium.org>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#1399859}

Bug: 40883201
Change-Id: If191568901b803a8c4d1daebab27a295cbe38a0e
Fuchsia-Binary-Size: Size increase is unavoidable - moving feature from //chrome to //content
Cq-Include-Trybots: luci.chromium.try:linux-cast-x64-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6121689
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Joshua Hood <jdh@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Owners-Override: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Mike Wasserman <msw@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1400362}
2024-12-26 13:56:02 -08:00
Owen Min
5783b19dd0 Revert "[DIPS] Move from //chrome to //content."
This reverts commit 8915d9509c.

Reason for revert: 
https://ci.chromium.org/ui/p/chromium/builders/ci/linux-cast-x64-rel/6859/overview

Original change's description:
> [DIPS] Move from //chrome to //content.
>
> By moving DIPS (Bounce Tracking Mitigations) into //content, it will be
> available for all content embedders, such as Android WebView.
>
> Aside from the obvious file moves, the main changes are:
> - DIPS-related WebContentsObservers are created in
>   WebContentsImpl::Init() instead of TabHelpers::AttachTabHelpers()
> - No more DIPSServiceFactory: BrowserContextImpl creates and owns the
>   DIPSServiceImpl directly
> - No more DIPSCleanupService (nor its factory): BrowserContextImpl
>   deletes the DIPS database file if necessary
> - The logic to trigger DIPS data deletion moved from
>   ChromeBrowsingDataRemoverDelegate to BrowsingDataRemoverImpl
> - Tests have to override the ContentBrowserClient instead of setting
>   prefs and modifying the HostContentSettingsMap to test 3PC behavior
> - The OpenerHeuristicService was split into two pieces: the part that
>   creates cookie grants was moved into //content as the new method
>   BrowserContext::BackfillPopupHeuristicGrants(); and the part that
>   observes the tracking protection settings stays in //chrome and calls
>   that method.
> - Many FeatureParams were moved from tpcd_experiment_features.h in
>   //chrome to //components/content_settings/core/common/features.h
> - components/content_settings/core/common was added to content/DEPS
> - Renamed SiteDataAccessType to DIPSDataAccessType
>
> In followup CLs, we will
> (1) Put all of the DIPS classes, functions, etc into the content namespace (crrev.com/c/6039087)
> (2) Rename DIPS prefixes to Dips to comply with the style guide
> (3) Change b/ bug references to crbug.com/
> (4) Delete DipsDelegate, moving its methods to ContentBrowserClient
>
> Bug: 40883201
> Change-Id: I3c07e867ae00e6817ff286a71722473c08ead624
> Fuchsia-Binary-Size: Size increase is unavoidable - moving feature from //chrome to //content
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000406
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Joshua Hood <jdh@chromium.org>
> Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
> Reviewed-by: Adam Langley <agl@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1399855}

Bug: 40883201
Change-Id: I7c74ccf088a40075dd2134d855dc4ad5ea08ae58
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6117354
Owners-Override: Owen Min <zmin@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Owen Min <zmin@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1399859}
2024-12-23 11:47:39 -08:00
Ryan Tarpine
8915d9509c [DIPS] Move from //chrome to //content.
By moving DIPS (Bounce Tracking Mitigations) into //content, it will be
available for all content embedders, such as Android WebView.

Aside from the obvious file moves, the main changes are:
- DIPS-related WebContentsObservers are created in
  WebContentsImpl::Init() instead of TabHelpers::AttachTabHelpers()
- No more DIPSServiceFactory: BrowserContextImpl creates and owns the
  DIPSServiceImpl directly
- No more DIPSCleanupService (nor its factory): BrowserContextImpl
  deletes the DIPS database file if necessary
- The logic to trigger DIPS data deletion moved from
  ChromeBrowsingDataRemoverDelegate to BrowsingDataRemoverImpl
- Tests have to override the ContentBrowserClient instead of setting
  prefs and modifying the HostContentSettingsMap to test 3PC behavior
- The OpenerHeuristicService was split into two pieces: the part that
  creates cookie grants was moved into //content as the new method
  BrowserContext::BackfillPopupHeuristicGrants(); and the part that
  observes the tracking protection settings stays in //chrome and calls
  that method.
- Many FeatureParams were moved from tpcd_experiment_features.h in
  //chrome to //components/content_settings/core/common/features.h
- components/content_settings/core/common was added to content/DEPS
- Renamed SiteDataAccessType to DIPSDataAccessType

In followup CLs, we will
(1) Put all of the DIPS classes, functions, etc into the content namespace (crrev.com/c/6039087)
(2) Rename DIPS prefixes to Dips to comply with the style guide
(3) Change b/ bug references to crbug.com/
(4) Delete DipsDelegate, moving its methods to ContentBrowserClient

Bug: 40883201
Change-Id: I3c07e867ae00e6817ff286a71722473c08ead624
Fuchsia-Binary-Size: Size increase is unavoidable - moving feature from //chrome to //content
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000406
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Joshua Hood <jdh@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1399855}
2024-12-23 11:37:31 -08:00
Daniel Rubery
24ccce39d3 Integrate Device Bound Sessions with Clear-Site-Data
Device bound sessions should be cleared whenever the Clear-Site-Data
header is cookies or storage.

Bug: 353774427
Change-Id: I8f5abc2922bdd06a53ec2f42042987bbbbd2af14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6067806
Reviewed-by: Kristian Monsen <kristianm@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1397678}
2024-12-17 17:30:07 -08:00
Muyao Xu
943e6a6cd3 [Code Health]Remove Feature::kPrivateStateTokens and Feature::kFledgePst
Both features has been enabled by default since M117.

Change-Id: I446e2faaf938ba878d668bfbdc0aaafdb12d5369
Bug: 356624913
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6084939
Commit-Queue: Muyao Xu <muyaoxu@google.com>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1397122}
2024-12-16 18:51:32 -08:00
Arthur Sonzogni
d5ce01f7ef C++11 std::array rewrite for memory safety [11/19]
Split from:
https://chromium-review.googlesource.com/c/chromium/src/+/6004959

Generated patch
---------------
- Tool: ./tool/clang/spanify/rewrite-multiple-platform.sh
- Platform: Linux.
- Filter: This includes 2400/4222 patches. I included the std::array
      ones and excluded build errors.

Google announcement:
--------------------
https://groups.google.com/a/google.com/g/chrome-memory-safety/c/RMiO4gaVLQA/m/Yz-3NCObAgAJ

Benchmarks:
----------
See design doc and
https://chromium-review.googlesource.com/c/chromium/src/+/6004959/21

Description
-----------
The consensus during the memory safety summit was to begin rewriting
relevant C-style arrays to C++11 std::array. It can be done immediately,
offers better developer ergonomics, and fix large chunks of the
-Wunsafe-buffer-usage errors in Chrome.

To clarify, this effort is complementary to the longer plan work with
enabling -fsanitize=array-bounds, and we plan to leverage both,
especially for protecting 3p code.

[Attached] is a document detailing the rationale, benefits, and
considerations for potential compile-time and performance impacts.

[Attached]:https://docs.google.com/document/d/1z5aBDg26lHmNDjXRCysElWKx7E4PAJXqykI_k7ondJI/edit?tab=t.0#heading=h.cqgo7wvp0kzt

NO_IFTTT=No need to update base/debug/stack_trace.h

Bug: 378069401
Change-Id: I6d36543c267f12c672cce00d75cf833fff238ebf
R: dcheng@chromium.org
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6039265
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395908}
2024-12-13 05:35:28 -08:00
amarjotgill
1f632536e2 [OBC] Add cookie scope semantics to CookieAccessResult params
This change adds CookieScopeSemantics to CookieAccessResult
and also adds GetScopeSemantics() to the cookie access delegate.

NO_IFTTT=<Adding linter to mojom>

Bug: 378827534
Change-Id: Iaf9d250fea400bd63e6714e04cdaff091127ded6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6050716
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Amarjot Gill <amarjotgill@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Reviewed-by: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1392397}
2024-12-05 18:21:19 +00:00
Peter Birk Pakkenberg
05dc8e598b Reland "Add new API to delete all WebStorage in WebView"
This is a reland of commit 393033a0c6

Original change's description:
> Add new API to delete all WebStorage in WebView
>
> The current implementation only deletes the types of storage available
> when the API was introduced.
>
> This change introduces a new set of APIs that will delete all storage
> data. These methods will be exposed through the AndroidX library for
> apps to use.
>
> The existing implementation is renamed to indicate that it is used by
> the Android framework.
>
> Bug: 373558938
> Change-Id: Iac61b2403fad73a3170904613e784915278185de
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5934451
> Reviewed-by: Nate Fischer <ntfschr@chromium.org>
> Commit-Queue: Peter Pakkenberg <pbirk@chromium.org>
> Reviewed-by: Christian Dullweber <dullweber@chromium.org>
> Reviewed-by: Adam Walls <avvall@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1390255}

Bug: 373558938
Change-Id: Ib27a27c761d70a438feddcda6f95636e9456e59c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6066301
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Auto-Submit: Peter Pakkenberg <pbirk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391111}
2024-12-03 18:20:15 +00:00
Peilin Wang
d2c79bcd6d Revert "Add new API to delete all WebStorage in WebView"
This reverts commit 393033a0c6.

Reason for revert: breaking ci bots https://ci.chromium.org/ui/p/chromium/builders/ci/Android%20WebView%20O%20(dbg)/26010/overview

Original change's description:
> Add new API to delete all WebStorage in WebView
>
> The current implementation only deletes the types of storage available
> when the API was introduced.
>
> This change introduces a new set of APIs that will delete all storage
> data. These methods will be exposed through the AndroidX library for
> apps to use.
>
> The existing implementation is renamed to indicate that it is used by
> the Android framework.
>
> Bug: 373558938
> Change-Id: Iac61b2403fad73a3170904613e784915278185de
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5934451
> Reviewed-by: Nate Fischer <ntfschr@chromium.org>
> Commit-Queue: Peter Pakkenberg <pbirk@chromium.org>
> Reviewed-by: Christian Dullweber <dullweber@chromium.org>
> Reviewed-by: Adam Walls <avvall@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1390255}

Bug: 373558938
Change-Id: I14fba91922ab2fb53da3db622d4e7f541599b25e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064225
Reviewed-by: Peilin Wang <peilinwang@google.com>
Owners-Override: Peilin Wang <peilinwang@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Peilin Wang <peilinwang@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1390519}
2024-12-02 19:44:41 +00:00
Peter Birk Pakkenberg
393033a0c6 Add new API to delete all WebStorage in WebView
The current implementation only deletes the types of storage available
when the API was introduced.

This change introduces a new set of APIs that will delete all storage
data. These methods will be exposed through the AndroidX library for
apps to use.

The existing implementation is renamed to indicate that it is used by
the Android framework.

Bug: 373558938
Change-Id: Iac61b2403fad73a3170904613e784915278185de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5934451
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Peter Pakkenberg <pbirk@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Adam Walls <avvall@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1390255}
2024-12-02 11:38:05 +00:00
Peter Boström
fc7ddc185b Migrate to NOTREACHED() in content/
NOTREACHED() and NOTREACHED_IN_MIGRATION() are both CHECK-fatal now.
The former is [[noreturn]] so this CL also performs dead-code removal
after the NOTREACHED().

This CL does not attempt to do additional rewrites of any surrounding
code, like:

if (!foo) {
  NOTREACHED();
}

to CHECK(foo);

Those transforms take a non-trivial amount of time (and there are
thousands of instances). Cleanup can be left as an exercise for the
reader.

This does clean up kCrashOnDanglingBrowserContext as both paths of the
kill switch are currently fatal. This has been rolled out for a long
time.

Bug: 40580068, 40062641
Change-Id: Ib88e710d003e2e48df3fc502ca54d2341d157a0e
Cq-Include-Trybots: luci.chromium.try:linux-dcheck-off-rel
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5974816
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1376522}
2024-10-31 19:37:21 +00:00
Eric Lawrence
a5e738f232 Ignore Strict-Transport-Security on https://localhost responses
Localhost is inherently a secure context, and Strict-Transport-Security
response headers can cause problems because they are not isolated by
port causing compatibility problems for web developers testing locally
as well as end-users who use software packages that commonly spin up
localhost webservers for ephemeral reasons (e.g. communication of an
auth token from a web login to a local software package). If one local
listener sets Strict-Transport-Security on a localhost response, it
will be applied to all subsequent localhost requests regardless of port.

We resolve this problem by matching Firefox and ignoring HSTS headers
on responses from localhost URLs.

Bug: 41251622
Change-Id: Ibebddb97aabe3f2a9c2a6008d314116cafe28a1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5923046
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Eric Lawrence <ericlaw@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1375901}
2024-10-30 16:55:58 +00:00
Nan Lin
f480b04528 Replace BrowsingDataFilterBuilderImpl::MatchesWithSavedStorageKey with
std::equal_to

This is to avoid dangling pointer when the callback is run.

Bug: 353506686
Change-Id: I2dae05aa5b4c255ee7ffed5b589cd6eb64df34dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5947364
Auto-Submit: Nan Lin <linnan@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1371535}
2024-10-21 18:35:56 +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
Tom Sepez
56b5eeb5fb Correct moves of const std::optional<> contents.
Use a variety of techniques to avoid unintentional copies.

-- remove stray consts that block move.
-- pass by const-ref where reasonable.
-- remove optional<> if value always present.
-- convert one else to early return to prove moved lifetime ends.

This CL was uploaded by git cl split.

R=ayui@chromium.org, clamy@chromium.org, hayato@chromium.org, toyoshim@chromium.org

Bug: 369952985
Change-Id: Ie66a7e6d4edc198f694d80e28ddd2f08b547cdfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5906790
Commit-Queue: Camille Lamy <clamy@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1364264}
2024-10-04 16:19:29 +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
Filipa Senra
19a187d3ca [iOS][QD] Record UserDeletedCookieOrCacheFromDialog histogram
This CL records the UserDeletedCookieOrCacheFromDialog histogram for QD.
It also does a small clean up so whenever the
UserDeletedCookieOrCache|FromDialog histograms are recorded, the same
common enum is used.

NO_IFTTT=Adding new IFTT for existing enum not changing the entries.

Bug: 337008330, 335387869
Change-Id: I042e88aa119e7ff74d5457bc786affe0b8b4bcbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5860079
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Filipa Senra <fsenra@google.com>
Cr-Commit-Position: refs/heads/main@{#1359954}
2024-09-25 15:27:23 +00:00
Arthur Sonzogni
0a5d54489f Spanify: content/ (c-array conversions only)
Addresses ~14% of `-WUnsafe-buffer-usage` opt-out in `//content`.
This is a #cleanup.

The patch was initially partially generated by `./tool/clang/spanify`.

This patch applies conversions specifically to c-arrays in `//content`.
Although the `spanify` tool supports broader conversions, this change
intentionally focuses on c-arrays. Several manual fixes were made to
address anonymous struct issues and other edge cases encountered during
the conversion process.

Bug: 342213636, 40285824
Change-Id: I72666faa45a461ea27bb3608beeacc6c9fcd8a63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5824992
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1349804}
2024-09-02 11:23:35 +00:00
Lei Zhang
05c13df891 Remove unnecessary ContentBrowserTest::SetUpCommandLine() calls
ContentBrowserTest::SetUpCommandLine() is actually not defined. Calls to
this method ends up running BrowserTestBase::SetUpCommandLine(), which
is always going to be empty. Since there is no point in calling this
method, delete all the callers from SetUpCommandLine() overrides. When
the override becomes empty, delete the override altogether.

Make a note of this in the comments in content_browser_test.h. Also fix
some lint errors along the way.

Change-Id: I81f263286d72ebdab68dfd9575ad4cf2b6378a3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5691227
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1325736}
2024-07-10 20:59:12 +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
selya
34bfee1517 Align the ancestor chain bit with SameSite attribute behavior
An edge case was discovered where the ancestor chain bit would
be calculated as cross-site when redirecting from a cross-site
resource to a same-site resource. This behavior does not align
with how the SameSite attribute behaves. To reduce developer
confusion, this CL unifies the behavior.

Tests have also been added to confirm the new expected behavior.


Bug: 346610961
Change-Id: I4d5bde5cf2e837bb738d2cb2b5de13bb05395d9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5621955
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Aaron Selya <selya@google.com>
Reviewed-by: Dylan Cutler <dylancutler@google.com>
Cr-Commit-Position: refs/heads/main@{#1317939}
2024-06-21 14:47:39 +00:00
Sandor Major
faa4f5cae6 Enable DataRemover to delete permissions granted by Related Website Sets
Permissions granted by Related Website Sets (RWS) are going to be
deleted when RWS are changing. This is currently a no-op because
RWS are loaded during startup but permissions granted by RWS are not
persisted. crrev.com/c/5588890 is going to persist RWS grants which will
then be cleared at startup if the RWS change.

Bug: b/338367663
Change-Id: Ib412817bbe0698b55295dc0aa267d97e369f8e1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5597148
Reviewed-by: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@google.com>
Cr-Commit-Position: refs/heads/main@{#1314573}
2024-06-13 15:04:01 +00:00
Ryan Tarpine
06e4558760 Don't clear interest groups when deleting only partitioned cookies.
Bug: 344844565
Change-Id: I166f95f7b3e5ea7b9ff4e2671e5af01c32ead13f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5597178
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1313000}
2024-06-10 20:07:29 +00:00
Nasko Oskov
ee48dfb4fa Prepare to remove //content/ from unsafe_bufers_paths.txt
Suppress unsafe buffer usage on a file-by-file basis.  Out of
approximately 5850 .cc and .h files only roughly 160 files fail
compilation with the unsafe buffers warning.

Suppress only, by inserting boilerplate into affected files. Do not
re-write any code to work around the issues. Properly fixing each file
will be done in follow-up CLs.

//content/ is not removed from unsafe_bufers_paths.txt file and will be
also done as a follow-up, so it makes potential reverts simpler.

Bug: 342213636
Change-Id: I4a936e63dea95a78951f7bfae6d5487708ae3c0b
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608913
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312393}
2024-06-08 05:13:06 +00:00
Rushan Suleymanov
e50ac01bb8 Revert "BrowsingData: Handle extension deletion with empty origins filter"
This reverts commit 343ee1faca.

Reason for revert: this might cause test failure on several bots:
https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel/60349/overview

Original change's description:
> BrowsingData: Handle extension deletion with empty origins filter
>
> Deletions with an empty list of origins have no effect and trigger a
> DCHECK. Return an error instead.
>
> Bug: 40072785, 339026522
> Change-Id: I9bdc96e66e2327ebe62071d4046a4be59c297a6e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5534764
> Commit-Queue: Christian Dullweber <dullweber@chromium.org>
> Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
> Auto-Submit: Christian Dullweber <dullweber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1309845}

Bug: 40072785, 339026522, 344818282
Change-Id: Idf0b40a2f472f047de05dabdb14d28cacf95de68
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5593976
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rushan Suleymanov <rushans@google.com>
Auto-Submit: Rushan Suleymanov <rushans@google.com>
Owners-Override: Rushan Suleymanov <rushans@google.com>
Cr-Commit-Position: refs/heads/main@{#1309870}
2024-06-04 12:10:37 +00:00
Christian Dullweber
343ee1faca BrowsingData: Handle extension deletion with empty origins filter
Deletions with an empty list of origins have no effect and trigger a
DCHECK. Return an error instead.

Bug: 40072785, 339026522
Change-Id: I9bdc96e66e2327ebe62071d4046a4be59c297a6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5534764
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Auto-Submit: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1309845}
2024-06-04 10:32:41 +00:00
Steven Valdez
321c095755 Add more console errors for Private State Tokens.
Bug: 339207243
Change-Id: Ib25e7fa0a2645d795b1d2044a95a8c9b9d231e17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5571078
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Steven Valdez <svaldez@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Aykut Bulut <aykutb@google.com>
Cr-Commit-Position: refs/heads/main@{#1307993}
2024-05-30 14:41:50 +00:00
Christian Dullweber
af12c3ef71 BrowsingData: Do not delete all origins without filter
Many data deletions are not checking time range or url filters. While
this isn't great, we should prevent at least individual origins from
being able to delete data globally through the Clear-Site-Data header.
These deletions should be skipped instead.

Change-Id: Ia8e0ebe6510fd91ab94b377047a335af0f806459
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5522577
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1302604}
2024-05-17 15:37:40 +00:00
Ryan Tarpine
5ce8f41942 Fix several cases of too much browsing data being deleted by accident.
Some types of storage don't support filtering and want to clear
themselves whenever "most" browsing data is being deleted.

It used to be the case that if BrowsingDataFilterBuilder::GetMode()
returned kPreserve, you could assume that almost all origins/domains
would be matched by the filter. Thanks to storage partitioning, that's
no longer true. There are now additional properties that restrict what
hosts are matched, and if you ignore them, then some storage will clear
all their data when only one host should be affected.

Add a new method to BrowsingDataFilterBuilder:
MatchesMostOriginsAndDomains().

Replace uses of BrowsingDataFilterBuilder::GetMode() == kPreserve with
calls to the new method.

Bug: 339385533
Change-Id: Ia040056b67ca616e1cd72d058bb80c86447258f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5527934
Reviewed-by: Jonathan Njeunje <njeunje@chromium.org>
Commit-Queue: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301994}
2024-05-16 16:09:30 +00:00
Peter Boström
8472105d01 Use NOTREACHED_IN_MIGRATION() in content/
This was generated by replacing "  NOTREACHED()" with
"  NOTREACHED_IN_MIGRATION()" and running git cl format.

This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.

Bug: 40580068
Change-Id: I3b48b89911ac5e9ffcb211622992f917f8f9e8d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539619
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301096}
2024-05-15 04:36:02 +00:00
selya
d1565b1d12 Add new parameter to CookiePartitionKey::FromNetworkIsolationKey
The current implementation of the Cookie partition key with the ancestor chain bit included can generate a cross-site key even when the site is the top-level site and should not have any ancestor. To address this, a new parameter, main_frame_navigation has been added to ensure that main frame's always create a same_site key.

The test coverage associated with this change is in linked CL https://chromium-review.googlesource.com/c/chromium/src/+/5512042

Bug: 339410000
Change-Id: Ifcaff07afec4d7ff48e99b5422e19ed7a0940c76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526495
Reviewed-by: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: mmenke <mmenke@chromium.org>
Auto-Submit: Aaron Selya <selya@google.com>
Reviewed-by: Brianna Goldstein <brgoldstein@google.com>
Reviewed-by: Garrett Tanzer <gtanzer@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Aaron Selya <selya@google.com>
Cr-Commit-Position: refs/heads/main@{#1299420}
2024-05-10 19:06:15 +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