Backed out 2 changesets (bug 1485400) for build bustage at build/src/netwerk/base/nsChannelClassifier.cpp on a CLOSED TREE

Backed out changeset c476aa79a8ca (bug 1485400)
Backed out changeset 9370432b26ad (bug 1485400)
This commit is contained in:
Coroiu Cristina 2018-08-31 18:57:58 +03:00
Родитель 238c91a232
Коммит 437a1f4445
5 изменённых файлов: 18 добавлений и 32 удалений

Просмотреть файл

@ -3555,16 +3555,14 @@ public:
--mIgnoreOpensDuringUnloadCounter;
}
void IncrementTrackerCount()
void IncrementTrackerCount(bool aIsTrackerBlocked)
{
MOZ_ASSERT(!GetSameTypeParentDocument());
++mNumTrackersFound;
}
void IncrementTrackerBlockedCount()
{
MOZ_ASSERT(!GetSameTypeParentDocument());
++mNumTrackersBlocked;
++mNumTrackersFound;
if (aIsTrackerBlocked) {
++mNumTrackersBlocked;
}
}
uint32_t NumTrackersFound()

Просмотреть файл

@ -911,6 +911,8 @@ nsChannelClassifier::SetBlockedContent(nsIChannel *channel,
nsCOMPtr<nsIDocument> doc = docShell->GetDocument();
NS_ENSURE_TRUE(doc, NS_OK);
doc->IncrementTrackerCount(true);
unsigned state;
if (aErrorCode == NS_ERROR_TRACKING_URI) {
state = nsIWebProgressListener::STATE_BLOCKED_TRACKING_CONTENT;

Просмотреть файл

@ -331,10 +331,6 @@ HttpBaseChannel::SetIsTrackingResource(bool aIsThirdParty)
MOZ_ASSERT(!mIsThirdPartyTrackingResource);
mIsFirstPartyTrackingResource = true;
}
if (mLoadInfo) {
MOZ_ALWAYS_SUCCEEDS(mLoadInfo->SetIsTracker(true));
}
}
nsresult

Просмотреть файл

@ -747,10 +747,10 @@ HttpChannelChild::DoOnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
}
bool isTracker;
MOZ_ALWAYS_SUCCEEDS(mLoadInfo->GetIsTracker(&isTracker));
if (isTracker) {
if (NS_SUCCEEDED(mLoadInfo->GetIsTracker(&isTracker)) && isTracker) {
bool isTrackerBlocked;
MOZ_ALWAYS_SUCCEEDS(mLoadInfo->GetIsTrackerBlocked(&isTrackerBlocked));
Unused << mLoadInfo->GetIsTrackerBlocked(&isTrackerBlocked);
LOG(("HttpChannelChild::DoOnStartRequest FastBlock %d [this=%p]\n",
isTrackerBlocked,
this));
@ -758,10 +758,8 @@ HttpChannelChild::DoOnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
nsCOMPtr<nsIDocument> doc;
if (!NS_WARN_IF(NS_FAILED(GetTopDocument(this,
getter_AddRefs(doc))))) {
doc->IncrementTrackerCount();
if (isTrackerBlocked) {
doc->IncrementTrackerBlockedCount();
}
doc->IncrementTrackerCount(isTrackerBlocked);
}
}

Просмотреть файл

@ -694,7 +694,6 @@ bool
nsHttpChannel::CheckFastBlocked()
{
LOG(("nsHttpChannel::CheckFastBlocked [this=%p]\n", this));
MOZ_ASSERT(mIsThirdPartyTrackingResource);
static bool sFastBlockInited = false;
static bool sIsFastBlockEnabled = false;
@ -707,26 +706,23 @@ nsHttpChannel::CheckFastBlocked()
}
TimeStamp timestamp;
if (NS_FAILED(GetNavigationStartTimeStamp(&timestamp)) || !timestamp) {
LOG(("FastBlock passed (no timestamp) [this=%p]\n", this));
if (NS_FAILED(GetNavigationStartTimeStamp(&timestamp))) {
return false;
}
if (!StaticPrefs::browser_contentblocking_enabled() ||
!sIsFastBlockEnabled ||
IsContentPolicyTypeWhitelistedForFastBlock(mLoadInfo)) {
LOG(("FastBlock passed (invalid) [this=%p]\n", this));
IsContentPolicyTypeWhitelistedForFastBlock(mLoadInfo) ||
!timestamp) {
return false;
}
TimeDuration duration = TimeStamp::NowLoRes() - timestamp;
bool isFastBlocking = duration.ToMilliseconds() >= sFastBlockTimeout;
if (isFastBlocking && mLoadInfo) {
MOZ_ALWAYS_SUCCEEDS(mLoadInfo->SetIsTrackerBlocked(true));
if (mLoadInfo) {
MOZ_ALWAYS_SUCCEEDS(mLoadInfo->SetIsTracker(true));
MOZ_ALWAYS_SUCCEEDS(mLoadInfo->SetIsTrackerBlocked(isFastBlocking));
}
LOG(("FastBlock %s (%lf) [this=%p]\n",
@ -6109,10 +6105,6 @@ nsHttpChannel::CancelInternal(nsresult status)
!!mTrackingProtectionCancellationPending;
if (status == NS_ERROR_TRACKING_URI) {
mTrackingProtectionCancellationPending = 0;
if (mLoadInfo) {
MOZ_ALWAYS_SUCCEEDS(mLoadInfo->SetIsTracker(true));
MOZ_ALWAYS_SUCCEEDS(mLoadInfo->SetIsTrackerBlocked(true));
}
}
mCanceled = true;