Bug 884061 - Part 3k: Use NS_DECL_THREADSAFE_ISUPPORTS in image/, r=joedrew
authorJoshua Cranmer <Pidgeot18@gmail.com>
Thu, 18 Jul 2013 21:23:31 -0500
changeset 151894 352cb42a9c7a061724807a7bf4fc9312666a3786
parent 151893 cd4a15be6ea597736c85a40fea4aeca702299299
child 151895 c00e38f175be47ca1441e2ea5e46ad4114e4f66a
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoedrew
bugs884061
milestone25.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 884061 - Part 3k: Use NS_DECL_THREADSAFE_ISUPPORTS in image/, r=joedrew
image/decoders/icon/mac/nsIconChannel.h
image/decoders/icon/mac/nsIconChannelCocoa.mm
image/decoders/icon/nsIconURI.cpp
image/decoders/icon/nsIconURI.h
image/decoders/icon/os2/nsIconChannel.cpp
image/decoders/icon/os2/nsIconChannel.h
image/decoders/icon/win/nsIconChannel.cpp
image/decoders/icon/win/nsIconChannel.h
image/encoders/bmp/nsBMPEncoder.cpp
image/encoders/bmp/nsBMPEncoder.h
image/encoders/ico/nsICOEncoder.cpp
image/encoders/ico/nsICOEncoder.h
image/encoders/jpeg/nsJPEGEncoder.cpp
image/encoders/jpeg/nsJPEGEncoder.h
image/encoders/png/nsPNGEncoder.cpp
image/encoders/png/nsPNGEncoder.h
image/src/RasterImage.cpp
image/src/RasterImage.h
--- a/image/decoders/icon/mac/nsIconChannel.h
+++ b/image/decoders/icon/mac/nsIconChannel.h
@@ -19,17 +19,17 @@
 #include "nsIStreamListener.h"
 #include "nsIURI.h"
 
 class nsIFile;
 
 class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIREQUEST
   NS_DECL_NSICHANNEL
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
   nsIconChannel();
   virtual ~nsIconChannel();
 
--- a/image/decoders/icon/mac/nsIconChannelCocoa.mm
+++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm
@@ -29,17 +29,17 @@
 // nsIconChannel methods
 nsIconChannel::nsIconChannel()
 {
 }
 
 nsIconChannel::~nsIconChannel() 
 {}
 
-NS_IMPL_THREADSAFE_ISUPPORTS4(nsIconChannel, 
+NS_IMPL_ISUPPORTS4(nsIconChannel, 
                               nsIChannel, 
                               nsIRequest,
 			       nsIRequestObserver,
 			       nsIStreamListener)
 
 nsresult nsIconChannel::Init(nsIURI* uri)
 {
   NS_ASSERTION(uri, "no uri");
--- a/image/decoders/icon/nsIconURI.cpp
+++ b/image/decoders/icon/nsIconURI.cpp
@@ -54,17 +54,17 @@ nsMozIconURI::nsMozIconURI()
     mIconState(-1)
 {
 }
  
 nsMozIconURI::~nsMozIconURI()
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS2(nsMozIconURI, nsIMozIconURI, nsIURI)
+NS_IMPL_ISUPPORTS2(nsMozIconURI, nsIMozIconURI, nsIURI)
 
 #define MOZICON_SCHEME "moz-icon:"
 #define MOZICON_SCHEME_LEN (sizeof(MOZICON_SCHEME) - 1)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIURI methods:
 
 NS_IMETHODIMP
--- a/image/decoders/icon/nsIconURI.h
+++ b/image/decoders/icon/nsIconURI.h
@@ -17,17 +17,17 @@
     0x2d37,                                          \
     0x11d5,                                          \
     { 0x99, 0x7, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b }   \
 }
 
 class nsMozIconURI : public nsIMozIconURI
 {
 public:    
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIURI
   NS_DECL_NSIMOZICONURI
 
   // nsMozIconURI
   nsMozIconURI();
   virtual ~nsMozIconURI();
 
 protected:
--- a/image/decoders/icon/os2/nsIconChannel.cpp
+++ b/image/decoders/icon/os2/nsIconChannel.cpp
@@ -52,17 +52,17 @@ static bool sUseRws = true;
 
 nsIconChannel::nsIconChannel()
 {
 }
 
 nsIconChannel::~nsIconChannel()
 {}
 
-NS_IMPL_THREADSAFE_ISUPPORTS4(nsIconChannel, 
+NS_IMPL_ISUPPORTS4(nsIconChannel, 
                               nsIChannel,
                               nsIRequest,
                               nsIRequestObserver,
                               nsIStreamListener)
 
 nsresult nsIconChannel::Init(nsIURI* uri)
 {
   NS_ASSERTION(uri, "no uri");
--- a/image/decoders/icon/os2/nsIconChannel.h
+++ b/image/decoders/icon/os2/nsIconChannel.h
@@ -19,17 +19,17 @@
 #include "nsIInputStreamPump.h"
 #include "nsIStreamListener.h"
 
 class nsIFile;
 
 class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIREQUEST
   NS_DECL_NSICHANNEL
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
   nsIconChannel();
   virtual ~nsIconChannel();
 
--- a/image/decoders/icon/win/nsIconChannel.cpp
+++ b/image/decoders/icon/win/nsIconChannel.cpp
@@ -70,17 +70,17 @@ static SHSTOCKICONID GetStockIconIDForNa
 // nsIconChannel methods
 nsIconChannel::nsIconChannel()
 {
 }
 
 nsIconChannel::~nsIconChannel() 
 {}
 
-NS_IMPL_THREADSAFE_ISUPPORTS4(nsIconChannel, 
+NS_IMPL_ISUPPORTS4(nsIconChannel, 
                               nsIChannel, 
                               nsIRequest,
                               nsIRequestObserver,
                               nsIStreamListener)
 
 nsresult nsIconChannel::Init(nsIURI* uri)
 {
   NS_ASSERTION(uri, "no uri");
--- a/image/decoders/icon/win/nsIconChannel.h
+++ b/image/decoders/icon/win/nsIconChannel.h
@@ -22,17 +22,17 @@
 
 #include <windows.h>
 
 class nsIFile;
 
 class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIREQUEST
   NS_DECL_NSICHANNEL
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
   nsIconChannel();
   ~nsIconChannel();
 
--- a/image/encoders/bmp/nsBMPEncoder.cpp
+++ b/image/encoders/bmp/nsBMPEncoder.cpp
@@ -8,17 +8,17 @@
 #include "prprf.h"
 #include "nsString.h"
 #include "nsStreamUtils.h"
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
 
 using namespace mozilla;
 
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsBMPEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
+NS_IMPL_ISUPPORTS3(nsBMPEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
 
 nsBMPEncoder::nsBMPEncoder() : mImageBufferStart(nullptr), 
                                mImageBufferCurr(0),
                                mImageBufferSize(0), 
                                mImageBufferReadPoint(0), 
                                mFinished(false),
                                mCallback(nullptr), 
                                mCallbackTarget(nullptr), 
--- a/image/encoders/bmp/nsBMPEncoder.h
+++ b/image/encoders/bmp/nsBMPEncoder.h
@@ -20,17 +20,17 @@
 
 // Provides BMP encoding functionality. Use InitFromData() to do the
 // encoding. See that function definition for encoding options.
 
 class nsBMPEncoder MOZ_FINAL : public imgIEncoder
 {
   typedef mozilla::ReentrantMonitor ReentrantMonitor;
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_IMGIENCODER
   NS_DECL_NSIINPUTSTREAM
   NS_DECL_NSIASYNCINPUTSTREAM
 
   nsBMPEncoder();
   ~nsBMPEncoder();
 
 protected:
--- a/image/encoders/ico/nsICOEncoder.cpp
+++ b/image/encoders/ico/nsICOEncoder.cpp
@@ -10,17 +10,17 @@
 #include "prprf.h"
 #include "nsString.h"
 #include "nsStreamUtils.h"
 #include "nsTArray.h"
 
 using namespace mozilla;
 using namespace mozilla::image;
 
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsICOEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
+NS_IMPL_ISUPPORTS3(nsICOEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
 
 nsICOEncoder::nsICOEncoder() : mImageBufferStart(nullptr),
                                mImageBufferCurr(0),
                                mImageBufferSize(0), 
                                mImageBufferReadPoint(0), 
                                mFinished(false),
                                mUsePNG(true),
                                mNotifyThreshold(0)
--- a/image/encoders/ico/nsICOEncoder.h
+++ b/image/encoders/ico/nsICOEncoder.h
@@ -24,17 +24,17 @@ class nsPNGEncoder;
 
 // Provides ICO encoding functionality. Use InitFromData() to do the
 // encoding. See that function definition for encoding options.
 
 class nsICOEncoder MOZ_FINAL : public imgIEncoder
 {
   typedef mozilla::ReentrantMonitor ReentrantMonitor;
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_IMGIENCODER
   NS_DECL_NSIINPUTSTREAM
   NS_DECL_NSIASYNCINPUTSTREAM
 
   nsICOEncoder();
   ~nsICOEncoder();
   
   // Obtains the width of the icon directory entry
--- a/image/encoders/jpeg/nsJPEGEncoder.cpp
+++ b/image/encoders/jpeg/nsJPEGEncoder.cpp
@@ -9,17 +9,17 @@
 #include "nsStreamUtils.h"
 #include "gfxColor.h"
 
 #include <setjmp.h>
 #include "jerror.h"
 
 using namespace mozilla;
 
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsJPEGEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
+NS_IMPL_ISUPPORTS3(nsJPEGEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
 
 // used to pass error info through the JPEG library
 struct encoder_error_mgr {
   jpeg_error_mgr pub;
   jmp_buf setjmp_buffer;
 };
 
 nsJPEGEncoder::nsJPEGEncoder() : mFinished(false),
--- a/image/encoders/jpeg/nsJPEGEncoder.h
+++ b/image/encoders/jpeg/nsJPEGEncoder.h
@@ -27,17 +27,17 @@ extern "C" {
 
 // Provides JPEG encoding functionality. Use InitFromData() to do the
 // encoding. See that function definition for encoding options.
 
 class nsJPEGEncoder MOZ_FINAL : public imgIEncoder
 {
   typedef mozilla::ReentrantMonitor ReentrantMonitor;
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_IMGIENCODER
   NS_DECL_NSIINPUTSTREAM
   NS_DECL_NSIASYNCINPUTSTREAM
 
   nsJPEGEncoder();
 
 private:
   ~nsJPEGEncoder();
--- a/image/encoders/png/nsPNGEncoder.cpp
+++ b/image/encoders/png/nsPNGEncoder.cpp
@@ -6,17 +6,17 @@
 #include "nsCRT.h"
 #include "nsPNGEncoder.h"
 #include "prprf.h"
 #include "nsString.h"
 #include "nsStreamUtils.h"
 
 using namespace mozilla;
 
-NS_IMPL_THREADSAFE_ISUPPORTS3(nsPNGEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
+NS_IMPL_ISUPPORTS3(nsPNGEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
 
 nsPNGEncoder::nsPNGEncoder() : mPNG(nullptr), mPNGinfo(nullptr),
                                mIsAnimation(false),
                                mFinished(false),
                                mImageBuffer(nullptr), mImageBufferSize(0),
                                mImageBufferUsed(0), mImageBufferReadPoint(0),
                                mCallback(nullptr),
                                mCallbackTarget(nullptr), mNotifyThreshold(0),
--- a/image/encoders/png/nsPNGEncoder.h
+++ b/image/encoders/png/nsPNGEncoder.h
@@ -22,17 +22,17 @@
 
 // Provides PNG encoding functionality. Use InitFromData() to do the
 // encoding. See that function definition for encoding options.
 
 class nsPNGEncoder MOZ_FINAL : public imgIEncoder
 {
   typedef mozilla::ReentrantMonitor ReentrantMonitor;
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_IMGIENCODER
   NS_DECL_NSIINPUTSTREAM
   NS_DECL_NSIASYNCINPUTSTREAM
 
   nsPNGEncoder();
   ~nsPNGEncoder();
 
 protected:
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -368,19 +368,19 @@ private:
 
 namespace mozilla {
 namespace image {
 
 /* static */ StaticRefPtr<RasterImage::DecodePool> RasterImage::DecodePool::sSingleton;
 static nsCOMPtr<nsIThread> sScaleWorkerThread = nullptr;
 
 #ifndef DEBUG
-NS_IMPL_THREADSAFE_ISUPPORTS2(RasterImage, imgIContainer, nsIProperties)
+NS_IMPL_ISUPPORTS2(RasterImage, imgIContainer, nsIProperties)
 #else
-NS_IMPL_THREADSAFE_ISUPPORTS3(RasterImage, imgIContainer, nsIProperties,
+NS_IMPL_ISUPPORTS3(RasterImage, imgIContainer, nsIProperties,
                               imgIContainerDebug)
 #endif
 
 //******************************************************************************
 RasterImage::RasterImage(imgStatusTracker* aStatusTracker,
                          nsIURI* aURI /* = nullptr */) :
   ImageResource(aStatusTracker, aURI), // invoke superclass's constructor
   mSize(0,0),
@@ -2982,17 +2982,17 @@ RasterImage::FinishedSomeDecoding(eShutd
       }
     }
 
   }
 
   return rv;
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(RasterImage::DecodePool,
+NS_IMPL_ISUPPORTS1(RasterImage::DecodePool,
                               nsIObserver)
 
 /* static */ RasterImage::DecodePool*
 RasterImage::DecodePool::Singleton()
 {
   if (!sSingleton) {
     MOZ_ASSERT(NS_IsMainThread());
     sSingleton = new DecodePool();
--- a/image/src/RasterImage.h
+++ b/image/src/RasterImage.h
@@ -138,17 +138,17 @@ class FrameAnimator;
 class RasterImage : public ImageResource
                   , public nsIProperties
                   , public SupportsWeakPtr<RasterImage>
 #ifdef DEBUG
                   , public imgIContainerDebug
 #endif
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIPROPERTIES
   NS_DECL_IMGICONTAINER
 #ifdef DEBUG
   NS_DECL_IMGICONTAINERDEBUG
 #endif
 
   // (no public constructor - use ImageFactory)
   virtual ~RasterImage();
@@ -379,17 +379,17 @@ private:
    *
    * When the DecodePool is run from the event queue, it decodes the image (and
    * all others it's managing) in chunks, periodically yielding control back to
    * the event loop.
    */
   class DecodePool : public nsIObserver
   {
   public:
-    NS_DECL_ISUPPORTS
+    NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIOBSERVER
 
     static DecodePool* Singleton();
 
     /**
      * Ask the DecodePool to asynchronously decode this image.
      */
     void RequestDecode(RasterImage* aImg);