Bug 1368875 - Count {video: true} and {audio: true} toward cam and mic counts respectively. r=jesup
authorJan-Ivar Bruaroey <jib@mozilla.com>
Tue, 30 May 2017 21:57:37 -0400
changeset 361916 905729223731593505075af5ed712c79cac707fc
parent 361898 fec3a4b50acd88df3b4af2dfe645a919713852a9
child 361917 5c407f01edac0fe3837946e6e094529441caee94
push id31952
push usercbook@mozilla.com
push dateFri, 02 Jun 2017 12:17:25 +0000
treeherdermozilla-central@194c009d6295 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1368875
milestone55.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 1368875 - Count {video: true} and {audio: true} toward cam and mic counts respectively. r=jesup MozReview-Commit-ID: BgdvRLpueit
dom/media/MediaManager.cpp
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -2225,16 +2225,18 @@ MediaManager::GetUserMedia(nsPIDOMWindow
           if (cs.mBrowserWindow.WasPassed()) {
             cs.mBrowserWindow.Value() = -1;
           }
         }
       }
     }
   } else if (IsOn(c.mVideo)) {
     videoType = MediaSourceEnum::Camera;
+    Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_TYPE,
+                          (uint32_t) videoType);
   }
 
   if (c.mAudio.IsMediaTrackConstraints()) {
     auto& ac = c.mAudio.GetAsMediaTrackConstraints();
     MediaConstraintsHelper::ConvertOldWithWarning(ac.mMozAutoGainControl,
                                                   ac.mAutoGainControl,
                                                   "MozAutoGainControlWarning",
                                                   aWindow);
@@ -2287,17 +2289,19 @@ MediaManager::GetUserMedia(nsPIDOMWindow
                                       MediaSourceEnum::Camera);
       for (MediaTrackConstraintSet& cs : ac.mAdvanced.Value()) {
         if (cs.mMediaSource.EqualsASCII(unset)) {
           cs.mMediaSource = ac.mMediaSource;
         }
       }
     }
   } else if (IsOn(c.mAudio)) {
-   audioType = MediaSourceEnum::Microphone;
+    audioType = MediaSourceEnum::Microphone;
+    Telemetry::Accumulate(Telemetry::WEBRTC_GET_USER_MEDIA_TYPE,
+                          (uint32_t) audioType);
   }
 
   // Create a window listener if it doesn't already exist.
   RefPtr<GetUserMediaWindowListener> windowListener =
     GetWindowListener(windowID);
   if (windowListener) {
     PrincipalHandle existingPrincipalHandle = windowListener->GetPrincipalHandle();
     MOZ_ASSERT(PrincipalHandleMatches(existingPrincipalHandle, principal));