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

This commit is contained in:
Benoit Jacob 2014-06-18 22:28:59 -04:00
parent 35c0a39717
commit e01bd7ff0c
10 changed files with 32 additions and 9 deletions

View File

@ -198,7 +198,7 @@ protected:
* its active image.
*/
class BufferRecycleBin MOZ_FINAL {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RecycleBin)
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(BufferRecycleBin)
//typedef mozilla::gl::GLContext GLContext;

View File

@ -12,11 +12,12 @@ namespace mozilla {
namespace layers {
class TransactionIdAllocator {
protected:
virtual ~TransactionIdAllocator() {}
public:
NS_INLINE_DECL_REFCOUNTING(TransactionIdAllocator)
virtual ~TransactionIdAllocator() {}
/**
* Allocate a unique id number for the current refresh tick, can
* only be called while IsInRefresh().

View File

@ -25,11 +25,11 @@ namespace layers {
* of touch input.
*/
class ActiveElementManager {
~ActiveElementManager();
public:
NS_INLINE_DECL_REFCOUNTING(ActiveElementManager)
ActiveElementManager();
~ActiveElementManager();
/**
* Specify the target of a touch. Typically this should be called right

View File

@ -80,6 +80,7 @@ using namespace mozilla::gfx;
*/
class TextureChild MOZ_FINAL : public PTextureChild
{
~TextureChild() {}
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TextureChild)

View File

@ -70,6 +70,9 @@ struct ViewTransform {
class AsyncCompositionManager MOZ_FINAL
{
friend class AutoResolveRefLayers;
~AsyncCompositionManager()
{
}
public:
NS_INLINE_DECL_REFCOUNTING(AsyncCompositionManager)
@ -80,9 +83,6 @@ public:
, mReadyForCompose(true)
{
}
~AsyncCompositionManager()
{
}
/**
* This forces the is-first-paint flag to true. This is intended to

View File

@ -17,6 +17,8 @@ class Compositor;
class TextRenderer
{
~TextRenderer();
public:
NS_INLINE_DECL_REFCOUNTING(TextRenderer)
@ -25,8 +27,6 @@ public:
{
}
~TextRenderer();
void RenderText(const std::string& aText, const gfx::IntPoint& aOrigin,
const gfx::Matrix4x4& aTransform, uint32_t aTextSize,
uint32_t aTargetPixelWidth);

View File

@ -1131,6 +1131,7 @@ public:
virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aParent) MOZ_OVERRIDE;
void DidComposite(uint64_t aId);
private:
// Private destructor, to discourage deletion outside of Release():
virtual ~CrossProcessCompositorParent();

View File

@ -254,6 +254,8 @@ private:
// This array is indexed by ColorModel::ToIndex.
RefPtr<FilterNode> mFilterForColorModel[4];
~FilterCachedColorModels() {}
};
FilterCachedColorModels::FilterCachedColorModels(DrawTarget* aDT,

View File

@ -23,6 +23,16 @@ typedef struct _cairo cairo_t;
struct GlyphBufferAzure;
template <typename T> class FallibleTArray;
class gfxContext;
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<gfxContext>
{
static const bool value = true;
};
}
/**
* This is the main class for doing actual drawing. It is initialized using
* a surface and can be drawn on. It manages various state information like

View File

@ -165,6 +165,14 @@ operator==(const FontFamilyName& a, const FontFamilyName& b) {
return a.mType == b.mType && a.mName == b.mName;
}
class FontFamilyList;
template<>
struct HasDangerousPublicDestructor<FontFamilyList>
{
static const bool value = true;
};
/**
* font family list, array of font families and a default font type.
* font family names are either named strings or generics. the default