refactor: NodeBindings::Create() returns a unique_ptr (#43392)
refactor: NodeBindings::Create() returns a unique_ptr (#43361) * refactor: NodeBindings::Create() returns a unique_ptr * empty commit Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
a577d569ec
commit
61b6dbbfee
4 changed files with 7 additions and 7 deletions
|
@ -80,7 +80,7 @@ class NodeBindings {
|
|||
public:
|
||||
enum class BrowserEnvironment { kBrowser, kRenderer, kUtility, kWorker };
|
||||
|
||||
static NodeBindings* Create(BrowserEnvironment browser_env);
|
||||
static std::unique_ptr<NodeBindings> Create(BrowserEnvironment browser_env);
|
||||
static void RegisterBuiltinBindings();
|
||||
static bool IsInitialized();
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ void NodeBindingsLinux::PollEvents() {
|
|||
}
|
||||
|
||||
// static
|
||||
NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) {
|
||||
return new NodeBindingsLinux(browser_env);
|
||||
std::unique_ptr<NodeBindings> NodeBindings::Create(BrowserEnvironment env) {
|
||||
return std::make_unique<NodeBindingsLinux>(env);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -41,8 +41,8 @@ void NodeBindingsMac::PollEvents() {
|
|||
}
|
||||
|
||||
// static
|
||||
NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) {
|
||||
return new NodeBindingsMac(browser_env);
|
||||
std::unique_ptr<NodeBindings> NodeBindings::Create(BrowserEnvironment env) {
|
||||
return std::make_unique<NodeBindingsMac>(env);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -50,8 +50,8 @@ void NodeBindingsWin::PollEvents() {
|
|||
}
|
||||
|
||||
// static
|
||||
NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) {
|
||||
return new NodeBindingsWin(browser_env);
|
||||
std::unique_ptr<NodeBindings> NodeBindings::Create(BrowserEnvironment env) {
|
||||
return std::make_unique<NodeBindingsWin>(env);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
Loading…
Reference in a new issue