mirror of
https://github.com/electron/electron.git
synced 2026-01-09 23:48:01 -05:00
refactor: NodeBindings::Create() returns a unique_ptr (#43361)
* refactor: NodeBindings::Create() returns a unique_ptr * empty commit
This commit is contained in:
@@ -84,7 +84,7 @@ class NodeBindings {
|
|||||||
public:
|
public:
|
||||||
enum class BrowserEnvironment { kBrowser, kRenderer, kUtility, kWorker };
|
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 void RegisterBuiltinBindings();
|
||||||
static bool IsInitialized();
|
static bool IsInitialized();
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ void NodeBindingsLinux::PollEvents() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) {
|
std::unique_ptr<NodeBindings> NodeBindings::Create(BrowserEnvironment env) {
|
||||||
return new NodeBindingsLinux(browser_env);
|
return std::make_unique<NodeBindingsLinux>(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace electron
|
} // namespace electron
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ void NodeBindingsMac::PollEvents() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) {
|
std::unique_ptr<NodeBindings> NodeBindings::Create(BrowserEnvironment env) {
|
||||||
return new NodeBindingsMac(browser_env);
|
return std::make_unique<NodeBindingsMac>(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace electron
|
} // namespace electron
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ void NodeBindingsWin::PollEvents() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
NodeBindings* NodeBindings::Create(BrowserEnvironment browser_env) {
|
std::unique_ptr<NodeBindings> NodeBindings::Create(BrowserEnvironment env) {
|
||||||
return new NodeBindingsWin(browser_env);
|
return std::make_unique<NodeBindingsWin>(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace electron
|
} // namespace electron
|
||||||
|
|||||||
Reference in New Issue
Block a user