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

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

Issue 2039363003: FirstMeaningfulPaint UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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) 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 m_postLayoutTasksTimer.stop(); 222 m_postLayoutTasksTimer.stop();
223 m_updateWidgetsTimer.stop(); 223 m_updateWidgetsTimer.stop();
224 m_firstLayout = true; 224 m_firstLayout = true;
225 m_safeToPropagateScrollToParent = true; 225 m_safeToPropagateScrollToParent = true;
226 m_lastViewportSize = IntSize(); 226 m_lastViewportSize = IntSize();
227 m_lastZoomFactor = 1.0f; 227 m_lastZoomFactor = 1.0f;
228 m_trackedObjectPaintInvalidations = wrapUnique(s_initialTrackAllPaintInvalid ations ? new Vector<ObjectPaintInvalidation> : nullptr); 228 m_trackedObjectPaintInvalidations = wrapUnique(s_initialTrackAllPaintInvalid ations ? new Vector<ObjectPaintInvalidation> : nullptr);
229 m_visuallyNonEmptyCharacterCount = 0; 229 m_visuallyNonEmptyCharacterCount = 0;
230 m_visuallyNonEmptyPixelCount = 0; 230 m_visuallyNonEmptyPixelCount = 0;
231 m_isVisuallyNonEmpty = false; 231 m_isVisuallyNonEmpty = false;
232 m_layoutObjectCounter.reset();
232 clearFragmentAnchor(); 233 clearFragmentAnchor();
233 m_viewportConstrainedObjects.reset(); 234 m_viewportConstrainedObjects.reset();
234 m_layoutSubtreeRootList.clear(); 235 m_layoutSubtreeRootList.clear();
235 m_orthogonalWritingModeRootList.clear(); 236 m_orthogonalWritingModeRootList.clear();
236 } 237 }
237 238
238 // Call function for each non-throttled frame view in pre tree order. 239 // Call function for each non-throttled frame view in pre tree order.
239 // Note it needs a null check of the frame's layoutView to access it in case of detached frames. 240 // Note it needs a null check of the frame's layoutView to access it in case of detached frames.
240 template <typename Function> 241 template <typename Function>
241 void FrameView::forAllNonThrottledFrameViews(const Function& function) 242 void FrameView::forAllNonThrottledFrameViews(const Function& function)
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 value->setInteger("approximateBlankCharacterCount", FontFaceSet::approximate BlankCharacterCount(*m_frame->document())); 857 value->setInteger("approximateBlankCharacterCount", FontFaceSet::approximate BlankCharacterCount(*m_frame->document()));
857 return value; 858 return value;
858 } 859 }
859 860
860 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark,rail," TRACE_DISABLED_B Y_DEFAULT("blink.debug.layout") 861 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark,rail," TRACE_DISABLED_B Y_DEFAULT("blink.debug.layout")
861 862
862 void FrameView::performLayout(bool inSubtreeLayout) 863 void FrameView::performLayout(bool inSubtreeLayout)
863 { 864 {
864 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty()); 865 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty());
865 866
867 int contentsHeightBeforeLayout = layoutViewItem().documentRect().height();
866 TRACE_EVENT_BEGIN1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou t", 868 TRACE_EVENT_BEGIN1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou t",
867 "contentsHeightBeforeLayout", layoutViewItem().documentRect().height()); 869 "contentsHeightBeforeLayout", contentsHeightBeforeLayout);
868 prepareLayoutAnalyzer(); 870 prepareLayoutAnalyzer();
869 871
870 ScriptForbiddenScope forbidScript; 872 ScriptForbiddenScope forbidScript;
871 873
872 ASSERT(!isInPerformLayout()); 874 ASSERT(!isInPerformLayout());
873 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); 875 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout);
874 876
875 // performLayout is the actual guts of layout(). 877 // performLayout is the actual guts of layout().
876 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions 878 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions
877 // so that a single human could understand what layout() is actually doing. 879 // so that a single human could understand what layout() is actually doing.
(...skipping 21 matching lines...) Expand all
899 } else { 901 } else {
900 layoutFromRootObject(*layoutView()); 902 layoutFromRootObject(*layoutView());
901 } 903 }
902 904
903 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); 905 m_frame->document()->fetcher()->updateAllImageResourcePriorities();
904 906
905 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout); 907 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout);
906 908
907 TRACE_EVENT_END1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayout" , 909 TRACE_EVENT_END1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayout" ,
908 "counters", analyzerCounters()); 910 "counters", analyzerCounters());
911 FirstMeaningfulPaintDetector::from(*m_frame->document()).markNextPaintAsMean ingfulIfNeeded(m_layoutObjectCounter, contentsHeightBeforeLayout, layoutViewItem ().documentRect().height(), visibleHeight());
909 } 912 }
910 913
911 void FrameView::scheduleOrPerformPostLayoutTasks() 914 void FrameView::scheduleOrPerformPostLayoutTasks()
912 { 915 {
913 if (m_postLayoutTasksTimer.isActive()) 916 if (m_postLayoutTasksTimer.isActive())
914 return; 917 return;
915 918
916 if (!m_inSynchronousPostLayout) { 919 if (!m_inSynchronousPostLayout) {
917 m_inSynchronousPostLayout = true; 920 m_inSynchronousPostLayout = true;
918 // Calls resumeScheduledEvents() 921 // Calls resumeScheduledEvents()
(...skipping 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after
4259 } 4262 }
4260 4263
4261 bool FrameView::canThrottleRendering() const 4264 bool FrameView::canThrottleRendering() const
4262 { 4265 {
4263 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4266 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4264 return false; 4267 return false;
4265 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4268 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4266 } 4269 }
4267 4270
4268 } // namespace blink 4271 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698