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
Родитель c494ef04f8
Коммит e6f9a16c61
6 изменённых файлов: 23 добавлений и 4 удалений

Просмотреть файл

@ -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

Просмотреть файл

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

Просмотреть файл

@ -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

Просмотреть файл

@ -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() {}
};
/*

Просмотреть файл

@ -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)

Просмотреть файл

@ -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