diff --git a/shell/common/node_bindings.h b/shell/common/node_bindings.h index 93363117df42..d7e3a1de51fe 100644 --- a/shell/common/node_bindings.h +++ b/shell/common/node_bindings.h @@ -80,7 +80,7 @@ class NodeBindings { public: enum class BrowserEnvironment { kBrowser, kRenderer, kUtility, kWorker }; - static NodeBindings* Create(BrowserEnvironment browser_env); + static std::unique_ptr Create(BrowserEnvironment browser_env); static void RegisterBuiltinBindings(); static bool IsInitialized(); diff --git a/shell/common/node_bindings_linux.cc b/shell/common/node_bindings_linux.cc index ad598105c9c8..7af0b151e695 100644 --- a/shell/common/node_bindings_linux.cc +++ b/shell/common/node_bindings_linux.cc @@ -33,8 +33,8 @@ void NodeBindingsLinux::PollEvents() { } // static -NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) { - return new NodeBindingsLinux(browser_env); +std::unique_ptr NodeBindings::Create(BrowserEnvironment env) { + return std::make_unique(env); } } // namespace electron diff --git a/shell/common/node_bindings_mac.cc b/shell/common/node_bindings_mac.cc index e50afcdf6a44..b6a92c54a0bb 100644 --- a/shell/common/node_bindings_mac.cc +++ b/shell/common/node_bindings_mac.cc @@ -41,8 +41,8 @@ void NodeBindingsMac::PollEvents() { } // static -NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) { - return new NodeBindingsMac(browser_env); +std::unique_ptr NodeBindings::Create(BrowserEnvironment env) { + return std::make_unique(env); } } // namespace electron diff --git a/shell/common/node_bindings_win.cc b/shell/common/node_bindings_win.cc index e6efce987dea..6c2aeffb27d0 100644 --- a/shell/common/node_bindings_win.cc +++ b/shell/common/node_bindings_win.cc @@ -50,8 +50,8 @@ void NodeBindingsWin::PollEvents() { } // static -NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) { - return new NodeBindingsWin(browser_env); +std::unique_ptr NodeBindings::Create(BrowserEnvironment env) { + return std::make_unique(env); } } // namespace electron