From 25987bb3e967c01156a52e377fcbf1b409be3fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 9 Dec 2019 12:52:53 +0000 Subject: [PATCH] Bug 1602317 - Remove some useless includes. r=heycam This intended to fix some windows builds, but that didn't end up working. This removes some unused members and such, and fixes some missing includes that they uncover (whoops). This was needed because some windows headers used in the sandbox redefine STRICT (which is used by `StyleContain`) and `TRANSPARENT`, which is used by some WR stuff. Differential Revision: https://phabricator.services.mozilla.com/D56317 --HG-- extra : moz-landing-system : lando --- dom/base/Document.cpp | 3 --- dom/base/Document.h | 9 --------- dom/base/test/gtest/TestContentUtils.cpp | 1 + dom/clients/api/Client.h | 1 + dom/clients/manager/ClientIPCUtils.h | 1 + dom/clients/manager/ClientInfo.h | 1 + dom/file/ipc/IPCBlobInputStream.cpp | 1 + dom/ipc/JSWindowActor.h | 2 ++ dom/plugins/base/nsPluginStreamListenerPeer.h | 1 + gfx/ipc/GfxMessageUtils.h | 1 - gfx/layers/Layers.h | 1 + gfx/layers/LayersTypes.h | 4 +++- gfx/layers/ScrollableLayerGuid.h | 1 + layout/base/StaticPresData.h | 18 +----------------- .../tests/test_reduceprecision.cpp | 1 + widget/nsIWidget.h | 7 ++++--- 16 files changed, 19 insertions(+), 34 deletions(-) diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 5da3be3ae060..4c0f0e7cf32a 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -13912,9 +13912,6 @@ void Document::DocAddSizeOfExcludingThis(nsWindowSizes& aWindowSizes) const { mStyleSet->AddSizeOfIncludingThis(aWindowSizes); - aWindowSizes.mDOMOtherSize += mLangGroupFontPrefs.SizeOfExcludingThis( - aWindowSizes.mState.mMallocSizeOf); - aWindowSizes.mPropertyTablesSize += mPropertyTable.SizeOfExcludingThis(aWindowSizes.mState.mMallocSizeOf); diff --git a/dom/base/Document.h b/dom/base/Document.h index 62d8e1c95ef6..f6eee73c73a9 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -42,7 +42,6 @@ #include "nsURIHashKey.h" #include "mozilla/UseCounter.h" #include "mozilla/WeakPtr.h" -#include "mozilla/StaticPresData.h" #include "Units.h" #include "nsContentListDeclarations.h" #include "nsExpirationTracker.h" @@ -58,7 +57,6 @@ #include "mozilla/LinkedList.h" #include "mozilla/NotNull.h" #include "mozilla/SegmentedVector.h" -#include "mozilla/ServoBindingTypes.h" #include "mozilla/StyleSheet.h" #include "mozilla/TimeStamp.h" #include "mozilla/UniquePtr.h" @@ -5287,13 +5285,6 @@ class Document : public nsINode, // resolution. nsTHashtable> mLazySVGPresElements; - // Most documents will only use one (or very few) language groups. Rather - // than have the overhead of a hash lookup, we simply look along what will - // typically be a very short (usually of length 1) linked list. There are 31 - // language groups, so in the worst case scenario we'll need to traverse 31 - // link items. - LangGroupFontPrefs mLangGroupFontPrefs; - nsTHashtable> mLanguagesUsed; // TODO(emilio): Is this hot enough to warrant to be cached? diff --git a/dom/base/test/gtest/TestContentUtils.cpp b/dom/base/test/gtest/TestContentUtils.cpp index d6638da94786..e0e50715271e 100644 --- a/dom/base/test/gtest/TestContentUtils.cpp +++ b/dom/base/test/gtest/TestContentUtils.cpp @@ -8,6 +8,7 @@ #include "jsapi.h" #include "nsContentUtils.h" +#include "nsNetUtil.h" #include "mozilla/CycleCollectedJSContext.h" #include "mozilla/dom/SimpleGlobalObject.h" diff --git a/dom/clients/api/Client.h b/dom/clients/api/Client.h index aeb9d5c36a0b..bf250a5260e4 100644 --- a/dom/clients/api/Client.h +++ b/dom/clients/api/Client.h @@ -6,6 +6,7 @@ #ifndef _mozilla_dom_Client_h #define _mozilla_dom_Client_h +#include "X11UndefineNone.h" #include "mozilla/dom/ClientBinding.h" #include "mozilla/StorageAccess.h" #include "nsCOMPtr.h" diff --git a/dom/clients/manager/ClientIPCUtils.h b/dom/clients/manager/ClientIPCUtils.h index 65e5e81198df..10a7e0a182e1 100644 --- a/dom/clients/manager/ClientIPCUtils.h +++ b/dom/clients/manager/ClientIPCUtils.h @@ -8,6 +8,7 @@ #include "ipc/IPCMessageUtils.h" +#include "X11UndefineNone.h" #include "mozilla/dom/ClientBinding.h" #include "mozilla/dom/ClientsBinding.h" #include "mozilla/dom/DocumentBinding.h" diff --git a/dom/clients/manager/ClientInfo.h b/dom/clients/manager/ClientInfo.h index 5f804a6aef7c..7e83edf2e442 100644 --- a/dom/clients/manager/ClientInfo.h +++ b/dom/clients/manager/ClientInfo.h @@ -7,6 +7,7 @@ #ifndef _mozilla_dom_ClientInfo_h #define _mozilla_dom_ClientInfo_h +#include "X11UndefineNone.h" #include "mozilla/dom/ClientBinding.h" #include "mozilla/Maybe.h" #include "mozilla/UniquePtr.h" diff --git a/dom/file/ipc/IPCBlobInputStream.cpp b/dom/file/ipc/IPCBlobInputStream.cpp index 655b0b6c6f15..2b2042926e8e 100644 --- a/dom/file/ipc/IPCBlobInputStream.cpp +++ b/dom/file/ipc/IPCBlobInputStream.cpp @@ -14,6 +14,7 @@ #include "nsIAsyncInputStream.h" #include "nsIAsyncOutputStream.h" #include "nsIPipe.h" +#include "nsNetUtil.h" #include "nsStreamUtils.h" #include "nsStringStream.h" diff --git a/dom/ipc/JSWindowActor.h b/dom/ipc/JSWindowActor.h index 1f5c410e20b3..204a50020f11 100644 --- a/dom/ipc/JSWindowActor.h +++ b/dom/ipc/JSWindowActor.h @@ -12,7 +12,9 @@ #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" #include "mozilla/dom/PromiseNativeHandler.h" +#include "nsCycleCollectionParticipant.h" #include "nsRefPtrHashtable.h" +#include "nsWrapperCache.h" class nsIGlobalObject; class nsQueryActor; diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.h b/dom/plugins/base/nsPluginStreamListenerPeer.h index 83c432fbc826..73a956ee23f1 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.h +++ b/dom/plugins/base/nsPluginStreamListenerPeer.h @@ -8,6 +8,7 @@ #include "nscore.h" #include "nsIFile.h" +#include "nsIRequest.h" #include "nsIStreamListener.h" #include "nsIProgressEventSink.h" #include "nsIHttpHeaderVisitor.h" diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h index 87a9c87eea17..cc1ae66c1cdf 100644 --- a/gfx/ipc/GfxMessageUtils.h +++ b/gfx/ipc/GfxMessageUtils.h @@ -7,7 +7,6 @@ #ifndef __GFXMESSAGEUTILS_H__ #define __GFXMESSAGEUTILS_H__ -#include "mozilla/webrender/webrender_ffi.h" #include "FilterSupport.h" #include "ImageTypes.h" #include "RegionBuilder.h" diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 676d8742c2a5..5afbd670bbed 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -39,6 +39,7 @@ #include "mozilla/layers/CanvasRenderer.h" #include "mozilla/layers/LayerAttributes.h" #include "mozilla/layers/LayersTypes.h" +#include "mozilla/webrender/WebRenderTypes.h" #include "mozilla/mozalloc.h" // for operator delete, etc #include "nsAutoPtr.h" // for nsAutoPtr, nsRefPtr, etc #include "nsCOMPtr.h" // for already_AddRefed diff --git a/gfx/layers/LayersTypes.h b/gfx/layers/LayersTypes.h index 7b43d082e5d1..eb83d2b28193 100644 --- a/gfx/layers/LayersTypes.h +++ b/gfx/layers/LayersTypes.h @@ -16,7 +16,6 @@ #include "mozilla/TimeStamp.h" // for TimeStamp #include "mozilla/TypedEnumBits.h" #include "nsRegion.h" -#include "nsStyleConsts.h" #include // FILE #include "mozilla/Logging.h" // for PR_LOG @@ -43,6 +42,9 @@ struct ParamTraits; } // namespace IPC namespace mozilla { + +enum class StyleBorderStyle : uint8_t; + namespace layers { class TextureHost; diff --git a/gfx/layers/ScrollableLayerGuid.h b/gfx/layers/ScrollableLayerGuid.h index 27291d3995e5..7f81c6763af4 100644 --- a/gfx/layers/ScrollableLayerGuid.h +++ b/gfx/layers/ScrollableLayerGuid.h @@ -11,6 +11,7 @@ #include "mozilla/HashFunctions.h" // for HashGeneric #include "mozilla/gfx/Logging.h" // for Log #include "mozilla/layers/LayersTypes.h" // for LayersId +#include "nsHashKeys.h" // for nsPrintfCString #include "nsPrintfCString.h" // for nsPrintfCString namespace mozilla { diff --git a/layout/base/StaticPresData.h b/layout/base/StaticPresData.h index 3c1edb9fb9f5..0427482a7e17 100644 --- a/layout/base/StaticPresData.h +++ b/layout/base/StaticPresData.h @@ -42,22 +42,6 @@ struct LangGroupFontPrefs { mLangGroup = nullptr; } - size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = 0; - LangGroupFontPrefs* curr = mNext.get(); - while (curr) { - n += aMallocSizeOf(curr); - - // Measurement of the following members may be added later if DMD finds - // it is worthwhile: - // - mLangGroup - // - mDefault*Font - - curr = curr->mNext.get(); - } - return n; - } - // Initialize this with the data for a given language void Initialize(nsStaticAtom* aLangGroupAtom); @@ -103,7 +87,7 @@ struct LangGroupFontPrefs { nsFont mDefaultMonospaceFont; nsFont mDefaultCursiveFont; nsFont mDefaultFantasyFont; - mozilla::UniquePtr mNext; + UniquePtr mNext; }; /** diff --git a/toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp b/toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp index 9bc7290dbb3e..338651cb68fb 100644 --- a/toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp +++ b/toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp @@ -8,6 +8,7 @@ #include "gtest/gtest.h" #include "nsIPrefBranch.h" +#include "nsServiceManagerUtils.h" #include "nsRFPService.h" using namespace mozilla; diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 7b0914207831..6d332a2cdc2d 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -18,12 +18,9 @@ #include "nsITheme.h" #include "nsITimer.h" #include "nsRegionFwd.h" -#include "nsStyleConsts.h" #include "nsXULAppAPI.h" #include "mozilla/Maybe.h" #include "mozilla/EventForwards.h" -#include "mozilla/layers/APZTypes.h" -#include "mozilla/layers/LayersTypes.h" #include "mozilla/layers/ScrollableLayerGuid.h" #include "mozilla/layers/ZoomConstraints.h" #include "mozilla/RefPtr.h" @@ -47,6 +44,9 @@ class nsIRunnable; class nsIKeyEventInPluginCallback; namespace mozilla { + +enum class StyleWindowShadow : uint8_t; + #if defined(MOZ_WIDGET_ANDROID) namespace ipc { class Shmem; @@ -66,6 +66,7 @@ struct FrameMetrics; class LayerManager; class LayerManagerComposite; class PLayerTransactionChild; +struct SLGuidAndRenderRoot; class WebRenderBridgeChild; } // namespace layers namespace gfx {