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

Unified Diff: extensions/common/value_builder.cc

Issue 2370633002: replace deprecated version of SetWithoutPathExpansion (Closed)
Patch Set: use MakeUnique Created 4 years, 3 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
« no previous file with comments | « extensions/browser/value_store/value_store_change.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/value_builder.cc
diff --git a/extensions/common/value_builder.cc b/extensions/common/value_builder.cc
index 2cb33237c1758d3b5b0ff591ef343f123ee6f24f..a288875e3d3751672ba5aef3181caed2fbfbecd4 100644
--- a/extensions/common/value_builder.cc
+++ b/extensions/common/value_builder.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
namespace extensions {
@@ -29,25 +30,29 @@ std::string DictionaryBuilder::ToJSON() const {
DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
int in_value) {
- dict_->SetWithoutPathExpansion(path, new base::FundamentalValue(in_value));
+ dict_->SetWithoutPathExpansion(
+ path, base::MakeUnique<base::FundamentalValue>(in_value));
return *this;
}
DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
double in_value) {
- dict_->SetWithoutPathExpansion(path, new base::FundamentalValue(in_value));
+ dict_->SetWithoutPathExpansion(
+ path, base::MakeUnique<base::FundamentalValue>(in_value));
return *this;
}
DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
const std::string& in_value) {
- dict_->SetWithoutPathExpansion(path, new base::StringValue(in_value));
+ dict_->SetWithoutPathExpansion(path,
+ base::MakeUnique<base::StringValue>(in_value));
return *this;
}
DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
const base::string16& in_value) {
- dict_->SetWithoutPathExpansion(path, new base::StringValue(in_value));
+ dict_->SetWithoutPathExpansion(path,
+ base::MakeUnique<base::StringValue>(in_value));
return *this;
}
@@ -60,7 +65,8 @@ DictionaryBuilder& DictionaryBuilder::Set(
DictionaryBuilder& DictionaryBuilder::SetBoolean(
const std::string& path, bool in_value) {
- dict_->SetWithoutPathExpansion(path, new base::FundamentalValue(in_value));
+ dict_->SetWithoutPathExpansion(
+ path, base::MakeUnique<base::FundamentalValue>(in_value));
return *this;
}
« no previous file with comments | « extensions/browser/value_store/value_store_change.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698