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

Unified Diff: Source/devtools/front_end/LayerTreeModel.js

Issue 23050018: DevTools: expose layer compositing reasons and paint count via layer tree agent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed gcc build Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.cpp ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.cpp ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698