RemoteBrowsingContext.h 984 B

1234567891011121314151617181920212223242526272829303132333435
  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. JS_DECLARE_ALLOCATOR(RemoteBrowsingContext);
  15. public:
  16. static JS::NonnullGCPtr<RemoteBrowsingContext> create_a_new_remote_browsing_context(String handle);
  17. virtual HTML::WindowProxy* window_proxy() override;
  18. virtual HTML::WindowProxy const* window_proxy() const override;
  19. virtual String const& window_handle() const override { return m_window_handle; }
  20. virtual void set_window_handle(String handle) override { m_window_handle = handle; }
  21. private:
  22. explicit RemoteBrowsingContext(String);
  23. String m_window_handle;
  24. };
  25. }