Bug 1594529 - Adding in asserts for LoadURI to ensure we have the correct contentPolicyType, r=kmag

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kingston 2020-04-14 19:13:15 +00:00
Родитель 349e62fa06
Коммит 740b0cb1d4
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -9702,6 +9702,13 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
securityFlags |= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
}
// Must never have a parent for TYPE_DOCUMENT loads
MOZ_ASSERT_IF(contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT,
!mBrowsingContext->GetParent());
// Subdocuments must have a parent
MOZ_ASSERT_IF(contentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT,
mBrowsingContext->GetParent());
RefPtr<LoadInfo> loadInfo =
(contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT)
? new LoadInfo(loadingWindow, aLoadState->TriggeringPrincipal(),