fix: explicitly call GetNativeNSView() on macOS (#46733)
* fix: explicitly call GetNativeNSView() on macOS * chore: move macOS impl to a .mm file This is needed in order to access gfx::NativeView::GetNativeNSView()
This commit is contained in:
parent
686ae47696
commit
c7b0bdab7e
6 changed files with 62 additions and 4 deletions
|
@ -3743,15 +3743,17 @@ void WebContents::SetDevToolsWebContents(const WebContents* devtools) {
|
|||
inspectable_web_contents_->SetDevToolsWebContents(devtools->web_contents());
|
||||
}
|
||||
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
v8::Local<v8::Value> WebContents::GetNativeView(v8::Isolate* isolate) const {
|
||||
gfx::NativeView ptr = web_contents()->GetNativeView();
|
||||
auto buffer = node::Buffer::Copy(isolate, reinterpret_cast<char*>(&ptr),
|
||||
sizeof(gfx::NativeView));
|
||||
auto buffer =
|
||||
node::Buffer::Copy(isolate, reinterpret_cast<char*>(&ptr), sizeof(ptr));
|
||||
if (buffer.IsEmpty())
|
||||
return v8::Null(isolate);
|
||||
else
|
||||
return buffer.ToLocalChecked();
|
||||
}
|
||||
#endif
|
||||
|
||||
v8::Local<v8::Value> WebContents::DevToolsWebContents(v8::Isolate* isolate) {
|
||||
if (devtools_web_contents_.IsEmpty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue