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

Unified Diff: base/json/json_value_converter.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 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 | « base/json/json_string_value_serializer.cc ('k') | base/json/json_value_converter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_value_converter.h
diff --git a/base/json/json_value_converter.h b/base/json/json_value_converter.h
index a1e0d5bb5a5a337b2b76d562b4eb6555b71d3aaf..4cca034f3320395127b9e7698b3f2b3cec416785 100644
--- a/base/json/json_value_converter.h
+++ b/base/json/json_value_converter.h
@@ -7,13 +7,13 @@
#include <stddef.h>
+#include <memory>
#include <string>
#include <vector>
#include "base/base_export.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/stl_util.h"
#include "base/strings/string16.h"
@@ -131,7 +131,7 @@ class FieldConverter : public FieldConverterBase<StructType> {
private:
FieldType StructType::* field_pointer_;
- scoped_ptr<ValueConverter<FieldType> > value_converter_;
+ std::unique_ptr<ValueConverter<FieldType>> value_converter_;
DISALLOW_COPY_AND_ASSIGN(FieldConverter);
};
@@ -266,7 +266,7 @@ class RepeatedValueConverter : public ValueConverter<ScopedVector<Element> > {
if (!list->Get(i, &element))
continue;
- scoped_ptr<Element> e(new Element);
+ std::unique_ptr<Element> e(new Element);
if (basic_converter_.Convert(*element, e.get())) {
field->push_back(e.release());
} else {
@@ -300,7 +300,7 @@ class RepeatedMessageConverter
if (!list->Get(i, &element))
continue;
- scoped_ptr<NestedType> nested(new NestedType);
+ std::unique_ptr<NestedType> nested(new NestedType);
if (converter_.Convert(*element, nested.get())) {
field->push_back(nested.release());
} else {
@@ -337,7 +337,7 @@ class RepeatedCustomValueConverter
if (!list->Get(i, &element))
continue;
- scoped_ptr<NestedType> nested(new NestedType);
+ std::unique_ptr<NestedType> nested(new NestedType);
if ((*convert_func_)(element, nested.get())) {
field->push_back(nested.release());
} else {
« no previous file with comments | « base/json/json_string_value_serializer.cc ('k') | base/json/json_value_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698