mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
cdp: check parameter's type on sendEvent
Disallow void type.
This commit is contained in:
@@ -206,6 +206,9 @@ pub fn sendEvent(
|
|||||||
params: T,
|
params: T,
|
||||||
sessionID: ?[]const u8,
|
sessionID: ?[]const u8,
|
||||||
) !void {
|
) !void {
|
||||||
|
// some clients like chromedp expects empty parameters structs.
|
||||||
|
if (T == void) @compileError("sendEvent: use struct{} instead of void for empty parameters");
|
||||||
|
|
||||||
log_cdp.debug("Event > method {s}, sessionID {?s}", .{ name, sessionID });
|
log_cdp.debug("Event > method {s}, sessionID {?s}", .{ name, sessionID });
|
||||||
const Resp = struct {
|
const Resp = struct {
|
||||||
method: []const u8,
|
method: []const u8,
|
||||||
|
|||||||
Reference in New Issue
Block a user