Bug 1493060 - Convert an overly aggressive assertion into a runtime check r=baku

None of the callers of this function ensure the argument passed
down here is actually a tracking window, so we need to properly
check it here rather than merely assert.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ehsan Akhgari 2018-09-24 17:18:21 +00:00
parent c37151f2e9
commit c30d164711

View File

@ -65,7 +65,9 @@ GetParentPrincipalAndTrackingOrigin(nsGlobalWindowInner* a3rdPartyTrackingWindow
nsIPrincipal** aTopLevelStoragePrincipal,
nsACString& aTrackingOrigin)
{
MOZ_ASSERT(nsContentUtils::IsTrackingResourceWindow(a3rdPartyTrackingWindow));
if (!nsContentUtils::IsTrackingResourceWindow(a3rdPartyTrackingWindow)) {
return false;
}
nsIDocument* doc = a3rdPartyTrackingWindow->GetDocument();
// Make sure storage access isn't disabled