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

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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 updateScrollbars(); 552 updateScrollbars();
553 } 553 }
554 554
555 setContentsSize(size); 555 setContentsSize(size);
556 } 556 }
557 557
558 void FrameView::adjustViewSizeAndLayout() 558 void FrameView::adjustViewSizeAndLayout()
559 { 559 {
560 adjustViewSize(); 560 adjustViewSize();
561 if (needsLayout()) { 561 if (needsLayout()) {
562 TemporaryChange<bool> suppressAdjustViewSize(m_suppressAdjustViewSize, t rue); 562 TemporaryChange<bool> suppressAdjustViewSize(&m_suppressAdjustViewSize, true);
563 layout(); 563 layout();
564 } 564 }
565 } 565 }
566 566
567 void FrameView::calculateScrollbarModesFromOverflowStyle(const ComputedStyle* st yle, ScrollbarMode& hMode, ScrollbarMode& vMode) 567 void FrameView::calculateScrollbarModesFromOverflowStyle(const ComputedStyle* st yle, ScrollbarMode& hMode, ScrollbarMode& vMode)
568 { 568 {
569 hMode = vMode = ScrollbarAuto; 569 hMode = vMode = ScrollbarAuto;
570 570
571 EOverflow overflowX = style->overflowX(); 571 EOverflow overflowX = style->overflowX();
572 EOverflow overflowY = style->overflowY(); 572 EOverflow overflowY = style->overflowY();
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 ASSERT(frameView); 780 ASSERT(frameView);
781 frameView->layout(); 781 frameView->layout();
782 } 782 }
783 783
784 void FrameView::performPreLayoutTasks() 784 void FrameView::performPreLayoutTasks()
785 { 785 {
786 TRACE_EVENT0("blink,benchmark", "FrameView::performPreLayoutTasks"); 786 TRACE_EVENT0("blink,benchmark", "FrameView::performPreLayoutTasks");
787 lifecycle().advanceTo(DocumentLifecycle::InPreLayout); 787 lifecycle().advanceTo(DocumentLifecycle::InPreLayout);
788 788
789 // Don't schedule more layouts, we're in one. 789 // Don't schedule more layouts, we're in one.
790 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, fal se); 790 TemporaryChange<bool> changeSchedulingEnabled(&m_layoutSchedulingEnabled, fa lse);
791 791
792 if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksT imer.isActive()) { 792 if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_postLayoutTasksT imer.isActive()) {
793 // This is a new top-level layout. If there are any remaining tasks from the previous layout, finish them now. 793 // This is a new top-level layout. If there are any remaining tasks from the previous layout, finish them now.
794 m_inSynchronousPostLayout = true; 794 m_inSynchronousPostLayout = true;
795 performPostLayoutTasks(); 795 performPostLayoutTasks();
796 m_inSynchronousPostLayout = false; 796 m_inSynchronousPostLayout = false;
797 } 797 }
798 798
799 bool wasResized = wasViewportResized(); 799 bool wasResized = wasViewportResized();
800 Document* document = m_frame->document(); 800 Document* document = m_frame->document();
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 958
959 performPreLayoutTasks(); 959 performPreLayoutTasks();
960 960
961 Document* document = m_frame->document(); 961 Document* document = m_frame->document();
962 962
963 // TODO(crbug.com/460956): The notion of a single root for layout is no long er applicable. Remove or update this code. 963 // TODO(crbug.com/460956): The notion of a single root for layout is no long er applicable. Remove or update this code.
964 LayoutObject* rootForThisLayout = layoutView(); 964 LayoutObject* rootForThisLayout = layoutView();
965 965
966 FontCachePurgePreventer fontCachePurgePreventer; 966 FontCachePurgePreventer fontCachePurgePreventer;
967 { 967 {
968 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); 968 TemporaryChange<bool> changeSchedulingEnabled(&m_layoutSchedulingEnabled , false);
969 m_nestedLayoutCount++; 969 m_nestedLayoutCount++;
970 970
971 updateCounters(); 971 updateCounters();
972 972
973 // If the layout view was marked as needing layout after we added items in the subtree roots we need 973 // If the layout view was marked as needing layout after we added items in the subtree roots we need
974 // to clear the roots and do the layout from the layoutView. 974 // to clear the roots and do the layout from the layoutView.
975 if (layoutViewItem().needsLayout()) 975 if (layoutViewItem().needsLayout())
976 clearLayoutSubtreeRootsAndMarkContainingBlocks(); 976 clearLayoutSubtreeRootsAndMarkContainingBlocks();
977 layoutViewItem().clearHitTestCache(); 977 layoutViewItem().clearHitTestCache();
978 978
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
2514 2514
2515 // Only the following target states are supported. 2515 // Only the following target states are supported.
2516 DCHECK(targetState == DocumentLifecycle::LayoutClean 2516 DCHECK(targetState == DocumentLifecycle::LayoutClean
2517 || targetState == DocumentLifecycle::CompositingClean 2517 || targetState == DocumentLifecycle::CompositingClean
2518 || targetState == DocumentLifecycle::PrePaintClean 2518 || targetState == DocumentLifecycle::PrePaintClean
2519 || targetState == DocumentLifecycle::PaintClean); 2519 || targetState == DocumentLifecycle::PaintClean);
2520 2520
2521 if (!m_frame->document()->isActive()) 2521 if (!m_frame->document()->isActive())
2522 return; 2522 return;
2523 2523
2524 TemporaryChange<DocumentLifecycle::LifecycleState> targetStateScope(m_curren tUpdateLifecyclePhasesTargetState, targetState); 2524 TemporaryChange<DocumentLifecycle::LifecycleState> targetStateScope(&m_curre ntUpdateLifecyclePhasesTargetState, targetState);
2525 2525
2526 if (shouldThrottleRendering()) { 2526 if (shouldThrottleRendering()) {
2527 updateViewportIntersectionsForSubtree(std::min(targetState, DocumentLife cycle::CompositingClean)); 2527 updateViewportIntersectionsForSubtree(std::min(targetState, DocumentLife cycle::CompositingClean));
2528 return; 2528 return;
2529 } 2529 }
2530 2530
2531 updateStyleAndLayoutIfNeededRecursive(); 2531 updateStyleAndLayoutIfNeededRecursive();
2532 DCHECK(lifecycle().state() >= DocumentLifecycle::LayoutClean); 2532 DCHECK(lifecycle().state() >= DocumentLifecycle::LayoutClean);
2533 2533
2534 if (targetState == DocumentLifecycle::LayoutClean) { 2534 if (targetState == DocumentLifecycle::LayoutClean) {
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after
4275 } 4275 }
4276 4276
4277 bool FrameView::canThrottleRendering() const 4277 bool FrameView::canThrottleRendering() const
4278 { 4278 {
4279 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4279 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4280 return false; 4280 return false;
4281 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4281 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4282 } 4282 }
4283 4283
4284 } // namespace blink 4284 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698