OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |