mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 02:09:28 +00:00
Bug 1027251 - Fix or whitelist dangerous public destructors in media/mtransport - r=abr
This commit is contained in:
parent
817cdfbfe9
commit
a9291b104e
@ -15,6 +15,14 @@
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class DataBuffer;
|
||||
|
||||
template<>
|
||||
struct HasDangerousPublicDestructor<DataBuffer>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
class DataBuffer {
|
||||
public:
|
||||
DataBuffer() : data_(nullptr), len_(0) {}
|
||||
|
@ -19,9 +19,9 @@
|
||||
namespace mozilla {
|
||||
|
||||
class DtlsIdentity {
|
||||
public:
|
||||
~DtlsIdentity();
|
||||
|
||||
public:
|
||||
// Generate an identity with a random name.
|
||||
static TemporaryRef<DtlsIdentity> Generate();
|
||||
|
||||
|
@ -182,6 +182,7 @@ struct nr_udp_message {
|
||||
nsAutoPtr<DataBuffer> data;
|
||||
|
||||
private:
|
||||
~nr_udp_message() {}
|
||||
DISALLOW_COPY_ASSIGN(nr_udp_message);
|
||||
};
|
||||
|
||||
|
@ -191,8 +191,6 @@ class NrIceCtx {
|
||||
static RefPtr<NrIceCtx> Create(const std::string& name,
|
||||
bool offerer,
|
||||
bool set_interface_priorities = true);
|
||||
virtual ~NrIceCtx();
|
||||
|
||||
nr_ice_ctx *ctx() { return ctx_; }
|
||||
nr_ice_peer_ctx *peer() { return peer_; }
|
||||
|
||||
@ -281,6 +279,8 @@ class NrIceCtx {
|
||||
(void)offerer_;
|
||||
}
|
||||
|
||||
virtual ~NrIceCtx();
|
||||
|
||||
DISALLOW_COPY_ASSIGN(NrIceCtx);
|
||||
|
||||
// Callbacks for nICEr
|
||||
|
@ -125,8 +125,6 @@ class NrIceMediaStream {
|
||||
static RefPtr<NrIceMediaStream> Create(NrIceCtx *ctx,
|
||||
const std::string& name,
|
||||
int components);
|
||||
~NrIceMediaStream();
|
||||
|
||||
enum State { ICE_CONNECTING, ICE_OPEN, ICE_CLOSED};
|
||||
|
||||
State state() const { return state_; }
|
||||
@ -206,6 +204,8 @@ class NrIceMediaStream {
|
||||
stream_(nullptr),
|
||||
opaque_(nullptr) {}
|
||||
|
||||
~NrIceMediaStream();
|
||||
|
||||
DISALLOW_COPY_ASSIGN(NrIceMediaStream);
|
||||
|
||||
State state_;
|
||||
|
@ -61,9 +61,9 @@ namespace mozilla {
|
||||
|
||||
class NrIceResolver
|
||||
{
|
||||
~NrIceResolver();
|
||||
public:
|
||||
NrIceResolver();
|
||||
~NrIceResolver();
|
||||
|
||||
nsresult Init();
|
||||
nr_resolver *AllocateResolver();
|
||||
|
@ -42,6 +42,16 @@ static uint8_t kStunMessage[] = {
|
||||
};
|
||||
static size_t kStunMessageLen = sizeof(kStunMessage);
|
||||
|
||||
class DummySocket;
|
||||
|
||||
namespace mozilla {
|
||||
template<>
|
||||
struct HasDangerousPublicDestructor<DummySocket>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
}
|
||||
|
||||
class DummySocket : public NrSocketBase {
|
||||
public:
|
||||
DummySocket()
|
||||
|
@ -38,12 +38,12 @@ MtransportTestUtils *test_utils;
|
||||
namespace {
|
||||
|
||||
class Destructor {
|
||||
public:
|
||||
Destructor(bool* destroyed) : destroyed_(destroyed) {}
|
||||
~Destructor() {
|
||||
std::cerr << "Destructor called" << std::endl;
|
||||
*destroyed_ = true;
|
||||
}
|
||||
public:
|
||||
Destructor(bool* destroyed) : destroyed_(destroyed) {}
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Destructor)
|
||||
|
||||
|
@ -120,6 +120,7 @@ class TransportLayerDtls : public TransportLayer {
|
||||
unsigned char value_[kMaxDigestLength];
|
||||
|
||||
private:
|
||||
~VerificationDigest() {}
|
||||
DISALLOW_COPY_ASSIGN(VerificationDigest);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user