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

Unified Diff: runtime/vm/timeline.h

Issue 1545853002: Handle duration events when filtering the timeline for a time range (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/timeline.cc ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timeline.h
diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h
index e00aa07a1a1a2f1353a9f5a331dca678291ac636..8a744c9665305961ef07e269b43cc4a9daf69acf 100644
--- a/runtime/vm/timeline.h
+++ b/runtime/vm/timeline.h
@@ -162,7 +162,8 @@ class TimelineEvent {
}
bool IsFinishedDuration() const {
- return (event_type() == kDuration) && (timestamp1_ > timestamp0_);
+ return (SerializedJSONIsDuration() || (event_type() == kDuration)) &&
+ (timestamp1_ > timestamp0_);
}
int64_t TimeOrigin() const;
@@ -238,8 +239,19 @@ class TimelineEvent {
}
}
+ bool Within(int64_t time_origin_micros,
+ int64_t time_extent_micros);
+
const char* GetSerializedJSON() const;
+ void SetSerializedJSONIsDuration(bool duration) {
+ state_ = SerializedJSONIsDurationField::update(duration, state_);
+ }
+
+ bool SerializedJSONIsDuration() const {
+ return SerializedJSONIsDurationField::decode(state_);
+ }
+
private:
void FreeArguments();
@@ -263,10 +275,13 @@ class TimelineEvent {
enum StateBits {
kEventTypeBit = 0, // reserve 4 bits for type.
- kNextBit = 4,
+ kSerializedJSONIsDuration = 4,
+ kNextBit = 5,
};
class EventTypeField : public BitField<EventType, kEventTypeBit, 4> {};
+ class SerializedJSONIsDurationField :
+ public BitField<bool, kSerializedJSONIsDuration, 1> {};
int64_t timestamp0_;
int64_t timestamp1_;
@@ -544,7 +559,13 @@ class TimelineEventFilter : public ValueObject {
return event->IsValid();
}
- bool EventInTimeRange(TimelineEvent* event);
+ int64_t time_origin_micros() const {
+ return time_origin_micros_;
+ }
+
+ int64_t time_extent_micros() const {
+ return time_extent_micros_;
+ }
private:
int64_t time_origin_micros_;
« no previous file with comments | « runtime/lib/timeline.cc ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698