mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibWeb+LibWebView+WebWorker: Enable the HTTP memory cache in workers
This is expected by WPT. For this to work, we must be able to determine the network partition key for shared worker environments. So we now set a top-level origin for these environments, with a FIXME to implement it in accordance with the Client-Side Storage Partitioning spec.
This commit is contained in:
Notes:
github-actions[bot]
2026-02-06 11:18:13 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/6120b3b918d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7546
@@ -35,11 +35,21 @@ GC::Ref<WorkerEnvironmentSettingsObject> WorkerEnvironmentSettingsObject::setup(
|
||||
settings_object->target_browsing_context = nullptr;
|
||||
|
||||
// FIXME: 5. Set settings object's id to a new unique opaque string, creation URL to worker global scope's url, top-level creation URL to null, target browsing context to null, and active service worker to null.
|
||||
// 6. If worker global scope is a DedicatedWorkerGlobalScope object, then set settings object's top-level origin to outside settings's top-level origin.
|
||||
|
||||
// 6. If worker global scope is a DedicatedWorkerGlobalScope object, then set settings object's top-level origin to
|
||||
// outside settings's top-level origin.
|
||||
if (is<DedicatedWorkerGlobalScope>(worker)) {
|
||||
settings_object->top_level_origin = outside_settings.top_level_origin;
|
||||
}
|
||||
// FIXME: 7. Otherwise, set settings object's top-level origin to an implementation-defined value.
|
||||
// 7. Otherwise, set settings object's top-level origin to an implementation-defined value.
|
||||
else {
|
||||
// FIXME: We set this to the same top-level origin as DedicatedWorkerGlobalScope objects for now, as this needs
|
||||
// to be non-null for determining network partition keys. The spec notes:
|
||||
//
|
||||
// See Client-Side Storage Partitioning for the latest on properly defining this.
|
||||
// https://privacycg.github.io/storage-partitioning/
|
||||
settings_object->top_level_origin = outside_settings.top_level_origin;
|
||||
}
|
||||
|
||||
// 8. Set realm's [[HostDefined]] field to settings object.
|
||||
auto intrinsics = realm->create<Bindings::Intrinsics>(*realm);
|
||||
|
||||
Reference in New Issue
Block a user