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

Unified Diff: chrome/common/json_value_serializer_perftest.cc

Issue 16270: Change the signature of JSONReader::Read() and related methods to be more (Closed)
Patch Set: fixens Created 12 years 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: chrome/common/json_value_serializer_perftest.cc
diff --git a/chrome/common/json_value_serializer_perftest.cc b/chrome/common/json_value_serializer_perftest.cc
index 6570d34109f9840296eac1399a0c31137eab9a41..bef8fbefc4f5e8eaa0407ef9c679b557ac14e899 100644
--- a/chrome/common/json_value_serializer_perftest.cc
+++ b/chrome/common/json_value_serializer_perftest.cc
@@ -52,10 +52,9 @@ TEST_F(JSONValueSerializerTests, Reading) {
PerfTimeLogger chrome_timer("chrome");
for (int i = 0; i < kIterations; ++i) {
for (size_t j = 0; j < test_cases_.size(); ++j) {
- Value* root = NULL;
JSONStringValueSerializer reader(test_cases_[j]);
- ASSERT_TRUE(reader.Deserialize(&root, NULL));
- delete root;
+ scoped_ptr<Value> root(reader.Deserialize(NULL));
+ ASSERT_TRUE(root.get());
}
}
chrome_timer.Done();
@@ -67,9 +66,9 @@ TEST_F(JSONValueSerializerTests, CompactWriting) {
// Convert test cases to Value objects.
std::vector<Value*> test_cases;
for (size_t i = 0; i < test_cases_.size(); ++i) {
- Value* root = NULL;
JSONStringValueSerializer reader(test_cases_[i]);
- ASSERT_TRUE(reader.Deserialize(&root, NULL));
+ Value* root = reader.Deserialize(NULL);
+ ASSERT_TRUE(root);
test_cases.push_back(root);
}

Powered by Google App Engine
This is Rietveld 408576698