diff --git a/src/api/environment.cc b/src/api/environment.cc index cdc0c5afb7541d..408c22f8466fcb 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -583,26 +583,6 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) { return env->platform(); } -MultiIsolatePlatform* CreatePlatform( - int thread_pool_size, - node::tracing::TracingController* tracing_controller) { - return CreatePlatform( - thread_pool_size, - static_cast(tracing_controller)); -} - -MultiIsolatePlatform* CreatePlatform( - int thread_pool_size, - v8::TracingController* tracing_controller) { - return MultiIsolatePlatform::Create(thread_pool_size, - tracing_controller) - .release(); -} - -void FreePlatform(MultiIsolatePlatform* platform) { - delete platform; -} - std::unique_ptr MultiIsolatePlatform::Create( int thread_pool_size, v8::TracingController* tracing_controller, diff --git a/src/node.cc b/src/node.cc index f921303b639dbc..29a4e76994361f 100644 --- a/src/node.cc +++ b/src/node.cc @@ -823,7 +823,7 @@ static ExitCode InitializeNodeWithArgsInternal( std::vector* exec_argv, std::vector* errors, ProcessInitializationFlags::Flags flags) { - // Make sure InitializeNodeWithArgs() is called only once. + // Make sure InitializeNodeWithArgsInternal() is called only once. CHECK(!init_called.exchange(true)); // Initialize node_start_time to get relative uptime. @@ -1021,14 +1021,6 @@ static ExitCode InitializeNodeWithArgsInternal( return ExitCode::kNoFailure; } -int InitializeNodeWithArgs(std::vector* argv, - std::vector* exec_argv, - std::vector* errors, - ProcessInitializationFlags::Flags flags) { - return static_cast( - InitializeNodeWithArgsInternal(argv, exec_argv, errors, flags)); -} - static std::shared_ptr InitializeOncePerProcessInternal(const std::vector& args, ProcessInitializationFlags::Flags flags = diff --git a/src/node.h b/src/node.h index f773096c959b59..15ed6100913262 100644 --- a/src/node.h +++ b/src/node.h @@ -329,22 +329,6 @@ NODE_EXTERN int Start(int argc, char* argv[]); NODE_EXTERN int Stop(Environment* env, StopFlags::Flags flags = StopFlags::kNoFlags); -// Set up per-process state needed to run Node.js. This will consume arguments -// from argv, fill exec_argv, and possibly add errors resulting from parsing -// the arguments to `errors`. The return value is a suggested exit code for the -// program; If it is 0, then initializing Node.js succeeded. -// This runs a subset of the initialization performed by -// InitializeOncePerProcess(), which supersedes this function. -// The subset is roughly equivalent to the one given by -// `ProcessInitializationFlags::kLegacyInitializeNodeWithArgsBehavior`. -NODE_DEPRECATED("Use InitializeOncePerProcess() instead", - NODE_EXTERN int InitializeNodeWithArgs( - std::vector* argv, - std::vector* exec_argv, - std::vector* errors, - ProcessInitializationFlags::Flags flags = - ProcessInitializationFlags::kNoFlags)); - // Set up per-process state needed to run Node.js. This will consume arguments // from args, and return information about the initialization success, // including the arguments split into argv/exec_argv, a list of potential @@ -848,19 +832,12 @@ NODE_EXTERN void GetNodeReport(Environment* env, NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env); NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env); -NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead", - NODE_EXTERN MultiIsolatePlatform* CreatePlatform( - int thread_pool_size, - v8::TracingController* tracing_controller)); -NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead", - NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform)); - -// Get/set the currently active tracing controller. Using CreatePlatform() -// will implicitly set this by default. This is global and should be initialized -// along with the v8::Platform instance that is being used. `controller` -// is allowed to be `nullptr`. -// This is used for tracing events from Node.js itself. V8 uses the tracing -// controller returned from the active `v8::Platform` instance. +// Get/set the currently active tracing controller. Using +// MultiIsolatePlatform::Create() will implicitly set this by default. This is +// global and should be initialized along with the v8::Platform instance that is +// being used. `controller` is allowed to be `nullptr`. This is used for tracing +// events from Node.js itself. V8 uses the tracing controller returned from the +// active `v8::Platform` instance. NODE_EXTERN v8::TracingController* GetTracingController(); NODE_EXTERN void SetTracingController(v8::TracingController* controller); diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h index ad9047b928ed5b..d3ec9d25a3ddf7 100644 --- a/test/cctest/node_test_fixture.h +++ b/test/cctest/node_test_fixture.h @@ -81,13 +81,15 @@ class NodeZeroIsolateTestFixture : public ::testing::Test { if (!node_initialized) { node_initialized = true; uv_os_unsetenv("NODE_OPTIONS"); - std::vector argv { "cctest" }; - std::vector exec_argv; - std::vector errors; - - int exitcode = node::InitializeNodeWithArgs(&argv, &exec_argv, &errors); - CHECK_EQ(exitcode, 0); - CHECK(errors.empty()); + std::vector argv{"cctest"}; + + std::shared_ptr result = + node::InitializeOncePerProcess( + argv, + node::ProcessInitializationFlags:: + kLegacyInitializeNodeWithArgsBehavior); + CHECK_EQ(result->exit_code(), 0); + CHECK(result->errors().empty()); } CHECK_EQ(0, uv_loop_init(¤t_loop)); }