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

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: ready for review 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 value->setInteger("approximateBlankCharacterCount", FontFaceSet::approximate BlankCharacterCount(*m_frame->document())); 868 value->setInteger("approximateBlankCharacterCount", FontFaceSet::approximate BlankCharacterCount(*m_frame->document()));
868 return value; 869 return value;
869 } 870 }
870 871
871 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark," TRACE_DISABLED_BY_DEF AULT("blink.debug.layout") 872 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark," TRACE_DISABLED_BY_DEF AULT("blink.debug.layout")
872 873
873 void FrameView::performLayout(bool inSubtreeLayout) 874 void FrameView::performLayout(bool inSubtreeLayout)
874 { 875 {
875 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty()); 876 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty());
876 877
878 int contentsHeightBeforeLayout = layoutViewItem().documentRect().height();
877 TRACE_EVENT_BEGIN1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou t", 879 TRACE_EVENT_BEGIN1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou t",
878 "contentsHeightBeforeLayout", layoutViewItem().documentRect().height()); 880 "contentsHeightBeforeLayout", contentsHeightBeforeLayout);
879 prepareLayoutAnalyzer(); 881 prepareLayoutAnalyzer();
880 882
881 ScriptForbiddenScope forbidScript; 883 ScriptForbiddenScope forbidScript;
882 884
883 ASSERT(!isInPerformLayout()); 885 ASSERT(!isInPerformLayout());
884 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); 886 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout);
885 887
886 // performLayout is the actual guts of layout(). 888 // performLayout is the actual guts of layout().
887 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions 889 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions
888 // so that a single human could understand what layout() is actually doing. 890 // so that a single human could understand what layout() is actually doing.
(...skipping 21 matching lines...) Expand all
910 } else { 912 } else {
911 layoutFromRootObject(*layoutView()); 913 layoutFromRootObject(*layoutView());
912 } 914 }
913 915
914 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); 916 m_frame->document()->fetcher()->updateAllImageResourcePriorities();
915 917
916 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout); 918 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout);
917 919
918 TRACE_EVENT_END1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayout" , 920 TRACE_EVENT_END1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayout" ,
919 "counters", analyzerCounters()); 921 "counters", analyzerCounters());
922 FirstMeaningfulPaintDetector::from(*m_frame->document()).computeLayoutSignif icance(m_layoutObjectCounter, contentsHeightBeforeLayout, layoutViewItem().docum entRect().height(), visibleHeight());
920 } 923 }
921 924
922 void FrameView::scheduleOrPerformPostLayoutTasks() 925 void FrameView::scheduleOrPerformPostLayoutTasks()
923 { 926 {
924 if (m_postLayoutTasksTimer.isActive()) 927 if (m_postLayoutTasksTimer.isActive())
925 return; 928 return;
926 929
927 if (!m_inSynchronousPostLayout) { 930 if (!m_inSynchronousPostLayout) {
928 m_inSynchronousPostLayout = true; 931 m_inSynchronousPostLayout = true;
929 // Calls resumeScheduledEvents() 932 // Calls resumeScheduledEvents()
(...skipping 3353 matching lines...) Expand 10 before | Expand all | Expand 10 after
4283 } 4286 }
4284 4287
4285 bool FrameView::canThrottleRendering() const 4288 bool FrameView::canThrottleRendering() const
4286 { 4289 {
4287 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4290 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4288 return false; 4291 return false;
4289 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4292 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4290 } 4293 }
4291 4294
4292 } // namespace blink 4295 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698