Backed out changeset 67833fc7a708 (bug 1221587)
authorWes Kocher <wkocher@mozilla.com>
Thu, 21 Jan 2016 17:28:20 -0800
changeset 281143 eeef1aa20f9f96550a2617092307676a4241b084
parent 281142 7e7888cd175dff03275bb7dd0b8c4ecc5ea06031
child 281144 3bd1d3dc69b75af1597437f84a3dddbd6cb9db53
push id29930
push usercbook@mozilla.com
push dateFri, 22 Jan 2016 11:05:50 +0000
treeherdermozilla-central@7104d650a97d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1221587
milestone46.0a1
backs out67833fc7a70867b6734aca150ecd00625a32eb9f
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
Backed out changeset 67833fc7a708 (bug 1221587)
dom/media/webrtc/MediaEngineWebRTC.cpp
dom/media/webrtc/MediaEngineWebRTC.h
--- a/dom/media/webrtc/MediaEngineWebRTC.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTC.cpp
@@ -40,17 +40,16 @@ GetUserMediaLog()
 #endif
 
 #undef LOG
 #define LOG(args) MOZ_LOG(GetUserMediaLog(), mozilla::LogLevel::Debug, args)
 
 namespace mozilla {
 
 cubeb_device_collection* AudioInputCubeb::mDevices = nullptr;
-bool AudioInputCubeb::mAnyInUse = false;
 
 MediaEngineWebRTC::MediaEngineWebRTC(MediaEnginePrefs &aPrefs)
   : mMutex("mozilla::MediaEngineWebRTC"),
     mVoiceEngine(nullptr),
     mAudioInput(nullptr),
     mAudioEngineInit(false)
 {
 #ifndef MOZ_B2G_CAMERA
--- a/dom/media/webrtc/MediaEngineWebRTC.h
+++ b/dom/media/webrtc/MediaEngineWebRTC.h
@@ -154,17 +154,17 @@ protected:
 
   webrtc::VoiceEngine* mVoiceEngine;
 };
 
 class AudioInputCubeb final : public AudioInput
 {
 public:
   explicit AudioInputCubeb(webrtc::VoiceEngine* aVoiceEngine) :
-    AudioInput(aVoiceEngine), mSelectedDevice(0), mInUse(false)
+    AudioInput(aVoiceEngine), mSelectedDevice(0)
   {
     // Force calculation of the indexes.  We could keep them global
     // too... cleanup would be annoying
     int devices;
     GetNumOfRecordingDevices(devices);
   }
 
   static void CleanupGlobalData()
@@ -237,48 +237,40 @@ public:
     MOZ_ASSERT(mDevices);
 
     ScopedCustomReleasePtr<webrtc::VoEExternalMedia> ptrVoERender;
     ptrVoERender = webrtc::VoEExternalMedia::GetInterface(mVoiceEngine);
     if (ptrVoERender) {
       ptrVoERender->SetExternalRecordingStatus(true);
     }
     aGraph->OpenAudioInput(mDevices->device[mSelectedDevice]->devid, aListener);
-    mInUse = true;
-    mAnyInUse = true;
   }
 
   void StopRecording(MediaStreamGraph *aGraph, AudioDataListener *aListener)
   {
     aGraph->CloseAudioInput(aListener);
-    mInUse = false;
-    mAnyInUse = false;
   }
 
   int SetRecordingDevice(int aIndex)
   {
     int32_t devindex = DeviceIndex(aIndex);
     if (!mDevices || devindex < 0) {
       return 1;
     }
     mSelectedDevice = devindex;
     return 0;
   }
 
 protected:
-  ~AudioInputCubeb() {
-    MOZ_RELEASE_ASSERT(!mInUse);
-  }
+  ~AudioInputCubeb() {}
 
 private:
   nsTArray<int> mDeviceIndexes;
   int mSelectedDevice;
   static cubeb_device_collection *mDevices;
-  bool mInUse; // for assertions about listener lifetime
-  static bool mAnyInUse;
 };
 
 class AudioInputWebRTC final : public AudioInput
 {
 public:
   explicit AudioInputWebRTC(webrtc::VoiceEngine* aVoiceEngine) : AudioInput(aVoiceEngine) {}
 
   int GetNumOfRecordingDevices(int& aDevices)