Chromium Code Reviews| 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 |
| }; |
| /** |