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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineIRModel.js

Issue 1808063002: Timeline: move SegmentedRange into the WebInspector namespace and a file of its own (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved Segment around Created 4 years, 9 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
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineIRModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineIRModel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineIRModel.js
index ffaf571796d8e357e9247d0f2950a740b6ef7160..0f9331f4cf5b1bba2bc471bbdab09322ad7e3c66 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineIRModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineIRModel.js
@@ -82,7 +82,7 @@ WebInspector.TimelineIRModel.prototype = {
var animations = asyncEventsByGroup.get(groups.animation);
if (animations)
this._processAnimations(animations);
- var range = new SegmentedRange();
+ var range = new WebInspector.SegmentedRange();
range.appendRange(this._drags); // Drags take lower precedence than animation, as we can't detect them reliably.
range.appendRange(this._cssAnimations);
range.appendRange(this._scrolls);
@@ -129,7 +129,7 @@ WebInspector.TimelineIRModel.prototype = {
// FIXME: also process renderer fling events.
if (!flingStart)
break;
- this._scrolls.append(new Segment(flingStart.startTime, event.endTime, phases.Fling));
+ this._scrolls.append(new WebInspector.Segment(flingStart.startTime, event.endTime, phases.Fling));
flingStart = null;
break;
@@ -168,7 +168,7 @@ WebInspector.TimelineIRModel.prototype = {
this._drags.append(this._segmentForEvent(event, phases.Drag));
} else if (touchStart) {
firstTouchMove = event;
- this._responses.append(new Segment(touchStart.startTime, event.endTime, phases.Response));
+ this._responses.append(new WebInspector.Segment(touchStart.startTime, event.endTime, phases.Response));
}
break;
@@ -199,7 +199,7 @@ WebInspector.TimelineIRModel.prototype = {
case eventTypes.MouseWheel:
// Do not consider first MouseWheel as trace viewer's implementation does -- in case of MouseWheel it's not really special.
if (mouseWheel && canMerge(thresholdsMs.mouse, mouseWheel, event))
- this._scrolls.append(new Segment(mouseWheel.endTime, event.startTime, phases.Scroll));
+ this._scrolls.append(new WebInspector.Segment(mouseWheel.endTime, event.startTime, phases.Scroll));
this._scrolls.append(this._segmentForEvent(event, phases.Scroll));
mouseWheel = event;
break;
@@ -230,15 +230,15 @@ WebInspector.TimelineIRModel.prototype = {
/**
* @param {!WebInspector.TracingModel.AsyncEvent} event
* @param {!WebInspector.TimelineIRModel.Phases} phase
- * @return {!Segment}
+ * @return {!WebInspector.Segment}
*/
_segmentForEvent: function(event, phase)
{
- return new Segment(event.startTime, event.endTime, phase);
+ return new WebInspector.Segment(event.startTime, event.endTime, phase);
},
/**
- * @return {!Array<!Segment>}
+ * @return {!Array<!WebInspector.Segment>}
*/
interactionRecords: function()
{
@@ -250,15 +250,15 @@ WebInspector.TimelineIRModel.prototype = {
var thresholdsMs = WebInspector.TimelineIRModel._mergeThresholdsMs;
this._segments = [];
- this._drags = new SegmentedRange(merge.bind(null, thresholdsMs.mouse));
- this._cssAnimations = new SegmentedRange(merge.bind(null, thresholdsMs.animation));
- this._responses = new SegmentedRange(merge.bind(null, 0));
- this._scrolls = new SegmentedRange(merge.bind(null, thresholdsMs.animation));
+ this._drags = new WebInspector.SegmentedRange(merge.bind(null, thresholdsMs.mouse));
+ this._cssAnimations = new WebInspector.SegmentedRange(merge.bind(null, thresholdsMs.animation));
+ this._responses = new WebInspector.SegmentedRange(merge.bind(null, 0));
+ this._scrolls = new WebInspector.SegmentedRange(merge.bind(null, thresholdsMs.animation));
/**
* @param {number} threshold
- * @param {!Segment} first
- * @param {!Segment} second
+ * @param {!WebInspector.Segment} first
+ * @param {!WebInspector.Segment} second
*/
function merge(threshold, first, second)
{

Powered by Google App Engine
This is Rietveld 408576698