chore: use std::make_unique/base::MakeRefCounted when possible (#29510)

This commit is contained in:
David Sanders 2021-06-07 19:00:05 -07:00 committed by GitHub
parent a4decffe9a
commit 79cb5144ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 106 additions and 101 deletions

View file

@ -252,7 +252,7 @@ int main(int argc, char* argv[]) {
abort();
}
std::unique_ptr<char[]> exec_path(new char[exec_path_size]);
auto exec_path = std::make_unique<char[]>(exec_path_size);
rv = _NSGetExecutablePath(exec_path.get(), &exec_path_size);
if (rv != 0) {
fprintf(stderr, "_NSGetExecutablePath: get path failed\n");

View file

@ -158,7 +158,7 @@ int NodeMain(int argc, char* argv[]) {
// Feed gin::PerIsolateData with a task runner.
argv = uv_setup_args(argc, argv);
uv_loop_t* loop = uv_default_loop();
scoped_refptr<UvTaskRunner> uv_task_runner(new UvTaskRunner(loop));
auto uv_task_runner = base::MakeRefCounted<UvTaskRunner>(loop);
base::ThreadTaskRunnerHandle handle(uv_task_runner);
// Initialize feature list.