| 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..90accd5efb9dfe9e742f1d9ceafb418659f4cdc3 100644
|
| --- a/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js
|
| +++ b/Source/devtools/front_end/timeline/TimelinePaintProfilerView.js
|
| @@ -29,36 +29,40 @@ WebInspector.TimelinePaintProfilerView = function()
|
| WebInspector.TimelinePaintProfilerView.prototype = {
|
| wasShown: function()
|
| {
|
| - this._innerSetPicture(this._picture);
|
| + if (this._updateWhenVisible) {
|
| + this._updateWhenVisible = false;
|
| + this._update();
|
| + }
|
| },
|
|
|
| /**
|
| + * @param {!WeakReference.<!WebInspector.Target>} weakTarget
|
| * @param {string} encodedPicture
|
| */
|
| - setPicture: function(encodedPicture)
|
| + setPicture: function(weakTarget, encodedPicture)
|
| {
|
| - if (this._lastLoadedSnapshot) {
|
| - this._lastLoadedSnapshot.dispose();
|
| - this._lastLoadedSnapshot = null;
|
| - }
|
| + this._disposeSnapshot();
|
| this._picture = encodedPicture;
|
| - if (!this.isShowing())
|
| - return;
|
| - this._innerSetPicture(this._picture);
|
| + this._weakTarget = weakTarget;
|
| + if (this.isShowing())
|
| + this._update();
|
| + else
|
| + this._updateWhenVisible = true;
|
| },
|
|
|
| - /**
|
| - * @param {string} encodedPicture
|
| - */
|
| - _innerSetPicture: function(encodedPicture)
|
| + _update: function()
|
| {
|
| - WebInspector.PaintProfilerSnapshot.load(encodedPicture, onSnapshotLoaded.bind(this));
|
| + var target = this._weakTarget.get();
|
| + if (!target)
|
| + return;
|
| + WebInspector.PaintProfilerSnapshot.load(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 +79,14 @@ WebInspector.TimelinePaintProfilerView.prototype = {
|
| }
|
| },
|
|
|
| + _disposeSnapshot: function()
|
| + {
|
| + if (!this._lastLoadedSnapshot)
|
| + return;
|
| + this._lastLoadedSnapshot.dispose();
|
| + this._lastLoadedSnapshot = null;
|
| + },
|
| +
|
| _onWindowChanged: function()
|
| {
|
| var window = this._paintProfilerView.windowBoundaries();
|
|
|