extensions: Replace base::MakeUnique with std::make_unique
Should use std::make_unique directly instead of using base::MakeUnique
since August[1]. So, this change removes usages of base::MakeUnique in
//chrome/browser/extensions.
This change removes `#include "base/memory/ptr_util.h"` if it's no more
used in files. (Might not remove if base::WrapUnique is used)
This change also adds `#include <memory>` header except the following
two cases:
- Not add the header if the file contains the <memory> header
- Not add the header if the related header contains <memory> header
(The style guide[2] says that foo.cc can rely on foo.h's includes)
Confirmed no additional lint errors(by `git cl lint`) after this change.
[1] https://chromium-review.googlesource.com/c/chromium/src/+/616016
[2] https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
Bug: 755727
Change-Id: Iad81c59fef2a7b92eb6d27fb891bc8c19643d32d
Reviewed-on: https://chromium-review.googlesource.com/867171
Reviewed-by: Devlin <[email protected]>
Commit-Queue: Jinho Bang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#529852}
diff --git a/chrome/browser/extensions/extension_protocols_unittest.cc b/chrome/browser/extensions/extension_protocols_unittest.cc
index 04c432e5..7f3931dd7 100644
--- a/chrome/browser/extensions/extension_protocols_unittest.cc
+++ b/chrome/browser/extensions/extension_protocols_unittest.cc
@@ -11,7 +11,6 @@
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/macros.h"
-#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -105,7 +104,7 @@
manifest.SetString("name", "An extension with web-accessible resources");
manifest.SetString("version", "2");
- auto web_accessible_list = base::MakeUnique<base::ListValue>();
+ auto web_accessible_list = std::make_unique<base::ListValue>();
web_accessible_list->AppendString("test.dat");
manifest.Set("web_accessible_resources", std::move(web_accessible_list));
@@ -160,7 +159,7 @@
read_contents_.clear();
waiting_for_extension_id_.reset();
seen_done_reading_extension_ids_.clear();
- run_loop_ = base::MakeUnique<base::RunLoop>();
+ run_loop_ = std::make_unique<base::RunLoop>();
}
private:
@@ -199,7 +198,7 @@
switches::kExtensionContentVerification,
switches::kExtensionContentVerificationEnforce);
content_verifier_ = new ContentVerifier(
- testing_profile_.get(), base::MakeUnique<ChromeContentVerifierDelegate>(
+ testing_profile_.get(), std::make_unique<ChromeContentVerifierDelegate>(
testing_profile_.get()));
extension_info_map_->SetContentVerifier(content_verifier_.get());
}