Commit 7fdb53cc authored by caseq@chromium.org's avatar caseq@chromium.org

Timeline: do not imply event.thread.target is the main target

We used to rely on event.thread.target in multiple places where
target was needed. These places mostly imply that this was a main
target (i.e. using it to get DOMModel & co), while it can now be a
different (or null) target. Let's keep main target associated with
timeline in Timeline model (and perhaps return null for recorded
timelines later) and plumb it where it is necessary.

BUG=

Review URL: https://codereview.chromium.org/717243002

git-svn-id: svn://svn.chromium.org/blink/trunk@185294 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9491d94f
function initialize_LayerTreeTests()
{
InspectorTest.preloadPanel("layers");
InspectorTest.layerTreeModel = WebInspector.targetManager.mainTarget().layerTreeModel;
InspectorTest.labelForLayer = function(layer)
......
......@@ -104,7 +104,7 @@ InspectorTest.invokeAsyncWithTimeline = function(functionName, doneCallback)
function step2()
{
InspectorTest.stopTimeline(doneCallback);
InspectorTest.stopTimeline(InspectorTest.safeWrap(doneCallback));
}
}
......
......@@ -212,14 +212,14 @@ function test()
]
};
var frameModel = new WebInspector.TracingTimelineFrameModel(WebInspector.targetManager.mainTarget());
var frameModel = new WebInspector.TracingTimelineFrameModel();
function loadEvents(events)
{
var tracingTimelineModel = InspectorTest.tracingTimelineModel();
tracingTimelineModel.setEventsForTest(events);
frameModel.reset();
frameModel.addTraceEvents(tracingTimelineModel.inspectedTargetEvents());
frameModel.addTraceEvents(WebInspector.targetManager.mainTarget(), tracingTimelineModel.inspectedTargetEvents());
}
for (var testName in testData) {
......
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/timeline-test.js"></script>
<script src="../../http/tests/inspector/layers-test.js"></script>
<script src="../tracing-test.js"></script>
......@@ -20,36 +21,32 @@ function doActions(callback)
callback();
return;
}
testRunner.displayAsyncThen(callback);
var pendingFrames = 3;
makeFrame();
function makeFrame()
{
if (!--pendingFrames) {
callback();
return;
}
testRunner.displayAsyncThen(requestAnimationFrame.bind(window, makeFrame));
}
}
function test()
{
InspectorTest.invokeWithTracing("doActions", onTracingComplete);
var target = /** @type {!WebInspector.Target} */ (WebInspector.targetManager.mainTarget());
var layerTree = new WebInspector.TracingLayerTree(target);
function onTracingComplete()
{
var events = InspectorTest.tracingTimelineModel().inspectedTargetEvents();
for (var i = events.length - 1; i >= 0; --i) {
if (events[i].phase === WebInspector.TracingModel.Phase.SnapshotObject && events[i].name === "cc::LayerTreeHostImpl") {
var rootLayer = events[i].args["snapshot"]["active_tree"]["root_layer"];
dumpLayerTreeSnapshot(rootLayer);
return;
}
}
InspectorTest.addResult("FAIL: cc::LayerTreeHostImpl snapshot not found");
InspectorTest.completeTest();
}
WebInspector.panels.timeline._captureLayersAndPicturesSetting.set(true);
function dumpLayerTreeSnapshot(rootLayer)
InspectorTest.invokeAsyncWithTimeline("doActions", step1);
function step1()
{
layerTree.setLayers(rootLayer, onLayersSet);
var frames = InspectorTest.timelineFrameModel().frames();
var lastFrame = InspectorTest.timelineFrameModel().frames().peekLast();
var deferredLayerTree = lastFrame.layerTree;
deferredLayerTree.resolve(InspectorTest.safeWrap(layerTreeResolved));
}
function onLayersSet()
function layerTreeResolved(layerTree)
{
InspectorTest.layerTreeModel.setLayerTree(layerTree);
InspectorTest.dumpLayerTree();
......
......@@ -30,8 +30,8 @@ function test()
var linkifier = new WebInspector.Linkifier();
var record = InspectorTest.findFirstTimelineRecord("TimerFire");
InspectorTest.check(record, "Should receive a TimerFire record.");
var contentHelper = new WebInspector.TimelineDetailsContentHelper(record.traceEvent().thread.target(), linkifier, true);
WebInspector.TimelineUIUtils._generateCauses(record.traceEvent(), contentHelper);
var contentHelper = new WebInspector.TimelineDetailsContentHelper(InspectorTest.timelineModel().target(), linkifier, true);
WebInspector.TimelineUIUtils._generateCauses(record.traceEvent(), InspectorTest.timelineModel().target(), contentHelper);
var causes = contentHelper.element.textContent;
InspectorTest.check(causes, "Should generate causes");
checkStringContains(causes, "Timer installedsetTimeoutFunction @ setTimeoutFunction.js:");
......@@ -56,8 +56,8 @@ function test()
var linkifier = new WebInspector.Linkifier();
var record = InspectorTest.findFirstTimelineRecord("FireAnimationFrame");
InspectorTest.check(record, "Should receive a FireAnimationFrame record.");
var contentHelper = new WebInspector.TimelineDetailsContentHelper(record.traceEvent().thread.target(), linkifier, true);
WebInspector.TimelineUIUtils._generateCauses(record.traceEvent(), contentHelper);
var contentHelper = new WebInspector.TimelineDetailsContentHelper(InspectorTest.timelineModel().target(), linkifier, true);
WebInspector.TimelineUIUtils._generateCauses(record.traceEvent(), InspectorTest.timelineModel().target(), contentHelper);
var causes = contentHelper.element.textContent;
InspectorTest.check(causes, "Should generate causes");
checkStringContains(causes, "Animation frame requestedrequestAnimationFrameFunction @ requestAnimationFrameFunction.js:");
......@@ -84,8 +84,8 @@ function test()
var linkifier = new WebInspector.Linkifier();
var record = InspectorTest.findFirstTimelineRecord("RecalculateStyles");
InspectorTest.check(record, "Should receive a RecalculateStyles record.");
var contentHelper = new WebInspector.TimelineDetailsContentHelper(record.traceEvent().thread.target(), linkifier, true);
WebInspector.TimelineUIUtils._generateCauses(record.traceEvent(), contentHelper);
var contentHelper = new WebInspector.TimelineDetailsContentHelper(InspectorTest.timelineModel().target(), linkifier, true);
WebInspector.TimelineUIUtils._generateCauses(record.traceEvent(), InspectorTest.timelineModel().target(), contentHelper);
var causes = contentHelper.element.textContent;
InspectorTest.check(causes, "Should generate causes");
checkStringContains(causes, "First invalidatedstyleRecalcFunction @ styleRecalcFunction.js:");
......@@ -113,8 +113,8 @@ function test()
var linkifier = new WebInspector.Linkifier();
var record = InspectorTest.findFirstTimelineRecord("Layout");
InspectorTest.check(record, "Should receive a Layout record.");
var contentHelper = new WebInspector.TimelineDetailsContentHelper(record.traceEvent().thread.target(), linkifier, true);
WebInspector.TimelineUIUtils._generateCauses(record.traceEvent(), contentHelper);
var contentHelper = new WebInspector.TimelineDetailsContentHelper(InspectorTest.timelineModel().target(), linkifier, true);
WebInspector.TimelineUIUtils._generateCauses(record.traceEvent(), InspectorTest.timelineModel().target(), contentHelper);
var causes = contentHelper.element.textContent;
InspectorTest.check(causes, "Should generate causes");
checkStringContains(causes, "Layout forcedlayoutFunction @ layoutFunction.js:");
......
......@@ -35,7 +35,7 @@ function test()
if (recordTypes.indexOf(record.type()) === -1)
return;
var details = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(record.traceEvent(), linkifier);
var details = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(record.traceEvent(), InspectorTest.timelineModel().target(), linkifier);
if (details)
InspectorTest.addResult("details.textContent for " + record.type() + " event: '" + details.textContent + "'");
}
......
......@@ -21,7 +21,6 @@ function test()
InspectorTest.invokeWithTracing("doActions", onTracingComplete, "disabled-by-default-blink.graphics_context_annotations");
var inFlightPictures = 0;
function onTracingComplete()
{
......@@ -33,7 +32,7 @@ function test()
if (!event.picture)
continue;
++inFlightPictures;
new WebInspector.LayerPaintEvent(event).loadPicture(onSnapshotLoaded);
new WebInspector.LayerPaintEvent(event, InspectorTest.timelineModel().target()).loadPicture(onSnapshotLoaded);
}
if (!inFlightPictures)
InspectorTest.completeTest();
......
......@@ -61,6 +61,14 @@ WebInspector.TracingManager.prototype = {
delete this._target;
},
/**
* @return {?WebInspector.Target}
*/
target: function()
{
return this._target;
},
/**
* @param {number} usage
*/
......
......@@ -111,7 +111,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
var name = WebInspector.TimelineUIUtils.eventStyle(event).title;
// TODO(yurys): support event dividers
var details = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, this._linkifier);
var details = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, this._model.target(), this._linkifier);
if (event.name === WebInspector.TimelineModel.RecordType.JSFrame && details)
return details.textContent;
return details ? WebInspector.UIString("%s (%s)", name, details.textContent) : name;
......
......@@ -230,12 +230,21 @@ WebInspector.TracingTimelineFrameModel._mainFrameMarkers = [
];
WebInspector.TracingTimelineFrameModel.prototype = {
reset: function()
{
WebInspector.TimelineFrameModelBase.prototype.reset.call(this);
this._target = null;
this._sessionId = null;
},
/**
* @param {?WebInspector.Target} target
* @param {!Array.<!WebInspector.TracingModel.Event>} events
* @param {string} sessionId
*/
addTraceEvents: function(events, sessionId)
addTraceEvents: function(target, events, sessionId)
{
this._target = target;
this._sessionId = sessionId;
if (!events.length)
return;
......@@ -255,16 +264,16 @@ WebInspector.TracingTimelineFrameModel.prototype = {
if (event.name === eventNames.SetLayerTreeId) {
if (this._sessionId === event.args["sessionId"])
this._layerTreeId = event.args["layerTreeId"];
return;
}
if (event.name === eventNames.TracingStartedInPage) {
} else if (event.name === eventNames.TracingStartedInPage) {
this._mainThread = event.thread;
return;
}
if (event.thread === this._mainThread)
} else if (event.phase === WebInspector.TracingModel.Phase.SnapshotObject && event.name === eventNames.LayerTreeHostImplSnapshot && parseInt(event.id, 0) === this._layerTreeId) {
var snapshot = /** @type {!WebInspector.TracingModel.ObjectSnapshot} */ (event);
this.handleLayerTreeSnapshot(new WebInspector.DeferredTracingLayerTree(snapshot, this._target));
} else if (event.thread === this._mainThread) {
this._addMainThreadTraceEvent(event);
else
} else {
this._addBackgroundTraceEvent(event);
}
},
/**
......@@ -273,11 +282,6 @@ WebInspector.TracingTimelineFrameModel.prototype = {
_addBackgroundTraceEvent: function(event)
{
var eventNames = WebInspector.TimelineModel.RecordType;
if (event.phase === WebInspector.TracingModel.Phase.SnapshotObject && event.name === eventNames.LayerTreeHostImplSnapshot && parseInt(event.id, 0) === this._layerTreeId) {
var snapshot = /** @type {!WebInspector.TracingModel.ObjectSnapshot} */ (event);
this.handleLayerTreeSnapshot(new WebInspector.DeferredTracingLayerTree(snapshot));
return;
}
if (this._lastFrame && event.selfTime)
this._lastFrame._addTimeForCategory(WebInspector.TimelineUIUtils.eventStyle(event).category.name, event.selfTime);
......@@ -321,8 +325,8 @@ WebInspector.TracingTimelineFrameModel.prototype = {
this._framePendingCommit = new WebInspector.PendingFrame();
if (!this._framePendingCommit)
return;
if (event.name === eventNames.Paint && event.args["data"]["layerId"] && event.picture)
this._framePendingCommit.paints.push(new WebInspector.LayerPaintEvent(event));
if (event.name === eventNames.Paint && event.args["data"]["layerId"] && event.picture && this._target)
this._framePendingCommit.paints.push(new WebInspector.LayerPaintEvent(event, this._target));
if (selfTime) {
var categoryName = WebInspector.TimelineUIUtils.eventStyle(event).category.name;
......@@ -339,10 +343,11 @@ WebInspector.TracingTimelineFrameModel.prototype = {
* @constructor
* @extends {WebInspector.DeferredLayerTree}
* @param {!WebInspector.TracingModel.ObjectSnapshot} snapshot
* @param {?WebInspector.Target} target
*/
WebInspector.DeferredTracingLayerTree = function(snapshot)
WebInspector.DeferredTracingLayerTree = function(snapshot, target)
{
WebInspector.DeferredLayerTree.call(this, snapshot.thread.target());
WebInspector.DeferredLayerTree.call(this, target);
this._snapshot = snapshot;
}
......@@ -427,7 +432,6 @@ WebInspector.TimelineFrame = function(startTime, startTimeOffset)
this.cpuTime = 0;
/** @type {?WebInspector.DeferredLayerTree} */
this.layerTree = null;
this.paintTiles = null;
}
WebInspector.TimelineFrame.prototype = {
......@@ -471,10 +475,12 @@ WebInspector.TimelineFrame.prototype = {
/**
* @constructor
* @param {!WebInspector.TracingModel.Event} event
* @param {?WebInspector.Target} target
*/
WebInspector.LayerPaintEvent = function(event)
WebInspector.LayerPaintEvent = function(event, target)
{
this._event = event;
this._target = target;
}
WebInspector.LayerPaintEvent.prototype = {
......@@ -499,19 +505,19 @@ WebInspector.LayerPaintEvent.prototype = {
*/
loadPicture: function(callback)
{
var target = this._event.thread.target();
this._event.picture.requestObject(onGotObject);
this._event.picture.requestObject(onGotObject.bind(this));
/**
* @param {?Object} result
* @this {WebInspector.LayerPaintEvent}
*/
function onGotObject(result)
{
if (!result || !result["skp64"] || !target) {
if (!result || !result["skp64"] || !this._target) {
callback(null, null);
return;
}
var rect = result["params"] && result["params"]["layer_rect"];
WebInspector.PaintProfilerSnapshot.load(target, result["skp64"], callback.bind(null, rect));
WebInspector.PaintProfilerSnapshot.load(this._target, result["skp64"], callback.bind(null, rect));
}
}
};
......
......@@ -499,6 +499,15 @@ WebInspector.TimelineModel.prototype = {
return this._records;
},
/**
* @return {?WebInspector.Target}
*/
target: function()
{
// FIXME: Consider returning null for loaded traces.
return this._tracingManager.target();
},
/**
* @param {!Array.<!WebInspector.TracingManager.EventPayload>} events
*/
......
......@@ -224,7 +224,7 @@ WebInspector.TimelinePanel.prototype = {
{
if (!this._lazyFrameModel) {
var tracingFrameModel = new WebInspector.TracingTimelineFrameModel();
tracingFrameModel.addTraceEvents(this._model.inspectedTargetEvents(), this._tracingModel.sessionId() || "");
tracingFrameModel.addTraceEvents(this._model.target(), this._model.inspectedTargetEvents(), this._tracingModel.sessionId() || "");
this._lazyFrameModel = tracingFrameModel;
}
return this._lazyFrameModel;
......@@ -789,7 +789,7 @@ WebInspector.TimelinePanel.prototype = {
this._updateToggleTimelineButton(false);
if (this._lazyFrameModel) {
this._lazyFrameModel.reset();
this._lazyFrameModel.addTraceEvents(this._model.inspectedTargetEvents(), this._tracingModel.sessionId());
this._lazyFrameModel.addTraceEvents(this._model.target(), this._model.inspectedTargetEvents(), this._tracingModel.sessionId());
}
this.requestWindowTimes(this._model.minimumRecordTime(), this._model.maximumRecordTime());
this._refreshViews();
......@@ -994,7 +994,8 @@ WebInspector.TimelinePanel.prototype = {
*/
_showEventInPaintProfiler: function(event, isCloseable)
{
if (!event.picture)
var target = this._model.target();
if (!event.picture || !target)
return;
var paintProfilerView = this._paintProfilerView();
if (!this._detailsView.hasTab(WebInspector.TimelinePanel.DetailsTab.PaintProfiler))
......@@ -1005,7 +1006,7 @@ WebInspector.TimelinePanel.prototype = {
{
if (!result || !result["skp64"])
return;
paintProfilerView.setPicture(event.thread.target(), result["skp64"]);
paintProfilerView.setPicture(target, result["skp64"]);
}
},
......
......@@ -264,13 +264,13 @@ WebInspector.TimelineUIUtils.isTallMarkerEvent = function(event)
/**
* @param {!WebInspector.TracingModel.Event} event
* @param {?WebInspector.Target} target
* @param {!WebInspector.Linkifier} linkifier
* @return {?Node}
*/
WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent = function(event, linkifier)
WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent = function(event, target, linkifier)
{
var recordType = WebInspector.TimelineModel.RecordType;
var target = event.thread.target();
var details;
var detailsText;
var eventData = event.args["data"];
......@@ -404,19 +404,23 @@ WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent = function(event, lin
*/
WebInspector.TimelineUIUtils.buildTraceEventDetails = function(event, model, linkifier, callback)
{
var target = event.thread.target();
var target = model.target();
if (!target) {
callbackWrapper();
return;
}
var relatedNode = null;
var barrier = new CallbackBarrier();
if (!event.previewElement) {
if (event.imageURL && target)
if (event.imageURL)
WebInspector.DOMPresentationUtils.buildImagePreviewContents(target, event.imageURL, false, barrier.createCallback(saveImage));
else if (event.picture)
WebInspector.TimelineUIUtils.buildPicturePreviewContent(event, barrier.createCallback(saveImage));
WebInspector.TimelineUIUtils.buildPicturePreviewContent(event, target, barrier.createCallback(saveImage));
}
if (event.backendNodeId && target)
if (event.backendNodeId)
target.domModel.pushNodesByBackendIdsToFrontend([event.backendNodeId], barrier.createCallback(setRelatedNode));
if (event.invalidationTrackingEvents)
WebInspector.TimelineUIUtils._pushInvalidationNodeIdsToFrontend(event, barrier.createCallback(updateInvalidationNodeIds));
WebInspector.TimelineUIUtils._pushInvalidationNodeIdsToFrontend(event, target, barrier.createCallback(updateInvalidationNodeIds));
barrier.callWhenDone(callbackWrapper);
/**
......@@ -500,7 +504,7 @@ WebInspector.TimelineUIUtils._buildTraceEventDetailsSynchronously = function(eve
// This message may vary per event.name;
var relatedNodeLabel;
var contentHelper = new WebInspector.TimelineDetailsContentHelper(event.thread.target(), linkifier, true);
var contentHelper = new WebInspector.TimelineDetailsContentHelper(model.target(), linkifier, true);
contentHelper.appendTextRow(WebInspector.UIString("Type"), WebInspector.TimelineUIUtils.eventTitle(event, model));
contentHelper.appendTextRow(WebInspector.UIString("Self Time"), Number.millisToString(event.selfTime, true));
contentHelper.appendTextRow(WebInspector.UIString("Start Time"), Number.millisToString((event.startTime - model.minimumRecordTime())));
......@@ -607,7 +611,7 @@ WebInspector.TimelineUIUtils._buildTraceEventDetailsSynchronously = function(eve
contentHelper.appendTextRow(WebInspector.UIString("Callback Function"), eventData["callbackName"]);
break;
default:
var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, linkifier);
var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(event, model.target(), linkifier);
if (detailsNode)
contentHelper.appendElementRow(WebInspector.UIString("Details"), detailsNode);
break;
......@@ -629,7 +633,7 @@ WebInspector.TimelineUIUtils._buildTraceEventDetailsSynchronously = function(eve
contentHelper.appendElementRow(WebInspector.UIString("Preview"), event.previewElement);
if (event.stackTrace || (event.initiator && event.initiator.stackTrace) || event.invalidationTrackingEvents)
WebInspector.TimelineUIUtils._generateCauses(event, contentHelper);
WebInspector.TimelineUIUtils._generateCauses(event, model.target(), contentHelper);
fragment.appendChild(contentHelper.element);
......@@ -638,9 +642,10 @@ WebInspector.TimelineUIUtils._buildTraceEventDetailsSynchronously = function(eve
/**
* @param {!WebInspector.TracingModel.Event} event
* @param {?WebInspector.Target} target
* @param {!WebInspector.TimelineDetailsContentHelper} contentHelper
*/
WebInspector.TimelineUIUtils._generateCauses = function(event, contentHelper)
WebInspector.TimelineUIUtils._generateCauses = function(event, target, contentHelper)
{
var recordTypes = WebInspector.TimelineModel.RecordType;
......@@ -670,7 +675,7 @@ WebInspector.TimelineUIUtils._generateCauses = function(event, contentHelper)
// Indirect causes.
if (event.invalidationTrackingEvents) { // Full invalidation tracking (experimental).
WebInspector.TimelineUIUtils._generateInvalidations(event, contentHelper);
WebInspector.TimelineUIUtils._generateInvalidations(event, target, contentHelper);
} else if (initiator && initiator.stackTrace) { // Partial invalidation tracking.
contentHelper.appendStackTrace(callSiteStackLabel || WebInspector.UIString("First invalidated"), initiator.stackTrace);
}
......@@ -678,14 +683,14 @@ WebInspector.TimelineUIUtils._generateCauses = function(event, contentHelper)
/**
* @param {!WebInspector.TracingModel.Event} event
* @param {?WebInspector.Target} target
* @param {!WebInspector.TimelineDetailsContentHelper} contentHelper
*/
WebInspector.TimelineUIUtils._generateInvalidations = function(event, contentHelper)
WebInspector.TimelineUIUtils._generateInvalidations = function(event, target, contentHelper)
{
if (!event.invalidationTrackingEvents)
return;
var target = event.thread.target();
var invalidations = {};
event.invalidationTrackingEvents.forEach(function(invalidation) {
if (!invalidations[invalidation.type])
......@@ -755,13 +760,14 @@ WebInspector.TimelineUIUtils._generateInvalidationsForType = function(type, targ
/**
* @param {!WebInspector.TracingModel.Event} event
* @param {!WebInspector.Target} target
* @param {function(?Array.<number>, ?Array.<number>)} callback
*/
WebInspector.TimelineUIUtils._pushInvalidationNodeIdsToFrontend = function(event, callback)
WebInspector.TimelineUIUtils._pushInvalidationNodeIdsToFrontend = function(event, target, callback)
{
var backendNodeIds = [];
var dedupedNodeIds = {};
if (event.nodeId) {
backendNodeIds.push(event.nodeId);
dedupedNodeIds[event.nodeId] = true;
......@@ -773,7 +779,6 @@ WebInspector.TimelineUIUtils._pushInvalidationNodeIdsToFrontend = function(event
}
});
var target = event.thread.target();
target.domModel.pushNodesByBackendIdsToFrontend(backendNodeIds, function(frontendNodeIds) {
callback(frontendNodeIds, backendNodeIds);
});
......@@ -840,12 +845,13 @@ WebInspector.TimelineUIUtils._aggregatedStatsForTraceEvent = function(total, mod
/**
* @param {!WebInspector.TracingModel.Event} event
* @param {!WebInspector.Target} target
* @param {function(!Element=)} callback
*/
WebInspector.TimelineUIUtils.buildPicturePreviewContent = function(event, callback)
WebInspector.TimelineUIUtils.buildPicturePreviewContent = function(event, target, callback)
{
new WebInspector.LayerPaintEvent(event).loadPicture(onSnapshotLoaded);
new WebInspector.LayerPaintEvent(event, target).loadPicture(onSnapshotLoaded);
/**
* @param {?Array.<number>} rect
* @param {?WebInspector.PaintProfilerSnapshot} snapshot
......
......@@ -567,7 +567,7 @@ WebInspector.TimelineView.prototype = {
}
} else {
if (!listRowElement) {
listRowElement = new WebInspector.TimelineRecordListRow(this._linkifier, selectRecordCallback, scheduleRefreshCallback).element;
listRowElement = new WebInspector.TimelineRecordListRow(this._linkifier, this._model.target(), selectRecordCallback, scheduleRefreshCallback).element;
this._sidebarListElement.appendChild(listRowElement);
}
if (!graphRowElement) {
......@@ -1019,9 +1019,10 @@ WebInspector.TimelineCalculator.prototype = {
* @constructor
* @param {!WebInspector.Linkifier} linkifier
* @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecord
* @param {?WebInspector.Target} target
* @param {function()} scheduleRefresh
*/
WebInspector.TimelineRecordListRow = function(linkifier, selectRecord, scheduleRefresh)
WebInspector.TimelineRecordListRow = function(linkifier, target, selectRecord, scheduleRefresh)
{
this.element = createElement("div");
this.element.row = this;
......@@ -1042,6 +1043,7 @@ WebInspector.TimelineRecordListRow = function(linkifier, selectRecord, scheduleR
this._dataElement = this.element.createChild("span", "data dimmed");
this._scheduleRefresh = scheduleRefresh;
this._selectRecord = selectRecord;
this._target = target;
}
WebInspector.TimelineRecordListRow.prototype = {
......@@ -1075,7 +1077,7 @@ WebInspector.TimelineRecordListRow.prototype = {
if (presentationRecord.coalesced()) {
this._dataElement.createTextChild(WebInspector.UIString("× %d", presentationRecord.presentationChildren().length));
} else {
var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(record.traceEvent(), this._linkifier);
var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceEvent(record.traceEvent(), this._target, this._linkifier);
if (detailsNode) {
this._dataElement.createTextChild("(");
this._dataElement.appendChild(detailsNode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment