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

Issue 154273002: Revert of Remove the layout timer

Created:
6 years, 10 months ago by f(malita)
Modified:
6 years, 10 months ago
CC:
blink-reviews
Visibility:
Public.

Description

Revert of Remove the layout timer (https://codereview.chromium.org/145663012/) Reason for revert: Broke browser_tests:DeclarativeContentApiTest.Overview & content_browsertests:SiteIsolationPolicyBrowserTest.CrossSiteDocumentBlockingForDifferentTargets. Original issue's description: > Remove the layout timer > > As discussed on blink-dev, we want to remove the layout timer > in order to better synchronize work with the compositor. > Prior to this CL, we'd trigger layout at arbitrary times, > which meant we could end up doing layout multiple times per > frame unnecessarily. > > BUG=340357 > > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=166415 TBR=ojan@chromium.org,eseidel@chromium.org,abarth@chromium.org NOTREECHECKS=true NOTRY=true BUG=340357

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -15 lines) Patch
M Source/core/frame/FrameView.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/frame/FrameView.cpp View 7 chunks +17 lines, -14 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
f(malita)
Created Revert of Remove the layout timer
6 years, 10 months ago (2014-02-04 20:43:07 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:46:21 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:48:25 UTC) #3
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:48:27 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:50:38 UTC) #5
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:50:39 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:51:48 UTC) #7
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:51:50 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:52:22 UTC) #9
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:52:24 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:53:13 UTC) #11
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:53:16 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:53:50 UTC) #13
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:53:53 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:55:37 UTC) #15
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:55:39 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:56:51 UTC) #17
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:56:53 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 20:57:56 UTC) #19
commit-bot: I haz the power
Failed to apply patch for Source/core/frame/FrameView.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-04 20:57:58 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/154273002/1
6 years, 10 months ago (2014-02-04 22:23:47 UTC) #21
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-04 22:23:49 UTC) #22
commit-bot: I haz the power
6 years, 10 months ago (2014-02-04 22:23:50 UTC) #23
Failed to apply patch for Source/core/frame/FrameView.cpp:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file Source/core/frame/FrameView.cpp
  Hunk #1 FAILED at 136.
  Hunk #2 FAILED at 220.
  Hunk #3 FAILED at 909.
  Hunk #4 succeeded at 1796 with fuzz 1 (offset 35 lines).
  Hunk #5 FAILED at 1783.
  Hunk #6 FAILED at 1840.
  Hunk #7 FAILED at 1870.
  6 out of 7 hunks FAILED -- saving rejects to file
Source/core/frame/FrameView.cpp.rej

Patch:       Source/core/frame/FrameView.cpp
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index
dc91f7916145ab9b990ce43a4089d7675ffb75bf..bdf389b57a826b00a117b84a4c13cc2e586dbe12
100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -136,7 +136,7 @@
     : m_frame(frame)
     , m_canHaveScrollbars(true)
     , m_slowRepaintObjectCount(0)
-    , m_hasPendingLayout(false)
+    , m_layoutTimer(this, &FrameView::layoutTimerFired)
     , m_layoutSubtreeRoot(0)
     , m_inSynchronousPostLayout(false)
     , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
@@ -220,7 +220,7 @@
     m_cannotBlitToWindow = false;
     m_isOverlapped = false;
     m_contentIsOpaque = false;
-    m_hasPendingLayout = false;
+    m_layoutTimer.stop();
     m_layoutSubtreeRoot = 0;
     m_delayedLayout = false;
     m_doFullRepaint = true;
@@ -909,7 +909,7 @@
     // Every scroll that happens during layout is programmatic.
     TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll,
true);
 
-    m_hasPendingLayout = false;
+    m_layoutTimer.stop();
     m_delayedLayout = false;
 
     // we shouldn't enter layout() while painting
@@ -1761,6 +1761,11 @@
     autoSizeIfEnabled();
 }
 
+void FrameView::layoutTimerFired(Timer<FrameView>*)
+{
+    layout();
+}
+
 void FrameView::scheduleRelayout()
 {
     ASSERT(m_frame->view() == this);
@@ -1778,14 +1783,13 @@
     InspectorInstrumentation::didInvalidateLayout(m_frame.get());
 
     int delay = m_frame->document()->minimumLayoutDelay();
-    if (m_hasPendingLayout && m_delayedLayout && !delay)
+    if (m_layoutTimer.isActive() && m_delayedLayout && !delay)
         unscheduleRelayout();
-    if (m_hasPendingLayout)
+    if (m_layoutTimer.isActive())
         return;
 
     m_delayedLayout = delay != 0;
-    m_hasPendingLayout = true;
-    scheduleAnimation();
+    m_layoutTimer.startOneShot(delay * 0.001);
 }
 
 static bool isObjectAncestorContainerOf(RenderObject* ancestor, RenderObject*
descendant)
@@ -1835,14 +1839,13 @@
         ASSERT(!m_layoutSubtreeRoot->container() ||
!m_layoutSubtreeRoot->container()->needsLayout());
         InspectorInstrumentation::didInvalidateLayout(m_frame.get());
         m_delayedLayout = delay != 0;
-        m_hasPendingLayout = true;
-        scheduleAnimation();
+        m_layoutTimer.startOneShot(delay * 0.001);
     }
 }
 
 bool FrameView::layoutPending() const
 {
-    return m_hasPendingLayout;
+    return m_layoutTimer.isActive();
 }
 
 bool FrameView::needsLayout() const
@@ -1865,10 +1868,10 @@
 
 void FrameView::unscheduleRelayout()
 {
-    if (!m_hasPendingLayout)
-        return;
-
-    m_hasPendingLayout = false;
+    if (!m_layoutTimer.isActive())
+        return;
+
+    m_layoutTimer.stop();
     m_delayedLayout = false;
 }

Powered by Google App Engine
This is Rietveld 408576698