mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibWeb/Storage: Add a storage key getter that takes a URL::Origin
When we serialize blob URL entries we do not serialize the entire environment settings object and only use it's origin. To allow a Blob URL entry to access its relevant storage key, add a getter that simply takes an origin.
This commit is contained in:
parent
ca3d9d9ee0
commit
70df8122b1
Notes:
github-actions[bot]
2025-01-21 19:23:14 +00:00
Author: https://github.com/shannonbooth
Commit: 70df8122b1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3303
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 7 additions and 0 deletions
|
@ -26,6 +26,12 @@ Optional<StorageKey> obtain_a_storage_key(HTML::Environment const& environment)
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StorageKey obtain_a_storage_key_for_non_storage_purposes(URL::Origin const& origin)
|
||||||
|
{
|
||||||
|
// NOTE: This function exists as there are cases where we don't have the full environment object, but we still need to obtain a storage key.
|
||||||
|
return { origin };
|
||||||
|
}
|
||||||
|
|
||||||
// https://storage.spec.whatwg.org/#obtain-a-storage-key-for-non-storage-purposes
|
// https://storage.spec.whatwg.org/#obtain-a-storage-key-for-non-storage-purposes
|
||||||
StorageKey obtain_a_storage_key_for_non_storage_purposes(HTML::Environment const& environment)
|
StorageKey obtain_a_storage_key_for_non_storage_purposes(HTML::Environment const& environment)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,6 +30,7 @@ struct StorageKey {
|
||||||
};
|
};
|
||||||
|
|
||||||
Optional<StorageKey> obtain_a_storage_key(HTML::Environment const&);
|
Optional<StorageKey> obtain_a_storage_key(HTML::Environment const&);
|
||||||
|
StorageKey obtain_a_storage_key_for_non_storage_purposes(URL::Origin const&);
|
||||||
StorageKey obtain_a_storage_key_for_non_storage_purposes(HTML::Environment const&);
|
StorageKey obtain_a_storage_key_for_non_storage_purposes(HTML::Environment const&);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue