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 @@ -477,13 +477,20 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
477477MultiIsolatePlatform* CreatePlatform (
478478 int thread_pool_size,
479479 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 ();
481482}
482483
483484void FreePlatform (MultiIsolatePlatform* platform) {
484485 delete platform;
485486}
486487
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+
487494MaybeLocal<Object> GetPerContextExports (Local<Context> context) {
488495 Isolate* isolate = context->GetIsolate ();
489496 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 {
298298 virtual void AddIsolateFinishedCallback (v8::Isolate* isolate,
299299 void (*callback)(void *),
300300 void* data) = 0;
301+
302+ static std::unique_ptr<MultiIsolatePlatform> Create (
303+ int thread_pool_size,
304+ node::tracing::TracingController* tracing_controller = nullptr );
301305};
302306
303307enum IsolateSettingsFlags {
@@ -446,6 +450,7 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
446450// it returns nullptr.
447451NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform ();
448452
453+ // Legacy variants of MultiIsolatePlatform::Create().
449454NODE_EXTERN MultiIsolatePlatform* CreatePlatform (
450455 int thread_pool_size,
451456 node::tracing::TracingController* tracing_controller);
You can’t perform that action at this time.
0 commit comments