summaryrefslogtreecommitdiffstats
path: root/image/imgRequest.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /image/imgRequest.cpp
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'image/imgRequest.cpp')
-rw-r--r--image/imgRequest.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/image/imgRequest.cpp b/image/imgRequest.cpp
index 9713d2f33e..857d1b75eb 100644
--- a/image/imgRequest.cpp
+++ b/image/imgRequest.cpp
@@ -711,16 +711,17 @@ imgRequest::OnStartRequest(nsIRequest* aRequest) {
nsAutoCString mimeType;
nsresult rv = channel->GetContentType(mimeType);
if (NS_SUCCEEDED(rv) && !mimeType.EqualsLiteral(IMAGE_SVG_XML)) {
+ mOffMainThreadData = true;
// Retarget OnDataAvailable to the DecodePool's IO thread.
nsCOMPtr<nsISerialEventTarget> target =
DecodePool::Singleton()->GetIOEventTarget();
rv = retargetable->RetargetDeliveryTo(target);
+ MOZ_LOG(gImgLog, LogLevel::Warning,
+ ("[this=%p] imgRequest::OnStartRequest -- "
+ "RetargetDeliveryTo rv %" PRIu32 "=%s\n",
+ this, static_cast<uint32_t>(rv),
+ NS_SUCCEEDED(rv) ? "succeeded" : "failed"));
}
- MOZ_LOG(gImgLog, LogLevel::Warning,
- ("[this=%p] imgRequest::OnStartRequest -- "
- "RetargetDeliveryTo rv %" PRIu32 "=%s\n",
- this, static_cast<uint32_t>(rv),
- NS_SUCCEEDED(rv) ? "succeeded" : "failed"));
}
return NS_OK;
@@ -834,9 +835,7 @@ static nsresult sniff_mimetype_callback(nsIInputStream* in, void* closure,
/** nsThreadRetargetableStreamListener methods **/
NS_IMETHODIMP
imgRequest::CheckListenerChain() {
- // TODO Might need more checking here.
- NS_ASSERTION(NS_IsMainThread(), "Should be on the main thread!");
- return NS_OK;
+ return mOffMainThreadData ? NS_OK : NS_ERROR_NO_INTERFACE;
}
NS_IMETHODIMP