Bug 1558915 - Use infallible nsIURI::SchemeIs in image/ r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D40459
This commit is contained in:
Tom Schuster
2019-08-03 09:44:12 +00:00
parent ea8be2c775
commit f2da11f06e
8 changed files with 15 additions and 44 deletions

View File

@@ -48,9 +48,9 @@ ImageCacheKey::ImageCacheKey(nsIURI* aURI, const OriginAttributes& aAttrs,
mControlledDocument(GetSpecialCaseDocumentToken(aDocument, aURI)),
mTopLevelBaseDomain(GetTopLevelBaseDomain(aDocument, aURI)),
mIsChrome(false) {
if (SchemeIs("blob")) {
if (mURI->SchemeIs("blob")) {
mBlobSerial = BlobSerial(mURI);
} else if (SchemeIs("chrome")) {
} else if (mURI->SchemeIs("chrome")) {
mIsChrome = true;
}
}
@@ -144,11 +144,6 @@ void ImageCacheKey::EnsureHash() const {
mHash.emplace(hash);
}
bool ImageCacheKey::SchemeIs(const char* aScheme) {
bool matches = false;
return NS_SUCCEEDED(mURI->SchemeIs(aScheme, &matches)) && matches;
}
/* static */
void* ImageCacheKey::GetSpecialCaseDocumentToken(Document* aDocument,
nsIURI* aURI) {