Index: third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js |
index 37cca1190dfe78c68ccd2cb2eb142b308f889bc3..510dba2b47c7b0db3df9d35f852cd36bbffbd98e 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js |
+++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TracingLayerTree.js |
@@ -387,14 +387,15 @@ TimelineModel.TracingLayer = class { |
var fragments = |
pictures.filter(picture => picture && rectsOverlap(picture.rect, targetRect)) |
.map(picture => ({x: picture.rect[0], y: picture.rect[1], picture: picture.serializedPicture})); |
- if (!fragments.length || !this._target) |
caseq1
2017/04/27 21:19:22
That's about the only place we needed target here,
dgozman
2017/04/28 00:07:33
Done.
|
+ var paintProfilerModel = this._target && this._target.model(SDK.PaintProfilerModel); |
+ if (!fragments.length || !paintProfilerModel) |
return null; |
var x0 = fragments.reduce((min, item) => Math.min(min, item.x), Infinity); |
var y0 = fragments.reduce((min, item) => Math.min(min, item.y), Infinity); |
// Rect is in layer content coordinates, make it relative to picture by offsetting to the top left corner. |
var rect = {x: targetRect[0] - x0, y: targetRect[1] - y0, width: targetRect[2], height: targetRect[3]}; |
- return SDK.PaintProfilerSnapshot.loadFromFragments(this._target, fragments) |
- .then(snapshot => snapshot ? {rect: rect, snapshot: snapshot} : null); |
+ return paintProfilerModel.loadSnapshotFromFragments(fragments).then( |
+ snapshot => snapshot ? {rect: rect, snapshot: snapshot} : null); |
}); |
/** |