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

Unified Diff: services/catalog/entry.cc

Issue 1910673002: Convert //services from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « services/catalog/entry.h ('k') | services/catalog/entry_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/catalog/entry.cc
diff --git a/services/catalog/entry.cc b/services/catalog/entry.cc
index c501bfae40893655504478a2b48eca78fdcc0007..e61be21e9b4bf49b99c32a22af0b798fab8ef490 100644
--- a/services/catalog/entry.cc
+++ b/services/catalog/entry.cc
@@ -106,31 +106,31 @@ Entry::Entry(const std::string& name)
Entry::Entry(const Entry& other) = default;
Entry::~Entry() {}
-scoped_ptr<base::DictionaryValue> Entry::Serialize() const {
- scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue);
+std::unique_ptr<base::DictionaryValue> Entry::Serialize() const {
+ std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue);
value->SetInteger(Store::kManifestVersionKey, 1);
value->SetString(Store::kNameKey, name_);
value->SetString(Store::kDisplayNameKey, display_name_);
value->SetString(Store::kQualifierKey, qualifier_);
- scoped_ptr<base::DictionaryValue> spec(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> spec(new base::DictionaryValue);
- scoped_ptr<base::DictionaryValue> provided(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> provided(new base::DictionaryValue);
for (const auto& i : capabilities_.provided) {
- scoped_ptr<base::ListValue> interfaces(new base::ListValue);
+ std::unique_ptr<base::ListValue> interfaces(new base::ListValue);
for (const auto& interface_name : i.second)
interfaces->AppendString(interface_name);
provided->Set(i.first, std::move(interfaces));
}
spec->Set(Store::kCapabilities_ProvidedKey, std::move(provided));
- scoped_ptr<base::DictionaryValue> required(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> required(new base::DictionaryValue);
for (const auto& i : capabilities_.required) {
- scoped_ptr<base::DictionaryValue> request(new base::DictionaryValue);
- scoped_ptr<base::ListValue> classes(new base::ListValue);
+ std::unique_ptr<base::DictionaryValue> request(new base::DictionaryValue);
+ std::unique_ptr<base::ListValue> classes(new base::ListValue);
for (const auto& class_name : i.second.classes)
classes->AppendString(class_name);
request->Set(Store::kCapabilities_ClassesKey, std::move(classes));
- scoped_ptr<base::ListValue> interfaces(new base::ListValue);
+ std::unique_ptr<base::ListValue> interfaces(new base::ListValue);
for (const auto& interface_name : i.second.interfaces)
interfaces->AppendString(interface_name);
request->Set(Store::kCapabilities_InterfacesKey, std::move(interfaces));
@@ -143,8 +143,8 @@ scoped_ptr<base::DictionaryValue> Entry::Serialize() const {
}
// static
-scoped_ptr<Entry> Entry::Deserialize(const base::DictionaryValue& value) {
- scoped_ptr<Entry> entry(new Entry);
+std::unique_ptr<Entry> Entry::Deserialize(const base::DictionaryValue& value) {
+ std::unique_ptr<Entry> entry(new Entry);
int manifest_version = 0;
if (value.HasKey(Store::kManifestVersionKey))
CHECK(value.GetInteger(Store::kManifestVersionKey, &manifest_version));
@@ -188,7 +188,7 @@ scoped_ptr<Entry> Entry::Deserialize(const base::DictionaryValue& value) {
for (size_t i = 0; i < applications->GetSize(); ++i) {
const base::DictionaryValue* application = nullptr;
applications->GetDictionary(i, &application);
- scoped_ptr<Entry> child = Entry::Deserialize(*application);
+ std::unique_ptr<Entry> child = Entry::Deserialize(*application);
if (child) {
child->set_package(entry.get());
// Caller must assume ownership of these items.
« no previous file with comments | « services/catalog/entry.h ('k') | services/catalog/entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698