Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: expose inspector session wrapObject #36

Draft
wants to merge 1 commit into
base: fork
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,16 @@ void v8_inspector__Session__dispatchProtocolMessage(
session->dispatchProtocolMessage(str_view);
}

struct RemoteObject{};

RemoteObject v8_inspector__Session__wrapObject(
v8_inspector::V8InspectorSession *session, v8::Isolate *isolate,
const v8::Context& ctx, const v8::Value& val,
const char *grpname, bool generatepreview) {
auto sv_grpname = toStringView(grpname);
return session->wrapObject(ptr_to_local(&ctx), ptr_to_local(&val), sv_grpname, generatepreview);
}

// InspectorChannel

v8_inspector__Channel__IMPL * v8_inspector__Channel__IMPL__CREATE(v8::Isolate *isolate) {
Expand Down
8 changes: 8 additions & 0 deletions src/binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -951,10 +951,18 @@ void v8_inspector__Client__IMPL__consoleAPIMessage(
const Context* v8_inspector__Client__IMPL__ensureDefaultContextInGroup(
InspectorClientImpl* self, void* data, int contextGroupId);


// RemoteObject
typedef struct RemoteObject RemoteObject;

// InspectorSession

typedef struct InspectorSession InspectorSession;
void v8_inspector__Session__dispatchProtocolMessage(InspectorSession *session, Isolate *isolate, const char* msg, usize msg_len);
RemoteObject v8_inspector__Session__wrapObject(
v8_inspector::V8InspectorSession *session, v8::Isolate *isolate,
const v8::Context& ctx, const v8::Value& val,
const char *grpname, bool generatepreview);

// Inspector
typedef struct Inspector Inspector;
Expand Down