-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BestEffortServiceWorker] Add RaceNetworkRequest token
This CL is a part of efforts that achieve the dedupe function to BestEffortServiceWorker. At a high-level, the dedupe is achieved by reusing the RaceNetworkRequest response as a response of the corresponding request in the fetch handler, and do not send a new fetch request. We can split into some smaller steps to implement this. 1. (This CL) Generates a token of RaceNetworkRequest, and pass it to the blink side to make the corresponding request in the fetch handler discoverable. 2. Adds a map of the token and URLLoaderFactory in ServiceWorkerGlobalScope, and replaces the default URLLoader when the fetch request is same as the one called in RaceNetworkRequest which is outside of the fetch handler. 3. Fuses two message pipes into one in a custom URLLoaderClient so that we can reuse the RaceNetworkRequest result and don't dispatch duplicated requests in the fetch handler. This CL introduce a token of RaceNetworkRequest as a new param to FetchAPIRequest mojom. A token is passed when RaceNetworkRequest is dispatched, thus outside of ServiceWorker fetch handler. In this CL ServiceWorkerMainResourceLoader adds the token. We don't support subreousrce at this moment. The token is `base::UnguessableToken`. To identify the same fetch request in the ServiceWorker, `platform/loader/fetch/resource_request` will have the token as a member. This member will be used in the child CL. This CL doesn't change the default behavior. Change-Id: I54280de1923512d6cd292e82b66c52df0f342790 Bug: 1420517 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4393865 Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org> Reviewed-by: Minoru Chikamune <chikamune@chromium.org> Commit-Queue: Shunya Shishido <sisidovski@chromium.org> Cr-Commit-Position: refs/heads/main@{#1150212}
- Loading branch information
1 parent
cdabd3a
commit ab60569
Showing
12 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters