File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -477,13 +477,20 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
477
477
MultiIsolatePlatform* CreatePlatform (
478
478
int thread_pool_size,
479
479
node::tracing::TracingController* tracing_controller) {
480
- return new NodePlatform (thread_pool_size, tracing_controller);
480
+ return MultiIsolatePlatform::Create (thread_pool_size, tracing_controller)
481
+ .release ();
481
482
}
482
483
483
484
void FreePlatform (MultiIsolatePlatform* platform) {
484
485
delete platform;
485
486
}
486
487
488
+ std::unique_ptr<MultiIsolatePlatform> MultiIsolatePlatform::Create (
489
+ int thread_pool_size,
490
+ node::tracing::TracingController* tracing_controller) {
491
+ return std::make_unique<NodePlatform>(thread_pool_size, tracing_controller);
492
+ }
493
+
487
494
MaybeLocal<Object> GetPerContextExports (Local<Context> context) {
488
495
Isolate* isolate = context->GetIsolate ();
489
496
EscapableHandleScope handle_scope (isolate);
Original file line number Diff line number Diff line change @@ -298,6 +298,10 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
298
298
virtual void AddIsolateFinishedCallback (v8::Isolate* isolate,
299
299
void (*callback)(void *),
300
300
void* data) = 0;
301
+
302
+ static std::unique_ptr<MultiIsolatePlatform> Create (
303
+ int thread_pool_size,
304
+ node::tracing::TracingController* tracing_controller = nullptr );
301
305
};
302
306
303
307
enum IsolateSettingsFlags {
@@ -446,6 +450,7 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
446
450
// it returns nullptr.
447
451
NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform ();
448
452
453
+ // Legacy variants of MultiIsolatePlatform::Create().
449
454
NODE_EXTERN MultiIsolatePlatform* CreatePlatform (
450
455
int thread_pool_size,
451
456
node::tracing::TracingController* tracing_controller);
You can’t perform that action at this time.
0 commit comments