Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: chrome/browser/extensions/install_signer.cc

Issue 2777063003: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Just rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/install_signer.cc
diff --git a/chrome/browser/extensions/install_signer.cc b/chrome/browser/extensions/install_signer.cc
index 065a544b3c85799c3059c3f9dd9d312284f8de92..d96ad631e75613fe4d03b6698bac913ce1ffc0dc 100644
--- a/chrome/browser/extensions/install_signer.cc
+++ b/chrome/browser/extensions/install_signer.cc
@@ -15,6 +15,7 @@
#include "base/json/json_writer.h"
#include "base/lazy_instance.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/process/process_info.h"
@@ -125,10 +126,10 @@ bool ValidateExpireDateFormat(const std::string& input) {
void SetExtensionIdSet(base::DictionaryValue* dictionary,
const char* key,
const ExtensionIdSet& ids) {
- base::ListValue* id_list = new base::ListValue();
+ auto id_list = base::MakeUnique<base::ListValue>();
for (ExtensionIdSet::const_iterator i = ids.begin(); i != ids.end(); ++i)
id_list->AppendString(*i);
- dictionary->Set(key, id_list);
+ dictionary->Set(key, std::move(id_list));
}
// Tries to fetch a list of strings from |dictionay| for |key|, and inserts
@@ -390,7 +391,7 @@ void InstallSigner::GetSignature(const SignatureCallback& callback) {
for (ExtensionIdSet::const_iterator i = ids_.begin(); i != ids_.end(); ++i) {
id_list->AppendString(*i);
}
- dictionary.Set(kIdsKey, id_list.release());
+ dictionary.Set(kIdsKey, std::move(id_list));
std::string json;
base::JSONWriter::Write(dictionary, &json);
if (json.empty()) {

Powered by Google App Engine
This is Rietveld 408576698