OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.SplitView} | 7 * @extends {WebInspector.SplitView} |
8 */ | 8 */ |
9 WebInspector.TimelinePaintProfilerView = function() | 9 WebInspector.TimelinePaintProfilerView = function() |
10 { | 10 { |
(...skipping 18 matching lines...) Expand all Loading... |
29 WebInspector.TimelinePaintProfilerView.prototype = { | 29 WebInspector.TimelinePaintProfilerView.prototype = { |
30 wasShown: function() | 30 wasShown: function() |
31 { | 31 { |
32 if (this._updateWhenVisible) { | 32 if (this._updateWhenVisible) { |
33 this._updateWhenVisible = false; | 33 this._updateWhenVisible = false; |
34 this._update(); | 34 this._update(); |
35 } | 35 } |
36 }, | 36 }, |
37 | 37 |
38 /** | 38 /** |
39 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 39 * @param {?WebInspector.Target} target |
40 * @param {string} encodedPicture | 40 * @param {string} encodedPicture |
41 */ | 41 */ |
42 setPicture: function(weakTarget, encodedPicture) | 42 setPicture: function(target, encodedPicture) |
43 { | 43 { |
44 this._disposeSnapshot(); | 44 this._disposeSnapshot(); |
45 this._picture = encodedPicture; | 45 this._picture = encodedPicture; |
46 this._weakTarget = weakTarget; | 46 this._target = target; |
47 if (this.isShowing()) | 47 if (this.isShowing()) |
48 this._update(); | 48 this._update(); |
49 else | 49 else |
50 this._updateWhenVisible = true; | 50 this._updateWhenVisible = true; |
51 }, | 51 }, |
52 | 52 |
53 _update: function() | 53 _update: function() |
54 { | 54 { |
55 var target = this._weakTarget.get(); | 55 if (!this._target) |
56 if (!target) | |
57 return; | 56 return; |
58 WebInspector.PaintProfilerSnapshot.load(target, this._picture, onSnapsho
tLoaded.bind(this)); | 57 WebInspector.PaintProfilerSnapshot.load(this._target, this._picture, onS
napshotLoaded.bind(this)); |
59 /** | 58 /** |
60 * @param {?WebInspector.PaintProfilerSnapshot} snapshot | 59 * @param {?WebInspector.PaintProfilerSnapshot} snapshot |
61 * @this WebInspector.TimelinePaintProfilerView | 60 * @this WebInspector.TimelinePaintProfilerView |
62 */ | 61 */ |
63 function onSnapshotLoaded(snapshot) | 62 function onSnapshotLoaded(snapshot) |
64 { | 63 { |
65 this._disposeSnapshot(); | 64 this._disposeSnapshot(); |
66 this._lastLoadedSnapshot = snapshot; | 65 this._lastLoadedSnapshot = snapshot; |
67 snapshot.commandLog(onCommandLogDone.bind(this, snapshot)); | 66 snapshot.commandLog(onCommandLogDone.bind(this, snapshot)); |
68 } | 67 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 * @param {string=} imageURL | 140 * @param {string=} imageURL |
142 */ | 141 */ |
143 showImage: function(imageURL) | 142 showImage: function(imageURL) |
144 { | 143 { |
145 this._imageElement.classList.toggle("hidden", !imageURL); | 144 this._imageElement.classList.toggle("hidden", !imageURL); |
146 this._imageElement.src = imageURL; | 145 this._imageElement.src = imageURL; |
147 }, | 146 }, |
148 | 147 |
149 __proto__: WebInspector.View.prototype | 148 __proto__: WebInspector.View.prototype |
150 }; | 149 }; |
OLD | NEW |