Bug 1156632 - Remove unused forward class declarations - patch 6 - the rest of the tree, r=ehsan
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 22 Apr 2015 08:29:24 +0200
changeset 259375 9e1d3ea762968d090fd4c945de5e3838c1bd3ec9
parent 259374 d47f66ce3822cd4b95c99b3c0b123584486d119c
child 259376 1f79844c376f994585b43edb1b739a553f2b1fbf
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1156632
milestone40.0a1
Bug 1156632 - Remove unused forward class declarations - patch 6 - the rest of the tree, r=ehsan
docshell/base/IHistory.h
docshell/base/LoadContext.h
docshell/base/nsDocShell.h
docshell/base/nsILinkHandler.h
gfx/2d/2D.h
gfx/2d/DrawTargetD2D1.h
gfx/2d/PathCairo.h
gfx/2d/QuartzSupport.h
gfx/2d/ScaledFontBase.h
gfx/2d/SourceSurfaceSkia.h
gfx/gl/AndroidSurfaceTexture.h
gfx/gl/GLContext.h
gfx/gl/TextureImageCGL.h
gfx/layers/Compositor.h
gfx/layers/CopyableCanvasLayer.h
gfx/layers/ImageContainer.h
gfx/layers/LayerTreeInvalidation.h
gfx/layers/Layers.h
gfx/layers/LayersTypes.h
gfx/layers/apz/src/APZCTreeManager.h
gfx/layers/apz/src/InputQueue.h
gfx/layers/apz/util/ActiveElementManager.h
gfx/layers/apz/util/ChromeProcessController.h
gfx/layers/basic/BasicCanvasLayer.h
gfx/layers/basic/BasicCompositor.h
gfx/layers/basic/BasicImplData.h
gfx/layers/basic/BasicLayers.h
gfx/layers/basic/BasicLayersImpl.h
gfx/layers/client/ClientPaintedLayer.h
gfx/layers/client/ClientTiledPaintedLayer.h
gfx/layers/client/CompositableClient.h
gfx/layers/client/ContentClient.h
gfx/layers/client/TextureClient.h
gfx/layers/client/TiledContentClient.h
gfx/layers/composite/CompositableHost.h
gfx/layers/composite/ContentHost.h
gfx/layers/composite/FPSCounter.h
gfx/layers/composite/ImageHost.h
gfx/layers/composite/LayerManagerComposite.h
gfx/layers/composite/TextureHost.h
gfx/layers/composite/TiledContentHost.h
gfx/layers/d3d11/TextureD3D11.h
gfx/layers/d3d9/DeviceManagerD3D9.h
gfx/layers/ipc/CompositableForwarder.h
gfx/layers/ipc/CompositableTransactionParent.h
gfx/layers/ipc/CompositorChild.h
gfx/layers/ipc/CompositorParent.h
gfx/layers/ipc/ISurfaceAllocator.h
gfx/layers/ipc/ImageBridgeChild.h
gfx/layers/ipc/ShadowLayerParent.h
gfx/layers/ipc/ShadowLayerUtilsGralloc.h
gfx/layers/ipc/ShadowLayers.h
gfx/layers/ipc/SharedPlanarYCbCrImage.h
gfx/layers/ipc/SharedRGBImage.h
gfx/layers/opengl/Composer2D.h
gfx/layers/opengl/CompositorOGL.h
gfx/layers/opengl/TextureClientOGL.h
gfx/layers/opengl/TextureHostOGL.h
gfx/src/FilterSupport.h
gfx/src/nsColor.h
gfx/src/nsITheme.h
gfx/thebes/gfx2DGlue.h
gfx/thebes/gfxAndroidPlatform.h
gfx/thebes/gfxBlur.h
gfx/thebes/gfxDrawable.h
gfx/thebes/gfxPattern.h
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxQtNativeRenderer.h
gfx/thebes/gfxWindowsPlatform.h
storage/src/StorageBaseStatementInternal.h
storage/src/mozStorageAsyncStatement.h
storage/src/mozStorageAsyncStatementParams.h
storage/src/mozStorageConnection.h
storage/src/mozStoragePrivateHelpers.h
widget/PuppetWidget.h
widget/android/AndroidBridge.h
widget/android/AndroidJavaWrappers.h
widget/android/GfxInfo.h
widget/cocoa/nsAppShell.h
widget/cocoa/nsChildView.h
widget/cocoa/nsMenuBarX.h
widget/cocoa/nsMenuGroupOwnerX.h
widget/gonk/HwcComposer2D.h
widget/gonk/libdisplay/FramebufferSurface.h
widget/gonk/libdisplay/GonkDisplay.h
widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueProducer.h
widget/gonk/nsWindow.h
widget/gtk/nsPSPrinters.h
widget/gtk/nsWindow.h
widget/nsBaseClipboard.h
widget/nsBaseDragService.h
widget/nsIWidget.h
widget/nsPrintOptionsImpl.h
widget/nsTransferable.h
widget/qt/nsWindow.h
widget/windows/KeyboardLayout.h
widget/windows/nsClipboard.h
widget/windows/nsDataObjCollection.h
widget/windows/nsDragService.h
widget/windows/nsNativeDragTarget.h
widget/windows/nsTextStore.h
widget/windows/nsWindow.h
xpcom/base/nsMemoryInfoDumper.h
xpcom/build/Omnijar.h
xpcom/build/nsXPCOMPrivate.h
xpcom/components/ManifestParser.h
xpcom/ds/nsObserverList.h
xpcom/glue/nsCOMPtr.h
xpcom/reflect/xptinfo/ShimInterfaceInfo.h
xpcom/reflect/xptinfo/xptinfo.h
--- a/docshell/base/IHistory.h
+++ b/docshell/base/IHistory.h
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_IHistory_h_
 #define mozilla_IHistory_h_
 
 #include "nsISupports.h"
 
 class nsIURI;
-class nsString;
 
 namespace mozilla {
 
 namespace dom {
 class Link;
 }
 
 // 0057c9d3-b98e-4933-bdc5-0275d06705e1
--- a/docshell/base/LoadContext.h
+++ b/docshell/base/LoadContext.h
@@ -9,18 +9,16 @@
 
 #include "SerializedLoadContext.h"
 #include "mozilla/Attributes.h"
 #include "nsIWeakReferenceUtils.h"
 #include "mozilla/dom/Element.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsILoadContext.h"
 
-class mozIApplication;
-
 namespace mozilla {
 
 /**
  * Class that provides nsILoadContext info in Parent process.  Typically copied
  * from Child via SerializedLoadContext.
  *
  * Note: this is not the "normal" or "original" nsILoadContext.  That is
  * typically provided by nsDocShell.  This is only used when the original
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -83,17 +83,16 @@ class nsIPrompt;
 class nsISHistory;
 class nsISecureBrowserUI;
 class nsIStringBundle;
 class nsISupportsArray;
 class nsIURIFixup;
 class nsIURILoader;
 class nsIWebBrowserFind;
 class nsIWidget;
-class ProfilerMarkerTracing;
 
 /* load commands were moved to nsIDocShell.h */
 /* load types were moved to nsDocShellLoadTypes.h */
 
 /* internally used ViewMode types */
 enum ViewMode
 {
   viewNormal = 0x0,
--- a/docshell/base/nsILinkHandler.h
+++ b/docshell/base/nsILinkHandler.h
@@ -8,17 +8,16 @@
 
 #include "nsISupports.h"
 #include "mozilla/EventForwards.h"
 
 class nsIContent;
 class nsIDocShell;
 class nsIInputStream;
 class nsIRequest;
-class nsString;
 
 // Interface ID for nsILinkHandler
 #define NS_ILINKHANDLER_IID \
   { 0xceb9aade, 0x43da, 0x4f1a, \
     { 0xac, 0x8a, 0xc7, 0x09, 0xfb, 0x22, 0x46, 0x64 } }
 
 /**
  * Interface used for handling clicks on links
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -39,17 +39,16 @@ typedef _cairo_scaled_font cairo_scaled_
 struct ID3D10Device1;
 struct ID3D10Texture2D;
 struct ID3D11Texture2D;
 struct ID3D11Device;
 struct ID2D1Device;
 struct IDWriteRenderingParams;
 
 class GrContext;
-struct GrGLInterface;
 
 struct CGContext;
 typedef struct CGContext *CGContextRef;
 
 namespace mozilla {
 
 namespace gfx {
 
--- a/gfx/2d/DrawTargetD2D1.h
+++ b/gfx/2d/DrawTargetD2D1.h
@@ -18,18 +18,16 @@
 #include <unordered_set>
 
 struct IDWriteFactory;
 
 namespace mozilla {
 namespace gfx {
 
 class SourceSurfaceD2D1;
-class GradientStopsD2D;
-class ScaledFontDWrite;
 
 const int32_t kLayerCacheSize1 = 5;
 
 class DrawTargetD2D1 : public DrawTarget
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetD2D1)
   DrawTargetD2D1();
--- a/gfx/2d/PathCairo.h
+++ b/gfx/2d/PathCairo.h
@@ -8,17 +8,16 @@
 
 #include "2D.h"
 #include "cairo.h"
 #include <vector>
 
 namespace mozilla {
 namespace gfx {
 
-class DrawTargetCairo;
 class PathCairo;
 
 class PathBuilderCairo : public PathBuilder
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilderCairo)
   explicit PathBuilderCairo(FillRule aFillRule);
 
--- a/gfx/2d/QuartzSupport.h
+++ b/gfx/2d/QuartzSupport.h
@@ -15,17 +15,16 @@
 #include "mozilla/RefPtr.h"
 #include "mozilla/gfx/MacIOSurface.h"
 #include "nsError.h"
 
 // Get the system color space.
 CGColorSpaceRef CreateSystemColorSpace();
 
 // Manages a CARenderer
-struct _CGLPBufferObject;
 struct _CGLContextObject;
 
 enum AllowOfflineRendererEnum { ALLOW_OFFLINE_RENDERER, DISALLOW_OFFLINE_RENDERER };
 
 class nsCARenderer : public mozilla::RefCounted<nsCARenderer> {
 public:
   MOZ_DECLARE_REFCOUNTED_TYPENAME(nsCARenderer)
   nsCARenderer() : mCARenderer(nullptr), mWrapperCALayer(nullptr), mFBOTexture(0),
--- a/gfx/2d/ScaledFontBase.h
+++ b/gfx/2d/ScaledFontBase.h
@@ -16,18 +16,16 @@
 #ifdef USE_SKIA
 #include "skia/SkPath.h"
 #include "skia/SkTypeface.h"
 #endif
 #ifdef USE_CAIRO_SCALED_FONT
 #include "cairo.h"
 #endif
 
-class gfxFont;
-
 namespace mozilla {
 namespace gfx {
 
 class ScaledFontBase : public ScaledFont
 {
 public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontBase)
   explicit ScaledFontBase(Float aSize);
--- a/gfx/2d/SourceSurfaceSkia.h
+++ b/gfx/2d/SourceSurfaceSkia.h
@@ -6,18 +6,16 @@
 #ifndef MOZILLA_GFX_SOURCESURFACESKIA_H_
 #define MOZILLA_GFX_SOURCESURFACESKIA_H_
 
 #include "2D.h"
 #include <vector>
 #include "skia/SkCanvas.h"
 #include "skia/SkBitmap.h"
 
-class GrContext;
-
 namespace mozilla {
 
 namespace gfx {
 
 class DrawTargetSkia;
 
 class SourceSurfaceSkia : public DataSourceSurface
 {
--- a/gfx/gl/AndroidSurfaceTexture.h
+++ b/gfx/gl/AndroidSurfaceTexture.h
@@ -13,18 +13,16 @@
 #include "gfxPlatform.h"
 #include "GLDefs.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/Monitor.h"
 
 #include "SurfaceTexture.h"
 #include "AndroidNativeWindow.h"
 
-class gfxASurface;
-
 namespace mozilla {
 namespace gfx {
 class Matrix4x4;
 }
 }
 
 namespace mozilla {
 namespace gl {
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -46,20 +46,16 @@
 #include "SurfaceTypes.h"
 #include "GLScreenBuffer.h"
 #include "GLContextSymbols.h"
 #include "base/platform_thread.h"       // for PlatformThreadId
 #include "mozilla/GenericRefCounted.h"
 #include "gfx2DGlue.h"
 #include "GeckoProfiler.h"
 
-class nsIntRegion;
-class nsIRunnable;
-class nsIThread;
-
 namespace android {
     class GraphicBuffer;
 }
 
 namespace mozilla {
     namespace gfx {
         class DataSourceSurface;
         class SourceSurface;
--- a/gfx/gl/TextureImageCGL.h
+++ b/gfx/gl/TextureImageCGL.h
@@ -6,18 +6,16 @@
 #ifndef TextureImageCGL_h_
 #define TextureImageCGL_h_
 
 #include "GLTextureImage.h"
 #include "GLContextTypes.h"
 #include "nsAutoPtr.h"
 #include "nsSize.h"
 
-class gfxASurface;
-
 namespace mozilla {
 namespace gl {
 
 class TextureImageCGL : public BasicTextureImage
 {
 public:
 
     TextureImageCGL(GLuint aTexture,
--- a/gfx/layers/Compositor.h
+++ b/gfx/layers/Compositor.h
@@ -115,17 +115,16 @@ class Matrix4x4;
 class DrawTarget;
 }
 
 namespace layers {
 
 struct Effect;
 struct EffectChain;
 class Image;
-class ISurfaceAllocator;
 class Layer;
 class TextureSource;
 class DataTextureSource;
 class CompositingRenderTarget;
 class PCompositorParent;
 class LayerManagerComposite;
 
 enum SurfaceInitMode
--- a/gfx/layers/CopyableCanvasLayer.h
+++ b/gfx/layers/CopyableCanvasLayer.h
@@ -16,19 +16,22 @@
 #include "mozilla/Preferences.h"        // for Preferences
 #include "mozilla/RefPtr.h"             // for RefPtr
 #include "mozilla/gfx/2D.h"             // for DrawTarget
 #include "mozilla/mozalloc.h"           // for operator delete, etc
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
 
 namespace mozilla {
-namespace layers {
 
-class CanvasClientWebGL;
+namespace gl {
+class SharedSurface;
+}
+
+namespace layers {
 
 /**
  * A shared CanvasLayer implementation that supports copying
  * its contents into a gfxASurface using UpdateSurface.
  */
 class CopyableCanvasLayer : public CanvasLayer
 {
 public:
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -90,26 +90,23 @@ struct ID3D10Texture2D;
 struct ID3D10Device;
 struct ID3D10ShaderResourceView;
 #endif
 
 typedef void* HANDLE;
 
 namespace mozilla {
 
-class CrossProcessMutex;
 
 namespace layers {
 
 class ImageClient;
 class SharedPlanarYCbCrImage;
 class TextureClient;
 class CompositableClient;
-class CompositableForwarder;
-class SurfaceDescriptor;
 class GrallocImage;
 
 struct ImageBackendData
 {
   virtual ~ImageBackendData() {}
 
 protected:
   ImageBackendData() {}
--- a/gfx/layers/LayerTreeInvalidation.h
+++ b/gfx/layers/LayerTreeInvalidation.h
@@ -5,18 +5,16 @@
 
 #ifndef GFX_LAYER_TREE_INVALIDATION_H
 #define GFX_LAYER_TREE_INVALIDATION_H
 
 #include "nsRegion.h"                   // for nsIntRegion
 #include "mozilla/UniquePtr.h"          // for UniquePtr
 #include "mozilla/gfx/Point.h"
 
-class nsPresContext;
-
 namespace mozilla {
 namespace layers {
 
 class Layer;
 class ContainerLayer;
 
 /**
  * Callback for ContainerLayer invalidations.
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -52,58 +52,52 @@ class gfxContext;
 
 extern uint8_t gLayerManagerLayerBuilder;
 
 namespace mozilla {
 
 class ComputedTimingFunction;
 class FrameLayerBuilder;
 class StyleAnimationValue;
-class WebGLContext;
 
 namespace gl {
 class GLContext;
-class SharedSurface;
 }
 
 namespace gfx {
 class DrawTarget;
 }
 
 namespace dom {
 class OverfillCallback;
 }
 
 namespace layers {
 
 class Animation;
 class AnimationData;
 class AsyncPanZoomController;
 class ClientLayerManager;
-class CommonLayerAttributes;
 class Layer;
 class LayerMetricsWrapper;
 class PaintedLayer;
 class ContainerLayer;
 class ImageLayer;
 class ColorLayer;
 class ImageContainer;
 class CanvasLayer;
 class ReadbackLayer;
 class ReadbackProcessor;
 class RefLayer;
 class LayerComposite;
 class ShadowableLayer;
 class ShadowLayerForwarder;
 class LayerManagerComposite;
 class SpecificLayerAttributes;
-class SurfaceDescriptor;
 class Compositor;
-struct TextureFactoryIdentifier;
-struct EffectMask;
 
 namespace layerscope {
 class LayersPacket;
 }
 
 #define MOZ_LAYER_DECL_NAME(n, e)                              \
   virtual const char* Name() const override { return n; }  \
   virtual LayerType GetType() const override { return e; }
--- a/gfx/layers/LayersTypes.h
+++ b/gfx/layers/LayersTypes.h
@@ -21,17 +21,16 @@
 #  ifndef MOZ_LAYERS_HAVE_LOG
 #    define MOZ_LAYERS_HAVE_LOG
 #  endif
 #  define MOZ_LAYERS_LOG(_args)                             \
   PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args)
 #  define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)         \
   do { if (layer->AsShadowableLayer()) { PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args); } } while (0)
 #else
-struct PRLogModuleInfo;
 #  define MOZ_LAYERS_LOG(_args)
 #  define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)
 #endif  // if defined(DEBUG) || defined(PR_LOGGING)
 
 #define INVALID_OVERLAY -1
 
 namespace android {
 class GraphicBuffer;
--- a/gfx/layers/apz/src/APZCTreeManager.h
+++ b/gfx/layers/apz/src/APZCTreeManager.h
@@ -36,17 +36,16 @@ enum AllowedTouchBehavior {
   PINCH_ZOOM =         1 << 2,
   DOUBLE_TAP_ZOOM =    1 << 3,
   UNKNOWN =            1 << 4
 };
 
 class Layer;
 class AsyncPanZoomController;
 class CompositorParent;
-class APZPaintLogHelper;
 class OverscrollHandoffChain;
 struct OverscrollHandoffState;
 class LayerMetricsWrapper;
 class InputQueue;
 class GeckoContentController;
 class HitTestingTreeNode;
 
 /**
--- a/gfx/layers/apz/src/InputQueue.h
+++ b/gfx/layers/apz/src/InputQueue.h
@@ -15,17 +15,16 @@ namespace mozilla {
 
 class InputData;
 class MultiTouchInput;
 class ScrollWheelInput;
 
 namespace layers {
 
 class AsyncPanZoomController;
-class OverscrollHandoffChain;
 class CancelableBlockState;
 class TouchBlockState;
 class WheelBlockState;
 
 /**
  * This class stores incoming input events, separated into "input blocks", until
  * they are ready for handling. Currently input blocks are only created from
  * touch input.
--- a/gfx/layers/apz/util/ActiveElementManager.h
+++ b/gfx/layers/apz/util/ActiveElementManager.h
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_layers_ActiveElementManager_h
 #define mozilla_layers_ActiveElementManager_h
 
 #include "nsCOMPtr.h"
 #include "nsISupportsImpl.h"
 
-class inIDOMUtils;
 class CancelableTask;
 
 namespace mozilla {
 namespace dom {
 class Element;
 class EventTarget;
 }
 
--- a/gfx/layers/apz/util/ChromeProcessController.h
+++ b/gfx/layers/apz/util/ChromeProcessController.h
@@ -17,17 +17,16 @@ class nsIWidget;
 
 class MessageLoop;
 
 namespace mozilla {
 
 namespace layers {
 
 class APZEventState;
-class CompositorParent;
 
 // A ChromeProcessController is attached to the root of a compositor's layer
 // tree.
 class ChromeProcessController : public mozilla::layers::GeckoContentController
 {
   typedef mozilla::layers::FrameMetrics FrameMetrics;
   typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
 
--- a/gfx/layers/basic/BasicCanvasLayer.h
+++ b/gfx/layers/basic/BasicCanvasLayer.h
@@ -8,18 +8,16 @@
 
 #include "BasicImplData.h"              // for BasicImplData
 #include "BasicLayers.h"                // for BasicLayerManager
 #include "CopyableCanvasLayer.h"        // for CopyableCanvasLayer
 #include "Layers.h"                     // for CanvasLayer, etc
 #include "nsDebug.h"                    // for NS_ASSERTION
 #include "nsRegion.h"                   // for nsIntRegion
 
-class gfxContext;
-
 namespace mozilla {
 namespace layers {
 
 class BasicCanvasLayer : public CopyableCanvasLayer,
                          public BasicImplData
 {
 public:
   explicit BasicCanvasLayer(BasicLayerManager* aLayerManager) :
--- a/gfx/layers/basic/BasicCompositor.h
+++ b/gfx/layers/basic/BasicCompositor.h
@@ -6,18 +6,16 @@
 #ifndef MOZILLA_GFX_BASICCOMPOSITOR_H
 #define MOZILLA_GFX_BASICCOMPOSITOR_H
 
 #include "mozilla/layers/Compositor.h"
 #include "mozilla/layers/TextureHost.h"
 #include "mozilla/gfx/2D.h"
 #include "nsAutoPtr.h"
 
-class gfxContext;
-
 namespace mozilla {
 namespace layers {
 
 class BasicCompositingRenderTarget : public CompositingRenderTarget
 {
 public:
   BasicCompositingRenderTarget(gfx::DrawTarget* aDrawTarget, const gfx::IntRect& aRect)
     : CompositingRenderTarget(aRect.TopLeft())
--- a/gfx/layers/basic/BasicImplData.h
+++ b/gfx/layers/basic/BasicImplData.h
@@ -10,17 +10,16 @@
 #include "nsDebug.h"                    // for NS_ASSERTION
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
 #include "mozilla/gfx/Types.h"
 
 namespace mozilla {
 namespace layers {
 
 class ReadbackProcessor;
-class SurfaceDescriptor;
 
 /**
  * This is the ImplData for all Basic layers. It also exposes methods
  * private to the Basic implementation that are common to all Basic layer types.
  * In particular, there is an internal Paint() method that we can use
  * to paint the contents of non-PaintedLayers.
  *
  * The class hierarchy for Basic layers is like this:
--- a/gfx/layers/basic/BasicLayers.h
+++ b/gfx/layers/basic/BasicLayers.h
@@ -15,28 +15,25 @@
 #include "mozilla/layers/LayersTypes.h"  // for BufferMode, LayersBackend, etc
 #include "nsAString.h"
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsISupportsImpl.h"            // for gfxContext::AddRef, etc
 #include "nsRegion.h"                   // for nsIntRegion
 #include "nscore.h"                     // for nsAString, etc
 
-class gfxPattern;
 class nsIWidget;
 
 namespace mozilla {
 namespace layers {
 
-class BasicShadowableLayer;
 class ImageFactory;
 class ImageLayer;
 class PaintLayerContext;
 class ReadbackLayer;
-class ReadbackProcessor;
 
 /**
  * This is a cairo/Thebes-only, main-thread-only implementation of layers.
  * 
  * In each transaction, the client sets up the layer tree and then during
  * the drawing phase, each PaintedLayer is painted directly into the target
  * context (with appropriate clipping and Push/PopGroups performed
  * between layers).
--- a/gfx/layers/basic/BasicLayersImpl.h
+++ b/gfx/layers/basic/BasicLayersImpl.h
@@ -20,17 +20,16 @@
 namespace mozilla {
 namespace gfx {
 class DrawTarget;
 }
 
 namespace layers {
 
 class AutoMoz2DMaskData;
-class BasicContainerLayer;
 class Layer;
 
 class AutoSetOperator {
 public:
   AutoSetOperator(gfxContext* aContext, gfxContext::GraphicsOperator aOperator) {
     if (aOperator != gfxContext::OPERATOR_OVER) {
       aContext->SetOperator(aOperator);
       mContext = aContext;
--- a/gfx/layers/client/ClientPaintedLayer.h
+++ b/gfx/layers/client/ClientPaintedLayer.h
@@ -13,18 +13,16 @@
 #include "mozilla/RefPtr.h"             // for RefPtr
 #include "mozilla/layers/ContentClient.h"  // for ContentClient
 #include "mozilla/mozalloc.h"           // for operator delete
 #include "nsDebug.h"                    // for NS_ASSERTION
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
 #include "nsRegion.h"                   // for nsIntRegion
 #include "mozilla/layers/PLayerTransaction.h" // for PaintedLayerAttributes
 
-class gfxContext;
-
 namespace mozilla {
 namespace layers {
 
 class CompositableClient;
 class ShadowableLayer;
 class SpecificLayerAttributes;
 
 class ClientPaintedLayer : public PaintedLayer,
--- a/gfx/layers/client/ClientTiledPaintedLayer.h
+++ b/gfx/layers/client/ClientTiledPaintedLayer.h
@@ -7,18 +7,16 @@
 
 #include "ClientLayerManager.h"         // for ClientLayer, etc
 #include "Layers.h"                     // for PaintedLayer, etc
 #include "mozilla/RefPtr.h"             // for RefPtr
 #include "mozilla/layers/TiledContentClient.h"
 #include "nsDebug.h"                    // for NS_RUNTIMEABORT
 #include "nsRegion.h"                   // for nsIntRegion
 
-class gfxContext;
-
 namespace mozilla {
 namespace layers {
 
 class ShadowableLayer;
 class SpecificLayerAttributes;
 
 /**
  * An implementation of PaintedLayer that ONLY supports remote
--- a/gfx/layers/client/CompositableClient.h
+++ b/gfx/layers/client/CompositableClient.h
@@ -22,17 +22,16 @@
 namespace mozilla {
 namespace layers {
 
 class CompositableClient;
 class BufferTextureClient;
 class ImageBridgeChild;
 class CompositableForwarder;
 class CompositableChild;
-class SurfaceDescriptor;
 class PCompositableChild;
 
 /**
  * Handle RemoveTextureFromCompositableAsync() transaction.
  */
 class RemoveTextureFromCompositableTracker : public AsyncTransactionTracker {
 public:
   RemoveTextureFromCompositableTracker()
--- a/gfx/layers/client/ContentClient.h
+++ b/gfx/layers/client/ContentClient.h
@@ -23,26 +23,23 @@
 #include "mozilla/mozalloc.h"           // for operator delete
 #include "ReadbackProcessor.h"          // For ReadbackProcessor::Update
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsPoint.h"                    // for nsIntPoint
 #include "nsRect.h"                     // for nsIntRect
 #include "nsRegion.h"                   // for nsIntRegion
 #include "nsTArray.h"                   // for nsTArray
 
-class gfxContext;
-
 namespace mozilla {
 namespace gfx {
 class DrawTarget;
 }
 
 namespace layers {
 
-class BasicLayerManager;
 class PaintedLayer;
 
 /**
  * A compositable client for PaintedLayers. These are different to Image/Canvas
  * clients due to sending a valid region across IPC and because we do a lot more
  * optimisation work, encapsualted in RotatedContentBuffers.
  *
  * We use content clients for OMTC and non-OMTC, basic rendering so that
--- a/gfx/layers/client/TextureClient.h
+++ b/gfx/layers/client/TextureClient.h
@@ -24,17 +24,16 @@
 #include "mozilla/layers/LayersTypes.h"
 #include "mozilla/layers/LayersSurfaces.h"  // for SurfaceDescriptor
 #include "mozilla/mozalloc.h"           // for operator delete
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsISupportsImpl.h"            // for TextureImage::AddRef, etc
 #include "GfxTexturesReporter.h"
 
-class gfxReusableSurfaceWrapper;
 class gfxImageSurface;
 
 namespace mozilla {
 namespace gl {
 class GLContext;
 class SharedSurface;
 }
 
@@ -42,21 +41,19 @@ class SharedSurface;
 // any inconsistencies.  This can be defined in release build as well.
 #ifdef DEBUG
 #define GFX_DEBUG_TRACK_CLIENTS_IN_POOL 1
 #endif
 
 namespace layers {
 
 class AsyncTransactionTracker;
-class ContentClient;
 class CompositableForwarder;
 class ISurfaceAllocator;
 class CompositableClient;
-class PlanarYCbCrImage;
 struct PlanarYCbCrData;
 class Image;
 class PTextureChild;
 class TextureChild;
 class BufferTextureClient;
 class TextureClient;
 #ifdef GFX_DEBUG_TRACK_CLIENTS_IN_POOL
 class TextureClientPool;
--- a/gfx/layers/client/TiledContentClient.h
+++ b/gfx/layers/client/TiledContentClient.h
@@ -36,17 +36,16 @@
 #include "mozilla/layers/ISurfaceAllocator.h"
 #include "gfxReusableSurfaceWrapper.h"
 #include "pratom.h"                     // For PR_ATOMIC_INCREMENT/DECREMENT
 #include "gfxPrefs.h"
 
 namespace mozilla {
 namespace layers {
 
-class BasicTileDescriptor;
 class ClientTiledPaintedLayer;
 class ClientLayerManager;
 
 
 // A class to help implement copy-on-write semantics for shared tiles.
 class gfxSharedReadLock {
 protected:
   virtual ~gfxSharedReadLock() {}
--- a/gfx/layers/composite/CompositableHost.h
+++ b/gfx/layers/composite/CompositableHost.h
@@ -32,19 +32,17 @@ namespace mozilla {
 namespace gfx {
 class Matrix4x4;
 class DataSourceSurface;
 }
 
 namespace layers {
 
 class Layer;
-class SurfaceDescriptor;
 class Compositor;
-class ISurfaceAllocator;
 class ThebesBufferData;
 class TiledLayerComposer;
 class CompositableParentManager;
 class PCompositableParent;
 struct EffectChain;
 
 /**
  * The compositor-side counterpart to CompositableClient. Responsible for
--- a/gfx/layers/composite/ContentHost.h
+++ b/gfx/layers/composite/ContentHost.h
@@ -37,17 +37,16 @@ namespace mozilla {
 namespace gfx {
 class Matrix4x4;
 }
 namespace layers {
 class Compositor;
 class ThebesBufferData;
 class TiledLayerComposer;
 struct EffectChain;
-class TextureImageTextureSourceOGL;
 
 struct TexturedEffect;
 
 /**
  * ContentHosts are used for compositing Painted layers, always matched by a
  * ContentClient of the same type.
  *
  * ContentHosts support only UpdateThebes(), not Update().
--- a/gfx/layers/composite/FPSCounter.h
+++ b/gfx/layers/composite/FPSCounter.h
@@ -11,23 +11,19 @@
 #include <map>                          // for std::map
 #include "GLDefs.h"                     // for GLuint
 #include "mozilla/RefPtr.h"             // for TemporaryRef, RefCounted
 #include "mozilla/TimeStamp.h"          // for TimeStamp, TimeDuration
 #include "nsTArray.h"                   // for nsAutoTArray, nsTArray_Impl, etc
 #include "prio.h"                       // for NSPR file i/o
 
 namespace mozilla {
-namespace gl {
-class GLContext;
-}
 namespace layers {
 
 class DataTextureSource;
-class ShaderProgramOGL;
 class Compositor;
 
 // Dump the FPS histogram every 10 seconds or kMaxFrameFPS
 const int kFpsDumpInterval = 10;
 
 // On desktop, we can have 240 hz monitors, so 10 seconds
 // times 240 frames = 2400
 const int kMaxFrames = 2400;
--- a/gfx/layers/composite/ImageHost.h
+++ b/gfx/layers/composite/ImageHost.h
@@ -26,17 +26,16 @@ class nsIntRegion;
 
 namespace mozilla {
 namespace gfx {
 class Matrix4x4;
 }
 namespace layers {
 
 class Compositor;
-class ISurfaceAllocator;
 struct EffectChain;
 
 /**
  * ImageHost. Works with ImageClientSingle and ImageClientBuffered
  */
 class ImageHost : public CompositableHost
 {
 public:
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -38,34 +38,28 @@ class gfxContext;
 #include <windows.h>
 #endif
 
 namespace mozilla {
 namespace gfx {
 class DrawTarget;
 }
 
-namespace gl {
-class GLContext;
-class TextureImage;
-}
-
 namespace layers {
 
 class CanvasLayerComposite;
 class ColorLayerComposite;
 class CompositableHost;
 class Compositor;
 class ContainerLayerComposite;
 struct EffectChain;
 class ImageLayer;
 class ImageLayerComposite;
 class LayerComposite;
 class RefLayerComposite;
-class SurfaceDescriptor;
 class PaintedLayerComposite;
 class TiledLayerComposer;
 class TextRenderer;
 class CompositingRenderTarget;
 struct FPSState;
 
 static const int kVisualWarningDuration = 150; // ms
 
--- a/gfx/layers/composite/TextureHost.h
+++ b/gfx/layers/composite/TextureHost.h
@@ -25,30 +25,27 @@
 #include "nsDebug.h"                    // for NS_RUNTIMEABORT
 #include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR, etc
 #include "nsRegion.h"                   // for nsIntRegion
 #include "nsTraceRefcnt.h"              // for MOZ_COUNT_CTOR, etc
 #include "nscore.h"                     // for nsACString
 #include "mozilla/layers/AtomicRefCountedWithFinalize.h"
 #include "mozilla/gfx/Rect.h"
 
-class gfxReusableSurfaceWrapper;
-
 namespace mozilla {
 namespace gl {
 class SharedSurface;
 }
 namespace ipc {
 class Shmem;
 }
 
 namespace layers {
 
 class Compositor;
-class CompositableHost;
 class CompositableParentManager;
 class SurfaceDescriptor;
 class SharedSurfaceDescriptor;
 class ISurfaceAllocator;
 class TextureHostOGL;
 class TextureSourceOGL;
 class TextureSourceD3D9;
 class TextureSourceD3D11;
--- a/gfx/layers/composite/TiledContentHost.h
+++ b/gfx/layers/composite/TiledContentHost.h
@@ -26,18 +26,16 @@
 #include "mozilla/mozalloc.h"           // for operator delete
 #include "nsRegion.h"                   // for nsIntRegion
 #include "nscore.h"                     // for nsACString
 
 #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
 #include <ui/Fence.h>
 #endif
 
-class gfxReusableSurfaceWrapper;
-
 namespace mozilla {
 namespace gfx {
 class Matrix4x4;
 }
 
 namespace layers {
 
 class Compositor;
--- a/gfx/layers/d3d11/TextureD3D11.h
+++ b/gfx/layers/d3d11/TextureD3D11.h
@@ -9,18 +9,16 @@
 #include "mozilla/layers/Compositor.h"
 #include "mozilla/layers/TextureClient.h"
 #include "mozilla/layers/TextureHost.h"
 #include "gfxWindowsPlatform.h"
 #include "mozilla/GfxMessageUtils.h"
 #include <d3d11.h>
 #include <vector>
 
-class gfxD2DSurface;
-
 namespace mozilla {
 namespace layers {
 
 class CompositorD3D11;
 
 /**
  * A TextureClient to share a D3D10 texture with the compositor thread.
  * The corresponding TextureHost is DXGITextureHostD3D11
--- a/gfx/layers/d3d9/DeviceManagerD3D9.h
+++ b/gfx/layers/d3d9/DeviceManagerD3D9.h
@@ -13,17 +13,16 @@
 #include "mozilla/layers/CompositorTypes.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/gfx/Rect.h"
 
 namespace mozilla {
 namespace layers {
 
 class DeviceManagerD3D9;
-class LayerD3D9;
 class Nv3DVUtils;
 class Layer;
 class TextureSourceD3D9;
 
 // Shader Constant locations
 const int CBmLayerTransform = 0;
 const int CBmProjection = 4;
 const int CBvRenderTargetOffset = 8;
--- a/gfx/layers/ipc/CompositableForwarder.h
+++ b/gfx/layers/ipc/CompositableForwarder.h
@@ -21,17 +21,16 @@ namespace mozilla {
 namespace layers {
 
 class CompositableClient;
 class AsyncTransactionTracker;
 struct TextureFactoryIdentifier;
 class SurfaceDescriptor;
 class SurfaceDescriptorTiles;
 class ThebesBufferData;
-class ClientTiledLayerBuffer;
 class PTextureChild;
 
 /**
  * A transaction is a set of changes that happenned on the content side, that
  * should be sent to the compositor side.
  * CompositableForwarder is an interface to manage a transaction of
  * compositable objetcs.
  *
--- a/gfx/layers/ipc/CompositableTransactionParent.h
+++ b/gfx/layers/ipc/CompositableTransactionParent.h
@@ -13,17 +13,16 @@
 #include "mozilla/layers/AsyncTransactionTracker.h" // for AsyncTransactionTracker
 #include "mozilla/layers/ISurfaceAllocator.h"  // for ISurfaceAllocator
 #include "mozilla/layers/LayersMessages.h"  // for EditReply, etc
 
 namespace mozilla {
 namespace layers {
 
 class CompositableHost;
-class PTextureChild;
 
 typedef std::vector<mozilla::layers::EditReply> EditReplyVector;
 
 // Since PCompositble has two potential manager protocols, we can't just call
 // the Manager() method usually generated when there's one manager protocol,
 // so both manager protocols implement this and we keep a reference to them
 // through this interface.
 class CompositableParentManager : public ISurfaceAllocator
--- a/gfx/layers/ipc/CompositorChild.h
+++ b/gfx/layers/ipc/CompositorChild.h
@@ -15,18 +15,16 @@
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsClassHashtable.h"           // for nsClassHashtable
 #include "nsCOMPtr.h"                   // for nsCOMPtr
 #include "nsHashKeys.h"                 // for nsUint64HashKey
 #include "nsISupportsImpl.h"            // for NS_INLINE_DECL_REFCOUNTING
 #include "ThreadSafeRefcountingWithMainThreadDestruction.h"
 #include "nsWeakReference.h"
 
-class nsIObserver;
-
 namespace mozilla {
 
 namespace dom {
   class TabChild;
 }
 
 namespace layers {
 
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -34,17 +34,16 @@
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsISupportsImpl.h"
 #include "nsSize.h"                     // for nsIntSize
 #include "ThreadSafeRefcountingWithMainThreadDestruction.h"
 #include "mozilla/VsyncDispatcher.h"
 
 class CancelableTask;
 class MessageLoop;
-class gfxContext;
 class nsIWidget;
 
 namespace mozilla {
 namespace gfx {
 class DrawTarget;
 }
 
 namespace layers {
--- a/gfx/layers/ipc/ISurfaceAllocator.h
+++ b/gfx/layers/ipc/ISurfaceAllocator.h
@@ -25,35 +25,27 @@
  * This #define is actually needed here, because subclasses of ISurfaceAllocator,
  * namely ShadowLayerForwarder, will or will not override AllocGrallocBuffer
  * depending on whether MOZ_HAVE_SURFACEDESCRIPTORGRALLOC is defined.
  */
 #ifdef MOZ_WIDGET_GONK
 #define MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
 #endif
 
-class gfxSharedImageSurface;
-
-namespace base {
-class Thread;
-}
-
 namespace mozilla {
 namespace ipc {
 class Shmem;
 }
 namespace gfx {
 class DataSourceSurface;
 }
 
 namespace layers {
 
 class MaybeMagicGrallocBufferHandle;
-class MemoryTextureClient;
-class MemoryTextureHost;
 
 enum BufferCapabilities {
   DEFAULT_BUFFER_CAPS = 0,
   /**
    * The allocated buffer must be efficiently mappable as a DataSourceSurface.
    */
   MAP_AS_IMAGE_SURFACE = 1 << 0,
   /**
--- a/gfx/layers/ipc/ImageBridgeChild.h
+++ b/gfx/layers/ipc/ImageBridgeChild.h
@@ -27,17 +27,16 @@ class Thread;
 
 namespace mozilla {
 namespace ipc {
 class Shmem;
 }
 
 namespace layers {
 
-class ClientTiledLayerBuffer;
 class AsyncTransactionTracker;
 class ImageClient;
 class ImageContainer;
 class ImageBridgeParent;
 class CompositableClient;
 struct CompositableTransaction;
 class Image;
 class TextureClient;
--- a/gfx/layers/ipc/ShadowLayerParent.h
+++ b/gfx/layers/ipc/ShadowLayerParent.h
@@ -13,17 +13,16 @@
 #include "mozilla/layers/PLayerParent.h"  // for PLayerParent
 #include "nsAutoPtr.h"                  // for nsRefPtr
 
 namespace mozilla {
 namespace layers {
 
 class ContainerLayer;
 class Layer;
-class LayerManager;
 
 class CanvasLayerComposite;
 class ColorLayerComposite;
 class ContainerLayerComposite;
 class ImageLayerComposite;
 class RefLayerComposite;
 class PaintedLayerComposite;
 
--- a/gfx/layers/ipc/ShadowLayerUtilsGralloc.h
+++ b/gfx/layers/ipc/ShadowLayerUtilsGralloc.h
@@ -17,17 +17,16 @@
 #define MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
 #define MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS
 
 namespace mozilla {
 namespace layers {
 
 class MaybeMagicGrallocBufferHandle;
 class SurfaceDescriptor;
-class TextureHost;
 
 struct GrallocBufferRef {
   base::ProcessId mOwner;
   int64_t mKey;
 
   GrallocBufferRef()
     : mOwner(0)
     , mKey(-1)
--- a/gfx/layers/ipc/ShadowLayers.h
+++ b/gfx/layers/ipc/ShadowLayers.h
@@ -21,43 +21,26 @@
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsRegion.h"                   // for nsIntRegion
 #include "nsTArrayForwardDeclare.h"     // for InfallibleTArray
 #include "nsIWidget.h"
 
 namespace mozilla {
 namespace layers {
 
-class ClientTiledLayerBuffer;
-class CanvasClient;
-class CanvasLayerComposite;
-class CanvasSurface;
-class ColorLayerComposite;
-class CompositableChild;
-class ContainerLayerComposite;
-class ContentClient;
-class ContentClientRemote;
 class EditReply;
-class ImageClient;
-class ImageLayerComposite;
 class Layer;
-class OptionalThebesBuffer;
 class PLayerChild;
 class PLayerTransactionChild;
-class PLayerTransactionParent;
 class LayerTransactionChild;
-class RefLayerComposite;
 class ShadowableLayer;
-class ShmemTextureClient;
 class SurfaceDescriptor;
 class TextureClient;
-class PaintedLayerComposite;
 class ThebesBuffer;
 class ThebesBufferData;
-class TiledLayerComposer;
 class Transaction;
 
 
 /**
  * We want to share layer trees across thread contexts and address
  * spaces for several reasons; chief among them
  *
  *  - a parent process can paint a child process's layer tree while
--- a/gfx/layers/ipc/SharedPlanarYCbCrImage.h
+++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.h
@@ -15,18 +15,16 @@
 #ifndef MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
 #define MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
 
 namespace mozilla {
 namespace layers {
 
 class BufferTextureClient;
 class ImageClient;
-class ISurfaceAllocator;
-class SurfaceDescriptor;
 class TextureClient;
 
 class SharedPlanarYCbCrImage : public PlanarYCbCrImage
 {
 public:
   explicit SharedPlanarYCbCrImage(ImageClient* aCompositable);
 
 protected:
--- a/gfx/layers/ipc/SharedRGBImage.h
+++ b/gfx/layers/ipc/SharedRGBImage.h
@@ -11,27 +11,21 @@
 #include "gfxTypes.h"
 #include "mozilla/Attributes.h"         // for override
 #include "mozilla/RefPtr.h"             // for RefPtr
 #include "mozilla/gfx/Point.h"          // for IntSize
 #include "mozilla/gfx/Types.h"          // for SurfaceFormat
 #include "nsCOMPtr.h"                   // for already_AddRefed
 
 namespace mozilla {
-namespace ipc {
-class Shmem;
-}
-
 namespace layers {
 
 class BufferTextureClient;
 class ImageClient;
-class ISurfaceAllocator;
 class TextureClient;
-class SurfaceDescriptor;
 
 already_AddRefed<Image> CreateSharedRGBImage(ImageContainer* aImageContainer,
                                              nsIntSize aSize,
                                              gfxImageFormat aImageFormat);
 
 /**
  * Stores RGB data in shared memory
  * It is assumed that the image width and stride are equal
--- a/gfx/layers/opengl/Composer2D.h
+++ b/gfx/layers/opengl/Composer2D.h
@@ -22,21 +22,16 @@
  * Composer2D is a very simple interface to this class of hardware
  * that allows an implementation to "try rendering" with the fast
  * path.  If the given layer tree requires more generality than the
  * hardware provides, the implementation should bail and have the
  * layer manager fall back on full GPU composition.
  */
 
 namespace mozilla {
-
-namespace gfx {
-class Matrix;
-}
-
 namespace layers {
 
 class Layer;
 
 class Composer2D {
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Composer2D)
 
 protected:
--- a/gfx/layers/opengl/CompositorOGL.h
+++ b/gfx/layers/opengl/CompositorOGL.h
@@ -35,17 +35,16 @@
 #ifdef MOZ_WIDGET_GONK
 #include <ui/GraphicBuffer.h>
 #endif
 #include "gfxVR.h"
 
 class nsIWidget;
 
 namespace mozilla {
-class TimeStamp;
 
 namespace gfx {
 class Matrix4x4;
 }
 
 namespace layers {
 
 class CompositingRenderTarget;
--- a/gfx/layers/opengl/TextureClientOGL.h
+++ b/gfx/layers/opengl/TextureClientOGL.h
@@ -15,18 +15,16 @@
 #include "mozilla/layers/LayersSurfaces.h"  // for SurfaceDescriptor
 #include "mozilla/layers/TextureClient.h"  // for TextureClient, etc
 #include "AndroidSurfaceTexture.h"
 
 namespace mozilla {
 
 namespace layers {
 
-class CompositableForwarder;
-
 class EGLImageTextureClient : public TextureClient
 {
 public:
   EGLImageTextureClient(ISurfaceAllocator* aAllocator,
                         TextureFlags aFlags,
                         EGLImageImage* aImage,
                         gfx::IntSize aSize);
 
--- a/gfx/layers/opengl/TextureHostOGL.h
+++ b/gfx/layers/opengl/TextureHostOGL.h
@@ -32,34 +32,32 @@
 #include "OGLShaderProgram.h"           // for ShaderProgramType, etc
 #ifdef MOZ_WIDGET_GONK
 #include <ui/GraphicBuffer.h>
 #if ANDROID_VERSION >= 17
 #include <ui/Fence.h>
 #endif
 #endif
 
-class gfxReusableSurfaceWrapper;
 class nsIntRegion;
 
 namespace mozilla {
 namespace gfx {
 class DataSourceSurface;
 }
 
 namespace gl {
 class AndroidSurfaceTexture;
 }
 
 namespace layers {
 
 class Compositor;
 class CompositorOGL;
 class TextureImageTextureSourceOGL;
-class TextureSharedDataGonkOGL;
 class GLTextureSource;
 
 inline void ApplyFilterToBoundTexture(gl::GLContext* aGL,
                                       gfx::Filter aFilter,
                                       GLuint aTarget = LOCAL_GL_TEXTURE_2D)
 {
   GLenum filter =
     (aFilter == gfx::Filter::POINT ? LOCAL_GL_NEAREST : LOCAL_GL_LINEAR);
--- a/gfx/src/FilterSupport.h
+++ b/gfx/src/FilterSupport.h
@@ -153,17 +153,16 @@ enum AttributeName {
   eImageNativeSize,
   eImageSubregion,
   eImageTransform,
   eLastAttributeName
 };
 
 class DrawTarget;
 class SourceSurface;
-class FilterNode;
 struct FilterAttribute;
 
 enum class AttributeType {
   eBool,
   eUint,
   eFloat,
   eSize,
   eIntSize,
--- a/gfx/src/nsColor.h
+++ b/gfx/src/nsColor.h
@@ -8,17 +8,16 @@
 
 #include <stddef.h>                     // for size_t
 #include <stdint.h>                     // for uint8_t, uint32_t
 #include "gfxCore.h"                    // for NS_GFX_
 #include "nscore.h"                     // for nsAString
 
 class nsAString;
 class nsString;
-class nsCString;
 
 // A color is a 32 bit unsigned integer with four components: R, G, B
 // and A.
 typedef uint32_t nscolor;
 
 // Make a color out of r,g,b values. This assumes that the r,g,b values are
 // properly constrained to 0-255. This also assumes that a is 255.
 #define NS_RGB(_r,_g,_b) \
--- a/gfx/src/nsITheme.h
+++ b/gfx/src/nsITheme.h
@@ -10,23 +10,21 @@
 #define nsITheme_h_
 
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 #include "nsColor.h"
 #include "Units.h"
 
 struct nsRect;
-struct nsFont;
 struct nsIntMargin;
 class nsPresContext;
 class nsRenderingContext;
 class nsDeviceContext;
 class nsIFrame;
-class nsIContent;
 class nsIAtom;
 class nsIWidget;
 
 // IID for the nsITheme interface
 // {a21dd936-5960-46da-a724-7c114e421b41}
  #define NS_ITHEME_IID     \
 { 0xa21dd936, 0x5960, 0x46da, \
   { 0xa7, 0x24, 0x7c, 0x11, 0x4e, 0x42, 0x1b, 0x41 } }
--- a/gfx/thebes/gfx2DGlue.h
+++ b/gfx/thebes/gfx2DGlue.h
@@ -13,24 +13,16 @@
 #include "gfxContext.h"
 #include "mozilla/gfx/Matrix.h"
 #include "mozilla/gfx/Rect.h"
 #include "mozilla/gfx/2D.h"
 #include "gfxColor.h"
 
 namespace mozilla {
 namespace gfx {
-class DrawTarget;
-class SourceSurface;
-class ScaledFont;
-}
-}
-
-namespace mozilla {
-namespace gfx {
 
 inline Rect ToRect(const gfxRect &aRect)
 {
   return Rect(Float(aRect.x), Float(aRect.y),
               Float(aRect.width), Float(aRect.height));
 }
 
 inline Rect ToRect(const nsIntRect &aRect)
--- a/gfx/thebes/gfxAndroidPlatform.h
+++ b/gfx/thebes/gfxAndroidPlatform.h
@@ -7,18 +7,16 @@
 #define GFX_PLATFORM_ANDROID_H
 
 #include "gfxFT2Fonts.h"
 #include "gfxPlatform.h"
 #include "gfxUserFontSet.h"
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 
-class nsIMemoryReporter;
-
 namespace mozilla {
     namespace dom {
         class FontListEntry;
     };
 };
 using mozilla::dom::FontListEntry;
 
 typedef struct FT_LibraryRec_ *FT_Library;
--- a/gfx/thebes/gfxBlur.h
+++ b/gfx/thebes/gfxBlur.h
@@ -11,17 +11,16 @@
 #include "nsAutoPtr.h"
 #include "gfxPoint.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/UniquePtr.h"
 
 class gfxContext;
 struct gfxRect;
 struct gfxRGBA;
-class gfxMatrix;
 
 namespace mozilla {
   namespace gfx {
     class AlphaBoxBlur;
     struct RectCornerRadii;
     class SourceSurface;
     class DrawTarget;
   }
--- a/gfx/thebes/gfxDrawable.h
+++ b/gfx/thebes/gfxDrawable.h
@@ -7,17 +7,16 @@
 #define GFX_DRAWABLE_H
 
 #include "nsAutoPtr.h"
 #include "gfxRect.h"
 #include "gfxMatrix.h"
 #include "GraphicsFilter.h"
 #include "mozilla/gfx/2D.h"
 
-class gfxASurface;
 class gfxContext;
 class gfxPattern;
 
 /**
  * gfxDrawable
  * An Interface representing something that has an intrinsic size and can draw
  * itself repeatedly.
  */
--- a/gfx/thebes/gfxPattern.h
+++ b/gfx/thebes/gfxPattern.h
@@ -12,18 +12,16 @@
 #include "mozilla/Alignment.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/PatternHelpers.h"
 #include "GraphicsFilter.h"
 #include "nsISupportsImpl.h"
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
 
-class gfxContext;
-class gfxASurface;
 struct gfxRGBA;
 typedef struct _cairo_pattern cairo_pattern_t;
 
 
 class gfxPattern final{
     NS_INLINE_DECL_REFCOUNTING(gfxPattern)
 
 public:
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -33,21 +33,19 @@ struct gfxFontStyle;
 class gfxUserFontSet;
 class gfxFontEntry;
 class gfxPlatformFontList;
 class gfxTextRun;
 class nsIURI;
 class nsIAtom;
 class nsIObserver;
 class SRGBOverrideObserver;
-struct gfxRGBA;
 
 namespace mozilla {
 namespace gl {
-class GLContext;
 class SkiaGLGlue;
 }
 namespace gfx {
 class DrawTarget;
 class SourceSurface;
 class DataSourceSurface;
 class ScaledFont;
 class DrawEventRecorder;
--- a/gfx/thebes/gfxQtNativeRenderer.h
+++ b/gfx/thebes/gfxQtNativeRenderer.h
@@ -6,18 +6,16 @@
 #ifndef GFXQTNATIVERENDER_H_
 #define GFXQTNATIVERENDER_H_
 
 #include "gfxColor.h"
 #include "gfxContext.h"
 #include "gfxXlibSurface.h"
 #include "mozilla/gfx/Rect.h"
 
-class QRect;
-
 /**
  * This class lets us take code that draws into an Xlib surface drawable and lets us
  * use it to draw into any Thebes context. The user should subclass this class,
  * override NativeDraw, and then call Draw(). The drawing will be subjected
  * to all Thebes transformations, clipping etc.
  */
 class gfxQtNativeRenderer {
 public:
--- a/gfx/thebes/gfxWindowsPlatform.h
+++ b/gfx/thebes/gfxWindowsPlatform.h
@@ -52,18 +52,16 @@ namespace layers {
 class DeviceManagerD3D9;
 class ReadbackManagerD3D11;
 }
 }
 struct IDirect3DDevice9;
 struct ID3D11Device;
 struct IDXGIAdapter1;
 
-class nsIMemoryReporter;
-
 /**
  * Utility to get a Windows HDC from a Moz2D DrawTarget.  If the DrawTarget is
  * not backed by a HDC this will get the HDC for the screen device context
  * instead.
  */
 class MOZ_STACK_CLASS DCFromDrawTarget final
 {
 public:
--- a/storage/src/StorageBaseStatementInternal.h
+++ b/storage/src/StorageBaseStatementInternal.h
@@ -8,17 +8,16 @@
 #define mozilla_storage_StorageBaseStatementInternal_h_
 
 #include "nsISupports.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 
 struct sqlite3;
 struct sqlite3_stmt;
-class mozIStorageError;
 class mozIStorageBindingParamsArray;
 class mozIStorageBindingParams;
 class mozIStorageStatementCallback;
 class mozIStoragePendingStatement;
 
 namespace mozilla {
 namespace storage {
 
--- a/storage/src/mozStorageAsyncStatement.h
+++ b/storage/src/mozStorageAsyncStatement.h
@@ -14,17 +14,16 @@
 
 #include "mozStorageBindingParamsArray.h"
 #include "mozStorageStatementData.h"
 #include "mozIStorageAsyncStatement.h"
 #include "StorageBaseStatementInternal.h"
 #include "mozilla/Attributes.h"
 
 class nsIXPConnectJSObjectHolder;
-struct sqlite3_stmt;
 
 namespace mozilla {
 namespace storage {
 
 class AsyncStatementJSHelper;
 class Connection;
 
 class AsyncStatement final : public mozIStorageAsyncStatement
--- a/storage/src/mozStorageAsyncStatementParams.h
+++ b/storage/src/mozStorageAsyncStatementParams.h
@@ -6,18 +6,16 @@
 
 #ifndef mozilla_storage_mozStorageAsyncStatementParams_h_
 #define mozilla_storage_mozStorageAsyncStatementParams_h_
 
 #include "mozIStorageStatementParams.h"
 #include "nsIXPCScriptable.h"
 #include "mozilla/Attributes.h"
 
-class mozIStorageAsyncStatement;
-
 namespace mozilla {
 namespace storage {
 
 class AsyncStatement;
 
 /*
  * Since mozIStorageStatementParams is just a tagging interface we do not have
  * an async variant.
--- a/storage/src/mozStorageConnection.h
+++ b/storage/src/mozStorageConnection.h
@@ -22,17 +22,16 @@
 #include "mozIStorageAsyncConnection.h"
 #include "mozIStorageCompletionCallback.h"
 
 #include "nsIMutableArray.h"
 #include "mozilla/Attributes.h"
 
 #include "sqlite3.h"
 
-struct PRLock;
 class nsIFile;
 class nsIFileURL;
 class nsIEventTarget;
 class nsIThread;
 
 namespace mozilla {
 namespace storage {
 
--- a/storage/src/mozStoragePrivateHelpers.h
+++ b/storage/src/mozStoragePrivateHelpers.h
@@ -14,18 +14,16 @@
 #include "sqlite3.h"
 #include "nsIVariant.h"
 #include "nsError.h"
 #include "nsAutoPtr.h"
 #include "js/TypeDecls.h"
 #include "Variant.h"
 
 class mozIStorageCompletionCallback;
-class mozIStorageBaseStatement;
-class mozIStorageBindingParams;
 class nsIRunnable;
 
 namespace mozilla {
 namespace storage {
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Macros
 
--- a/widget/PuppetWidget.h
+++ b/widget/PuppetWidget.h
@@ -19,18 +19,16 @@
 #include "mozilla/RefPtr.h"
 #include "nsBaseScreen.h"
 #include "nsBaseWidget.h"
 #include "nsIScreenManager.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 
-class gfxASurface;
-
 namespace mozilla {
 
 namespace dom {
 class TabChild;
 }
 
 namespace widget {
 
--- a/widget/android/AndroidBridge.h
+++ b/widget/android/AndroidBridge.h
@@ -31,18 +31,16 @@
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Types.h"
 #include "mozilla/jni/Utils.h"
 
 // Some debug #defines
 // #define DEBUG_ANDROID_EVENTS
 // #define DEBUG_ANDROID_WIDGET
 
-class nsWindow;
-class nsIDOMMozSmsMessage;
 class nsIObserver;
 class Task;
 
 extern bool mozilla_AndroidBridge_SetMainThread(pthread_t);
 
 namespace base {
 class Thread;
 } // end namespace base
@@ -57,20 +55,16 @@ class NetworkInformation;
 } // namespace hal
 
 namespace dom {
 namespace mobilemessage {
 struct SmsFilterData;
 } // namespace mobilemessage
 } // namespace dom
 
-namespace layers {
-class CompositorParent;
-} // namespace layers
-
 // The order and number of the members in this structure must correspond
 // to the attrsAppearance array in GeckoAppShell.getSystemColors()
 typedef struct AndroidSystemColors {
     nscolor textColorPrimary;
     nscolor textColorPrimaryInverse;
     nscolor textColorSecondary;
     nscolor textColorSecondaryInverse;
     nscolor textColorTertiary;
--- a/widget/android/AndroidJavaWrappers.h
+++ b/widget/android/AndroidJavaWrappers.h
@@ -22,17 +22,16 @@
 #include "mozilla/EventForwards.h"
 #include "InputData.h"
 #include "Units.h"
 #include "FrameMetrics.h"
 
 //#define FORCE_ALOG 1
 
 class nsIAndroidDisplayport;
-class nsIAndroidViewport;
 class nsIWidget;
 
 namespace mozilla {
 
 class AutoLocalJNIFrame;
 
 void InitAndroidJavaWrappers(JNIEnv *jEnv);
 
--- a/widget/android/GfxInfo.h
+++ b/widget/android/GfxInfo.h
@@ -11,20 +11,16 @@
 #include "GfxInfoBase.h"
 #include "GfxDriverInfo.h"
 
 #include "nsString.h"
 #include "mozilla/UniquePtr.h"
 
 namespace mozilla {
 
-namespace gl {
-class GLContext;
-}
-
 namespace widget {
 
 class GfxInfo : public GfxInfoBase
 {
 private:
   ~GfxInfo();
 
 public:
--- a/widget/cocoa/nsAppShell.h
+++ b/widget/cocoa/nsAppShell.h
@@ -6,18 +6,16 @@
 /*
  * Runs the main native Cocoa run loop, interrupting it as needed to process
  * Gecko events.
  */
 
 #ifndef nsAppShell_h_
 #define nsAppShell_h_
 
-class nsCocoaWindow;
-
 #include "nsBaseAppShell.h"
 #include "nsTArray.h"
 
 // GeckoNSApplication
 //
 // Subclass of NSApplication for filtering out certain events.
 @interface GeckoNSApplication : NSApplication
 {
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -28,17 +28,16 @@
 
 #include "nsString.h"
 #include "nsIDragService.h"
 
 #import <Carbon/Carbon.h>
 #import <Cocoa/Cocoa.h>
 #import <AppKit/NSOpenGL.h>
 
-class gfxASurface;
 class nsChildView;
 class nsCocoaWindow;
 
 namespace {
 class GLPresenter;
 class RectTextureImage;
 }
 
--- a/widget/cocoa/nsMenuBarX.h
+++ b/widget/cocoa/nsMenuBarX.h
@@ -12,17 +12,16 @@
 #include "nsMenuGroupOwnerX.h"
 #include "nsChangeObserver.h"
 #include "nsINativeMenuService.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 
 class nsMenuX;
 class nsMenuBarX;
-class nsMenuItemX;
 class nsIWidget;
 class nsIContent;
 
 // The native menu service for creating native menu bars.
 class nsNativeMenuServiceX : public nsINativeMenuService
 {
 public:
   NS_DECL_ISUPPORTS
--- a/widget/cocoa/nsMenuGroupOwnerX.h
+++ b/widget/cocoa/nsMenuGroupOwnerX.h
@@ -11,22 +11,20 @@
 #include "nsMenuBaseX.h"
 #include "nsIMutationObserver.h"
 #include "nsHashKeys.h"
 #include "nsDataHashtable.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 
 
-class nsMenuX;
 class nsMenuItemX;
 class nsChangeObserver;
 class nsIWidget;
 class nsIContent;
-class nsIDocument;
 
 class nsMenuGroupOwnerX : public nsMenuObjectX, public nsIMutationObserver
 {
 public:
   nsMenuGroupOwnerX();
 
   nsresult Create(nsIContent * aContent);
 
--- a/widget/gonk/HwcComposer2D.h
+++ b/widget/gonk/HwcComposer2D.h
@@ -33,17 +33,16 @@
 namespace mozilla {
 
 namespace gl {
     class GLContext;
 }
 
 namespace layers {
 class CompositorParent;
-class ContainerLayer;
 class Layer;
 }
 
 //Holds a dynamically allocated vector of rectangles
 //used to decribe the complex visible region of a layer
 typedef std::vector<hwc_rect_t> RectVector;
 #if ANDROID_VERSION >= 17
 typedef hwc_composer_device_1_t HwcDevice;
--- a/widget/gonk/libdisplay/FramebufferSurface.h
+++ b/widget/gonk/libdisplay/FramebufferSurface.h
@@ -23,17 +23,16 @@
 #include <gui/ConsumerBase.h>
 
 // ---------------------------------------------------------------------------
 namespace android {
 // ---------------------------------------------------------------------------
 
 class Rect;
 class String8;
-class HWComposer;
 
 #if ANDROID_VERSION >= 21
 typedef IGraphicBufferConsumer StreamConsumer;
 #else
 typedef BufferQueue StreamConsumer;
 #endif
 
 // ---------------------------------------------------------------------------
--- a/widget/gonk/libdisplay/GonkDisplay.h
+++ b/widget/gonk/libdisplay/GonkDisplay.h
@@ -16,20 +16,16 @@
 #ifndef GONKDISPLAY_H
 #define GONKDISPLAY_H
 
 #include <system/window.h>
 #include "mozilla/Types.h"
 
 namespace mozilla {
 
-namespace layers {
-class Layer;
-}
-
 typedef void * EGLDisplay;
 typedef void * EGLSurface;
 
 class MOZ_EXPORT GonkDisplay {
 public:
     virtual ANativeWindow* GetNativeWindow() = 0;
 
     virtual void SetEnabled(bool enabled) = 0;
--- a/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueProducer.h
+++ b/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueProducer.h
@@ -18,18 +18,16 @@
 #ifndef NATIVEWINDOW_GONKBUFFERQUEUEPRODUCER_LL_H
 #define NATIVEWINDOW_GONKBUFFERQUEUEPRODUCER_LL_H
 
 #include "GonkBufferQueueDefs.h"
 #include <gui/IGraphicBufferProducer.h>
 
 namespace android {
 
-class GonkBufferSlot;
-
 class GonkBufferQueueProducer : public BnGraphicBufferProducer,
                             private IBinder::DeathRecipient {
 public:
     friend class GonkBufferQueue; // Needed to access binderDied
 
     GonkBufferQueueProducer(const sp<GonkBufferQueueCore>& core);
     virtual ~GonkBufferQueueProducer();
 
--- a/widget/gonk/nsWindow.h
+++ b/widget/gonk/nsWindow.h
@@ -18,32 +18,18 @@
 
 #include "InputData.h"
 #include "nsBaseWidget.h"
 #include "nsRegion.h"
 #include "nsIIdleServiceInternal.h"
 #include "Units.h"
 
 extern nsIntRect gScreenBounds;
-
-namespace mozilla {
-namespace gl {
-class GLContext;
-}
-namespace layers {
-class LayersManager;
-}
-}
-
 class ANativeWindowBuffer;
 
-namespace android {
-class FramebufferNativeWindow;
-}
-
 namespace widget {
 struct InputContext;
 struct InputContextAction;
 }
 
 class nsWindow : public nsBaseWidget
 {
 public:
--- a/widget/gtk/nsPSPrinters.h
+++ b/widget/gtk/nsPSPrinters.h
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPSPrinters_h___
 #define nsPSPrinters_h___
 
 #include "nsString.h"
 #include "nsTArray.h"
 
-class nsCUPSShim;
-
 class nsPSPrinterList {
     public:
         nsPSPrinterList();
 
         /**
          * Is the PostScript module enabled or disabled?
          * @return true if enabled,
          *         false if not.
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -56,17 +56,16 @@ extern PRLogModuleInfo *gWidgetDrawLog;
 #define LOGFOCUS(args)
 #define LOGDRAG(args)
 #define LOGDRAW(args)
 
 #endif /* MOZ_LOGGING */
 
 class gfxASurface;
 class gfxPattern;
-class nsDragService;
 class nsPluginNativeWindowGtk;
 #if defined(MOZ_X11) && defined(MOZ_HAVE_SHAREDMEMORYSYSV)
 #  define MOZ_HAVE_SHMIMAGE
 class nsShmImage;
 #endif
 
 class nsWindow : public nsBaseWidget
 {
--- a/widget/nsBaseClipboard.h
+++ b/widget/nsBaseClipboard.h
@@ -5,17 +5,16 @@
 
 #ifndef nsBaseClipboard_h__
 #define nsBaseClipboard_h__
 
 #include "nsIClipboard.h"
 #include "nsITransferable.h"
 
 class nsITransferable;
-class nsDataObj;
 class nsIClipboardOwner;
 class nsIWidget;
 
 /**
  * Native Win32 BaseClipboard wrapper
  */
 
 class nsBaseClipboard : public nsIClipboard
--- a/widget/nsBaseDragService.h
+++ b/widget/nsBaseDragService.h
@@ -19,20 +19,18 @@
 #include "mozilla/dom/HTMLCanvasElement.h"
 #include "nsTArray.h"
 
 // translucency level for drag images
 #define DRAG_TRANSLUCENCY 0.65
 
 class nsIContent;
 class nsIDOMNode;
-class nsIFrame;
 class nsPresContext;
 class nsIImageLoadingContent;
-class nsICanvasElementExternal;
 
 namespace mozilla {
 namespace gfx {
 class SourceSurface;
 }
 }
 
 /**
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -23,19 +23,16 @@
 #include "mozilla/RefPtr.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/gfx/Point.h"
 #include "nsDataHashtable.h"
 #include "nsIObserver.h"
 #include "Units.h"
 
 // forward declarations
-class   nsFontMetrics;
-class   nsDeviceContext;
-struct  nsFont;
 class   nsIRollupListener;
 class   imgIContainer;
 class   nsIContent;
 class   ViewWrapper;
 class   nsIWidgetListener;
 class   nsIntRegion;
 class   nsIScreen;
 
--- a/widget/nsPrintOptionsImpl.h
+++ b/widget/nsPrintOptionsImpl.h
@@ -10,17 +10,16 @@
 #include "mozilla/embedding/PPrinting.h"
 #include "nsCOMPtr.h"
 #include "nsIPrintOptions.h"
 #include "nsIPrintSettingsService.h"
 #include "nsString.h"
 #include "nsFont.h"
 
 class nsIPrintSettings;
-class nsIWebBrowserPrint;
 
 /**
  *   Class nsPrintOptions
  */
 class nsPrintOptions : public nsIPrintOptions,
                        public nsIPrintSettingsService
 {
 public:
--- a/widget/nsTransferable.h
+++ b/widget/nsTransferable.h
@@ -9,17 +9,16 @@
 #include "nsIFormatConverter.h"
 #include "nsITransferable.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsWeakPtr.h"
 
 class nsString;
-class nsDataObj;
 
 //
 // DataStruct
 //
 // Holds a flavor (a mime type) that describes the data and the associated data.
 //
 struct DataStruct
 {
--- a/widget/qt/nsWindow.h
+++ b/widget/qt/nsWindow.h
@@ -54,17 +54,16 @@ extern PRLogModuleInfo *gWidgetDrawLog;
 #define LOGFOCUS(args)
 #define LOGIM(args)
 #define LOGDRAW(args)
 
 #endif
 
 #endif /* MOZ_LOGGING */
 
-class nsIdleService;
 class QCloseEvent;
 class QFocusEvent;
 class QHideEvent;
 class QKeyEvent;
 class QMouseEvent;
 class QMoveEvent;
 class QResizeEvent;
 class QShowEvent;
--- a/widget/windows/KeyboardLayout.h
+++ b/widget/windows/KeyboardLayout.h
@@ -32,17 +32,16 @@
 #define VK_OEM_5                0xDC
 #define VK_OEM_6                0xDD
 #define VK_OEM_7                0xDE
 #define VK_OEM_8                0xDF
 #define VK_OEM_102              0xE2
 #define VK_OEM_CLEAR            0xFE
 
 class nsIIdleServiceInternal;
-struct nsModifierKeyState;
 
 namespace mozilla {
 namespace widget {
 
 static const uint32_t sModifierKeyMap[][3] = {
   { nsIWidget::CAPS_LOCK, VK_CAPITAL, 0 },
   { nsIWidget::NUM_LOCK,  VK_NUMLOCK, 0 },
   { nsIWidget::SHIFT_L,   VK_SHIFT,   VK_LSHIFT },
--- a/widget/windows/nsClipboard.h
+++ b/widget/windows/nsClipboard.h
@@ -7,17 +7,16 @@
 #define nsClipboard_h__
 
 #include "nsBaseClipboard.h"
 #include "nsIObserver.h"
 #include "nsIURI.h"
 #include <windows.h>
 
 class nsITransferable;
-class nsIClipboardOwner;
 class nsIWidget;
 class nsIFile;
 struct IDataObject;
 
 /**
  * Native Win32 Clipboard wrapper
  */
 
--- a/widget/windows/nsDataObjCollection.h
+++ b/widget/windows/nsDataObjCollection.h
@@ -9,18 +9,16 @@
 #include <oleidl.h>
 
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
 #include "nsDataObj.h"
 #include "mozilla/Attributes.h"
 
-class CEnumFormatEtc;
-
 #define MULTI_MIME "Mozilla/IDataObjectCollectionFormat"
 
 EXTERN_C const IID IID_IDataObjCollection;
 
 // An interface to make sure we have the right kind of object for D&D
 // this way we can filter out collection objects that aren't ours
 class nsIDataObjCollection : public IUnknown {
 public:
--- a/widget/windows/nsDragService.h
+++ b/widget/windows/nsDragService.h
@@ -5,21 +5,18 @@
 
 #ifndef nsDragService_h__
 #define nsDragService_h__
 
 #include "nsBaseDragService.h"
 #include <windows.h>
 #include <shlobj.h>
 
-struct IDropSource;
 struct IDataObject;
-class  nsNativeDragTarget;
 class  nsDataObjCollection;
-class  nsString;
 
 /**
  * Native Win32 DragService wrapper
  */
 
 class nsDragService : public nsBaseDragService
 {
 public:
--- a/widget/windows/nsNativeDragTarget.h
+++ b/widget/windows/nsNativeDragTarget.h
@@ -15,18 +15,16 @@
 #undef LogSeverity // SetupAPI.h #defines this as DWORD
 #endif
 
 #include "mozilla/Attributes.h"
 
 class nsIDragService;
 class nsIWidget;
 
-struct IDataObject;
-
 /*
  * nsNativeDragTarget implements the IDropTarget interface and gets most of its
  * behavior from the associated adapter (m_dragDrop).
  */
 
 class nsNativeDragTarget final : public IDropTarget
 {
 public:
--- a/widget/windows/nsTextStore.h
+++ b/widget/windows/nsTextStore.h
@@ -33,20 +33,16 @@
 // TSF InputScope, for earlier SDK 8
 #define IS_SEARCH static_cast<InputScope>(50)
 
 struct ITfThreadMgr;
 struct ITfDocumentMgr;
 struct ITfDisplayAttributeMgr;
 struct ITfCategoryMgr;
 class nsWindow;
-#ifdef MOZ_METRO
-class MetroWidget;
-#endif
-class TSFStaticSink;
 
 namespace mozilla {
 namespace widget {
 struct MSGResult;
 } // namespace widget
 } // namespace mozilla
 
 /*
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -44,24 +44,22 @@
 #include "nsIIdleServiceInternal.h"
 
 /**
  * Forward class definitions
  */
 
 class nsNativeDragTarget;
 class nsIRollupListener;
-class nsIFile;
 class nsIntRegion;
 class imgIContainer;
 
 namespace mozilla {
 namespace widget {
 class NativeKey;
-class ModifierKeyState;
 struct MSGResult;
 } // namespace widget
 } // namespacw mozilla;
 
 /**
  * Native WIN32 window wrapper.
  */
 
--- a/xpcom/base/nsMemoryInfoDumper.h
+++ b/xpcom/base/nsMemoryInfoDumper.h
@@ -5,18 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_nsMemoryInfoDumper_h
 #define mozilla_nsMemoryInfoDumper_h
 
 #include "nsIMemoryInfoDumper.h"
 #include <stdio.h>
 
-class nsACString;
-
 /**
  * This class facilitates dumping information about our memory usage to disk.
  *
  * Its cpp file also has Linux-only code which watches various OS signals and
  * dumps memory info upon receiving a signal.  You can activate these listeners
  * by calling Initialize().
  */
 class nsMemoryInfoDumper : public nsIMemoryInfoDumper
--- a/xpcom/build/Omnijar.h
+++ b/xpcom/build/Omnijar.h
@@ -8,18 +8,16 @@
 #define mozilla_Omnijar_h
 
 #include "nscore.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIFile.h"
 #include "nsZipArchive.h"
 
-class nsIURI;
-
 namespace mozilla {
 
 class Omnijar
 {
 private:
   /**
    * Store an nsIFile for an omni.jar. We can store two paths here, one
    * for GRE (corresponding to resource://gre/) and one for APP
--- a/xpcom/build/nsXPCOMPrivate.h
+++ b/xpcom/build/nsXPCOMPrivate.h
@@ -9,17 +9,16 @@
 
 #include "nscore.h"
 #include "nsXPCOM.h"
 #include "nsXPCOMStrings.h"
 #include "xptcall.h"
 
 class nsStringContainer;
 class nsCStringContainer;
-class nsIComponentLoader;
 class nsPurpleBufferEntry;
 
 /**
  * During this shutdown notification all threads which run XPCOM code must
  * be joined.
  */
 #define NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID "xpcom-shutdown-threads"
 
--- a/xpcom/components/ManifestParser.h
+++ b/xpcom/components/ManifestParser.h
@@ -8,18 +8,16 @@
 #define ManifestParser_h
 
 #include "nsComponentManager.h"
 #if !defined(MOZILLA_XPCOMRT_API)
 #include "nsChromeRegistry.h"
 #endif // !defined(MOZILLA_XPCOMRT_API)
 #include "mozilla/FileLocation.h"
 
-class nsIFile;
-
 void ParseManifest(NSLocationType aType, mozilla::FileLocation& aFile,
                    char* aBuf, bool aChromeOnly, bool aXPTOnly = false);
 
 void LogMessage(const char* aMsg, ...);
 
 void LogMessageWithContext(mozilla::FileLocation& aFile,
                            uint32_t aLineNumber, const char* aMsg, ...);
 
--- a/xpcom/ds/nsObserverList.h
+++ b/xpcom/ds/nsObserverList.h
@@ -12,20 +12,16 @@
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsIObserver.h"
 #include "nsIWeakReference.h"
 #include "nsHashKeys.h"
 #include "nsISimpleEnumerator.h"
 #include "mozilla/Attributes.h"
 
-namespace mozilla {
-class ObserverServiceReporter;
-} // namespace mozilla
-
 struct ObserverRef
 {
   ObserverRef(const ObserverRef& aO) : isWeakRef(aO.isWeakRef), ref(aO.ref) {}
   explicit ObserverRef(nsIObserver* aObserver) : isWeakRef(false), ref(aObserver) {}
   explicit ObserverRef(nsIWeakReference* aWeak) : isWeakRef(true), ref(aWeak) {}
 
   bool isWeakRef;
   nsCOMPtr<nsISupports> ref;
--- a/xpcom/glue/nsCOMPtr.h
+++ b/xpcom/glue/nsCOMPtr.h
@@ -104,19 +104,16 @@
   #define NSCAP_LOG_ASSIGNMENT(this, ptr)
 #endif
 
 #ifndef NSCAP_LOG_RELEASE
   #define NSCAP_LOG_RELEASE(this, ptr)
 #endif
 
 namespace mozilla {
-
-struct unused_t;
-
 namespace dom {
 template<class T> class OwningNonNull;
 } // namespace dom
 } // namespace mozilla
 
 template<class T>
 inline already_AddRefed<T>
 dont_AddRef(T* aRawPtr)
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.h
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.h
@@ -14,17 +14,16 @@
 #include "nsID.h"
 #include "nsTArray.h"
 #include "xptinfo.h"
 #include "nsAutoPtr.h"
 #include "js/RootingAPI.h"
 
 namespace mozilla {
 namespace dom {
-struct ConstantSpec;
 struct NativePropertyHooks;
 }
 }
 
 class ShimInterfaceInfo final : public nsIInterfaceInfo
 {
 public:
     NS_DECL_ISUPPORTS
--- a/xpcom/reflect/xptinfo/xptinfo.h
+++ b/xpcom/reflect/xptinfo/xptinfo.h
@@ -6,18 +6,16 @@
 /* XPTI_PUBLIC_API and XPTI_GetInterfaceInfoManager declarations. */
 
 #ifndef xptiinfo_h___
 #define xptiinfo_h___
 
 #include "nscore.h"
 #include "xpt_struct.h"
 
-class nsIInterfaceInfoManager;
-
 // Flyweight wrapper classes for xpt_struct.h structs. 
 // Everything here is dependent upon - and sensitive to changes in -
 // xpcom/typelib/xpt/xpt_struct.h!
 
 class nsXPTType : public XPTTypeDescriptorPrefix
 {
 // NO DATA - this a flyweight wrapper
 public: