diff options
Diffstat (limited to 'core/inspector.rs')
-rw-r--r-- | core/inspector.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/inspector.rs b/core/inspector.rs index 2b03d663d..c83784fe3 100644 --- a/core/inspector.rs +++ b/core/inspector.rs @@ -111,6 +111,16 @@ impl v8::inspector::V8InspectorClientImpl for JsRuntimeInspector { &self.v8_inspector_client } + unsafe fn base_ptr( + this: *const Self, + ) -> *const v8::inspector::V8InspectorClientBase + where + Self: Sized, + { + // SAFETY: this pointer is valid for the whole lifetime of inspector + unsafe { std::ptr::addr_of!((*this).v8_inspector_client) } + } + fn base_mut(&mut self) -> &mut v8::inspector::V8InspectorClientBase { &mut self.v8_inspector_client } @@ -647,6 +657,14 @@ impl v8::inspector::ChannelImpl for InspectorSession { &self.v8_channel } + unsafe fn base_ptr(this: *const Self) -> *const v8::inspector::ChannelBase + where + Self: Sized, + { + // SAFETY: this pointer is valid for the whole lifetime of inspector + unsafe { std::ptr::addr_of!((*this).v8_channel) } + } + fn base_mut(&mut self) -> &mut v8::inspector::ChannelBase { &mut self.v8_channel } |