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

Unified Diff: Source/devtools/front_end/sdk/PaintProfiler.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/PaintProfiler.js
diff --git a/Source/devtools/front_end/sdk/PaintProfiler.js b/Source/devtools/front_end/sdk/PaintProfiler.js
index 95d41b2eea1e4a485379a5b206c60d944f51e528..67ccad7559126a8e5c8fdd41cb5c20bae0ac74c5 100644
--- a/Source/devtools/front_end/sdk/PaintProfiler.js
+++ b/Source/devtools/front_end/sdk/PaintProfiler.js
@@ -30,21 +30,25 @@
/**
* @constructor
+ * @param {!WebInspector.Target} target
* @param {string} snapshotId
+ * @extends {WebInspector.SDKObject}
*/
-WebInspector.PaintProfilerSnapshot = function(snapshotId)
+WebInspector.PaintProfilerSnapshot = function(target, snapshotId)
sergeyv 2014/07/11 11:29:00 As we spoke offline, this snapshot can live longer
{
+ WebInspector.SDKObject.call(this, target);
this._id = snapshotId;
}
/**
+ * @param {!WebInspector.Target} target
* @param {string} encodedPicture
* @param {function(?WebInspector.PaintProfilerSnapshot)} callback
*/
-WebInspector.PaintProfilerSnapshot.load = function(encodedPicture, callback)
+WebInspector.PaintProfilerSnapshot.load = function(target, encodedPicture, callback)
{
- var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.loadSnapshot(): ", WebInspector.PaintProfilerSnapshot);
- LayerTreeAgent.loadSnapshot(encodedPicture, wrappedCallback);
+ var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.loadSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, target));
+ target.layerTreeAgent().loadSnapshot(encodedPicture, wrappedCallback);
}
/**
@@ -97,7 +101,7 @@ WebInspector.PaintProfilerSnapshot._processAnnotations = function(log)
WebInspector.PaintProfilerSnapshot.prototype = {
dispose: function()
{
- LayerTreeAgent.releaseSnapshot(this._id);
+ this.target().layerTreeAgent().releaseSnapshot(this._id);
},
/**
@@ -109,7 +113,7 @@ WebInspector.PaintProfilerSnapshot.prototype = {
requestImage: function(firstStep, lastStep, scale, callback)
{
var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.replaySnapshot(): ");
- LayerTreeAgent.replaySnapshot(this._id, firstStep || undefined, lastStep || undefined, scale || 1.0, wrappedCallback);
+ this.target().layerTreeAgent().replaySnapshot(this._id, firstStep || undefined, lastStep || undefined, scale || 1.0, wrappedCallback);
},
/**
@@ -118,7 +122,7 @@ WebInspector.PaintProfilerSnapshot.prototype = {
profile: function(callback)
{
var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.profileSnapshot(): ");
- LayerTreeAgent.profileSnapshot(this._id, 5, 1, wrappedCallback);
+ this.target().layerTreeAgent().profileSnapshot(this._id, 5, 1, wrappedCallback);
},
/**
@@ -139,9 +143,11 @@ WebInspector.PaintProfilerSnapshot.prototype = {
}
callback(WebInspector.PaintProfilerSnapshot._processAnnotations(log));
}
- LayerTreeAgent.snapshotCommandLog(this._id, callbackWrapper);
+
+ this.target().layerTreeAgent().snapshotCommandLog(this._id, callbackWrapper);
},
+ __proto__: WebInspector.SDKObject.prototype
};
/**
« no previous file with comments | « Source/devtools/front_end/sdk/LayerTreeModel.js ('k') | Source/devtools/front_end/timeline/TimelineLayersView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698