Bug 1027251 - Fix or whitelist dangerous public destructors in widget/ - r=roc
authorBenoit Jacob <bjacob@mozilla.com>
Fri, 20 Jun 2014 07:08:25 -0400
changeset 210563 8e05708379ffe13bbe159dfc0439f901b70aab17
parent 210562 fc29e89ab9b12f4a36b5b3c8ae80b71098e789dc
child 210564 77aa55e45693239251b4977fedcf5f268bb6d1ba
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1027251
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1027251 - Fix or whitelist dangerous public destructors in widget/ - r=roc
widget/TextRange.h
widget/shared/nsShmImage.h
--- a/widget/TextRange.h
+++ b/widget/TextRange.h
@@ -158,16 +158,18 @@ struct TextRange
   }
 };
 
 /******************************************************************************
  * mozilla::TextRangeArray
  ******************************************************************************/
 class TextRangeArray MOZ_FINAL : public nsAutoTArray<TextRange, 10>
 {
+  ~TextRangeArray() {}
+
   NS_INLINE_DECL_REFCOUNTING(TextRangeArray)
 
 public:
   bool IsComposing() const
   {
     for (uint32_t i = 0; i < Length(); ++i) {
       if (ElementAt(i).IsClause()) {
         return true;
--- a/widget/shared/nsShmImage.h
+++ b/widget/shared/nsShmImage.h
@@ -44,26 +44,28 @@ public:
 
     static bool UseShm();
     static already_AddRefed<nsShmImage>
         Create(const gfxIntSize& aSize, Visual* aVisual, unsigned int aDepth);
     static already_AddRefed<gfxASurface>
         EnsureShmImage(const gfxIntSize& aSize, Visual* aVisual, unsigned int aDepth,
                        nsRefPtr<nsShmImage>& aImage);
 
+private:
     ~nsShmImage() {
         if (mImage) {
             mozilla::FinishX(DISPLAY());
             if (mXAttached) {
                 XShmDetach(DISPLAY(), &mInfo);
             }
             XDestroyImage(mImage);
         }
     }
 
+public:
     already_AddRefed<gfxASurface> AsSurface();
 
 #if (MOZ_WIDGET_GTK == 2)
     void Put(GdkWindow* aWindow, GdkRectangle* aRects, GdkRectangle* aEnd);
 #elif (MOZ_WIDGET_GTK == 3)
     void Put(GdkWindow* aWindow, cairo_rectangle_list_t* aRects);
 #elif defined(MOZ_WIDGET_QT)
     void Put(QWindow* aWindow, QRect& aRect);