Bug 816374 - Don't export RasterImage from imagelib. r=joe
authorSeth Fowler <seth@mozilla.com>
Mon, 17 Dec 2012 18:35:46 -0800
changeset 125479 c243e7f3512daf8862c318cd3dabafe5279dfd68
parent 125478 d433d1a9fd78fa6a78931cd82595294d75be2d25
child 125480 0ef2edc84da0e4ab9eed4c4cb83ba5d7b2ace3ba
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs816374
milestone20.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 816374 - Don't export RasterImage from imagelib. r=joe
image/build/nsImageModule.cpp
image/src/RasterImage.h
--- a/image/build/nsImageModule.cpp
+++ b/image/build/nsImageModule.cpp
@@ -23,57 +23,49 @@
 #include "DiscardTracker.h"
 
 #include "nsICOEncoder.h"
 #include "nsPNGEncoder.h"
 #include "nsJPEGEncoder.h"
 #include "nsBMPEncoder.h"
 
 // objects that just require generic constructors
-namespace mozilla {
-namespace image {
-NS_GENERIC_FACTORY_CONSTRUCTOR(RasterImage)
-}
-}
 using namespace mozilla::image;
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(imgLoader, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(imgRequestProxy)
 NS_GENERIC_FACTORY_CONSTRUCTOR(imgTools)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsICOEncoder)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsJPEGEncoder)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPNGEncoder)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBMPEncoder)
 NS_DEFINE_NAMED_CID(NS_IMGLOADER_CID);
 NS_DEFINE_NAMED_CID(NS_IMGREQUESTPROXY_CID);
 NS_DEFINE_NAMED_CID(NS_IMGTOOLS_CID);
-NS_DEFINE_NAMED_CID(NS_RASTERIMAGE_CID);
 NS_DEFINE_NAMED_CID(NS_ICOENCODER_CID);
 NS_DEFINE_NAMED_CID(NS_JPEGENCODER_CID);
 NS_DEFINE_NAMED_CID(NS_PNGENCODER_CID);
 NS_DEFINE_NAMED_CID(NS_BMPENCODER_CID);
 
 static const mozilla::Module::CIDEntry kImageCIDs[] = {
   { &kNS_IMGLOADER_CID, false, NULL, imgLoaderConstructor, },
   { &kNS_IMGREQUESTPROXY_CID, false, NULL, imgRequestProxyConstructor, },
   { &kNS_IMGTOOLS_CID, false, NULL, imgToolsConstructor, },
-  { &kNS_RASTERIMAGE_CID, false, NULL, RasterImageConstructor, },
   { &kNS_ICOENCODER_CID, false, NULL, nsICOEncoderConstructor, },
   { &kNS_JPEGENCODER_CID, false, NULL, nsJPEGEncoderConstructor, },
   { &kNS_PNGENCODER_CID, false, NULL, nsPNGEncoderConstructor, },
   { &kNS_BMPENCODER_CID, false, NULL, nsBMPEncoderConstructor, },
   { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kImageContracts[] = {
   { "@mozilla.org/image/cache;1", &kNS_IMGLOADER_CID },
   { "@mozilla.org/image/loader;1", &kNS_IMGLOADER_CID },
   { "@mozilla.org/image/request;1", &kNS_IMGREQUESTPROXY_CID },
   { "@mozilla.org/image/tools;1", &kNS_IMGTOOLS_CID },
-  { "@mozilla.org/image/rasterimage;1", &kNS_RASTERIMAGE_CID },
   { "@mozilla.org/image/encoder;2?type=image/vnd.microsoft.icon", &kNS_ICOENCODER_CID },
   { "@mozilla.org/image/encoder;2?type=image/jpeg", &kNS_JPEGENCODER_CID },
   { "@mozilla.org/image/encoder;2?type=image/png", &kNS_PNGENCODER_CID },
   { "@mozilla.org/image/encoder;2?type=image/bmp", &kNS_BMPENCODER_CID },
   { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kImageCategories[] = {
--- a/image/src/RasterImage.h
+++ b/image/src/RasterImage.h
@@ -148,20 +148,17 @@ class RasterImage : public Image
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPROPERTIES
   NS_DECL_IMGICONTAINER
 #ifdef DEBUG
   NS_DECL_IMGICONTAINERDEBUG
 #endif
 
-  // XXX(seth) Currently the constructor is required to be public because it's
-  // exposed as part of the image module and imgTools needs it. New code should
-  // create images using ImageFactory.
-  RasterImage(imgStatusTracker* aStatusTracker = nullptr);
+  // (no public constructor - use ImageFactory)
   virtual ~RasterImage();
 
   virtual nsresult StartAnimation();
   virtual nsresult StopAnimation();
 
   // Methods inherited from Image
   nsresult Init(imgIDecoderObserver* aObserver,
                 const char* aMimeType,
@@ -731,16 +728,18 @@ private: // data
   // Helpers
   void DoError();
   bool CanDiscard();
   bool CanForciblyDiscard();
   bool DiscardingActive();
   bool StoringSourceData() const;
 
 protected:
+  RasterImage(imgStatusTracker* aStatusTracker = nullptr);
+
   bool ShouldAnimate();
 
   friend class ImageFactory;
 };
 
 inline NS_IMETHODIMP RasterImage::GetAnimationMode(uint16_t *aAnimationMode) {
   return GetAnimationModeInternal(aAnimationMode);
 }