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

Side by Side Diff: base/debug/trace_event_unittest.cc

Issue 21030009: Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/json/json_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/debug/trace_event_unittest.h" 5 #include "base/debug/trace_event_unittest.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (!root.get()) { 142 if (!root.get()) {
143 LOG(ERROR) << json_output_.json_output; 143 LOG(ERROR) << json_output_.json_output;
144 } 144 }
145 145
146 ListValue* root_list = NULL; 146 ListValue* root_list = NULL;
147 ASSERT_TRUE(root.get()); 147 ASSERT_TRUE(root.get());
148 ASSERT_TRUE(root->GetAsList(&root_list)); 148 ASSERT_TRUE(root->GetAsList(&root_list));
149 149
150 // Move items into our aggregate collection 150 // Move items into our aggregate collection
151 while (root_list->GetSize()) { 151 while (root_list->GetSize()) {
152 Value* item = NULL; 152 scoped_ptr<Value> item;
153 root_list->Remove(0, &item); 153 root_list->Remove(0, &item);
154 trace_parsed_.Append(item); 154 trace_parsed_.Append(item.release());
155 } 155 }
156 } 156 }
157 157
158 static bool CompareJsonValues(const std::string& lhs, 158 static bool CompareJsonValues(const std::string& lhs,
159 const std::string& rhs, 159 const std::string& rhs,
160 CompareOp op) { 160 CompareOp op) {
161 switch (op) { 161 switch (op) {
162 case IS_EQUAL: 162 case IS_EQUAL:
163 return lhs == rhs; 163 return lhs == rhs;
164 case IS_NOT_EQUAL: 164 case IS_NOT_EQUAL:
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( 2015 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace(
2016 " bad_category ")); 2016 " bad_category "));
2017 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( 2017 EXPECT_TRUE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace(
2018 "")); 2018 ""));
2019 EXPECT_FALSE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace( 2019 EXPECT_FALSE(CategoryFilter::IsEmptyOrContainsLeadingOrTrailingWhitespace(
2020 "good_category")); 2020 "good_category"));
2021 } 2021 }
2022 2022
2023 } // namespace debug 2023 } // namespace debug
2024 } // namespace base 2024 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/json/json_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698