WebDriver: add navigate

This feature is significant because it adds support for processing an HTTP
request via the worker. It requires parking the connection and then having the
worker notify the loop when the response is ready. A lot of this was already
in-place (e.g. worker -> loop notification) but not quite do this extent.
This commit is contained in:
Karl Seguin committed 2026-09-16 14:05:49 +08:00
1 parent d52957b2e2
commit 7ecefa9e92
12 files changed
+756 -169

No files matched your search

+7
View File
@@ -30,6 +30,7 @@ const lp = @import("lightpanda");
const CDP = @import("server/cdp/CDP.zig");
const Link = @import("server/Link.zig");
const http_command = @import("server/bidi/http_command.zig");
const DoublyLinkedList = std.DoublyLinkedList;
@@ -168,10 +169,16 @@ pub const Message = struct {
// gets its BiDi connection after the fact).
link: *Link,
// An HTTP WebDriver command, parsed on the loop. Its connection is
// parked on the Server.Worker until the consumer responds.
bidi_http: http_command.Command,
pub fn size(self: Payload) usize {
return switch (self) {
.cdp => |c| c.raw.len,
.bidi, .ping => |b| b.len,
// one at a time, it never backs up
.bidi_http => 0,
.close, .disconnect, .link, .quit => 0,
};
}