forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support writing shared dictionary from workers
To trigger the shared dictionary writer, we need to set the request's shared_dictionary_writer_enabled flag. This flag should be enabled when a valid CompressionDictionaryTransport Origin Trial token is set or blink::features::kCompressionDictionaryTransport is enabled. Currently FrameFetchContext is correctly setting this flag. But WorkerFetchContext is not setting this flag. This CL changes WorkerFetchContext::PrepareRequest() to set this flag to support writing shared dictionary from workers. Bug: 1413922 Change-Id: I904ef3b5a3e182e92b52912ddea6346c9783f7c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4619955 Reviewed-by: Nate Chapin <japhet@chromium.org> Reviewed-by: Patrick Meenan <pmeenan@chromium.org> Commit-Queue: Tsuyoshi Horo <horo@chromium.org> Cr-Commit-Position: refs/heads/main@{#1160321}
- Loading branch information
Showing
4 changed files
with
242 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// For Dedicatd Worker and Service Worker. | ||
self.addEventListener('message', (e) => { | ||
fetch(e.data); | ||
}); | ||
|
||
// For Shared Worker. | ||
self.addEventListener('connect', (e) => { | ||
const port = e.ports[0]; | ||
port.addEventListener('message', (e) => { | ||
fetch(e.data); | ||
}); | ||
port.start(); | ||
}); |
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