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

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

Issue 671913005: Implement layout invalidation tracking in devtools (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | « LayoutTests/inspector/tracing/timeline-paint-with-style-recalc-invalidations.html ('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/TracingTimelineModel.js
diff --git a/Source/devtools/front_end/timeline/TracingTimelineModel.js b/Source/devtools/front_end/timeline/TracingTimelineModel.js
index 461ab7d5c5ba332ecfc2f0bff67c2b01baa068a1..854393eac57172c5abe889e2156ef64126c3b012 100644
--- a/Source/devtools/front_end/timeline/TracingTimelineModel.js
+++ b/Source/devtools/front_end/timeline/TracingTimelineModel.js
@@ -618,6 +618,7 @@ WebInspector.TracingTimelineModel.prototype = {
break;
case recordTypes.Layout:
+ this._invalidationTracker.didLayout(event);
var frameId = event.args["beginData"]["frame"];
event.initiator = this._layoutInvalidate[frameId];
// In case we have no closing Layout event, endData is not available.
@@ -1197,6 +1198,25 @@ WebInspector.InvalidationTracker.prototype = {
},
/**
+ * @param {!WebInspector.TracingModel.Event} layoutEvent
+ */
+ didLayout: function(layoutEvent)
kouhei (in TOK) 2014/10/23 04:48:38 I think we should share the logic here with didRec
pdr. 2014/10/23 05:09:44 I thought the same but it feels a little overengin
+ {
+ var layoutFrameId = layoutEvent.args["beginData"]["frame"];
+ var index = this._lastLayoutEventIndex;
+ var invalidationCount = this._invalidationEvents.length;
+ for (; index < invalidationCount; index++) {
+ var invalidation = this._invalidationEvents[index];
+ if (invalidation.type !== WebInspector.TracingTimelineModel.RecordType.LayoutInvalidationTracking)
+ continue;
+ if (invalidation.frameId === layoutFrameId)
+ this._addInvalidationTrackingEvent(layoutEvent, invalidation);
+ }
+
+ this._lastLayoutEventIndex = invalidationCount;
+ },
+
+ /**
* @param {!WebInspector.TracingModel.Event} paintEvent
*/
didPaint: function(paintEvent)
@@ -1248,6 +1268,7 @@ WebInspector.InvalidationTracker.prototype = {
{
this._invalidationEvents = [];
this._lastStyleRecalcEventIndex = 0;
+ this._lastLayoutEventIndex = 0;
kouhei (in TOK) 2014/10/23 04:48:38 Perhaps make this a map? this._lastEventIndex[Styl
this._lastPaintWithLayer = undefined;
this._didPaint = false;
}
« no previous file with comments | « LayoutTests/inspector/tracing/timeline-paint-with-style-recalc-invalidations.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698