refactor: remove uses of v8::Isolate::GetCurrent (#24179)
This commit is contained in:
parent
563a8c83ea
commit
61a05caa78
24 changed files with 69 additions and 46 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "shell/browser/api/electron_api_session.h"
|
||||
#include "shell/browser/api/electron_api_web_contents.h"
|
||||
#include "shell/browser/electron_browser_context.h"
|
||||
#include "shell/browser/javascript_environment.h"
|
||||
#include "shell/common/gin_converters/callback_converter.h"
|
||||
#include "shell/common/gin_converters/gurl_converter.h"
|
||||
#include "shell/common/gin_converters/net_converter.h"
|
||||
|
@ -409,7 +410,7 @@ void WebRequest::HandleSimpleEvent(SimpleEvent event,
|
|||
if (!MatchesFilterCondition(request_info, info.url_patterns))
|
||||
return;
|
||||
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
gin::Dictionary details(isolate, v8::Object::New(isolate));
|
||||
FillDetails(&details, request_info, args...);
|
||||
|
@ -432,7 +433,7 @@ int WebRequest::HandleResponseEvent(ResponseEvent event,
|
|||
|
||||
callbacks_[request_info->id] = std::move(callback);
|
||||
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
gin::Dictionary details(isolate, v8::Object::New(isolate));
|
||||
FillDetails(&details, request_info, args...);
|
||||
|
@ -454,7 +455,7 @@ void WebRequest::OnListenerResult(uint64_t id,
|
|||
|
||||
int result = net::OK;
|
||||
if (response->IsObject()) {
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
gin::Dictionary dict(isolate, response.As<v8::Object>());
|
||||
|
||||
bool cancel = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue