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

Unified Diff: runtime/vm/timeline.h

Issue 1765563002: Stream blocks of timeline events over the service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « runtime/vm/service_event.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 6dfc8d21d2a3df0c385452d74421264b112ef86c..002f8c9dc2f99018a53e4a24381d274777d86735 100644
--- a/runtime/vm/timeline.h
+++ b/runtime/vm/timeline.h
@@ -526,6 +526,8 @@ class TimelineEventBlock {
}
protected:
+ void PrintJSON(JSONStream* stream) const;
+
TimelineEvent* StartEvent();
TimelineEvent events_[kBlockSize];
@@ -545,6 +547,7 @@ class TimelineEventBlock {
friend class TimelineEventRingRecorder;
friend class TimelineEventEndlessRecorder;
friend class TimelineTestHelper;
+ friend class JSONStream;
private:
DISALLOW_COPY_AND_ASSIGN(TimelineEventBlock);
@@ -687,21 +690,22 @@ class TimelineEventRingRecorder : public TimelineEventRecorder {
};
-// An abstract recorder that calls |StreamEvent| whenever an event is complete.
-class TimelineEventStreamingRecorder : public TimelineEventRecorder {
+// An abstract recorder that calls |OnEvent| whenever an event is complete.
+// This should only be used for testing.
+class TimelineEventCallbackRecorder : public TimelineEventRecorder {
public:
- TimelineEventStreamingRecorder();
- ~TimelineEventStreamingRecorder();
+ TimelineEventCallbackRecorder();
+ ~TimelineEventCallbackRecorder();
void PrintJSON(JSONStream* js, TimelineEventFilter* filter);
void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter);
- // Called when |event| is ready to be streamed. It is unsafe to keep a
- // reference to |event| as it may be freed as soon as this function returns.
- virtual void StreamEvent(TimelineEvent* event) = 0;
+ // Called when |event| is completed. It is unsafe to keep a reference to
+ // |event| as it may be freed as soon as this function returns.
+ virtual void OnEvent(TimelineEvent* event) = 0;
const char* name() const {
- return "streaming";
+ return "callback";
}
protected:
« no previous file with comments | « runtime/vm/service_event.cc ('k') | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698