OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * @constructor | 8 * @constructor |
9 * @extends {WebInspector.VBox} | 9 * @extends {WebInspector.VBox} |
10 */ | 10 */ |
(...skipping 29 matching lines...) Expand all Loading... |
40 if (this._updateWhenVisible) { | 40 if (this._updateWhenVisible) { |
41 this._updateWhenVisible = false; | 41 this._updateWhenVisible = false; |
42 this._update(); | 42 this._update(); |
43 } | 43 } |
44 }, | 44 }, |
45 | 45 |
46 _update: function() | 46 _update: function() |
47 { | 47 { |
48 var layerTree; | 48 var layerTree; |
49 | 49 |
50 this._weakTarget = this._deferredLayerTree.weakTarget(); | 50 this._target = this._deferredLayerTree.target(); |
51 var originalTiles = this._paintTiles; | 51 var originalTiles = this._paintTiles; |
52 var tilesReadyBarrier = new CallbackBarrier(); | 52 var tilesReadyBarrier = new CallbackBarrier(); |
53 this._deferredLayerTree.resolve(tilesReadyBarrier.createCallback(onLayer
sReady)); | 53 this._deferredLayerTree.resolve(tilesReadyBarrier.createCallback(onLayer
sReady)); |
54 var target = this._weakTarget.get(); | 54 if (this._target) { |
55 if (target) { | |
56 for (var i = 0; this._paints && i < this._paints.length; ++i) | 55 for (var i = 0; this._paints && i < this._paints.length; ++i) |
57 WebInspector.PaintProfilerSnapshot.load(target, this._paints[i].
picture, tilesReadyBarrier.createCallback(onSnapshotLoaded.bind(this, this._pain
ts[i]))); | 56 WebInspector.PaintProfilerSnapshot.load(this._target, this._pain
ts[i].picture, tilesReadyBarrier.createCallback(onSnapshotLoaded.bind(this, this
._paints[i]))); |
58 } | 57 } |
59 tilesReadyBarrier.callWhenDone(onLayersAndTilesReady.bind(this)); | 58 tilesReadyBarrier.callWhenDone(onLayersAndTilesReady.bind(this)); |
60 | 59 |
61 /** | 60 /** |
62 * @param {!WebInspector.LayerTreeBase} resolvedLayerTree | 61 * @param {!WebInspector.LayerTreeBase} resolvedLayerTree |
63 */ | 62 */ |
64 function onLayersReady(resolvedLayerTree) | 63 function onLayersReady(resolvedLayerTree) |
65 { | 64 { |
66 layerTree = resolvedLayerTree; | 65 layerTree = resolvedLayerTree; |
67 } | 66 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 120 |
122 /** | 121 /** |
123 * @param {?WebInspector.DOMNode} node | 122 * @param {?WebInspector.DOMNode} node |
124 */ | 123 */ |
125 _toggleNodeHighlight: function(node) | 124 _toggleNodeHighlight: function(node) |
126 { | 125 { |
127 if (node) { | 126 if (node) { |
128 node.highlightForTwoSeconds(); | 127 node.highlightForTwoSeconds(); |
129 return; | 128 return; |
130 } | 129 } |
131 var target = this._weakTarget.get(); | 130 if (this._target) |
132 if (target) | 131 this._target.domModel.hideDOMNodeHighlight(); |
133 target.domModel.hideDOMNodeHighlight(); | |
134 | 132 |
135 }, | 133 }, |
136 | 134 |
137 /** | 135 /** |
138 * @param {!WebInspector.Event} event | 136 * @param {!WebInspector.Event} event |
139 */ | 137 */ |
140 _onObjectSelected: function(event) | 138 _onObjectSelected: function(event) |
141 { | 139 { |
142 var activeObject = /** @type {!WebInspector.Layers3DView.ActiveObject} *
/ (event.data); | 140 var activeObject = /** @type {!WebInspector.Layers3DView.ActiveObject} *
/ (event.data); |
143 this._selectObject(activeObject); | 141 this._selectObject(activeObject); |
(...skipping 10 matching lines...) Expand all Loading... |
154 | 152 |
155 _disposeTiles: function() | 153 _disposeTiles: function() |
156 { | 154 { |
157 for (var i = 0; i < this._paintTiles.length; ++i) | 155 for (var i = 0; i < this._paintTiles.length; ++i) |
158 this._paintTiles[i].snapshot.dispose(); | 156 this._paintTiles[i].snapshot.dispose(); |
159 this._paintTiles = []; | 157 this._paintTiles = []; |
160 }, | 158 }, |
161 | 159 |
162 __proto__: WebInspector.VBox.prototype | 160 __proto__: WebInspector.VBox.prototype |
163 } | 161 } |
OLD | NEW |