Backed out changeset 3a1f27080f9c (bug 906811) for Linux mochitest failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 28 Aug 2013 20:15:34 -0400
changeset 145126 404c12dddf2842590a716761a29cb5277d811634
parent 145125 cd4f0f51af699bfe17733bc76559cb5afcd6072a
child 145127 b2e8b88878162bec22599c930537a989030fa35e
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
bugs906811
milestone26.0a1
backs out3a1f27080f9c2e05c6260ebf19cfd07bd6ff9c51
Backed out changeset 3a1f27080f9c (bug 906811) for Linux mochitest failures.
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -214,21 +214,18 @@ static NS_DEFINE_CID(kAppShellCID, NS_AP
 #if defined(DEBUG_bryner) || defined(DEBUG_chb)
 //#define DEBUG_DOCSHELL_FOCUS
 #define DEBUG_PAGE_CACHE
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-// Number of active documents currently loading.
-// More properly "the number of documents that are loading that were active when
-// they started loading" because we don't change this number if a document
-// becomes inactive while loading.
-static int32_t gNumberOfActiveDocumentsLoading = 0;
+// Number of documents currently loading
+static int32_t gNumberOfDocumentsLoading = 0;
 
 // Global count of existing docshells.
 static int32_t gDocShellCount = 0;
 
 // Global count of docshells with the private attribute set
 static uint32_t gNumberOfPrivateDocShells = 0;
 
 // Global reference to the URI fixup service.
@@ -781,17 +778,16 @@ nsDocShell::nsDocShell():
     mIsBeingDestroyed(false),
     mIsExecutingOnLoadHandler(false),
     mIsPrintingOrPP(false),
     mSavingOldViewer(false),
 #ifdef DEBUG
     mInEnsureScriptEnv(false),
 #endif
     mAffectPrivateSessionLifetime(true),
-    mTurnOffFavorPerfMode(false),
     mFrameType(eFrameTypeRegular),
     mOwnOrContainingAppId(nsIScriptSecurityManager::UNKNOWN_APP_ID),
     mParentCharsetSource(0)
 {
     mHistoryID = ++gDocshellIDCounter;
     if (gDocShellCount++ == 0) {
         NS_ASSERTION(sURIFixup == nullptr,
                      "Huh, sURIFixup not null in first nsDocShell ctor!");
@@ -6715,19 +6711,18 @@ nsDocShell::EndPageLoad(nsIWebProgress *
         mContentViewer->LoadComplete(aStatus);
         mIsExecutingOnLoadHandler = false;
 
         mEODForCurrentDocument = true;
 
         // If all documents have completed their loading
         // favor native event dispatch priorities
         // over performance
-        if (mTurnOffFavorPerfMode && --gNumberOfActiveDocumentsLoading == 0) {
+        if (--gNumberOfDocumentsLoading == 0) {
           // Hint to use normal native event dispatch priorities 
-          mTurnOffFavorPerfMode = false;
           FavorPerformanceHint(false);
         }
     }
     /* Check if the httpChannel has any cache-control related response headers,
      * like no-store, no-cache. If so, update SHEntry so that 
      * when a user goes back/forward to this page, we appropriately do 
      * form value restoration or load from server.
      */
@@ -7722,22 +7717,18 @@ nsDocShell::RestoreFromHistory()
 
     // This is the end of our Embed() replacement
 
     mSavingOldViewer = false;
     mEODForCurrentDocument = false;
 
     // Tell the event loop to favor plevents over user events, see comments
     // in CreateContentViewer.
-    if (mIsActive) {
-        mTurnOffFavorPerfMode = true;
-        if (++gNumberOfActiveDocumentsLoading == 1) {
-          FavorPerformanceHint(true);
-        }
-    }
+    if (++gNumberOfDocumentsLoading == 1)
+        FavorPerformanceHint(true);
 
 
     if (oldMUDV && newMUDV) {
         newMUDV->SetMinFontSize(minFontSize);
         newMUDV->SetTextZoom(textZoom);
         newMUDV->SetFullZoom(pageZoom);
         newMUDV->SetAuthorStyleDisabled(styleDisabled);
     }
@@ -8128,24 +8119,21 @@ nsDocShell::CreateContentViewer(const ch
           doc->SetPartID(partID);
         }
       }
     }
 
     // Give hint to native plevent dispatch mechanism. If a document
     // is loading the native plevent dispatch mechanism should favor
     // performance over normal native event dispatch priorities.
-    if (mIsActive) {
+    if (++gNumberOfDocumentsLoading == 1) {
       // Hint to favor performance for the plevent notification mechanism.
       // We want the pages to load as fast as possible even if its means 
       // native messages might be starved.
-      mTurnOffFavorPerfMode = true;
-      if (++gNumberOfActiveDocumentsLoading == 1) {
-        FavorPerformanceHint(true);
-      }
+      FavorPerformanceHint(true);
     }
 
     if (onLocationChangeNeeded) {
       FireOnLocationChange(this, request, mCurrentURI, 0);
     }
   
     return NS_OK;
 }
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -849,17 +849,16 @@ protected:
     bool                       mSavingOldViewer;
     
     // @see nsIDocShellHistory::createdDynamically
     bool                       mDynamicallyCreated;
 #ifdef DEBUG
     bool                       mInEnsureScriptEnv;
 #endif
     bool                       mAffectPrivateSessionLifetime;
-    bool                       mTurnOffFavorPerfMode;
     uint64_t                   mHistoryID;
 
     static nsIURIFixup *sURIFixup;
 
     nsRefPtr<nsDOMNavigationTiming> mTiming;
 
     // Are we a regular frame, a browser frame, or an app frame?
     FrameType mFrameType;