mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-15 15:58:57 +00:00
move Blob out of files/ + provide subclasses of Blob in _type
This commit is contained in:
@@ -26,6 +26,7 @@ const Page = @import("../../Page.zig");
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/API/Blob
|
||||
const Blob = @This();
|
||||
|
||||
_type: Type,
|
||||
/// Immutable slice of blob.
|
||||
/// Note that another blob may hold a pointer/slice to this,
|
||||
/// so its better to leave the deallocation of it to arena allocator.
|
||||
@@ -33,6 +34,11 @@ slice: []const u8,
|
||||
/// MIME attached to blob. Can be an empty string.
|
||||
mime: []const u8,
|
||||
|
||||
const Type = union(enum) {
|
||||
generic,
|
||||
file: *@import("File.zig"),
|
||||
};
|
||||
|
||||
const InitOptions = struct {
|
||||
/// MIME type.
|
||||
type: []const u8 = "",
|
||||
Reference in New Issue
Block a user