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

Side by Side Diff: runtime/vm/timeline.h

Issue 1297443002: Improve timeline iterators and tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | runtime/vm/timeline.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_TIMELINE_H_ 5 #ifndef VM_TIMELINE_H_
6 #define VM_TIMELINE_H_ 6 #define VM_TIMELINE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/bitfield.h" 9 #include "vm/bitfield.h"
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 int64_t TimeOrigin() const; 84 int64_t TimeOrigin() const;
85 int64_t AsyncId() const; 85 int64_t AsyncId() const;
86 int64_t TimeDuration() const; 86 int64_t TimeDuration() const;
87 87
88 void PrintJSON(JSONStream* stream) const; 88 void PrintJSON(JSONStream* stream) const;
89 89
90 ThreadId thread() const { 90 ThreadId thread() const {
91 return thread_; 91 return thread_;
92 } 92 }
93 93
94 const char* label() const {
95 return label_;
96 }
97
94 private: 98 private:
95 struct TimelineEventArgument { 99 struct TimelineEventArgument {
96 const char* name; 100 const char* name;
97 char* value; 101 char* value;
98 }; 102 };
99 103
100 int64_t timestamp0_; 104 int64_t timestamp0_;
101 int64_t timestamp1_; 105 int64_t timestamp1_;
102 TimelineEventArgument* arguments_; 106 TimelineEventArgument* arguments_;
103 intptr_t arguments_length_; 107 intptr_t arguments_length_;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 intptr_t block_index_; 472 intptr_t block_index_;
469 }; 473 };
470 474
471 475
472 // An iterator for blocks. 476 // An iterator for blocks.
473 class TimelineEventBlockIterator { 477 class TimelineEventBlockIterator {
474 public: 478 public:
475 explicit TimelineEventBlockIterator(TimelineEventRecorder* recorder); 479 explicit TimelineEventBlockIterator(TimelineEventRecorder* recorder);
476 ~TimelineEventBlockIterator(); 480 ~TimelineEventBlockIterator();
477 481
478 void Reset(); 482 void Reset(TimelineEventRecorder* recorder);
479 bool Next();
480 483
481 TimelineEventBlock* current() const { 484 // Returns false when there are no more blocks.
482 return current_; 485 bool HasNext() const;
483 } 486
487 // Returns the next block and moves forward.
488 TimelineEventBlock* Next();
484 489
485 private: 490 private:
486 TimelineEventBlock* current_; 491 TimelineEventBlock* current_;
487 TimelineEventRecorder* recorder_; 492 TimelineEventRecorder* recorder_;
488 }; 493 };
489 494
490 } // namespace dart 495 } // namespace dart
491 496
492 #endif // VM_TIMELINE_H_ 497 #endif // VM_TIMELINE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698