зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1482117 - Part 1: Make FastBlock happen after tailing; r=mayhemer
move the FastBlock checking block to |TriggerNetwork| Differential Revision: https://phabricator.services.mozilla.com/D3199 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e60252016a
Коммит
837bec1102
|
@ -638,11 +638,6 @@ nsHttpChannel::Connect()
|
|||
NS_SUCCEEDED(thirdPartyUtil->IsThirdPartyChannel(this, nullptr,
|
||||
&result)) &&
|
||||
result) {
|
||||
if (CheckFastBlocked()) {
|
||||
Unused << AsyncAbort(NS_ERROR_ABORT);
|
||||
CloseCacheEntry(false);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
AddClassFlags(nsIClassOfService::Tail);
|
||||
}
|
||||
|
@ -699,6 +694,14 @@ nsHttpChannel::CheckFastBlocked()
|
|||
Preferences::AddUintVarCache(&sFastBlockTimeout, "browser.fastblock.timeout");
|
||||
}
|
||||
|
||||
nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil = services::GetThirdPartyUtil();
|
||||
bool result = false;
|
||||
if (!thirdPartyUtil ||
|
||||
NS_FAILED(thirdPartyUtil->IsThirdPartyChannel(this, nullptr, &result)) ||
|
||||
!result) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TimeStamp timestamp;
|
||||
if (NS_FAILED(GetNavigationStartTimeStamp(×tamp))) {
|
||||
return false;
|
||||
|
@ -726,6 +729,13 @@ nsHttpChannel::ConnectOnTailUnblock()
|
|||
|
||||
LOG(("nsHttpChannel::ConnectOnTailUnblock [this=%p]\n", this));
|
||||
|
||||
bool isTrackingResource = mIsTrackingResource; // is atomic
|
||||
if (isTrackingResource && CheckFastBlocked()) {
|
||||
Unused << AsyncAbort(NS_ERROR_ABORT);
|
||||
CloseCacheEntry(false);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Consider opening a TCP connection right away.
|
||||
SpeculativeConnect();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче