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

Unified Diff: components/bookmarks/browser/bookmark_codec.cc

Issue 2287733002: Switch //components away from base::ListValue::Append(Value*) overload. (Closed)
Patch Set: Test fix Created 4 years, 4 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: components/bookmarks/browser/bookmark_codec.cc
diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmarks/browser/bookmark_codec.cc
index 8bda69bf3880cb03ead4cad1450535c27cb1a437..e110ad3d5284a04fb41aee9dc1831175b9470ed1 100644
--- a/components/bookmarks/browser/bookmark_codec.cc
+++ b/components/bookmarks/browser/bookmark_codec.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <algorithm>
+#include <utility>
#include "base/json/json_string_value_serializer.h"
#include "base/strings/string_number_conversions.h"
@@ -114,8 +115,9 @@ bool BookmarkCodec::Decode(BookmarkNode* bb_node,
return success;
}
-base::Value* BookmarkCodec::EncodeNode(const BookmarkNode* node) {
- base::DictionaryValue* value = new base::DictionaryValue();
+std::unique_ptr<base::Value> BookmarkCodec::EncodeNode(
+ const BookmarkNode* node) {
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
std::string id = base::Int64ToString(node->id());
value->SetString(kIdKey, id);
const base::string16& title = node->GetTitle();
@@ -147,7 +149,7 @@ base::Value* BookmarkCodec::EncodeNode(const BookmarkNode* node) {
value->SetString(kSyncTransactionVersion,
base::Int64ToString(node->sync_transaction_version()));
}
- return value;
+ return std::move(value);
blundell 2016/08/29 07:39:15 just to verify my own understanding of how this st
dcheng 2016/08/30 17:41:55 It is, because the type of the local doesn't match
}
base::Value* BookmarkCodec::EncodeMetaInfo(

Powered by Google App Engine
This is Rietveld 408576698