Skip to content

Commit 9eed656

Browse files
committed
contex_id
1 parent 66f5801 commit 9eed656

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/binding.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "src/api/api.h"
88
#include "src/inspector/protocol/Runtime.h"
99
#include "src/inspector/v8-string-conversions.h"
10+
#include "src/debug/debug-interface.h"
1011

1112
#include "inspector.h"
1213

@@ -381,6 +382,10 @@ void v8__Context__SetEmbedderData(
381382
ptr_to_local(&self)->SetEmbedderData(idx, ptr_to_local(&val));
382383
}
383384

385+
int v8__Context__DebugContextId(const v8::Context& self) {
386+
return v8::debug::GetContextId(ptr_to_local(&self));
387+
}
388+
384389
// ScriptOrigin
385390

386391
void v8__ScriptOrigin__CONSTRUCT(
@@ -1677,6 +1682,10 @@ void v8_inspector__Inspector__ContextCreated(v8_inspector::V8Inspector *self,
16771682
self->contextCreated(info);
16781683
}
16791684

1685+
void v8_inspector__Inspector__resetContextGroup(v8_inspector::V8Inspector *self, int contextGroupId) {
1686+
self->resetContextGroup(contextGroupId);
1687+
}
1688+
16801689
// InspectorSession
16811690

16821691
void v8_inspector__Session__DELETE(v8_inspector::V8InspectorSession* self) {

src/binding.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ void v8__Context__SetEmbedderData(
338338
const Context* self,
339339
int idx,
340340
const Value* val);
341+
int v8__Context__DebugContextId(const Context* self);
341342

342343
// Boolean
343344
const Boolean* v8__Boolean__New(
@@ -1063,6 +1064,7 @@ void v8_inspector__Inspector__ContextCreated(Inspector *self, const char *name,
10631064
const char *auxData, const usize auxData_len,
10641065
int contextGroupId,
10651066
const Context* context);
1067+
void v8_inspector__Inspector__resetContextGroup(Inspector *self, int contextGroupId) ;
10661068

10671069
// RemoteObject
10681070
void v8_inspector__RemoteObject__DELETE(RemoteObject *self);

src/v8.zig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,10 @@ pub const Context = struct {
557557
pub fn setEmbedderData(self: Self, idx: u32, val: anytype) void {
558558
c.v8__Context__SetEmbedderData(self.handle, @as(c_int, @intCast(idx)), getValueHandle(val));
559559
}
560+
561+
pub fn debugContextId(self: Self) i32 {
562+
return c.v8__Context__DebugContextId(self.handle);
563+
}
560564
};
561565

562566
pub const PropertyCallbackInfo = struct {
@@ -2499,6 +2503,12 @@ pub const Inspector = struct {
24992503
);
25002504
self.ctx_handle = ctx.handle;
25012505
}
2506+
2507+
pub fn resetContextGroup(
2508+
self: *Inspector,
2509+
) void {
2510+
c.v8_inspector__Inspector__resetContextGroup(self.handle, contextGroupId);
2511+
}
25022512
};
25032513

25042514
// InspectorClient

0 commit comments

Comments
 (0)