ladybird/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp
Ben Abraham ae346cff6b LibWeb: Add partially functioning Worker API
Add a partial implementation of HTML5 Worker API.
Messages can be sent from the inner context externally.
2022-02-17 22:45:21 +01:00

29 lines
641 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/MessageChannel.h>
#include <LibWeb/HTML/MessagePort.h>
namespace Web::HTML {
MessageChannel::MessageChannel()
{
// 1. Set this's port 1 to a new MessagePort in this's relevant Realm.
m_port1 = MessagePort::create();
// 2. Set this's port 2 to a new MessagePort in this's relevant Realm.
m_port2 = MessagePort::create();
// 3. Entangle this's port 1 and this's port 2.
m_port1->entangle_with(*m_port2);
}
MessageChannel::~MessageChannel()
{
}
}