mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: avoid deprecated v8::Context::GetIsolate() calls (pt 2) (#47896)
* refactor: add a v8::Isolate* arg to Constructible::GetConstructor() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: add a v8::Isolate* arg to NodeBindings::Initialize() This is needed for the GetConstructor() call Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: avoid v8::Context::GetIsolate() call in GetIpcObject() by taking it as an arg Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: avoid v8::Context::GetIsolate() call in ipc_native::EmitIPCEvent() by taking it as an arg Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
@@ -40,8 +40,8 @@ template <typename T>
|
||||
class Constructible {
|
||||
public:
|
||||
static v8::Local<v8::Function> GetConstructor(
|
||||
v8::Isolate* const isolate,
|
||||
v8::Local<v8::Context> context) {
|
||||
v8::Isolate* isolate = context->GetIsolate();
|
||||
gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);
|
||||
auto* wrapper_info = &T::kWrapperInfo;
|
||||
v8::Local<v8::FunctionTemplate> constructor =
|
||||
|
||||
@@ -576,7 +576,8 @@ std::vector<std::string> NodeBindings::ParseNodeCliFlags() {
|
||||
return args;
|
||||
}
|
||||
|
||||
void NodeBindings::Initialize(v8::Local<v8::Context> context) {
|
||||
void NodeBindings::Initialize(v8::Isolate* const isolate,
|
||||
v8::Local<v8::Context> context) {
|
||||
TRACE_EVENT0("electron", "NodeBindings::Initialize");
|
||||
// Open node's error reporting system for browser process.
|
||||
|
||||
@@ -635,7 +636,7 @@ void NodeBindings::Initialize(v8::Local<v8::Context> context) {
|
||||
SetErrorMode(GetErrorMode() & ~SEM_NOGPFAULTERRORBOX);
|
||||
#endif
|
||||
|
||||
gin_helper::internal::Event::GetConstructor(context);
|
||||
gin_helper::internal::Event::GetConstructor(isolate, context);
|
||||
|
||||
g_is_initialized = true;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ class NodeBindings {
|
||||
virtual ~NodeBindings();
|
||||
|
||||
// Setup V8, libuv.
|
||||
void Initialize(v8::Local<v8::Context> context);
|
||||
void Initialize(v8::Isolate* isolate, v8::Local<v8::Context> context);
|
||||
|
||||
std::vector<std::string> ParseNodeCliFlags();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user