Bug 1380351 - Reschedule HTTP transaction when ClassOfService flags influencing its priority are changed, r=mcmanus
authorHonza Bambas <honzab.moz@firemni.cz>
Wed, 12 Jul 2017 08:42:00 +0200
changeset 608367 03b7dd48f78c45c085cea9b9e15ed30172873907
parent 608366 ff324c369c9cbaf010b7e8bd6b93348e5d378a03
child 608368 e8dd724b3cdf515dcf3e219c6597c01c0adf66ca
push id68249
push userbmo:rail@mozilla.com
push dateThu, 13 Jul 2017 14:21:35 +0000
reviewersmcmanus
bugs1380351
milestone56.0a1
Bug 1380351 - Reschedule HTTP transaction when ClassOfService flags influencing its priority are changed, r=mcmanus
netwerk/protocol/http/nsHttpConnectionMgr.cpp
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -2273,17 +2273,22 @@ nsHttpConnectionMgr::OnMsgReschedTransac
 void nsHttpConnectionMgr::OnMsgUpdateClassOfServiceOnTransaction(int32_t arg, ARefBase *param)
 {
     MOZ_ASSERT(OnSocketThread(), "not on socket thread");
     LOG(("nsHttpConnectionMgr::OnMsgUpdateClassOfServiceOnTransaction [trans=%p]\n", param));
 
     uint32_t cos = static_cast<uint32_t>(arg);
     nsHttpTransaction *trans = static_cast<nsHttpTransaction *>(param);
 
+    uint32_t previous = trans->ClassOfService();
     trans->SetClassOfService(cos);
+
+    if ((previous ^ cos) & (NS_HTTP_LOAD_AS_BLOCKING | NS_HTTP_LOAD_UNBLOCKED)) {
+        Unused << RescheduleTransaction(trans, trans->Priority());
+    }
 }
 
 void
 nsHttpConnectionMgr::OnMsgCancelTransaction(int32_t reason, ARefBase *param)
 {
     MOZ_ASSERT(OnSocketThread(), "not on socket thread");
     LOG(("nsHttpConnectionMgr::OnMsgCancelTransaction [trans=%p]\n", param));