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 111492 58c8080a1a7c35e71fa839959bfe12baadb9baa0
parent 111491 b36eeabe85b53fcca595a20615e2cb57dfc65526
child 111585 5ecff3e46ed55a485c15ee12809f08e04b0f6114
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersdolske
bugs802397, 449811
milestone19.0a1
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 () {