Backed out changeset 57a7a785a964 (bug 906990)
authorWes Kocher <wkocher@mozilla.com>
Fri, 01 Nov 2013 17:14:54 -0700
changeset 153208 296037536c114354d15f818c83c719c424fb91d4
parent 153207 cb757cda1837e3a19531e056b1d748380b28ada6
child 153209 82d16c52341251b4e4376f2195c6fe1879d4eb81
push id25571
push userkwierso@gmail.com
push dateSat, 02 Nov 2013 03:35:05 +0000
treeherdermozilla-central@396e59370945 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs906990
milestone28.0a1
backs out57a7a785a9648a13e83c81d958b0128286a0e433
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 57a7a785a964 (bug 906990)
dom/media/PeerConnection.js
dom/media/PeerConnection.manifest
dom/webidl/PeerConnectionImpl.webidl
dom/webidl/RTCPeerConnection.webidl
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -11,17 +11,17 @@ Cu.import("resource://gre/modules/XPCOMU
 
 const PC_CONTRACT = "@mozilla.org/dom/peerconnection;1";
 const PC_OBS_CONTRACT = "@mozilla.org/dom/peerconnectionobserver;1";
 const PC_ICE_CONTRACT = "@mozilla.org/dom/rtcicecandidate;1";
 const PC_SESSION_CONTRACT = "@mozilla.org/dom/rtcsessiondescription;1";
 const PC_MANAGER_CONTRACT = "@mozilla.org/dom/peerconnectionmanager;1";
 const PC_STATS_CONTRACT = "@mozilla.org/dom/rtcstatsreport;1";
 
-const PC_CID = Components.ID("{00e0e20d-1494-4776-8e0e-0f0acbea3c79}");
+const PC_CID = Components.ID("{fc684a5c-c729-42c7-aa82-3c10dc4398f3}");
 const PC_OBS_CID = Components.ID("{1d44a18e-4545-4ff3-863d-6dbd6234a583}");
 const PC_ICE_CID = Components.ID("{02b9970c-433d-4cc2-923d-f7028ac66073}");
 const PC_SESSION_CID = Components.ID("{1775081b-b62d-4954-8ffe-a067bbf508a7}");
 const PC_MANAGER_CID = Components.ID("{7293e901-2be3-4c02-b4bd-cbef6fc24f78}");
 const PC_STATS_CID = Components.ID("{7fe6e18b-0da3-4056-bf3b-440ef3809e06}");
 
 // Global list of PeerConnection objects, so they can be cleaned up when
 // a page is torn down. (Maps inner window ID to an array of PC objects).
@@ -714,36 +714,28 @@ RTCPeerConnection.prototype = {
   },
 
   changeIceConnectionState: function(state) {
     this._iceConnectionState = state;
     this.dispatchEvent(new this._win.Event("iceconnectionstatechange"));
   },
 
   getStats: function(selector, onSuccess, onError) {
+    this._onGetStatsSuccess = onSuccess;
+    this._onGetStatsFailure = onError;
+
     this._queueOrRun({
       func: this._getStats,
-      args: [selector, onSuccess, onError, false],
+      args: [selector],
       wait: true
     });
   },
 
-  getStatsInternal: function(selector, onSuccess, onError) {
-    this._queueOrRun({
-      func: this._getStats,
-      args: [selector, onSuccess, onError, true],
-      wait: true
-    });
-  },
-
-  _getStats: function(selector, onSuccess, onError, internal) {
-    this._onGetStatsSuccess = onSuccess;
-    this._onGetStatsFailure = onError;
-
-    this._getPC().getStats(selector, internal);
+  _getStats: function(selector) {
+    this._getPC().getStats(selector);
   },
 
   createDataChannel: function(label, dict) {
     this._checkClosed();
     if (dict == undefined) {
       dict = {};
     }
     if (dict.maxRetransmitNum != undefined) {
--- a/dom/media/PeerConnection.manifest
+++ b/dom/media/PeerConnection.manifest
@@ -1,13 +1,13 @@
-component {00e0e20d-1494-4776-8e0e-0f0acbea3c79} PeerConnection.js
+component {fc684a5c-c729-42c7-aa82-3c10dc4398f3} PeerConnection.js
 component {1d44a18e-4545-4ff3-863d-6dbd6234a583} PeerConnection.js
 component {02b9970c-433d-4cc2-923d-f7028ac66073} PeerConnection.js
 component {1775081b-b62d-4954-8ffe-a067bbf508a7} PeerConnection.js
 component {7293e901-2be3-4c02-b4bd-cbef6fc24f78} PeerConnection.js
 component {7fe6e18b-0da3-4056-bf3b-440ef3809e06} PeerConnection.js
 
-contract @mozilla.org/dom/peerconnection;1 {00e0e20d-1494-4776-8e0e-0f0acbea3c79}
+contract @mozilla.org/dom/peerconnection;1 {fc684a5c-c729-42c7-aa82-3c10dc4398f3}
 contract @mozilla.org/dom/peerconnectionobserver;1 {1d44a18e-4545-4ff3-863d-6dbd6234a583}
 contract @mozilla.org/dom/rtcicecandidate;1 {02b9970c-433d-4cc2-923d-f7028ac66073}
 contract @mozilla.org/dom/rtcsessiondescription;1 {1775081b-b62d-4954-8ffe-a067bbf508a7}
 contract @mozilla.org/dom/peerconnectionmanager;1 {7293e901-2be3-4c02-b4bd-cbef6fc24f78}
 contract @mozilla.org/dom/rtcstatsreport;1 {7fe6e18b-0da3-4056-bf3b-440ef3809e06}
--- a/dom/webidl/PeerConnectionImpl.webidl
+++ b/dom/webidl/PeerConnectionImpl.webidl
@@ -30,17 +30,17 @@ interface PeerConnectionImpl  {
   void createAnswer(optional MediaConstraintsInternal constraints);
   [Throws]
   void setLocalDescription(long action, DOMString sdp);
   [Throws]
   void setRemoteDescription(long action, DOMString sdp);
 
   /* Stats call */
   [Throws]
-  void getStats(MediaStreamTrack? selector, boolean internalStats);
+  void getStats(MediaStreamTrack? selector);
 
   /* Adds the stream created by GetUserMedia */
   [Throws]
   void addStream(MediaStream stream);
   [Throws]
   void removeStream(MediaStream stream);
   [Throws]
   void closeStreams();
--- a/dom/webidl/RTCPeerConnection.webidl
+++ b/dom/webidl/RTCPeerConnection.webidl
@@ -120,20 +120,15 @@ interface mozRTCPeerConnection : EventTa
   attribute EventHandler onaddstream;
   attribute EventHandler onremovestream;
   attribute EventHandler oniceconnectionstatechange;
 
   void getStats (MediaStreamTrack? selector,
                  RTCStatsCallback successCallback,
                  RTCPeerConnectionErrorCallback failureCallback);
 
-  [ChromeOnly]
-  void getStatsInternal (MediaStreamTrack? selector,
-                         RTCStatsCallback successCallback,
-                         RTCPeerConnectionErrorCallback failureCallback);
-
   // Data channel.
   RTCDataChannel createDataChannel (DOMString label,
                                     optional RTCDataChannelInit dataChannelDict);
   attribute EventHandler ondatachannel;
   attribute EventHandler onconnection;
   attribute EventHandler onclosedconnection;
 };
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -1105,31 +1105,29 @@ PeerConnectionImpl::GetTimeSinceEpoch(DO
   nsPerformance *perf = mWindow->GetPerformance();
   NS_ENSURE_TRUE(perf && perf->Timing(), NS_ERROR_UNEXPECTED);
   *result = perf->Now() + perf->Timing()->NavigationStart();
   return NS_OK;
 }
 #endif
 
 NS_IMETHODIMP
-PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector,
-                             bool internalStats) {
+PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector) {
   PC_AUTO_ENTER_API_CALL(true);
 
 #ifdef MOZILLA_INTERNAL_API
   uint32_t track = aSelector ? aSelector->GetTrackID() : 0;
   DOMHighResTimeStamp now;
   nsresult rv = GetTimeSinceEpoch(&now);
   NS_ENSURE_SUCCESS(rv, rv);
   nsRefPtr<PeerConnectionImpl> pc(this);
   RUN_ON_THREAD(mSTSThread,
                 WrapRunnable(pc,
                              &PeerConnectionImpl::GetStats_s,
                              track,
-                             internalStats,
                              now),
                 NS_DISPATCH_NORMAL);
 #endif
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PeerConnectionImpl::AddIceCandidate(const char* aCandidate, const char* aMid, unsigned short aLevel) {
@@ -1622,17 +1620,16 @@ PeerConnectionImpl::IceStateChange_m(PCI
                              rv, static_cast<JSCompartment*>(nullptr)),
                 NS_DISPATCH_NORMAL);
   return NS_OK;
 }
 
 #ifdef MOZILLA_INTERNAL_API
 void PeerConnectionImpl::GetStats_s(
     uint32_t trackId,
-    bool internalStats,
     DOMHighResTimeStamp now) {
 
   nsresult result = NS_OK;
   nsAutoPtr<RTCStatsReportInternal> report(new RTCStatsReportInternal);
   if (!report) {
     result = NS_ERROR_FAILURE;
   }
   if (mMedia) {
@@ -1640,57 +1637,52 @@ void PeerConnectionImpl::GetStats_s(
         mMedia->ice_media_stream(trackId));
     if (mediaStream) {
       std::vector<NrIceCandidatePair> candPairs;
       mediaStream->GetCandidatePairs(&candPairs);
       report->mIceCandidatePairStats.Construct();
       report->mIceCandidateStats.Construct();
       NS_ConvertASCIItoUTF16 componentId(mediaStream->name().c_str());
       for (auto p = candPairs.begin(); p != candPairs.end(); ++p) {
+        RTCIceCandidatePairStats s;
         NS_ConvertASCIItoUTF16 codeword(p->codeword.c_str());
         const nsString localCodeword(
             NS_ConvertASCIItoUTF16("local_") + codeword);
         const nsString remoteCodeword(
             NS_ConvertASCIItoUTF16("remote_") + codeword);
-        // Only expose candidate-pair statistics to chrome, until we've thought
-        // through the implications of exposing it to content.
-
-        if (internalStats) {
-          RTCIceCandidatePairStats s;
-          s.mId.Construct(codeword);
-          s.mComponentId.Construct(componentId);
-          s.mTimestamp.Construct(now);
-          s.mType.Construct(RTCStatsType::Candidatepair);
+        s.mId.Construct(codeword);
+        s.mComponentId.Construct(componentId);
+        s.mTimestamp.Construct(now);
+        s.mType.Construct(RTCStatsType::Candidatepair);
 
-          // Not quite right; we end up with duplicate candidates. Will fix.
-          s.mLocalCandidateId.Construct(localCodeword);
-          s.mRemoteCandidateId.Construct(remoteCodeword);
-          s.mNominated.Construct(p->nominated);
-          s.mMozPriority.Construct(p->priority);
-          s.mSelected.Construct(p->selected);
-          s.mState.Construct(RTCStatsIceCandidatePairState(p->state));
-          report->mIceCandidatePairStats.Value().AppendElement(s);
-        }
+        // Not quite right; we end up with duplicate candidates. Will fix.
+        s.mLocalCandidateId.Construct(localCodeword);
+        s.mRemoteCandidateId.Construct(remoteCodeword);
+        s.mNominated.Construct(p->nominated);
+        s.mMozPriority.Construct(p->priority);
+        s.mSelected.Construct(p->selected);
+        s.mState.Construct(RTCStatsIceCandidatePairState(p->state));
+        report->mIceCandidatePairStats.Value().AppendElement(s);
 
         {
           RTCIceCandidateStats local;
-          local.mId.Construct(localCodeword);
+          local.mId.Construct(s.mLocalCandidateId.Value());
           local.mTimestamp.Construct(now);
           local.mType.Construct(RTCStatsType::Localcandidate);
           local.mCandidateType.Construct(
               RTCStatsIceCandidateType(p->local.type));
           local.mIpAddress.Construct(
               NS_ConvertASCIItoUTF16(p->local.host.c_str()));
           local.mPortNumber.Construct(p->local.port);
           report->mIceCandidateStats.Value().AppendElement(local);
         }
 
         {
           RTCIceCandidateStats remote;
-          remote.mId.Construct(remoteCodeword);
+          remote.mId.Construct(s.mRemoteCandidateId.Value());
           remote.mTimestamp.Construct(now);
           remote.mType.Construct(RTCStatsType::Remotecandidate);
           remote.mCandidateType.Construct(
               RTCStatsIceCandidateType(p->remote.type));
           remote.mIpAddress.Construct(
               NS_ConvertASCIItoUTF16(p->remote.host.c_str()));
           remote.mPortNumber.Construct(p->remote.port);
           report->mIceCandidateStats.Value().AppendElement(remote);
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -296,20 +296,19 @@ public:
 
   NS_IMETHODIMP SetRemoteDescription (int32_t aAction, const char* aSDP);
   void SetRemoteDescription (int32_t aAction, const nsAString& aSDP, ErrorResult &rv)
   {
     rv = SetRemoteDescription(aAction, NS_ConvertUTF16toUTF8(aSDP).get());
   }
 
   NS_IMETHODIMP_TO_ERRORRESULT(GetStats, ErrorResult &rv,
-                               mozilla::dom::MediaStreamTrack *aSelector,
-                               bool internalStats)
+                               mozilla::dom::MediaStreamTrack *aSelector)
   {
-    rv = GetStats(aSelector, internalStats);
+    rv = GetStats(aSelector);
   }
 
   NS_IMETHODIMP AddIceCandidate(const char* aCandidate, const char* aMid,
                                 unsigned short aLevel);
   void AddIceCandidate(const nsAString& aCandidate, const nsAString& aMid,
                        unsigned short aLevel, ErrorResult &rv)
   {
     rv = AddIceCandidate(NS_ConvertUTF16toUTF8(aCandidate).get(),
@@ -482,17 +481,16 @@ private:
   void ShutdownMedia();
 
   // ICE callbacks run on the right thread.
   nsresult IceStateChange_m(mozilla::dom::PCImplIceState aState);
 
 #ifdef MOZILLA_INTERNAL_API
   // Fills in an RTCStatsReportInternal. Must be run on STS.
   void GetStats_s(uint32_t trackId,
-                  bool internalStats,
                   DOMHighResTimeStamp now);
 
   // Sends an RTCStatsReport to JS. Must run on main thread.
   void OnStatsReport_m(uint32_t trackId,
                        nsresult result,
                        nsAutoPtr<mozilla::dom::RTCStatsReportInternal> report);
 #endif