mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 00:08:59 +00:00
Add navigate telemetry
This commit is contained in:
14
src/app.zig
14
src/app.zig
@@ -7,18 +7,30 @@ const Telemetry = @import("telemetry/telemetry.zig").Telemetry;
|
||||
// Container for global state / objects that various parts of the system
|
||||
// might need.
|
||||
pub const App = struct {
|
||||
loop: *Loop,
|
||||
allocator: Allocator,
|
||||
telemetry: Telemetry,
|
||||
|
||||
pub fn init(allocator: Allocator, loop: *Loop) !App {
|
||||
pub fn init(allocator: Allocator) !App {
|
||||
const loop = try allocator.create(Loop);
|
||||
errdefer allocator.destroy(loop);
|
||||
|
||||
loop.* = try Loop.init(allocator);
|
||||
errdefer loop.deinit();
|
||||
|
||||
const telemetry = Telemetry.init(allocator, loop);
|
||||
errdefer telemetry.deinit();
|
||||
|
||||
return .{
|
||||
.loop = loop,
|
||||
.allocator = allocator,
|
||||
.telemetry = telemetry,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn deinit(self: *App) void {
|
||||
self.telemetry.deinit();
|
||||
self.loop.deinit();
|
||||
self.allocator.destroy(self.loop);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user