Bug 1027251 - Fix or whitelist dangerous public destructors in media/webrtc - r=rjesup

This commit is contained in:
Benoit Jacob 2014-06-20 07:08:23 -04:00
parent e67cb5f1e0
commit 257c09f0c6
21 changed files with 74 additions and 29 deletions

View File

@ -29,9 +29,9 @@ namespace CSF
protected:
CC_Call () { }
public:
virtual ~CC_Call () {}
public:
virtual void setRemoteWindow (VideoWindowHandle window) = 0;
virtual int setExternalRenderer(VideoFormat videoFormat, ExternalRendererHandle renderer) = 0;

View File

@ -33,10 +33,10 @@ namespace CSF
protected:
CC_CallInfo() { }
public:
//Base class needs dtor to be declared as virtual
virtual ~CC_CallInfo() {};
public:
/**
Get the line object associated with this call.

View File

@ -19,13 +19,13 @@ namespace CSF
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_CallServerInfo)
protected:
//Base class needs dtor to be declared as virtual
virtual ~CC_CallServerInfo() { }
CC_CallServerInfo() { }
public:
//Base class needs dtor to be declared as virtual
virtual ~CC_CallServerInfo() {};
/**
gets call server name

View File

@ -21,9 +21,9 @@ namespace CSF
protected:
CC_Device() {}
public:
virtual ~CC_Device() {}
public:
virtual std::string toString() = 0;
virtual CC_DeviceInfoPtr getDeviceInfo () = 0;

View File

@ -22,10 +22,10 @@ namespace CSF
protected:
CC_DeviceInfo() { }
public:
//Base class needs dtor to be declared as virtual
virtual ~CC_DeviceInfo() {};
public:
/**
gets the device name
@returns - the device name as an std::string

View File

@ -20,10 +20,10 @@ namespace CSF
protected:
CC_FeatureInfo() { }
public:
//Base class needs dtor to be declared as virtual
virtual ~CC_FeatureInfo() {};
public:
/**
Get the physical button number on which this feature is configured

View File

@ -20,9 +20,9 @@ namespace CSF
protected:
CC_Line () { }
public:
virtual ~CC_Line () {};
public:
virtual std::string toString() = 0;
virtual cc_lineid_t getID() = 0;

View File

@ -23,10 +23,10 @@ namespace CSF
protected:
CC_LineInfo() { }
public:
//Base class needs dtor to be declared as virtual
virtual ~CC_LineInfo() {};
public:
/**
Get the line Name

View File

@ -23,7 +23,6 @@ namespace CSF
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Service)
protected:
CC_Service() {}
public:
virtual ~CC_Service() {};
public:

View File

@ -6,6 +6,18 @@
#include "CC_Common.h"
namespace CSF {
class AudioControl;
}
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<CSF::AudioControl>
{
static const bool value = true;
};
}
namespace CSF
{
DECLARE_NS_PTR(AudioControl)

View File

@ -10,6 +10,18 @@
#include <string>
#include <vector>
namespace CSF {
class VideoControl;
}
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<CSF::VideoControl>
{
static const bool value = true;
};
}
namespace CSF
{
DECLARE_NS_PTR(VideoControl)

View File

@ -47,6 +47,9 @@ namespace CSF
*/
class ECC_API CallControlManager
{
protected:
virtual ~CallControlManager();
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CallControlManager)
/**
@ -59,8 +62,6 @@ namespace CSF
static CallControlManagerPtr create();
virtual bool destroy() = 0;
virtual ~CallControlManager();
/**
CC_Observer is for core call control events (on CC_Device, CC_Line and CC_Call).
ECC_Observer is for "value add" features of CallControlManager.

View File

@ -14,9 +14,10 @@ namespace CSF
DECLARE_NS_PTR_VECTOR(PhoneDetails);
class ECC_API PhoneDetails
{
protected:
virtual ~PhoneDetails() {}
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PhoneDetails)
virtual ~PhoneDetails() {}
/**
* Get the device name (the CUCM device name) and the free text description.
*/

View File

@ -21,10 +21,11 @@ namespace CSF
virtual ServiceStateType::ServiceState getServiceState() const { return state; }
virtual std::string getConfig() const { return config; }
public:
protected:
PhoneDetailsImpl();
virtual ~PhoneDetailsImpl();
public:
virtual void setName(const std::string& name);
virtual void setDescription(const std::string& description);
// Note that setting model and model description are mutually exclusive.

View File

@ -25,9 +25,10 @@ namespace mozilla {
*/
class TransportInterface
{
public:
protected:
virtual ~TransportInterface() {}
public:
/**
* RTP Transport Function to be implemented by concrete transport implementation
* @param data : RTP Packet (audio/video) to be transported
@ -71,9 +72,10 @@ private:
*/
class VideoRenderer
{
public:
protected:
virtual ~VideoRenderer() {}
public:
/**
* Callback Function reportng any change in the video-frame dimensions
* @param width: current width of the video @ decoder
@ -122,11 +124,12 @@ class VideoRenderer
*/
class MediaSessionConduit
{
protected:
virtual ~MediaSessionConduit() {}
public:
enum Type { AUDIO, VIDEO } ;
virtual ~MediaSessionConduit() {}
virtual Type type() const = 0;
/**

View File

@ -12,6 +12,7 @@
#include "MediaEngineWrapper.h"
#include "CodecStatistics.h"
#include "LoadManagerFactory.h"
#include "LoadManager.h"
// conflicts with #include of scoped_ptr.h
#undef FF

View File

@ -67,6 +67,15 @@ class PeerIdentity;
// For a transmitting conduit, "output" is RTP and "input" is RTCP.
// For a receiving conduit, "input" is RTP and "output" is RTCP.
//
class MediaPipeline;
template<>
struct HasDangerousPublicDestructor<MediaPipeline>
{
static const bool value = true;
};
class MediaPipeline : public sigslot::has_slots<> {
public:
enum Direction { TRANSMIT, RECEIVE };

View File

@ -28,8 +28,8 @@ namespace mozilla {
class SrtpFlow {
public:
~SrtpFlow();
public:
static mozilla::RefPtr<SrtpFlow> Create(int cipher_suite,

View File

@ -204,6 +204,9 @@ protected:
// TODO(ekr@rtfm.com): Refactor {Local,Remote}SourceStreamInfo
// bug 837539.
class LocalSourceStreamInfo : public SourceStreamInfo {
~LocalSourceStreamInfo() {
mMediaStream = nullptr;
}
public:
typedef mozilla::DOMMediaStream DOMMediaStream;
@ -211,10 +214,6 @@ public:
PeerConnectionMedia *aParent)
: SourceStreamInfo(aMediaStream, aParent) {}
~LocalSourceStreamInfo() {
mMediaStream = nullptr;
}
DOMMediaStream* GetMediaStream() {
return mMediaStream;
}
@ -239,6 +238,7 @@ private:
};
class RemoteSourceStreamInfo : public SourceStreamInfo {
~RemoteSourceStreamInfo() {}
public:
typedef mozilla::DOMMediaStream DOMMediaStream;
@ -271,9 +271,10 @@ public:
};
class PeerConnectionMedia : public sigslot::has_slots<> {
~PeerConnectionMedia() {}
public:
PeerConnectionMedia(PeerConnectionImpl *parent);
~PeerConnectionMedia() {}
nsresult Init(const std::vector<mozilla::NrIceStunServer>& stun_servers,
const std::vector<mozilla::NrIceTurnServer>& turn_servers);

View File

@ -33,8 +33,9 @@ namespace CSF
class CC_SIPCCCallMediaData
{
~CC_SIPCCCallMediaData() {}
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_SipCCCAllMediaData)
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_SIPCCCallMediaData)
CC_SIPCCCallMediaData():
remoteWindow(nullptr),
streamMapMutex("CC_SIPCCCallMediaData"),

View File

@ -36,9 +36,10 @@ static const int64_t USECS_PER_S = 1000000;
class Fake_MediaStreamListener
{
public:
protected:
virtual ~Fake_MediaStreamListener() {}
public:
virtual void NotifyQueuedTrackChanges(mozilla::MediaStreamGraph* aGraph, mozilla::TrackID aID,
mozilla::TrackRate aTrackRate,
mozilla::TrackTicks aTrackOffset,
@ -51,9 +52,10 @@ class Fake_MediaStreamListener
class Fake_MediaStreamDirectListener : public Fake_MediaStreamListener
{
public:
protected:
virtual ~Fake_MediaStreamDirectListener() {}
public:
virtual void NotifyRealtimeData(mozilla::MediaStreamGraph* graph, mozilla::TrackID tid,
mozilla::TrackRate rate,
mozilla::TrackTicks offset,
@ -63,9 +65,11 @@ class Fake_MediaStreamDirectListener : public Fake_MediaStreamListener
// Note: only one listener supported
class Fake_MediaStream {
protected:
virtual ~Fake_MediaStream() { Stop(); }
public:
Fake_MediaStream () : mListeners(), mMutex("Fake MediaStream") {}
virtual ~Fake_MediaStream() { Stop(); }
void AddListener(Fake_MediaStreamListener *aListener) {
mozilla::MutexAutoLock lock(mMutex);