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