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

Unified Diff: third_party/libaddressinput/chromium/json.cc

Issue 1911823002: Convert //third_party from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update crashpad's README.chromium 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: third_party/libaddressinput/chromium/json.cc
diff --git a/third_party/libaddressinput/chromium/json.cc b/third_party/libaddressinput/chromium/json.cc
index 89c65bc17047cff6ed98df1d18170dc00e015216..535173f1f62b981ab127d27f7d0f2e0d864c9e72 100644
--- a/third_party/libaddressinput/chromium/json.cc
+++ b/third_party/libaddressinput/chromium/json.cc
@@ -5,11 +5,11 @@
#include "third_party/libaddressinput/src/cpp/src/util/json.h"
#include <map>
+#include <memory>
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "base/values.h"
@@ -20,14 +20,15 @@ namespace {
// Returns |json| parsed into a JSON dictionary. Sets |parser_error| to true if
// parsing failed.
-::scoped_ptr<const base::DictionaryValue> Parse(const std::string& json,
- bool* parser_error) {
+::std::unique_ptr<const base::DictionaryValue> Parse(const std::string& json,
+ bool* parser_error) {
DCHECK(parser_error);
- ::scoped_ptr<const base::DictionaryValue> result;
+ ::std::unique_ptr<const base::DictionaryValue> result;
// |json| is converted to a |c_str()| here because rapidjson and other parts
// of the standalone library use char* rather than std::string.
- ::scoped_ptr<const base::Value> parsed(base::JSONReader::Read(json.c_str()));
+ ::std::unique_ptr<const base::Value> parsed(
+ base::JSONReader::Read(json.c_str()));
*parser_error = !parsed || !parsed->IsType(base::Value::TYPE_DICTIONARY);
if (*parser_error)
@@ -74,7 +75,7 @@ class Json::JsonImpl {
explicit JsonImpl(const base::DictionaryValue& dict)
: parser_error_(false), dict_(dict) {}
- const ::scoped_ptr<const base::DictionaryValue> owned_;
+ const ::std::unique_ptr<const base::DictionaryValue> owned_;
bool parser_error_;
const base::DictionaryValue& dict_;
std::vector<const Json*> sub_dicts_;
« no previous file with comments | « third_party/libaddressinput/chromium/input_suggester.h ('k') | third_party/libaddressinput/chromium/storage_test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698