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

Side by Side Diff: base/test/trace_event_analyzer.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/sys_info_posix.cc ('k') | base/test/trace_event_analyzer_unittest.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/test/trace_event_analyzer.h" 5 #include "base/test/trace_event_analyzer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <math.h> 8 #include <math.h>
9 #include <set> 9 #include <set>
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 bool TraceEvent::HasNumberArg(const std::string& name) const { 134 bool TraceEvent::HasNumberArg(const std::string& name) const {
135 return (arg_numbers.find(name) != arg_numbers.end()); 135 return (arg_numbers.find(name) != arg_numbers.end());
136 } 136 }
137 137
138 std::string TraceEvent::GetKnownArgAsString(const std::string& name) const { 138 std::string TraceEvent::GetKnownArgAsString(const std::string& name) const {
139 std::string arg_string; 139 std::string arg_string;
140 if (GetArgAsString(name, &arg_string)) 140 if (GetArgAsString(name, &arg_string))
141 return arg_string; 141 return arg_string;
142 NOTREACHED(); 142 NOTREACHED();
143 return ""; 143 return std::string();
144 } 144 }
145 145
146 double TraceEvent::GetKnownArgAsDouble(const std::string& name) const { 146 double TraceEvent::GetKnownArgAsDouble(const std::string& name) const {
147 double arg_double; 147 double arg_double;
148 if (GetArgAsNumber(name, &arg_double)) 148 if (GetArgAsNumber(name, &arg_double))
149 return arg_double; 149 return arg_double;
150 NOTREACHED(); 150 NOTREACHED();
151 return 0; 151 return 0;
152 } 152 }
153 153
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 end_position = (end_position < events.size()) ? end_position : events.size(); 954 end_position = (end_position < events.size()) ? end_position : events.size();
955 size_t count = 0u; 955 size_t count = 0u;
956 for (size_t i = begin_position; i < end_position; ++i) { 956 for (size_t i = begin_position; i < end_position; ++i) {
957 if (query.Evaluate(*events.at(i))) 957 if (query.Evaluate(*events.at(i)))
958 ++count; 958 ++count;
959 } 959 }
960 return count; 960 return count;
961 } 961 }
962 962
963 } // namespace trace_analyzer 963 } // namespace trace_analyzer
OLDNEW
« no previous file with comments | « base/sys_info_posix.cc ('k') | base/test/trace_event_analyzer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698