Backed out changeset ba0529f6b073 (bug 1208328)

This commit is contained in:
Carsten "Tomcat" Book 2016-06-09 15:18:32 +02:00
Родитель 7be668f681
Коммит 89552f5055
4 изменённых файлов: 10 добавлений и 38 удалений

Просмотреть файл

@ -10,7 +10,6 @@
#include "nsIUUIDGenerator.h"
#include "nsPIDOMWindow.h"
#include "mozilla/dom/MediaStreamBinding.h"
#include "mozilla/dom/MediaStreamTrackEvent.h"
#include "mozilla/dom/LocalMediaStreamBinding.h"
#include "mozilla/dom/AudioNode.h"
#include "AudioChannelAgent.h"
@ -1003,9 +1002,6 @@ DOMMediaStream::CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType,
new TrackPort(mPlaybackPort, track, TrackPort::InputPortOwnership::EXTERNAL));
NotifyTrackAdded(track);
DispatchTrackEvent(NS_LITERAL_STRING("addtrack"), track);
return track;
}
@ -1245,22 +1241,6 @@ DOMMediaStream::NotifyTrackRemoved(const RefPtr<MediaStreamTrack>& aTrack)
// track has been confirmed removed by the graph. See BlockPlaybackTrack().
}
nsresult
DOMMediaStream::DispatchTrackEvent(const nsAString& aName,
const RefPtr<MediaStreamTrack>& aTrack)
{
MOZ_ASSERT(aName == NS_LITERAL_STRING("addtrack"),
"Only 'addtrack' is supported at this time");
MediaStreamTrackEventInit init;
init.mTrack = aTrack;
RefPtr<MediaStreamTrackEvent> event =
MediaStreamTrackEvent::Constructor(this, aName, init);
return DispatchTrustedEvent(event);
}
void
DOMMediaStream::CreateAndAddPlaybackStreamListener(MediaStream* aStream)
{

Просмотреть файл

@ -362,8 +362,6 @@ public:
/** Identical to CloneInternal(TrackForwardingOption::EXPLICIT) */
already_AddRefed<DOMMediaStream> Clone();
IMPL_EVENT_HANDLER(addtrack)
// NON-WebIDL
/**
@ -524,12 +522,7 @@ public:
* Called for each track in our owned stream to indicate to JS that we
* are carrying that track.
*
* Creates a MediaStreamTrack, adds it to mTracks, raises "addtrack" and
* returns it.
*
* Note that "addtrack" is raised synchronously and only has an effect if
* this MediaStream is already exposed to script. For spec compliance this is
* to be called from an async task.
* Creates a MediaStreamTrack, adds it to mTracks and returns it.
*/
MediaStreamTrack* CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType,
MediaStreamTrackSource* aSource);
@ -610,10 +603,6 @@ protected:
// Dispatches NotifyTrackRemoved() to all registered track listeners.
void NotifyTrackRemoved(const RefPtr<MediaStreamTrack>& aTrack);
// Dispatches "addtrack" or "removetrack".
nsresult DispatchTrackEvent(const nsAString& aName,
const RefPtr<MediaStreamTrack>& aTrack);
class OwnedStreamListener;
friend class OwnedStreamListener;

Просмотреть файл

@ -43,7 +43,7 @@ interface MediaStream : EventTarget {
// readonly attribute boolean active;
// attribute EventHandler onactive;
// attribute EventHandler oninactive;
attribute EventHandler onaddtrack;
// attribute EventHandler onaddtrack;
// attribute EventHandler onremovetrack;
readonly attribute double currentTime;
};

Просмотреть файл

@ -8,12 +8,15 @@
*/
dictionary MediaStreamTrackEventInit : EventInit {
required MediaStreamTrack track;
MediaStreamTrack? track = null;
RTCRtpReceiver? receiver = null;
MediaStream? stream = null;
};
[Exposed=Window,
Constructor (DOMString type, MediaStreamTrackEventInit eventInitDict)]
[Pref="media.peerconnection.enabled",
Constructor(DOMString type, optional MediaStreamTrackEventInit eventInitDict)]
interface MediaStreamTrackEvent : Event {
[SameObject]
readonly attribute MediaStreamTrack track;
readonly attribute RTCRtpReceiver? receiver;
readonly attribute MediaStreamTrack? track;
readonly attribute MediaStream? stream;
};