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

Unified Diff: dbus/values_util.cc

Issue 1867253002: Convert //dbus from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU fixes in //device Created 4 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
« no previous file with comments | « dbus/test_service.cc ('k') | dbus/values_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/values_util.cc
diff --git a/dbus/values_util.cc b/dbus/values_util.cc
index e932312e6929841d1f316fbfaef077efe587714b..ed435a193680ff368b2f3e757d062de5676e12ec 100644
--- a/dbus/values_util.cc
+++ b/dbus/values_util.cc
@@ -4,9 +4,10 @@
#include "dbus/values_util.h"
+#include <memory>
+
#include "base/json/json_writer.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "dbus/message.h"
@@ -47,7 +48,7 @@ bool PopDictionaryEntries(MessageReader* reader,
return false;
} else {
// If the type of keys is not STRING, convert it to string.
- scoped_ptr<base::Value> key(PopDataAsValue(&entry_reader));
+ std::unique_ptr<base::Value> key(PopDataAsValue(&entry_reader));
if (!key)
return false;
// Use JSONWriter to convert an arbitrary value to a string.
@@ -176,12 +177,12 @@ base::Value* PopDataAsValue(MessageReader* reader) {
// If the type of the array's element is DICT_ENTRY, create a
// DictionaryValue, otherwise create a ListValue.
if (sub_reader.GetDataType() == Message::DICT_ENTRY) {
- scoped_ptr<base::DictionaryValue> dictionary_value(
+ std::unique_ptr<base::DictionaryValue> dictionary_value(
new base::DictionaryValue);
if (PopDictionaryEntries(&sub_reader, dictionary_value.get()))
result = dictionary_value.release();
} else {
- scoped_ptr<base::ListValue> list_value(new base::ListValue);
+ std::unique_ptr<base::ListValue> list_value(new base::ListValue);
if (PopListElements(&sub_reader, list_value.get()))
result = list_value.release();
}
@@ -191,7 +192,7 @@ base::Value* PopDataAsValue(MessageReader* reader) {
case Message::STRUCT: {
MessageReader sub_reader(NULL);
if (reader->PopStruct(&sub_reader)) {
- scoped_ptr<base::ListValue> list_value(new base::ListValue);
+ std::unique_ptr<base::ListValue> list_value(new base::ListValue);
if (PopListElements(&sub_reader, list_value.get()))
result = list_value.release();
}
« no previous file with comments | « dbus/test_service.cc ('k') | dbus/values_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698