Use std::make_unique in GN code.

- Replaces "base::MakeUnique" with "std::make_unique"
- Replaces "std::unique_ptr<...>(new ...)" with "std::make_unique"
- Replaces "unique_ptr.reset(new ...)" with "= std::make_unique"
- Adds "#include <memory>" in all files using this.

Fixes xcode generator unit tests under asan. It turns out the test was
checking for pointer equality (depending on duplicate string folding)
rather than doing string equality. This usually worked but doesn't
under our asan build.

Change-Id: Ibdffb2ee0d14f7ffbe938df4bb27f741ce004c0f
Reviewed-on: https://chromium-review.googlesource.com/775777
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Brett Wilson <brettw@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#517993}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3667991ece7e160bb9133e151c53c68f8466d2c9
diff --git a/tools/gn/analyzer.cc b/tools/gn/analyzer.cc
index cc403c2..b69b4d8 100644
--- a/tools/gn/analyzer.cc
+++ b/tools/gn/analyzer.cc
@@ -6,12 +6,12 @@
 
 #include <algorithm>
 #include <iterator>
+#include <memory>
 #include <set>
 #include <vector>
 
 #include "base/json/json_reader.h"
 #include "base/json/json_writer.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_util.h"
 #include "base/values.h"
 #include "tools/gn/builder.h"
@@ -111,7 +111,7 @@
                  const std::string& key,
                  const LabelSet& labels) {
   std::vector<std::string> strings;
-  auto value = base::MakeUnique<base::ListValue>();
+  auto value = std::make_unique<base::ListValue>();
   for (const auto l : labels)
     strings.push_back(l.GetUserVisibleName(default_toolchain));
   std::sort(strings.begin(), strings.end());
@@ -197,7 +197,7 @@
 std::string OutputsToJSON(const Outputs& outputs,
                           const Label& default_toolchain, Err *err) {
   std::string output;
-  auto value = base::MakeUnique<base::DictionaryValue>();
+  auto value = std::make_unique<base::DictionaryValue>();
 
   if (outputs.error.size()) {
     WriteString(*value, "error", outputs.error);
@@ -206,7 +206,7 @@
   } else {
     WriteString(*value, "status", outputs.status);
     if (outputs.compile_includes_all) {
-      auto compile_targets = base::MakeUnique<base::ListValue>();
+      auto compile_targets = std::make_unique<base::ListValue>();
       compile_targets->AppendString("all");
       value->SetWithoutPathExpansion("compile_targets",
                                      std::move(compile_targets));
diff --git a/tools/gn/command_desc.cc b/tools/gn/command_desc.cc
index 8dbe6de..6203d01 100644
--- a/tools/gn/command_desc.cc
+++ b/tools/gn/command_desc.cc
@@ -5,12 +5,12 @@
 #include <stddef.h>
 
 #include <algorithm>
+#include <memory>
 #include <set>
 #include <sstream>
 
 #include "base/command_line.h"
 #include "base/json/json_writer.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_util.h"
 #include "tools/gn/commands.h"
 #include "tools/gn/config.h"
@@ -457,7 +457,7 @@
 
   if (json) {
     // Convert all targets/configs to JSON, serialize and print them
-    auto res = base::MakeUnique<base::DictionaryValue>();
+    auto res = std::make_unique<base::DictionaryValue>();
     if (!target_matches.empty()) {
       for (const auto* target : target_matches) {
         res->SetWithoutPathExpansion(
diff --git a/tools/gn/desc_builder.cc b/tools/gn/desc_builder.cc
index 38b78e8..ba5291e 100644
--- a/tools/gn/desc_builder.cc
+++ b/tools/gn/desc_builder.cc
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <memory>
 #include <set>
 
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "tools/gn/commands.h"
 #include "tools/gn/config.h"
@@ -114,7 +114,7 @@
 
   template <typename T>
   ValuePtr RenderValue(const std::vector<T>& vector) {
-    auto res = base::MakeUnique<base::ListValue>();
+    auto res = std::make_unique<base::ListValue>();
     for (const auto& v : vector)
       res->Append(RenderValue(v));
 
@@ -122,17 +122,17 @@
   }
 
   ValuePtr RenderValue(const std::string& s, bool optional = false) {
-    return (s.empty() && optional) ? base::MakeUnique<base::Value>()
+    return (s.empty() && optional) ? std::make_unique<base::Value>()
                                    : ValuePtr(new base::Value(s));
   }
 
   ValuePtr RenderValue(const SourceDir& d) {
-    return d.is_null() ? base::MakeUnique<base::Value>()
+    return d.is_null() ? std::make_unique<base::Value>()
                        : ValuePtr(new base::Value(FormatSourceDir(d)));
   }
 
   ValuePtr RenderValue(const SourceFile& f) {
-    return f.is_null() ? base::MakeUnique<base::Value>()
+    return f.is_null() ? std::make_unique<base::Value>()
                        : ValuePtr(new base::Value(f.value()));
   }
 
@@ -182,7 +182,7 @@
       : BaseDescBuilder(what, false, false, false), config_(config) {}
 
   std::unique_ptr<base::DictionaryValue> BuildDescription() {
-    auto res = base::MakeUnique<base::DictionaryValue>();
+    auto res = std::make_unique<base::DictionaryValue>();
     const ConfigValues& values = config_->resolved_values();
 
     if (what_.empty())
@@ -192,7 +192,7 @@
               config_->label().GetToolchainLabel().GetUserVisibleName(false)));
 
     if (what(variables::kConfigs) && !config_->configs().empty()) {
-      auto configs = base::MakeUnique<base::ListValue>();
+      auto configs = std::make_unique<base::ListValue>();
       FillInConfigVector(configs.get(), config_->configs().vector());
       res->SetWithoutPathExpansion(variables::kConfigs, std::move(configs));
     }
@@ -235,7 +235,7 @@
   ValuePtr render_config_value_array(
       const ConfigValues& values,
       const std::vector<T>& (ConfigValues::*getter)() const) {
-    auto res = base::MakeUnique<base::ListValue>();
+    auto res = std::make_unique<base::ListValue>();
 
     for (const T& cur : (values.*getter)())
       res->Append(RenderValue(cur));
@@ -256,7 +256,7 @@
       : BaseDescBuilder(what, all, tree, blame), target_(target) {}
 
   std::unique_ptr<base::DictionaryValue> BuildDescription() {
-    auto res = base::MakeUnique<base::DictionaryValue>();
+    auto res = std::make_unique<base::DictionaryValue>();
     bool is_binary_output = target_->IsBinary();
 
     if (what_.empty()) {
@@ -283,7 +283,7 @@
                     base::Value(target_->check_includes()));
 
       if (what(variables::kAllowCircularIncludesFrom)) {
-        auto labels = base::MakeUnique<base::ListValue>();
+        auto labels = std::make_unique<base::ListValue>();
         for (const auto& cur : target_->allow_circular_includes_from())
           labels->AppendString(cur.GetUserVisibleName(GetToolchainLabel()));
 
@@ -321,13 +321,13 @@
 
     if (is_binary_output && what(variables::kConfigs) &&
         !target_->configs().empty()) {
-      auto configs = base::MakeUnique<base::ListValue>();
+      auto configs = std::make_unique<base::ListValue>();
       FillInConfigVector(configs.get(), target_->configs().vector());
       res->SetWithoutPathExpansion(variables::kConfigs, std::move(configs));
     }
 
     if (what(variables::kPublicConfigs) && !target_->public_configs().empty()) {
-      auto configs = base::MakeUnique<base::ListValue>();
+      auto configs = std::make_unique<base::ListValue>();
       FillInConfigVector(configs.get(), target_->public_configs());
       res->SetWithoutPathExpansion(variables::kPublicConfigs,
                                    std::move(configs));
@@ -335,7 +335,7 @@
 
     if (what(variables::kAllDependentConfigs) &&
         !target_->all_dependent_configs().empty()) {
-      auto configs = base::MakeUnique<base::ListValue>();
+      auto configs = std::make_unique<base::ListValue>();
       FillInConfigVector(configs.get(), target_->all_dependent_configs());
       res->SetWithoutPathExpansion(variables::kAllDependentConfigs,
                                    std::move(configs));
@@ -349,7 +349,7 @@
                     base::Value(target_->action_values().script().value()));
 
       if (what(variables::kArgs)) {
-        auto args = base::MakeUnique<base::ListValue>();
+        auto args = std::make_unique<base::ListValue>();
         for (const auto& elem : target_->action_values().args().list())
           args->AppendString(elem.AsString());
 
@@ -419,7 +419,7 @@
     if (what(variables::kLibs)) {
       const OrderedSet<LibFile>& all_libs = target_->all_libs();
       if (!all_libs.empty()) {
-        auto libs = base::MakeUnique<base::ListValue>();
+        auto libs = std::make_unique<base::ListValue>();
         for (size_t i = 0; i < all_libs.size(); i++)
           libs->AppendString(all_libs[i].value());
         res->SetWithoutPathExpansion(variables::kLibs, std::move(libs));
@@ -429,7 +429,7 @@
     if (what(variables::kLibDirs)) {
       const OrderedSet<SourceDir>& all_lib_dirs = target_->all_lib_dirs();
       if (!all_lib_dirs.empty()) {
-        auto lib_dirs = base::MakeUnique<base::ListValue>();
+        auto lib_dirs = std::make_unique<base::ListValue>();
         for (size_t i = 0; i < all_lib_dirs.size(); i++)
           lib_dirs->AppendString(FormatSourceDir(all_lib_dirs[i]));
         res->SetWithoutPathExpansion(variables::kLibDirs, std::move(lib_dirs));
@@ -486,7 +486,7 @@
   }
 
   ValuePtr RenderDeps() {
-    auto res = base::MakeUnique<base::ListValue>();
+    auto res = std::make_unique<base::ListValue>();
 
     // Tree mode is separate.
     if (tree_) {
@@ -520,7 +520,7 @@
   }
 
   ValuePtr RenderRuntimeDeps() {
-    auto res = base::MakeUnique<base::ListValue>();
+    auto res = std::make_unique<base::ListValue>();
 
     const Target* previous_from = NULL;
     for (const auto& pair : ComputeRuntimeDeps(target_)) {
@@ -546,12 +546,12 @@
   }
 
   void FillInSourceOutputs(base::DictionaryValue* res) {
-    auto dict = base::MakeUnique<base::DictionaryValue>();
+    auto dict = std::make_unique<base::DictionaryValue>();
     for (const auto& source : target_->sources()) {
       std::vector<OutputFile> outputs;
       Toolchain::ToolType tool_type = Toolchain::TYPE_NONE;
       if (target_->GetOutputFilesForSource(source, &tool_type, &outputs)) {
-        auto list = base::MakeUnique<base::ListValue>();
+        auto list = std::make_unique<base::ListValue>();
         for (const auto& output : outputs)
           list->AppendString(output.value());
 
@@ -562,7 +562,7 @@
   }
 
   void FillInBundle(base::DictionaryValue* res) {
-    auto data = base::MakeUnique<base::DictionaryValue>();
+    auto data = std::make_unique<base::DictionaryValue>();
     const BundleData& bundle_data = target_->bundle_data();
     const Settings* settings = target_->settings();
     BundleData::SourceFiles sources;
@@ -583,7 +583,7 @@
     data->SetWithoutPathExpansion(
         "partial_info_plist", RenderValue(bundle_data.partial_info_plist()));
 
-    auto deps = base::MakeUnique<base::ListValue>();
+    auto deps = std::make_unique<base::ListValue>();
     for (const auto* dep : bundle_data.bundle_deps())
       deps->AppendString(dep->label().GetUserVisibleName(GetToolchainLabel()));
 
@@ -593,7 +593,7 @@
 
   void FillInOutputs(base::DictionaryValue* res) {
     if (target_->output_type() == Target::ACTION) {
-      auto list = base::MakeUnique<base::ListValue>();
+      auto list = std::make_unique<base::ListValue>();
       for (const auto& elem : target_->action_values().outputs().list())
         list->AppendString(elem.AsString());
 
@@ -608,7 +608,7 @@
                target_->output_type() == Target::COPY_FILES) {
       const SubstitutionList& outputs = target_->action_values().outputs();
       if (!outputs.required_types().empty()) {
-        auto patterns = base::MakeUnique<base::ListValue>();
+        auto patterns = std::make_unique<base::ListValue>();
         for (const auto& elem : outputs.list())
           patterns->AppendString(elem.AsString());
 
@@ -644,7 +644,7 @@
   template <class T>
   ValuePtr RenderConfigValues(const std::vector<T>& (ConfigValues::*getter)()
                                   const) {
-    auto res = base::MakeUnique<base::ListValue>();
+    auto res = std::make_unique<base::ListValue>();
     for (ConfigValuesIterator iter(target_); !iter.done(); iter.Next()) {
       const std::vector<T>& vec = (iter.cur().*getter)();
 
@@ -678,7 +678,7 @@
         // Indent string values in blame mode
         if (blame_ && rendered->GetAsString(&str)) {
           str = "  " + str;
-          rendered = base::MakeUnique<base::Value>(str);
+          rendered = std::make_unique<base::Value>(str);
         }
         res->Append(std::move(rendered));
       }
diff --git a/tools/gn/function_get_target_outputs_unittest.cc b/tools/gn/function_get_target_outputs_unittest.cc
index abe07d4..d7354eb 100644
--- a/tools/gn/function_get_target_outputs_unittest.cc
+++ b/tools/gn/function_get_target_outputs_unittest.cc
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <memory>
 #include <utility>
 
-#include "base/memory/ptr_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/functions.h"
 #include "tools/gn/target.h"
@@ -61,7 +61,7 @@
 
 TEST_F(GetTargetOutputsTest, Copy) {
   auto action =
-      base::MakeUnique<Target>(setup_.settings(), GetLabel("//foo/", "bar"));
+      std::make_unique<Target>(setup_.settings(), GetLabel("//foo/", "bar"));
   action->set_output_type(Target::COPY_FILES);
   action->sources().push_back(SourceFile("//file.txt"));
   action->action_values().outputs() =
@@ -77,7 +77,7 @@
 
 TEST_F(GetTargetOutputsTest, Action) {
   auto action =
-      base::MakeUnique<Target>(setup_.settings(), GetLabel("//foo/", "bar"));
+      std::make_unique<Target>(setup_.settings(), GetLabel("//foo/", "bar"));
   action->set_output_type(Target::ACTION);
   action->action_values().outputs() = SubstitutionList::MakeForTest(
       "//output1.txt",
@@ -93,7 +93,7 @@
 
 TEST_F(GetTargetOutputsTest, ActionForeach) {
   auto action =
-      base::MakeUnique<Target>(setup_.settings(), GetLabel("//foo/", "bar"));
+      std::make_unique<Target>(setup_.settings(), GetLabel("//foo/", "bar"));
   action->set_output_type(Target::ACTION_FOREACH);
   action->sources().push_back(SourceFile("//file.txt"));
   action->action_values().outputs() = SubstitutionList::MakeForTest(
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc
index 2d80273..aeeb4e1 100644
--- a/tools/gn/function_toolchain.cc
+++ b/tools/gn/function_toolchain.cc
@@ -4,6 +4,7 @@
 
 #include <algorithm>
 #include <limits>
+#include <memory>
 #include <utility>
 
 #include "tools/gn/err.h"
@@ -453,7 +454,8 @@
 
   // This object will actually be copied into the one owned by the toolchain
   // manager, but that has to be done in the lock.
-  std::unique_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label));
+  std::unique_ptr<Toolchain> toolchain =
+      std::make_unique<Toolchain>(scope->settings(), label);
   toolchain->set_defined_from(function);
   toolchain->visibility().SetPublic();
 
@@ -1022,7 +1024,7 @@
     subst_output_validator = &IsValidToolSubstitution;
   }
 
-  std::unique_ptr<Tool> tool(new Tool);
+  std::unique_ptr<Tool> tool = std::make_unique<Tool>();
   tool->set_defined_from(function);
 
   if (!ReadPattern(&block_scope, "command", subst_validator, tool.get(),
diff --git a/tools/gn/functions.cc b/tools/gn/functions.cc
index 4e469ac..60a6eb7 100644
--- a/tools/gn/functions.cc
+++ b/tools/gn/functions.cc
@@ -6,6 +6,7 @@
 
 #include <stddef.h>
 #include <iostream>
+#include <memory>
 #include <utility>
 
 #include "base/environment.h"
@@ -337,7 +338,8 @@
     g_scheduler->Log("Defining config", label.GetUserVisibleName(true));
 
   // Create the new config.
-  std::unique_ptr<Config> config(new Config(scope->settings(), label));
+  std::unique_ptr<Config> config =
+      std::make_unique<Config>(scope->settings(), label);
   config->set_defined_from(function);
   if (!Visibility::FillItemVisibility(config.get(), scope, err))
     return Value();
@@ -825,7 +827,7 @@
   if (args.size() != 1) {
     *err = Err(function, "set_sources_assignment_filter takes one argument.");
   } else {
-    std::unique_ptr<PatternList> f(new PatternList);
+    std::unique_ptr<PatternList> f = std::make_unique<PatternList>();
     f->SetFromValue(args[0], err);
     if (!err->has_error())
       scope->set_sources_assignment_filter(std::move(f));
@@ -908,7 +910,7 @@
   }
 
   // Create the new pool.
-  std::unique_ptr<Pool> pool(new Pool(scope->settings(), label));
+  std::unique_ptr<Pool> pool = std::make_unique<Pool>(scope->settings(), label);
   pool->set_depth(depth->int_value());
 
   // Save the generated item.
diff --git a/tools/gn/functions_unittest.cc b/tools/gn/functions_unittest.cc
index 949b844..1ed509a 100644
--- a/tools/gn/functions_unittest.cc
+++ b/tools/gn/functions_unittest.cc
@@ -4,9 +4,9 @@
 
 #include "tools/gn/functions.h"
 
+#include <memory>
 #include <utility>
 
-#include "base/memory/ptr_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/parse_tree.h"
 #include "tools/gn/test_with_scope.h"
@@ -22,7 +22,7 @@
   Token undefined_token(Location(), Token::IDENTIFIER, "undef");
   ListNode args_list_identifier_undefined;
   args_list_identifier_undefined.append_item(
-      std::unique_ptr<ParseNode>(new IdentifierNode(undefined_token)));
+      std::make_unique<IdentifierNode>(undefined_token));
   Value result = functions::RunDefined(setup.scope(), &function_call,
                                        &args_list_identifier_undefined, &err);
   ASSERT_EQ(Value::BOOLEAN, result.type());
@@ -31,14 +31,13 @@
   // Define a value that's itself a scope value.
   const char kDef[] = "def";  // Defined variable name.
   setup.scope()->SetValue(
-      kDef, Value(nullptr, std::unique_ptr<Scope>(new Scope(setup.scope()))),
-      nullptr);
+      kDef, Value(nullptr, std::make_unique<Scope>(setup.scope())), nullptr);
 
   // Test the defined identifier.
   Token defined_token(Location(), Token::IDENTIFIER, kDef);
   ListNode args_list_identifier_defined;
   args_list_identifier_defined.append_item(
-      std::unique_ptr<ParseNode>(new IdentifierNode(defined_token)));
+      std::make_unique<IdentifierNode>(defined_token));
   result = functions::RunDefined(setup.scope(), &function_call,
                                  &args_list_identifier_defined, &err);
   ASSERT_EQ(Value::BOOLEAN, result.type());
@@ -46,9 +45,10 @@
 
   // Should also work by passing an accessor node so you can do
   // "defined(def.foo)" to see if foo is defined on the def scope.
-  std::unique_ptr<AccessorNode> undef_accessor(new AccessorNode);
+  std::unique_ptr<AccessorNode> undef_accessor =
+      std::make_unique<AccessorNode>();
   undef_accessor->set_base(defined_token);
-  undef_accessor->set_member(base::MakeUnique<IdentifierNode>(undefined_token));
+  undef_accessor->set_member(std::make_unique<IdentifierNode>(undefined_token));
   ListNode args_list_accessor_defined;
   args_list_accessor_defined.append_item(std::move(undef_accessor));
   result = functions::RunDefined(setup.scope(), &function_call,
diff --git a/tools/gn/import_manager.cc b/tools/gn/import_manager.cc
index c9a44d4..b94ea70 100644
--- a/tools/gn/import_manager.cc
+++ b/tools/gn/import_manager.cc
@@ -4,6 +4,8 @@
 
 #include "tools/gn/import_manager.h"
 
+#include <memory>
+
 #include "tools/gn/err.h"
 #include "tools/gn/parse_tree.h"
 #include "tools/gn/scheduler.h"
@@ -24,7 +26,8 @@
   if (!node)
     return nullptr;
 
-  std::unique_ptr<Scope> scope(new Scope(settings->base_config()));
+  std::unique_ptr<Scope> scope =
+      std::make_unique<Scope>(settings->base_config());
   scope->set_source_dir(file.GetDir());
 
   // Don't allow ScopePerFileProvider to provide target-related variables.
@@ -80,7 +83,7 @@
     base::AutoLock lock(imports_lock_);
     std::unique_ptr<ImportInfo>& info_ptr = imports_[file];
     if (!info_ptr)
-      info_ptr.reset(new ImportInfo);
+      info_ptr = std::make_unique<ImportInfo>();
 
     // Promote the ImportInfo to outside of the imports lock.
     import_info = info_ptr.get();
diff --git a/tools/gn/input_conversion.cc b/tools/gn/input_conversion.cc
index 2e905c6..7cce107 100644
--- a/tools/gn/input_conversion.cc
+++ b/tools/gn/input_conversion.cc
@@ -4,6 +4,7 @@
 
 #include "tools/gn/input_conversion.h"
 
+#include <memory>
 #include <utility>
 
 #include "base/macros.h"
@@ -74,7 +75,7 @@
   if (!parse_root)
     return Value();
 
-  std::unique_ptr<Scope> scope(new Scope(settings));
+  std::unique_ptr<Scope> scope = std::make_unique<Scope>(settings);
   Value result = parse_root->Execute(scope.get(), err);
   if (err->has_error())
     return Value();
diff --git a/tools/gn/input_file_manager.cc b/tools/gn/input_file_manager.cc
index 9fd3def..9f92130 100644
--- a/tools/gn/input_file_manager.cc
+++ b/tools/gn/input_file_manager.cc
@@ -4,6 +4,7 @@
 
 #include "tools/gn/input_file_manager.h"
 
+#include <memory>
 #include <utility>
 
 #include "base/bind.h"
@@ -111,7 +112,8 @@
     InputFileMap::const_iterator found = input_files_.find(file_name);
     if (found == input_files_.end()) {
       // New file, schedule load.
-      std::unique_ptr<InputFileData> data(new InputFileData(file_name));
+      std::unique_ptr<InputFileData> data =
+          std::make_unique<InputFileData>(file_name);
       data->scheduled_callbacks.push_back(callback);
       schedule_this = base::Bind(&InputFileManager::BackgroundLoadFile,
                                  this,
@@ -162,7 +164,8 @@
   InputFileMap::iterator found = input_files_.find(file_name);
   if (found == input_files_.end()) {
     // Haven't seen this file yet, start loading right now.
-    std::unique_ptr<InputFileData> new_data(new InputFileData(file_name));
+    std::unique_ptr<InputFileData> new_data =
+        std::make_unique<InputFileData>(file_name);
     data = new_data.get();
     data->sync_invocation = true;
     input_files_[file_name] = std::move(new_data);
@@ -202,9 +205,9 @@
     if (!data->loaded) {
       // Wait for the already-pending sync load to complete.
       if (!data->completion_event) {
-        data->completion_event.reset(new base::WaitableEvent(
+        data->completion_event = std::make_unique<base::WaitableEvent>(
             base::WaitableEvent::ResetPolicy::AUTOMATIC,
-            base::WaitableEvent::InitialState::NOT_SIGNALED));
+            base::WaitableEvent::InitialState::NOT_SIGNALED);
       }
       {
         base::AutoUnlock unlock(lock_);
@@ -230,7 +233,7 @@
     InputFile** file,
     std::vector<Token>** tokens,
     std::unique_ptr<ParseNode>** parse_root) {
-  std::unique_ptr<InputFileData> data(new InputFileData(name));
+  std::unique_ptr<InputFileData> data = std::make_unique<InputFileData>(name);
   *file = &data->file;
   *tokens = &data->tokens;
   *parse_root = &data->parsed_root;
diff --git a/tools/gn/json_project_writer.cc b/tools/gn/json_project_writer.cc
index dfb3cdb..4f4b0e7 100644
--- a/tools/gn/json_project_writer.cc
+++ b/tools/gn/json_project_writer.cc
@@ -5,10 +5,10 @@
 #include "tools/gn/json_project_writer.h"
 
 #include <iostream>
+#include <memory>
 
 #include "base/command_line.h"
 #include "base/json/json_writer.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "tools/gn/builder.h"
 #include "tools/gn/commands.h"
@@ -86,7 +86,7 @@
                        std::vector<const Target*>& all_targets) {
   Label default_toolchain_label;
 
-  auto targets = base::MakeUnique<base::DictionaryValue>();
+  auto targets = std::make_unique<base::DictionaryValue>();
   for (const auto* target : all_targets) {
     if (default_toolchain_label.is_null())
       default_toolchain_label = target->settings()->default_toolchain_label();
@@ -105,7 +105,7 @@
         std::move(description));
   }
 
-  auto settings = base::MakeUnique<base::DictionaryValue>();
+  auto settings = std::make_unique<base::DictionaryValue>();
   settings->SetKey("root_path", base::Value(build_settings->root_path_utf8()));
   settings->SetKey("build_dir",
                    base::Value(build_settings->build_dir().value()));
@@ -113,7 +113,7 @@
       "default_toolchain",
       base::Value(default_toolchain_label.GetUserVisibleName(false)));
 
-  auto output = base::MakeUnique<base::DictionaryValue>();
+  auto output = std::make_unique<base::DictionaryValue>();
   output->SetWithoutPathExpansion("targets", std::move(targets));
   output->SetWithoutPathExpansion("build_settings", std::move(settings));
 
diff --git a/tools/gn/loader.cc b/tools/gn/loader.cc
index ba214c2..57680e0 100644
--- a/tools/gn/loader.cc
+++ b/tools/gn/loader.cc
@@ -4,8 +4,9 @@
 
 #include "tools/gn/loader.h"
 
+#include <memory>
+
 #include "base/bind.h"
-#include "base/memory/ptr_util.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "tools/gn/build_settings.h"
 #include "tools/gn/err.h"
@@ -123,8 +124,8 @@
     // should not specify a toolchain.
     DCHECK(toolchain_name.is_null());
 
-    std::unique_ptr<ToolchainRecord> new_record(
-        new ToolchainRecord(build_settings_, Label(), Label()));
+    std::unique_ptr<ToolchainRecord> new_record =
+        std::make_unique<ToolchainRecord>(build_settings_, Label(), Label());
     ToolchainRecord* record = new_record.get();
     toolchain_records_[Label()] = std::move(new_record);
 
@@ -149,8 +150,9 @@
     DCHECK(!default_toolchain_label_.is_null());
 
     // No reference to this toolchain found yet, make one.
-    std::unique_ptr<ToolchainRecord> new_record(new ToolchainRecord(
-        build_settings_, toolchain_name, default_toolchain_label_));
+    std::unique_ptr<ToolchainRecord> new_record =
+        std::make_unique<ToolchainRecord>(build_settings_, toolchain_name,
+                                          default_toolchain_label_);
     record = new_record.get();
     toolchain_records_[toolchain_name] = std::move(new_record);
 
@@ -168,8 +170,9 @@
   ToolchainRecord* record = toolchain_records_[toolchain->label()].get();
   if (!record) {
     DCHECK(!default_toolchain_label_.is_null());
-    std::unique_ptr<ToolchainRecord> new_record(new ToolchainRecord(
-        build_settings_, toolchain->label(), default_toolchain_label_));
+    std::unique_ptr<ToolchainRecord> new_record =
+        std::make_unique<ToolchainRecord>(build_settings_, toolchain->label(),
+                                          default_toolchain_label_);
     record = new_record.get();
     toolchain_records_[toolchain->label()] = std::move(new_record);
   }
diff --git a/tools/gn/loader_unittest.cc b/tools/gn/loader_unittest.cc
index 20b8609..fb33e5e 100644
--- a/tools/gn/loader_unittest.cc
+++ b/tools/gn/loader_unittest.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include <map>
+#include <memory>
 #include <utility>
 #include <vector>
 
@@ -68,8 +69,8 @@
 // Sets a given response for a given source file.
 void MockInputFileManager::AddCannedResponse(const SourceFile& source_file,
                                              const std::string& source) {
-  std::unique_ptr<CannedResult> canned(new CannedResult);
-  canned->input_file.reset(new InputFile(source_file));
+  std::unique_ptr<CannedResult> canned = std::make_unique<CannedResult>();
+  canned->input_file = std::make_unique<InputFile>(source_file);
   canned->input_file->SetContents(source);
 
   // Tokenize.
diff --git a/tools/gn/ninja_binary_target_writer_unittest.cc b/tools/gn/ninja_binary_target_writer_unittest.cc
index fc0b328..71804ef 100644
--- a/tools/gn/ninja_binary_target_writer_unittest.cc
+++ b/tools/gn/ninja_binary_target_writer_unittest.cc
@@ -4,6 +4,7 @@
 
 #include "tools/gn/ninja_binary_target_writer.h"
 
+#include <memory>
 #include <sstream>
 #include <utility>
 
@@ -582,7 +583,7 @@
   pch_settings.set_default_toolchain_label(setup.toolchain()->label());
 
   // Declare a C++ compiler that supports PCH.
-  std::unique_ptr<Tool> cxx_tool(new Tool);
+  std::unique_ptr<Tool> cxx_tool = std::make_unique<Tool>();
   TestWithScope::SetCommandForTool(
       "c++ {{source}} {{cflags}} {{cflags_cc}} {{defines}} {{include_dirs}} "
       "-o {{output}}",
@@ -593,7 +594,7 @@
   pch_toolchain.SetTool(Toolchain::TYPE_CXX, std::move(cxx_tool));
 
   // Add a C compiler as well.
-  std::unique_ptr<Tool> cc_tool(new Tool);
+  std::unique_ptr<Tool> cc_tool = std::make_unique<Tool>();
   TestWithScope::SetCommandForTool(
       "cc {{source}} {{cflags}} {{cflags_c}} {{defines}} {{include_dirs}} "
       "-o {{output}}",
@@ -709,7 +710,7 @@
   pch_settings.set_default_toolchain_label(setup.toolchain()->label());
 
   // Declare a C++ compiler that supports PCH.
-  std::unique_ptr<Tool> cxx_tool(new Tool);
+  std::unique_ptr<Tool> cxx_tool = std::make_unique<Tool>();
   TestWithScope::SetCommandForTool(
       "c++ {{source}} {{cflags}} {{cflags_cc}} {{defines}} {{include_dirs}} "
       "-o {{output}}",
@@ -721,7 +722,7 @@
   pch_toolchain.ToolchainSetupComplete();
 
   // Add a C compiler as well.
-  std::unique_ptr<Tool> cc_tool(new Tool);
+  std::unique_ptr<Tool> cc_tool = std::make_unique<Tool>();
   TestWithScope::SetCommandForTool(
       "cc {{source}} {{cflags}} {{cflags_c}} {{defines}} {{include_dirs}} "
       "-o {{output}}",
diff --git a/tools/gn/operators_unittest.cc b/tools/gn/operators_unittest.cc
index d72e08b..4b8ab37 100644
--- a/tools/gn/operators_unittest.cc
+++ b/tools/gn/operators_unittest.cc
@@ -5,6 +5,8 @@
 #include "tools/gn/operators.h"
 
 #include <stdint.h>
+
+#include <memory>
 #include <utility>
 
 #include "testing/gtest/include/gtest/gtest.h"
@@ -62,7 +64,7 @@
   }
 
   void SetLeftToValue(const Value& value) {
-    set_left(std::unique_ptr<ParseNode>(new TestParseNode(value)));
+    set_left(std::make_unique<TestParseNode>(value));
   }
 
   // Sets the left-hand side of the operator to an identifier node, this is
@@ -70,23 +72,23 @@
   void SetLeftToIdentifier(const char* identifier) {
     left_identifier_token_ownership_ =
         Token(Location(), Token::IDENTIFIER, identifier);
-    set_left(std::unique_ptr<ParseNode>(
-        new IdentifierNode(left_identifier_token_ownership_)));
+    set_left(
+        std::make_unique<IdentifierNode>(left_identifier_token_ownership_));
   }
 
   void SetRightToValue(const Value& value) {
-    set_right(std::unique_ptr<ParseNode>(new TestParseNode(value)));
+    set_right(std::make_unique<TestParseNode>(value));
   }
   void SetRightToListOfValue(const Value& value) {
     Value list(nullptr, Value::LIST);
     list.list_value().push_back(value);
-    set_right(std::unique_ptr<ParseNode>(new TestParseNode(list)));
+    set_right(std::make_unique<TestParseNode>(list));
   }
   void SetRightToListOfValue(const Value& value1, const Value& value2) {
     Value list(nullptr, Value::LIST);
     list.list_value().push_back(value1);
     list.list_value().push_back(value2);
-    set_right(std::unique_ptr<ParseNode>(new TestParseNode(list)));
+    set_right(std::make_unique<TestParseNode>(list));
   }
 
  private:
@@ -113,7 +115,7 @@
   node.SetLeftToIdentifier(sources);
 
   // Set up the filter on the scope to remove everything ending with "rm"
-  std::unique_ptr<PatternList> pattern_list(new PatternList);
+  std::unique_ptr<PatternList> pattern_list = std::make_unique<PatternList>();
   pattern_list->Append(Pattern("*rm"));
   setup.scope()->set_sources_assignment_filter(std::move(pattern_list));
 
@@ -189,7 +191,7 @@
   // This should fail.
   const char str_str[] = "\"hi\"";
   Token str(Location(), Token::STRING, str_str);
-  node.set_right(std::unique_ptr<ParseNode>(new LiteralNode(str)));
+  node.set_right(std::make_unique<LiteralNode>(str));
   ExecuteBinaryOperator(setup.scope(), &node, node.left(), node.right(), &err);
   EXPECT_TRUE(err.has_error());
   err = Err();
@@ -276,8 +278,7 @@
   // Set right as foo, but don't define a value for it.
   const char foo[] = "foo";
   Token identifier_token(Location(), Token::IDENTIFIER, foo);
-  node.set_right(
-      std::unique_ptr<ParseNode>(new IdentifierNode(identifier_token)));
+  node.set_right(std::make_unique<IdentifierNode>(identifier_token));
 
   Value ret = ExecuteBinaryOperator(setup.scope(), &node, node.left(),
                                     node.right(), &err);
@@ -295,8 +296,7 @@
   // Set right as foo, but don't define a value for it.
   const char foo[] = "foo";
   Token identifier_token(Location(), Token::IDENTIFIER, foo);
-  node.set_right(
-      std::unique_ptr<ParseNode>(new IdentifierNode(identifier_token)));
+  node.set_right(std::make_unique<IdentifierNode>(identifier_token));
 
   Value ret = ExecuteBinaryOperator(setup.scope(), &node, node.left(),
                                     node.right(), &err);
@@ -336,8 +336,7 @@
 
   // Set up "foo" with a nonempty scope.
   const char bar[] = "bar";
-  old_value =
-      Value(nullptr, std::unique_ptr<Scope>(new Scope(setup.settings())));
+  old_value = Value(nullptr, std::make_unique<Scope>(setup.settings()));
   old_value.scope_value()->SetValue(bar, Value(nullptr, "bar"), nullptr);
   setup.scope()->SetValue(foo, old_value, nullptr);
 
@@ -350,7 +349,7 @@
 
   // Assigning an empty list should succeed.
   node.SetRightToValue(
-      Value(nullptr, std::unique_ptr<Scope>(new Scope(setup.settings()))));
+      Value(nullptr, std::make_unique<Scope>(setup.settings())));
   node.Execute(setup.scope(), &err);
   ASSERT_FALSE(err.has_error());
   new_value = setup.scope()->GetValue(foo);
diff --git a/tools/gn/parse_tree.cc b/tools/gn/parse_tree.cc
index d1de9cb..3dae3e6 100644
--- a/tools/gn/parse_tree.cc
+++ b/tools/gn/parse_tree.cc
@@ -6,6 +6,7 @@
 
 #include <stdint.h>
 
+#include <memory>
 #include <string>
 #include <tuple>
 
@@ -110,7 +111,7 @@
 
 Comments* ParseNode::comments_mutable() {
   if (!comments_)
-    comments_.reset(new Comments);
+    comments_ = std::make_unique<Comments>();
   return comments_.get();
 }
 
@@ -315,7 +316,7 @@
   Scope* execution_scope;  // Either the enclosing_scope or nested_scope.
   if (result_mode_ == RETURNS_SCOPE) {
     // Create a nested scope to save the values for returning.
-    nested_scope.reset(new Scope(enclosing_scope));
+    nested_scope = std::make_unique<Scope>(enclosing_scope);
     execution_scope = nested_scope.get();
   } else {
     // Use the enclosing scope. Modifications will go into this also (for
diff --git a/tools/gn/parse_tree_unittest.cc b/tools/gn/parse_tree_unittest.cc
index 0609215..a786925 100644
--- a/tools/gn/parse_tree_unittest.cc
+++ b/tools/gn/parse_tree_unittest.cc
@@ -5,6 +5,8 @@
 #include "tools/gn/parse_tree.h"
 
 #include <stdint.h>
+
+#include <memory>
 #include <utility>
 
 #include "testing/gtest/include/gtest/gtest.h"
@@ -24,8 +26,8 @@
   AccessorNode accessor;
   accessor.set_base(base_token);
 
-  std::unique_ptr<IdentifierNode> member_identifier(
-      new IdentifierNode(member_token));
+  std::unique_ptr<IdentifierNode> member_identifier =
+      std::make_unique<IdentifierNode>(member_token);
   accessor.set_member(std::move(member_identifier));
 
   // The access should fail because a is not defined.
@@ -37,8 +39,7 @@
   // Define a as a Scope. It should still fail because b isn't defined.
   err = Err();
   setup.scope()->SetValue(
-      "a", Value(nullptr, std::unique_ptr<Scope>(new Scope(setup.scope()))),
-      nullptr);
+      "a", Value(nullptr, std::make_unique<Scope>(setup.scope())), nullptr);
   result = accessor.Execute(setup.scope(), &err);
   EXPECT_TRUE(err.has_error());
   EXPECT_EQ(Value::NONE, result.type());
diff --git a/tools/gn/parser.cc b/tools/gn/parser.cc
index 7e2c7f4..cc146e4 100644
--- a/tools/gn/parser.cc
+++ b/tools/gn/parser.cc
@@ -4,10 +4,10 @@
 
 #include "tools/gn/parser.h"
 
+#include <memory>
 #include <utility>
 
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "tools/gn/functions.h"
 #include "tools/gn/operators.h"
 #include "tools/gn/token.h"
@@ -460,7 +460,7 @@
 }
 
 std::unique_ptr<ParseNode> Parser::Literal(const Token& token) {
-  return base::MakeUnique<LiteralNode>(token);
+  return std::make_unique<LiteralNode>(token);
 }
 
 std::unique_ptr<ParseNode> Parser::Name(const Token& token) {
@@ -468,7 +468,8 @@
 }
 
 std::unique_ptr<ParseNode> Parser::BlockComment(const Token& token) {
-  std::unique_ptr<BlockCommentNode> comment(new BlockCommentNode());
+  std::unique_ptr<BlockCommentNode> comment =
+      std::make_unique<BlockCommentNode>();
   comment->set_comment(token);
   return std::move(comment);
 }
@@ -490,7 +491,7 @@
       *err_ = Err(token, "Expected right-hand side for '!'.");
     return std::unique_ptr<ParseNode>();
   }
-  std::unique_ptr<UnaryOpNode> unary_op(new UnaryOpNode);
+  std::unique_ptr<UnaryOpNode> unary_op = std::make_unique<UnaryOpNode>();
   unary_op->set_op(token);
   unary_op->set_operand(std::move(expr));
   return std::move(unary_op);
@@ -515,7 +516,7 @@
     }
     return std::unique_ptr<ParseNode>();
   }
-  std::unique_ptr<BinaryOpNode> binary_op(new BinaryOpNode);
+  std::unique_ptr<BinaryOpNode> binary_op = std::make_unique<BinaryOpNode>();
   binary_op->set_op(token);
   binary_op->set_left(std::move(left));
   binary_op->set_right(std::move(right));
@@ -525,9 +526,9 @@
 std::unique_ptr<ParseNode> Parser::IdentifierOrCall(
     std::unique_ptr<ParseNode> left,
     const Token& token) {
-  std::unique_ptr<ListNode> list(new ListNode);
+  std::unique_ptr<ListNode> list = std::make_unique<ListNode>();
   list->set_begin_token(token);
-  list->set_end(base::MakeUnique<EndNode>(token));
+  list->set_end(std::make_unique<EndNode>(token));
   std::unique_ptr<BlockNode> block;
   bool has_arg = false;
   if (LookAhead(Token::LEFT_PAREN)) {
@@ -552,9 +553,10 @@
 
   if (!left && !has_arg) {
     // Not a function call, just a standalone identifier.
-    return std::unique_ptr<ParseNode>(new IdentifierNode(token));
+    return std::make_unique<IdentifierNode>(token);
   }
-  std::unique_ptr<FunctionCallNode> func_call(new FunctionCallNode);
+  std::unique_ptr<FunctionCallNode> func_call =
+      std::make_unique<FunctionCallNode>();
   func_call->set_function(token);
   func_call->set_args(std::move(list));
   if (block)
@@ -576,7 +578,7 @@
       *err_ = Err(token, "Expected right-hand side for assignment.");
     return std::unique_ptr<ParseNode>();
   }
-  std::unique_ptr<BinaryOpNode> assign(new BinaryOpNode);
+  std::unique_ptr<BinaryOpNode> assign = std::make_unique<BinaryOpNode>();
   assign->set_op(token);
   assign->set_left(std::move(left));
   assign->set_right(std::move(value));
@@ -596,7 +598,7 @@
   }
   std::unique_ptr<ParseNode> value = ParseExpression();
   Consume(Token::RIGHT_BRACKET, "Expecting ']' after subscript.");
-  std::unique_ptr<AccessorNode> accessor(new AccessorNode);
+  std::unique_ptr<AccessorNode> accessor = std::make_unique<AccessorNode>();
   accessor->set_base(left->AsIdentifier()->value());
   accessor->set_index(std::move(value));
   return std::move(accessor);
@@ -619,7 +621,7 @@
     return std::unique_ptr<ParseNode>();
   }
 
-  std::unique_ptr<AccessorNode> accessor(new AccessorNode);
+  std::unique_ptr<AccessorNode> accessor = std::make_unique<AccessorNode>();
   accessor->set_base(left->AsIdentifier()->value());
   accessor->set_member(std::unique_ptr<IdentifierNode>(
       static_cast<IdentifierNode*>(right.release())));
@@ -630,7 +632,7 @@
 std::unique_ptr<ListNode> Parser::ParseList(const Token& start_token,
                                             Token::Type stop_before,
                                             bool allow_trailing_comma) {
-  std::unique_ptr<ListNode> list(new ListNode);
+  std::unique_ptr<ListNode> list = std::make_unique<ListNode>();
   list->set_begin_token(start_token);
   bool just_got_comma = false;
   bool first_time = true;
@@ -667,12 +669,13 @@
     *err_ = Err(cur_token(), "Trailing comma");
     return std::unique_ptr<ListNode>();
   }
-  list->set_end(base::MakeUnique<EndNode>(cur_token()));
+  list->set_end(std::make_unique<EndNode>(cur_token()));
   return list;
 }
 
 std::unique_ptr<ParseNode> Parser::ParseFile() {
-  std::unique_ptr<BlockNode> file(new BlockNode(BlockNode::DISCARDS_RESULT));
+  std::unique_ptr<BlockNode> file =
+      std::make_unique<BlockNode>(BlockNode::DISCARDS_RESULT);
   for (;;) {
     if (at_end())
       break;
@@ -721,12 +724,12 @@
     BlockNode::ResultMode result_mode) {
   if (has_error())
     return std::unique_ptr<BlockNode>();
-  std::unique_ptr<BlockNode> block(new BlockNode(result_mode));
+  std::unique_ptr<BlockNode> block = std::make_unique<BlockNode>(result_mode);
   block->set_begin_token(begin_brace);
 
   for (;;) {
     if (LookAhead(Token::RIGHT_BRACE)) {
-      block->set_end(base::MakeUnique<EndNode>(Consume()));
+      block->set_end(std::make_unique<EndNode>(Consume()));
       break;
     }
 
@@ -739,7 +742,7 @@
 }
 
 std::unique_ptr<ParseNode> Parser::ParseCondition() {
-  std::unique_ptr<ConditionNode> condition(new ConditionNode);
+  std::unique_ptr<ConditionNode> condition = std::make_unique<ConditionNode>();
   condition->set_if_token(Consume(Token::IF, "Expected 'if'"));
   Consume(Token::LEFT_PAREN, "Expected '(' after 'if'.");
   condition->set_condition(ParseExpression());
diff --git a/tools/gn/scope.cc b/tools/gn/scope.cc
index 024d5ec..6802a5a 100644
--- a/tools/gn/scope.cc
+++ b/tools/gn/scope.cc
@@ -4,8 +4,9 @@
 
 #include "tools/gn/scope.h"
 
+#include <memory>
+
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "tools/gn/parse_tree.h"
 #include "tools/gn/template.h"
 
@@ -346,7 +347,7 @@
     }
 
     std::unique_ptr<Scope>& dest_scope = dest->target_defaults_[current_name];
-    dest_scope = base::MakeUnique<Scope>(settings_);
+    dest_scope = std::make_unique<Scope>(settings_);
     pair.second->NonRecursiveMergeTo(dest_scope.get(), options, node_for_err,
                                      "<SHOULDN'T HAPPEN>", err);
   }
@@ -363,8 +364,8 @@
         return false;
       }
     }
-    dest->sources_assignment_filter_.reset(
-        new PatternList(*sources_assignment_filter_));
+    dest->sources_assignment_filter_ =
+        std::make_unique<PatternList>(*sources_assignment_filter_);
   }
 
   // Templates.
@@ -412,14 +413,14 @@
   if (const_containing_) {
     // We reached the top of the mutable scope stack. The result scope just
     // references the const scope (which will never change).
-    result.reset(new Scope(const_containing_));
+    result = std::make_unique<Scope>(const_containing_);
   } else if (mutable_containing_) {
     // There are more nested mutable scopes. Recursively go up the stack to
     // get the closure.
     result = mutable_containing_->MakeClosure();
   } else {
     // This is a standalone scope, just copy it.
-    result.reset(new Scope(settings_));
+    result = std::make_unique<Scope>(settings_);
   }
 
   // Want to clobber since we've flattened some nested scopes, and our parent
@@ -437,7 +438,7 @@
 
 Scope* Scope::MakeTargetDefaults(const std::string& target_type) {
   std::unique_ptr<Scope>& dest = target_defaults_[target_type];
-  dest = base::MakeUnique<Scope>(settings_);
+  dest = std::make_unique<Scope>(settings_);
   return dest.get();
 }
 
diff --git a/tools/gn/scope_per_file_provider.cc b/tools/gn/scope_per_file_provider.cc
index 737a5cd..f8c6026 100644
--- a/tools/gn/scope_per_file_provider.cc
+++ b/tools/gn/scope_per_file_provider.cc
@@ -4,6 +4,8 @@
 
 #include "tools/gn/scope_per_file_provider.h"
 
+#include <memory>
+
 #include "tools/gn/filesystem_utils.h"
 #include "tools/gn/settings.h"
 #include "tools/gn/source_file.h"
@@ -46,77 +48,73 @@
 
 const Value* ScopePerFileProvider::GetCurrentToolchain() {
   if (!current_toolchain_) {
-    current_toolchain_.reset(new Value(
+    current_toolchain_ = std::make_unique<Value>(
         nullptr,
-        scope_->settings()->toolchain_label().GetUserVisibleName(false)));
+        scope_->settings()->toolchain_label().GetUserVisibleName(false));
   }
   return current_toolchain_.get();
 }
 
 const Value* ScopePerFileProvider::GetDefaultToolchain() {
   if (!default_toolchain_) {
-    default_toolchain_.reset(new Value(
+    default_toolchain_ = std::make_unique<Value>(
         nullptr,
         scope_->settings()->default_toolchain_label().GetUserVisibleName(
-            false)));
+            false));
   }
   return default_toolchain_.get();
 }
 
 const Value* ScopePerFileProvider::GetPythonPath() {
   if (!python_path_) {
-    python_path_.reset(new Value(
+    python_path_ = std::make_unique<Value>(
         nullptr,
-        FilePathToUTF8(scope_->settings()->build_settings()->python_path())));
+        FilePathToUTF8(scope_->settings()->build_settings()->python_path()));
   }
   return python_path_.get();
 }
 
 const Value* ScopePerFileProvider::GetRootBuildDir() {
   if (!root_build_dir_) {
-    root_build_dir_.reset(new Value(
+    root_build_dir_ = std::make_unique<Value>(
         nullptr, DirectoryWithNoLastSlash(
-                     scope_->settings()->build_settings()->build_dir())));
+                     scope_->settings()->build_settings()->build_dir()));
   }
   return root_build_dir_.get();
 }
 
 const Value* ScopePerFileProvider::GetRootGenDir() {
   if (!root_gen_dir_) {
-    root_gen_dir_.reset(new Value(
-        nullptr,
-        DirectoryWithNoLastSlash(GetBuildDirAsSourceDir(
-            BuildDirContext(scope_), BuildDirType::GEN))));
+    root_gen_dir_ = std::make_unique<Value>(
+        nullptr, DirectoryWithNoLastSlash(GetBuildDirAsSourceDir(
+                     BuildDirContext(scope_), BuildDirType::GEN)));
   }
   return root_gen_dir_.get();
 }
 
 const Value* ScopePerFileProvider::GetRootOutDir() {
   if (!root_out_dir_) {
-    root_out_dir_.reset(new Value(
-        nullptr,
-        DirectoryWithNoLastSlash(GetScopeCurrentBuildDirAsSourceDir(
-            scope_, BuildDirType::TOOLCHAIN_ROOT))));
+    root_out_dir_ = std::make_unique<Value>(
+        nullptr, DirectoryWithNoLastSlash(GetScopeCurrentBuildDirAsSourceDir(
+                     scope_, BuildDirType::TOOLCHAIN_ROOT)));
   }
   return root_out_dir_.get();
 }
 
 const Value* ScopePerFileProvider::GetTargetGenDir() {
   if (!target_gen_dir_) {
-    target_gen_dir_.reset(new Value(
-        nullptr,
-        DirectoryWithNoLastSlash(
-            GetScopeCurrentBuildDirAsSourceDir(scope_, BuildDirType::GEN))));
+    target_gen_dir_ = std::make_unique<Value>(
+        nullptr, DirectoryWithNoLastSlash(GetScopeCurrentBuildDirAsSourceDir(
+                     scope_, BuildDirType::GEN)));
   }
   return target_gen_dir_.get();
 }
 
 const Value* ScopePerFileProvider::GetTargetOutDir() {
   if (!target_out_dir_) {
-    target_out_dir_.reset(new Value(
-        nullptr,
-        DirectoryWithNoLastSlash(
-            GetScopeCurrentBuildDirAsSourceDir(scope_, BuildDirType::OBJ))));
+    target_out_dir_ = std::make_unique<Value>(
+        nullptr, DirectoryWithNoLastSlash(GetScopeCurrentBuildDirAsSourceDir(
+                     scope_, BuildDirType::OBJ)));
   }
   return target_out_dir_.get();
 }
diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc
index e3b01a4..50a304f 100644
--- a/tools/gn/setup.cc
+++ b/tools/gn/setup.cc
@@ -5,7 +5,9 @@
 #include "tools/gn/setup.h"
 
 #include <stdlib.h>
+
 #include <algorithm>
+#include <memory>
 #include <sstream>
 #include <utility>
 
@@ -423,7 +425,7 @@
 }
 
 bool Setup::FillArgsFromCommandLine(const std::string& args) {
-  args_input_file_.reset(new InputFile(SourceFile()));
+  args_input_file_ = std::make_unique<InputFile>(SourceFile());
   args_input_file_->SetContents(args);
   args_input_file_->set_friendly_name("the command-line \"--args\"");
   return FillArgsFromArgsInputFile();
@@ -447,7 +449,7 @@
   if (contents.empty())
     return true;  // Empty file, do nothing.
 
-  args_input_file_.reset(new InputFile(build_arg_source_file));
+  args_input_file_ = std::make_unique<InputFile>(build_arg_source_file);
   args_input_file_->SetContents(contents);
   args_input_file_->set_friendly_name(
       "build arg file (use \"gn args <out_dir>\" to edit)");
@@ -668,7 +670,7 @@
   if (scheduler_.verbose_logging())
     scheduler_.Log("Got dotfile", FilePathToUTF8(dotfile_name_));
 
-  dotfile_input_file_.reset(new InputFile(SourceFile("//.gn")));
+  dotfile_input_file_ = std::make_unique<InputFile>(SourceFile("//.gn"));
   if (!dotfile_input_file_->Load(dotfile_name_)) {
     Err(Location(), "Could not load dotfile.",
         "The file \"" + FilePathToUTF8(dotfile_name_) + "\" couldn't be loaded")
@@ -771,7 +773,8 @@
       err.PrintToStdout();
       return false;
     }
-    std::unique_ptr<std::set<SourceFile>> whitelist(new std::set<SourceFile>);
+    std::unique_ptr<std::set<SourceFile>> whitelist =
+        std::make_unique<std::set<SourceFile>>();
     for (const auto& item : exec_script_whitelist_value->list_value()) {
       if (!item.VerifyTypeIs(Value::STRING, &err)) {
         err.PrintToStdout();
diff --git a/tools/gn/string_utils_unittest.cc b/tools/gn/string_utils_unittest.cc
index eb021a8..3e87c77 100644
--- a/tools/gn/string_utils_unittest.cc
+++ b/tools/gn/string_utils_unittest.cc
@@ -5,6 +5,8 @@
 #include "tools/gn/string_utils.h"
 
 #include <stdint.h>
+
+#include <memory>
 #include <utility>
 
 #include "testing/gtest/include/gtest/gtest.h"
@@ -23,8 +25,8 @@
   scope.SetValue("onestring", Value(nullptr, "one"), nullptr);
 
   // Nested scope called "onescope" with a value "one" inside it.
-  std::unique_ptr<Scope> onescope(
-      new Scope(static_cast<const Settings*>(nullptr)));
+  std::unique_ptr<Scope> onescope =
+      std::make_unique<Scope>(static_cast<const Settings*>(nullptr));
   onescope->SetValue("one", Value(nullptr, one), nullptr);
   scope.SetValue("onescope", Value(nullptr, std::move(onescope)), nullptr);
 
diff --git a/tools/gn/target_generator.cc b/tools/gn/target_generator.cc
index d751115..c31e754 100644
--- a/tools/gn/target_generator.cc
+++ b/tools/gn/target_generator.cc
@@ -6,6 +6,7 @@
 
 #include <stddef.h>
 
+#include <memory>
 #include <utility>
 
 #include "tools/gn/action_target_generator.h"
@@ -90,7 +91,8 @@
   if (g_scheduler->verbose_logging())
     g_scheduler->Log("Defining target", label.GetUserVisibleName(true));
 
-  std::unique_ptr<Target> target(new Target(scope->settings(), label));
+  std::unique_ptr<Target> target =
+      std::make_unique<Target>(scope->settings(), label);
   target->set_defined_from(function_call);
 
   // Create and call out to the proper generator.
diff --git a/tools/gn/target_unittest.cc b/tools/gn/target_unittest.cc
index 9ddcf37..bf943e8 100644
--- a/tools/gn/target_unittest.cc
+++ b/tools/gn/target_unittest.cc
@@ -4,6 +4,7 @@
 
 #include "tools/gn/target.h"
 
+#include <memory>
 #include <utility>
 
 #include "testing/gtest/include/gtest/gtest.h"
@@ -589,7 +590,7 @@
 
   Toolchain toolchain(setup.settings(), Label(SourceDir("//tc/"), "tc"));
 
-  std::unique_ptr<Tool> solink_tool(new Tool());
+  std::unique_ptr<Tool> solink_tool = std::make_unique<Tool>();
   solink_tool->set_output_prefix("lib");
   solink_tool->set_default_output_extension(".so");
 
@@ -630,7 +631,7 @@
 
   Toolchain toolchain(setup.settings(), Label(SourceDir("//tc/"), "tc"));
 
-  std::unique_ptr<Tool> solink_tool(new Tool());
+  std::unique_ptr<Tool> solink_tool = std::make_unique<Tool>();
   solink_tool->set_output_prefix("");
   solink_tool->set_default_output_extension(".dll");
 
diff --git a/tools/gn/template.cc b/tools/gn/template.cc
index 66d6745..0cc3131 100644
--- a/tools/gn/template.cc
+++ b/tools/gn/template.cc
@@ -4,6 +4,7 @@
 
 #include "tools/gn/template.h"
 
+#include <memory>
 #include <utility>
 
 #include "tools/gn/err.h"
@@ -38,7 +39,7 @@
 
   // First run the invocation's block. Need to allocate the scope on the heap
   // so we can pass ownership to the template.
-  std::unique_ptr<Scope> invocation_scope(new Scope(scope));
+  std::unique_ptr<Scope> invocation_scope = std::make_unique<Scope>(scope);
   if (!FillTargetBlockScope(scope, invocation, template_name,
                             block, args, invocation_scope.get(), err))
     return Value();
diff --git a/tools/gn/test_with_scope.cc b/tools/gn/test_with_scope.cc
index b239c64..d5c80c2 100644
--- a/tools/gn/test_with_scope.cc
+++ b/tools/gn/test_with_scope.cc
@@ -4,6 +4,7 @@
 
 #include "tools/gn/test_with_scope.h"
 
+#include <memory>
 #include <utility>
 
 #include "base/bind.h"
@@ -74,7 +75,7 @@
   Err err;
 
   // CC
-  std::unique_ptr<Tool> cc_tool(new Tool);
+  std::unique_ptr<Tool> cc_tool = std::make_unique<Tool>();
   SetCommandForTool(
       "cc {{source}} {{cflags}} {{cflags_c}} {{defines}} {{include_dirs}} "
       "-o {{output}}",
@@ -84,7 +85,7 @@
   toolchain->SetTool(Toolchain::TYPE_CC, std::move(cc_tool));
 
   // CXX
-  std::unique_ptr<Tool> cxx_tool(new Tool);
+  std::unique_ptr<Tool> cxx_tool = std::make_unique<Tool>();
   SetCommandForTool(
       "c++ {{source}} {{cflags}} {{cflags_cc}} {{defines}} {{include_dirs}} "
       "-o {{output}}",
@@ -94,7 +95,7 @@
   toolchain->SetTool(Toolchain::TYPE_CXX, std::move(cxx_tool));
 
   // OBJC
-  std::unique_ptr<Tool> objc_tool(new Tool);
+  std::unique_ptr<Tool> objc_tool = std::make_unique<Tool>();
   SetCommandForTool(
       "objcc {{source}} {{cflags}} {{cflags_objc}} {{defines}} "
       "{{include_dirs}} -o {{output}}",
@@ -104,7 +105,7 @@
   toolchain->SetTool(Toolchain::TYPE_OBJC, std::move(objc_tool));
 
   // OBJC
-  std::unique_ptr<Tool> objcxx_tool(new Tool);
+  std::unique_ptr<Tool> objcxx_tool = std::make_unique<Tool>();
   SetCommandForTool(
       "objcxx {{source}} {{cflags}} {{cflags_objcc}} {{defines}} "
       "{{include_dirs}} -o {{output}}",
@@ -116,7 +117,7 @@
   // Don't use RC and ASM tools in unit tests yet. Add here if needed.
 
   // ALINK
-  std::unique_ptr<Tool> alink_tool(new Tool);
+  std::unique_ptr<Tool> alink_tool = std::make_unique<Tool>();
   SetCommandForTool("ar {{output}} {{source}}", alink_tool.get());
   alink_tool->set_lib_switch("-l");
   alink_tool->set_lib_dir_switch("-L");
@@ -126,7 +127,7 @@
   toolchain->SetTool(Toolchain::TYPE_ALINK, std::move(alink_tool));
 
   // SOLINK
-  std::unique_ptr<Tool> solink_tool(new Tool);
+  std::unique_ptr<Tool> solink_tool = std::make_unique<Tool>();
   SetCommandForTool("ld -shared -o {{target_output_name}}.so {{inputs}} "
       "{{ldflags}} {{libs}}", solink_tool.get());
   solink_tool->set_lib_switch("-l");
@@ -138,7 +139,7 @@
   toolchain->SetTool(Toolchain::TYPE_SOLINK, std::move(solink_tool));
 
   // SOLINK_MODULE
-  std::unique_ptr<Tool> solink_module_tool(new Tool);
+  std::unique_ptr<Tool> solink_module_tool = std::make_unique<Tool>();
   SetCommandForTool("ld -bundle -o {{target_output_name}}.so {{inputs}} "
       "{{ldflags}} {{libs}}", solink_module_tool.get());
   solink_module_tool->set_lib_switch("-l");
@@ -151,7 +152,7 @@
                      std::move(solink_module_tool));
 
   // LINK
-  std::unique_ptr<Tool> link_tool(new Tool);
+  std::unique_ptr<Tool> link_tool = std::make_unique<Tool>();
   SetCommandForTool("ld -o {{target_output_name}} {{source}} "
       "{{ldflags}} {{libs}}", link_tool.get());
   link_tool->set_lib_switch("-l");
@@ -161,23 +162,23 @@
   toolchain->SetTool(Toolchain::TYPE_LINK, std::move(link_tool));
 
   // STAMP
-  std::unique_ptr<Tool> stamp_tool(new Tool);
+  std::unique_ptr<Tool> stamp_tool = std::make_unique<Tool>();
   SetCommandForTool("touch {{output}}", stamp_tool.get());
   toolchain->SetTool(Toolchain::TYPE_STAMP, std::move(stamp_tool));
 
   // COPY
-  std::unique_ptr<Tool> copy_tool(new Tool);
+  std::unique_ptr<Tool> copy_tool = std::make_unique<Tool>();
   SetCommandForTool("cp {{source}} {{output}}", copy_tool.get());
   toolchain->SetTool(Toolchain::TYPE_COPY, std::move(copy_tool));
 
   // COPY_BUNDLE_DATA
-  std::unique_ptr<Tool> copy_bundle_data_tool(new Tool);
+  std::unique_ptr<Tool> copy_bundle_data_tool = std::make_unique<Tool>();
   SetCommandForTool("cp {{source}} {{output}}", copy_bundle_data_tool.get());
   toolchain->SetTool(Toolchain::TYPE_COPY_BUNDLE_DATA,
                      std::move(copy_bundle_data_tool));
 
   // COMPILE_XCASSETS
-  std::unique_ptr<Tool> compile_xcassets_tool(new Tool);
+  std::unique_ptr<Tool> compile_xcassets_tool = std::make_unique<Tool>();
   SetCommandForTool("touch {{output}}", compile_xcassets_tool.get());
   toolchain->SetTool(Toolchain::TYPE_COMPILE_XCASSETS,
                      std::move(compile_xcassets_tool));
diff --git a/tools/gn/visibility.cc b/tools/gn/visibility.cc
index b32586c..d130caf 100644
--- a/tools/gn/visibility.cc
+++ b/tools/gn/visibility.cc
@@ -4,7 +4,8 @@
 
 #include "tools/gn/visibility.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "base/strings/string_piece.h"
 #include "base/strings/string_util.h"
 #include "base/values.h"
@@ -86,11 +87,10 @@
 }
 
 std::unique_ptr<base::Value> Visibility::AsValue() const {
-  auto* res = new base::ListValue();
+  auto res = std::make_unique<base::ListValue>();
   for (const auto& pattern : patterns_)
     res->AppendString(pattern.Describe());
-
-  return WrapUnique(res);
+  return res;
 }
 
 // static
diff --git a/tools/gn/visual_studio_writer.cc b/tools/gn/visual_studio_writer.cc
index bbb99c6..4e56b77 100644
--- a/tools/gn/visual_studio_writer.cc
+++ b/tools/gn/visual_studio_writer.cc
@@ -397,7 +397,7 @@
   base::FilePath vcxproj_path = build_settings_->GetFullPath(target_file);
   std::string vcxproj_path_str = FilePathToUTF8(vcxproj_path);
 
-  projects_.emplace_back(new SolutionProject(
+  projects_.push_back(std::make_unique<SolutionProject>(
       project_name, vcxproj_path_str,
       MakeGuid(vcxproj_path_str, kGuidSeedProject),
       FilePathToUTF8(build_settings_->GetFullPath(target->label().dir())),
@@ -817,9 +817,9 @@
       project->parent_folder = it->second;
     } else {
       std::string folder_path_str = folder_path.as_string();
-      std::unique_ptr<SolutionEntry> folder(new SolutionEntry(
+      std::unique_ptr<SolutionEntry> folder = std::make_unique<SolutionEntry>(
           FindLastDirComponent(SourceDir(folder_path)).as_string(),
-          folder_path_str, MakeGuid(folder_path_str, kGuidSeedFolder)));
+          folder_path_str, MakeGuid(folder_path_str, kGuidSeedFolder));
       project->parent_folder = folder.get();
       processed_paths[folder_path] = folder.get();
       folders_.push_back(std::move(folder));
@@ -862,10 +862,11 @@
       if (it != processed_paths.end()) {
         folder = it->second;
       } else {
-        std::unique_ptr<SolutionEntry> new_folder(new SolutionEntry(
-            FindLastDirComponent(SourceDir(parent_path)).as_string(),
-            parent_path.as_string(),
-            MakeGuid(parent_path.as_string(), kGuidSeedFolder)));
+        std::unique_ptr<SolutionEntry> new_folder =
+            std::make_unique<SolutionEntry>(
+                FindLastDirComponent(SourceDir(parent_path)).as_string(),
+                parent_path.as_string(),
+                MakeGuid(parent_path.as_string(), kGuidSeedFolder));
         processed_paths[parent_path] = new_folder.get();
         folder = new_folder.get();
         additional_folders.push_back(std::move(new_folder));
diff --git a/tools/gn/visual_studio_writer_unittest.cc b/tools/gn/visual_studio_writer_unittest.cc
index 6a7fbfc..b924182 100644
--- a/tools/gn/visual_studio_writer_unittest.cc
+++ b/tools/gn/visual_studio_writer_unittest.cc
@@ -4,6 +4,8 @@
 
 #include "tools/gn/visual_studio_writer.h"
 
+#include <memory>
+
 #include "base/strings/string_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/test_with_scope.h"
@@ -33,24 +35,28 @@
 
   std::string path =
       MakeTestPath("/foo/chromium/src/out/Debug/obj/base/base.vcxproj");
-  writer.projects_.emplace_back(new VisualStudioWriter::SolutionProject(
-      "base", path, MakeGuid(path, "project"),
-      MakeTestPath("/foo/chromium/src/base"), "Win32"));
+  writer.projects_.push_back(
+      std::make_unique<VisualStudioWriter::SolutionProject>(
+          "base", path, MakeGuid(path, "project"),
+          MakeTestPath("/foo/chromium/src/base"), "Win32"));
 
   path = MakeTestPath("/foo/chromium/src/out/Debug/obj/tools/gn/gn.vcxproj");
-  writer.projects_.emplace_back(new VisualStudioWriter::SolutionProject(
-      "gn", path, MakeGuid(path, "project"),
-      MakeTestPath("/foo/chromium/src/tools/gn"), "Win32"));
+  writer.projects_.push_back(
+      std::make_unique<VisualStudioWriter::SolutionProject>(
+          "gn", path, MakeGuid(path, "project"),
+          MakeTestPath("/foo/chromium/src/tools/gn"), "Win32"));
 
   path = MakeTestPath("/foo/chromium/src/out/Debug/obj/chrome/chrome.vcxproj");
-  writer.projects_.emplace_back(new VisualStudioWriter::SolutionProject(
-      "chrome", path, MakeGuid(path, "project"),
-      MakeTestPath("/foo/chromium/src/chrome"), "Win32"));
+  writer.projects_.push_back(
+      std::make_unique<VisualStudioWriter::SolutionProject>(
+          "chrome", path, MakeGuid(path, "project"),
+          MakeTestPath("/foo/chromium/src/chrome"), "Win32"));
 
   path = MakeTestPath("/foo/chromium/src/out/Debug/obj/base/bar.vcxproj");
-  writer.projects_.emplace_back(new VisualStudioWriter::SolutionProject(
-      "bar", path, MakeGuid(path, "project"),
-      MakeTestPath("/foo/chromium/src/base"), "Win32"));
+  writer.projects_.push_back(
+      std::make_unique<VisualStudioWriter::SolutionProject>(
+          "bar", path, MakeGuid(path, "project"),
+          MakeTestPath("/foo/chromium/src/base"), "Win32"));
 
   writer.ResolveSolutionFolders();
 
@@ -88,20 +94,23 @@
 
   std::string path =
       MakeTestPath("/foo/chromium/src/out/Debug/obj/base/base.vcxproj");
-  writer.projects_.emplace_back(new VisualStudioWriter::SolutionProject(
-      "base", path, MakeGuid(path, "project"),
-      MakeTestPath("/foo/chromium/src/base"), "Win32"));
+  writer.projects_.push_back(
+      std::make_unique<VisualStudioWriter::SolutionProject>(
+          "base", path, MakeGuid(path, "project"),
+          MakeTestPath("/foo/chromium/src/base"), "Win32"));
 
   path = MakeTestPath("/foo/chromium/src/out/Debug/obj/tools/gn/gn.vcxproj");
-  writer.projects_.emplace_back(new VisualStudioWriter::SolutionProject(
-      "gn", path, MakeGuid(path, "project"),
-      MakeTestPath("/foo/chromium/src/tools/gn"), "Win32"));
+  writer.projects_.push_back(
+      std::make_unique<VisualStudioWriter::SolutionProject>(
+          "gn", path, MakeGuid(path, "project"),
+          MakeTestPath("/foo/chromium/src/tools/gn"), "Win32"));
 
   path = MakeTestPath(
       "/foo/chromium/src/out/Debug/obj/ABS_PATH/C/foo/bar/bar.vcxproj");
-  writer.projects_.emplace_back(new VisualStudioWriter::SolutionProject(
-      "bar", path, MakeGuid(path, "project"), MakeTestPath("/foo/bar"),
-      "Win32"));
+  writer.projects_.push_back(
+      std::make_unique<VisualStudioWriter::SolutionProject>(
+          "bar", path, MakeGuid(path, "project"), MakeTestPath("/foo/bar"),
+          "Win32"));
 
   std::string baz_label_dir_path = MakeTestPath("/foo/bar/baz");
 #if defined(OS_WIN)
@@ -110,8 +119,9 @@
 #endif
   path = MakeTestPath(
       "/foo/chromium/src/out/Debug/obj/ABS_PATH/C/foo/bar/baz/baz.vcxproj");
-  writer.projects_.emplace_back(new VisualStudioWriter::SolutionProject(
-      "baz", path, MakeGuid(path, "project"), baz_label_dir_path, "Win32"));
+  writer.projects_.push_back(
+      std::make_unique<VisualStudioWriter::SolutionProject>(
+          "baz", path, MakeGuid(path, "project"), baz_label_dir_path, "Win32"));
 
   writer.ResolveSolutionFolders();
 
diff --git a/tools/gn/xcode_object.cc b/tools/gn/xcode_object.cc
index 17d82e5..b229d2d 100644
--- a/tools/gn/xcode_object.cc
+++ b/tools/gn/xcode_object.cc
@@ -5,12 +5,12 @@
 #include "tools/gn/xcode_object.h"
 
 #include <iomanip>
+#include <memory>
 #include <sstream>
 #include <utility>
 
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_util.h"
 #include "tools/gn/filesystem_utils.h"
 
@@ -321,7 +321,7 @@
       name_(name) {
   if (!shell_script.empty()) {
     build_phases_.push_back(
-        base::MakeUnique<PBXShellScriptBuildPhase>(name, shell_script));
+        std::make_unique<PBXShellScriptBuildPhase>(name, shell_script));
   }
 }
 
@@ -541,7 +541,7 @@
       }
     }
 
-    children_.push_back(base::MakeUnique<PBXFileReference>(
+    children_.push_back(std::make_unique<PBXFileReference>(
         navigator_path, source_path, std::string()));
     return static_cast<PBXFileReference*>(children_.back().get());
   }
@@ -560,7 +560,7 @@
   }
 
   if (!group) {
-    children_.push_back(base::MakeUnique<PBXGroup>(component.as_string(),
+    children_.push_back(std::make_unique<PBXGroup>(component.as_string(),
                                                    component.as_string()));
     group = static_cast<PBXGroup*>(children_.back().get());
   }
@@ -617,11 +617,11 @@
       product_type_(product_type),
       product_name_(product_name) {
   DCHECK(product_reference_);
-  build_phases_.push_back(base::MakeUnique<PBXSourcesBuildPhase>());
+  build_phases_.push_back(std::make_unique<PBXSourcesBuildPhase>());
   source_build_phase_ =
       static_cast<PBXSourcesBuildPhase*>(build_phases_.back().get());
 
-  build_phases_.push_back(base::MakeUnique<PBXFrameworksBuildPhase>());
+  build_phases_.push_back(std::make_unique<PBXFrameworksBuildPhase>());
 }
 
 PBXNativeTarget::~PBXNativeTarget() {}
@@ -629,7 +629,7 @@
 void PBXNativeTarget::AddFileForIndexing(const PBXFileReference* file_reference,
                                          const CompilerFlags compiler_flag) {
   DCHECK(file_reference);
-  source_build_phase_->AddBuildFile(base::MakeUnique<PBXBuildFile>(
+  source_build_phase_->AddBuildFile(std::make_unique<PBXBuildFile>(
       file_reference, source_build_phase_, compiler_flag));
 }
 
@@ -664,11 +664,11 @@
 
   main_group_.reset(new PBXGroup);
   sources_ = static_cast<PBXGroup*>(
-      main_group_->AddChild(base::MakeUnique<PBXGroup>(source_path, "Source")));
+      main_group_->AddChild(std::make_unique<PBXGroup>(source_path, "Source")));
   sources_->set_is_source(true);
   products_ = static_cast<PBXGroup*>(main_group_->AddChild(
-      base::MakeUnique<PBXGroup>(std::string(), "Product")));
-  main_group_->AddChild(base::MakeUnique<PBXGroup>(std::string(), "Build"));
+      std::make_unique<PBXGroup>(std::string(), "Product")));
+  main_group_->AddChild(std::make_unique<PBXGroup>(std::string(), "Build"));
 
   configurations_.reset(new XCConfigurationList(config_name, attributes, this));
 }
@@ -707,7 +707,7 @@
   attributes["CONFIGURATION_BUILD_DIR"] = ".";
   attributes["PRODUCT_NAME"] = name;
 
-  targets_.push_back(base::MakeUnique<PBXAggregateTarget>(
+  targets_.push_back(std::make_unique<PBXAggregateTarget>(
       name, shell_script, config_name_, attributes));
 }
 
@@ -719,11 +719,11 @@
   attributes["PRODUCT_NAME"] = "sources";
 
   PBXFileReference* product_reference = static_cast<PBXFileReference*>(
-      products_->AddChild(base::MakeUnique<PBXFileReference>(
+      products_->AddChild(std::make_unique<PBXFileReference>(
           std::string(), "sources", "compiled.mach-o.executable")));
 
   const char product_type[] = "com.apple.product-type.tool";
-  targets_.push_back(base::MakeUnique<PBXNativeTarget>(
+  targets_.push_back(std::make_unique<PBXNativeTarget>(
       "sources", std::string(), config_name_, attributes, product_type,
       "sources", product_reference));
   target_for_indexing_ = static_cast<PBXNativeTarget*>(targets_.back().get());
@@ -738,7 +738,7 @@
     const PBXAttributes& extra_attributes) {
   base::StringPiece ext = FindExtension(&output_name);
   PBXFileReference* product = static_cast<PBXFileReference*>(
-      products_->AddChild(base::MakeUnique<PBXFileReference>(
+      products_->AddChild(std::make_unique<PBXFileReference>(
           std::string(), output_name,
           type.empty() ? GetSourceType(ext) : type)));
 
@@ -760,7 +760,7 @@
   attributes["CONFIGURATION_BUILD_DIR"] = ".";
   attributes["PRODUCT_NAME"] = product_name;
 
-  targets_.push_back(base::MakeUnique<PBXNativeTarget>(
+  targets_.push_back(std::make_unique<PBXNativeTarget>(
       name, shell_script, config_name_, attributes, output_type, product_name,
       product));
   return static_cast<PBXNativeTarget*>(targets_.back().get());
@@ -953,7 +953,7 @@
     : owner_reference_(owner_reference) {
   DCHECK(owner_reference_);
   configurations_.push_back(
-      base::MakeUnique<XCBuildConfiguration>(name, attributes));
+      std::make_unique<XCBuildConfiguration>(name, attributes));
 }
 
 XCConfigurationList::~XCConfigurationList() {}
diff --git a/tools/gn/xcode_object_unittest.cc b/tools/gn/xcode_object_unittest.cc
index 52a98b9..656d0b7 100644
--- a/tools/gn/xcode_object_unittest.cc
+++ b/tools/gn/xcode_object_unittest.cc
@@ -4,7 +4,6 @@
 
 #include "tools/gn/xcode_object.h"
 
-#include "base/memory/ptr_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
@@ -306,22 +305,23 @@
 
 // Tests the mapping between PBXObjectClass and it's name as a string.
 TEST(XcodeObject, ClassToString) {
-  EXPECT_EQ("PBXAggregateTarget", ToString(PBXAggregateTargetClass));
-  EXPECT_EQ("PBXBuildFile", ToString(PBXBuildFileClass));
-  EXPECT_EQ("PBXAggregateTarget", ToString(PBXAggregateTargetClass));
-  EXPECT_EQ("PBXBuildFile", ToString(PBXBuildFileClass));
-  EXPECT_EQ("PBXContainerItemProxy", ToString(PBXContainerItemProxyClass));
-  EXPECT_EQ("PBXFileReference", ToString(PBXFileReferenceClass));
-  EXPECT_EQ("PBXFrameworksBuildPhase", ToString(PBXFrameworksBuildPhaseClass));
-  EXPECT_EQ("PBXGroup", ToString(PBXGroupClass));
-  EXPECT_EQ("PBXNativeTarget", ToString(PBXNativeTargetClass));
-  EXPECT_EQ("PBXProject", ToString(PBXProjectClass));
-  EXPECT_EQ("PBXSourcesBuildPhase", ToString(PBXSourcesBuildPhaseClass));
-  EXPECT_EQ("PBXTargetDependency", ToString(PBXTargetDependencyClass));
-  EXPECT_EQ("XCBuildConfiguration", ToString(XCBuildConfigurationClass));
-  EXPECT_EQ("XCConfigurationList", ToString(XCConfigurationListClass));
-  EXPECT_EQ("PBXShellScriptBuildPhase",
-            ToString(PBXShellScriptBuildPhaseClass));
+  EXPECT_STREQ("PBXAggregateTarget", ToString(PBXAggregateTargetClass));
+  EXPECT_STREQ("PBXBuildFile", ToString(PBXBuildFileClass));
+  EXPECT_STREQ("PBXAggregateTarget", ToString(PBXAggregateTargetClass));
+  EXPECT_STREQ("PBXBuildFile", ToString(PBXBuildFileClass));
+  EXPECT_STREQ("PBXContainerItemProxy", ToString(PBXContainerItemProxyClass));
+  EXPECT_STREQ("PBXFileReference", ToString(PBXFileReferenceClass));
+  EXPECT_STREQ("PBXFrameworksBuildPhase",
+               ToString(PBXFrameworksBuildPhaseClass));
+  EXPECT_STREQ("PBXGroup", ToString(PBXGroupClass));
+  EXPECT_STREQ("PBXNativeTarget", ToString(PBXNativeTargetClass));
+  EXPECT_STREQ("PBXProject", ToString(PBXProjectClass));
+  EXPECT_STREQ("PBXSourcesBuildPhase", ToString(PBXSourcesBuildPhaseClass));
+  EXPECT_STREQ("PBXTargetDependency", ToString(PBXTargetDependencyClass));
+  EXPECT_STREQ("XCBuildConfiguration", ToString(XCBuildConfigurationClass));
+  EXPECT_STREQ("XCConfigurationList", ToString(XCConfigurationListClass));
+  EXPECT_STREQ("PBXShellScriptBuildPhase",
+               ToString(PBXShellScriptBuildPhaseClass));
 }
 
 // Tests the mapping between PBXObject and it's name as a string.
diff --git a/tools/gn/xcode_writer.cc b/tools/gn/xcode_writer.cc
index c10ebb4..3134b48 100644
--- a/tools/gn/xcode_writer.cc
+++ b/tools/gn/xcode_writer.cc
@@ -13,7 +13,6 @@
 
 #include "base/environment.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/sha1.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
@@ -151,8 +150,8 @@
                             PBXTarget* dependent_pbxtarget,
                             const PBXProject* project) {
   auto container_item_proxy =
-      base::MakeUnique<PBXContainerItemProxy>(project, base_pbxtarget);
-  auto dependency = base::MakeUnique<PBXTargetDependency>(
+      std::make_unique<PBXContainerItemProxy>(project, base_pbxtarget);
+  auto dependency = std::make_unique<PBXTargetDependency>(
       base_pbxtarget, std::move(container_item_proxy));
 
   dependent_pbxtarget->AddDependency(std::move(dependency));
diff --git a/tools/gn/xml_element_writer.cc b/tools/gn/xml_element_writer.cc
index ecc4f7b..127766c 100644
--- a/tools/gn/xml_element_writer.cc
+++ b/tools/gn/xml_element_writer.cc
@@ -4,7 +4,7 @@
 
 #include "tools/gn/xml_element_writer.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
 
 XmlAttributes::XmlAttributes() {}
 
@@ -64,7 +64,7 @@
     const std::string& tag,
     const XmlAttributes& attributes) {
   StartContent(true);
-  return base::MakeUnique<XmlElementWriter>(out_, tag, attributes, indent_ + 2);
+  return std::make_unique<XmlElementWriter>(out_, tag, attributes, indent_ + 2);
 }
 
 std::ostream& XmlElementWriter::StartContent(bool start_new_line) {
diff --git a/tools/gn/xml_element_writer.h b/tools/gn/xml_element_writer.h
index 0e8fa01..4aa5f7e 100644
--- a/tools/gn/xml_element_writer.h
+++ b/tools/gn/xml_element_writer.h
@@ -12,7 +12,6 @@
 #include <vector>
 
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_piece.h"
 
 // Vector of XML attribute key-value pairs.
@@ -116,7 +115,7 @@
     const std::string& attribute_name,
     const Writer& attribute_value_writer) {
   StartContent(true);
-  return base::MakeUnique<XmlElementWriter>(
+  return std::make_unique<XmlElementWriter>(
       out_, tag, attribute_name, attribute_value_writer, indent_ + 2);
 }