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

Unified Diff: runtime/vm/timeline.h

Issue 1295563002: Allow TimelineAnalysis to work on any TimelineEventRecorder (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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 ae6edbed0aacf71fa85f988ce6f01fc2fa033aec..e7c804a8309c8b7507cf72ac0eee26602f35dbae 100644
--- a/runtime/vm/timeline.h
+++ b/runtime/vm/timeline.h
@@ -348,6 +348,7 @@ class TimelineEventRecorder {
// Interface method(s) which must be implemented.
virtual void PrintJSON(JSONStream* js) = 0;
virtual TimelineEventBlock* GetNewBlock() = 0;
+ virtual TimelineEventBlock* GetHeadBlock() = 0;
void WriteTo(const char* directory);
@@ -362,6 +363,9 @@ class TimelineEventRecorder {
void PrintJSONMeta(JSONArray* array) const;
TimelineEvent* ThreadBlockStartEvent();
+ Mutex lock_;
+
+ friend class TimelineEventBlockIterator;
friend class TimelineStream;
friend class Isolate;
@@ -381,6 +385,7 @@ class TimelineEventRingRecorder : public TimelineEventRecorder {
void PrintJSON(JSONStream* js);
TimelineEventBlock* GetNewBlock();
+ TimelineEventBlock* GetHeadBlock();
protected:
void VisitObjectPointers(ObjectPointerVisitor* visitor);
@@ -397,7 +402,6 @@ class TimelineEventRingRecorder : public TimelineEventRecorder {
intptr_t capacity_;
intptr_t num_blocks_;
intptr_t block_cursor_;
- Mutex lock_;
};
@@ -409,7 +413,10 @@ class TimelineEventStreamingRecorder : public TimelineEventRecorder {
~TimelineEventStreamingRecorder();
void PrintJSON(JSONStream* js);
- virtual TimelineEventBlock* GetNewBlock() {
+ TimelineEventBlock* GetNewBlock() {
+ return NULL;
+ }
+ TimelineEventBlock* GetHeadBlock() {
return NULL;
}
@@ -438,6 +445,8 @@ class TimelineEventEndlessRecorder : public TimelineEventRecorder {
// Recorder owns the block and it should be filled by only one thread.
TimelineEventBlock* GetNewBlock();
+ TimelineEventBlock* GetHeadBlock();
+
// It is expected that this function is only called when an isolate is
// shutting itself down.
// NOTE: Calling this while threads are filling in their blocks is not safe
@@ -454,18 +463,15 @@ class TimelineEventEndlessRecorder : public TimelineEventRecorder {
TimelineEventBlock* GetNewBlockLocked();
void PrintJSONEvents(JSONArray* array) const;
- Mutex lock_;
TimelineEventBlock* head_;
intptr_t block_index_;
-
- friend class TimelineEventBlockIterator;
};
// An iterator for blocks.
class TimelineEventBlockIterator {
public:
- explicit TimelineEventBlockIterator(TimelineEventEndlessRecorder* recorder);
+ explicit TimelineEventBlockIterator(TimelineEventRecorder* recorder);
~TimelineEventBlockIterator();
void Reset();
@@ -477,7 +483,7 @@ class TimelineEventBlockIterator {
private:
TimelineEventBlock* current_;
- TimelineEventEndlessRecorder* recorder_;
+ TimelineEventRecorder* recorder_;
};
} // namespace dart
« 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