mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-10-09 12:51:45 -04:00
chore: Move ownership of the Inbox from HttpClient to WebSocker Driver
Currently, the HttpClient owns the inbox and its borrowed by the Link. This is a bit backwards, but it also means that we can't eagerly create a Link: the Link needs the inbox, so it needs the HttpClient, which is created by the Browser (which creates an Isolate). Remember, the Inbox is one of the few things shared between the main thread and the worker, so either end can own it and the other can borrow it. This switches the ownership so that the HttpClient now borrows the Inbox from the Server's side of the Link (the WebSocket). The main goal of this change is to prepare for more advanced HTTP WebDriver flows. The more we can create _without_ a Browser, the fewer edge cases we have to deal with (Browser because it's expensive and has to be created on the Worker thread due to how V8::Isolate works).
This commit is contained in:
16 files changed
+111
-96
No files matched your search
+1
-1
@@ -43,7 +43,7 @@ pub fn init(self: *ToolSession, app: *App) !void {
|
||||
self.registry = .init(app.allocator);
|
||||
errdefer self.registry.deinit();
|
||||
|
||||
try self.browser.init(app, .{}, null);
|
||||
try self.browser.init(app, .{});
|
||||
errdefer self.browser.deinit();
|
||||
|
||||
try self.restartSession();
|
||||
|
||||
Reference in new issue
Block a user