mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05: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. (cherry picked from commit 32a22c49e3e999e681e2d1de1ebabd092a7f9b47)
This commit is contained in:
parent
ca8332d01e
commit
cc4c7917d5
16 changed files with 31 additions and 22 deletions
|
@ -544,6 +544,7 @@ struct POSTResource;
|
|||
struct ScrollOptions;
|
||||
struct ScrollToOptions;
|
||||
struct SerializedFormData;
|
||||
struct StructuredSerializeOptions;
|
||||
struct ToggleTaskTracker;
|
||||
struct TransferDataHolder;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -20,11 +20,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 {
|
||||
|
|
|
@ -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) \
|
||||
|
|
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/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/Origin.h>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -28,6 +28,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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue