Skip to content

Commit fa4920b

Browse files
browser: rename setInspector -> initInspector
Signed-off-by: Francis Bouvier <[email protected]>
1 parent eaf5c6f commit fa4920b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/browser/browser.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub const Session = struct {
138138
self.alloc.destroy(self);
139139
}
140140

141-
pub fn setInspector(
141+
pub fn initInspector(
142142
self: *Session,
143143
ctx: anytype,
144144
onResp: jsruntime.InspectorOnResponseFn,
@@ -149,15 +149,15 @@ pub const Session = struct {
149149
self.env.setInspector(self.inspector.?);
150150
}
151151

152-
pub fn createPage(self: *Session) !Page {
153-
return Page.init(self.alloc, self);
154-
}
155-
156152
pub fn callInspector(self: *Session, msg: []const u8) void {
157153
if (self.inspector) |inspector| {
158154
inspector.send(msg, self.env);
159155
}
160156
}
157+
158+
pub fn createPage(self: *Session) !Page {
159+
return Page.init(self.alloc, self);
160+
}
161161
};
162162

163163
// Page navigates to an url.

src/server.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ pub const Ctx = struct {
300300

301301
fn newSession(self: *Ctx) !void {
302302
try self.browser.newSession(self.alloc(), self.loop);
303-
try self.browser.currentSession().setInspector(
303+
try self.browser.currentSession().initInspector(
304304
self,
305305
Ctx.onInspectorResp,
306306
Ctx.onInspectorNotif,
@@ -426,7 +426,7 @@ pub fn listen(
426426
.conn_completion = &conn_completion,
427427
.timeout_completion = &timeout_completion,
428428
};
429-
try browser.currentSession().setInspector(
429+
try browser.currentSession().initInspector(
430430
&ctx,
431431
Ctx.onInspectorResp,
432432
Ctx.onInspectorNotif,

0 commit comments

Comments
 (0)