mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 00:08:59 +00:00
change how Blob and File initialized
This commit is contained in:
@@ -34,7 +34,7 @@ slice: []const u8,
|
|||||||
/// MIME attached to blob. Can be an empty string.
|
/// MIME attached to blob. Can be an empty string.
|
||||||
mime: []const u8,
|
mime: []const u8,
|
||||||
|
|
||||||
const Type = union(enum) {
|
pub const Type = union(enum) {
|
||||||
generic,
|
generic,
|
||||||
file: *@import("File.zig"),
|
file: *@import("File.zig"),
|
||||||
};
|
};
|
||||||
@@ -76,7 +76,11 @@ pub fn init(
|
|||||||
break :blk "";
|
break :blk "";
|
||||||
};
|
};
|
||||||
|
|
||||||
return page._factory.create(Blob{ .slice = slice, .mime = mime });
|
return page._factory.create(Blob{
|
||||||
|
._type = .generic,
|
||||||
|
.slice = slice,
|
||||||
|
.mime = mime,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const largest_vector = @max(std.simd.suggestVectorLength(u8) orelse 1, 8);
|
const largest_vector = @max(std.simd.suggestVectorLength(u8) orelse 1, 8);
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ const File = @This();
|
|||||||
_proto: *Blob,
|
_proto: *Blob,
|
||||||
|
|
||||||
// TODO: Implement File API.
|
// TODO: Implement File API.
|
||||||
pub fn init() File {
|
pub fn init(page: *Page) !*File {
|
||||||
return .{ ._proto = undefined };
|
return page._factory.blob(File{ ._proto = undefined });
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const JsApi = struct {
|
pub const JsApi = struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user