chore: fix IsolateData handling (#20918)
This commit is contained in:
parent
776cab96b1
commit
b194d5d0e2
4 changed files with 17 additions and 4 deletions
|
@ -336,9 +336,11 @@ node::Environment* NodeBindings::CreateEnvironment(
|
|||
args.insert(args.begin() + 1, init_script);
|
||||
|
||||
std::unique_ptr<const char*[]> c_argv = StringVectorToArgArray(args);
|
||||
node::Environment* env = node::CreateEnvironment(
|
||||
node::CreateIsolateData(context->GetIsolate(), uv_loop_, platform),
|
||||
context, args.size(), c_argv.get(), 0, nullptr, bootstrap_env);
|
||||
isolate_data_ =
|
||||
node::CreateIsolateData(context->GetIsolate(), uv_loop_, platform);
|
||||
node::Environment* env =
|
||||
node::CreateEnvironment(isolate_data_, context, args.size(), c_argv.get(),
|
||||
0, nullptr, bootstrap_env);
|
||||
DCHECK(env);
|
||||
|
||||
// Clean up the global _noBrowserGlobals that we unironically injected into
|
||||
|
|
|
@ -19,6 +19,7 @@ class MessageLoop;
|
|||
namespace node {
|
||||
class Environment;
|
||||
class MultiIsolatePlatform;
|
||||
class IsolateData;
|
||||
} // namespace node
|
||||
|
||||
namespace electron {
|
||||
|
@ -54,6 +55,8 @@ class NodeBindings {
|
|||
// Do message loop integration.
|
||||
virtual void RunMessageLoop();
|
||||
|
||||
node::IsolateData* isolate_data() const { return isolate_data_; }
|
||||
|
||||
// Gets/sets the environment to wrap uv loop.
|
||||
void set_uv_env(node::Environment* env) { uv_env_ = env; }
|
||||
node::Environment* uv_env() const { return uv_env_; }
|
||||
|
@ -106,6 +109,9 @@ class NodeBindings {
|
|||
// Environment that to wrap the uv loop.
|
||||
node::Environment* uv_env_ = nullptr;
|
||||
|
||||
// Isolate data used in creating the environment
|
||||
node::IsolateData* isolate_data_ = nullptr;
|
||||
|
||||
base::WeakPtrFactory<NodeBindings> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NodeBindings);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue