Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 816 | 816 |
| 817 static inline void layoutFromRootObject(LayoutObject& root) | 817 static inline void layoutFromRootObject(LayoutObject& root) |
| 818 { | 818 { |
| 819 LayoutState layoutState(root); | 819 LayoutState layoutState(root); |
| 820 root.layout(); | 820 root.layout(); |
| 821 } | 821 } |
| 822 | 822 |
| 823 void FrameView::prepareLayoutAnalyzer() | 823 void FrameView::prepareLayoutAnalyzer() |
| 824 { | 824 { |
| 825 bool isTracing = false; | 825 bool isTracing = false; |
| 826 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.debug.la yout"), &isTracing); | 826 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink.user_timing", &isTracing); |
| 827 if (!isTracing) { | 827 if (!isTracing) { |
| 828 m_analyzer.clear(); | 828 m_analyzer.clear(); |
| 829 return; | 829 return; |
| 830 } | 830 } |
| 831 if (!m_analyzer) | 831 if (!m_analyzer) |
| 832 m_analyzer = adoptPtr(new LayoutAnalyzer()); | 832 m_analyzer = adoptPtr(new LayoutAnalyzer()); |
| 833 m_analyzer->reset(); | 833 m_analyzer->reset(); |
| 834 } | 834 } |
| 835 | 835 |
| 836 PassOwnPtr<TracedValue> FrameView::analyzerCounters() | 836 PassOwnPtr<TracedValue> FrameView::analyzerCounters() |
| 837 { | 837 { |
| 838 if (!m_analyzer) | 838 if (!m_analyzer) |
| 839 return TracedValue::create(); | 839 return TracedValue::create(); |
| 840 OwnPtr<TracedValue> value = m_analyzer->toTracedValue(); | 840 OwnPtr<TracedValue> value = m_analyzer->toTracedValue(); |
| 841 value->setString("host", layoutView()->document().location()->host()); | 841 value->setString("host", layoutView()->document().location()->host()); |
| 842 value->setInteger("visibleHeight", visibleHeight()); | |
| 843 value->setInteger("contentsHeightBefore", contentsSize().height()); | |
|
paulirish
2016/04/29 02:41:51
Are you submitting a CL for these non-font counter
Kunihiko Sakamoto
2016/05/09 07:33:42
Sorry for the delay, just sent out https://coderev
| |
| 844 value->setInteger("contentsHeightAfter", layoutView()->documentRect().height ()); | |
| 845 value->setBoolean("hasBlankText", FontFaceSet::hasBlankText(*m_frame->docume nt())); | |
| 842 return value.release(); | 846 return value.release(); |
| 843 } | 847 } |
| 844 | 848 |
| 845 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark," TRACE_DISABLED_BY_DEF AULT("blink.debug.layout") | 849 #define PERFORM_LAYOUT_TRACE_CATEGORIES "blink,benchmark," TRACE_DISABLED_BY_DEF AULT("blink.debug.layout") |
| 846 | 850 |
| 847 void FrameView::performLayout(bool inSubtreeLayout) | 851 void FrameView::performLayout(bool inSubtreeLayout) |
| 848 { | 852 { |
| 849 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty()); | 853 ASSERT(inSubtreeLayout || m_layoutSubtreeRootList.isEmpty()); |
| 850 | 854 |
| 851 TRACE_EVENT_BEGIN0(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayou t"); | 855 TRACE_EVENT_BEGIN0("blink.user_timing", "FrameView::performLayout"); |
| 852 prepareLayoutAnalyzer(); | 856 prepareLayoutAnalyzer(); |
| 853 | 857 |
| 854 ScriptForbiddenScope forbidScript; | 858 ScriptForbiddenScope forbidScript; |
| 855 | 859 |
| 856 ASSERT(!isInPerformLayout()); | 860 ASSERT(!isInPerformLayout()); |
| 857 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); | 861 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); |
| 858 | 862 |
| 859 // performLayout is the actual guts of layout(). | 863 // performLayout is the actual guts of layout(). |
| 860 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions | 864 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions |
| 861 // so that a single human could understand what layout() is actually doing. | 865 // so that a single human could understand what layout() is actually doing. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 881 } | 885 } |
| 882 m_layoutSubtreeRootList.clear(); | 886 m_layoutSubtreeRootList.clear(); |
| 883 } else { | 887 } else { |
| 884 layoutFromRootObject(*layoutView()); | 888 layoutFromRootObject(*layoutView()); |
| 885 } | 889 } |
| 886 | 890 |
| 887 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); | 891 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); |
| 888 | 892 |
| 889 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout); | 893 lifecycle().advanceTo(DocumentLifecycle::AfterPerformLayout); |
| 890 | 894 |
| 891 TRACE_EVENT_END1(PERFORM_LAYOUT_TRACE_CATEGORIES, "FrameView::performLayout" , | 895 TRACE_EVENT_END2("blink.user_timing", "FrameView::performLayout", |
| 892 "counters", analyzerCounters()); | 896 "counters", analyzerCounters(), "frame", m_frame.get()); |
| 893 } | 897 } |
| 894 | 898 |
| 895 void FrameView::scheduleOrPerformPostLayoutTasks() | 899 void FrameView::scheduleOrPerformPostLayoutTasks() |
| 896 { | 900 { |
| 897 if (m_postLayoutTasksTimer.isActive()) | 901 if (m_postLayoutTasksTimer.isActive()) |
| 898 return; | 902 return; |
| 899 | 903 |
| 900 if (!m_inSynchronousPostLayout) { | 904 if (!m_inSynchronousPostLayout) { |
| 901 m_inSynchronousPostLayout = true; | 905 m_inSynchronousPostLayout = true; |
| 902 // Calls resumeScheduledEvents() | 906 // Calls resumeScheduledEvents() |
| (...skipping 3163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4066 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4070 return m_hiddenForThrottling && m_crossOriginForThrottling; |
| 4067 } | 4071 } |
| 4068 | 4072 |
| 4069 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const | 4073 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const |
| 4070 { | 4074 { |
| 4071 ASSERT(layoutView()); | 4075 ASSERT(layoutView()); |
| 4072 return *layoutView(); | 4076 return *layoutView(); |
| 4073 } | 4077 } |
| 4074 | 4078 |
| 4075 } // namespace blink | 4079 } // namespace blink |
| OLD | NEW |