diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /dom/media/webrtc/jsapi | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-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 'dom/media/webrtc/jsapi')
-rw-r--r-- | dom/media/webrtc/jsapi/PeerConnectionCtx.cpp | 5 | ||||
-rw-r--r-- | dom/media/webrtc/jsapi/RTCRtpScriptTransform.cpp | 16 | ||||
-rw-r--r-- | dom/media/webrtc/jsapi/RTCRtpScriptTransformer.cpp | 2 | ||||
-rw-r--r-- | dom/media/webrtc/jsapi/RTCRtpScriptTransformer.h | 2 | ||||
-rw-r--r-- | dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp | 2 |
5 files changed, 22 insertions, 5 deletions
diff --git a/dom/media/webrtc/jsapi/PeerConnectionCtx.cpp b/dom/media/webrtc/jsapi/PeerConnectionCtx.cpp index d293fa0be6..b9b9ab8fc5 100644 --- a/dom/media/webrtc/jsapi/PeerConnectionCtx.cpp +++ b/dom/media/webrtc/jsapi/PeerConnectionCtx.cpp @@ -129,11 +129,12 @@ class DummyAudioProcessing : public AudioProcessing { } void set_stream_key_pressed(bool) override { MOZ_CRASH("Unexpected call"); } bool CreateAndAttachAecDump(absl::string_view, int64_t, - rtc::TaskQueue*) override { + absl::Nonnull<TaskQueueBase*>) override { MOZ_CRASH("Unexpected call"); return false; } - bool CreateAndAttachAecDump(FILE*, int64_t, rtc::TaskQueue*) override { + bool CreateAndAttachAecDump(FILE*, int64_t, + absl::Nonnull<TaskQueueBase*>) override { MOZ_CRASH("Unexpected call"); return false; } 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()); diff --git a/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.cpp b/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.cpp index 126020a94f..f2fbd6d637 100644 --- a/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.cpp +++ b/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.cpp @@ -148,7 +148,7 @@ WritableStreamRTCFrameSink::WritableStreamRTCFrameSink( WritableStreamRTCFrameSink::~WritableStreamRTCFrameSink() = default; -already_AddRefed<Promise> WritableStreamRTCFrameSink::WriteCallback( +already_AddRefed<Promise> WritableStreamRTCFrameSink::WriteCallbackImpl( JSContext* aCx, JS::Handle<JS::Value> aChunk, WritableStreamDefaultController& aController, ErrorResult& aError) { // Spec does not say to do this right now. Might be a spec bug, needs diff --git a/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.h b/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.h index 6d61ac3cd5..7a22612254 100644 --- a/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.h +++ b/dom/media/webrtc/jsapi/RTCRtpScriptTransformer.h @@ -87,7 +87,7 @@ class WritableStreamRTCFrameSink final NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(WritableStreamRTCFrameSink, UnderlyingSinkAlgorithmsWrapper) - already_AddRefed<Promise> WriteCallback( + already_AddRefed<Promise> WriteCallbackImpl( JSContext* aCx, JS::Handle<JS::Value> aChunk, WritableStreamDefaultController& aController, ErrorResult& aError) override; diff --git a/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp b/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp index 4e4bf9ab93..eabf7ee335 100644 --- a/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp +++ b/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp @@ -234,7 +234,7 @@ void WebrtcGlobalInformation::GetStatsHistorySince( auto statsAfter = aAfter.WasPassed() ? Some(aAfter.Value()) : Nothing(); auto sdpAfter = aSdpAfter.WasPassed() ? Some(aSdpAfter.Value()) : Nothing(); - WebrtcGlobalStatsHistory::GetHistory(pcIdFilter).apply([&](auto& hist) { + WebrtcGlobalStatsHistory::GetHistory(pcIdFilter).apply([&](const auto& hist) { if (!history.mReports.AppendElements(hist->Since(statsAfter), fallible)) { mozalloc_handle_oom(0); } |