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

Unified Diff: components/sync/protocol/sync_protocol_error.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits Created 3 years, 7 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 | « components/sync/protocol/sync_protocol_error.h ('k') | components/sync/syncable/base_node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/protocol/sync_protocol_error.cc
diff --git a/components/sync/protocol/sync_protocol_error.cc b/components/sync/protocol/sync_protocol_error.cc
index 01fd3b09a7b08a618d1c3c3328283889a57c0adc..1f1ff0d3c1f9f30fb5f22cdc5f6f28f46089cf70 100644
--- a/components/sync/protocol/sync_protocol_error.cc
+++ b/components/sync/protocol/sync_protocol_error.cc
@@ -4,7 +4,10 @@
#include "components/sync/protocol/sync_protocol_error.h"
+#include <utility>
+
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
namespace syncer {
#define ENUM_CASE(x) \
@@ -52,8 +55,8 @@ SyncProtocolError::SyncProtocolError(const SyncProtocolError& other) = default;
SyncProtocolError::~SyncProtocolError() {}
-base::DictionaryValue* SyncProtocolError::ToValue() const {
- base::DictionaryValue* value = new base::DictionaryValue();
+std::unique_ptr<base::DictionaryValue> SyncProtocolError::ToValue() const {
+ auto value = base::MakeUnique<base::DictionaryValue>();
value->SetString("ErrorType", GetSyncErrorTypeString(error_type));
value->SetString("ErrorDescription", error_description);
value->SetString("url", url);
« no previous file with comments | « components/sync/protocol/sync_protocol_error.h ('k') | components/sync/syncable/base_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698