/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
switch (mAs) { case ResourceType::SCRIPT:
mScript = std::move(aToMove.mScript); break; case ResourceType::STYLE:
mStyle = std::move(aToMove.mStyle); break; case ResourceType::IMAGE: break; case ResourceType::FONT: break; case ResourceType::FETCH: break; case ResourceType::NONE: break;
}
}
PreloadHashKey& PreloadHashKey::operator=(const PreloadHashKey& aOther) {
MOZ_ASSERT(mAs == ResourceType::NONE || aOther.mAs == ResourceType::NONE, "Assigning more than once, only reset is allowed");
nsURIHashKey::operator=(aOther);
mAs = aOther.mAs;
mCORSMode = aOther.mCORSMode;
mPrincipal = aOther.mPrincipal;
switch (mAs) { case ResourceType::SCRIPT:
mScript = aOther.mScript; break; case ResourceType::STYLE:
mStyle = aOther.mStyle; break; case ResourceType::IMAGE: break; case ResourceType::FONT: break; case ResourceType::FETCH: break; case ResourceType::NONE: break;
}
if (!mPrincipal != !aOther->mPrincipal) { // One or the other has a principal, but not both... not equal returnfalse;
}
if (mPrincipal && !mPrincipal->Equals(aOther->mPrincipal)) { returnfalse;
}
if (!nsURIHashKey::KeyEquals( static_cast<const nsURIHashKey*>(aOther)->GetKey())) { returnfalse;
}
switch (mAs) { case ResourceType::SCRIPT: if (mScript.mScriptKind != aOther->mScript.mScriptKind) { returnfalse;
} break; case ResourceType::STYLE: { if (mStyle.mParsingMode != aOther->mStyle.mParsingMode) { returnfalse;
} break;
} case ResourceType::IMAGE: // No more checks needed. The image cache key consists of the document // (which we are scoped into), origin attributes (which we compare as part // of the principal check) and the URL. imgLoader::ValidateEntry compares // CORS, referrer info and principal, which we do by default. break; case ResourceType::FONT: break; case ResourceType::FETCH: // No more checks needed. break; case ResourceType::NONE: break;
}
// Enough to use the common attributes
hash = AddToHash(hash, static_cast<uint32_t>(aKey->mAs));
hash = AddToHash(hash, static_cast<uint32_t>(aKey->mCORSMode));
return hash;
}
} // namespace mozilla
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.