Chromium Code Reviews| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 if (this._domModel) | 257 if (this._domModel) |
| 258 this._domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds, pop ulateBackendNodeMap.bind(this)); | 258 this._domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds, pop ulateBackendNodeMap.bind(this)); |
| 259 | 259 |
| 260 /** | 260 /** |
| 261 * @this {WebInspector.LayerTreeBase} | 261 * @this {WebInspector.LayerTreeBase} |
| 262 * @param {?Map<number, ?WebInspector.DOMNode>} nodesMap | 262 * @param {?Map<number, ?WebInspector.DOMNode>} nodesMap |
| 263 */ | 263 */ |
| 264 function populateBackendNodeMap(nodesMap) | 264 function populateBackendNodeMap(nodesMap) |
| 265 { | 265 { |
| 266 if (nodesMap) { | 266 if (nodesMap) { |
| 267 for (var entry of nodesMap) | 267 for (var entry of nodesMap) |
|
lushnikov
2016/03/04 22:49:18
.keys()?
kozy
2016/03/04 23:18:50
Done.
| |
| 268 this._backendNodeIdToNode.set(entry[0], entry[1]); | 268 this._backendNodeIdToNode.set(/** @type {number} */(entry[0] ), /** @type {?WebInspector.DOMNode} */(entry[1])); |
| 269 } | 269 } |
| 270 callback(); | 270 callback(); |
| 271 } | 271 } |
| 272 }, | 272 }, |
| 273 | 273 |
| 274 /** | 274 /** |
| 275 * @param {!Object} viewportSize | 275 * @param {!Object} viewportSize |
| 276 */ | 276 */ |
| 277 setViewportSize: function(viewportSize) | 277 setViewportSize: function(viewportSize) |
| 278 { | 278 { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 375 }, | 375 }, |
| 376 | 376 |
| 377 /** | 377 /** |
| 378 * @param {!Set<number>} nodeIdsToResolve | 378 * @param {!Set<number>} nodeIdsToResolve |
| 379 * @param {!Object} seenNodeIds | 379 * @param {!Object} seenNodeIds |
| 380 * @param {!WebInspector.TracingLayerPayload} payload | 380 * @param {!WebInspector.TracingLayerPayload} payload |
| 381 */ | 381 */ |
| 382 _extractNodeIdsToResolve: function(nodeIdsToResolve, seenNodeIds, payload) | 382 _extractNodeIdsToResolve: function(nodeIdsToResolve, seenNodeIds, payload) |
| 383 { | 383 { |
| 384 var backendNodeId = payload.owner_node; | 384 var backendNodeId = payload.owner_node; |
| 385 if (backendNodeId && !this._backendNodeIdToNode[backendNodeId]) | 385 if (backendNodeId && !this._backendNodeIdToNode.has(backendNodeId)) |
| 386 nodeIdsToResolve.add(backendNodeId); | 386 nodeIdsToResolve.add(backendNodeId); |
| 387 for (var i = 0; payload.children && i < payload.children.length; ++i) | 387 for (var i = 0; payload.children && i < payload.children.length; ++i) |
| 388 this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload .children[i]); | 388 this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload .children[i]); |
| 389 }, | 389 }, |
| 390 | 390 |
| 391 __proto__: WebInspector.LayerTreeBase.prototype | 391 __proto__: WebInspector.LayerTreeBase.prototype |
| 392 } | 392 } |
| 393 | 393 |
| 394 /** | 394 /** |
| 395 * @constructor | 395 * @constructor |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1273 WebInspector.LayerTreeModel.fromTarget = function(target) | 1273 WebInspector.LayerTreeModel.fromTarget = function(target) |
| 1274 { | 1274 { |
| 1275 if (!target.isPage()) | 1275 if (!target.isPage()) |
| 1276 return null; | 1276 return null; |
| 1277 | 1277 |
| 1278 var model = /** @type {?WebInspector.LayerTreeModel} */ (target.model(WebIns pector.LayerTreeModel)); | 1278 var model = /** @type {?WebInspector.LayerTreeModel} */ (target.model(WebIns pector.LayerTreeModel)); |
| 1279 if (!model) | 1279 if (!model) |
| 1280 model = new WebInspector.LayerTreeModel(target); | 1280 model = new WebInspector.LayerTreeModel(target); |
| 1281 return model; | 1281 return model; |
| 1282 } | 1282 } |
| OLD | NEW |