Commit 1436fe47 authored by caseq@chromium.org's avatar caseq@chromium.org

Timeline: bring back FirstPaint marker and remove brown ticks near frame markers

- implement synthetic FirstPaint markers on front-end (they used to be generated
    on the back-end with old Timeline instrumentation which is an ex-parrot)
- remove brown marks near the frame markers (regressed at r177959)

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@185392 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8c58c6c8
......@@ -27,4 +27,13 @@ MarkLoad Properties:
thread : <string>
type : "MarkLoad"
}
MarkFirstPaint Properties:
{
data : {
}
endTime : <number>
startTime : <number>
thread : <string>
type : "MarkFirstPaint"
}
......@@ -3,6 +3,10 @@
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/timeline-test.js"></script>
<script>
function display(callback)
{
requestAnimationFrame(testRunner.displayAsyncThen.bind(testRunner, callback));
}
function test()
{
......@@ -10,7 +14,9 @@ function test()
function pageReloaded()
{
InspectorTest.stopTimeline(finish);
InspectorTest.invokePageFunctionAsync("display", function() {
InspectorTest.stopTimeline(finish);
});
}
function finish()
......@@ -18,9 +24,11 @@ function test()
InspectorTest.addResult("Model records:");
InspectorTest.printTimelineRecords("MarkDOMContent");
InspectorTest.printTimelineRecords("MarkLoad");
InspectorTest.printTimelineRecords("MarkFirstPaint");
InspectorTest.addResult("Timestamp records:");
InspectorTest.printTimestampRecords("MarkDOMContent");
InspectorTest.printTimestampRecords("MarkLoad");
InspectorTest.printTimestampRecords("MarkFirstPaint");
InspectorTest.completeTest();
}
}
......@@ -28,7 +36,7 @@ function test()
</script>
</head>
<body onload="runTest()">
<body onload="runTestAfterDisplay()">
<p>
Tests the load event.
</p>
......
......@@ -755,6 +755,8 @@ WebInspector.TimelineModel.prototype = {
this._lastRecalculateStylesEvent = null;
this._currentScriptEvent = null;
this._eventStack = [];
this._layerTreeActivatedAfterLoad = false;
this._expectFirstPaint = false;
},
/**
......@@ -765,6 +767,7 @@ WebInspector.TimelineModel.prototype = {
*/
_processThreadEvents: function(startTime, endTime, mainThread, thread)
{
var recordTypes = WebInspector.TimelineModel.RecordType;
var events = thread.events();
var length = events.length;
var i = events.lowerBound(startTime, function (time, event) { return time - event.startTime });
......@@ -787,6 +790,10 @@ WebInspector.TimelineModel.prototype = {
if (endTime && event.startTime >= endTime)
break;
this._processEvent(event);
if (this._expectFirstPaint && event.name === recordTypes.DrawFrame && this._layerTreeActivatedAfterLoad) {
threadEvents.push(new WebInspector.TracingModel.Event(event.category, recordTypes.MarkFirstPaint, WebInspector.TracingModel.Phase.Instant, event.startTime, event.thread));
this._expectFirstPaint = false;
}
threadEvents.push(event);
this._inspectedTargetEvents.push(event);
}
......@@ -813,7 +820,6 @@ WebInspector.TimelineModel.prototype = {
_processEvent: function(event)
{
var recordTypes = WebInspector.TimelineModel.RecordType;
var eventStack = this._eventStack;
while (eventStack.length && eventStack.peekLast().endTime < event.startTime)
eventStack.pop();
......@@ -983,6 +989,17 @@ WebInspector.TimelineModel.prototype = {
event.backendNodeId = paintImageEvent.backendNodeId;
event.imageURL = paintImageEvent.imageURL;
break;
case recordTypes.MarkDOMContent:
if (!event.args["data"]["isMainFrame"])
break;
this._expectFirstPaint = true;
this._layerTreeActivatedAfterLoad = false;
break;
case recordTypes.ActivateLayerTree:
this._layerTreeActivatedAfterLoad = true;
break;
}
},
......
......@@ -473,6 +473,10 @@
margin: 0 1px;
}
.timeline .resources-event-divider.timeline-frame-divider::before {
display: none;
}
.timeline .resources-event-divider.resources-red-divider::before {
background-color: rgb(255, 0, 0);
}
......
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