1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:07:44 +00:00

LibWeb: Introduce RemoteBrowsingContext

Remote browsing context represents top level browsing context that
lives in another WebContent process.
This commit is contained in:
Aliaksandr Kalenik 2023-03-14 13:44:54 +03:00 committed by Tim Flynn
parent 40ec976781
commit 8026c63e10
3 changed files with 78 additions and 0 deletions

View file

@ -283,6 +283,7 @@ set(SOURCES
HTML/Plugin.cpp
HTML/PluginArray.cpp
HTML/PromiseRejectionEvent.cpp
HTML/RemoteBrowsingContext.cpp
HTML/Scripting/ClassicScript.cpp
HTML/Scripting/Environments.cpp
HTML/Scripting/ExceptionReporter.cpp

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/HTML/RemoteBrowsingContext.h>
namespace Web::HTML {
JS::NonnullGCPtr<RemoteBrowsingContext> RemoteBrowsingContext::create_a_new_remote_browsing_context(String handle)
{
auto browsing_context = Bindings::main_thread_vm().heap().allocate_without_realm<RemoteBrowsingContext>(handle);
return browsing_context;
};
HTML::WindowProxy* RemoteBrowsingContext::window_proxy()
{
return nullptr;
}
HTML::WindowProxy const* RemoteBrowsingContext::window_proxy() const
{
return nullptr;
}
RemoteBrowsingContext::RemoteBrowsingContext(String handle)
: m_window_handle(handle) {};
}

View file

@ -0,0 +1,47 @@
/*
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/HTML/AbstractBrowsingContext.h>
namespace Web::HTML {
class RemoteBrowsingContext final
: public AbstractBrowsingContext
, public Weakable<RemoteBrowsingContext> {
JS_CELL(RemoteBrowsingContext, AbstractBrowsingContext);
public:
static JS::NonnullGCPtr<RemoteBrowsingContext> create_a_new_remote_browsing_context(String handle);
virtual HTML::WindowProxy* window_proxy() override;
virtual HTML::WindowProxy const* window_proxy() const override;
virtual WebIDL::ExceptionOr<void> navigate(
JS::NonnullGCPtr<Fetch::Infrastructure::Request>,
BrowsingContext&,
bool,
HistoryHandlingBehavior,
Optional<PolicyContainer>,
DeprecatedString,
Optional<DeprecatedString>,
Function<void(JS::NonnullGCPtr<Fetch::Infrastructure::Response>)>) override
{
return {};
};
virtual String const& window_handle() const override { return m_window_handle; }
virtual void set_window_handle(String handle) override { m_window_handle = handle; };
private:
explicit RemoteBrowsingContext(String);
String m_window_handle;
};
}