SyntheticRealmSettings.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Forward.h>
  8. #include <LibJS/Heap/GCPtr.h>
  9. #include <LibWeb/Forward.h>
  10. namespace Web::HTML {
  11. // https://whatpr.org/html/9893/webappapis.html#synthetic-realm-settings-objects
  12. // Each synthetic realm has an associated synthetic realm settings object with the following fields:
  13. struct SyntheticRealmSettings {
  14. // An execution context
  15. // The JavaScript execution context for the scripts within this realm.
  16. NonnullOwnPtr<JS::ExecutionContext> execution_context;
  17. // A principal realm
  18. // The principal realm which this synthetic realm exists within.
  19. JS::NonnullGCPtr<JS::Realm> principal_realm;
  20. // An underlying realm
  21. // The synthetic realm which this settings object represents.
  22. JS::NonnullGCPtr<JS::Realm> underlying_realm;
  23. // A module map
  24. // A module map that is used when importing JavaScript modules.
  25. JS::NonnullGCPtr<ModuleMap> module_map;
  26. void visit_edges(JS::Cell::Visitor&);
  27. };
  28. }