Bug 1208371 - Move OnTracksAvailableCallback out of DOMMediaStream. r=roc

So it can be forward declared.

MozReview-Commit-ID: 4RH7p8AzO84

--HG--
extra : rebase_source : e9c4ef72029de4ed09dca3b51ba2b46829f41d14
This commit is contained in:
Andreas Pehrson 2016-01-05 10:16:21 +08:00
Родитель 497cedf7f8
Коммит 88628853b2
6 изменённых файлов: 19 добавлений и 18 удалений

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

@ -3124,12 +3124,11 @@ private:
};
class HTMLMediaElement::MediaStreamTracksAvailableCallback:
public DOMMediaStream::OnTracksAvailableCallback
public OnTracksAvailableCallback
{
public:
explicit MediaStreamTracksAvailableCallback(HTMLMediaElement* aElement):
DOMMediaStream::OnTracksAvailableCallback(),
mElement(aElement)
OnTracksAvailableCallback(), mElement(aElement)
{}
virtual void NotifyTracksAvailable(DOMMediaStream* aStream)
{

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

@ -33,6 +33,7 @@ namespace mozilla {
class DOMHwMediaStream;
class DOMLocalMediaStream;
class DOMMediaStream;
class MediaStream;
class MediaEngineSource;
class MediaInputPort;
@ -64,6 +65,12 @@ class MediaStreamDirectListener;
{ 0x8cb65468, 0x66c0, 0x444e, \
{ 0x89, 0x9f, 0x89, 0x1d, 0x9e, 0xd2, 0xbe, 0x7c } }
class OnTracksAvailableCallback {
public:
virtual ~OnTracksAvailableCallback() {}
virtual void NotifyTracksAvailable(DOMMediaStream* aStream) = 0;
};
/**
* DOM wrapper for MediaStreams.
*
@ -478,11 +485,6 @@ public:
*/
MediaStreamTrack* CreateOwnDOMTrack(TrackID aTrackID, MediaSegment::Type aType, const nsString& aLabel);
class OnTracksAvailableCallback {
public:
virtual ~OnTracksAvailableCallback() {}
virtual void NotifyTracksAvailable(DOMMediaStream* aStream) = 0;
};
// When the initial set of tracks has been added, run
// aCallback->NotifyTracksAvailable.
// It is allowed to do anything, including run script.

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

@ -251,7 +251,7 @@ public:
MediaOperationTask(MediaOperation aType,
GetUserMediaCallbackMediaStreamListener* aListener,
DOMMediaStream* aStream,
DOMMediaStream::OnTracksAvailableCallback* aOnTracksAvailableCallback,
OnTracksAvailableCallback* aOnTracksAvailableCallback,
AudioDevice* aAudioDevice,
VideoDevice* aVideoDevice,
bool aBool,
@ -378,7 +378,7 @@ public:
private:
MediaOperation mType;
RefPtr<DOMMediaStream> mStream;
nsAutoPtr<DOMMediaStream::OnTracksAvailableCallback> mOnTracksAvailableCallback;
nsAutoPtr<OnTracksAvailableCallback> mOnTracksAvailableCallback;
RefPtr<AudioDevice> mAudioDevice; // threadsafe
RefPtr<VideoDevice> mVideoDevice; // threadsafe
RefPtr<GetUserMediaCallbackMediaStreamListener> mListener; // threadsafe
@ -886,7 +886,7 @@ public:
~GetUserMediaStreamRunnable() {}
class TracksAvailableCallback : public DOMMediaStream::OnTracksAvailableCallback
class TracksAvailableCallback : public OnTracksAvailableCallback
{
public:
TracksAvailableCallback(MediaManager* aManager,

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

@ -350,7 +350,7 @@ class GetUserMediaNotificationEvent: public nsRunnable
GetUserMediaNotificationEvent(GetUserMediaStatus aStatus,
already_AddRefed<DOMMediaStream> aStream,
DOMMediaStream::OnTracksAvailableCallback* aOnTracksAvailableCallback,
OnTracksAvailableCallback* aOnTracksAvailableCallback,
bool aIsAudio, bool aIsVideo, uint64_t aWindowID,
already_AddRefed<nsIDOMGetUserMediaErrorCallback> aError)
: mStream(aStream), mOnTracksAvailableCallback(aOnTracksAvailableCallback),
@ -366,7 +366,7 @@ class GetUserMediaNotificationEvent: public nsRunnable
protected:
RefPtr<GetUserMediaCallbackMediaStreamListener> mListener; // threadsafe
RefPtr<DOMMediaStream> mStream;
nsAutoPtr<DOMMediaStream::OnTracksAvailableCallback> mOnTracksAvailableCallback;
nsAutoPtr<OnTracksAvailableCallback> mOnTracksAvailableCallback;
GetUserMediaStatus mStatus;
bool mIsAudio;
bool mIsVideo;
@ -388,13 +388,13 @@ class ReleaseMediaOperationResource : public nsRunnable
{
public:
ReleaseMediaOperationResource(already_AddRefed<DOMMediaStream> aStream,
DOMMediaStream::OnTracksAvailableCallback* aOnTracksAvailableCallback):
OnTracksAvailableCallback* aOnTracksAvailableCallback):
mStream(aStream),
mOnTracksAvailableCallback(aOnTracksAvailableCallback) {}
NS_IMETHOD Run() override {return NS_OK;}
private:
RefPtr<DOMMediaStream> mStream;
nsAutoPtr<DOMMediaStream::OnTracksAvailableCallback> mOnTracksAvailableCallback;
nsAutoPtr<OnTracksAvailableCallback> mOnTracksAvailableCallback;
};
typedef nsTArray<RefPtr<GetUserMediaCallbackMediaStreamListener> > StreamListeners;

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

@ -288,7 +288,7 @@ class MediaRecorder::Session: public nsIObserver
};
// For Ensure recorder has tracks to record.
class TracksAvailableCallback : public DOMMediaStream::OnTracksAvailableCallback
class TracksAvailableCallback : public OnTracksAvailableCallback
{
public:
explicit TracksAvailableCallback(Session *aSession)

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

@ -172,14 +172,14 @@ private:
}
#if !defined(MOZILLA_EXTERNAL_LINKAGE)
class TracksAvailableCallback : public DOMMediaStream::OnTracksAvailableCallback
class TracksAvailableCallback : public OnTracksAvailableCallback
{
public:
TracksAvailableCallback(size_t numNewAudioTracks,
size_t numNewVideoTracks,
const std::string& pcHandle,
RefPtr<PeerConnectionObserver> aObserver)
: DOMMediaStream::OnTracksAvailableCallback()
: OnTracksAvailableCallback()
, mObserver(aObserver)
, mPcHandle(pcHandle)
{}