OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 */ | 42 */ |
43 WebInspector.TracingLayerPayload; | 43 WebInspector.TracingLayerPayload; |
44 | 44 |
45 /** | 45 /** |
46 * @constructor | 46 * @constructor |
47 * @extends {WebInspector.SDKObject} | 47 * @extends {WebInspector.SDKObject} |
48 */ | 48 */ |
49 WebInspector.LayerTreeModel = function(target) | 49 WebInspector.LayerTreeModel = function(target) |
50 { | 50 { |
51 WebInspector.SDKObject.call(this, target); | 51 WebInspector.SDKObject.call(this, target); |
52 InspectorBackend.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispa tcher(this)); | 52 target.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispatcher(this )); |
53 target.domModel.addEventListener(WebInspector.DOMModel.Events.DocumentUpdate d, this._onDocumentUpdated, this); | 53 target.domModel.addEventListener(WebInspector.DOMModel.Events.DocumentUpdate d, this._onDocumentUpdated, this); |
54 /** @type {?WebInspector.LayerTreeBase} */ | 54 /** @type {?WebInspector.LayerTreeBase} */ |
55 this._layerTree = null; | 55 this._layerTree = null; |
56 } | 56 } |
57 | 57 |
58 WebInspector.LayerTreeModel.Events = { | 58 WebInspector.LayerTreeModel.Events = { |
59 LayerTreeChanged: "LayerTreeChanged", | 59 LayerTreeChanged: "LayerTreeChanged", |
60 LayerPainted: "LayerPainted", | 60 LayerPainted: "LayerPainted", |
61 } | 61 } |
62 | 62 |
63 WebInspector.LayerTreeModel.ScrollRectType = { | 63 WebInspector.LayerTreeModel.ScrollRectType = { |
64 NonFastScrollable: {name: "NonFastScrollable", description: "Non fast scroll able"}, | 64 NonFastScrollable: {name: "NonFastScrollable", description: "Non fast scroll able"}, |
65 TouchEventHandler: {name: "TouchEventHandler", description: "Touch event han dler"}, | 65 TouchEventHandler: {name: "TouchEventHandler", description: "Touch event han dler"}, |
66 WheelEventHandler: {name: "WheelEventHandler", description: "Wheel event han dler"}, | 66 WheelEventHandler: {name: "WheelEventHandler", description: "Wheel event han dler"}, |
67 RepaintsOnScroll: {name: "RepaintsOnScroll", description: "Repaints on scrol l"} | 67 RepaintsOnScroll: {name: "RepaintsOnScroll", description: "Repaints on scrol l"} |
68 } | 68 } |
69 | 69 |
70 WebInspector.LayerTreeModel.prototype = { | 70 WebInspector.LayerTreeModel.prototype = { |
71 disable: function() | 71 disable: function() |
72 { | 72 { |
73 if (!this._enabled) | 73 if (!this._enabled) |
74 return; | 74 return; |
75 this._enabled = false; | 75 this._enabled = false; |
76 this._layerTree = null; | 76 this._layerTree = null; |
77 LayerTreeAgent.disable(); | 77 this.target().layerTreeAgent().disable(); |
78 }, | 78 }, |
79 | 79 |
80 enable: function() | 80 enable: function() |
81 { | 81 { |
82 if (this._enabled) | 82 if (this._enabled) |
83 return; | 83 return; |
84 this._enabled = true; | 84 this._enabled = true; |
85 this._layerTree = new WebInspector.AgentLayerTree(this.target().weakRefe rence()); | 85 this._layerTree = new WebInspector.AgentLayerTree(this.target()); |
86 this._lastPaintRectByLayerId = {}; | 86 this._lastPaintRectByLayerId = {}; |
87 LayerTreeAgent.enable(); | 87 this.target().layerTreeAgent().enable(); |
88 }, | 88 }, |
89 | 89 |
90 /** | 90 /** |
91 * @param {!WebInspector.LayerTreeBase} layerTree | 91 * @param {!WebInspector.LayerTreeBase} layerTree |
92 */ | 92 */ |
93 setLayerTree: function(layerTree) | 93 setLayerTree: function(layerTree) |
94 { | 94 { |
95 this.disable(); | 95 this.disable(); |
96 this._layerTree = layerTree; | 96 this._layerTree = layerTree; |
97 this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTr eeChanged); | 97 this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTr eeChanged); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 return; | 156 return; |
157 this.disable(); | 157 this.disable(); |
158 this.enable(); | 158 this.enable(); |
159 }, | 159 }, |
160 | 160 |
161 __proto__: WebInspector.SDKObject.prototype | 161 __proto__: WebInspector.SDKObject.prototype |
162 } | 162 } |
163 | 163 |
164 /** | 164 /** |
165 * @constructor | 165 * @constructor |
166 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 166 * @param {?WebInspector.Target} target |
167 */ | 167 */ |
168 WebInspector.LayerTreeBase = function(weakTarget) | 168 WebInspector.LayerTreeBase = function(target) |
169 { | 169 { |
170 this._weakTarget = weakTarget; | 170 this._target = target; |
171 this._layersById = {}; | 171 this._layersById = {}; |
172 this._backendNodeIdToNodeId = {}; | 172 this._backendNodeIdToNodeId = {}; |
173 this._reset(); | 173 this._reset(); |
174 } | 174 } |
175 | 175 |
176 WebInspector.LayerTreeBase.prototype = { | 176 WebInspector.LayerTreeBase.prototype = { |
177 _reset: function() | 177 _reset: function() |
178 { | 178 { |
179 this._root = null; | 179 this._root = null; |
180 this._contentRoot = null; | 180 this._contentRoot = null; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
219 { | 219 { |
220 return this._layersById[id] || null; | 220 return this._layersById[id] || null; |
221 }, | 221 }, |
222 | 222 |
223 /** | 223 /** |
224 * @param {!Array.<number>} requestedNodeIds | 224 * @param {!Array.<number>} requestedNodeIds |
225 * @param {function()} callback | 225 * @param {function()} callback |
226 */ | 226 */ |
227 _resolveBackendNodeIds: function(requestedNodeIds, callback) | 227 _resolveBackendNodeIds: function(requestedNodeIds, callback) |
228 { | 228 { |
229 var target = this._weakTarget.get(); | 229 if (!requestedNodeIds.length || !this._target) { |
230 if (!requestedNodeIds.length || !target) { | |
231 callback(); | 230 callback(); |
232 return; | 231 return; |
233 } | 232 } |
234 | 233 |
235 target.domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds, popula teBackendNodeIdMap.bind(this)); | 234 this._target.domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds, populateBackendNodeIdMap.bind(this)); |
236 | 235 |
237 /** | 236 /** |
238 * @this {WebInspector.LayerTreeBase} | 237 * @this {WebInspector.LayerTreeBase} |
239 * @param {?Array.<number>} nodeIds | 238 * @param {?Array.<number>} nodeIds |
240 */ | 239 */ |
241 function populateBackendNodeIdMap(nodeIds) | 240 function populateBackendNodeIdMap(nodeIds) |
242 { | 241 { |
243 if (nodeIds) { | 242 if (nodeIds) { |
244 for (var i = 0; i < requestedNodeIds.length; ++i) { | 243 for (var i = 0; i < requestedNodeIds.length; ++i) { |
245 var nodeId = nodeIds[i]; | 244 var nodeId = nodeIds[i]; |
(...skipping 20 matching lines...) Expand all Loading... | |
266 { | 265 { |
267 return this._viewportSize; | 266 return this._viewportSize; |
268 }, | 267 }, |
269 | 268 |
270 /** | 269 /** |
271 * @param {number} id | 270 * @param {number} id |
272 * @return {?WebInspector.DOMNode} | 271 * @return {?WebInspector.DOMNode} |
273 */ | 272 */ |
274 _nodeForId: function(id) | 273 _nodeForId: function(id) |
275 { | 274 { |
276 var target = this._weakTarget.get(); | 275 return this._target ? this._target.domModel.nodeForId(id) : null; |
277 return target ? target.domModel.nodeForId(id) : null; | |
278 } | 276 } |
279 }; | 277 }; |
280 | 278 |
281 /** | 279 /** |
282 * @constructor | 280 * @constructor |
283 * @extends {WebInspector.LayerTreeBase} | 281 * @extends {WebInspector.LayerTreeBase} |
284 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 282 * @param {?WebInspector.Target} target |
285 */ | 283 */ |
286 WebInspector.TracingLayerTree = function(weakTarget) | 284 WebInspector.TracingLayerTree = function(target) |
287 { | 285 { |
288 WebInspector.LayerTreeBase.call(this, weakTarget); | 286 WebInspector.LayerTreeBase.call(this, target); |
289 } | 287 } |
290 | 288 |
291 WebInspector.TracingLayerTree.prototype = { | 289 WebInspector.TracingLayerTree.prototype = { |
292 /** | 290 /** |
293 * @param {!WebInspector.TracingLayerPayload} root | 291 * @param {!WebInspector.TracingLayerPayload} root |
294 * @param {!function()} callback | 292 * @param {!function()} callback |
295 */ | 293 */ |
296 setLayers: function(root, callback) | 294 setLayers: function(root, callback) |
297 { | 295 { |
298 var idsToResolve = []; | 296 var idsToResolve = []; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 } | 348 } |
351 for (var i = 0; payload.children && i < payload.children.length; ++i) | 349 for (var i = 0; payload.children && i < payload.children.length; ++i) |
352 this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload .children[i]); | 350 this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload .children[i]); |
353 }, | 351 }, |
354 | 352 |
355 __proto__: WebInspector.LayerTreeBase.prototype | 353 __proto__: WebInspector.LayerTreeBase.prototype |
356 } | 354 } |
357 | 355 |
358 /** | 356 /** |
359 * @constructor | 357 * @constructor |
360 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 358 * @param {?WebInspector.Target} target |
361 * @extends {WebInspector.LayerTreeBase} | 359 * @extends {WebInspector.LayerTreeBase} |
362 */ | 360 */ |
363 WebInspector.AgentLayerTree = function(weakTarget) | 361 WebInspector.AgentLayerTree = function(target) |
364 { | 362 { |
365 WebInspector.LayerTreeBase.call(this, weakTarget); | 363 WebInspector.LayerTreeBase.call(this, target); |
366 } | 364 } |
367 | 365 |
368 WebInspector.AgentLayerTree.prototype = { | 366 WebInspector.AgentLayerTree.prototype = { |
369 /** | 367 /** |
370 * @param {?Array.<!LayerTreeAgent.Layer>} payload | 368 * @param {?Array.<!LayerTreeAgent.Layer>} payload |
371 * @param {function()} callback | 369 * @param {function()} callback |
372 */ | 370 */ |
373 setLayers: function(payload, callback) | 371 setLayers: function(payload, callback) |
374 { | 372 { |
375 if (!payload) { | 373 if (!payload) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
410 if (!layers) | 408 if (!layers) |
411 return; | 409 return; |
412 var oldLayersById = this._layersById; | 410 var oldLayersById = this._layersById; |
413 this._layersById = {}; | 411 this._layersById = {}; |
414 for (var i = 0; i < layers.length; ++i) { | 412 for (var i = 0; i < layers.length; ++i) { |
415 var layerId = layers[i].layerId; | 413 var layerId = layers[i].layerId; |
416 var layer = oldLayersById[layerId]; | 414 var layer = oldLayersById[layerId]; |
417 if (layer) | 415 if (layer) |
418 layer._reset(layers[i]); | 416 layer._reset(layers[i]); |
419 else | 417 else |
420 layer = new WebInspector.AgentLayer(this._weakTarget, layers[i]) ; | 418 layer = new WebInspector.AgentLayer(this._target, layers[i]); |
421 this._layersById[layerId] = layer; | 419 this._layersById[layerId] = layer; |
422 if (layers[i].backendNodeId) { | 420 if (layers[i].backendNodeId) { |
423 layer._setNode(this._nodeForId(this._backendNodeIdToNodeId[layer s[i].backendNodeId])); | 421 layer._setNode(this._nodeForId(this._backendNodeIdToNodeId[layer s[i].backendNodeId])); |
424 if (!this._contentRoot) | 422 if (!this._contentRoot) |
425 this._contentRoot = layer; | 423 this._contentRoot = layer; |
426 } | 424 } |
427 var parentId = layer.parentId(); | 425 var parentId = layer.parentId(); |
428 if (parentId) { | 426 if (parentId) { |
429 var parent = this._layersById[parentId]; | 427 var parent = this._layersById[parentId]; |
430 if (!parent) | 428 if (!parent) |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
553 | 551 |
554 /** | 552 /** |
555 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback | 553 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback |
556 */ | 554 */ |
557 requestSnapshot: function(callback) { }, | 555 requestSnapshot: function(callback) { }, |
558 } | 556 } |
559 | 557 |
560 /** | 558 /** |
561 * @constructor | 559 * @constructor |
562 * @implements {WebInspector.Layer} | 560 * @implements {WebInspector.Layer} |
563 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 561 * @param {?WebInspector.Target} target |
564 * @param {!LayerTreeAgent.Layer} layerPayload | 562 * @param {!LayerTreeAgent.Layer} layerPayload |
565 */ | 563 */ |
566 WebInspector.AgentLayer = function(weakTarget, layerPayload) | 564 WebInspector.AgentLayer = function(target, layerPayload) |
567 { | 565 { |
568 this._weakTarget = weakTarget; | 566 this._target = target; |
569 this._reset(layerPayload); | 567 this._reset(layerPayload); |
570 } | 568 } |
571 | 569 |
572 WebInspector.AgentLayer.prototype = { | 570 WebInspector.AgentLayer.prototype = { |
573 /** | 571 /** |
574 * @return {string} | 572 * @return {string} |
575 */ | 573 */ |
576 id: function() | 574 id: function() |
577 { | 575 { |
578 return this._layerPayload.layerId; | 576 return this._layerPayload.layerId; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
739 scrollRects: function() | 737 scrollRects: function() |
740 { | 738 { |
741 return this._scrollRects; | 739 return this._scrollRects; |
742 }, | 740 }, |
743 | 741 |
744 /** | 742 /** |
745 * @param {function(!Array.<string>)} callback | 743 * @param {function(!Array.<string>)} callback |
746 */ | 744 */ |
747 requestCompositingReasons: function(callback) | 745 requestCompositingReasons: function(callback) |
748 { | 746 { |
747 if (!this._target) | |
caseq
2014/07/17 14:41:18
We normally invoke callbacks if we fail early (pas
sergeyv
2014/07/17 15:09:22
Done.
| |
748 return; | |
749 | |
749 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay erTreeAgent.reasonsForCompositingLayer(): ", undefined, []); | 750 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay erTreeAgent.reasonsForCompositingLayer(): ", undefined, []); |
750 LayerTreeAgent.compositingReasons(this.id(), wrappedCallback); | 751 this._target.layerTreeAgent().compositingReasons(this.id(), wrappedCallb ack); |
751 }, | 752 }, |
752 | 753 |
753 /** | 754 /** |
754 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback | 755 * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback |
755 */ | 756 */ |
756 requestSnapshot: function(callback) | 757 requestSnapshot: function(callback) |
757 { | 758 { |
758 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, thi s._weakTarget)); | 759 if (!this._target) |
caseq
2014/07/17 14:41:18
ditto.
sergeyv
2014/07/17 15:09:22
Done.
| |
759 LayerTreeAgent.makeSnapshot(this.id(), wrappedCallback); | 760 return; |
761 | |
762 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, thi s._target)); | |
763 this._target.layerTreeAgent().makeSnapshot(this.id(), wrappedCallback); | |
760 }, | 764 }, |
761 | 765 |
762 /** | 766 /** |
763 * @param {!DOMAgent.Rect} rect | 767 * @param {!DOMAgent.Rect} rect |
764 */ | 768 */ |
765 _didPaint: function(rect) | 769 _didPaint: function(rect) |
766 { | 770 { |
767 this._lastPaintRect = rect; | 771 this._lastPaintRect = rect; |
768 this._paintCount = this.paintCount() + 1; | 772 this._paintCount = this.paintCount() + 1; |
769 this._image = null; | 773 this._image = null; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1086 */ | 1090 */ |
1087 requestSnapshot: function(callback) | 1091 requestSnapshot: function(callback) |
1088 { | 1092 { |
1089 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot); | 1093 var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "Lay erTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot); |
1090 LayerTreeAgent.makeSnapshot(this.id(), wrappedCallback); | 1094 LayerTreeAgent.makeSnapshot(this.id(), wrappedCallback); |
1091 } | 1095 } |
1092 } | 1096 } |
1093 | 1097 |
1094 /** | 1098 /** |
1095 * @constructor | 1099 * @constructor |
1096 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 1100 * @param {?WebInspector.Target} target |
1097 */ | 1101 */ |
1098 WebInspector.DeferredLayerTree = function(weakTarget) | 1102 WebInspector.DeferredLayerTree = function(target) |
1099 { | 1103 { |
1100 this._weakTarget = weakTarget; | 1104 this._target = target; |
1101 } | 1105 } |
1102 | 1106 |
1103 WebInspector.DeferredLayerTree.prototype = { | 1107 WebInspector.DeferredLayerTree.prototype = { |
1104 /** | 1108 /** |
1105 * @param {function(!WebInspector.LayerTreeBase)} callback | 1109 * @param {function(!WebInspector.LayerTreeBase)} callback |
1106 */ | 1110 */ |
1107 resolve: function(callback) { }, | 1111 resolve: function(callback) { }, |
1108 | 1112 |
1109 /** | 1113 /** |
1110 * @return {!WeakReference.<!WebInspector.Target>} | 1114 * @return {?WebInspector.Target} |
1111 */ | 1115 */ |
1112 weakTarget: function() | 1116 target: function() |
1113 { | 1117 { |
1114 return this._weakTarget; | 1118 return this._target; |
1115 } | 1119 } |
1116 }; | 1120 }; |
1117 | 1121 |
1118 /** | 1122 /** |
1119 * @constructor | 1123 * @constructor |
1120 * @extends {WebInspector.DeferredLayerTree} | 1124 * @extends {WebInspector.DeferredLayerTree} |
1121 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 1125 * @param {?WebInspector.Target} target |
1122 * @param {!Array.<!LayerTreeAgent.Layer>} layers | 1126 * @param {!Array.<!LayerTreeAgent.Layer>} layers |
1123 */ | 1127 */ |
1124 WebInspector.DeferredAgentLayerTree = function(weakTarget, layers) | 1128 WebInspector.DeferredAgentLayerTree = function(target, layers) |
1125 { | 1129 { |
1126 WebInspector.DeferredLayerTree.call(this, weakTarget); | 1130 WebInspector.DeferredLayerTree.call(this, target); |
1127 this._layers = layers; | 1131 this._layers = layers; |
1128 } | 1132 } |
1129 | 1133 |
1130 WebInspector.DeferredAgentLayerTree.prototype = { | 1134 WebInspector.DeferredAgentLayerTree.prototype = { |
1131 /** | 1135 /** |
1132 * @param {function(!WebInspector.LayerTreeBase)} callback | 1136 * @param {function(!WebInspector.LayerTreeBase)} callback |
1133 */ | 1137 */ |
1134 resolve: function(callback) | 1138 resolve: function(callback) |
1135 { | 1139 { |
1136 var result = new WebInspector.AgentLayerTree(this._weakTarget); | 1140 var result = new WebInspector.AgentLayerTree(this._target); |
1137 result.setLayers(this._layers, callback.bind(null, result)); | 1141 result.setLayers(this._layers, callback.bind(null, result)); |
1138 }, | 1142 }, |
1139 | 1143 |
1140 __proto__: WebInspector.DeferredLayerTree.prototype | 1144 __proto__: WebInspector.DeferredLayerTree.prototype |
1141 }; | 1145 }; |
1142 | 1146 |
1143 /** | 1147 /** |
1144 * @constructor | 1148 * @constructor |
1145 * @extends {WebInspector.DeferredLayerTree} | 1149 * @extends {WebInspector.DeferredLayerTree} |
1146 * @param {!WeakReference.<!WebInspector.Target>} weakTarget | 1150 * @param {?WebInspector.Target} target |
1147 * @param {!WebInspector.TracingLayerPayload} root | 1151 * @param {!WebInspector.TracingLayerPayload} root |
1148 * @param {!Object} viewportSize | 1152 * @param {!Object} viewportSize |
1149 */ | 1153 */ |
1150 WebInspector.DeferredTracingLayerTree = function(weakTarget, root, viewportSize) | 1154 WebInspector.DeferredTracingLayerTree = function(target, root, viewportSize) |
1151 { | 1155 { |
1152 WebInspector.DeferredLayerTree.call(this, weakTarget); | 1156 WebInspector.DeferredLayerTree.call(this, target); |
1153 this._root = root; | 1157 this._root = root; |
1154 this._viewportSize = viewportSize; | 1158 this._viewportSize = viewportSize; |
1155 } | 1159 } |
1156 | 1160 |
1157 WebInspector.DeferredTracingLayerTree.prototype = { | 1161 WebInspector.DeferredTracingLayerTree.prototype = { |
1158 /** | 1162 /** |
1159 * @param {function(!WebInspector.LayerTreeBase)} callback | 1163 * @param {function(!WebInspector.LayerTreeBase)} callback |
1160 */ | 1164 */ |
1161 resolve: function(callback) | 1165 resolve: function(callback) |
1162 { | 1166 { |
1163 var result = new WebInspector.TracingLayerTree(this._weakTarget); | 1167 var result = new WebInspector.TracingLayerTree(this._target); |
1164 result.setViewportSize(this._viewportSize); | 1168 result.setViewportSize(this._viewportSize); |
1165 result.setLayers(this._root, callback.bind(null, result)); | 1169 result.setLayers(this._root, callback.bind(null, result)); |
1166 }, | 1170 }, |
1167 | 1171 |
1168 __proto__: WebInspector.DeferredLayerTree.prototype | 1172 __proto__: WebInspector.DeferredLayerTree.prototype |
1169 }; | 1173 }; |
1170 | 1174 |
1171 /** | 1175 /** |
1172 * @constructor | 1176 * @constructor |
1173 * @implements {LayerTreeAgent.Dispatcher} | 1177 * @implements {LayerTreeAgent.Dispatcher} |
(...skipping 15 matching lines...) Expand all Loading... | |
1189 | 1193 |
1190 /** | 1194 /** |
1191 * @param {!LayerTreeAgent.LayerId} layerId | 1195 * @param {!LayerTreeAgent.LayerId} layerId |
1192 * @param {!DOMAgent.Rect} clipRect | 1196 * @param {!DOMAgent.Rect} clipRect |
1193 */ | 1197 */ |
1194 layerPainted: function(layerId, clipRect) | 1198 layerPainted: function(layerId, clipRect) |
1195 { | 1199 { |
1196 this._layerTreeModel._layerPainted(layerId, clipRect); | 1200 this._layerTreeModel._layerPainted(layerId, clipRect); |
1197 } | 1201 } |
1198 } | 1202 } |
OLD | NEW |