Bug 802397: Work around JS engine bug 449811 to select correct mic/camera r=dolske
authorRandell Jesup <rjesup@jesup.org>
Thu, 25 Oct 2012 20:14:47 -0400
changeset 111360 58c8080a1a7c35e71fa839959bfe12baadb9baa0
parent 111359 b36eeabe85b53fcca595a20615e2cb57dfc65526
child 111453 5ecff3e46ed55a485c15ee12809f08e04b0f6114
push id23746
push userrjesup@wgate.com
push dateFri, 26 Oct 2012 00:41:31 +0000
treeherdermozilla-central@58c8080a1a7c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske
bugs802397, 449811
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 802397: Work around JS engine bug 449811 to select correct mic/camera r=dolske
browser/modules/webrtcUI.jsm
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -85,26 +85,28 @@ function prompt(aBrowser, aCallID, aAudi
     }
   };
 
   let secondaryActions = [];
   let selectableDevices = videoDevices.length ? videoDevices : audioDevices;
   if (selectableDevices.length > 1) {
     let selectableDeviceNumber = 0;
     for (let device of selectableDevices) {
+      // See bug 449811 for why we do this
+      let actual_device = device;
       selectableDeviceNumber++;
       secondaryActions.push({
         label: stringBundle.getFormattedString(
                  device.type == "audio" ?
                    "getUserMedia.shareSpecificMicrophone.label" :
                    "getUserMedia.shareSpecificCamera.label",
                  [ device.name ]),
         accessKey: selectableDeviceNumber,
         callback: function () {
-          Services.obs.notifyObservers(device, "getUserMedia:response:allow", aCallID);
+          Services.obs.notifyObservers(actual_device, "getUserMedia:response:allow", aCallID);
         }
       });
     }
   }
   secondaryActions.push({
     label: stringBundle.getString("getUserMedia.denyRequest.label"),
     accessKey: stringBundle.getString("getUserMedia.denyRequest.accesskey"),
     callback: function () {