RemoteBrowsingContext.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Bindings/MainThreadVM.h>
  8. #include <LibWeb/HTML/AbstractBrowsingContext.h>
  9. namespace Web::HTML {
  10. class RemoteBrowsingContext final
  11. : public AbstractBrowsingContext
  12. , public Weakable<RemoteBrowsingContext> {
  13. JS_CELL(RemoteBrowsingContext, AbstractBrowsingContext);
  14. public:
  15. static JS::NonnullGCPtr<RemoteBrowsingContext> create_a_new_remote_browsing_context(String handle);
  16. virtual HTML::WindowProxy* window_proxy() override;
  17. virtual HTML::WindowProxy const* window_proxy() const override;
  18. virtual WebIDL::ExceptionOr<void> navigate(
  19. JS::NonnullGCPtr<Fetch::Infrastructure::Request>,
  20. BrowsingContext&,
  21. bool,
  22. HistoryHandlingBehavior,
  23. Optional<PolicyContainer>,
  24. DeprecatedString,
  25. Optional<String>,
  26. Function<void(JS::NonnullGCPtr<Fetch::Infrastructure::Response>)>) override
  27. {
  28. return {};
  29. };
  30. virtual String const& window_handle() const override { return m_window_handle; }
  31. virtual void set_window_handle(String handle) override { m_window_handle = handle; };
  32. private:
  33. explicit RemoteBrowsingContext(String);
  34. String m_window_handle;
  35. };
  36. }