fix: remove unneeded handlescope from JS callbacks (#48344)
fix: remove unneeded handlescope from JS callbacks (#48318) fix: remove handlescope from JS callbacks
This commit is contained in:
parent
93ef8abd99
commit
40fb7621a9
2 changed files with 4 additions and 10 deletions
|
@ -1697,14 +1697,11 @@ Session* Session::CreateFrom(v8::Isolate* isolate,
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
v8::Local<v8::Object> wrapper;
|
||||||
v8::HandleScope handle_scope(isolate);
|
if (!session->GetWrapper(isolate).ToLocal(&wrapper)) {
|
||||||
v8::Local<v8::Object> wrapper;
|
return nullptr;
|
||||||
if (!session->GetWrapper(isolate).ToLocal(&wrapper)) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
App::Get()->EmitWithoutEvent("session-created", wrapper);
|
|
||||||
}
|
}
|
||||||
|
App::Get()->EmitWithoutEvent("session-created", wrapper);
|
||||||
|
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
@ -1883,7 +1880,6 @@ v8::Local<v8::Value> FromPartition(const std::string& partition,
|
||||||
Session::FromPartition(args->isolate(), partition, std::move(options));
|
Session::FromPartition(args->isolate(), partition, std::move(options));
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
v8::HandleScope handle_scope(args->isolate());
|
|
||||||
v8::Local<v8::Object> wrapper;
|
v8::Local<v8::Object> wrapper;
|
||||||
if (!session->GetWrapper(args->isolate()).ToLocal(&wrapper)) {
|
if (!session->GetWrapper(args->isolate()).ToLocal(&wrapper)) {
|
||||||
return v8::Null(args->isolate());
|
return v8::Null(args->isolate());
|
||||||
|
@ -1905,7 +1901,6 @@ v8::Local<v8::Value> FromPath(const base::FilePath& path,
|
||||||
Session* session = Session::FromPath(args, path, std::move(options));
|
Session* session = Session::FromPath(args, path, std::move(options));
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
v8::HandleScope handle_scope(args->isolate());
|
|
||||||
v8::Local<v8::Object> wrapper;
|
v8::Local<v8::Object> wrapper;
|
||||||
if (!session->GetWrapper(args->isolate()).ToLocal(&wrapper)) {
|
if (!session->GetWrapper(args->isolate()).ToLocal(&wrapper)) {
|
||||||
return v8::Null(args->isolate());
|
return v8::Null(args->isolate());
|
||||||
|
|
|
@ -3758,7 +3758,6 @@ v8::Local<v8::Value> WebContents::GetOwnerBrowserWindow(
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::Local<v8::Value> WebContents::Session(v8::Isolate* isolate) {
|
v8::Local<v8::Value> WebContents::Session(v8::Isolate* isolate) {
|
||||||
v8::HandleScope handle_scope(isolate);
|
|
||||||
v8::Local<v8::Object> wrapper;
|
v8::Local<v8::Object> wrapper;
|
||||||
if (!session_->GetWrapper(isolate).ToLocal(&wrapper)) {
|
if (!session_->GetWrapper(isolate).ToLocal(&wrapper)) {
|
||||||
return v8::Null(isolate);
|
return v8::Null(isolate);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue