浏览代码

LibWeb: Move XHR::FormDataEntry to its own header

This avoids a circular dependency in a future commit
Andrew Kaster 1 年之前
父节点
当前提交
a83668d838
共有 2 个文件被更改,包括 25 次插入8 次删除
  1. 1 8
      Userland/Libraries/LibWeb/XHR/FormData.h
  2. 24 0
      Userland/Libraries/LibWeb/XHR/FormDataEntry.h

+ 1 - 8
Userland/Libraries/LibWeb/XHR/FormData.h

@@ -11,17 +11,10 @@
 #include <LibWeb/Forward.h>
 #include <LibWeb/Forward.h>
 #include <LibWeb/HTML/HTMLFormElement.h>
 #include <LibWeb/HTML/HTMLFormElement.h>
 #include <LibWeb/WebIDL/ExceptionOr.h>
 #include <LibWeb/WebIDL/ExceptionOr.h>
+#include <LibWeb/XHR/FormDataEntry.h>
 
 
 namespace Web::XHR {
 namespace Web::XHR {
 
 
-// https://xhr.spec.whatwg.org/#formdataentryvalue
-using FormDataEntryValue = Variant<JS::Handle<FileAPI::File>, String>;
-
-struct FormDataEntry {
-    String name;
-    FormDataEntryValue value;
-};
-
 // https://xhr.spec.whatwg.org/#interface-formdata
 // https://xhr.spec.whatwg.org/#interface-formdata
 class FormData : public Bindings::PlatformObject {
 class FormData : public Bindings::PlatformObject {
     WEB_PLATFORM_OBJECT(FormData, Bindings::PlatformObject);
     WEB_PLATFORM_OBJECT(FormData, Bindings::PlatformObject);

+ 24 - 0
Userland/Libraries/LibWeb/XHR/FormDataEntry.h

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2023, Kenneth Myhra <kennethmyhra@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <AK/String.h>
+#include <AK/Variant.h>
+#include <LibJS/Heap/Handle.h>
+#include <LibWeb/Forward.h>
+
+namespace Web::XHR {
+
+// https://xhr.spec.whatwg.org/#formdataentryvalue
+using FormDataEntryValue = Variant<JS::Handle<FileAPI::File>, String>;
+
+struct FormDataEntry {
+    String name;
+    FormDataEntryValue value;
+};
+
+}