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