mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 11:38:16 +00:00
Bug 1035394 - Fix dangerous public destructors in content/media - r=cpearce
This commit is contained in:
parent
5707fd97e7
commit
bbd8cc51c5
@ -289,7 +289,6 @@ class DOMLocalMediaStream : public DOMMediaStream,
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DOMLocalMediaStream() {}
|
DOMLocalMediaStream() {}
|
||||||
virtual ~DOMLocalMediaStream();
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
|
|
||||||
@ -308,6 +307,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
static already_AddRefed<DOMLocalMediaStream>
|
static already_AddRefed<DOMLocalMediaStream>
|
||||||
CreateTrackUnionStream(nsIDOMWindow* aWindow, TrackTypeHints aHintContents = 0);
|
CreateTrackUnionStream(nsIDOMWindow* aWindow, TrackTypeHints aHintContents = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ~DOMLocalMediaStream();
|
||||||
};
|
};
|
||||||
|
|
||||||
class DOMAudioNodeMediaStream : public DOMMediaStream
|
class DOMAudioNodeMediaStream : public DOMMediaStream
|
||||||
@ -315,7 +317,6 @@ class DOMAudioNodeMediaStream : public DOMMediaStream
|
|||||||
typedef dom::AudioNode AudioNode;
|
typedef dom::AudioNode AudioNode;
|
||||||
public:
|
public:
|
||||||
DOMAudioNodeMediaStream(AudioNode* aNode);
|
DOMAudioNodeMediaStream(AudioNode* aNode);
|
||||||
~DOMAudioNodeMediaStream();
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)
|
||||||
@ -328,6 +329,9 @@ public:
|
|||||||
AudioNode* aNode,
|
AudioNode* aNode,
|
||||||
TrackTypeHints aHintContents = 0);
|
TrackTypeHints aHintContents = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
~DOMAudioNodeMediaStream();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// If this object wraps a stream owned by an AudioNode, we need to ensure that
|
// If this object wraps a stream owned by an AudioNode, we need to ensure that
|
||||||
// the node isn't cycle-collected too early.
|
// the node isn't cycle-collected too early.
|
||||||
|
@ -44,7 +44,6 @@ class MediaRecorder : public DOMEventTargetHelper,
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
MediaRecorder(DOMMediaStream&, nsPIDOMWindow* aOwnerWindow);
|
MediaRecorder(DOMMediaStream&, nsPIDOMWindow* aOwnerWindow);
|
||||||
virtual ~MediaRecorder();
|
|
||||||
|
|
||||||
// nsWrapperCache
|
// nsWrapperCache
|
||||||
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||||
@ -91,6 +90,8 @@ public:
|
|||||||
NS_DECL_NSIDOCUMENTACTIVITY
|
NS_DECL_NSIDOCUMENTACTIVITY
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual ~MediaRecorder();
|
||||||
|
|
||||||
MediaRecorder& operator = (const MediaRecorder& x) MOZ_DELETE;
|
MediaRecorder& operator = (const MediaRecorder& x) MOZ_DELETE;
|
||||||
// Create dataavailable event with Blob data and it runs in main thread
|
// Create dataavailable event with Blob data and it runs in main thread
|
||||||
nsresult CreateAndDispatchBlobEvent(already_AddRefed<nsIDOMBlob>&& aBlob);
|
nsresult CreateAndDispatchBlobEvent(already_AddRefed<nsIDOMBlob>&& aBlob);
|
||||||
|
@ -29,7 +29,6 @@ public:
|
|||||||
* MediaStream owned by aStream.
|
* MediaStream owned by aStream.
|
||||||
*/
|
*/
|
||||||
MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID);
|
MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID);
|
||||||
virtual ~MediaStreamTrack();
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamTrack,
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamTrack,
|
||||||
@ -54,6 +53,8 @@ public:
|
|||||||
void NotifyEnded() { mEnded = true; }
|
void NotifyEnded() { mEnded = true; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual ~MediaStreamTrack();
|
||||||
|
|
||||||
nsRefPtr<DOMMediaStream> mStream;
|
nsRefPtr<DOMMediaStream> mStream;
|
||||||
TrackID mTrackID;
|
TrackID mTrackID;
|
||||||
nsID mID;
|
nsID mID;
|
||||||
|
@ -38,8 +38,6 @@ public:
|
|||||||
const nsAString& aLabel,
|
const nsAString& aLabel,
|
||||||
const nsAString& aLanguage);
|
const nsAString& aLanguage);
|
||||||
|
|
||||||
virtual ~MediaTrack();
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaTrack, DOMEventTargetHelper)
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaTrack, DOMEventTargetHelper)
|
||||||
|
|
||||||
@ -88,6 +86,8 @@ public:
|
|||||||
friend class MediaTrackList;
|
friend class MediaTrackList;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual ~MediaTrack();
|
||||||
|
|
||||||
void SetTrackList(MediaTrackList* aList);
|
void SetTrackList(MediaTrackList* aList);
|
||||||
void Init(nsPIDOMWindow* aOwnerWindow);
|
void Init(nsPIDOMWindow* aOwnerWindow);
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@ class MediaTrackList : public DOMEventTargetHelper
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MediaTrackList(nsPIDOMWindow* aOwnerWindow, HTMLMediaElement* aMediaElement);
|
MediaTrackList(nsPIDOMWindow* aOwnerWindow, HTMLMediaElement* aMediaElement);
|
||||||
virtual ~MediaTrackList();
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaTrackList, DOMEventTargetHelper)
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaTrackList, DOMEventTargetHelper)
|
||||||
@ -117,6 +116,8 @@ public:
|
|||||||
friend class VideoTrack;
|
friend class VideoTrack;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual ~MediaTrackList();
|
||||||
|
|
||||||
void CreateAndDispatchTrackEventRunner(MediaTrack* aTrack,
|
void CreateAndDispatchTrackEventRunner(MediaTrack* aTrack,
|
||||||
const nsAString& aEventName);
|
const nsAString& aEventName);
|
||||||
|
|
||||||
|
@ -57,7 +57,6 @@ public:
|
|||||||
TextTrackMode aMode,
|
TextTrackMode aMode,
|
||||||
TextTrackReadyState aReadyState,
|
TextTrackReadyState aReadyState,
|
||||||
TextTrackSource aTextTrackSource);
|
TextTrackSource aTextTrackSource);
|
||||||
~TextTrack();
|
|
||||||
|
|
||||||
void SetDefaultSettings();
|
void SetDefaultSettings();
|
||||||
|
|
||||||
@ -121,6 +120,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
~TextTrack();
|
||||||
|
|
||||||
nsRefPtr<TextTrackList> mTextTrackList;
|
nsRefPtr<TextTrackList> mTextTrackList;
|
||||||
|
|
||||||
TextTrackKind mKind;
|
TextTrackKind mKind;
|
||||||
|
@ -51,8 +51,6 @@ public:
|
|||||||
const nsAString& aText, HTMLTrackElement* aTrackElement,
|
const nsAString& aText, HTMLTrackElement* aTrackElement,
|
||||||
ErrorResult& aRv);
|
ErrorResult& aRv);
|
||||||
|
|
||||||
~TextTrackCue();
|
|
||||||
|
|
||||||
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||||
|
|
||||||
TextTrack* GetTrack() const
|
TextTrack* GetTrack() const
|
||||||
@ -336,6 +334,8 @@ public:
|
|||||||
void SetTrackElement(HTMLTrackElement* aTrackElement);
|
void SetTrackElement(HTMLTrackElement* aTrackElement);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
~TextTrackCue();
|
||||||
|
|
||||||
void SetDefaultCueSettings();
|
void SetDefaultCueSettings();
|
||||||
nsresult StashDocument();
|
nsresult StashDocument();
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ public:
|
|||||||
|
|
||||||
TextTrackList(nsPIDOMWindow* aOwnerWindow);
|
TextTrackList(nsPIDOMWindow* aOwnerWindow);
|
||||||
TextTrackList(nsPIDOMWindow* aOwnerWindow, TextTrackManager* aTextTrackManager);
|
TextTrackList(nsPIDOMWindow* aOwnerWindow, TextTrackManager* aTextTrackManager);
|
||||||
~TextTrackList();
|
|
||||||
|
|
||||||
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||||
|
|
||||||
@ -68,6 +67,8 @@ public:
|
|||||||
IMPL_EVENT_HANDLER(removetrack)
|
IMPL_EVENT_HANDLER(removetrack)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
~TextTrackList();
|
||||||
|
|
||||||
nsTArray< nsRefPtr<TextTrack> > mTextTracks;
|
nsTArray< nsRefPtr<TextTrack> > mTextTracks;
|
||||||
nsRefPtr<TextTrackManager> mTextTrackManager;
|
nsRefPtr<TextTrackManager> mTextTrackManager;
|
||||||
|
|
||||||
|
@ -49,8 +49,6 @@ public:
|
|||||||
Constructor(const GlobalObject& aGlobal,
|
Constructor(const GlobalObject& aGlobal,
|
||||||
ErrorResult& aRv);
|
ErrorResult& aRv);
|
||||||
|
|
||||||
~MediaSource();
|
|
||||||
|
|
||||||
SourceBufferList* SourceBuffers();
|
SourceBufferList* SourceBuffers();
|
||||||
SourceBufferList* ActiveSourceBuffers();
|
SourceBufferList* ActiveSourceBuffers();
|
||||||
MediaSourceReadyState ReadyState();
|
MediaSourceReadyState ReadyState();
|
||||||
@ -98,6 +96,8 @@ public:
|
|||||||
void NotifyGotData();
|
void NotifyGotData();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
~MediaSource();
|
||||||
|
|
||||||
explicit MediaSource(nsPIDOMWindow* aWindow);
|
explicit MediaSource(nsPIDOMWindow* aWindow);
|
||||||
|
|
||||||
friend class AsyncEventRunner<MediaSource>;
|
friend class AsyncEventRunner<MediaSource>;
|
||||||
|
@ -90,7 +90,6 @@ public:
|
|||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SourceBuffer, DOMEventTargetHelper)
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SourceBuffer, DOMEventTargetHelper)
|
||||||
|
|
||||||
static already_AddRefed<SourceBuffer> Create(MediaSource* aMediaSource, const nsACString& aType);
|
static already_AddRefed<SourceBuffer> Create(MediaSource* aMediaSource, const nsACString& aType);
|
||||||
~SourceBuffer();
|
|
||||||
|
|
||||||
MediaSource* GetParentObject() const;
|
MediaSource* GetParentObject() const;
|
||||||
|
|
||||||
@ -113,6 +112,8 @@ public:
|
|||||||
bool ContainsTime(double aTime);
|
bool ContainsTime(double aTime);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
~SourceBuffer();
|
||||||
|
|
||||||
SourceBuffer(MediaSource* aMediaSource, const nsACString& aType);
|
SourceBuffer(MediaSource* aMediaSource, const nsACString& aType);
|
||||||
|
|
||||||
friend class AsyncEventRunner<SourceBuffer>;
|
friend class AsyncEventRunner<SourceBuffer>;
|
||||||
|
@ -31,6 +31,10 @@ namespace mozilla {
|
|||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
|
SourceBufferList::~SourceBufferList()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
SourceBuffer*
|
SourceBuffer*
|
||||||
SourceBufferList::IndexedGetter(uint32_t aIndex, bool& aFound)
|
SourceBufferList::IndexedGetter(uint32_t aIndex, bool& aFound)
|
||||||
{
|
{
|
||||||
|
@ -80,6 +80,8 @@ public:
|
|||||||
bool AllContainsTime(double aTime);
|
bool AllContainsTime(double aTime);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
~SourceBufferList();
|
||||||
|
|
||||||
friend class AsyncEventRunner<SourceBufferList>;
|
friend class AsyncEventRunner<SourceBufferList>;
|
||||||
void DispatchSimpleEvent(const char* aName);
|
void DispatchSimpleEvent(const char* aName);
|
||||||
void QueueAsyncSimpleEvent(const char* aName);
|
void QueueAsyncSimpleEvent(const char* aName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user