--- a/image/decoders/icon/android/nsIconChannel.h
+++ b/image/decoders/icon/android/nsIconChannel.h
@@ -34,27 +34,29 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsIconChannel_h_
#define nsIconChannel_h_
+#include "mozilla/Attributes.h"
+
#include "nsIChannel.h"
#include "nsIURI.h"
#include "nsIIconURI.h"
#include "nsCOMPtr.h"
/**
* This class is the Android implementation of nsIconChannel.
* It asks Android for an icon, and creates a new channel for
* that file to which all calls will be proxied.
*/
-class nsIconChannel : public nsIChannel {
+class nsIconChannel MOZ_FINAL : public nsIChannel {
public:
NS_DECL_ISUPPORTS
NS_FORWARD_NSIREQUEST(mRealChannel->)
NS_FORWARD_NSICHANNEL(mRealChannel->)
nsIconChannel() {}
~nsIconChannel() {}
--- a/image/decoders/icon/gtk/nsIconChannel.cpp
+++ b/image/decoders/icon/gtk/nsIconChannel.cpp
@@ -278,16 +278,17 @@ moz_gtk_icon_size(const char *name)
return GTK_ICON_SIZE_DND;
if (strcmp(name, "dialog") == 0)
return GTK_ICON_SIZE_DIALOG;
return GTK_ICON_SIZE_MENU;
}
+#if defined(MOZ_ENABLE_GNOMEUI) || defined(MOZ_ENABLE_GIO)
static PRInt32
GetIconSize(nsIMozIconURI *aIconURI)
{
nsCAutoString iconSizeString;
aIconURI->GetIconSize(iconSizeString);
if (iconSizeString.IsEmpty()) {
PRUint32 size;
@@ -315,16 +316,17 @@ ScaleIconBuf(GdkPixbuf **aBuf, PRInt32 i
// replace original buffer by scaled
g_object_unref(*aBuf);
*aBuf = scaled;
if (!scaled)
return NS_ERROR_OUT_OF_MEMORY;
}
return NS_OK;
}
+#endif
#ifdef MOZ_ENABLE_GNOMEUI
nsresult
nsIconChannel::InitWithGnome(nsIMozIconURI *aIconURI)
{
nsresult rv;
if (NS_FAILED(ensure_libgnomeui()) || NS_FAILED(ensure_libgnome()) || NS_FAILED(ensure_libgnomevfs())) {
--- a/image/decoders/icon/gtk/nsIconChannel.h
+++ b/image/decoders/icon/gtk/nsIconChannel.h
@@ -32,28 +32,30 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsIconChannel_h_
#define nsIconChannel_h_
+#include "mozilla/Attributes.h"
+
#include "nsIChannel.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"
#include "nsIIconURI.h"
#include "nsCOMPtr.h"
/**
* This class is the gnome implementation of nsIconChannel. It basically asks
* gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for
* that file to which all calls will be proxied.
*/
-class nsIconChannel : public nsIChannel {
+class nsIconChannel MOZ_FINAL : public nsIChannel {
public:
NS_DECL_ISUPPORTS
NS_FORWARD_NSIREQUEST(mRealChannel->)
NS_FORWARD_NSICHANNEL(mRealChannel->)
nsIconChannel() {}
~nsIconChannel() {}
--- a/image/decoders/icon/mac/nsIconChannel.h
+++ b/image/decoders/icon/mac/nsIconChannel.h
@@ -36,29 +36,31 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsIconChannel_h___
#define nsIconChannel_h___
+#include "mozilla/Attributes.h"
+
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsIChannel.h"
#include "nsILoadGroup.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIInputStreamPump.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"
class nsIFile;
-class nsIconChannel : public nsIChannel, public nsIStreamListener
+class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUEST
NS_DECL_NSICHANNEL
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
--- a/image/decoders/icon/os2/nsIconChannel.h
+++ b/image/decoders/icon/os2/nsIconChannel.h
@@ -36,29 +36,31 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsIconChannel_h___
#define nsIconChannel_h___
+#include "mozilla/Attributes.h"
+
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsIChannel.h"
#include "nsILoadGroup.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIURI.h"
#include "nsIInputStreamPump.h"
#include "nsIStreamListener.h"
class nsIFile;
-class nsIconChannel : public nsIChannel, public nsIStreamListener
+class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUEST
NS_DECL_NSICHANNEL
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
--- a/image/decoders/icon/qt/nsIconChannel.h
+++ b/image/decoders/icon/qt/nsIconChannel.h
@@ -33,28 +33,30 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsIconChannel_h_
#define nsIconChannel_h_
+#include "mozilla/Attributes.h"
+
#include "nsIChannel.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"
#include "nsIIconURI.h"
#include "nsCOMPtr.h"
/**
* This class is the gnome implementation of nsIconChannel. It basically asks
* qt for an icon, and creates a new channel for
* that file to which all calls will be proxied.
*/
-class nsIconChannel : public nsIChannel {
+class nsIconChannel MOZ_FINAL : public nsIChannel {
public:
NS_DECL_ISUPPORTS
NS_FORWARD_NSIREQUEST(mRealChannel->)
NS_FORWARD_NSICHANNEL(mRealChannel->)
nsIconChannel() {}
~nsIconChannel() {}
--- a/image/decoders/icon/win/nsIconChannel.h
+++ b/image/decoders/icon/win/nsIconChannel.h
@@ -35,32 +35,34 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsIconChannel_h___
#define nsIconChannel_h___
+#include "mozilla/Attributes.h"
+
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsIChannel.h"
#include "nsILoadGroup.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIURI.h"
#include "nsIInputStreamPump.h"
#include "nsIStreamListener.h"
#include "nsIIconURI.h"
#include <windows.h>
class nsIFile;
-class nsIconChannel : public nsIChannel, public nsIStreamListener
+class nsIconChannel MOZ_FINAL : public nsIChannel, public nsIStreamListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUEST
NS_DECL_NSICHANNEL
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
--- a/image/encoders/bmp/nsBMPEncoder.h
+++ b/image/encoders/bmp/nsBMPEncoder.h
@@ -30,35 +30,36 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
+#include "mozilla/Attributes.h"
+#include "mozilla/ReentrantMonitor.h"
+
#include "imgIEncoder.h"
#include "BMPFileHeaders.h"
-#include "mozilla/ReentrantMonitor.h"
-
#include "nsCOMPtr.h"
#define NS_BMPENCODER_CID \
{ /* 13a5320c-4c91-4FA4-bd16-b081a3ba8c0b */ \
0x13a5320c, \
0x4c91, \
0x4fa4, \
{0xbd, 0x16, 0xb0, 0x81, 0xa3, 0Xba, 0x8c, 0x0b} \
}
// Provides BMP encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options.
-class nsBMPEncoder : public imgIEncoder
+class nsBMPEncoder MOZ_FINAL : public imgIEncoder
{
typedef mozilla::ReentrantMonitor ReentrantMonitor;
public:
NS_DECL_ISUPPORTS
NS_DECL_IMGIENCODER
NS_DECL_NSIINPUTSTREAM
NS_DECL_NSIASYNCINPUTSTREAM
--- a/image/encoders/ico/nsICOEncoder.cpp
+++ b/image/encoders/ico/nsICOEncoder.cpp
@@ -45,25 +45,23 @@
#include "nsString.h"
#include "nsStreamUtils.h"
using namespace mozilla;
using namespace mozilla::imagelib;
NS_IMPL_THREADSAFE_ISUPPORTS3(nsICOEncoder, imgIEncoder, nsIInputStream, nsIAsyncInputStream)
-nsICOEncoder::nsICOEncoder() : mFinished(false),
- mImageBufferStart(nsnull),
+nsICOEncoder::nsICOEncoder() : mImageBufferStart(nsnull),
mImageBufferCurr(0),
mImageBufferSize(0),
mImageBufferReadPoint(0),
- mCallback(nsnull),
- mCallbackTarget(nsnull),
- mNotifyThreshold(0),
- mUsePNG(true)
+ mFinished(false),
+ mUsePNG(true),
+ mNotifyThreshold(0)
{
}
nsICOEncoder::~nsICOEncoder()
{
if (mImageBufferStart) {
moz_free(mImageBufferStart);
mImageBufferStart = nsnull;
--- a/image/encoders/ico/nsICOEncoder.h
+++ b/image/encoders/ico/nsICOEncoder.h
@@ -30,19 +30,20 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-#include "imgIEncoder.h"
+#include "mozilla/Attributes.h"
+#include "mozilla/ReentrantMonitor.h"
-#include "mozilla/ReentrantMonitor.h"
+#include "imgIEncoder.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "ICOFileHeaders.h"
class nsBMPEncoder;
class nsPNGEncoder;
@@ -52,17 +53,17 @@ class nsPNGEncoder;
0x8968, \
0x41b1, \
{0x87, 0x09, 0xb6, 0x12, 0x3b, 0Xce, 0xaf, 0x21} \
}
// Provides ICO encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options.
-class nsICOEncoder : public imgIEncoder
+class nsICOEncoder MOZ_FINAL : public imgIEncoder
{
typedef mozilla::ReentrantMonitor ReentrantMonitor;
public:
NS_DECL_ISUPPORTS
NS_DECL_IMGIENCODER
NS_DECL_NSIINPUTSTREAM
NS_DECL_NSIASYNCINPUTSTREAM
--- a/image/encoders/png/nsPNGEncoder.h
+++ b/image/encoders/png/nsPNGEncoder.h
@@ -30,36 +30,37 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-#include "imgIEncoder.h"
+#include "mozilla/Attributes.h"
+#include "mozilla/ReentrantMonitor.h"
-#include "mozilla/ReentrantMonitor.h"
+#include "imgIEncoder.h"
#include "nsCOMPtr.h"
#include <png.h>
#define NS_PNGENCODER_CID \
{ /* 38d1592e-b81e-432b-86f8-471878bbfe07 */ \
0x38d1592e, \
0xb81e, \
0x432b, \
{0x86, 0xf8, 0x47, 0x18, 0x78, 0xbb, 0xfe, 0x07} \
}
// Provides PNG encoding functionality. Use InitFromData() to do the
// encoding. See that function definition for encoding options.
-class nsPNGEncoder : public imgIEncoder
+class nsPNGEncoder MOZ_FINAL : public imgIEncoder
{
typedef mozilla::ReentrantMonitor ReentrantMonitor;
public:
NS_DECL_ISUPPORTS
NS_DECL_IMGIENCODER
NS_DECL_NSIINPUTSTREAM
NS_DECL_NSIASYNCINPUTSTREAM
--- a/image/src/BMPFileHeaders.h
+++ b/image/src/BMPFileHeaders.h
@@ -133,9 +133,9 @@ enum ERLEState {
eRLEStateInitial,
eRLEStateNeedSecondEscapeByte,
eRLEStateNeedXDelta,
eRLEStateNeedYDelta, ///< mStateData will hold x delta
eRLEStateAbsoluteMode, ///< mStateData will hold count of existing data to read
eRLEStateAbsoluteModePadded ///< As above, but another byte of data has to be read as padding
};
-#endif
\ No newline at end of file
+#endif
--- a/image/src/Decoder.cpp
+++ b/image/src/Decoder.cpp
@@ -43,23 +43,23 @@
namespace mozilla {
namespace imagelib {
Decoder::Decoder(RasterImage &aImage, imgIDecoderObserver* aObserver)
: mImage(aImage)
, mObserver(aObserver)
, mDecodeFlags(0)
+ , mDecodeDone(false)
+ , mDataError(false)
, mFrameCount(0)
, mFailCode(NS_OK)
, mInitialized(false)
, mSizeDecode(false)
, mInFrame(false)
- , mDecodeDone(false)
- , mDataError(false)
, mIsAnimated(false)
{
}
Decoder::~Decoder()
{
NS_WARN_IF_FALSE(!mInFrame, "Shutting down decoder mid-frame!");
mInitialized = false;
--- a/image/src/SVGDocumentWrapper.h
+++ b/image/src/SVGDocumentWrapper.h
@@ -36,16 +36,18 @@
*
* ***** END LICENSE BLOCK ***** */
/* This class wraps an SVG document, for use by VectorImage objects. */
#ifndef mozilla_imagelib_SVGDocumentWrapper_h_
#define mozilla_imagelib_SVGDocumentWrapper_h_
+#include "mozilla/Attributes.h"
+
#include "nsCOMPtr.h"
#include "nsIStreamListener.h"
#include "nsIObserver.h"
#include "nsIContentViewer.h"
#include "nsWeakReference.h"
class nsIAtom;
class nsIPresShell;
@@ -57,19 +59,19 @@ class nsSVGSVGElement;
#define SVG_MIMETYPE "image/svg+xml"
#define OBSERVER_SVC_CID "@mozilla.org/observer-service;1"
namespace mozilla {
namespace imagelib {
-class SVGDocumentWrapper : public nsIStreamListener,
- public nsIObserver,
- nsSupportsWeakReference
+class SVGDocumentWrapper MOZ_FINAL : public nsIStreamListener,
+ public nsIObserver,
+ nsSupportsWeakReference
{
public:
SVGDocumentWrapper();
~SVGDocumentWrapper();
NS_DECL_ISUPPORTS
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIREQUESTOBSERVER
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -32,16 +32,20 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
+#include "mozilla/Attributes.h"
+#include "mozilla/FunctionTimer.h"
+#include "mozilla/Preferences.h"
+
#include "ImageLogging.h"
#include "imgLoader.h"
#include "imgRequestProxy.h"
#include "RasterImage.h"
/* We end up pulling in windows.h because we eventually hit gfxWindowsSurface;
* windows.h defines LoadImage, so we have to #undef it or imgLoader::LoadImage
* gets changed.
@@ -84,19 +88,16 @@
// we want to explore making the document own the load group
// so we can associate the document URI with the load group.
// until this point, we have an evil hack:
#include "nsIHttpChannelInternal.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIChannelPolicy.h"
-#include "mozilla/FunctionTimer.h"
-#include "mozilla/Preferences.h"
-
#include "nsContentUtils.h"
using namespace mozilla;
using namespace mozilla::imagelib;
#if defined(DEBUG_pavlov) || defined(DEBUG_timeless)
#include "nsISimpleEnumerator.h"
#include "nsXPCOM.h"
@@ -131,17 +132,17 @@ static void PrintImageDecoders()
printf("Have decoder for mime type: %s\n", xcs.get()+decoderContract.Length());
}
}
}
}
#endif
-class imgMemoryReporter :
+class imgMemoryReporter MOZ_FINAL :
public nsIMemoryReporter
{
public:
enum ReporterType {
CHROME_BIT = PR_BIT(0),
USED_BIT = PR_BIT(1),
RAW_BIT = PR_BIT(2),
HEAP_BIT = PR_BIT(3),
@@ -754,17 +755,17 @@ nsresult imgLoader::CreateNewProxyForReq
}
// transfer reference to caller
*_retval = static_cast<imgIRequest*>(proxyRequest);
return NS_OK;
}
-class imgCacheObserver : public nsIObserver
+class imgCacheObserver MOZ_FINAL : public nsIObserver
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
private:
imgLoader mLoader;
};
@@ -778,17 +779,18 @@ imgCacheObserver::Observe(nsISupports* a
mLoader.MinimizeCaches();
} else if (strcmp(aTopic, "chrome-flush-skin-caches") == 0 ||
strcmp(aTopic, "chrome-flush-caches") == 0) {
mLoader.ClearChromeImageCache();
}
return NS_OK;
}
-class imgCacheExpirationTracker : public nsExpirationTracker<imgCacheEntry, 3>
+class imgCacheExpirationTracker MOZ_FINAL
+ : public nsExpirationTracker<imgCacheEntry, 3>
{
enum { TIMEOUT_SECONDS = 10 };
public:
imgCacheExpirationTracker();
protected:
void NotifyExpired(imgCacheEntry *entry);
};
--- a/image/src/imgLoader.h
+++ b/image/src/imgLoader.h
@@ -36,16 +36,18 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef imgLoader_h__
#define imgLoader_h__
+#include "mozilla/Attributes.h"
+
#include "imgILoader.h"
#include "imgICache.h"
#include "nsWeakReference.h"
#include "nsIContentSniffer.h"
#include "nsRefPtrHashtable.h"
#include "nsExpirationTracker.h"
#include "nsAutoPtr.h"
#include "prtypes.h"
@@ -387,19 +389,20 @@ private:
};
/**
* A class that implements nsIProgressEventSink and forwards all calls to it to
* the original notification callbacks of the channel. Also implements
* nsIInterfaceRequestor and gives out itself for nsIProgressEventSink calls,
* and forwards everything else to the channel's notification callbacks.
*/
-class nsProgressNotificationProxy : public nsIProgressEventSink
- , public nsIChannelEventSink
- , public nsIInterfaceRequestor
+class nsProgressNotificationProxy MOZ_FINAL
+ : public nsIProgressEventSink
+ , public nsIChannelEventSink
+ , public nsIInterfaceRequestor
{
public:
nsProgressNotificationProxy(nsIChannel* channel,
imgIRequest* proxy)
: mImageRequest(proxy) {
channel->GetNotificationCallbacks(getter_AddRefs(mOriginalCallbacks));
}
--- a/xpcom/ds/nsExpirationTracker.h
+++ b/xpcom/ds/nsExpirationTracker.h
@@ -34,16 +34,18 @@
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef NSEXPIRATIONTRACKER_H_
#define NSEXPIRATIONTRACKER_H_
+#include "mozilla/Attributes.h"
+
#include "prlog.h"
#include "nsTArray.h"
#include "nsITimer.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsComponentManagerUtils.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"