diff options
author | estade <estade@chromium.org> | 2015-05-12 11:11:50 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-12 18:12:00 +0000 |
commit | a68b0442058dc2c5e61177b88697d8a461667328 (patch) | |
tree | c78360424be712d325ff8f8ea428c2703d655899 /base/json | |
parent | 90e34895f20edf97693c14ac0ec6faf64dbdcd91 (diff) | |
download | chromium_src-a68b0442058dc2c5e61177b88697d8a461667328.zip chromium_src-a68b0442058dc2c5e61177b88697d8a461667328.tar.gz chromium_src-a68b0442058dc2c5e61177b88697d8a461667328.tar.bz2 |
More base::Values-related bare pointer -> scoped_ptr conversions
main change: Value::CreateNullValue returns a scoped_ptr
BUG=none
Review URL: https://codereview.chromium.org/1129083003
Cr-Commit-Position: refs/heads/master@{#329443}
Diffstat (limited to 'base/json')
-rw-r--r-- | base/json/json_parser.cc | 2 | ||||
-rw-r--r-- | base/json/json_writer_unittest.cc | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc index e9a27bc..4d79be3 100644 --- a/base/json/json_parser.cc +++ b/base/json/json_parser.cc @@ -932,7 +932,7 @@ Value* JSONParser::ConsumeLiteral() { return NULL; } NextNChars(kNullLen - 1); - return Value::CreateNullValue(); + return Value::CreateNullValue().release(); } default: ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1); diff --git a/base/json/json_writer_unittest.cc b/base/json/json_writer_unittest.cc index 802876c..5ac2590 100644 --- a/base/json/json_writer_unittest.cc +++ b/base/json/json_writer_unittest.cc @@ -12,8 +12,7 @@ TEST(JSONWriterTest, BasicTypes) { std::string output_js; // Test null. - scoped_ptr<Value> root(Value::CreateNullValue()); - EXPECT_TRUE(JSONWriter::Write(root.get(), &output_js)); + EXPECT_TRUE(JSONWriter::Write(Value::CreateNullValue().get(), &output_js)); EXPECT_EQ("null", output_js); // Test empty dict. @@ -57,7 +56,6 @@ TEST(JSONWriterTest, BasicTypes) { EXPECT_EQ("\"foo\"", output_js); } - TEST(JSONWriterTest, NestedTypes) { std::string output_js; |