Bug 1395472 - Don't move background transactions' streams to background group when the pref is off. r=hurley
authorKershaw Chang <kechang@mozilla.com>
Sun, 03 Sep 2017 23:55:00 -0400
changeset 428351 ca6fb76e5158e044073dce51d3654536b4a6332c
parent 428350 9296a073916948eb7c88f1025aae04072c57dc66
child 428352 4badc1d24b23c18e7fc9cb42332e19fe16c7ee74
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley
bugs1395472
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1395472 - Don't move background transactions' streams to background group when the pref is off. r=hurley
netwerk/protocol/http/Http2Stream.cpp
netwerk/protocol/http/nsHttpConnectionMgr.cpp
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -1269,32 +1269,35 @@ Http2Stream::UpdatePriorityDependency()
   // streams for folowers (images) depend on b
   // default streams (xhr, async js) depend on 5
   // explicit bg streams (beacon, etc..) depend on 7
   // spculative bg streams depend on 9
   // urgent-start streams depend on d
 
   mPriorityDependency = GetPriorityDependencyFromTransaction(trans);
 
-  if (mTransactionTabId != mCurrentForegroundTabOuterContentWindowId &&
+  if (gHttpHandler->ActiveTabPriority() &&
+      mTransactionTabId != mCurrentForegroundTabOuterContentWindowId &&
       mPriorityDependency != Http2Session::kUrgentStartGroupID) {
     LOG3(("Http2Stream::UpdatePriorityDependency %p "
           " depends on background group for trans %p\n",
           this, trans));
     mPriorityDependency = Http2Session::kBackgroundGroupID;
   }
 
   LOG3(("Http2Stream::UpdatePriorityDependency %p "
         "depends on stream 0x%X\n",
         this, mPriorityDependency));
 }
 
 void
 Http2Stream::TopLevelOuterContentWindowIdChanged(uint64_t windowId)
 {
+  MOZ_ASSERT(gHttpHandler->ActiveTabPriority());
+
   LOG3(("Http2Stream::TopLevelOuterContentWindowIdChanged "
         "%p windowId=%" PRIx64 "\n",
         this, windowId));
 
   mCurrentForegroundTabOuterContentWindowId = windowId;
 
   if (!mSession->UseH2Deps()) {
     return;
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -3468,17 +3468,19 @@ nsHttpConnectionMgr::OnMsgUpdateCurrentT
     }
 
     bool activeTabWasLoading = mActiveTabTransactionsExist;
     bool activeTabIdChanged = mCurrentTopLevelOuterContentWindowId != winId;
 
     uint64_t previousWindowId = mCurrentTopLevelOuterContentWindowId;
     mCurrentTopLevelOuterContentWindowId = winId;
 
-    NotifyConnectionOfWindowIdChange(previousWindowId);
+    if (gHttpHandler->ActiveTabPriority()) {
+        NotifyConnectionOfWindowIdChange(previousWindowId);
+    }
 
     LOG(("nsHttpConnectionMgr::OnMsgUpdateCurrentTopLevelOuterContentWindowId"
          " id=%" PRIx64 "\n",
          mCurrentTopLevelOuterContentWindowId));
 
     nsTArray<RefPtr<nsHttpTransaction>> *transactions = nullptr;
 
     if (activeTabIdChanged) {