Skip to content

Commit

Permalink
Bug 1907570 - [devtools] Retrieve cookies for a given host from diffe…
Browse files Browse the repository at this point in the history
…rent jars. r=timhuang,devtools-reviewers,ochameau

This patch changes how we're retrieving cookies for a given host.
We used to retrieve the first window we found for the host and get
its associated `originAttributes` to pass them to `Services.cookies.getCookiesFromHost`.
With CHIPS, windows with the same host can have different `originAttributes`
(more precisely, different `partitionKey`).
This means that in order to retrieve all the cookies for a given host, we need
to call `Services.cookies.getCookiesFromHost` with all the different `originAttributes`
we can have for the host.

This also impacts how we handle editing and removing cookies, as we also need
the specific originAttributes linked to the cookie that is being modified/deleted.
(note that adding cookies might also be impacted, but by default we put them in
the top level document, which should put them in the unpartitioned jar).

A test is added to try to cover all this changes

Differential Revision: https://phabricator.services.mozilla.com/D210169

UltraBlame original commit: 47e971e1e3f489307b0131525e3704c337d8759a
  • Loading branch information
marco-c committed Dec 13, 2024
1 parent 0194e8d commit b9e4c05
Show file tree
Hide file tree
Showing 6 changed files with 1,959 additions and 84 deletions.
22 changes: 22 additions & 0 deletions devtools/client/storage/test/browser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,21 @@ helpers
js
"
]
prefs
=
[
"
network
.
cookie
.
CHIPS
.
enabled
=
true
"
]
[
"
browser_storage_basic
Expand Down Expand Up @@ -546,6 +561,13 @@ intermittent
]
[
"
browser_storage_cookies_partitioned
.
js
"
]
[
"
browser_storage_cookies_samesite
.
js
Expand Down
Loading

0 comments on commit b9e4c05

Please sign in to comment.