Closed Bug 975177 Opened 10 years ago Closed 10 years ago

The WebRTC toolbar icon sometimes stays visible when no device is shared

Categories

(Core :: WebRTC: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: florian, Assigned: florian)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
Steps to reproduce:
1. Open 3 tabs.
2. In the first tab, load http://apprtc.webrtc.org/ and grant permissions to use the devices.
3. In the second tab, load http://apprtc.webrtc.org/ but don't touch the permission prompt (keep the request pending).
4. Close the first tab.
5. Close the second tab.

Expected result:
After step 2, the webrtc toolbar icon appears, and it disappears after step 4.

Actual result:
After step 2, the webrtc toolbar icon appears, but it's still around even after step 5.


The underlying cause of the bug is that the code in webrtcUI.jsm assumes that nsIMediaManagerService.activeMediaCaptureWindows contains only the windows where a device is actually shared, but MediaManager returns both the windows where a device is shared, and the windows where a device has been requested.

This can either be fixed in MediaManager (the approach I took for the attached patch) or in webrtcUI.jsm by making the webrtcUI.activeStreams getter call MediaManagerService.mediaCaptureWindowState for each window.

Note: the WindowsHashToArrayFunc function seems to be the only one around this code with 4 space indent; I'm happy to fully reindent it if we keep this approach, but I wanted this attachment to show what I'm actually changing.
Attachment #8379332 - Flags: review?(rjesup)
Comment on attachment 8379332 [details] [diff] [review]
Patch

Review of attachment 8379332 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/MediaManager.cpp
@@ +1777,4 @@
>  
>      MOZ_ASSERT(window);
>      if (window) {
> +      bool capturing = false;

Add a comment about why we need to do this (and ref bug #)
Attachment #8379332 - Flags: review?(rjesup) → review+
Addressed comment 1, and fixed the indent as discussed on IRC.

https://hg.mozilla.org/integration/mozilla-inbound/rev/bc95fe54b4ee
Assignee: nobody → florian
Attachment #8379332 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/bc95fe54b4ee
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: