diff --git a/inspector.cc b/inspector.cc index ff32e2ea..ac09426a 100644 --- a/inspector.cc +++ b/inspector.cc @@ -46,22 +46,22 @@ void InspectorClient::consoleAPIMessage(int contextGroupId, extern "C" { -InspectorPtr CreateInspector(v8Isolate* iso, InspectorClientPtr client) { - InspectorPtr inspector = V8Inspector::create(iso, client).release(); +v8Inspector* CreateInspector(v8Isolate* iso, v8InspectorClient* client) { + v8Inspector* inspector = V8Inspector::create(iso, client).release(); return inspector; } -void DeleteInspector(InspectorPtr inspector) { +void DeleteInspector(v8Inspector* inspector) { delete inspector; } /********** InspectorClient **********/ -InspectorClientPtr NewInspectorClient(uintptr_t callbackRef) { +v8InspectorClient* NewInspectorClient(uintptr_t callbackRef) { return new InspectorClient(callbackRef); } -void InspectorContextCreated(InspectorPtr inspector, ContextPtr context) { +void InspectorContextCreated(v8Inspector* inspector, ContextPtr context) { LOCAL_CONTEXT(context); int groupId = 1; StringView name = StringView((const uint8_t*)"Test", 4); @@ -69,12 +69,12 @@ void InspectorContextCreated(InspectorPtr inspector, ContextPtr context) { inspector->contextCreated(info); } -void InspectorContextDestroyed(InspectorPtr inspector, ContextPtr context) { +void InspectorContextDestroyed(v8Inspector* inspector, ContextPtr context) { LOCAL_CONTEXT(context); inspector->contextDestroyed(local_ctx); } -void DeleteInspectorClient(InspectorClientPtr client) { +void DeleteInspectorClient(v8InspectorClient* client) { delete client; } } diff --git a/inspector.go b/inspector.go index 60e2c5da..5adcbdff 100644 --- a/inspector.go +++ b/inspector.go @@ -31,12 +31,12 @@ const ( // // See also: https://v8.github.io/api/head/classv8__inspector_1_1V8Inspector.html type Inspector struct { - ptr C.InspectorPtr + ptr *C.v8Inspector } // An InspectorClient is the bridge from the [Inspector] to your code. type InspectorClient struct { - ptr C.InspectorClientPtr + ptr *C.v8InspectorClient clientHandle cgo.Handle } diff --git a/inspector.h b/inspector.h index e1c8b7b3..d542edff 100644 --- a/inspector.h +++ b/inspector.h @@ -13,16 +13,13 @@ class V8InspectorClient; }; // namespace v8_inspector typedef v8::Isolate v8Isolate; -typedef v8_inspector::V8Inspector* InspectorPtr; -typedef v8_inspector::V8InspectorClient* InspectorClientPtr; +typedef v8_inspector::V8Inspector v8Inspector; +typedef v8_inspector::V8InspectorClient v8InspectorClient; extern "C" { #else typedef struct v8Inspector v8Inspector; -typedef v8Inspector* InspectorPtr; - typedef struct v8InspectorClient v8InspectorClient; -typedef v8InspectorClient* InspectorClientPtr; typedef struct v8Isolate v8Isolate; @@ -36,14 +33,14 @@ typedef _Bool bool; typedef struct m_ctx m_ctx; typedef m_ctx* ContextPtr; -extern InspectorPtr CreateInspector(v8Isolate* iso, InspectorClientPtr client); -extern void DeleteInspector(InspectorPtr inspector); -extern void InspectorContextCreated(InspectorPtr inspector, ContextPtr context); -extern void InspectorContextDestroyed(InspectorPtr inspector, +extern v8Inspector* CreateInspector(v8Isolate* iso, v8InspectorClient* client); +extern void DeleteInspector(v8Inspector* inspector); +extern void InspectorContextCreated(v8Inspector* inspector, ContextPtr context); +extern void InspectorContextDestroyed(v8Inspector* inspector, ContextPtr context); -extern InspectorClientPtr NewInspectorClient(uintptr_t callbackRef); -extern void DeleteInspectorClient(InspectorClientPtr client); +extern v8InspectorClient* NewInspectorClient(uintptr_t callbackRef); +extern void DeleteInspectorClient(v8InspectorClient* client); typedef struct StringViewData { bool is8bit;