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

Unified Diff: Source/devtools/front_end/timeline/TracingTimelineUIUtils.js

Issue 389563002: DevTools: make paint profiler target-aware (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed a test and a stray line 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
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineTracingView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
diff --git a/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js b/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
index 2183ae76e89bbdba8f4c08aa4b0190083fa37281..1343c788a98bf34c2d918e166dd5eb9a2b655ba6 100644
--- a/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
+++ b/Source/devtools/front_end/timeline/TracingTimelineUIUtils.js
@@ -465,7 +465,7 @@ WebInspector.TracingTimelineUIUtils.buildTraceEventDetails = function(event, mod
if (event.imageURL)
WebInspector.DOMPresentationUtils.buildImagePreviewContents(target, event.imageURL, false, barrier.createCallback(saveImage));
else if (event.picture)
- WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent(event.picture, barrier.createCallback(saveImage));
+ WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent(model.target(), event.picture, barrier.createCallback(saveImage));
}
if (event.backendNodeId)
target.domModel.pushNodesByBackendIdsToFrontend([event.backendNodeId], barrier.createCallback(setRelatedNode));
@@ -698,45 +698,39 @@ WebInspector.TracingTimelineUIUtils._aggregatedStatsForTraceEvent = function(tot
}
/**
+ * @param {!WebInspector.Target} target
* @param {string} encodedPicture
* @param {function(!Element=)} callback
*/
-WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent = function(encodedPicture, callback)
+WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent = function(target, encodedPicture, callback)
{
- var snapshotId;
-
- LayerTreeAgent.loadSnapshot(encodedPicture, onSnapshotLoaded);
+ WebInspector.PaintProfilerSnapshot.load(target, encodedPicture, onSnapshotLoaded);
/**
- * @param {string} error
- * @param {string} id
+ * @param {?WebInspector.PaintProfilerSnapshot} snapshot
*/
- function onSnapshotLoaded(error, id)
+ function onSnapshotLoaded(snapshot)
{
- if (error) {
- console.error("LayerTreeAgent.loadSnapshot(): " + error);
+ if (!snapshot) {
callback();
return;
}
- snapshotId = id;
- LayerTreeAgent.replaySnapshot(snapshotId, onSnapshotReplayed);
+ snapshot.requestImage(null, null, 1, onGotImage);
+ snapshot.dispose();
}
/**
- * @param {string} error
- * @param {string} encodedBitmap
+ * @param {string=} imageURL
*/
- function onSnapshotReplayed(error, encodedBitmap)
+ function onGotImage(imageURL)
{
- LayerTreeAgent.releaseSnapshot(snapshotId);
- if (error) {
- console.error("LayerTreeAgent.replaySnapshot(): " + error);
+ if (!imageURL) {
callback();
return;
}
var container = document.createElement("div");
container.className = "image-preview-container";
var img = container.createChild("img");
- img.src = encodedBitmap;
+ img.src = imageURL;
callback(container);
}
}
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineTracingView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698