Backed out changeset c0e5f138b42a (bug 1376964)

This commit is contained in:
Carsten "Tomcat" Book 2017-07-12 12:41:39 +02:00
Родитель d767449ced
Коммит 12b87e384a
2 изменённых файлов: 9 добавлений и 11 удалений

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

@ -107,7 +107,6 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowInner* aWindow, nsIDocument* aDocument)
, mHasLoadingFontFacesIsDirty(false)
, mDelayedLoadCheck(false)
, mBypassCache(false)
, mPrivateBrowsing(false)
{
MOZ_ASSERT(mDocument, "We should get a valid document from the caller!");
@ -138,11 +137,6 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowInner* aWindow, nsIDocument* aDocument)
}
}
// Same for the "private browsing" flag.
if (nsCOMPtr<nsILoadContext> loadContext = mDocument->GetLoadContext()) {
mPrivateBrowsing = loadContext->UsePrivateBrowsing();
}
if (!mDocument->DidFireDOMContentLoaded()) {
mDocument->AddSystemEventListener(NS_LITERAL_STRING("DOMContentLoaded"),
this, false, false);
@ -1455,6 +1449,13 @@ FontFaceSet::SyncLoadFontData(gfxUserFontEntry* aFontToLoad,
return NS_OK;
}
bool
FontFaceSet::GetPrivateBrowsing()
{
nsCOMPtr<nsILoadContext> loadContext = mDocument->GetLoadContext();
return loadContext && loadContext->UsePrivateBrowsing();
}
void
FontFaceSet::OnFontFaceStatusChanged(FontFace* aFontFace)
{
@ -1863,7 +1864,7 @@ FontFaceSet::UserFontSet::SyncLoadFontData(gfxUserFontEntry* aFontToLoad,
/* virtual */ bool
FontFaceSet::UserFontSet::GetPrivateBrowsing()
{
return mFontFaceSet && mFontFaceSet->mPrivateBrowsing;
return mFontFaceSet && mFontFaceSet->GetPrivateBrowsing();
}
/* virtual */ void

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

@ -265,6 +265,7 @@ private:
nsIPrincipal** aPrincipal,
bool* aBypassCache);
bool IsFontLoadAllowed(nsIURI* aFontLocation, nsIPrincipal* aPrincipal);
bool GetPrivateBrowsing();
nsresult SyncLoadFontData(gfxUserFontEntry* aFontToLoad,
const gfxFontFaceSrc* aFontFaceSrc,
uint8_t*& aBuffer,
@ -358,10 +359,6 @@ private:
// Whether the docshell for our document indicated that loads should
// bypass the cache.
bool mBypassCache;
// Whether the docshell for our document indicates that we are in private
// browsing mode.
bool mPrivateBrowsing;
};
} // namespace dom