Bug 1004183: Unbreak build with --disable-webrtc after bug 907352 r=jib
authorJan Beich <jbeich@tormail.org>
Thu, 01 May 2014 02:58:48 -0400
changeset 181547 6e5eb6a1b0a84570eee1910f530f8037bbe90089
parent 181546 4f77407d183928edcdee4a977ee5a5e679c0a15a
child 181548 e6dd7032e3dac867767a0ea96e97ebf615780045
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersjib
bugs1004183, 907352
milestone32.0a1
Bug 1004183: Unbreak build with --disable-webrtc after bug 907352 r=jib
dom/media/MediaManager.cpp
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1327,16 +1327,18 @@ MediaManager::GetUserMedia(bool aPrivile
 
   NS_ENSURE_TRUE(aWindow, NS_ERROR_NULL_POINTER);
   NS_ENSURE_TRUE(aOnError, NS_ERROR_NULL_POINTER);
   NS_ENSURE_TRUE(aOnSuccess, NS_ERROR_NULL_POINTER);
 
   nsCOMPtr<nsIDOMGetUserMediaSuccessCallback> onSuccess(aOnSuccess);
   nsCOMPtr<nsIDOMGetUserMediaErrorCallback> onError(aOnError);
 
+  MediaStreamConstraints c(aConstraints); // copy
+
   /**
    * If we were asked to get a picture, before getting a snapshot, we check if
    * the calling page is allowed to open a popup. We do this because
    * {picture:true} will open a new "window" to let the user preview or select
    * an image, on Android. The desktop UI for {picture:true} is TBD, at which
    * may point we can decide whether to extend this test there as well.
    */
 #if !defined(MOZ_WEBRTC)
@@ -1387,18 +1389,16 @@ MediaManager::GetUserMedia(bool aPrivile
 
   // Create a disabled listener to act as a placeholder
   GetUserMediaCallbackMediaStreamListener* listener =
     new GetUserMediaCallbackMediaStreamListener(mediaThread, windowID);
 
   // No need for locking because we always do this in the main thread.
   listeners->AppendElement(listener);
 
-  MediaStreamConstraints c(aConstraints); // copy
-
   // Developer preference for turning off permission check.
   if (Preferences::GetBool("media.navigator.permission.disabled", false)) {
     aPrivileged = true;
   }
   if (!Preferences::GetBool("media.navigator.video.enabled", true)) {
     c.mVideo.SetAsBoolean() = false;
   }