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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js

Issue 2218603003: Timeline: show white overlay till page being reloaded paints (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased, dropped console.error() upon paint with 0 layer Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 */ 1646 */
1647 didPaint: function(paintEvent) 1647 didPaint: function(paintEvent)
1648 { 1648 {
1649 this._didPaint = true; 1649 this._didPaint = true;
1650 1650
1651 // If a paint doesn't have a corresponding graphics layer id, it paints 1651 // If a paint doesn't have a corresponding graphics layer id, it paints
1652 // into its parent so add an effectivePaintId to these events. 1652 // into its parent so add an effectivePaintId to these events.
1653 var layerId = paintEvent.args["data"]["layerId"]; 1653 var layerId = paintEvent.args["data"]["layerId"];
1654 if (layerId) 1654 if (layerId)
1655 this._lastPaintWithLayer = paintEvent; 1655 this._lastPaintWithLayer = paintEvent;
1656 if (!this._lastPaintWithLayer) { 1656 // Quietly discard top-level paints without layerId, as these are likely
1657 console.error("Failed to find a paint container for a paint event.") ; 1657 // to come from overlay.
1658 if (!this._lastPaintWithLayer)
1658 return; 1659 return;
1659 }
1660 1660
1661 var effectivePaintId = this._lastPaintWithLayer.args["data"]["nodeId"]; 1661 var effectivePaintId = this._lastPaintWithLayer.args["data"]["nodeId"];
1662 var paintFrameId = paintEvent.args["data"]["frame"]; 1662 var paintFrameId = paintEvent.args["data"]["frame"];
1663 var types = [WebInspector.TimelineModel.RecordType.StyleRecalcInvalidati onTracking, 1663 var types = [WebInspector.TimelineModel.RecordType.StyleRecalcInvalidati onTracking,
1664 WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking, 1664 WebInspector.TimelineModel.RecordType.LayoutInvalidationTracking,
1665 WebInspector.TimelineModel.RecordType.PaintInvalidationTracking, 1665 WebInspector.TimelineModel.RecordType.PaintInvalidationTracking,
1666 WebInspector.TimelineModel.RecordType.ScrollInvalidationTracking]; 1666 WebInspector.TimelineModel.RecordType.ScrollInvalidationTracking];
1667 for (var invalidation of this._invalidationsOfTypes(types)) { 1667 for (var invalidation of this._invalidationsOfTypes(types)) {
1668 if (invalidation.paintId === effectivePaintId) 1668 if (invalidation.paintId === effectivePaintId)
1669 this._addInvalidationToEvent(paintEvent, paintFrameId, invalidat ion); 1669 this._addInvalidationToEvent(paintEvent, paintFrameId, invalidat ion);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 if (!id) 1778 if (!id)
1779 return; 1779 return;
1780 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */ 1780 /** @type {!Map<string, !WebInspector.TracingModel.Event>|undefined} */
1781 var initiatorMap = this._initiatorByType.get(initiatorType); 1781 var initiatorMap = this._initiatorByType.get(initiatorType);
1782 if (isInitiator) 1782 if (isInitiator)
1783 initiatorMap.set(id, event); 1783 initiatorMap.set(id, event);
1784 else 1784 else
1785 event.initiator = initiatorMap.get(id) || null; 1785 event.initiator = initiatorMap.get(id) || null;
1786 } 1786 }
1787 } 1787 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorTracingAgent.cpp ('k') | third_party/WebKit/Source/web/InspectorOverlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698