File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -490,13 +490,20 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
490490MultiIsolatePlatform* CreatePlatform (
491491 int thread_pool_size,
492492 node::tracing::TracingController* tracing_controller) {
493- return new NodePlatform (thread_pool_size, tracing_controller);
493+ return MultiIsolatePlatform::Create (thread_pool_size, tracing_controller)
494+ .release ();
494495}
495496
496497void FreePlatform (MultiIsolatePlatform* platform) {
497498 delete platform;
498499}
499500
501+ std::unique_ptr<MultiIsolatePlatform> MultiIsolatePlatform::Create (
502+ int thread_pool_size,
503+ node::tracing::TracingController* tracing_controller) {
504+ return std::make_unique<NodePlatform>(thread_pool_size, tracing_controller);
505+ }
506+
500507MaybeLocal<Object> GetPerContextExports (Local<Context> context) {
501508 Isolate* isolate = context->GetIsolate ();
502509 EscapableHandleScope handle_scope (isolate);
Original file line number Diff line number Diff line change @@ -316,6 +316,10 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
316316 virtual void AddIsolateFinishedCallback (v8::Isolate* isolate,
317317 void (*callback)(void *),
318318 void* data) = 0;
319+
320+ static std::unique_ptr<MultiIsolatePlatform> Create (
321+ int thread_pool_size,
322+ node::tracing::TracingController* tracing_controller = nullptr );
319323};
320324
321325enum IsolateSettingsFlags {
@@ -467,6 +471,7 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
467471// it returns nullptr.
468472NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform ();
469473
474+ // Legacy variants of MultiIsolatePlatform::Create().
470475NODE_EXTERN MultiIsolatePlatform* CreatePlatform (
471476 int thread_pool_size,
472477 node::tracing::TracingController* tracing_controller);
You can’t perform that action at this time.
0 commit comments