mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-06 16:19:40 +00:00
LibWeb: First implementation of the TrustedTypePolicyFactory
Most of the functions are either not implemented of filled with dummy values.
This commit is contained in:
parent
223b1cc704
commit
8fdd9b68dc
Notes:
github-actions[bot]
2025-07-30 14:53:13 +00:00
Author: https://github.com/tete17
Commit: 8fdd9b68dc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5430
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/tcl3 ✅
11 changed files with 116 additions and 0 deletions
|
@ -43,6 +43,7 @@
|
|||
#include <LibWeb/Platform/ImageCodecPlugin.h>
|
||||
#include <LibWeb/ResourceTiming/PerformanceResourceTiming.h>
|
||||
#include <LibWeb/ServiceWorker/CacheStorage.h>
|
||||
#include <LibWeb/TrustedTypes/TrustedTypePolicyFactory.h>
|
||||
#include <LibWeb/UserTiming/PerformanceMark.h>
|
||||
#include <LibWeb/UserTiming/PerformanceMeasure.h>
|
||||
#include <LibWeb/WebIDL/AbstractOperations.h>
|
||||
|
@ -82,6 +83,7 @@ void WindowOrWorkerGlobalScopeMixin::visit_edges(JS::Cell::Visitor& visitor)
|
|||
visitor.visit(m_crypto);
|
||||
visitor.visit(m_cache_storage);
|
||||
visitor.visit(m_resource_timing_secondary_buffer);
|
||||
visitor.visit(m_trusted_type_policy_factory);
|
||||
}
|
||||
|
||||
void WindowOrWorkerGlobalScopeMixin::finalize()
|
||||
|
@ -1122,4 +1124,15 @@ GC::Ref<ServiceWorker::CacheStorage> WindowOrWorkerGlobalScopeMixin::caches()
|
|||
return GC::Ref { *m_cache_storage };
|
||||
}
|
||||
|
||||
// https://w3c.github.io/trusted-types/dist/spec/#extensions-to-the-windoworworkerglobalscope-interface
|
||||
GC::Ref<TrustedTypes::TrustedTypePolicyFactory> WindowOrWorkerGlobalScopeMixin::trusted_types()
|
||||
{
|
||||
auto const& platform_object = this_impl();
|
||||
auto& realm = platform_object.realm();
|
||||
|
||||
if (!m_trusted_type_policy_factory)
|
||||
m_trusted_type_policy_factory = realm.create<TrustedTypes::TrustedTypePolicyFactory>(realm);
|
||||
return *m_trusted_type_policy_factory;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue