browser: rename setInspector -> initInspector

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-10-09 12:45:28 +02:00
parent eaf5c6f86f
commit fa4920bd94
2 changed files with 7 additions and 7 deletions

View File

@@ -138,7 +138,7 @@ pub const Session = struct {
self.alloc.destroy(self);
}
pub fn setInspector(
pub fn initInspector(
self: *Session,
ctx: anytype,
onResp: jsruntime.InspectorOnResponseFn,
@@ -149,15 +149,15 @@ pub const Session = struct {
self.env.setInspector(self.inspector.?);
}
pub fn createPage(self: *Session) !Page {
return Page.init(self.alloc, self);
}
pub fn callInspector(self: *Session, msg: []const u8) void {
if (self.inspector) |inspector| {
inspector.send(msg, self.env);
}
}
pub fn createPage(self: *Session) !Page {
return Page.init(self.alloc, self);
}
};
// Page navigates to an url.

View File

@@ -300,7 +300,7 @@ pub const Ctx = struct {
fn newSession(self: *Ctx) !void {
try self.browser.newSession(self.alloc(), self.loop);
try self.browser.currentSession().setInspector(
try self.browser.currentSession().initInspector(
self,
Ctx.onInspectorResp,
Ctx.onInspectorNotif,
@@ -426,7 +426,7 @@ pub fn listen(
.conn_completion = &conn_completion,
.timeout_completion = &timeout_completion,
};
try browser.currentSession().setInspector(
try browser.currentSession().initInspector(
&ctx,
Ctx.onInspectorResp,
Ctx.onInspectorNotif,