Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Side by Side Diff: Source/devtools/front_end/LayerTreeModel.js

Issue 206313004: DevTools: Rename WebInspector.DOMAgent into WebInspector.DOMModel (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/devtools/front_end/LayerTree.js ('k') | Source/devtools/front_end/Layers3DView.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 23 matching lines...) Expand all
34 */ 34 */
35 WebInspector.LayerTreeModel = function() 35 WebInspector.LayerTreeModel = function()
36 { 36 {
37 WebInspector.Object.call(this); 37 WebInspector.Object.call(this);
38 this._layersById = {}; 38 this._layersById = {};
39 // We fetch layer tree lazily and get paint events asynchronously, so keep t he last painted 39 // We fetch layer tree lazily and get paint events asynchronously, so keep t he last painted
40 // rect separate from layer so we can get it after refreshing the tree. 40 // rect separate from layer so we can get it after refreshing the tree.
41 this._lastPaintRectByLayerId = {}; 41 this._lastPaintRectByLayerId = {};
42 this._backendNodeIdToNodeId = {}; 42 this._backendNodeIdToNodeId = {};
43 InspectorBackend.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispa tcher(this)); 43 InspectorBackend.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispa tcher(this));
44 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.Document Updated, this._onDocumentUpdated, this); 44 WebInspector.domModel.addEventListener(WebInspector.DOMModel.Events.Document Updated, this._onDocumentUpdated, this);
45 } 45 }
46 46
47 WebInspector.LayerTreeModel.Events = { 47 WebInspector.LayerTreeModel.Events = {
48 LayerTreeChanged: "LayerTreeChanged", 48 LayerTreeChanged: "LayerTreeChanged",
49 LayerPainted: "LayerPainted", 49 LayerPainted: "LayerPainted",
50 } 50 }
51 51
52 WebInspector.LayerTreeModel.prototype = { 52 WebInspector.LayerTreeModel.prototype = {
53 disable: function() 53 disable: function()
54 { 54 {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 * @param {!Array.<!LayerTreeAgent.Layer>} layers 195 * @param {!Array.<!LayerTreeAgent.Layer>} layers
196 * @param {function()} callback 196 * @param {function()} callback
197 */ 197 */
198 _resolveBackendNodeIdsForLayers: function(layers, callback) 198 _resolveBackendNodeIdsForLayers: function(layers, callback)
199 { 199 {
200 var idsToResolve = {}; 200 var idsToResolve = {};
201 var requestedIds = []; 201 var requestedIds = [];
202 for (var i = 0; i < layers.length; ++i) { 202 for (var i = 0; i < layers.length; ++i) {
203 var backendNodeId = layers[i].backendNodeId; 203 var backendNodeId = layers[i].backendNodeId;
204 if (!backendNodeId || idsToResolve[backendNodeId] || 204 if (!backendNodeId || idsToResolve[backendNodeId] ||
205 (this._backendNodeIdToNodeId[backendNodeId] && WebInspector.domA gent.nodeForId(this._backendNodeIdToNodeId[backendNodeId]))) { 205 (this._backendNodeIdToNodeId[backendNodeId] && WebInspector.domM odel.nodeForId(this._backendNodeIdToNodeId[backendNodeId]))) {
206 continue; 206 continue;
207 } 207 }
208 idsToResolve[backendNodeId] = true; 208 idsToResolve[backendNodeId] = true;
209 requestedIds.push(backendNodeId); 209 requestedIds.push(backendNodeId);
210 } 210 }
211 if (!requestedIds.length) { 211 if (!requestedIds.length) {
212 callback(); 212 callback();
213 return; 213 return;
214 } 214 }
215 WebInspector.domAgent.pushNodesByBackendIdsToFrontend(requestedIds, popu lateBackendNodeIdMap.bind(this)); 215 WebInspector.domModel.pushNodesByBackendIdsToFrontend(requestedIds, popu lateBackendNodeIdMap.bind(this));
216 216
217 /** 217 /**
218 * @this {WebInspector.LayerTreeModel} 218 * @this {WebInspector.LayerTreeModel}
219 * @param {?Array.<number>} nodeIds 219 * @param {?Array.<number>} nodeIds
220 */ 220 */
221 function populateBackendNodeIdMap(nodeIds) 221 function populateBackendNodeIdMap(nodeIds)
222 { 222 {
223 if (nodeIds) { 223 if (nodeIds) {
224 for (var i = 0; i < requestedIds.length; ++i) { 224 for (var i = 0; i < requestedIds.length; ++i) {
225 var nodeId = nodeIds[i]; 225 var nodeId = nodeIds[i];
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 503
504 /** 504 /**
505 * @param {!LayerTreeAgent.LayerId} layerId 505 * @param {!LayerTreeAgent.LayerId} layerId
506 * @param {!DOMAgent.Rect} clipRect 506 * @param {!DOMAgent.Rect} clipRect
507 */ 507 */
508 layerPainted: function(layerId, clipRect) 508 layerPainted: function(layerId, clipRect)
509 { 509 {
510 this._layerTreeModel._layerPainted(layerId, clipRect); 510 this._layerTreeModel._layerPainted(layerId, clipRect);
511 } 511 }
512 } 512 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/LayerTree.js ('k') | Source/devtools/front_end/Layers3DView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698