Closed
Bug 991368
Opened 10 years ago
Closed 10 years ago
close() on already closed PeerConnection results in exception
Categories
(Core :: WebRTC: Networking, defect)
Core
WebRTC: Networking
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: drno, Assigned: drno)
References
Details
Attachments
(1 file, 1 obsolete file)
875 bytes,
patch
|
abr
:
review+
jesup
:
review+
|
Details | Diff | Splinter Review |
If you call close() on a mozRTCPeerConnection object which is closed already it raises an exception of the form: Peer connection is closed I think this is a bug: the user of the API instructs the system to go into the closed state. In which state the PeerConnection currently is does not really matter as long as the end result after the close() call will be that it is in the closed state. As the PeerConnection is already in the desired state the close() call should simply return without doing anything.
Assignee | ||
Comment 1•10 years ago
|
||
This patch implements the suggested return on close() if the PC is in the closed state already.
Attachment #8400949 -
Flags: review?(rjesup)
Attachment #8400949 -
Flags: review?(adam)
Assignee | ||
Comment 2•10 years ago
|
||
Same patch with proper comment in it
Attachment #8400949 -
Attachment is obsolete: true
Attachment #8400949 -
Flags: review?(rjesup)
Attachment #8400949 -
Flags: review?(adam)
Attachment #8400959 -
Flags: review?(rjesup)
Attachment #8400959 -
Flags: review?(adam)
Assignee | ||
Comment 3•10 years ago
|
||
Try run: https://tbpl.mozilla.org/?tree=Try&rev=f061308c661d
Comment 4•10 years ago
|
||
From the spec: When the RTCPeerConnection close() method is invoked, the user agent MUST run the following steps: If the RTCPeerConnection object's RTCPeerConnection signalingState is closed, abort these steps. So, no exception. Sounds good to me.
Updated•10 years ago
|
Attachment #8400959 -
Flags: review?(rjesup) → review+
Comment 5•10 years ago
|
||
Comment on attachment 8400959 [details] [diff] [review] Avoid exception in case close() gets called twice. Review of attachment 8400959 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/media/PeerConnection.js @@ +785,1 @@ > this._queueOrRun({ func: this._close, args: [false], wait: false }); Hmm, not related to this patch, but why do we _queueOrRun close? - This means that if say, createOffer has been called them close will be deferred until after createOffer's callbacks have been called. That seems wrong. I figured I'd ask here since we have the right audience.
Assignee | ||
Comment 6•10 years ago
|
||
(In reply to Jan-Ivar Bruaroey [:jib] from comment #5) > Hmm, not related to this patch, but why do we _queueOrRun close? - This > means that if say, createOffer has been called them close will be deferred > until after createOffer's callbacks have been called. That seems wrong. That is indeed a good question. From looking at the function parameters in the spec close() looks like a synchronous function to me. On the other hand receiving a state callback for a sync function like Bug 989936 requests is a strange thing too (and I think the requester is right: if close() is async we should generate the event). If we don't put it into the queue, the close() call would have to clear the queue and cancel any pending requests. Not sure if that is possible or a potential problem?! But right now we have the middle thing: an a-sync call without an event.
Comment 7•10 years ago
|
||
Comment on attachment 8400959 [details] [diff] [review] Avoid exception in case close() gets called twice. Yep, looks correct to me. Thanks.
Attachment #8400959 -
Flags: review?(adam) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 8•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/58046fca8321
Assignee: nobody → drno
Keywords: checkin-needed
Comment 9•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/58046fca8321
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•