Backed out changeset 57a7a785a964 (bug 906990)

This commit is contained in:
Wes Kocher 2013-11-01 17:14:54 -07:00
parent fa84a5a4e7
commit 73ea42404f
6 changed files with 31 additions and 54 deletions

View File

@ -16,7 +16,7 @@ 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}");
@ -719,26 +719,18 @@ RTCPeerConnection.prototype = {
},
getStats: function(selector, onSuccess, onError) {
this._queueOrRun({
func: this._getStats,
args: [selector, onSuccess, onError, false],
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);
this._queueOrRun({
func: this._getStats,
args: [selector],
wait: true
});
},
_getStats: function(selector) {
this._getPC().getStats(selector);
},
createDataChannel: function(label, dict) {

View File

@ -1,11 +1,11 @@
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}

View File

@ -35,7 +35,7 @@ interface PeerConnectionImpl {
/* Stats call */
[Throws]
void getStats(MediaStreamTrack? selector, boolean internalStats);
void getStats(MediaStreamTrack? selector);
/* Adds the stream created by GetUserMedia */
[Throws]

View File

@ -125,11 +125,6 @@ interface mozRTCPeerConnection : EventTarget {
RTCStatsCallback successCallback,
RTCPeerConnectionErrorCallback failureCallback);
[ChromeOnly]
void getStatsInternal (MediaStreamTrack? selector,
RTCStatsCallback successCallback,
RTCPeerConnectionErrorCallback failureCallback);
// Data channel.
RTCDataChannel createDataChannel (DOMString label,
optional RTCDataChannelInit dataChannelDict);

View File

@ -1110,8 +1110,7 @@ PeerConnectionImpl::GetTimeSinceEpoch(DOMHighResTimeStamp *result) {
#endif
NS_IMETHODIMP
PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector,
bool internalStats) {
PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector) {
PC_AUTO_ENTER_API_CALL(true);
#ifdef MOZILLA_INTERNAL_API
@ -1124,7 +1123,6 @@ PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector,
WrapRunnable(pc,
&PeerConnectionImpl::GetStats_s,
track,
internalStats,
now),
NS_DISPATCH_NORMAL);
#endif
@ -1627,7 +1625,6 @@ PeerConnectionImpl::IceStateChange_m(PCImplIceState aState)
#ifdef MOZILLA_INTERNAL_API
void PeerConnectionImpl::GetStats_s(
uint32_t trackId,
bool internalStats,
DOMHighResTimeStamp now) {
nsresult result = NS_OK;
@ -1645,34 +1642,29 @@ void PeerConnectionImpl::GetStats_s(
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.
s.mId.Construct(codeword);
s.mComponentId.Construct(componentId);
s.mTimestamp.Construct(now);
s.mType.Construct(RTCStatsType::Candidatepair);
if (internalStats) {
RTCIceCandidatePairStats s;
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(
@ -1685,7 +1677,7 @@ void PeerConnectionImpl::GetStats_s(
{
RTCIceCandidateStats remote;
remote.mId.Construct(remoteCodeword);
remote.mId.Construct(s.mRemoteCandidateId.Value());
remote.mTimestamp.Construct(now);
remote.mType.Construct(RTCStatsType::Remotecandidate);
remote.mCandidateType.Construct(

View File

@ -301,10 +301,9 @@ public:
}
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,
@ -487,7 +486,6 @@ private:
#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.