Use scoped_ptrs in JSONReader::Read functions.
There are many callers, so all could not be updated at once. The old version is renamed to JSONReader::DeprecatedRead, and a new version of JSONReader::Read that returns scoped_ptr takes its place.
Much of this patch was generated with sed. Some callsites of the form
scoped_ptr<Value> value(Read());
have been updated to
scoped_ptr<Value> value = Read();
but most Read() calls are simply converted to DeprecatedRead. Actually updating them is a TODO.
BUG=none
Review URL: https://codereview.chromium.org/1136643005
Cr-Commit-Position: refs/heads/master@{#331120}
diff --git a/chrome/browser/safe_json_parser_browsertest.cc b/chrome/browser/safe_json_parser_browsertest.cc
index f67e513d..b6c45377 100644
--- a/chrome/browser/safe_json_parser_browsertest.cc
+++ b/chrome/browser/safe_json_parser_browsertest.cc
@@ -35,8 +35,8 @@
message_loop_runner_ = new content::MessageLoopRunner;
std::string error;
- scoped_ptr<base::Value> value(base::JSONReader::ReadAndReturnError(
- json, base::JSON_PARSE_RFC, nullptr, &error));
+ scoped_ptr<base::Value> value = base::JSONReader::ReadAndReturnError(
+ json, base::JSON_PARSE_RFC, nullptr, &error);
SafeJsonParser::SuccessCallback success_callback;
SafeJsonParser::ErrorCallback error_callback;