Closed Bug 1311944 Opened 3 years ago Closed 3 years ago

[Presentation API] nsIPresentationDevice::Disconnect() shouldn't be called when PresentationConnection::Close is called.

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: kuoe0.tw, Assigned: schien)

Details

Attachments

(2 files)

When PresentationConnection::Close is called, it also triggers PresentationSessionInfo::Shutdown and the receiver device will be disconnected. In our definition, PresentationConnection::Close is only used to disconnect the sessionTransport not the device.
Comment on attachment 8803824 [details]
Bug 1311944 - notify device disconnect only when session termination.

https://reviewboard.mozilla.org/r/87974/#review87094

::: dom/presentation/PresentationSessionInfo.cpp
(Diff revision 1)
>  
>    if (mTimer) {
>      mTimer->Cancel();
>    }
>  
> -  if (mDevice) {

Ok, so that patch doesn't do what the bug title says, but just moves mDevice->Disconnect() to another place.

::: dom/presentation/PresentationSessionInfo.cpp:1395
(Diff revision 1)
>    if (mContentParent) {
>      Unused << NS_WARN_IF(!static_cast<ContentParent*>(mContentParent.get())->SendNotifyPresentationReceiverCleanUp(mSessionId));
>    }
>  
> +  // Receiver device might need clean up after session termination.
> +  if (mDevice) {

UntrackFromService seems to be called after termination, so fine.
Attachment #8803824 - Flags: review?(bugs) → review+
Pushed by schien@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a151abb7d9f8
notify device disconnect only when session termination. r=smaug
Summary: [Presentation API] PresentationSessionInfo::Shutdown shouldn't be called when PresentationConnection::Close is called. → [Presentation API] nsIPresentationDevice::Disconnect() shouldn't be called when PresentationConnection::Close is called.
https://hg.mozilla.org/mozilla-central/rev/a151abb7d9f8
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.