mirror of
				https://github.com/lightpanda-io/browser.git
				synced 2025-10-28 22:53:28 +00:00 
			
		
		
		
	browser: rename setInspector -> initInspector
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
		| @@ -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. | ||||
|   | ||||
| @@ -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, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Francis Bouvier
					Francis Bouvier