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

Unified Diff: Source/devtools/front_end/components/FlameChart.js

Issue 696703003: DevTools: implement search for CPUProfiler FlameChart view (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test was rebaselined Created 6 years, 1 month 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: Source/devtools/front_end/components/FlameChart.js
diff --git a/Source/devtools/front_end/components/FlameChart.js b/Source/devtools/front_end/components/FlameChart.js
index 42637d929c50adde4bc15073d3f64c945ea50812..ec64628fccfd1066c8a19637750d204ec5683e09 100644
--- a/Source/devtools/front_end/components/FlameChart.js
+++ b/Source/devtools/front_end/components/FlameChart.js
@@ -440,6 +440,29 @@ WebInspector.FlameChart.prototype = {
}
},
+ _revealEntry: function(entryIndex)
+ {
+ var timelineData = this._timelineData();
yurys 2014/11/06 11:39:58 Should we check for null data like in some other p
loislo 2014/11/09 15:32:57 Done.
+ var entryStartTime = timelineData.entryStartTimes[entryIndex];
+ var entryTotalTime = timelineData.entryTotalTimes[entryIndex];
+ var entryEndTime = entryStartTime + entryTotalTime;
+ var minEntryTimeWindow = Math.min(entryTotalTime, this._timeWindowRight - this._timeWindowLeft);
+
+ var y = this._levelToHeight(timelineData.entryLevels[entryIndex]);
+ if (y < this._vScrollElement.scrollTop)
+ this._vScrollElement.scrollTop = y;
yurys 2014/11/06 11:39:58 Did you consider scrolling it so that selected bar
+ else if (y > this._vScrollElement.scrollTop + this._offsetHeight + this._barHeightDelta)
+ this._vScrollElement.scrollTop = y - this._offsetHeight - this._barHeightDelta;
+
+ if (this._timeWindowLeft > entryEndTime) {
+ var delta = this._timeWindowLeft - entryEndTime + minEntryTimeWindow;
yurys 2014/11/06 11:39:58 How about delta = this._timeWindowLeft - entrySta
loislo 2014/11/09 15:32:57 The idea is to do the minimal scrolling but show a
+ this._flameChartDelegate.requestWindowTimes(this._timeWindowLeft - delta, this._timeWindowRight - delta);
+ } else if (this._timeWindowRight < entryStartTime) {
+ var delta = entryStartTime - this._timeWindowRight + minEntryTimeWindow;
yurys 2014/11/06 11:39:58 Maybe delta = entryStartTime - this._timeWindowLef
loislo 2014/11/09 15:32:57 ditto
+ this._flameChartDelegate.requestWindowTimes(this._timeWindowLeft + delta, this._timeWindowRight + delta);
+ }
+ },
+
/**
* @param {number} startTime
* @param {number} endTime
@@ -1093,6 +1116,7 @@ WebInspector.FlameChart.prototype = {
setSelectedEntry: function(entryIndex)
{
this._selectedEntryIndex = entryIndex;
+ this._revealEntry(entryIndex);
this._updateElementPosition(this._selectedElement, this._selectedEntryIndex);
},

Powered by Google App Engine
This is Rietveld 408576698