зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1662362 - Record STATE_UNBLOCKED_UNSAFE_CONTENT event to content blocking log when unblock API of URL Classifier is called r=nhnt11,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D88957
This commit is contained in:
Родитель
5763aba6d5
Коммит
f3da525903
|
@ -145,6 +145,9 @@ UrlClassifierFeatureCryptominingProtection::ProcessChannel(
|
||||||
|
|
||||||
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
||||||
ChannelBlockDecision::Unblocked) {
|
ChannelBlockDecision::Unblocked) {
|
||||||
|
ContentBlockingNotifier::OnEvent(
|
||||||
|
aChannel, nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT,
|
||||||
|
false);
|
||||||
*aShouldContinue = true;
|
*aShouldContinue = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,6 +152,10 @@ UrlClassifierFeatureFingerprintingProtection::ProcessChannel(
|
||||||
|
|
||||||
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
||||||
ChannelBlockDecision::Unblocked) {
|
ChannelBlockDecision::Unblocked) {
|
||||||
|
ContentBlockingNotifier::OnEvent(
|
||||||
|
aChannel, nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT,
|
||||||
|
false);
|
||||||
|
*aShouldContinue = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,10 @@ UrlClassifierFeatureSocialTrackingProtection::ProcessChannel(
|
||||||
|
|
||||||
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
||||||
ChannelBlockDecision::Unblocked) {
|
ChannelBlockDecision::Unblocked) {
|
||||||
|
ContentBlockingNotifier::OnEvent(
|
||||||
|
aChannel, nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT,
|
||||||
|
false);
|
||||||
|
*aShouldContinue = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,9 @@ UrlClassifierFeatureTrackingProtection::ProcessChannel(
|
||||||
|
|
||||||
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
||||||
ChannelBlockDecision::Unblocked) {
|
ChannelBlockDecision::Unblocked) {
|
||||||
|
ContentBlockingNotifier::OnEvent(
|
||||||
|
aChannel, nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT,
|
||||||
|
false);
|
||||||
*aShouldContinue = true;
|
*aShouldContinue = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,6 +158,10 @@ Maybe<uint32_t> ContentBlockingLog::RecordLogParent(
|
||||||
aTrackingFullHashes);
|
aTrackingFullHashes);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT:
|
||||||
|
RecordLogInternal(aOrigin, aType, blockedValue);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Ignore nsIWebProgressListener::STATE_BLOCKED_UNSAFE_CONTENT;
|
// Ignore nsIWebProgressListener::STATE_BLOCKED_UNSAFE_CONTENT;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -496,7 +496,7 @@ void ContentBlockingNotifier::OnDecision(BrowsingContext* aBrowsingContext,
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
void ContentBlockingNotifier::OnEvent(nsIChannel* aTrackingChannel,
|
void ContentBlockingNotifier::OnEvent(nsIChannel* aTrackingChannel,
|
||||||
uint32_t aRejectedReason) {
|
uint32_t aRejectedReason, bool aBlocked) {
|
||||||
MOZ_ASSERT(XRE_IsParentProcess() && aTrackingChannel);
|
MOZ_ASSERT(XRE_IsParentProcess() && aTrackingChannel);
|
||||||
|
|
||||||
nsCOMPtr<nsIURI> uri;
|
nsCOMPtr<nsIURI> uri;
|
||||||
|
@ -507,7 +507,7 @@ void ContentBlockingNotifier::OnEvent(nsIChannel* aTrackingChannel,
|
||||||
Unused << nsContentUtils::GetASCIIOrigin(uri, trackingOrigin);
|
Unused << nsContentUtils::GetASCIIOrigin(uri, trackingOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ContentBlockingNotifier::OnEvent(aTrackingChannel, true,
|
return ContentBlockingNotifier::OnEvent(aTrackingChannel, aBlocked,
|
||||||
aRejectedReason, trackingOrigin);
|
aRejectedReason, trackingOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,8 @@ class ContentBlockingNotifier final {
|
||||||
static void OnDecision(dom::BrowsingContext* aBrowsingContext,
|
static void OnDecision(dom::BrowsingContext* aBrowsingContext,
|
||||||
BlockingDecision aDecision, uint32_t aRejectedReason);
|
BlockingDecision aDecision, uint32_t aRejectedReason);
|
||||||
|
|
||||||
static void OnEvent(nsIChannel* aChannel, uint32_t aRejectedReason);
|
static void OnEvent(nsIChannel* aChannel, uint32_t aRejectedReason,
|
||||||
|
bool aBlocked = true);
|
||||||
|
|
||||||
static void OnEvent(
|
static void OnEvent(
|
||||||
nsIChannel* aChannel, bool aBlocked, uint32_t aRejectedReason,
|
nsIChannel* aChannel, bool aBlocked, uint32_t aRejectedReason,
|
||||||
|
|
|
@ -352,6 +352,7 @@ interface nsIWebProgressListener : nsISupports
|
||||||
const unsigned long STATE_COOKIES_BLOCKED_FOREIGN = 0x00000080;
|
const unsigned long STATE_COOKIES_BLOCKED_FOREIGN = 0x00000080;
|
||||||
const unsigned long STATE_BLOCKED_SOCIALTRACKING_CONTENT = 0x00010000;
|
const unsigned long STATE_BLOCKED_SOCIALTRACKING_CONTENT = 0x00010000;
|
||||||
const unsigned long STATE_LOADED_SOCIALTRACKING_CONTENT = 0x00020000;
|
const unsigned long STATE_LOADED_SOCIALTRACKING_CONTENT = 0x00020000;
|
||||||
|
const unsigned long STATE_UNBLOCKED_UNSAFE_CONTENT = 0x00000010;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notification indicating the state has changed for one of the requests
|
* Notification indicating the state has changed for one of the requests
|
||||||
|
|
Загрузка…
Ссылка в новой задаче