Bug 1658881 - When failing to create a channel and an image request, make sure to set the image blocking status appropriately. r=tnikkel

This is the same status as we do for known no-data protocols here:

  https://searchfox.org/mozilla-central/rev/ac142717cc067d875e83e4b1316f004f6e063a46/dom/base/nsNoDataProtocolContentPolicy.cpp#59

This ensures we treat these two cases the same.

Differential Revision: https://phabricator.services.mozilla.com/D89382
This commit is contained in:
Emilio Cobos Álvarez
2020-09-09 22:58:29 +00:00
parent 41e97cb134
commit 7d2e29552b
4 changed files with 9 additions and 1 deletions

View File

@@ -1211,7 +1211,12 @@ nsresult nsImageLoadingContent::LoadImage(nsIURI* aNewURI, bool aForce,
MOZ_ASSERT(!req, "Shouldn't have non-null request here");
// If we don't have a current URI, we might as well store this URI so people
// know what we tried (and failed) to load.
if (!mCurrentRequest) mCurrentURI = aNewURI;
if (!mCurrentRequest) {
mCurrentURI = aNewURI;
if (mImageBlockingStatus == nsIContentPolicy::ACCEPT) {
mImageBlockingStatus = nsIContentPolicy::REJECT_REQUEST;
}
}
FireEvent(u"error"_ns);
FireEvent(u"loadend"_ns);