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

Powered by Google App Engine
This is Rietveld 408576698