refactor: remove uses of v8::Isolate::GetCurrent (#24179)

This commit is contained in:
Shelley Vohr 2020-06-22 09:35:24 -07:00 committed by GitHub
commit 61a05caa78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 69 additions and 46 deletions

View file

@ -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;