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

Unified Diff: Source/devtools/front_end/timeline/TimelinePaintProfilerView.js

Issue 389563002: DevTools: make paint profiler target-aware (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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: Source/devtools/front_end/timeline/TimelinePaintProfilerView.js
diff --git a/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js b/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js
index 92965b7845ce14c790851933fa202a934c82fd5b..64dba21e37391b054cfc41025b89942e8a4aa6e6 100644
--- a/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js
+++ b/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js
@@ -29,36 +29,37 @@ WebInspector.TimelinePaintProfilerView = function()
WebInspector.TimelinePaintProfilerView.prototype = {
wasShown: function()
{
- this._innerSetPicture(this._picture);
+ if (this._updateWhenVisible) {
+ this._updateWhenVisible = false;
+ this._update();
+ }
},
/**
+ * @param {!WebInspector.Target} target
* @param {string} encodedPicture
*/
- setPicture: function(encodedPicture)
+ setPicture: function(target, encodedPicture)
{
- if (this._lastLoadedSnapshot) {
- this._lastLoadedSnapshot.dispose();
- this._lastLoadedSnapshot = null;
- }
+ this._disposeSnapshot();
this._picture = encodedPicture;
- if (!this.isShowing())
- return;
- this._innerSetPicture(this._picture);
+ this._target = target;
+ if (this.isShowing())
+ this._update();
+ else
+ this._updateWhenVisible = true;
},
- /**
- * @param {string} encodedPicture
- */
- _innerSetPicture: function(encodedPicture)
+ _update: function()
{
- WebInspector.PaintProfilerSnapshot.load(encodedPicture, onSnapshotLoaded.bind(this));
+ WebInspector.PaintProfilerSnapshot.load(this._target, this._picture, onSnapshotLoaded.bind(this));
/**
* @param {?WebInspector.PaintProfilerSnapshot} snapshot
* @this WebInspector.TimelinePaintProfilerView
*/
function onSnapshotLoaded(snapshot)
{
+ this._disposeSnapshot();
this._lastLoadedSnapshot = snapshot;
snapshot.commandLog(onCommandLogDone.bind(this, snapshot));
}
@@ -75,6 +76,14 @@ WebInspector.TimelinePaintProfilerView.prototype = {
}
},
+ _disposeSnapshot: function()
+ {
+ if (!this._lastLoadedSnapshot)
+ return;
+ this._lastLoadedSnapshot.dispose();
+ this._lastLoadedSnapshot = null;
+ },
+
_onWindowChanged: function()
{
var window = this._paintProfilerView.windowBoundaries();

Powered by Google App Engine
This is Rietveld 408576698