Index: Source/devtools/front_end/LayerTreeModel.js |
diff --git a/Source/devtools/front_end/LayerTreeModel.js b/Source/devtools/front_end/LayerTreeModel.js |
index df1d656582229d4025e05f76bcc50c14d33ac4e0..6268119c270e734170fc3eaebd70a2eefa338abe 100644 |
--- a/Source/devtools/front_end/LayerTreeModel.js |
+++ b/Source/devtools/front_end/LayerTreeModel.js |
@@ -97,7 +97,7 @@ WebInspector.LayerTreeModel.prototype = { |
this._root = null; |
if (error) { |
console.error("LayerTreeAgent.getLayers(): " + error); |
- return; |
+ layers = []; |
} |
this._repopulate(layers); |
for (var i = 0; i < this._pendingRequestLayersCallbacks.length; ++i) |
@@ -168,7 +168,7 @@ WebInspector.Layer = function(layerPayload) |
WebInspector.Layer.prototype = { |
/** |
- * @return {string?} |
+ * @return {string} |
*/ |
id: function() |
{ |
@@ -292,6 +292,35 @@ WebInspector.Layer.prototype = { |
}, |
/** |
+ * @return {number} |
+ */ |
+ paintCount: function() |
+ { |
+ return this._layerPayload.paintCount; |
+ }, |
+ |
+ /** |
+ * @param {function(Array.<string>?)} callback |
+ */ |
+ requestCompositingReasons: function(callback) |
+ { |
+ /** |
+ * @param {?string} error |
+ * @param {?Array.<string>} compositingReasons |
+ */ |
+ function callbackWrapper(error, compositingReasons) |
+ { |
+ if (error) { |
+ console.error("LayerTreeAgent.reasonsForCompositingLayer(): " + error); |
+ callback(null); |
+ return; |
+ } |
+ callback(compositingReasons); |
+ } |
+ LayerTreeAgent.compositingReasons(this.id(), callbackWrapper.bind(this)); |
+ }, |
+ |
+ /** |
* @param {LayerTreeAgent.Layer} layerPayload |
*/ |
_reset: function(layerPayload) |