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:
Timothy Flynn 2024-10-17 08:46:48 -04:00 committed by Tim Flynn
parent 5ed702e211
commit 32a22c49e3
Notes: github-actions[bot] 2024-10-17 20:35:59 +00:00
16 changed files with 31 additions and 22 deletions

View file

@ -545,6 +545,7 @@ struct POSTResource;
struct ScrollOptions;
struct ScrollToOptions;
struct SerializedFormData;
struct StructuredSerializeOptions;
struct ToggleTaskTracker;
struct TransferDataHolder;
}

View file

@ -11,6 +11,7 @@
#include <LibWeb/HTML/EventHandler.h>
#include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/MessageEvent.h>
#include <LibWeb/HTML/MessagePort.h>
namespace Web::HTML {

View file

@ -20,6 +20,7 @@
#include <LibWeb/HTML/MessageEvent.h>
#include <LibWeb/HTML/MessagePort.h>
#include <LibWeb/HTML/Scripting/TemporaryExecutionContext.h>
#include <LibWeb/HTML/StructuredSerializeOptions.h>
#include <LibWeb/HTML/WorkerGlobalScope.h>
namespace Web::HTML {

View file

@ -21,11 +21,6 @@ namespace Web::HTML {
E(onmessage, HTML::EventNames::message) \
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
class MessagePort final : public DOM::EventTarget
, public Bindings::Transferable {

View file

@ -8,7 +8,6 @@
#include <LibWeb/Bindings/ServiceWorkerPrototype.h>
#include <LibWeb/DOM/EventTarget.h>
#include <LibWeb/HTML/MessagePort.h>
#define ENUMERATE_SERVICE_WORKER_EVENT_HANDLERS(E) \
E(onstatechange, HTML::EventNames::statechange) \

View 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;
};
}

View file

@ -44,6 +44,7 @@
#include <LibWeb/HTML/HTMLObjectElement.h>
#include <LibWeb/HTML/Location.h>
#include <LibWeb/HTML/MessageEvent.h>
#include <LibWeb/HTML/MessagePort.h>
#include <LibWeb/HTML/Navigation.h>
#include <LibWeb/HTML/Navigator.h>
#include <LibWeb/HTML/PageTransitionEvent.h>

View file

@ -24,6 +24,7 @@
#include <LibWeb/HTML/Plugin.h>
#include <LibWeb/HTML/Scripting/ImportMap.h>
#include <LibWeb/HTML/ScrollOptions.h>
#include <LibWeb/HTML/StructuredSerializeOptions.h>
#include <LibWeb/HTML/WindowEventHandlers.h>
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
#include <LibWeb/RequestIdleCallback/IdleRequest.h>

View file

@ -27,6 +27,7 @@
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
#include <LibWeb/HTML/Scripting/Fetching.h>
#include <LibWeb/HTML/StructuredSerialize.h>
#include <LibWeb/HTML/StructuredSerializeOptions.h>
#include <LibWeb/HTML/Timer.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>

View file

@ -16,7 +16,6 @@
#include <LibWeb/Fetch/Request.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/ImageBitmap.h>
#include <LibWeb/HTML/MessagePort.h>
#include <LibWeb/PerformanceTimeline/PerformanceEntry.h>
#include <LibWeb/PerformanceTimeline/PerformanceEntryTuple.h>

View file

@ -5,14 +5,12 @@
*/
#include <AK/Debug.h>
#include <LibJS/Runtime/ConsoleObject.h>
#include <LibJS/Runtime/Realm.h>
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/Bindings/WorkerPrototype.h>
#include <LibWeb/HTML/MessagePort.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/WebIDL/ExceptionOr.h>
namespace Web::HTML {

View file

@ -6,20 +6,11 @@
#pragma once
#include <AK/RefCounted.h>
#include <LibURL/Parser.h>
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/Forward.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/WorkerAgent.h>
#include <LibWeb/HTML/WorkerDebugConsoleClient.h>
#include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
#define ENUMERATE_WORKER_EVENT_HANDLERS(E) \
E(onmessage, HTML::EventNames::message) \

View file

@ -5,6 +5,7 @@
*/
#include <LibWeb/Bindings/HostDefined.h>
#include <LibWeb/HTML/MessagePort.h>
#include <LibWeb/HTML/WorkerAgent.h>
#include <LibWeb/Page/Page.h>
#include <LibWeb/Worker/WebWorkerClient.h>

View file

@ -9,7 +9,6 @@
#include <LibWeb/Bindings/RequestPrototype.h>
#include <LibWeb/Bindings/WorkerPrototype.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/MessagePort.h>
#include <LibWeb/Worker/WebWorkerClient.h>
namespace Web::HTML {

View file

@ -11,6 +11,7 @@
#include <LibWeb/HTML/EventHandler.h>
#include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/MessageEvent.h>
#include <LibWeb/HTML/MessagePort.h>
#include <LibWeb/HTML/Scripting/ClassicScript.h>
#include <LibWeb/HTML/StructuredSerialize.h>
#include <LibWeb/HTML/WorkerGlobalScope.h>

View file

@ -9,6 +9,7 @@
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/HTML/DedicatedWorkerGlobalScope.h>
#include <LibWeb/HTML/MessagePort.h>
#include <LibWeb/HTML/Scripting/ClassicScript.h>
#include <LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h>
#include <LibWeb/HTML/Scripting/Fetching.h>