WindowOrWorkerGlobalScope.h 828 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2023, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Forward.h>
  8. #include <LibWeb/Bindings/PlatformObject.h>
  9. #include <LibWeb/Forward.h>
  10. namespace Web::HTML {
  11. // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
  12. class WindowOrWorkerGlobalScopeMixin {
  13. public:
  14. virtual ~WindowOrWorkerGlobalScopeMixin();
  15. virtual Bindings::PlatformObject& this_impl() = 0;
  16. virtual Bindings::PlatformObject const& this_impl() const = 0;
  17. // JS API functions
  18. WebIDL::ExceptionOr<String> origin() const;
  19. bool is_secure_context() const;
  20. bool cross_origin_isolated() const;
  21. WebIDL::ExceptionOr<String> btoa(String const& data) const;
  22. WebIDL::ExceptionOr<String> atob(String const& data) const;
  23. };
  24. }