From 5bca90b07413fb412d5ac192c60e6d9522d47414 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 17 Oct 2019 18:01:55 -0700 Subject: [PATCH] wip --- src/v8_inspector/channel.h | 57 ++++++++++++++++++++++++++++++++++++++ v8 | 1 + 2 files changed, 58 insertions(+) create mode 100644 src/v8_inspector/channel.h create mode 120000 v8 diff --git a/src/v8_inspector/channel.h b/src/v8_inspector/channel.h new file mode 100644 index 00000000..deaaebe2 --- /dev/null +++ b/src/v8_inspector/channel.h @@ -0,0 +1,57 @@ +#include +#include + +extern "C" { +using namespace v8_inspector; + +void v8_inspector__Channel__EXTENDER__sendResponse(Channel& self, + int callId, + StringBuffer* message); +void v8_inspector__Channel__EXTENDER__sendNotification(Channel& self, + StringBuffer* message); +void v8_inspector__Channel__EXTENDER__flushProtocolNotifications(Channel& self); +} // extern "C" + +namespace v8_inspector { +struct Channel__EXTENDER : public Channel { + using Channel::Channel; + static_assert(sizeof(std::unique_ptr) == sizeof(StringBuffer*)); + + void sendResponse(int callId, + std::unique_ptr message) override { + v8_inspector__Channel__EXTENDER__sendResponse(*this, callId, + message.release()); + } + void sendNotification(std::unique_ptr message) override { + v8_inspector__Channel__EXTENDER__sendNotification(*this, message.release()); + } + void flushProtocolNotifications() override { + v8_inspector__Channel__EXTENDER__flushProtocolNotifications(*this); + } +}; +} // namespace v8_inspector + +extern "C" { +using namespace v8_inspector; + +void v8_inspector__Channel__EXTENDER__CTOR(uninit_t& buf) { + new (std::launder(&buf)) Channel__EXTENDER(); +} +void v8_inspector__Channel__DTOR(Channel& self) { + self.~Channel(); +} + +void v8_inspector__Channel__sendResponse(Channel& self, + int callId, + StringBuffer* message) { + self.sendResponse(callId, + static_cast>(message)); +} +void v8_inspector__Channel__sendNotification(Channel& self, + StringBuffer* message) { + self.sendNotification(static_cast>(message)); +} +void v8_inspector__Channel__flushProtocolNotifications(Channel& self) { + self.flushProtocolNotifications(); +} +} // extern "C" \ No newline at end of file diff --git a/v8 b/v8 new file mode 120000 index 00000000..be27a02b --- /dev/null +++ b/v8 @@ -0,0 +1 @@ +d:/deno2/third_party/v8 \ No newline at end of file