Skip to content

Commit

Permalink
Cherry-pick of https://crrev.com/c/3666357 into M103
Browse files Browse the repository at this point in the history
Reland "Implement new design for CHIPS OT and delete old design"

This is a reland of commit 5f95d48

Original change's description:
> Implement new design for CHIPS OT and delete old design
>
> This CL deletes the client hint-based origin trial design which I
> landed in https://crrev.com/c/3453430.
>
> It also implements the new origin trial design announced here:
> privacysandbox/privacy-sandbox-dev-support#33
>
> The new origin trial design only checks the Origin-Trial header when an
> HTTP response has a Set-Cookie header with a Partitioned attribute in
> the cookie line. The resulting cookie from the Set-Cookie with
> Partitioned does NOT have to be valid.
>
> In order to do this, I added a new field, has_partitioned_cookie, to
> URLResponseHead. This bit indicates to the browser/renderer that the
> response had a Set-Cookie header with Partitioned.
>
> The network service has no idea if the site is in the OT at request
> time, so we will set any cookie with the Partitioned attribute as
> partitioned even if the site is not in the OT.
>
> Afterwards, we then check the Origin-Trial header and token in the
> browser for navigation requests and the renderer for subresource
> requests. If a site is not a valid OT participant, we convert that
> URL's partitioned cookies to unpartitioned.
>
> In order to do this in the renderer, we had to give
> RestrictedCookieManager the ability to change any URL's partitioned
> cookies to unpartitioned. Since unpartitioned cookies are already the
> state of the art for the web, it's low risk to give renderers this
> ability. RCM's ability to do this will be temporary and only for the
> duration of the OT.
>
> The entire feature is tested end-to-end in
> navigation_request_browsertest.cc for now.
>
> Bug: 1296161,1327045
> Change-Id: I08490a7df4cbb93e121034d67b88ce4a69f32c37
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3650844
> Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
> Reviewed-by: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: Nate Fischer <ntfschr@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Reviewed-by: Ari Chivukula <arichiv@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Philip Rogers <pdr@chromium.org>
> Commit-Queue: Dylan Cutler <dylancutler@google.com>
> Cr-Commit-Position: refs/heads/main@{#1007159}

(cherry picked from commit 196d0a9)

Bug: 1296161,1327045
Change-Id: I1f73a4ff04121d14a2ae8eb91f3f8e3aed9068f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3666357
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Victor Tan <victortan@chromium.org>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1007601}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3679821
Owners-Override: Krishna Govind <govind@chromium.org>
Reviewed-by: Krishna Govind <govind@chromium.org>
Cr-Commit-Position: refs/branch-heads/5060@{#439}
Cr-Branched-From: b83393d-refs/heads/main@{#1002911}
  • Loading branch information
DCtheTall authored and Chromium LUCI CQ committed May 31, 2022
1 parent 6f7ef57 commit a15eae7
Show file tree
Hide file tree
Showing 47 changed files with 878 additions and 1,101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,10 @@ bool AwProxyingRestrictedCookieManager::AllowCookies(
}
}

void AwProxyingRestrictedCookieManager::
ConvertPartitionedCookiesToUnpartitioned(const GURL& url) {
underlying_restricted_cookie_manager_
->ConvertPartitionedCookiesToUnpartitioned(url);
}

} // namespace android_webview
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ class AwProxyingRestrictedCookieManager
bool AllowCookies(const GURL& url,
const net::SiteForCookies& site_for_cookies) const;

// TODO(https://crbug.com/1296161): Delete this function.
void ConvertPartitionedCookiesToUnpartitioned(const GURL& url) override;

private:
AwProxyingRestrictedCookieManager(
mojo::PendingRemote<network::mojom::RestrictedCookieManager>
Expand Down

0 comments on commit a15eae7

Please sign in to comment.