Skip to content

Commit 574f6c8

Browse files
Add some comments for Inspector methods parameters
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
1 parent 98c24c5 commit 574f6c8

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/engines/v8/v8.zig

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,26 @@ pub const Inspector = struct {
541541
alloc.destroy(self.inner);
542542
}
543543

544-
pub fn contextCreated(self: Inspector, env: Env, name: []const u8, origin: []const u8, auxData: ?[]const u8) void {
544+
// From CDP docs
545+
// https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-ExecutionContextDescription
546+
// ----
547+
// - name: Human readable name describing given context.
548+
// - origin: Execution context origin (ie. URL who initialised the request)
549+
// - auxData: Embedder-specific auxiliary data likely matching
550+
// {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
551+
pub fn contextCreated(
552+
self: Inspector,
553+
env: Env,
554+
name: []const u8,
555+
origin: []const u8,
556+
auxData: ?[]const u8,
557+
) void {
545558
self.inner.contextCreated(env.js_ctx.?, name, origin, auxData);
546559
}
547560

561+
// msg should be formatted for the Inspector protocol
562+
// for v8 it's the CDP protocol https://chromedevtools.github.io/devtools-protocol/
563+
// with only some domains being relevant (mainly Runtime and Debugger)
548564
pub fn send(self: Inspector, env: Env, msg: []const u8) void {
549565
return self.session.dispatchProtocolMessage(env.isolate, msg);
550566
}

0 commit comments

Comments
 (0)