Bug 1481557: improve getStats isRemote deprecation warning. r=jib
authorPhilipp Hancke <fippo@appear.in>
Tue, 07 Aug 2018 20:00:26 +0200
changeset 430482 04a334d50b81
parent 430481 e54c4c4cde45
child 430483 20bf59c86755
push id106183
push usercbrindusan@mozilla.com
push dateWed, 08 Aug 2018 04:01:29 +0000
treeherdermozilla-inbound@04a334d50b81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1481557
milestone63.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 1481557: improve getStats isRemote deprecation warning. r=jib by adding the key that is accessed.
dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -320,17 +320,17 @@ class RTCStatsReport {
               //       if (stat.isRemote) continue;
               //       let rtcp = stats.get(stat.remoteId);
               //
               if (warnRemoteNullable.warn && stat.isRemote &&
                   key != "type" &&
                   key != "isRemote") {
                 // id is first prop, a sign of JSON.stringify(), cancel warnings.
                 if (key != "id") {
-                  warnRemoteNullable.warn();
+                  warnRemoteNullable.warn(key);
                 }
                 warnRemoteNullable.warn = null;
               }
               return stat[key];
             }, entry)
           });
         }
         Cu.unwaiveXrays(entry)._isRemote = stat.isRemote;
@@ -495,19 +495,19 @@ class RTCPeerConnection {
     this._warnDeprecatedStatsAccessNullable = { warn: () =>
       this.logWarning("non-maplike pc.getStats access is deprecated, and will be removed in the near future! " +
                       "See http://w3c.github.io/webrtc-pc/#getstats-example for usage.") };
 
     this._warnDeprecatedStatsCallbacksNullable = { warn: () =>
       this.logWarning("Callback-based pc.getStats is deprecated, and will be removed in the near future! Use promise-version! " +
                       "See http://w3c.github.io/webrtc-pc/#getstats-example for usage.") };
 
-    this._warnDeprecatedStatsRemoteAccessNullable = { warn: () =>
-      this.logWarning("Detected soon-to-break getStats() use! stat.isRemote goes away in Firefox 65, but won't warn there!\
- - See https://blog.mozilla.org/webrtc/getstats-isremote-65/") };
+    this._warnDeprecatedStatsRemoteAccessNullable = { warn: (key) =>
+      this.logWarning(`Detected soon-to-break getStats() use with key="${key}"! stat.isRemote goes away in Firefox 65, but won't warn there!\
+ - See https://blog.mozilla.org/webrtc/getstats-isremote-65/`) };
 
     // Add a reference to the PeerConnection to global list (before init).
     _globalPCList.addPC(this);
 
     this._impl.initialize(this._observer, this._win, rtcConfig,
                           Services.tm.currentThread);
 
     this._certificateReady = this._initCertificate(rtcConfig.certificates);