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 1577433003: Statistics of LayoutBox rare data reasons Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 3 years, 9 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 2972 matching lines...) Expand 10 before | Expand all | Expand 10 after
2983 dispatchEventsForPrintingOnAllFrames(); 2983 dispatchEventsForPrintingOnAllFrames();
2984 } 2984 }
2985 2985
2986 void FrameView::clearPrintContext() { 2986 void FrameView::clearPrintContext() {
2987 if (!m_printContext) 2987 if (!m_printContext)
2988 return; 2988 return;
2989 m_printContext->end(); 2989 m_printContext->end();
2990 m_printContext.clear(); 2990 m_printContext.clear();
2991 } 2991 }
2992 2992
2993 static int gFrameCounts[7];
2994 int* frameCounts() {
2995 return gFrameCounts;
2996 }
2997
2998 static void countFrames(const Frame& frame) {
2999 gFrameCounts[0]++;
3000 for (Frame* child = frame.tree().firstChild(); child;
3001 child = child->tree().nextSibling()) {
3002 if (!child->isLocalFrame()) {
3003 gFrameCounts[1]++;
3004 continue;
3005 }
3006 if (!child->ownerLayoutObject())
3007 gFrameCounts[2]++;
3008 if (FrameView* childView = toLocalFrame(child)->view()) {
3009 if (childView->shouldThrottleRendering()) {
3010 gFrameCounts[3]++;
3011 if (!child->ownerLayoutObject())
3012 gFrameCounts[4]++;
3013 }
3014 if (!childView->layoutView())
3015 gFrameCounts[5]++;
3016 } else {
3017 gFrameCounts[6]++;
3018 }
3019 countFrames(*child);
3020 }
3021 }
3022
2993 // TODO(leviw): We don't assert lifecycle information from documents in child 3023 // TODO(leviw): We don't assert lifecycle information from documents in child
2994 // PluginViews. 3024 // PluginViews.
2995 void FrameView::updateLifecyclePhasesInternal( 3025 void FrameView::updateLifecyclePhasesInternal(
2996 DocumentLifecycle::LifecycleState targetState) { 3026 DocumentLifecycle::LifecycleState targetState) {
2997 if (m_currentUpdateLifecyclePhasesTargetState != 3027 if (m_currentUpdateLifecyclePhasesTargetState !=
2998 DocumentLifecycle::Uninitialized) { 3028 DocumentLifecycle::Uninitialized) {
2999 NOTREACHED() << "FrameView::updateLifecyclePhasesInternal() reentrance"; 3029 NOTREACHED() << "FrameView::updateLifecyclePhasesInternal() reentrance";
3000 return; 3030 return;
3001 } 3031 }
3002 3032
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3114 } 3144 }
3115 } 3145 }
3116 3146
3117 forAllNonThrottledFrameViews([](FrameView& frameView) { 3147 forAllNonThrottledFrameViews([](FrameView& frameView) {
3118 frameView.checkDoesNotNeedLayout(); 3148 frameView.checkDoesNotNeedLayout();
3119 frameView.m_allowsLayoutInvalidationAfterLayoutClean = true; 3149 frameView.m_allowsLayoutInvalidationAfterLayoutClean = true;
3120 }); 3150 });
3121 } 3151 }
3122 3152
3123 updateViewportIntersectionsForSubtree(targetState); 3153 updateViewportIntersectionsForSubtree(targetState);
3154
3155 gFrameCounts[0] = gFrameCounts[1] = gFrameCounts[2] = gFrameCounts[3] =
3156 gFrameCounts[4] = 0;
3157 countFrames(*m_frame);
3124 } 3158 }
3125 3159
3126 void FrameView::enqueueScrollAnchoringAdjustment( 3160 void FrameView::enqueueScrollAnchoringAdjustment(
3127 ScrollableArea* scrollableArea) { 3161 ScrollableArea* scrollableArea) {
3128 m_anchoringAdjustmentQueue.insert(scrollableArea); 3162 m_anchoringAdjustmentQueue.insert(scrollableArea);
3129 } 3163 }
3130 3164
3131 void FrameView::performScrollAnchoringAdjustments() { 3165 void FrameView::performScrollAnchoringAdjustments() {
3132 for (WeakMember<ScrollableArea>& scroller : m_anchoringAdjustmentQueue) { 3166 for (WeakMember<ScrollableArea>& scroller : m_anchoringAdjustmentQueue) {
3133 if (scroller) { 3167 if (scroller) {
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after
5257 void FrameView::setAnimationHost( 5291 void FrameView::setAnimationHost(
5258 std::unique_ptr<CompositorAnimationHost> host) { 5292 std::unique_ptr<CompositorAnimationHost> host) {
5259 m_animationHost = std::move(host); 5293 m_animationHost = std::move(host);
5260 } 5294 }
5261 5295
5262 LayoutUnit FrameView::caretWidth() const { 5296 LayoutUnit FrameView::caretWidth() const {
5263 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5297 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5264 } 5298 }
5265 5299
5266 } // namespace blink 5300 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698