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

Unified Diff: chrome/browser/extensions/api/bluetooth_low_energy/utils.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header 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
Index: chrome/browser/extensions/api/bluetooth_low_energy/utils.cc
diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc b/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc
index 69cda098f9833d81f73ebd760e7ac84fcb2b32fa..c3b65d19d7afd52ae167bb3ba3ae29da03f2dd8c 100644
--- a/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc
+++ b/chrome/browser/extensions/api/bluetooth_low_energy/utils.cc
@@ -11,9 +11,9 @@ namespace bluetooth_low_energy {
namespace {
// Converts a list of CharacteristicProperty to a base::ListValue of strings.
-scoped_ptr<base::ListValue> CharacteristicPropertiesToValue(
+std::unique_ptr<base::ListValue> CharacteristicPropertiesToValue(
const std::vector<CharacteristicProperty> properties) {
- scoped_ptr<base::ListValue> property_list(new base::ListValue());
+ std::unique_ptr<base::ListValue> property_list(new base::ListValue());
for (std::vector<CharacteristicProperty>::const_iterator iter =
properties.begin();
iter != properties.end();
@@ -24,24 +24,25 @@ scoped_ptr<base::ListValue> CharacteristicPropertiesToValue(
} // namespace
-scoped_ptr<base::DictionaryValue> CharacteristicToValue(Characteristic* from) {
+std::unique_ptr<base::DictionaryValue> CharacteristicToValue(
+ Characteristic* from) {
// Copy the properties. Use Characteristic::ToValue to generate the result
// dictionary without the properties, to prevent json_schema_compiler from
// failing.
std::vector<CharacteristicProperty> properties = from->properties;
from->properties.clear();
- scoped_ptr<base::DictionaryValue> to = from->ToValue();
+ std::unique_ptr<base::DictionaryValue> to = from->ToValue();
to->SetWithoutPathExpansion(
"properties", CharacteristicPropertiesToValue(properties).release());
return to;
}
-scoped_ptr<base::DictionaryValue> DescriptorToValue(Descriptor* from) {
+std::unique_ptr<base::DictionaryValue> DescriptorToValue(Descriptor* from) {
// Copy the characteristic properties and set them later manually.
std::vector<CharacteristicProperty> properties =
from->characteristic.properties;
from->characteristic.properties.clear();
- scoped_ptr<base::DictionaryValue> to = from->ToValue();
+ std::unique_ptr<base::DictionaryValue> to = from->ToValue();
base::DictionaryValue* chrc_value = NULL;
to->GetDictionaryWithoutPathExpansion("characteristic", &chrc_value);

Powered by Google App Engine
This is Rietveld 408576698