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 <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 TraceEvent::TraceEvent(TraceEvent&& other) = default; | 29 TraceEvent::TraceEvent(TraceEvent&& other) = default; |
30 | 30 |
31 TraceEvent::~TraceEvent() { | 31 TraceEvent::~TraceEvent() { |
32 } | 32 } |
33 | 33 |
34 TraceEvent& TraceEvent::operator=(TraceEvent&& rhs) = default; | 34 TraceEvent& TraceEvent::operator=(TraceEvent&& rhs) = default; |
35 | 35 |
36 bool TraceEvent::SetFromJSON(const base::Value* event_value) { | 36 bool TraceEvent::SetFromJSON(const base::Value* event_value) { |
37 if (event_value->GetType() != base::Value::TYPE_DICTIONARY) { | 37 if (event_value->GetType() != base::Value::Type::DICTIONARY) { |
38 LOG(ERROR) << "Value must be TYPE_DICTIONARY"; | 38 LOG(ERROR) << "Value must be Type::DICTIONARY"; |
39 return false; | 39 return false; |
40 } | 40 } |
41 const base::DictionaryValue* dictionary = | 41 const base::DictionaryValue* dictionary = |
42 static_cast<const base::DictionaryValue*>(event_value); | 42 static_cast<const base::DictionaryValue*>(event_value); |
43 | 43 |
44 std::string phase_str; | 44 std::string phase_str; |
45 const base::DictionaryValue* args = NULL; | 45 const base::DictionaryValue* args = NULL; |
46 | 46 |
47 if (!dictionary->GetString("ph", &phase_str)) { | 47 if (!dictionary->GetString("ph", &phase_str)) { |
48 LOG(ERROR) << "ph is missing from TraceEvent JSON"; | 48 LOG(ERROR) << "ph is missing from TraceEvent JSON"; |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 end_position = (end_position < events.size()) ? end_position : events.size(); | 990 end_position = (end_position < events.size()) ? end_position : events.size(); |
991 size_t count = 0u; | 991 size_t count = 0u; |
992 for (size_t i = begin_position; i < end_position; ++i) { | 992 for (size_t i = begin_position; i < end_position; ++i) { |
993 if (query.Evaluate(*events.at(i))) | 993 if (query.Evaluate(*events.at(i))) |
994 ++count; | 994 ++count; |
995 } | 995 } |
996 return count; | 996 return count; |
997 } | 997 } |
998 | 998 |
999 } // namespace trace_analyzer | 999 } // namespace trace_analyzer |
OLD | NEW |