Bug 1027251 - Fix or whitelist dangerous public destructors in image/ - r=jrmuizel

This commit is contained in:
Benoit Jacob 2014-06-18 22:29:00 -04:00
parent 96b29e0856
commit b4866abdf9
6 changed files with 23 additions and 4 deletions

View File

@ -15,6 +15,17 @@
#include "mozilla/Telemetry.h"
namespace mozilla {
namespace image {
class Decoder;
}
template<>
struct HasDangerousPublicDestructor<image::Decoder>
{
static const bool value = true;
};
namespace image {
class Decoder

View File

@ -138,10 +138,10 @@ private:
*/
class FrameSequence
{
public:
~FrameSequence();
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(FrameSequence)
/**

View File

@ -35,7 +35,7 @@ public:
aURI->GetRef(mRef);
}
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(mozilla::image::ImageURL)
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageURL)
nsresult GetSpec(nsACString &result) {
result = mSpec;
@ -78,6 +78,8 @@ private:
nsAutoCString mSpec;
nsAutoCString mScheme;
nsAutoCString mRef;
~ImageURL() {}
};
} // namespace image

View File

@ -390,6 +390,9 @@ private:
/* True if a new frame has been allocated, but DecodeSomeData hasn't yet
* been called to flush data to it */
bool mAllocatedNewFrame;
private:
~DecodeRequest() {}
};
/*

View File

@ -111,6 +111,7 @@ private:
*/
class CachedSurface
{
~CachedSurface() {}
public:
NS_INLINE_DECL_REFCOUNTING(CachedSurface)
@ -158,6 +159,7 @@ private:
*/
class ImageSurfaceCache
{
~ImageSurfaceCache() {}
public:
NS_INLINE_DECL_REFCOUNTING(ImageSurfaceCache)

View File

@ -108,6 +108,8 @@ enum {
class imgStatusTracker : public mozilla::SupportsWeakPtr<imgStatusTracker>
{
virtual ~imgStatusTracker();
public:
MOZ_DECLARE_REFCOUNTED_TYPENAME(imgStatusTracker)
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(imgStatusTracker)
@ -116,7 +118,6 @@ public:
// imgRequestProxys in SyncNotify() and EmulateRequestFinished(), and must be
// alive as long as this instance is, because we hold a weak reference to it.
imgStatusTracker(mozilla::image::Image* aImage);
virtual ~imgStatusTracker();
// Image-setter, for imgStatusTrackers created by imgRequest::Init, which
// are created before their Image is created. This method should only