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

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

Issue 389563002: DevTools: make paint profiler target-aware (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
Index: Source/devtools/front_end/sdk/LayerTreeModel.js
diff --git a/Source/devtools/front_end/sdk/LayerTreeModel.js b/Source/devtools/front_end/sdk/LayerTreeModel.js
index cdb450406bc852fa0aa6ec04630a0105835ff58c..ef3ce1092a59f34aa71f202913defde6ac103cf8 100644
--- a/Source/devtools/front_end/sdk/LayerTreeModel.js
+++ b/Source/devtools/front_end/sdk/LayerTreeModel.js
@@ -408,7 +408,7 @@ WebInspector.AgentLayerTree.prototype = {
if (layer)
layer._reset(layers[i]);
else
- layer = new WebInspector.AgentLayer(layers[i]);
+ layer = new WebInspector.AgentLayer(this.target(), layers[i]);
this._layersById[layerId] = layer;
if (layers[i].backendNodeId) {
layer._setNode(this.target().domModel.nodeForId(this._backendNodeIdToNodeId[layers[i].backendNodeId]));
@@ -551,10 +551,13 @@ WebInspector.Layer.prototype = {
/**
* @constructor
* @implements {WebInspector.Layer}
+ * @extends {WebInspector.SDKObject}
+ * @param {!WebInspector.Target} target
* @param {!LayerTreeAgent.Layer} layerPayload
*/
-WebInspector.AgentLayer = function(layerPayload)
+WebInspector.AgentLayer = function(target, layerPayload)
{
+ WebInspector.SDKObject.call(this, target);
this._reset(layerPayload);
}
@@ -744,7 +747,7 @@ WebInspector.AgentLayer.prototype = {
*/
requestSnapshot: function(callback)
{
- var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot);
+ var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, this.target()));
LayerTreeAgent.makeSnapshot(this.id(), wrappedCallback);
},
@@ -833,7 +836,9 @@ WebInspector.AgentLayer.prototype = {
}
this._children.forEach(calculateQuadForLayer);
- }
+ },
+
+ __proto__: WebInspector.SDKObject.prototype
}
/**

Powered by Google App Engine
This is Rietveld 408576698