Bug 1515063 - Add error categories for the console errors reported from the anti-tracking backend; r=baku

Differential Revision: https://phabricator.services.mozilla.com/D14862

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ehsan Akhgari 2018-12-18 15:21:04 +00:00
Родитель 14c2b81c65
Коммит c4ecc7c9bd
1 изменённых файлов: 8 добавлений и 3 удалений

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

@ -242,21 +242,26 @@ void ReportBlockingToConsole(nsPIDOMWindowOuter* aWindow, nsIURI* aURI,
}
const char* message = nullptr;
nsAutoCString category;
switch (aRejectedReason) {
case nsIWebProgressListener::STATE_COOKIES_BLOCKED_BY_PERMISSION:
message = "CookieBlockedByPermission";
category = NS_LITERAL_CSTRING("cookieBlockedPermission");
break;
case nsIWebProgressListener::STATE_COOKIES_BLOCKED_TRACKER:
message = "CookieBlockedTracker";
category = NS_LITERAL_CSTRING("cookieBlockedTracker");
break;
case nsIWebProgressListener::STATE_COOKIES_BLOCKED_ALL:
message = "CookieBlockedAll";
category = NS_LITERAL_CSTRING("cookieBlockedAll");
break;
case nsIWebProgressListener::STATE_COOKIES_BLOCKED_FOREIGN:
message = "CookieBlockedForeign";
category = NS_LITERAL_CSTRING("cookieBlockedForeign");
break;
default:
@ -277,9 +282,9 @@ void ReportBlockingToConsole(nsPIDOMWindowOuter* aWindow, nsIURI* aURI,
NS_ConvertUTF8toUTF16 spec(exposableURI->GetSpecOrDefault());
const char16_t* params[] = {spec.get()};
nsContentUtils::ReportToConsole(
nsIScriptError::warningFlag, NS_LITERAL_CSTRING("Content Blocking"), doc,
nsContentUtils::eNECKO_PROPERTIES, message, params, ArrayLength(params));
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag, category, doc,
nsContentUtils::eNECKO_PROPERTIES, message,
params, ArrayLength(params));
}
void ReportUnblockingConsole(