summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/FileAPI/Blob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/FileAPI/Blob.cpp')
-rw-r--r--Userland/Libraries/LibWeb/FileAPI/Blob.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp
index d2d19a093d..6a76a7cbd4 100644
--- a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp
+++ b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp
@@ -115,7 +115,6 @@ bool is_basic_latin(StringView view)
Blob::Blob(JS::Realm& realm)
: PlatformObject(realm)
{
- set_prototype(&Bindings::cached_web_prototype(realm, "Blob"));
}
Blob::Blob(JS::Realm& realm, ByteBuffer byte_buffer, DeprecatedString type)
@@ -123,18 +122,22 @@ Blob::Blob(JS::Realm& realm, ByteBuffer byte_buffer, DeprecatedString type)
, m_byte_buffer(move(byte_buffer))
, m_type(move(type))
{
- set_prototype(&Bindings::cached_web_prototype(realm, "Blob"));
}
Blob::Blob(JS::Realm& realm, ByteBuffer byte_buffer)
: PlatformObject(realm)
, m_byte_buffer(move(byte_buffer))
{
- set_prototype(&Bindings::cached_web_prototype(realm, "Blob"));
}
Blob::~Blob() = default;
+void Blob::initialize(JS::Realm& realm)
+{
+ Base::initialize(realm);
+ set_prototype(&Bindings::ensure_web_prototype<Bindings::BlobPrototype>(realm, "Blob"));
+}
+
// https://w3c.github.io/FileAPI/#ref-for-dom-blob-blob
WebIDL::ExceptionOr<JS::NonnullGCPtr<Blob>> Blob::create(JS::Realm& realm, Optional<Vector<BlobPart>> const& blob_parts, Optional<BlobPropertyBag> const& options)
{