Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Sec-Fetch-Mode from the network service. #18838

Merged
merged 2 commits into from
Sep 5, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Sep 4, 2019

In order to move Sec-Fetch-Mode into the network service to ensure
that it's consistently set every time Sec-Fetch-Site is set, this
patch does a few things:

  1. Based on the conversation in 1 and 2, this patch extends
    network::mojom::RequestMode to include two new values to
    represent nested navigations and object/embed navigations as
    distinct from main-frame navigations.

  2. It introduces a new network::IsNavigationRequestMode() function
    to replace direct comparisons to kNavigate in various parts of
    the codebase.

  3. It refactors network::SetSecFetchSiteHeader() into
    network::SetFetchMetadataHeaders(). This creates a single entry
    point from URLLoader to set all Fetch Metadata headers, and
    fleshes out the Sec-Fetch-Mode header.

Bug: 972263, 990864
Change-Id: Icd20c7640d3d08ecb34a739f0203140fdcc195d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1780725
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Łukasz Anforowicz <[email protected]>
Commit-Queue: Mike West <[email protected]>
Cr-Commit-Position: refs/heads/master@{#693517}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

@chromium-wpt-export-bot chromium-wpt-export-bot changed the title [WIP] Set Sec-Fetch-Mode from the network service. Set Sec-Fetch-Mode from the network service. Sep 4, 2019
In order to move `Sec-Fetch-Mode` into the network service to ensure
that it's consistently set every time `Sec-Fetch-Site` is set, this
patch does a few things:

1.  Based on the conversation in [1] and [2], this patch extends
    `network::mojom::RequestMode` to include two new values to
    represent nested navigations and object/embed navigations as
    distinct from main-frame navigations.

2.  It introduces a new `network::IsNavigationRequestMode()` function
    to replace direct comparisons to `kNavigate` in various parts of
    the codebase.

3.  It refactors `network::SetSecFetchSiteHeader()` into
    `network::SetFetchMetadataHeaders()`. This creates a single entry
    point from `URLLoader` to set all Fetch Metadata headers, and
    fleshes out the `Sec-Fetch-Mode` header.

[1]: w3c/webappsec-fetch-metadata#37
[2]: whatwg/fetch#755

Bug: 972263, 990864
Change-Id: Icd20c7640d3d08ecb34a739f0203140fdcc195d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1780725
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Łukasz Anforowicz <[email protected]>
Commit-Queue: Mike West <[email protected]>
Cr-Commit-Position: refs/heads/master@{#693517}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit d6b04f2 into master Sep 5, 2019
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-1780725 branch September 5, 2019 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants