Backed out changesets 7d86454fd261 and 24241169e9d6 (bug 1616661) for build bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 27 Feb 2020 15:13:50 -0500
changeset 524626 be31d6a4cc2ac73268e522a1d75aa244ae32f143
parent 524625 a34778097505ce3c5988e82f373bf707b548b6ea
child 524627 2ae01e2ee32f05bd6a378d575eea53d0f7f25b40
push id919
push userryanvm@gmail.com
push dateThu, 27 Feb 2020 20:15:05 +0000
treeherdermozilla-esr68@be31d6a4cc2a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1616661
milestone68.6.0
backs out7d86454fd261ff5028988de190372aff143d873e
24241169e9d68b39500c3012d7794c0d386482ae
Backed out changesets 7d86454fd261 and 24241169e9d6 (bug 1616661) for build bustage.
browser/actors/WebRTCChild.jsm
dom/media/MediaManager.cpp
dom/media/MediaManager.h
dom/media/nsIDOMNavigatorUserMedia.idl
mobile/android/components/geckoview/GeckoViewPermission.js
--- a/browser/actors/WebRTCChild.jsm
+++ b/browser/actors/WebRTCChild.jsm
@@ -217,30 +217,30 @@ function prompt(
     device = device.QueryInterface(Ci.nsIMediaDevice);
     switch (device.type) {
       case "audioinput":
         // Check that if we got a microphone, we have not requested an audio
         // capture, and if we have requested an audio capture, we are not
         // getting a microphone instead.
         if (audio && (device.mediaSource == "microphone") != sharingAudio) {
           audioDevices.push({
-            name: device.rawName, // unfiltered device name to show to the user
+            name: device.name,
             deviceIndex: devices.length,
             id: device.rawId,
             mediaSource: device.mediaSource,
           });
           devices.push(device);
         }
         break;
       case "videoinput":
         // Verify that if we got a camera, we haven't requested a screen share,
         // or that if we requested a screen share we aren't getting a camera.
         if (video && (device.mediaSource == "camera") != sharingScreen) {
           let deviceObject = {
-            name: device.rawName, // unfiltered device name to show to the user
+            name: device.name,
             deviceIndex: devices.length,
             id: device.rawId,
             mediaSource: device.mediaSource,
           };
           if (device.scary) {
             deviceObject.scary = true;
           }
           videoDevices.push(deviceObject);
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -708,18 +708,17 @@ MediaDevice::MediaDevice(const RefPtr<Me
                 ? dom::MediaDeviceKind::Videoinput
                 : dom::MediaDeviceKind::Audioinput),
       mScary(mSource->GetScary()),
       mType(NS_ConvertUTF8toUTF16(
           dom::MediaDeviceKindValues::strings[uint32_t(mKind)].value)),
       mName(aName),
       mID(aID),
       mGroupID(aGroupID),
-      mRawID(aRawID),
-      mRawName(aName) {
+      mRawID(aRawID) {
   MOZ_ASSERT(mSource);
 }
 
 MediaDevice::MediaDevice(const RefPtr<AudioDeviceInfo>& aAudioDeviceInfo,
                          const nsString& aID, const nsString& aGroupID,
                          const nsString& aRawID)
     : mSource(nullptr),
       mSinkInfo(aAudioDeviceInfo),
@@ -727,43 +726,36 @@ MediaDevice::MediaDevice(const RefPtr<Au
                 ? dom::MediaDeviceKind::Audioinput
                 : dom::MediaDeviceKind::Audiooutput),
       mScary(false),
       mType(NS_ConvertUTF8toUTF16(
           dom::MediaDeviceKindValues::strings[uint32_t(mKind)].value)),
       mName(mSinkInfo->Name()),
       mID(aID),
       mGroupID(aGroupID),
-      mRawID(aRawID),
-      mRawName(mSinkInfo->Name()) {
+      mRawID(aRawID) {
   // For now this ctor is used only for Audiooutput.
   // It could be used for Audioinput and Videoinput
   // when we do not instantiate a MediaEngineSource
   // during EnumerateDevices.
   MOZ_ASSERT(mKind == dom::MediaDeviceKind::Audiooutput);
   MOZ_ASSERT(mSinkInfo);
 }
 
 MediaDevice::MediaDevice(const RefPtr<MediaDevice>& aOther, const nsString& aID,
                          const nsString& aGroupID, const nsString& aRawID)
-    : MediaDevice(aOther, aID, aGroupID, aRawID, aOther->mName) {}
-
-MediaDevice::MediaDevice(const RefPtr<MediaDevice>& aOther, const nsString& aID,
-                         const nsString& aGroupID, const nsString& aRawID,
-                         const nsString& aName)
     : mSource(aOther->mSource),
       mSinkInfo(aOther->mSinkInfo),
       mKind(aOther->mKind),
       mScary(aOther->mScary),
       mType(aOther->mType),
-      mName(aName),
+      mName(aOther->mName),
       mID(aID),
       mGroupID(aGroupID),
-      mRawID(aRawID),
-      mRawName(aOther->mRawName) {
+      mRawID(aRawID) {
   MOZ_ASSERT(aOther);
 }
 
 /**
  * Helper functions that implement the constraints algorithm from
  * http://dev.w3.org/2011/webrtc/editor/getusermedia.html#methods-5
  */
 
@@ -826,23 +818,16 @@ uint32_t MediaDevice::GetBestFitnessDist
 NS_IMETHODIMP
 MediaDevice::GetName(nsAString& aName) {
   MOZ_ASSERT(NS_IsMainThread());
   aName.Assign(mName);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-MediaDevice::GetRawName(nsAString& aName) {
-  MOZ_ASSERT(NS_IsMainThread());
-  aName.Assign(mRawName);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 MediaDevice::GetType(nsAString& aType) {
   MOZ_ASSERT(NS_IsMainThread());
   aType.Assign(mType);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MediaDevice::GetId(nsAString& aID) {
@@ -2984,22 +2969,17 @@ void MediaManager::AnonymizeDevices(Medi
       // Use window id to salt group id in order to make it session based as
       // required by the spec. This does not provide unique group ids through
       // out a browser restart. However, this is not agaist the spec.
       // Furtermore, since device ids are the same after a browser restart the
       // fingerprint is not bigger.
       groupId.AppendInt(aWindowId);
       AnonymizeId(groupId, aOriginKey);
 
-      nsString name;
-      device->GetName(name);
-      if (name.Find(NS_LITERAL_STRING("AirPods")) != -1) {
-        name = NS_LITERAL_STRING("AirPods");
-      }
-      device = new MediaDevice(device, id, groupId, rawId, name);
+      device = new MediaDevice(device, id, groupId, rawId);
     }
   }
 }
 
 /* static */
 nsresult MediaManager::AnonymizeId(nsAString& aId,
                                    const nsACString& aOriginKey) {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -72,20 +72,16 @@ class MediaDevice : public nsIMediaDevic
 
   MediaDevice(const RefPtr<AudioDeviceInfo>& aAudioDeviceInfo,
               const nsString& aID, const nsString& aGroupID,
               const nsString& aRawID = NS_LITERAL_STRING(""));
 
   MediaDevice(const RefPtr<MediaDevice>& aOther, const nsString& aID,
               const nsString& aGroupID, const nsString& aRawID);
 
-  MediaDevice(const RefPtr<MediaDevice>& aOther, const nsString& aID,
-              const nsString& aGroupID, const nsString& aRawID,
-              const nsString& aName);
-
   uint32_t GetBestFitnessDistance(
       const nsTArray<const NormalizedConstraintSet*>& aConstraintSets,
       bool aIsChrome);
 
   nsresult Allocate(const dom::MediaTrackConstraints& aConstraints,
                     const MediaEnginePrefs& aPrefs,
                     const mozilla::ipc::PrincipalInfo& aPrincipalInfo,
                     const char** aOutBadConstraint);
@@ -126,17 +122,16 @@ class MediaDevice : public nsIMediaDevic
   const RefPtr<AudioDeviceInfo> mSinkInfo;
   const dom::MediaDeviceKind mKind;
   const bool mScary;
   const nsString mType;
   const nsString mName;
   const nsString mID;
   const nsString mGroupID;
   const nsString mRawID;
-  const nsString mRawName;
 };
 
 typedef nsRefPtrHashtable<nsUint64HashKey, GetUserMediaWindowListener>
     WindowTable;
 typedef MozPromise<RefPtr<AudioDeviceInfo>, nsresult, true> SinkInfoPromise;
 
 class MediaManager final : public nsIMediaManagerService,
                            public nsIObserver,
--- a/dom/media/nsIDOMNavigatorUserMedia.idl
+++ b/dom/media/nsIDOMNavigatorUserMedia.idl
@@ -4,16 +4,15 @@
 
 #include "nsISupports.idl"
 #include "nsIVariant.idl"
 
 [scriptable, builtinclass, uuid(ba3b2e08-1c07-4cd3-8822-f4d7e35ff2ae)]
 interface nsIMediaDevice : nsISupports
 {
   readonly attribute AString type;
-  readonly attribute AString name; // may have personal info filtered out
+  readonly attribute AString name;
   readonly attribute AString id;
   readonly attribute AString mediaSource;
   readonly attribute AString rawId;
   readonly attribute AString groupId;
   readonly attribute boolean scary;
-  readonly attribute AString rawName; // unfiltered device name, from 1616661
 };
--- a/mobile/android/components/geckoview/GeckoViewPermission.js
+++ b/mobile/android/components/geckoview/GeckoViewPermission.js
@@ -123,17 +123,17 @@ GeckoViewPermission.prototype = {
         }
 
         let sources = devices.map(device => {
           device = device.QueryInterface(Ci.nsIMediaDevice);
           return {
             type: device.type,
             id: device.id,
             rawId: device.rawId,
-            name: device.rawName, // unfiltered device name to show to the user
+            name: device.name,
             mediaSource: device.mediaSource,
           };
         });
 
         if (
           constraints.video &&
           !sources.some(source => source.type === "videoinput")
         ) {