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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 | « base/json/json_writer.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 <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
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
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
OLDNEW
« no previous file with comments | « base/json/json_writer.cc ('k') | base/test/trace_event_analyzer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698