Closed Bug 2056243 Opened 3 months ago Closed 3 months ago

Fix Coverity COPY_INSTEAD_OF_MOVE defects in WebRTC signaling (move Maybe<RTCErrorParams>)

Categories

(Core :: WebRTC: Signaling, task)

task

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug)

Details

Attachments

(3 external files)

Coverity Scan reported COPY_INSTEAD_OF_MOVE defects in the WebRTC signaling code. In each case a Maybe<dom::RTCErrorParams> (an error/aError value) is passed by value to a callee that takes it by value, at the variable's last use, so it can be moved instead of copied:

  • CID 1696626: MediaTransportHandlerSTS::OnStateChange -> MediaTransportHandler::OnStateChange (MediaTransportHandler.cpp)
  • CID 1696625: MediaTransportHandlerSTS::OnRtcpStateChange -> MediaTransportHandler::OnRtcpStateChange (MediaTransportHandler.cpp)
  • CID 1696624: MediaTransportChild::RecvOnStateChange -> OnStateChange (MediaTransportHandlerIPC.cpp)
  • CID 1696623: MediaTransportChild::RecvOnRtcpStateChange -> OnRtcpStateChange (MediaTransportHandlerIPC.cpp)
  • CID 1696621: PeerConnectionImpl::OnDtlsStateChange -> RTCDtlsTransport::UpdateState (PeerConnectionImpl.cpp)
  • CID 1696620: PeerConnectionImpl::OnRtcpStateChange -> OnDtlsStateChange (PeerConnectionImpl.cpp)

Fix: wrap the argument in std::move.

Fixes Coverity CID 1696626 and CID 1696625 (COPY_INSTEAD_OF_MOVE): the
error value is at its last use when forwarded to the base
OnStateChange/OnRtcpStateChange, so move it instead of copying.

Assignee: nobody → sledru
Status: NEW → ASSIGNED

Fixes Coverity CID 1696624 and CID 1696623 (COPY_INSTEAD_OF_MOVE): the
error parameter is at its last use when forwarded to
OnStateChange/OnRtcpStateChange, so move it instead of copying.

Fixes Coverity CID 1696621 and CID 1696620 (COPY_INSTEAD_OF_MOVE): aError
is at its last use when forwarded to UpdateState/OnDtlsStateChange, so
move it instead of copying.

Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ba5e645ed3e3 https://hg.mozilla.org/integration/autoland/rev/56127d99715f Move Maybe<RTCErrorParams> in MediaTransportHandlerSTS state-change handlers. r=webrtc-reviewers,bwc
Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0a948b6e566e https://hg.mozilla.org/integration/autoland/rev/443738be761a Move Maybe<RTCErrorParams> in MediaTransportChild Recv handlers. r=webrtc-reviewers,bwc
Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2c7f8b5eb595 https://hg.mozilla.org/integration/autoland/rev/115902587b88 Move Maybe<RTCErrorParams> in PeerConnectionImpl DTLS state-change handlers. r=webrtc-reviewers,bwc
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
QA Whiteboard: [qa-triage-done-c156/b155]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: