mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
refactor: allocate api::Debugger on cpp heap (#48266)
* refactor: remove unused isolate arg from Debugger ctor * refactor: make Debugger ctor, dtor public needed for cppgc::MakeGarbageCollected() This is what upstream does, e.g. https://chromium-review.googlesource.com/c/chromium/src/+/6722236 * fixup! refactor: remove unused isolate arg from Debugger ctor mark Debugger ctor as explicit * refactor: in EventEmitterMixin, handle both old and new WrapperInfo types * refactor: make electron::api::Debugger inherit from gin::Wrappable * refactor: add api::Debugger::GetTypeName() * refactor: add api::Debugger::GetClassName()
This commit is contained in:
@@ -3804,11 +3804,16 @@ v8::Local<v8::Value> WebContents::DevToolsWebContents(v8::Isolate* isolate) {
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> WebContents::Debugger(v8::Isolate* isolate) {
|
||||
if (debugger_.IsEmpty()) {
|
||||
auto handle = electron::api::Debugger::Create(isolate, web_contents());
|
||||
debugger_.Reset(isolate, handle.ToV8());
|
||||
if (!debugger_) {
|
||||
debugger_ = electron::api::Debugger::Create(isolate, web_contents());
|
||||
}
|
||||
return v8::Local<v8::Value>::New(isolate, debugger_);
|
||||
|
||||
v8::HandleScope handle_scope{isolate};
|
||||
v8::Local<v8::Object> wrapper;
|
||||
if (!debugger_->GetWrapper(isolate).ToLocal(&wrapper)) {
|
||||
return v8::Null(isolate);
|
||||
}
|
||||
return v8::Local<v8::Value>::New(isolate, wrapper);
|
||||
}
|
||||
|
||||
content::RenderFrameHost* WebContents::MainFrame() {
|
||||
|
||||
Reference in New Issue
Block a user