Bug 1515873 - Remove aWindowId arg from MediaManager::GetBackend. r=jib, a=RyanVM
authorAndreas Pehrson <apehrson@mozilla.com>
Thu, 03 Jan 2019 05:18:09 +0000
changeset 506526 ab6723fb0cefb88a1325ebca507dafa15e6e479a
parent 506525 3c697557546a791ba786a58478113d10f939c25c
child 506527 2641666a95ba71d2fad2fcfd48bd13f8f6f0adef
push id10448
push userryanvm@gmail.com
push dateFri, 04 Jan 2019 19:56:55 +0000
treeherdermozilla-beta@8da001054d07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, RyanVM
bugs1515873
milestone65.0
Bug 1515873 - Remove aWindowId arg from MediaManager::GetBackend. r=jib, a=RyanVM It is unused. Differential Revision: https://phabricator.services.mozilla.com/D15630
dom/media/MediaManager.cpp
dom/media/MediaManager.h
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1828,17 +1828,17 @@ RefPtr<MediaManager::MediaDeviceSetPromi
     // Only enumerate what's asked for, and only fake cams and mics.
     RefPtr<MediaEngine> fakeBackend, realBackend;
     if (fakeDeviceRequested) {
       fakeBackend = new MediaEngineDefault();
     }
     if (realDeviceRequested) {
       MediaManager* manager = MediaManager::GetIfExists();
       MOZ_RELEASE_ASSERT(manager);  // Must exist while media thread is alive
-      realBackend = manager->GetBackend(aWindowId);
+      realBackend = manager->GetBackend();
     }
 
     auto result = MakeRefPtr<MediaDeviceSetRefCnt>();
 
     if (hasVideo) {
       MediaDeviceSet videos;
       LOG(("EnumerateRawDevices Task: Getting video sources with %s backend",
            aVideoInputEnumType == DeviceEnumerationType::Fake ? "fake"
@@ -2161,19 +2161,19 @@ template <typename MozPromiseType, typen
 
 int MediaManager::AddDeviceChangeCallback(DeviceChangeCallback* aCallback) {
   bool fakeDeviceChangeEventOn = mPrefs.mFakeDeviceChangeEventOn;
   MediaManager::PostTask(NewTaskFrom([fakeDeviceChangeEventOn]() {
     MediaManager* manager = MediaManager::GetIfExists();
     MOZ_RELEASE_ASSERT(manager);  // Must exist while media thread is alive
     // this is needed in case persistent permission is given but no gUM()
     // or enumeration() has created the real backend yet
-    manager->GetBackend(0);
+    manager->GetBackend();
     if (fakeDeviceChangeEventOn)
-      manager->GetBackend(0)->SetFakeDeviceChangeEvents();
+      manager->GetBackend()->SetFakeDeviceChangeEvents();
   }));
 
   return DeviceChangeCallback::AddDeviceChangeCallback(aCallback);
 }
 
 void MediaManager::OnDeviceChange() {
   RefPtr<MediaManager> self(this);
   NS_DispatchToMainThread(
@@ -3257,17 +3257,17 @@ nsresult MediaManager::GetUserMediaDevic
         aOnSuccess.Call(array);
         return NS_OK;
       }
     }
   }
   return NS_ERROR_UNEXPECTED;
 }
 
-MediaEngine* MediaManager::GetBackend(uint64_t aWindowId) {
+MediaEngine* MediaManager::GetBackend() {
   MOZ_ASSERT(MediaManager::IsInMediaThread());
   // Plugin backends as appropriate. The default engine also currently
   // includes picture support for Android.
   // This IS called off main-thread.
   if (!mBackend) {
     MOZ_RELEASE_ASSERT(
         !sHasShutdown);  // we should never create a new backend in shutdown
 #if defined(MOZ_WEBRTC)
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -174,17 +174,17 @@ class MediaManager final : public nsIMed
 
   static nsresult NotifyRecordingStatusChange(nsPIDOMWindowInner* aWindow);
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIMEDIAMANAGERSERVICE
 
   media::Parent<media::NonE10s>* GetNonE10sParent();
-  MediaEngine* GetBackend(uint64_t aWindowId = 0);
+  MediaEngine* GetBackend();
 
   WindowTable* GetActiveWindows() {
     MOZ_ASSERT(NS_IsMainThread());
     return &mActiveWindows;
   }
   GetUserMediaWindowListener* GetWindowListener(uint64_t aWindowId) {
     MOZ_ASSERT(NS_IsMainThread());
     return mActiveWindows.GetWeak(aWindowId);