Bug 1561645 - report only http/https schemes; r=baku

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Liang-Heng Chen 2019-06-27 08:25:26 +00:00
Родитель 62645647cf
Коммит 6e38d3f928
1 изменённых файлов: 11 добавлений и 8 удалений

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

@ -10474,6 +10474,13 @@ bool Document::CanSavePresentation(nsIRequest* aNewRequest,
return ret;
}
static bool HasHttpScheme(nsIURI* aURI) {
bool isHttpish = false;
return aURI &&
((NS_SUCCEEDED(aURI->SchemeIs("http", &isHttpish)) && isHttpish) ||
(NS_SUCCEEDED(aURI->SchemeIs("https", &isHttpish)) && isHttpish));
}
void Document::Destroy() {
// The ContentViewer wants to release the document now. So, tell our content
// to drop any references to the document so that it can be destroyed.
@ -10483,7 +10490,10 @@ void Document::Destroy() {
if (!nsContentUtils::IsInPrivateBrowsing(this) &&
IsTopLevelContentDocument()) {
mContentBlockingLog.ReportLog(NodePrincipal());
mContentBlockingLog.ReportOrigins();
if (HasHttpScheme(GetDocumentURI())) {
mContentBlockingLog.ReportOrigins();
}
}
mIsGoingAway = true;
@ -10829,13 +10839,6 @@ static void DispatchFullscreenChange(Document* aDocument, nsINode* aTarget) {
static void ClearPendingFullscreenRequests(Document* aDoc);
static bool HasHttpScheme(nsIURI* aURI) {
bool isHttpish = false;
return aURI &&
((NS_SUCCEEDED(aURI->SchemeIs("http", &isHttpish)) && isHttpish) ||
(NS_SUCCEEDED(aURI->SchemeIs("https", &isHttpish)) && isHttpish));
}
void Document::OnPageHide(bool aPersisted, EventTarget* aDispatchStartTarget,
bool aOnlySystemGroup) {
if (IsTopLevelContentDocument() && GetDocGroup() &&