mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-15 15:58:57 +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: []const u8,
|
||||
|
||||
const Type = union(enum) {
|
||||
pub const Type = union(enum) {
|
||||
generic,
|
||||
file: *@import("File.zig"),
|
||||
};
|
||||
@@ -76,7 +76,11 @@ pub fn init(
|
||||
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);
|
||||
|
||||
@@ -28,8 +28,8 @@ const File = @This();
|
||||
_proto: *Blob,
|
||||
|
||||
// TODO: Implement File API.
|
||||
pub fn init() File {
|
||||
return .{ ._proto = undefined };
|
||||
pub fn init(page: *Page) !*File {
|
||||
return page._factory.blob(File{ ._proto = undefined });
|
||||
}
|
||||
|
||||
pub const JsApi = struct {
|
||||
|
||||
Reference in New Issue
Block a user