Bug 1323319 - Make sure we can force paint remote tabs even during the first activation. r?billm draft
authorMike Conley <mconley@mozilla.com>
Wed, 21 Dec 2016 16:09:09 -0500
changeset 452619 550a5ed8e8d73fee00451ef6892950ba201b7594
parent 451655 0f3603e365f029bc9ea5f926d32f6f0f8aa4d998
child 540244 f1eed70ebf346c4a7bbdd67e44d0b640efd96bed
push id39422
push usermconley@mozilla.com
push dateWed, 21 Dec 2016 21:09:36 +0000
reviewersbillm
bugs1323319
milestone53.0a1
Bug 1323319 - Make sure we can force paint remote tabs even during the first activation. r?billm MozReview-Commit-ID: EV9u7M2i2sL
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -157,17 +157,16 @@ TabParent::TabParent(nsIContentParent* a
   , mCursor(nsCursor(-1))
   , mTabSetsCursor(false)
   , mHasContentOpener(false)
 #ifdef DEBUG
   , mActiveSupressDisplayportCount(0)
 #endif
   , mLayerTreeEpoch(0)
   , mPreserveLayers(false)
-  , mFirstActivate(true)
 {
   MOZ_ASSERT(aManager);
 }
 
 TabParent::~TabParent()
 {
 }
 
@@ -2652,22 +2651,18 @@ TabParent::SetDocShellIsActive(bool isAc
   // docshell is consider prerendered only if not active yet
   mIsPrerendered &= !isActive;
   mDocShellIsActive = isActive;
   Unused << SendSetDocShellIsActive(isActive, mPreserveLayers, mLayerTreeEpoch);
 
   // Ask the child to repaint using the PHangMonitor channel/thread (which may
   // be less congested).
   if (isActive) {
-    if (mFirstActivate) {
-      mFirstActivate = false;
-    } else {
-      ContentParent* cp = Manager()->AsContentParent();
-      cp->ForceTabPaint(this, mLayerTreeEpoch);
-    }
+    ContentParent* cp = Manager()->AsContentParent();
+    cp->ForceTabPaint(this, mLayerTreeEpoch);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabParent::GetDocShellIsActive(bool* aIsActive)
 {
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -765,22 +765,16 @@ private:
   static void RemoveTabParentFromTable(uint64_t aLayersId);
 
   uint64_t mLayerTreeEpoch;
 
   // If this flag is set, then the tab's layers will be preserved even when
   // the tab's docshell is inactive.
   bool mPreserveLayers;
 
-  // Normally we call ForceTabPaint when activating a tab. But we don't do this
-  // the first time we activate a tab. The tab is probably busy running the
-  // initial content scripts and we don't want to force painting then; they're
-  // probably quick and there's some cost to forcing painting.
-  bool mFirstActivate;
-
 public:
   static TabParent* GetTabParentFromLayersId(uint64_t aLayersId);
 };
 
 struct MOZ_STACK_CLASS TabParent::AutoUseNewTab final
 {
 public:
   AutoUseNewTab(TabParent* aNewTab, bool* aWindowIsNew, nsCString* aURLToLoad)