mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibWeb: Remove unecessary dependence on Window from Fetch, XHR, FileAPI
These classes only needed Window to get at its realm. Pass a realm directly to construct Fetch, XMLHttpRequest and FileAPI classes.
This commit is contained in:
parent
6a10352712
commit
4878a18ee7
17 changed files with 144 additions and 169 deletions
|
@ -6,7 +6,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Time.h>
|
||||
#include <LibWeb/FileAPI/Blob.h>
|
||||
|
||||
namespace Web::FileAPI {
|
||||
|
@ -19,8 +18,8 @@ class File : public Blob {
|
|||
WEB_PLATFORM_OBJECT(File, Blob);
|
||||
|
||||
public:
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<File>> create(HTML::Window&, Vector<BlobPart> const& file_bits, String const& file_name, Optional<FilePropertyBag> const& options = {});
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<File>> create_with_global_object(HTML::Window&, Vector<BlobPart> const& file_bits, String const& file_name, Optional<FilePropertyBag> const& options = {});
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<File>> create(JS::Realm&, Vector<BlobPart> const& file_bits, String const& file_name, Optional<FilePropertyBag> const& options = {});
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<File>> construct_impl(JS::Realm&, Vector<BlobPart> const& file_bits, String const& file_name, Optional<FilePropertyBag> const& options = {});
|
||||
|
||||
virtual ~File() override;
|
||||
|
||||
|
@ -30,7 +29,7 @@ public:
|
|||
i64 last_modified() const { return m_last_modified; }
|
||||
|
||||
private:
|
||||
File(HTML::Window&, ByteBuffer, String file_name, String type, i64 last_modified);
|
||||
File(JS::Realm&, ByteBuffer, String file_name, String type, i64 last_modified);
|
||||
|
||||
String m_name;
|
||||
i64 m_last_modified { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue