| Index: base/json/json_reader.cc
|
| diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc
|
| index 3ab5f754b72072ce9964b3c8eeb156cc27f6bae4..983508cf4ff457f37b7061ef9e488d5f3f73dce7 100644
|
| --- a/base/json/json_reader.cc
|
| +++ b/base/json/json_reader.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/json/json_parser.h"
|
| #include "base/logging.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/values.h"
|
|
|
| namespace base {
|
| @@ -43,27 +44,28 @@ JSONReader::~JSONReader() {
|
| }
|
|
|
| // static
|
| -scoped_ptr<Value> JSONReader::Read(const StringPiece& json) {
|
| +std::unique_ptr<Value> JSONReader::Read(const StringPiece& json) {
|
| internal::JSONParser parser(JSON_PARSE_RFC);
|
| - return make_scoped_ptr(parser.Parse(json));
|
| + return WrapUnique(parser.Parse(json));
|
| }
|
|
|
| // static
|
| -scoped_ptr<Value> JSONReader::Read(const StringPiece& json, int options) {
|
| +std::unique_ptr<Value> JSONReader::Read(const StringPiece& json, int options) {
|
| internal::JSONParser parser(options);
|
| - return make_scoped_ptr(parser.Parse(json));
|
| + return WrapUnique(parser.Parse(json));
|
| }
|
|
|
|
|
| // static
|
| -scoped_ptr<Value> JSONReader::ReadAndReturnError(const StringPiece& json,
|
| - int options,
|
| - int* error_code_out,
|
| - std::string* error_msg_out,
|
| - int* error_line_out,
|
| - int* error_column_out) {
|
| +std::unique_ptr<Value> JSONReader::ReadAndReturnError(
|
| + const StringPiece& json,
|
| + int options,
|
| + int* error_code_out,
|
| + std::string* error_msg_out,
|
| + int* error_line_out,
|
| + int* error_column_out) {
|
| internal::JSONParser parser(options);
|
| - scoped_ptr<Value> root(parser.Parse(json));
|
| + std::unique_ptr<Value> root(parser.Parse(json));
|
| if (!root) {
|
| if (error_code_out)
|
| *error_code_out = parser.error_code();
|
| @@ -105,8 +107,8 @@ std::string JSONReader::ErrorCodeToString(JsonParseError error_code) {
|
| }
|
| }
|
|
|
| -scoped_ptr<Value> JSONReader::ReadToValue(const std::string& json) {
|
| - return make_scoped_ptr(parser_->Parse(json));
|
| +std::unique_ptr<Value> JSONReader::ReadToValue(const std::string& json) {
|
| + return WrapUnique(parser_->Parse(json));
|
| }
|
|
|
| JSONReader::JsonParseError JSONReader::error_code() const {
|
|
|