mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
add pump message loop calls
This commit is contained in:
@@ -156,6 +156,8 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
return struct {
|
||||
allocator: Allocator,
|
||||
|
||||
platform: *const Platform,
|
||||
|
||||
// the global isolate
|
||||
isolate: v8.Isolate,
|
||||
|
||||
@@ -181,7 +183,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
|
||||
const Opts = struct {};
|
||||
|
||||
pub fn init(allocator: Allocator, _: Opts) !*Self {
|
||||
pub fn init(allocator: Allocator, platform: *const Platform, _: Opts) !*Self {
|
||||
// var params = v8.initCreateParams();
|
||||
var params = try allocator.create(v8.CreateParams);
|
||||
errdefer allocator.destroy(params);
|
||||
@@ -215,6 +217,7 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
errdefer allocator.destroy(env);
|
||||
|
||||
env.* = .{
|
||||
.platform = platform,
|
||||
.isolate = isolate,
|
||||
.templates = undefined,
|
||||
.allocator = allocator,
|
||||
@@ -270,6 +273,10 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
|
||||
self.isolate.performMicrotasksCheckpoint();
|
||||
}
|
||||
|
||||
pub fn pumpMessageLoop(self: *const Self) bool {
|
||||
return self.platform.inner.pumpMessageLoop(self.isolate, false);
|
||||
}
|
||||
|
||||
pub fn newExecutionWorld(self: *Self) !ExecutionWorld {
|
||||
return .{
|
||||
.env = self,
|
||||
|
||||
Reference in New Issue
Block a user