mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb: Move StructuredSerializeOptions to its own header
This largely reduces the number of files needed to be compiled when we change the MessagePort header.
This commit is contained in:
@@ -545,6 +545,7 @@ struct POSTResource;
|
|||||||
struct ScrollOptions;
|
struct ScrollOptions;
|
||||||
struct ScrollToOptions;
|
struct ScrollToOptions;
|
||||||
struct SerializedFormData;
|
struct SerializedFormData;
|
||||||
|
struct StructuredSerializeOptions;
|
||||||
struct ToggleTaskTracker;
|
struct ToggleTaskTracker;
|
||||||
struct TransferDataHolder;
|
struct TransferDataHolder;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <LibWeb/HTML/EventHandler.h>
|
#include <LibWeb/HTML/EventHandler.h>
|
||||||
#include <LibWeb/HTML/EventNames.h>
|
#include <LibWeb/HTML/EventNames.h>
|
||||||
#include <LibWeb/HTML/MessageEvent.h>
|
#include <LibWeb/HTML/MessageEvent.h>
|
||||||
|
#include <LibWeb/HTML/MessagePort.h>
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <LibWeb/HTML/MessageEvent.h>
|
#include <LibWeb/HTML/MessageEvent.h>
|
||||||
#include <LibWeb/HTML/MessagePort.h>
|
#include <LibWeb/HTML/MessagePort.h>
|
||||||
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
|
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
|
||||||
|
#include <LibWeb/HTML/StructuredSerializeOptions.h>
|
||||||
#include <LibWeb/HTML/WorkerGlobalScope.h>
|
#include <LibWeb/HTML/WorkerGlobalScope.h>
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|||||||
@@ -21,11 +21,6 @@ namespace Web::HTML {
|
|||||||
E(onmessage, HTML::EventNames::message) \
|
E(onmessage, HTML::EventNames::message) \
|
||||||
E(onmessageerror, HTML::EventNames::messageerror)
|
E(onmessageerror, HTML::EventNames::messageerror)
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/web-messaging.html#structuredserializeoptions
|
|
||||||
struct StructuredSerializeOptions {
|
|
||||||
Vector<JS::Handle<JS::Object>> transfer;
|
|
||||||
};
|
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/web-messaging.html#message-ports
|
// https://html.spec.whatwg.org/multipage/web-messaging.html#message-ports
|
||||||
class MessagePort final : public DOM::EventTarget
|
class MessagePort final : public DOM::EventTarget
|
||||||
, public Bindings::Transferable {
|
, public Bindings::Transferable {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include <LibWeb/Bindings/ServiceWorkerPrototype.h>
|
#include <LibWeb/Bindings/ServiceWorkerPrototype.h>
|
||||||
#include <LibWeb/DOM/EventTarget.h>
|
#include <LibWeb/DOM/EventTarget.h>
|
||||||
#include <LibWeb/HTML/MessagePort.h>
|
|
||||||
|
|
||||||
#define ENUMERATE_SERVICE_WORKER_EVENT_HANDLERS(E) \
|
#define ENUMERATE_SERVICE_WORKER_EVENT_HANDLERS(E) \
|
||||||
E(onstatechange, HTML::EventNames::statechange) \
|
E(onstatechange, HTML::EventNames::statechange) \
|
||||||
|
|||||||
19
Userland/Libraries/LibWeb/HTML/StructuredSerializeOptions.h
Normal file
19
Userland/Libraries/LibWeb/HTML/StructuredSerializeOptions.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Vector.h>
|
||||||
|
#include <LibJS/Runtime/Object.h>
|
||||||
|
|
||||||
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/web-messaging.html#structuredserializeoptions
|
||||||
|
struct StructuredSerializeOptions {
|
||||||
|
Vector<JS::Handle<JS::Object>> transfer;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -44,6 +44,7 @@
|
|||||||
#include <LibWeb/HTML/HTMLObjectElement.h>
|
#include <LibWeb/HTML/HTMLObjectElement.h>
|
||||||
#include <LibWeb/HTML/Location.h>
|
#include <LibWeb/HTML/Location.h>
|
||||||
#include <LibWeb/HTML/MessageEvent.h>
|
#include <LibWeb/HTML/MessageEvent.h>
|
||||||
|
#include <LibWeb/HTML/MessagePort.h>
|
||||||
#include <LibWeb/HTML/Navigation.h>
|
#include <LibWeb/HTML/Navigation.h>
|
||||||
#include <LibWeb/HTML/Navigator.h>
|
#include <LibWeb/HTML/Navigator.h>
|
||||||
#include <LibWeb/HTML/PageTransitionEvent.h>
|
#include <LibWeb/HTML/PageTransitionEvent.h>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <LibWeb/HTML/Plugin.h>
|
#include <LibWeb/HTML/Plugin.h>
|
||||||
#include <LibWeb/HTML/Scripting/ImportMap.h>
|
#include <LibWeb/HTML/Scripting/ImportMap.h>
|
||||||
#include <LibWeb/HTML/ScrollOptions.h>
|
#include <LibWeb/HTML/ScrollOptions.h>
|
||||||
|
#include <LibWeb/HTML/StructuredSerializeOptions.h>
|
||||||
#include <LibWeb/HTML/WindowEventHandlers.h>
|
#include <LibWeb/HTML/WindowEventHandlers.h>
|
||||||
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
|
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
|
||||||
#include <LibWeb/RequestIdleCallback/IdleRequest.h>
|
#include <LibWeb/RequestIdleCallback/IdleRequest.h>
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
|
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
|
||||||
#include <LibWeb/HTML/Scripting/Fetching.h>
|
#include <LibWeb/HTML/Scripting/Fetching.h>
|
||||||
#include <LibWeb/HTML/StructuredSerialize.h>
|
#include <LibWeb/HTML/StructuredSerialize.h>
|
||||||
|
#include <LibWeb/HTML/StructuredSerializeOptions.h>
|
||||||
#include <LibWeb/HTML/Timer.h>
|
#include <LibWeb/HTML/Timer.h>
|
||||||
#include <LibWeb/HTML/Window.h>
|
#include <LibWeb/HTML/Window.h>
|
||||||
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
|
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
#include <LibWeb/Fetch/Request.h>
|
#include <LibWeb/Fetch/Request.h>
|
||||||
#include <LibWeb/Forward.h>
|
#include <LibWeb/Forward.h>
|
||||||
#include <LibWeb/HTML/ImageBitmap.h>
|
#include <LibWeb/HTML/ImageBitmap.h>
|
||||||
#include <LibWeb/HTML/MessagePort.h>
|
|
||||||
#include <LibWeb/PerformanceTimeline/PerformanceEntry.h>
|
#include <LibWeb/PerformanceTimeline/PerformanceEntry.h>
|
||||||
#include <LibWeb/PerformanceTimeline/PerformanceEntryTuple.h>
|
#include <LibWeb/PerformanceTimeline/PerformanceEntryTuple.h>
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/Debug.h>
|
#include <AK/Debug.h>
|
||||||
#include <LibJS/Runtime/ConsoleObject.h>
|
|
||||||
#include <LibJS/Runtime/Realm.h>
|
#include <LibJS/Runtime/Realm.h>
|
||||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
|
||||||
#include <LibWeb/Bindings/WorkerPrototype.h>
|
#include <LibWeb/Bindings/WorkerPrototype.h>
|
||||||
|
#include <LibWeb/HTML/MessagePort.h>
|
||||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||||
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
|
#include <LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h>
|
||||||
#include <LibWeb/HTML/Worker.h>
|
#include <LibWeb/HTML/Worker.h>
|
||||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
|||||||
@@ -6,20 +6,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/RefCounted.h>
|
|
||||||
#include <LibURL/Parser.h>
|
|
||||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
|
||||||
#include <LibWeb/Forward.h>
|
#include <LibWeb/Forward.h>
|
||||||
#include <LibWeb/HTML/AbstractWorker.h>
|
#include <LibWeb/HTML/AbstractWorker.h>
|
||||||
#include <LibWeb/HTML/MessageEvent.h>
|
|
||||||
#include <LibWeb/HTML/MessagePort.h>
|
|
||||||
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
|
||||||
#include <LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h>
|
|
||||||
#include <LibWeb/HTML/Scripting/WorkerEnvironmentSettingsObject.h>
|
|
||||||
#include <LibWeb/HTML/Window.h>
|
#include <LibWeb/HTML/Window.h>
|
||||||
#include <LibWeb/HTML/WorkerAgent.h>
|
#include <LibWeb/HTML/WorkerAgent.h>
|
||||||
#include <LibWeb/HTML/WorkerDebugConsoleClient.h>
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||||
#include <LibWeb/Loader/ResourceLoader.h>
|
|
||||||
|
|
||||||
#define ENUMERATE_WORKER_EVENT_HANDLERS(E) \
|
#define ENUMERATE_WORKER_EVENT_HANDLERS(E) \
|
||||||
E(onmessage, HTML::EventNames::message) \
|
E(onmessage, HTML::EventNames::message) \
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibWeb/Bindings/HostDefined.h>
|
#include <LibWeb/Bindings/HostDefined.h>
|
||||||
|
#include <LibWeb/HTML/MessagePort.h>
|
||||||
#include <LibWeb/HTML/WorkerAgent.h>
|
#include <LibWeb/HTML/WorkerAgent.h>
|
||||||
#include <LibWeb/Page/Page.h>
|
#include <LibWeb/Page/Page.h>
|
||||||
#include <LibWeb/Worker/WebWorkerClient.h>
|
#include <LibWeb/Worker/WebWorkerClient.h>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include <LibWeb/Bindings/RequestPrototype.h>
|
#include <LibWeb/Bindings/RequestPrototype.h>
|
||||||
#include <LibWeb/Bindings/WorkerPrototype.h>
|
#include <LibWeb/Bindings/WorkerPrototype.h>
|
||||||
#include <LibWeb/Forward.h>
|
#include <LibWeb/Forward.h>
|
||||||
#include <LibWeb/HTML/MessagePort.h>
|
|
||||||
#include <LibWeb/Worker/WebWorkerClient.h>
|
#include <LibWeb/Worker/WebWorkerClient.h>
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <LibWeb/HTML/EventHandler.h>
|
#include <LibWeb/HTML/EventHandler.h>
|
||||||
#include <LibWeb/HTML/EventNames.h>
|
#include <LibWeb/HTML/EventNames.h>
|
||||||
#include <LibWeb/HTML/MessageEvent.h>
|
#include <LibWeb/HTML/MessageEvent.h>
|
||||||
|
#include <LibWeb/HTML/MessagePort.h>
|
||||||
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
||||||
#include <LibWeb/HTML/StructuredSerialize.h>
|
#include <LibWeb/HTML/StructuredSerialize.h>
|
||||||
#include <LibWeb/HTML/WorkerGlobalScope.h>
|
#include <LibWeb/HTML/WorkerGlobalScope.h>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <LibWeb/Fetch/Fetching/Fetching.h>
|
#include <LibWeb/Fetch/Fetching/Fetching.h>
|
||||||
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
|
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
|
||||||
#include <LibWeb/HTML/DedicatedWorkerGlobalScope.h>
|
#include <LibWeb/HTML/DedicatedWorkerGlobalScope.h>
|
||||||
|
#include <LibWeb/HTML/MessagePort.h>
|
||||||
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
||||||
#include <LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h>
|
#include <LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h>
|
||||||
#include <LibWeb/HTML/Scripting/Fetching.h>
|
#include <LibWeb/HTML/Scripting/Fetching.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user