mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibTextCodec+LibWeb: Move isomorphic coders to LibTextCodec
This will be used outside of LibWeb.
This commit is contained in:
parent
0480934afb
commit
0fd80a8f99
Notes:
github-actions[bot]
2025-11-27 13:59:06 +00:00
Author: https://github.com/trflynn89
Commit: 0fd80a8f99
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6944
Reviewed-by: https://github.com/gmta ✅
17 changed files with 65 additions and 64 deletions
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <AK/GenericLexer.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibTextCodec/Decoder.h>
|
||||
#include <LibWeb/ContentSecurityPolicy/Directives/DirectiveFactory.h>
|
||||
#include <LibWeb/ContentSecurityPolicy/Directives/SerializedDirective.h>
|
||||
#include <LibWeb/ContentSecurityPolicy/Policy.h>
|
||||
|
|
@ -14,7 +15,6 @@
|
|||
#include <LibWeb/Fetch/Infrastructure/HTTP/Headers.h>
|
||||
#include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h>
|
||||
#include <LibWeb/Infra/CharacterTypes.h>
|
||||
#include <LibWeb/Infra/Strings.h>
|
||||
|
||||
namespace Web::ContentSecurityPolicy {
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ GC::Ref<Policy> Policy::parse_a_serialized_csp(GC::Heap& heap, Variant<ByteStrin
|
|||
// 1. If serialized is a byte sequence, then set serialized to be the result of isomorphic decoding serialized.
|
||||
auto serialized_string = serialized.has<String>()
|
||||
? serialized.get<String>()
|
||||
: Infra::isomorphic_decode(serialized.get<ByteString>());
|
||||
: TextCodec::isomorphic_decode(serialized.get<ByteString>());
|
||||
|
||||
// 2. Let policy be a new policy with an empty directive set, a source of source, and a disposition of disposition.
|
||||
auto policy = heap.allocate<Policy>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue