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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 877293003: Renderer.LineLayoutMs UMA histogram to measure line layout time. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: . Created 5 years, 10 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
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 document->styleResolverChanged(); 826 document->styleResolverChanged();
827 document->mediaQueryAffectingValueChanged(); 827 document->mediaQueryAffectingValueChanged();
828 } else { 828 } else {
829 document->evaluateMediaQueryList(); 829 document->evaluateMediaQueryList();
830 } 830 }
831 831
832 document->updateRenderTreeIfNeeded(); 832 document->updateRenderTreeIfNeeded();
833 lifecycle().advanceTo(DocumentLifecycle::StyleClean); 833 lifecycle().advanceTo(DocumentLifecycle::StyleClean);
834 } 834 }
835 835
836 void FrameView::lineLayoutTime(double ms)
837 {
838 m_lineLayoutMs += ms;
839 }
840
836 void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay out) 841 void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay out)
837 { 842 {
843 m_lineLayoutMs = 0;
838 TRACE_EVENT0("blink,benchmark", "FrameView::performLayout"); 844 TRACE_EVENT0("blink,benchmark", "FrameView::performLayout");
839 double start = WTF::currentTimeMS(); 845 double start = WTF::currentTimeMS();
840 846
841 ScriptForbiddenScope forbidScript; 847 ScriptForbiddenScope forbidScript;
842 848
843 ASSERT(!isInPerformLayout()); 849 ASSERT(!isInPerformLayout());
844 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); 850 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout);
845 851
846 TemporaryChange<bool> changeInPerformLayout(m_inPerformLayout, true); 852 TemporaryChange<bool> changeInPerformLayout(m_inPerformLayout, true);
847 853
848 // performLayout is the actual guts of layout(). 854 // performLayout is the actual guts of layout().
849 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions 855 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions
850 // so that a single human could understand what layout() is actually doing. 856 // so that a single human could understand what layout() is actually doing.
851 857
852 LayoutState layoutState(*rootForThisLayout); 858 LayoutState layoutState(*rootForThisLayout);
853 859
854 forceLayoutParentViewIfNeeded(); 860 forceLayoutParentViewIfNeeded();
855 861
856 // FIXME (crbug.com/256657): Do not do two layouts for text autosizing. 862 // FIXME (crbug.com/256657): Do not do two layouts for text autosizing.
857 rootForThisLayout->layout(); 863 rootForThisLayout->layout();
858 gatherDebugLayoutRects(rootForThisLayout); 864 gatherDebugLayoutRects(rootForThisLayout);
859 865
860 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->updateAllIma geResourcePriorities(); 866 ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->updateAllIma geResourcePriorities();
861 867
862 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout); 868 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout);
863 int layoutMs = (WTF::currentTimeMS() - start); 869 int layoutMs = (WTF::currentTimeMS() - start);
864 Platform::current()->histogramCustomCounts("Renderer.LayoutMs", layoutMs, 0, 1000 * 60, 50); 870 Platform::current()->histogramCustomCounts("Renderer.LayoutMs", layoutMs, 0, 1000 * 60, 50);
871 Platform::current()->histogramCustomCounts("Renderer.LineLayoutMs", m_lineLa youtMs, 0, 1000 * 60, 50);
865 } 872 }
866 873
867 void FrameView::scheduleOrPerformPostLayoutTasks() 874 void FrameView::scheduleOrPerformPostLayoutTasks()
868 { 875 {
869 if (m_postLayoutTasksTimer.isActive()) 876 if (m_postLayoutTasksTimer.isActive())
870 return; 877 return;
871 878
872 if (!m_inSynchronousPostLayout) { 879 if (!m_inSynchronousPostLayout) {
873 m_inSynchronousPostLayout = true; 880 m_inSynchronousPostLayout = true;
874 // Calls resumeScheduledEvents() 881 // Calls resumeScheduledEvents()
(...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after
4042 { 4049 {
4043 Settings* settings = frame().settings(); 4050 Settings* settings = frame().settings();
4044 if (!settings || !settings->rootLayerScrolls()) 4051 if (!settings || !settings->rootLayerScrolls())
4045 return this; 4052 return this;
4046 4053
4047 RenderView* renderView = this->renderView(); 4054 RenderView* renderView = this->renderView();
4048 return renderView ? renderView->scrollableArea() : nullptr; 4055 return renderView ? renderView->scrollableArea() : nullptr;
4049 } 4056 }
4050 4057
4051 } // namespace blink 4058 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698