Web Inspector: discontinuous recordings should have discontinuities in the timeline...
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / Models / TimelineRecording.js
index 932568d..95e419f 100644 (file)
@@ -159,6 +159,7 @@ WebInspector.TimelineRecording = class TimelineRecording extends WebInspector.Ob
         this._eventMarkers = [];
         this._startTime = NaN;
         this._endTime = NaN;
+        this._discontinuities = [];
 
         this._topDownCallingContextTree.reset();
         this._bottomUpCallingContextTree.reset();
@@ -282,6 +283,16 @@ WebInspector.TimelineRecording = class TimelineRecording extends WebInspector.Ob
         memoryTimeline.addMemoryPressureEvent(memoryPressureEvent);
     }
 
+    addDiscontinuity(startTime, endTime)
+    {
+        this._discontinuities.push({startTime, endTime});
+    }
+
+    discontinuitiesInTimeRange(startTime, endTime)
+    {
+        return this._discontinuities.filter((item) => item.startTime < endTime && item.endTime > startTime);
+    }
+
     computeElapsedTime(timestamp)
     {
         if (!timestamp || isNaN(timestamp))