diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 10a2a8d26d0..0ef07f43679 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -19,6 +19,7 @@ #include "nsPIDOMWindow.h" // for use in inline functions #include "nsPropertyTable.h" // for member #include "nsTHashtable.h" // for member +#include "nsWeakReference.h" #include "mozilla/dom/DocumentBinding.h" #include "mozilla/WeakPtr.h" #include "Units.h" diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h index ef09fa1f284..ed6618a6ac1 100644 --- a/content/base/public/nsINode.h +++ b/content/base/public/nsINode.h @@ -15,7 +15,6 @@ #include "nsNodeInfoManager.h" // for use in NodePrincipal() #include "nsPropertyTable.h" // for typedefs #include "nsTObserverArray.h" // for member -#include "nsWindowMemoryReporter.h" // for NS_DECL_SIZEOF_EXCLUDING_THIS #include "mozilla/ErrorResult.h" #include "mozilla/MemoryReporting.h" #include "mozilla/dom/EventTarget.h" // for base class @@ -244,13 +243,21 @@ private: // ever passed to Mutated(). enum { eMaxMutations = 300 }; - + // sMutationCount is a global mutation counter which is decreased by one at // every mutation. It is capped at 0 to avoid wrapping. // Its value is always between 0 and 300, inclusive. static uint32_t sMutationCount; }; +// This should be used for any nsINode sub-class that has fields of its own +// that it needs to measure; any sub-class that doesn't use it will inherit +// SizeOfExcludingThis from its super-class. SizeOfIncludingThis() need not be +// defined, it is inherited from nsINode. +// This macro isn't actually specific to nodes, and bug 956400 will move it into MFBT. +#define NS_DECL_SIZEOF_EXCLUDING_THIS \ + virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; + // Categories of node properties // 0 is global. #define DOM_USER_DATA 1 diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 1826ac98a72..accae78ae87 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -221,6 +221,7 @@ #include "nsIMutableArray.h" #include "nsContentPermissionHelper.h" #include "mozilla/dom/DOMStringList.h" +#include "nsWindowMemoryReporter.h" using namespace mozilla; using namespace mozilla::dom; diff --git a/content/base/src/nsFrameMessageManager.cpp b/content/base/src/nsFrameMessageManager.cpp index df889d57fec..fded1caf70a 100644 --- a/content/base/src/nsFrameMessageManager.cpp +++ b/content/base/src/nsFrameMessageManager.cpp @@ -23,6 +23,7 @@ #include "nsIXULRuntime.h" #include "nsIScriptError.h" #include "nsIConsoleService.h" +#include "nsIMemoryReporter.h" #include "nsIProtocolHandler.h" #include "nsIScriptSecurityManager.h" #include "nsIJSRuntimeService.h" diff --git a/content/svg/content/src/SVGTransform.cpp b/content/svg/content/src/SVGTransform.cpp index a45e1adf66e..53ad781372b 100644 --- a/content/svg/content/src/SVGTransform.cpp +++ b/content/svg/content/src/SVGTransform.cpp @@ -12,6 +12,7 @@ #include "nsError.h" #include "nsSVGAnimatedTransformList.h" #include "nsSVGAttrTearoffTable.h" +#include "mozilla/DebugOnly.h" namespace { const double kRadPerDegree = 2.0 * M_PI / 360.0; diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 053e14cdb7e..759b2889fdb 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -35,6 +35,7 @@ #include "nsIScriptTimeoutHandler.h" #include "nsIController.h" #include "nsScriptNameSpaceManager.h" +#include "nsWindowMemoryReporter.h" // Helper Classes #include "nsJSUtils.h" diff --git a/dom/base/nsWindowMemoryReporter.h b/dom/base/nsWindowMemoryReporter.h index 301497c9910..214b55f2a62 100644 --- a/dom/base/nsWindowMemoryReporter.h +++ b/dom/base/nsWindowMemoryReporter.h @@ -19,13 +19,6 @@ #include "mozilla/TimeStamp.h" #include "nsArenaMemoryStats.h" -// This should be used for any nsINode sub-class that has fields of its own -// that it needs to measure; any sub-class that doesn't use it will inherit -// SizeOfExcludingThis from its super-class. SizeOfIncludingThis() need not be -// defined, it is inherited from nsINode. -#define NS_DECL_SIZEOF_EXCLUDING_THIS \ - virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; - class nsWindowSizes { #define FOR_EACH_SIZE(macro) \ macro(DOM, mDOMElementNodesSize) \ diff --git a/editor/libeditor/base/IMETextTxn.cpp b/editor/libeditor/base/IMETextTxn.cpp index 7f9b9313b80..9eaf1843743 100644 --- a/editor/libeditor/base/IMETextTxn.cpp +++ b/editor/libeditor/base/IMETextTxn.cpp @@ -4,6 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "IMETextTxn.h" +#include "mozilla/DebugOnly.h" // for DebugOnly #include "mozilla/mozalloc.h" // for operator new #include "mozilla/TextEvents.h" // for TextRangeStyle #include "nsAString.h" // for nsAString_internal::Length, etc diff --git a/image/src/SurfaceCache.cpp b/image/src/SurfaceCache.cpp index 972aa78242d..cad2efa2a17 100644 --- a/image/src/SurfaceCache.cpp +++ b/image/src/SurfaceCache.cpp @@ -15,6 +15,7 @@ #include "mozilla/Preferences.h" #include "mozilla/RefPtr.h" #include "mozilla/StaticPtr.h" +#include "nsIMemoryReporter.h" #include "gfx2DGlue.h" #include "gfxASurface.h" #include "gfxPattern.h" // Workaround for flaw in bug 921753 part 2. diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index d4a0368860c..e595db32d69 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -26,6 +26,7 @@ #include "nsZipArchive.h" #include "nsIDOMFile.h" #include "nsIDOMFileList.h" +#include "nsWindowMemoryReporter.h" using namespace mozilla; using namespace JS; diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index e64433d4963..0c7ebd87d12 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -82,6 +82,7 @@ #include "mozilla/GuardObjects.h" #include "mozilla/Maybe.h" #include "mozilla/MemoryReporting.h" +#include "mozilla/TimeStamp.h" #include #include diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index ab05c120930..34a97136b48 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -113,6 +113,7 @@ #include "SVGContentUtils.h" #include "nsSVGEffects.h" #include "SVGFragmentIdentifier.h" +#include "nsArenaMemoryStats.h" #include "nsPerformance.h" #include "nsRefreshDriver.h" diff --git a/layout/xul/nsXULPopupManager.h b/layout/xul/nsXULPopupManager.h index 1273ac667dc..3a325c6a54c 100644 --- a/layout/xul/nsXULPopupManager.h +++ b/layout/xul/nsXULPopupManager.h @@ -17,6 +17,7 @@ #include "nsPoint.h" #include "nsCOMPtr.h" #include "nsTArray.h" +#include "nsIObserver.h" #include "nsITimer.h" #include "nsIReflowCallback.h" #include "nsThreadUtils.h"