зеркало из 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) ==
|
||||
ChannelBlockDecision::Unblocked) {
|
||||
ContentBlockingNotifier::OnEvent(
|
||||
aChannel, nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT,
|
||||
false);
|
||||
*aShouldContinue = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -152,6 +152,10 @@ UrlClassifierFeatureFingerprintingProtection::ProcessChannel(
|
|||
|
||||
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
||||
ChannelBlockDecision::Unblocked) {
|
||||
ContentBlockingNotifier::OnEvent(
|
||||
aChannel, nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT,
|
||||
false);
|
||||
*aShouldContinue = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -148,6 +148,10 @@ UrlClassifierFeatureSocialTrackingProtection::ProcessChannel(
|
|||
|
||||
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
||||
ChannelBlockDecision::Unblocked) {
|
||||
ContentBlockingNotifier::OnEvent(
|
||||
aChannel, nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT,
|
||||
false);
|
||||
*aShouldContinue = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -152,6 +152,9 @@ UrlClassifierFeatureTrackingProtection::ProcessChannel(
|
|||
|
||||
if (ChannelClassifierService::OnBeforeBlockChannel(aChannel, mName, list) ==
|
||||
ChannelBlockDecision::Unblocked) {
|
||||
ContentBlockingNotifier::OnEvent(
|
||||
aChannel, nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT,
|
||||
false);
|
||||
*aShouldContinue = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -158,6 +158,10 @@ Maybe<uint32_t> ContentBlockingLog::RecordLogParent(
|
|||
aTrackingFullHashes);
|
||||
break;
|
||||
|
||||
case nsIWebProgressListener::STATE_UNBLOCKED_UNSAFE_CONTENT:
|
||||
RecordLogInternal(aOrigin, aType, blockedValue);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Ignore nsIWebProgressListener::STATE_BLOCKED_UNSAFE_CONTENT;
|
||||
break;
|
||||
|
|
|
@ -496,7 +496,7 @@ void ContentBlockingNotifier::OnDecision(BrowsingContext* aBrowsingContext,
|
|||
|
||||
/* static */
|
||||
void ContentBlockingNotifier::OnEvent(nsIChannel* aTrackingChannel,
|
||||
uint32_t aRejectedReason) {
|
||||
uint32_t aRejectedReason, bool aBlocked) {
|
||||
MOZ_ASSERT(XRE_IsParentProcess() && aTrackingChannel);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
|
@ -507,7 +507,7 @@ void ContentBlockingNotifier::OnEvent(nsIChannel* aTrackingChannel,
|
|||
Unused << nsContentUtils::GetASCIIOrigin(uri, trackingOrigin);
|
||||
}
|
||||
|
||||
return ContentBlockingNotifier::OnEvent(aTrackingChannel, true,
|
||||
return ContentBlockingNotifier::OnEvent(aTrackingChannel, aBlocked,
|
||||
aRejectedReason, trackingOrigin);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ class ContentBlockingNotifier final {
|
|||
static void OnDecision(dom::BrowsingContext* aBrowsingContext,
|
||||
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(
|
||||
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_BLOCKED_SOCIALTRACKING_CONTENT = 0x00010000;
|
||||
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче