Add network.setCacheDisabled

Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
Francis Bouvier
2024-06-07 16:08:49 +02:00
parent 1929eed8ac
commit 7d67d131c2

View File

@@ -9,6 +9,7 @@ const stringify = cdp.stringify;
const NetworkMethods = enum {
enable,
setCacheDisabled,
};
pub fn network(
@@ -23,6 +24,7 @@ pub fn network(
return switch (method) {
.enable => networkEnable(alloc, id, scanner, ctx),
.setCacheDisabled => networkSetCacheDisabled(alloc, id, scanner, ctx),
};
}
@@ -36,3 +38,14 @@ fn networkEnable(
return result(alloc, id orelse msg.id.?, null, null, msg.sessionID);
}
fn networkSetCacheDisabled(
alloc: std.mem.Allocator,
id: ?u16,
scanner: *std.json.Scanner,
_: *Ctx,
) ![]const u8 {
const msg = try getMsg(alloc, void, scanner);
return result(alloc, id orelse msg.id.?, null, null, msg.sessionID);
}