mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-30 17:18:57 +00:00
Removes CDPT (generic CDP)
CDPT used to be a generic so that we could inject Browser, Session, Page and Client. At some point, it [thankfully] became a generic only to inject Client. This commit removes the generic and bakes the *Server.Client instance in CDP. It uses a socketpair for testing. BrowserContext is still generic, but that's generic for a very different reason and, while I'd like to remove that generic too, it belongs in a different PR.
This commit is contained in:
@@ -324,7 +324,9 @@ pub const WsConnection = struct {
|
||||
pub fn init(socket: posix.socket_t, allocator: Allocator, json_version_response: []const u8, timeout_ms: u32) !WsConnection {
|
||||
const socket_flags = try posix.fcntl(socket, posix.F.GETFL, 0);
|
||||
const nonblocking = @as(u32, @bitCast(posix.O{ .NONBLOCK = true }));
|
||||
assert(socket_flags & nonblocking == nonblocking, "WsConnection.init blocking", .{});
|
||||
if (builtin.is_test == false) {
|
||||
assert(socket_flags & nonblocking == nonblocking, "WsConnection.init blocking", .{});
|
||||
}
|
||||
|
||||
var reader = try Reader(true).init(allocator);
|
||||
errdefer reader.deinit();
|
||||
|
||||
Reference in New Issue
Block a user