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

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

Issue 23189006: Ingnore unsupported arguments in TraceEventAnalyzer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 double double_num = 0.0; 87 double double_num = 0.0;
88 if (it.value().GetAsString(&str)) 88 if (it.value().GetAsString(&str))
89 arg_strings[it.key()] = str; 89 arg_strings[it.key()] = str;
90 else if (it.value().GetAsInteger(&int_num)) 90 else if (it.value().GetAsInteger(&int_num))
91 arg_numbers[it.key()] = static_cast<double>(int_num); 91 arg_numbers[it.key()] = static_cast<double>(int_num);
92 else if (it.value().GetAsBoolean(&boolean)) 92 else if (it.value().GetAsBoolean(&boolean))
93 arg_numbers[it.key()] = static_cast<double>(boolean ? 1 : 0); 93 arg_numbers[it.key()] = static_cast<double>(boolean ? 1 : 0);
94 else if (it.value().GetAsDouble(&double_num)) 94 else if (it.value().GetAsDouble(&double_num))
95 arg_numbers[it.key()] = double_num; 95 arg_numbers[it.key()] = double_num;
96 else { 96 else {
97 LOG(ERROR) << "Value type of argument is not supported: " << 97 LOG(WARNING) << "Value type of argument is not supported: " <<
98 static_cast<int>(it.value().GetType()); 98 static_cast<int>(it.value().GetType());
99 return false; // Invalid trace event JSON format. 99 continue; // Skip non-supported arguments.
100 } 100 }
101 } 101 }
102 102
103 return true; 103 return true;
104 } 104 }
105 105
106 double TraceEvent::GetAbsTimeToOtherEvent() const { 106 double TraceEvent::GetAbsTimeToOtherEvent() const {
107 return fabs(other_event->timestamp - timestamp); 107 return fabs(other_event->timestamp - timestamp);
108 } 108 }
109 109
(...skipping 844 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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698