Bug 913619 - Minimize the #includes in image/src; r=jrmuizel

This patch was generated by running include-what-you-use on image/src,
and then removing the #include statements suggested by that tool, either
replacing them with forward declarations of the used names in headers,
or dropping the ones that were completely unnecessary, and then adding
new #include statements in other places that were implicitly relying on
some of the removed #include statements.
This commit is contained in:
Ehsan Akhgari 2013-09-07 09:01:08 -04:00
parent 3ea4cf31e9
commit bdb172ee45
45 changed files with 53 additions and 114 deletions

View File

@ -10,6 +10,7 @@
#include "ImageAccessible.h"
#include "mozilla/Likely.h"
#include "nsMai.h"
#include "nsIURI.h"
using namespace mozilla;
using namespace mozilla::a11y;

View File

@ -21,6 +21,7 @@
#include "nsIWebProgress.h"
#include "prenv.h"
#include "nsIDocShellTreeItem.h"
#include "nsIURI.h"
using namespace mozilla;
using namespace mozilla::a11y;

View File

@ -19,6 +19,7 @@
#include "nsIServiceManager.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsPIDOMWindow.h"
#include "nsIURI.h"
using namespace mozilla::a11y;

View File

@ -17,6 +17,7 @@
#include "nsIFrame.h"
#include "nsImageFrame.h"
#include "nsImageMap.h"
#include "nsIURI.h"
using namespace mozilla::a11y;

View File

@ -14,6 +14,7 @@
#include "nsIAccessibleTypes.h"
#include "nsString.h"
#include "nsIURI.h"
using namespace mozilla;
using namespace mozilla::a11y;

View File

@ -6,6 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ImageAccessibleWrap.h"
#include "nsIURI.h"
using namespace mozilla;
using namespace mozilla::a11y;

View File

@ -24,6 +24,7 @@
#include "nsHTMLCSSStyleSheet.h"
#include "nsCSSParser.h"
#include "nsStyledElement.h"
#include "nsIURI.h"
#include <algorithm>
using namespace mozilla;

View File

@ -38,6 +38,7 @@
#include "nsGkAtoms.h"
#include "nsGUIEvent.h"
#include "nsIFrame.h"
#include "nsIURI.h"
// image copy stuff
#include "nsIImageLoadingContent.h"

View File

@ -16,6 +16,7 @@
#include "nsRuleData.h"
#include "nsMappedAttributes.h"
#include "nsContentUtils.h"
#include "nsIURI.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Shared)

View File

@ -20,6 +20,7 @@
#include "mozAutoDocUpdate.h"
#include "nsIScriptError.h"
#include "nsContentUtils.h"
#include "nsIURI.h"
#include "mozilla/dom/ElementBinding.h"

View File

@ -6,10 +6,10 @@
#include "gfxDrawable.h"
#include "gfxPlatform.h"
#include "gfxUtils.h"
#include "mozilla/dom/SVGSVGElement.h"
#include "ClippedImage.h"
#include "Orientation.h"
#include "SVGImageContext.h"
using mozilla::layers::LayerManager;
using mozilla::layers::ImageContainer;

View File

@ -5,10 +5,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Decoder.h"
#include "nsIServiceManager.h"
#include "nsIConsoleService.h"
#include "nsIScriptError.h"
#include "GeckoProfiler.h"
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
namespace mozilla {
namespace image {

View File

@ -11,6 +11,7 @@
#include "mozilla/RefPtr.h"
#include "ImageMetadata.h"
#include "Orientation.h"
#include "mozilla/Telemetry.h"
namespace mozilla {
namespace image {

View File

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "FrameAnimator.h"
#include "FrameBlender.h"
#include "imgIContainer.h"

View File

@ -8,12 +8,13 @@
#define mozilla_imagelib_FrameAnimator_h_
#include "mozilla/TimeStamp.h"
#include "FrameBlender.h"
#include "nsRect.h"
namespace mozilla {
namespace image {
class FrameBlender;
class FrameAnimator
{
public:

View File

@ -6,7 +6,6 @@
#include "FrameBlender.h"
#include "mozilla/MemoryReporting.h"
#include "RasterImage.h"
#include "pixman.h"

View File

@ -9,10 +9,10 @@
#include "mozilla/MemoryReporting.h"
#include "gfxASurface.h"
#include "imgFrame.h"
#include "FrameSequence.h"
#include "nsCOMPtr.h"
#include "nsISupportsImpl.h"
class imgFrame;
namespace mozilla {
namespace image {

View File

@ -11,7 +11,6 @@
#include "mozilla/MemoryReporting.h"
#include "gfxASurface.h"
#include "imgFrame.h"
#include "nsISupportsImpl.h"
namespace mozilla {
namespace image {

View File

@ -10,8 +10,9 @@
#include "imgIContainer.h"
#include "imgStatusTracker.h"
#include "nsIURI.h"
#include "nsIRequest.h"
#include "nsIInputStream.h"
class nsIRequest;
class nsIInputStream;
namespace mozilla {
namespace image {

View File

@ -12,13 +12,10 @@
#include "nsIHttpChannel.h"
#include "nsIFileChannel.h"
#include "nsIFile.h"
#include "nsSimpleURI.h"
#include "nsMimeTypes.h"
#include "nsIURI.h"
#include "nsIRequest.h"
#include "imgIContainer.h"
#include "imgStatusTracker.h"
#include "RasterImage.h"
#include "VectorImage.h"
#include "Image.h"

View File

@ -8,7 +8,7 @@
#include "RasterImage.h"
#include "nsComponentManagerUtils.h"
#include "nsSupportsPrimitives.h"
#include "nsISupportsPrimitives.h"
using namespace mozilla::image;

View File

@ -8,7 +8,6 @@
#define MOZILLA_IMAGELIB_IMAGEOPS_H_
#include "nsCOMPtr.h"
#include "Orientation.h"
class imgIContainer;
struct nsIntRect;
@ -17,6 +16,7 @@ namespace mozilla {
namespace image {
class Image;
class Orientation;
class ImageOps
{

View File

@ -10,17 +10,12 @@
#include "nsError.h"
#include "Decoder.h"
#include "RasterImage.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIMultiPartChannel.h"
#include "nsAutoPtr.h"
#include "nsStringStream.h"
#include "prenv.h"
#include "prsystem.h"
#include "ImageContainer.h"
#include "Layers.h"
#include "nsPresContext.h"
#include "nsThread.h"
#include "nsIThreadPool.h"
#include "nsXPCOMCIDInternal.h"
#include "nsIObserverService.h"
@ -45,10 +40,9 @@
#include "mozilla/gfx/Scale.h"
#include "GeckoProfiler.h"
#include "gfx2DGlue.h"
#include <algorithm>
#include "pixman.h"
using namespace mozilla;
using namespace mozilla::image;
using namespace mozilla::layers;

View File

@ -22,28 +22,24 @@
#include "nsCOMPtr.h"
#include "imgIContainer.h"
#include "nsIProperties.h"
#include "nsITimer.h"
#include "nsIRequest.h"
#include "nsTArray.h"
#include "imgFrame.h"
#include "nsThreadUtils.h"
#include "DiscardTracker.h"
#include "Orientation.h"
#include "nsISupportsImpl.h"
#include "nsIObserver.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Telemetry.h"
#include "mozilla/LinkedList.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/WeakPtr.h"
#include "mozilla/Mutex.h"
#include "gfx2DGlue.h"
#ifdef DEBUG
#include "imgIContainerDebug.h"
#endif
class nsIInputStream;
class nsIThreadPool;
class nsIRequest;
#define NS_RASTERIMAGE_CID \
{ /* 376ff2c1-9bf6-418a-b143-3340c00112f7 */ \

View File

@ -6,7 +6,6 @@
#include "SVGDocumentWrapper.h"
#include "mozilla/dom/Element.h"
#include "nsIAtom.h"
#include "nsICategoryManager.h"
#include "nsIChannel.h"
#include "nsIContentViewer.h"
@ -24,12 +23,10 @@
#include "nsComponentManagerUtils.h"
#include "nsSMILAnimationController.h"
#include "nsServiceManagerUtils.h"
#include "nsSize.h"
#include "gfxRect.h"
#include "mozilla/dom/SVGSVGElement.h"
#include "nsSVGLength2.h"
#include "nsSVGEffects.h"
#include "mozilla/dom/SVGAnimatedLength.h"
#include "nsMimeTypes.h"
using namespace mozilla::dom;

View File

@ -15,7 +15,6 @@
#include "nsIObserver.h"
#include "nsIContentViewer.h"
#include "nsWeakReference.h"
#include "nsMimeTypes.h"
class nsIAtom;
class nsIPresShell;

View File

@ -5,28 +5,21 @@
#include "VectorImage.h"
#include <algorithm>
#include "gfxContext.h"
#include "gfxDrawable.h"
#include "gfxPlatform.h"
#include "gfxUtils.h"
#include "imgDecoderObserver.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/SVGSVGElement.h"
#include "nsComponentManagerUtils.h"
#include "nsIDOMEvent.h"
#include "nsIObserverService.h"
#include "nsIPresShell.h"
#include "nsIStreamListener.h"
#include "nsMimeTypes.h"
#include "nsPresContext.h"
#include "nsRect.h"
#include "nsServiceManagerUtils.h"
#include "nsStubDocumentObserver.h"
#include "nsSVGEffects.h" // for nsSVGRenderingObserver
#include "nsSVGUtils.h" // for nsSVGUtils::ConvertToSurfaceSize
#include "Orientation.h"
#include "SVGDocumentWrapper.h"
#include "nsIDOMEventListener.h"

View File

@ -8,11 +8,9 @@
#include "Image.h"
#include "nsIStreamListener.h"
#include "nsIRequest.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/WeakPtr.h"
class imgDecoderObserver;
class nsIRequest;
namespace mozilla {
namespace layers {

View File

@ -7,8 +7,6 @@
#include "imgFrame.h"
#include "DiscardTracker.h"
#include <limits.h>
#include "prenv.h"
#include "gfxPlatform.h"

View File

@ -12,9 +12,6 @@
#include "nsRect.h"
#include "nsPoint.h"
#include "nsSize.h"
#include "gfxTypes.h"
#include "nsID.h"
#include "gfxContext.h"
#include "gfxPattern.h"
#include "gfxDrawable.h"
#include "gfxImageSurface.h"

View File

@ -12,8 +12,6 @@
#include "imgLoader.h"
#include "imgRequestProxy.h"
#include "RasterImage.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
@ -27,31 +25,21 @@
#include "nsIProgressEventSink.h"
#include "nsIChannelEventSink.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsIServiceManager.h"
#include "nsIFileURL.h"
#include "nsThreadUtils.h"
#include "nsXPIDLString.h"
#include "nsCRT.h"
#include "nsIDocument.h"
#include "nsPIDOMWindow.h"
#include "netCore.h"
#include "nsURILoader.h"
#include "nsIComponentRegistrar.h"
#include "nsIApplicationCache.h"
#include "nsIApplicationCacheContainer.h"
#include "nsIMemoryReporter.h"
#include "Image.h"
#include "DiscardTracker.h"
// 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 "nsILoadContext.h"
#include "nsILoadGroupChild.h"
@ -2032,7 +2020,6 @@ nsresult imgLoader::GetMimeTypeFromContent(const char* aContents, uint32_t aLeng
#include "nsIRequest.h"
#include "nsIStreamConverterService.h"
#include "nsXPIDLString.h"
NS_IMPL_ISUPPORTS2(ProxyListener, nsIStreamListener, nsIRequestObserver)

View File

@ -17,19 +17,17 @@
#include "nsExpirationTracker.h"
#include "nsAutoPtr.h"
#include "imgRequest.h"
#include "nsIObserverService.h"
#include "nsIChannelPolicy.h"
#include "nsIProgressEventSink.h"
#include "nsIChannel.h"
#include "imgIRequest.h"
class imgLoader;
class imgRequest;
class imgRequestProxy;
class imgIRequest;
class imgINotificationObserver;
class nsILoadGroup;
class imgCacheExpirationTracker;
class imgMemoryReporter;
class nsIChannelPolicy;
class imgCacheEntry
{
@ -200,8 +198,6 @@ private:
uint32_t mSize;
};
class imgMemoryReporter;
class imgLoader : public imgILoader,
public nsIContentSniffer,
public imgICache,

View File

@ -13,13 +13,8 @@
#include "ImageFactory.h"
#include "Image.h"
#include "imgILoader.h"
#include "netCore.h"
#include "nsIChannel.h"
#include "nsICachingChannel.h"
#include "nsILoadGroup.h"
#include "nsIInputStream.h"
#include "nsIMultiPartChannel.h"
#include "nsIHttpChannel.h"
@ -27,22 +22,16 @@
#include "nsIApplicationCacheChannel.h"
#include "nsMimeTypes.h"
#include "nsIComponentManager.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIServiceManager.h"
#include "nsISupportsPrimitives.h"
#include "nsIScriptSecurityManager.h"
#include "nsICacheVisitor.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "plstr.h" // PL_strcasestr(...)
#include "nsNetUtil.h"
#include "nsIProtocolHandler.h"
#include "DiscardTracker.h"
#include "nsAsyncRedirectVerifyHelper.h"
#include "imgIRequest.h"
using namespace mozilla;
using namespace mozilla::image;

View File

@ -9,19 +9,13 @@
#include "nsIChannelEventSink.h"
#include "nsIInterfaceRequestor.h"
#include "nsIRequest.h"
#include "nsIProperties.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"
#include "nsIPrincipal.h"
#include "nsITimedChannel.h"
#include "nsIApplicationCache.h"
#include "nsAutoPtr.h"
#include "nsCOMPtr.h"
#include "nsStringGlue.h"
#include "nsError.h"
#include "imgIRequest.h"
#include "nsIAsyncVerifyRedirectCallback.h"
class imgCacheValidator;
@ -31,6 +25,11 @@ class imgRequestProxy;
class imgCacheEntry;
class imgMemoryReporter;
class imgRequestNotifyRunnable;
class nsIApplicationCache;
class nsIProperties;
class nsIRequest;
class nsITimedChannel;
class nsIURI;
namespace mozilla {
namespace image {

View File

@ -7,22 +7,12 @@
#include "imgRequestProxy.h"
#include "imgIOnloadBlocker.h"
#include "nsIInputStream.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIMultiPartChannel.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "Image.h"
#include "ImageOps.h"
#include "nsError.h"
#include "ImageLogging.h"
#include "nspr.h"
#include "nsCRTGlue.h"
#include "imgINotificationObserver.h"
using namespace mozilla::image;

View File

@ -8,11 +8,8 @@
#define imgRequestProxy_h__
#include "imgIRequest.h"
#include "imgINotificationObserver.h"
#include "nsISecurityInfoProvider.h"
#include "nsIRequestObserver.h"
#include "nsIChannel.h"
#include "nsILoadGroup.h"
#include "nsISupportsPriority.h"
#include "nsITimedChannel.h"
@ -30,8 +27,10 @@
{0x8f, 0x65, 0x9c, 0x46, 0x2e, 0xe2, 0xbc, 0x95} \
}
class imgINotificationObserver;
class imgRequestNotifyRunnable;
class imgStatusNotifyRunnable;
class nsIntRect;
class ProxyBehaviour;
namespace mozilla {

View File

@ -11,11 +11,8 @@
#include "imgDecoderObserver.h"
#include "Image.h"
#include "ImageLogging.h"
#include "RasterImage.h"
#include "nsIObserverService.h"
#include "RasterImage.h"
#include "mozilla/Util.h"
#include "mozilla/Assertions.h"
#include "mozilla/Services.h"

View File

@ -7,21 +7,19 @@
#ifndef imgStatusTracker_h__
#define imgStatusTracker_h__
class imgDecoderObserver;
class imgIContainer;
class imgRequestProxy;
class imgStatusNotifyRunnable;
class imgRequestNotifyRunnable;
class imgStatusTrackerObserver;
class imgStatusTrackerNotifyingObserver;
struct nsIntRect;
class nsIRunnable;
#include "mozilla/RefPtr.h"
#include "nsCOMPtr.h"
#include "nsTObserverArray.h"
#include "nsIRunnable.h"
#include "nscore.h"
#include "imgDecoderObserver.h"
#include "nsISupportsImpl.h"
#include "nsRect.h"
namespace mozilla {
namespace image {

View File

@ -9,17 +9,13 @@
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsString.h"
#include "nsError.h"
#include "imgLoader.h"
#include "imgICache.h"
#include "imgIContainer.h"
#include "imgIEncoder.h"
#include "gfxContext.h"
#include "nsStringStream.h"
#include "nsComponentManagerUtils.h"
#include "nsWeakReference.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsStreamUtils.h"
#include "nsNetUtil.h"
#include "nsContentUtils.h"

View File

@ -5,7 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "imgITools.h"
#include "gfxContext.h"
class gfxImageSurface;
#define NS_IMGTOOLS_CID \
{ /* 4c2383a4-931c-484d-8c4a-973590f66e3f */ \

View File

@ -20,6 +20,7 @@
#include "imgIContainer.h"
#include "imgRequestProxy.h"
#include "nsIURI.h"
#include <algorithm>

View File

@ -36,6 +36,7 @@
#include "mozilla/dom/CSSStyleDeclarationBinding.h"
#include "StyleRule.h"
#include "nsFont.h"
#include "nsIURI.h"
using namespace mozilla;

View File

@ -15,6 +15,7 @@
#include "nsCSSProps.h"
#include "nsCOMPtr.h"
#include "mozAutoDocUpdate.h"
#include "nsIURI.h"
using namespace mozilla;

View File

@ -27,6 +27,7 @@
#include "imgIContainer.h"
#include "mozilla/Likely.h"
#include "nsIURI.h"
#include <algorithm>
static_assert((((1 << nsStyleStructID_Length) - 1) &

View File

@ -12,6 +12,7 @@
#include "nsRuleNode.h"
#include "nsROCSSPrimitiveValue.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIURI.h"
using namespace mozilla;