Bug 1448728 part 1 - Make popular headers not include nsWindowSizes.h. r=njn

MozReview-Commit-ID: EC5J9Im3gfu

--HG--
extra : source : 9fa9209aeeb00009143c5c21f21210c93184e61f
This commit is contained in:
Xidorn Quan 2018-03-28 10:44:49 +11:00
Родитель cae93b8fe4
Коммит 1962625a79
21 изменённых файлов: 42 добавлений и 17 удалений

Просмотреть файл

@ -37,6 +37,7 @@
#include "nsBidiUtils.h"
#include "PLDHashTable.h"
#include "mozilla/Sprintf.h"
#include "nsWindowSizes.h"
#include "nsWrapperCacheInlines.h"
namespace mozilla {

Просмотреть файл

@ -79,6 +79,7 @@
#include "nsAttrValueOrString.h"
#include "nsAttrValueInlines.h"
#include "nsCSSPseudoElements.h"
#include "nsWindowSizes.h"
#ifdef MOZ_XUL
#include "nsXULElement.h"
#endif /* MOZ_XUL */

Просмотреть файл

@ -84,6 +84,7 @@
#include "nsContentUtils.h"
#include "nsTextFragment.h"
#include "nsContentCID.h"
#include "nsWindowSizes.h"
#include "nsIDOMEventListener.h"
#include "nsIWebNavigation.h"

Просмотреть файл

@ -18,6 +18,7 @@
namespace mozilla {
class EventStates;
class SizeOfState;
namespace dom {

Просмотреть файл

@ -2405,6 +2405,13 @@ nsINode::AddSizeOfExcludingThis(nsWindowSizes& aSizes, size_t* aNodeSize) const
// non-owning
}
void
nsINode::AddSizeOfIncludingThis(nsWindowSizes& aSizes, size_t* aNodeSize) const
{
*aNodeSize += aSizes.mState.mMallocSizeOf(this);
AddSizeOfExcludingThis(aSizes, aNodeSize);
}
#define EVENT(name_, id_, type_, struct_) \
EventHandlerNonNull* nsINode::GetOn##name_() { \
EventListenerManager *elm = GetExistingListenerManager(); \

Просмотреть файл

@ -17,7 +17,6 @@
#include "nsNodeInfoManager.h" // for use in NodePrincipal()
#include "nsPropertyTable.h" // for typedefs
#include "nsTObserverArray.h" // for member
#include "nsWindowSizes.h" // for nsStyleSizes
#include "mozilla/ErrorResult.h"
#include "mozilla/LinkedList.h"
#include "mozilla/MemoryReporting.h"
@ -56,6 +55,7 @@ class nsNodeSupportsWeakRefTearoff;
class nsNodeWeakReference;
class nsDOMMutationObserver;
class nsRange;
class nsWindowSizes;
struct RawServoSelectorList;
namespace mozilla {
@ -359,11 +359,7 @@ public:
// way that |this| points to the start of the allocated object, even in
// methods of nsINode's sub-classes, so aSizes.mState.mMallocSizeOf(this) is
// always safe to call no matter which object it was invoked on.
virtual void AddSizeOfIncludingThis(nsWindowSizes& aSizes,
size_t* aNodeSize) const {
*aNodeSize += aSizes.mState.mMallocSizeOf(this);
AddSizeOfExcludingThis(aSizes, aNodeSize);
}
void AddSizeOfIncludingThis(nsWindowSizes& aSizes, size_t* aNodeSize) const;
friend class nsNodeUtils;
friend class nsNodeWeakReference;

Просмотреть файл

@ -19,6 +19,7 @@
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIURI.h"
#include "nsWindowSizes.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Anchor)

Просмотреть файл

@ -12,6 +12,7 @@
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventStates.h"
#include "mozilla/MemoryReporting.h"
#include "nsWindowSizes.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Area)

Просмотреть файл

@ -28,6 +28,7 @@
#include "nsStyleConsts.h"
#include "nsStyleLinkElement.h"
#include "nsUnicharUtils.h"
#include "nsWindowSizes.h"
#define LINK_ELEMENT_FLAG_BIT(n_) \
NODE_FLAG_BIT(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + (n_))

Просмотреть файл

@ -20,6 +20,7 @@
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsStyleStruct.h"
#include "nsWindowSizes.h"
#include "SVGContentUtils.h"
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Path)

Просмотреть файл

@ -23,6 +23,7 @@
#include "nsIScriptSecurityManager.h"
#include "nsContentUtils.h"
#include "nsDOMJSUtils.h"
#include "nsWindowSizes.h"
#include "mozilla/Services.h"
#include "xpcpublic.h"
#include "mozilla/scache/StartupCache.h"

Просмотреть файл

@ -6,6 +6,7 @@
#include "Image.h"
#include "Layers.h" // for LayerManager
#include "nsRefreshDriver.h"
#include "mozilla/SizeOfState.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Tuple.h" // for Tie

Просмотреть файл

@ -38,6 +38,7 @@
#include "mozilla/Move.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Services.h"
#include "mozilla/SizeOfState.h"
#include <stdint.h>
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"

Просмотреть файл

@ -27,6 +27,7 @@
#include "nsIRunnable.h"
#include "nsPIDOMWindow.h"
#include "nsPrintfCString.h"
#include "nsWindowSizes.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Services.h"

Просмотреть файл

@ -30,6 +30,7 @@
#include "GeckoProfiler.h"
#include "nsIStatefulFrame.h"
#include "nsContainerFrame.h"
#include "nsWindowSizes.h"
#include "mozilla/MemoryReporting.h"

Просмотреть файл

@ -94,6 +94,7 @@
#include "nsRegion.h"
#include "nsIFrameInlines.h"
#include "nsStyleChangeList.h"
#include "nsWindowSizes.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/EffectCompositor.h"

Просмотреть файл

@ -9,6 +9,7 @@
#include "mozilla/ComputedStyle.h"
#include "nsCOMPtr.h"
#include "nsIMemoryReporter.h"
#include "nsWindowSizes.h"
namespace mozilla {

Просмотреть файл

@ -18,6 +18,7 @@
#include "nsStyleStructInlines.h"
#include "nsString.h"
#include "nsPresContext.h"
#include "nsWindowSizes.h"
#include "nsCOMPtr.h"
#include "nsIPresShell.h"
@ -447,4 +448,17 @@ ComputedStyle::GetCachedLazyPseudoStyle(CSSPseudoElementType aPseudo) const
return mCachedInheritingStyles.Lookup(nsCSSPseudoElements::GetPseudoAtom(aPseudo));
}
void
ComputedStyle::AddSizeOfIncludingThis(nsWindowSizes& aSizes,
size_t* aCVsSize) const
{
// Note: |this| sits within a servo_arc::Arc, i.e. it is preceded by a
// refcount. So we need to measure it with a function that can handle an
// interior pointer. We use ServoComputedValuesMallocEnclosingSizeOf to
// clearly identify in DMD's output the memory measured here.
*aCVsSize += ServoComputedValuesMallocEnclosingSizeOf(this);
mSource.AddSizeOfExcludingThis(aSizes);
mCachedInheritingStyles.AddSizeOfIncludingThis(aSizes, aCVsSize);
}
} // namespace mozilla

Просмотреть файл

@ -10,7 +10,6 @@
#define _ComputedStyle_h_
#include "nsIMemoryReporter.h"
#include "nsWindowSizes.h"
#include <algorithm>
#include "mozilla/Assertions.h"
#include "mozilla/RestyleLogging.h"
@ -22,6 +21,7 @@
class nsAtom;
class nsPresContext;
class nsWindowSizes;
namespace mozilla {
@ -354,16 +354,7 @@ public:
// The |aCVsSize| outparam on this function is where the actual CVs size
// value is added. It's done that way because the callers know which value
// the size should be added to.
void AddSizeOfIncludingThis(nsWindowSizes& aSizes, size_t* aCVsSize) const
{
// Note: |this| sits within a servo_arc::Arc, i.e. it is preceded by a
// refcount. So we need to measure it with a function that can handle an
// interior pointer. We use ServoComputedValuesMallocEnclosingSizeOf to
// clearly identify in DMD's output the memory measured here.
*aCVsSize += ServoComputedValuesMallocEnclosingSizeOf(this);
mSource.AddSizeOfExcludingThis(aSizes);
mCachedInheritingStyles.AddSizeOfIncludingThis(aSizes, aCVsSize);
}
void AddSizeOfIncludingThis(nsWindowSizes& aSizes, size_t* aCVsSize) const;
protected:
// Needs to be friend so that it can call the destructor without making it

Просмотреть файл

@ -46,6 +46,7 @@
#include "nsSVGElement.h"
#include "nsTArray.h"
#include "nsTransitionManager.h"
#include "nsWindowSizes.h"
#include "mozilla/CORSMode.h"
#include "mozilla/DeclarationBlockInlines.h"

Просмотреть файл

@ -36,6 +36,7 @@
#include "nsXBLPrototypeBinding.h"
#include "gfxUserFontSet.h"
#include "nsBindingManager.h"
#include "nsWindowSizes.h"
using namespace mozilla;
using namespace mozilla::dom;