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() {
490
490
MultiIsolatePlatform* CreatePlatform (
491
491
int thread_pool_size,
492
492
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 ();
494
495
}
495
496
496
497
void FreePlatform (MultiIsolatePlatform* platform) {
497
498
delete platform;
498
499
}
499
500
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
+
500
507
MaybeLocal<Object> GetPerContextExports (Local<Context> context) {
501
508
Isolate* isolate = context->GetIsolate ();
502
509
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 {
316
316
virtual void AddIsolateFinishedCallback (v8::Isolate* isolate,
317
317
void (*callback)(void *),
318
318
void* data) = 0;
319
+
320
+ static std::unique_ptr<MultiIsolatePlatform> Create (
321
+ int thread_pool_size,
322
+ node::tracing::TracingController* tracing_controller = nullptr );
319
323
};
320
324
321
325
enum IsolateSettingsFlags {
@@ -467,6 +471,7 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
467
471
// it returns nullptr.
468
472
NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform ();
469
473
474
+ // Legacy variants of MultiIsolatePlatform::Create().
470
475
NODE_EXTERN MultiIsolatePlatform* CreatePlatform (
471
476
int thread_pool_size,
472
477
node::tracing::TracingController* tracing_controller);
You can’t perform that action at this time.
0 commit comments