summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
commitdef92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch)
tree2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp
parentAdding debian version 125.0.3-1. (diff)
downloadfirefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz
firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp')
-rw-r--r--dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp b/dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp
index 43f34c456f..8fa0bade00 100644
--- a/dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp
+++ b/dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp
@@ -47,6 +47,22 @@ already_AddRefed<RTCRtpScriptTransform> RTCRtpScriptTransform::Constructor(
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
+
+ // The spec currently fails to describe what to do when the worker is closing
+ // or closed; the following placeholder text can be found in the spec at:
+ // https://w3c.github.io/webrtc-encoded-transform/#dom-rtcrtpscripttransform-rtcrtpscripttransform
+ //
+ // > FIXME: Describe error handling (worker closing flag true at
+ // > RTCRtpScriptTransform creation time. And worker being terminated while
+ // > transform is processing data).
+ //
+ // Because our worker runnables do not like to be pointed at a nonexistant
+ // worker, we throw in this case.
+ if (!aWorker.IsEligibleForMessaging()) {
+ aRv.Throw(NS_ERROR_FAILURE);
+ return nullptr;
+ }
+
auto newTransform = MakeRefPtr<RTCRtpScriptTransform>(ownerWindow);
RefPtr<RTCTransformEventRunnable> runnable =
new RTCTransformEventRunnable(aWorker, &newTransform->GetProxy());