Bug 1376964 - Part 6: Use gfxFontSrcURI in the user font set and cache. r=jfkthame
MozReview-Commit-ID: 7eWOTs4kF4v
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "FontFaceSet.h"
|
||||
|
||||
#include "gfxFontConstants.h"
|
||||
#include "gfxFontSrcURI.h"
|
||||
#include "mozilla/css/Declaration.h"
|
||||
#include "mozilla/css/Loader.h"
|
||||
#include "mozilla/dom/FontFaceSetBinding.h"
|
||||
@@ -631,7 +632,7 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry,
|
||||
// being loaded might have a different origin from the principal of the
|
||||
// stylesheet that initiated the font load.
|
||||
rv = NS_NewChannelWithTriggeringPrincipal(getter_AddRefs(channel),
|
||||
aFontFaceSrc->mURI,
|
||||
aFontFaceSrc->mURI->get(),
|
||||
mDocument,
|
||||
aUserFontEntry->GetPrincipal(),
|
||||
nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS,
|
||||
@@ -640,7 +641,8 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
RefPtr<nsFontFaceLoader> fontLoader =
|
||||
new nsFontFaceLoader(aUserFontEntry, aFontFaceSrc->mURI, this, channel);
|
||||
new nsFontFaceLoader(aUserFontEntry, aFontFaceSrc->mURI->get(), this,
|
||||
channel);
|
||||
|
||||
if (LOG_ENABLED()) {
|
||||
LOG(("userfonts (%p) download start - font uri: (%s) "
|
||||
@@ -682,7 +684,8 @@ FontFaceSet::StartLoad(gfxUserFontEntry* aUserFontEntry,
|
||||
rv = NS_NewStreamLoader(getter_AddRefs(streamLoader), fontLoader);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mozilla::net::PredictorLearn(aFontFaceSrc->mURI, mDocument->GetDocumentURI(),
|
||||
mozilla::net::PredictorLearn(aFontFaceSrc->mURI->get(),
|
||||
mDocument->GetDocumentURI(),
|
||||
nsINetworkPredictor::LEARN_LOAD_SUBRESOURCE,
|
||||
loadGroup);
|
||||
|
||||
@@ -1119,7 +1122,8 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace(const nsAString& aFamilyName,
|
||||
break;
|
||||
case eCSSUnit_URL: {
|
||||
face->mSourceType = gfxFontFaceSrc::eSourceType_URL;
|
||||
face->mURI = val.GetURLValue();
|
||||
nsIURI* uri = val.GetURLValue();
|
||||
face->mURI = uri ? new gfxFontSrcURI(uri) : nullptr;
|
||||
URLValue* url = val.GetURLStructValue();
|
||||
face->mReferrer = url->mExtraData->GetReferrer();
|
||||
face->mReferrerPolicy = mDocument->GetReferrerPolicy();
|
||||
@@ -1400,7 +1404,7 @@ FontFaceSet::SyncLoadFontData(gfxUserFontEntry* aFontToLoad,
|
||||
// whether we use SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS or not, to be more
|
||||
// restrictive we use SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS.
|
||||
rv = NS_NewChannelWithTriggeringPrincipal(getter_AddRefs(channel),
|
||||
aFontFaceSrc->mURI,
|
||||
aFontFaceSrc->mURI->get(),
|
||||
mDocument,
|
||||
aFontToLoad->GetPrincipal(),
|
||||
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS,
|
||||
|
||||
Reference in New Issue
Block a user