Bug 1380351 - Reschedule HTTP transaction when ClassOfService flags influencing its priority are changed, r=mcmanus
--- 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));