diff --git a/accessible/aom/AccessibleNode.h b/accessible/aom/AccessibleNode.h index e9fd4d4bb009..d94703b6dbe1 100644 --- a/accessible/aom/AccessibleNode.h +++ b/accessible/aom/AccessibleNode.h @@ -10,7 +10,6 @@ #include "nsDataHashtable.h" #include "nsRefPtrHashtable.h" #include "nsWrapperCache.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/DOMString.h" #include "mozilla/dom/Nullable.h" @@ -19,6 +18,8 @@ class nsINode; namespace mozilla { +class ErrorResult; + namespace a11y { class Accessible; } diff --git a/devtools/shared/heapsnapshot/DominatorTree.h b/devtools/shared/heapsnapshot/DominatorTree.h index dd88f1d08e22..e8e06ee076a1 100644 --- a/devtools/shared/heapsnapshot/DominatorTree.h +++ b/devtools/shared/heapsnapshot/DominatorTree.h @@ -8,12 +8,13 @@ #include "mozilla/devtools/HeapSnapshot.h" #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefCounted.h" #include "js/UbiNodeDominatorTree.h" #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace devtools { class DominatorTree final : public nsISupports, public nsWrapperCache { diff --git a/devtools/shared/heapsnapshot/HeapSnapshot.h b/devtools/shared/heapsnapshot/HeapSnapshot.h index 5f54a6ea8d3a..b4aa316f4cee 100644 --- a/devtools/shared/heapsnapshot/HeapSnapshot.h +++ b/devtools/shared/heapsnapshot/HeapSnapshot.h @@ -7,7 +7,6 @@ #define mozilla_devtools_HeapSnapshot__ #include "js/HashTable.h" -#include "mozilla/ErrorResult.h" #include "mozilla/devtools/DeserializedNode.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/Nullable.h" @@ -27,6 +26,8 @@ #include "nsXPCOM.h" namespace mozilla { +class ErrorResult; + namespace devtools { class DominatorTree; diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h index a5c28da8f797..2abae03069b2 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h @@ -15,7 +15,6 @@ #include "mozilla/RefPtr.h" #include "mozilla/Span.h" #include "mozilla/Tuple.h" -#include "mozilla/WeakPtr.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/FeaturePolicy.h" #include "mozilla/dom/LocationBase.h" diff --git a/docshell/base/SyncedContext.h b/docshell/base/SyncedContext.h index 56dd7d958f8d..e9ad5017cf1d 100644 --- a/docshell/base/SyncedContext.h +++ b/docshell/base/SyncedContext.h @@ -7,12 +7,16 @@ #ifndef mozilla_dom_SyncedContext_h #define mozilla_dom_SyncedContext_h -#include "mozilla/EnumSet.h" -#include "mozilla/ErrorResult.h" -#include "mozilla/Maybe.h" -#include "mozilla/RefPtr.h" -#include "mozilla/Tuple.h" +#include +#include #include +#include "mozilla/Attributes.h" +#include "mozilla/EnumSet.h" +#include "nsStringFwd.h" +#include "nscore.h" + +// Referenced via macro definitions +#include "mozilla/ErrorResult.h" class PickleIterator; @@ -31,6 +35,8 @@ struct IPDLParamTraits; namespace dom { class ContentParent; class ContentChild; +template +class MaybeDiscarded; namespace syncedcontext { diff --git a/docshell/base/WindowContext.h b/docshell/base/WindowContext.h index 6ff4e9eb4f60..748f284b9fa5 100644 --- a/docshell/base/WindowContext.h +++ b/docshell/base/WindowContext.h @@ -9,7 +9,6 @@ #include "mozilla/PermissionDelegateHandler.h" #include "mozilla/Span.h" -#include "mozilla/dom/BrowsingContext.h" #include "mozilla/dom/MaybeDiscarded.h" #include "mozilla/dom/SyncedContext.h" #include "mozilla/dom/UserActivation.h" @@ -27,6 +26,7 @@ namespace dom { class WindowGlobalParent; class WindowGlobalInit; +class BrowsingContext; class BrowsingContextGroup; #define MOZ_EACH_WC_FIELD(FIELD) \ diff --git a/docshell/base/nsILoadContext.idl b/docshell/base/nsILoadContext.idl index 234ba531c2b4..af71b96b347d 100644 --- a/docshell/base/nsILoadContext.idl +++ b/docshell/base/nsILoadContext.idl @@ -14,7 +14,9 @@ webidl Element; %{C++ #ifdef MOZILLA_INTERNAL_API -#include "mozilla/BasePrincipal.h" // for OriginAttributes +namespace mozilla { +class OriginAttributes; +} #endif %} diff --git a/docshell/shistory/ChildSHistory.h b/docshell/shistory/ChildSHistory.h index 9dbba23ad59c..43b2f63bd03b 100644 --- a/docshell/shistory/ChildSHistory.h +++ b/docshell/shistory/ChildSHistory.h @@ -21,9 +21,9 @@ #include "nsCOMPtr.h" #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" #include "nsThreadUtils.h" +#include "mozilla/ErrorResult.h" #include "mozilla/LinkedList.h" #include "nsID.h" diff --git a/dom/abort/AbortController.h b/dom/abort/AbortController.h index f2e31c372805..c653f2a768b5 100644 --- a/dom/abort/AbortController.h +++ b/dom/abort/AbortController.h @@ -8,7 +8,6 @@ #define mozilla_dom_AbortController_h #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/ErrorResult.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" @@ -16,6 +15,8 @@ class nsIGlobalObject; namespace mozilla { +class ErrorResult; + namespace dom { class AbortSignal; diff --git a/dom/animation/CSSPseudoElement.h b/dom/animation/CSSPseudoElement.h index 0a195bec1e36..fbc02939ce4f 100644 --- a/dom/animation/CSSPseudoElement.h +++ b/dom/animation/CSSPseudoElement.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/RefPtr.h" #include "nsCSSPseudoElements.h" diff --git a/dom/base/BodyConsumer.h b/dom/base/BodyConsumer.h index f75b33d5b992..2a7ab4af02f0 100644 --- a/dom/base/BodyConsumer.h +++ b/dom/base/BodyConsumer.h @@ -10,7 +10,6 @@ #include "mozilla/dom/AbortSignal.h" #include "mozilla/dom/MutableBlobStorage.h" #include "nsIInputStreamPump.h" -#include "nsNetUtil.h" #include "nsIObserver.h" #include "nsWeakReference.h" diff --git a/dom/base/BodyStream.h b/dom/base/BodyStream.h index b16d49631e45..33b1166006d8 100644 --- a/dom/base/BodyStream.h +++ b/dom/base/BodyStream.h @@ -15,7 +15,6 @@ #include "nsISupportsImpl.h" #include "nsNetCID.h" #include "nsWeakReference.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Mutex.h" class nsIGlobalObject; @@ -23,6 +22,8 @@ class nsIGlobalObject; class nsIInputStream; namespace mozilla { +class ErrorResult; + namespace dom { class BodyStream; diff --git a/dom/base/BodyUtil.h b/dom/base/BodyUtil.h index 3e56ad93a1a4..bed0eb1dbbbc 100644 --- a/dom/base/BodyUtil.h +++ b/dom/base/BodyUtil.h @@ -10,11 +10,12 @@ #include "nsString.h" #include "nsError.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/File.h" #include "mozilla/dom/FormData.h" namespace mozilla { +class ErrorResult; + namespace dom { class BodyUtil final { diff --git a/dom/base/ChromeUtils.cpp b/dom/base/ChromeUtils.cpp index 88337c6ee246..746b94bd5145 100644 --- a/dom/base/ChromeUtils.cpp +++ b/dom/base/ChromeUtils.cpp @@ -13,28 +13,21 @@ #include "WrapperFactory.h" #include "mozilla/Base64.h" -#include "mozilla/BasePrincipal.h" #include "mozilla/CycleCollectedJSRuntime.h" #include "mozilla/IntentionalCrash.h" #include "mozilla/PerformanceMetricsCollector.h" #include "mozilla/PerfStats.h" #include "mozilla/Preferences.h" #include "mozilla/ProcInfo.h" -#include "mozilla/RDDProcessManager.h" #include "mozilla/ResultExtensions.h" #include "mozilla/SharedStyleSheetCache.h" #include "mozilla/TimeStamp.h" -#include "mozilla/dom/BrowsingContext.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/IdleDeadline.h" #include "mozilla/dom/InProcessParent.h" -#include "mozilla/dom/InProcessChild.h" #include "mozilla/dom/JSActorService.h" -#include "mozilla/dom/MediaMetadata.h" #include "mozilla/dom/MediaSessionBinding.h" #include "mozilla/dom/PBrowserParent.h" -#include "mozilla/dom/PWindowGlobalParent.h" #include "mozilla/dom/Performance.h" #include "mozilla/dom/PopupBlocker.h" #include "mozilla/dom/Promise.h" @@ -43,12 +36,9 @@ #include "mozilla/dom/WindowBinding.h" // For IdleRequestCallback/Options #include "mozilla/dom/WindowGlobalParent.h" #include "mozilla/dom/WorkerPrivate.h" -#include "mozilla/gfx/GPUProcessManager.h" #include "mozilla/ipc/GeckoChildProcessHost.h" #include "mozilla/net/UrlClassifierFeatureFactory.h" -#include "mozilla/net/SocketProcessHost.h" #include "IOActivityMonitor.h" -#include "nsIOService.h" #include "nsThreadUtils.h" #include "mozJSComponentLoader.h" #include "GeckoProfiler.h" diff --git a/dom/base/ChromeUtils.h b/dom/base/ChromeUtils.h index d372031d58d6..974d1897a120 100644 --- a/dom/base/ChromeUtils.h +++ b/dom/base/ChromeUtils.h @@ -11,13 +11,14 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/ChromeUtilsBinding.h" #include "mozilla/dom/Exceptions.h" -#include "mozilla/ErrorResult.h" #include "nsDOMNavigationTiming.h" // for DOMHighResTimeStamp #include "nsIDOMProcessChild.h" #include "nsIDOMProcessParent.h" namespace mozilla { +class ErrorResult; + namespace devtools { class HeapSnapshot; } // namespace devtools diff --git a/dom/base/Crypto.cpp b/dom/base/Crypto.cpp index ec3fc6b0ebd1..2b8bfbbe70e1 100644 --- a/dom/base/Crypto.cpp +++ b/dom/base/Crypto.cpp @@ -4,19 +4,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "Crypto.h" -#include "jsfriendapi.h" +#include "js/ScalarType.h" #include "js/experimental/TypedData.h" // JS_GetArrayBufferViewType #include "nsCOMPtr.h" #include "nsIRandomGenerator.h" -#include "MainThreadUtils.h" -#include "nsXULAppAPI.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/CryptoBinding.h" +#include "mozilla/dom/SubtleCrypto.h" #include "nsServiceManagerUtils.h" -using mozilla::dom::ContentChild; - namespace mozilla::dom { NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Crypto) diff --git a/dom/base/CustomElementRegistry.h b/dom/base/CustomElementRegistry.h index a95d395e9407..14437a6961ba 100644 --- a/dom/base/CustomElementRegistry.h +++ b/dom/base/CustomElementRegistry.h @@ -11,7 +11,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" #include "mozilla/CycleCollectedJSContext.h" // for MicroTaskRunnable -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/CustomElementRegistryBinding.h" #include "mozilla/dom/Document.h" @@ -23,6 +22,8 @@ #include "nsContentUtils.h" namespace mozilla { +class ErrorResult; + namespace dom { struct CustomElementData; diff --git a/dom/base/DOMImplementation.h b/dom/base/DOMImplementation.h index 68f8046997a7..d33f54b82960 100644 --- a/dom/base/DOMImplementation.h +++ b/dom/base/DOMImplementation.h @@ -10,7 +10,6 @@ #include "nsWrapperCache.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsIScriptGlobalObject.h" @@ -19,6 +18,8 @@ #include "nsString.h" namespace mozilla { +class ErrorResult; + namespace dom { class Document; class DocumentType; diff --git a/dom/base/DOMParser.h b/dom/base/DOMParser.h index 697b80bb7905..cd59b4c4b39c 100644 --- a/dom/base/DOMParser.h +++ b/dom/base/DOMParser.h @@ -10,7 +10,6 @@ #include "nsCOMPtr.h" #include "mozilla/dom/Document.h" #include "nsWrapperCache.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Span.h" #include "mozilla/dom/DOMParserBinding.h" #include "mozilla/dom/TypedArray.h" @@ -18,6 +17,8 @@ class nsIGlobalObject; namespace mozilla { +class ErrorResult; + namespace dom { class DOMParser final : public nsISupports, public nsWrapperCache { diff --git a/dom/base/FormData.h b/dom/base/FormData.h index 2bbad1b0cf92..492b134a9026 100644 --- a/dom/base/FormData.h +++ b/dom/base/FormData.h @@ -8,7 +8,6 @@ #define mozilla_dom_FormData_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/HTMLFormSubmission.h" #include "mozilla/dom/File.h" @@ -17,6 +16,8 @@ #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class HTMLFormElement; diff --git a/dom/base/IdleDeadline.h b/dom/base/IdleDeadline.h index 9df3440fc312..10f149e63cd5 100644 --- a/dom/base/IdleDeadline.h +++ b/dom/base/IdleDeadline.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Maybe.h" #include "mozilla/dom/BindingDeclarations.h" #include "nsCOMPtr.h" diff --git a/dom/base/Location.h b/dom/base/Location.h index c6e7ae4ef5f6..ce472b318d04 100644 --- a/dom/base/Location.h +++ b/dom/base/Location.h @@ -12,14 +12,13 @@ #include "mozilla/dom/BrowsingContext.h" #include "mozilla/dom/LocationBase.h" #include "nsCycleCollectionParticipant.h" -#include "nsIWeakReferenceUtils.h" -#include "nsPIDOMWindow.h" #include "nsString.h" #include "nsWrapperCache.h" class nsIDocShell; +class nsIPrincipal; class nsIURI; -class nsDocShellLoadState; +class nsPIDOMWindowInner; namespace mozilla { namespace dom { diff --git a/dom/base/LocationBase.h b/dom/base/LocationBase.h index 1dec70130939..c0c57bb1da51 100644 --- a/dom/base/LocationBase.h +++ b/dom/base/LocationBase.h @@ -8,7 +8,6 @@ #define mozilla_dom_LocationBase_h #include "mozilla/AlreadyAddRefed.h" -#include "mozilla/ErrorResult.h" #include "nsStringFwd.h" class nsIDocShell; @@ -17,6 +16,8 @@ class nsIURI; class nsDocShellLoadState; namespace mozilla { +class ErrorResult; + namespace dom { class BrowsingContext; diff --git a/dom/base/MozQueryInterface.h b/dom/base/MozQueryInterface.h index 1d19f4504a07..1dd3d9bfff6e 100644 --- a/dom/base/MozQueryInterface.h +++ b/dom/base/MozQueryInterface.h @@ -21,10 +21,11 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/NonRefcountedDOMObject.h" -#include "mozilla/ErrorResult.h" #include "nsID.h" namespace mozilla { +class ErrorResult; + namespace dom { class MozQueryInterface final : public NonRefcountedDOMObject { diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index 043fa07e152c..99be251bf05a 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -12,7 +12,6 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/Fetch.h" #include "mozilla/dom/Nullable.h" -#include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" #include "nsHashKeys.h" #include "nsInterfaceHashtable.h" @@ -28,6 +27,8 @@ class nsIPrincipal; class nsIURI; namespace mozilla { +class ErrorResult; + namespace dom { class AddonManager; class BodyExtractorBase; diff --git a/dom/base/PlacesEvent.h b/dom/base/PlacesEvent.h index 46ac66460492..74c36e158fa8 100644 --- a/dom/base/PlacesEvent.h +++ b/dom/base/PlacesEvent.h @@ -8,10 +8,11 @@ #define mozilla_dom_PlacesEvent_h #include "mozilla/dom/PlacesEventBinding.h" -#include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class PlacesEvent : public nsWrapperCache { diff --git a/dom/base/PlacesObservers.h b/dom/base/PlacesObservers.h index 33de57ada64e..516aebc42162 100644 --- a/dom/base/PlacesObservers.h +++ b/dom/base/PlacesObservers.h @@ -11,11 +11,11 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/PlacesObserversBinding.h" #include "mozilla/dom/PlacesEvent.h" -#include "mozilla/ErrorResult.h" #include "mozilla/places/INativePlacesEventCallback.h" #include "nsIWeakReferenceUtils.h" namespace mozilla { +class ErrorResult; namespace dom { diff --git a/dom/base/PlacesWeakCallbackWrapper.h b/dom/base/PlacesWeakCallbackWrapper.h index 74ff59067304..c7ed3aa42989 100644 --- a/dom/base/PlacesWeakCallbackWrapper.h +++ b/dom/base/PlacesWeakCallbackWrapper.h @@ -9,7 +9,6 @@ #include "mozilla/WeakPtr.h" #include "mozilla/dom/PlacesObserversBinding.h" -#include "mozilla/ErrorResult.h" #include "nsIWeakReferenceUtils.h" #include "nsWrapperCache.h" diff --git a/dom/base/PopupBlocker.h b/dom/base/PopupBlocker.h index d6e82151f6c0..b71ff5995f9a 100644 --- a/dom/base/PopupBlocker.h +++ b/dom/base/PopupBlocker.h @@ -7,12 +7,17 @@ #ifndef mozilla_dom_PopupBlocker_h #define mozilla_dom_PopupBlocker_h -#include "mozilla/BasicEvents.h" +#include +#include "mozilla/Attributes.h" +#include "mozilla/TimeStamp.h" +class AutoPopupStatePusherInternal; class nsIPrincipal; namespace mozilla { +class WidgetEvent; namespace dom { +class Event; class PopupBlocker final { public: diff --git a/dom/base/Pose.h b/dom/base/Pose.h index 1373eeb06154..4ca5df1e082e 100644 --- a/dom/base/Pose.h +++ b/dom/base/Pose.h @@ -7,10 +7,11 @@ #ifndef mozilla_dom_Pose_h #define mozilla_dom_Pose_h -#include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class Pose : public nsWrapperCache { diff --git a/dom/base/ResizeObserver.h b/dom/base/ResizeObserver.h index b3a79e016a86..83843b8cf4a8 100644 --- a/dom/base/ResizeObserver.h +++ b/dom/base/ResizeObserver.h @@ -10,7 +10,6 @@ #include "js/TypeDecls.h" #include "mozilla/AppUnits.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/LinkedList.h" #include "mozilla/WritingModes.h" #include "mozilla/dom/DOMRect.h" @@ -26,6 +25,8 @@ #include "nsPIDOMWindow.h" namespace mozilla { +class ErrorResult; + namespace dom { class Element; diff --git a/dom/base/StaticRange.h b/dom/base/StaticRange.h index 6b2669f5e10b..6e8ed1d0d333 100644 --- a/dom/base/StaticRange.h +++ b/dom/base/StaticRange.h @@ -7,7 +7,6 @@ #ifndef mozilla_dom_StaticRange_h #define mozilla_dom_StaticRange_h -#include "mozilla/ErrorResult.h" #include "mozilla/RangeBoundary.h" #include "mozilla/dom/AbstractRange.h" #include "mozilla/dom/StaticRangeBinding.h" @@ -15,6 +14,8 @@ #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class StaticRange final : public AbstractRange { diff --git a/dom/base/StructuredCloneBlob.h b/dom/base/StructuredCloneBlob.h index 45e49f894694..8fc2c00cd999 100644 --- a/dom/base/StructuredCloneBlob.h +++ b/dom/base/StructuredCloneBlob.h @@ -7,19 +7,25 @@ #ifndef mozilla_dom_StructuredCloneBlob_h #define mozilla_dom_StructuredCloneBlob_h -#include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/dom/StructuredCloneHolder.h" -#include "mozilla/dom/StructuredCloneHolderBinding.h" - -#include "jsapi.h" - +#include "js/TypeDecls.h" +#include "mozilla/AlreadyAddRefed.h" #include "mozilla/Maybe.h" +#include "mozilla/RefPtr.h" +#include "mozilla/dom/StructuredCloneHolder.h" #include "nsIMemoryReporter.h" #include "nsISupports.h" +struct JSStructuredCloneReader; +struct JSStructuredCloneWriter; + namespace mozilla { + +class ErrorResult; + namespace dom { +class GlobalObject; + class StructuredCloneBlob final : public nsIMemoryReporter { MOZ_DEFINE_MALLOC_SIZE_OF(MallocSizeOf) diff --git a/dom/base/Text.h b/dom/base/Text.h index a660e6043736..99a64dba2a69 100644 --- a/dom/base/Text.h +++ b/dom/base/Text.h @@ -8,9 +8,10 @@ #define mozilla_dom_Text_h #include "mozilla/dom/CharacterData.h" -#include "mozilla/ErrorResult.h" namespace mozilla { +class ErrorResult; + namespace dom { class Text : public CharacterData { diff --git a/dom/base/nsDOMAttributeMap.h b/dom/base/nsDOMAttributeMap.h index c7066f25bc2e..c30b0898aed5 100644 --- a/dom/base/nsDOMAttributeMap.h +++ b/dom/base/nsDOMAttributeMap.h @@ -12,7 +12,6 @@ #define nsDOMAttributeMap_h #include "mozilla/MemoryReporting.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsRefPtrHashtable.h" #include "nsString.h" @@ -22,6 +21,8 @@ class nsAtom; class nsINode; namespace mozilla { +class ErrorResult; + namespace dom { class Attr; class DocGroup; diff --git a/dom/base/nsDOMSerializer.h b/dom/base/nsDOMSerializer.h index 3b48ced6fe8d..cebf3d9aaa21 100644 --- a/dom/base/nsDOMSerializer.h +++ b/dom/base/nsDOMSerializer.h @@ -8,12 +8,15 @@ #define nsDOMSerializer_h_ #include "mozilla/dom/NonRefcountedDOMObject.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/XMLSerializerBinding.h" class nsINode; class nsIOutputStream; +namespace mozilla { +class ErrorResult; +} + class nsDOMSerializer final : public mozilla::dom::NonRefcountedDOMObject { public: nsDOMSerializer(); diff --git a/dom/base/nsFocusManager.h b/dom/base/nsFocusManager.h index dc817cd55af5..4b276d57b0ab 100644 --- a/dom/base/nsFocusManager.h +++ b/dom/base/nsFocusManager.h @@ -12,7 +12,6 @@ #include "mozilla/dom/Document.h" #include "nsIFocusManager.h" #include "nsIObserver.h" -#include "nsIWidget.h" #include "nsWeakReference.h" #include "mozilla/Attributes.h" #include "mozilla/RefPtr.h" diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index 48ae9b65f897..1244e1adad2a 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -4,169 +4,304 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "nsGlobalWindow.h" +#include "nsGlobalWindowInner.h" -#include - -#include "mozilla/MemoryReporting.h" - -// Local Includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "AudioChannelService.h" #include "AutoplayPolicy.h" +#include "Crypto.h" +#include "GeckoProfiler.h" +#include "MainThreadUtils.h" #include "Navigator.h" -#include "nsContentSecurityManager.h" -#include "nsScreen.h" -#include "nsHistory.h" -#include "nsDOMNavigationTiming.h" -#include "nsIDOMStorageManager.h" +#include "PaintWorkletImpl.h" +#include "SessionStorageCache.h" +#include "Units.h" +#include "VRManagerChild.h" +#include "WindowDestroyedEvent.h" +#include "WindowNamedPropertiesHandler.h" +#include "js/ComparisonOperators.h" +#include "js/CompileOptions.h" +#include "js/Id.h" +#include "js/PropertyDescriptor.h" +#include "js/RealmOptions.h" +#include "js/RootingAPI.h" +#include "js/TypeDecls.h" +#include "js/Value.h" +#include "js/Warnings.h" +#include "js/shadow/String.h" +#include "jsapi.h" +#include "jsfriendapi.h" +#include "mozIDOMWindow.h" +#include "moz_external_vr.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/ArrayIterator.h" +#include "mozilla/ArrayUtils.h" +#include "mozilla/Attributes.h" +#include "mozilla/BaseProfilerMarkersPrerequisites.h" +#include "mozilla/BasicEvents.h" +#include "mozilla/CallState.h" +#include "mozilla/CycleCollectedJSContext.h" +#include "mozilla/DOMEventTargetHelper.h" +#include "mozilla/ErrorResult.h" +#include "mozilla/EventDispatcher.h" +#include "mozilla/EventListenerManager.h" +#include "mozilla/EventQueue.h" +#include "mozilla/FloatingPoint.h" +#include "mozilla/FlushType.h" +#include "mozilla/Likely.h" +#include "mozilla/LinkedList.h" +#include "mozilla/Logging.h" +#include "mozilla/MacroForEach.h" +#include "mozilla/Maybe.h" +#include "mozilla/OwningNonNull.h" +#include "mozilla/PermissionDelegateHandler.h" +#include "mozilla/Preferences.h" +#include "mozilla/PresShell.h" +#include "mozilla/ProcessHangMonitor.h" +#include "mozilla/RefPtr.h" +#include "mozilla/Result.h" +#include "mozilla/ScopeExit.h" +#include "mozilla/ScrollOrigin.h" +#include "mozilla/ScrollTypes.h" +#include "mozilla/Services.h" +#include "mozilla/SizeOfState.h" +#include "mozilla/Span.h" +#include "mozilla/SpinEventLoopUntil.h" +#include "mozilla/Sprintf.h" +#include "mozilla/StaticPrefs_browser.h" +#include "mozilla/StaticPrefs_dom.h" +#include "mozilla/StorageAccess.h" +#include "mozilla/TaskCategory.h" +#include "mozilla/Telemetry.h" +#include "mozilla/TelemetryHistogramEnums.h" +#include "mozilla/TimeStamp.h" +#include "mozilla/UniquePtr.h" +#include "mozilla/Unused.h" +#include "mozilla/dom/AudioContext.h" +#include "mozilla/dom/BarProps.h" +#include "mozilla/dom/BindingDeclarations.h" +#include "mozilla/dom/BindingUtils.h" +#include "mozilla/dom/BrowserChild.h" +#include "mozilla/dom/BrowsingContext.h" +#include "mozilla/dom/CSPEvalChecker.h" #include "mozilla/dom/CallbackDebuggerNotification.h" -#include "mozilla/dom/ContentChild.h" +#include "mozilla/dom/ChromeMessageBroadcaster.h" +#include "mozilla/dom/ClientInfo.h" +#include "mozilla/dom/ClientManager.h" +#include "mozilla/dom/ClientSource.h" +#include "mozilla/dom/ClientState.h" +#include "mozilla/dom/ClientsBinding.h" +#include "mozilla/dom/Console.h" #include "mozilla/dom/ContentFrameMessageManager.h" #include "mozilla/dom/ContentMediaController.h" -#include "mozilla/dom/ContentParent.h" -#include "mozilla/dom/CSPEvalChecker.h" #include "mozilla/dom/CustomElementRegistry.h" -#include "mozilla/dom/DebuggerNotification.h" -#include "mozilla/dom/DocumentInlines.h" #include "mozilla/dom/DOMJSProxyHandler.h" +#include "mozilla/dom/DebuggerNotification.h" +#include "mozilla/dom/DebuggerNotificationBinding.h" +#include "mozilla/dom/DebuggerNotificationManager.h" +#include "mozilla/dom/DispatcherTrait.h" +#include "mozilla/dom/DocGroup.h" +#include "mozilla/dom/Document.h" +#include "mozilla/dom/DocumentInlines.h" +#include "mozilla/dom/Element.h" +#include "mozilla/dom/Event.h" #include "mozilla/dom/EventTarget.h" +#include "mozilla/dom/Fetch.h" +#include "mozilla/dom/Gamepad.h" +#include "mozilla/dom/GamepadManager.h" +#include "mozilla/dom/HashChangeEvent.h" +#include "mozilla/dom/HashChangeEventBinding.h" +#include "mozilla/dom/IDBFactory.h" +#include "mozilla/dom/IdleRequest.h" +#include "mozilla/dom/ImageBitmap.h" +#include "mozilla/dom/ImageBitmapSource.h" +#include "mozilla/dom/InstallTriggerBinding.h" +#include "mozilla/dom/IntlUtils.h" +#include "mozilla/dom/LSObject.h" +#include "mozilla/dom/LoadedScript.h" #include "mozilla/dom/LocalStorage.h" #include "mozilla/dom/LocalStorageCommon.h" -#include "mozilla/dom/LSObject.h" +#include "mozilla/dom/Location.h" +#include "mozilla/dom/NavigatorBinding.h" +#include "mozilla/dom/Nullable.h" #include "mozilla/dom/PartitionedLocalStorage.h" -#include "mozilla/dom/Storage.h" -#include "mozilla/dom/IdleRequest.h" #include "mozilla/dom/Performance.h" +#include "mozilla/dom/PopStateEvent.h" +#include "mozilla/dom/PopStateEventBinding.h" +#include "mozilla/dom/PopupBlocker.h" +#include "mozilla/dom/PrimitiveConversions.h" +#include "mozilla/dom/Promise.h" +#include "mozilla/dom/RootedDictionary.h" #include "mozilla/dom/ScriptLoader.h" +#include "mozilla/dom/ScriptSettings.h" +#include "mozilla/dom/ServiceWorker.h" +#include "mozilla/dom/ServiceWorkerDescriptor.h" +#include "mozilla/dom/ServiceWorkerRegistration.h" #include "mozilla/dom/SessionStorageManager.h" +#include "mozilla/dom/SharedWorker.h" +#include "mozilla/dom/Storage.h" #include "mozilla/dom/StorageEvent.h" #include "mozilla/dom/StorageEventBinding.h" #include "mozilla/dom/StorageNotifierService.h" #include "mozilla/dom/StorageUtils.h" +#include "mozilla/dom/TabMessageTypes.h" #include "mozilla/dom/Timeout.h" #include "mozilla/dom/TimeoutHandler.h" #include "mozilla/dom/TimeoutManager.h" +#include "mozilla/dom/ToJSValue.h" +#include "mozilla/dom/U2F.h" +#include "mozilla/dom/VRDisplay.h" +#include "mozilla/dom/VRDisplayEvent.h" +#include "mozilla/dom/VRDisplayEventBinding.h" +#include "mozilla/dom/VREventObserver.h" #include "mozilla/dom/VisualViewport.h" -#include "mozilla/dom/WindowProxyHolder.h" -#ifdef MOZ_GLEAN -# include "mozilla/glean/Glean.h" -#endif -#include "mozilla/IntegerPrintfMacros.h" -#include "mozilla/Result.h" -#if defined(MOZ_WIDGET_ANDROID) -# include "mozilla/dom/WindowOrientationObserver.h" -#endif -#include "nsDOMOfflineResourceList.h" -#include "nsICookieService.h" -#include "nsError.h" -#include "nsISizeOfEventTarget.h" -#include "nsDOMJSUtils.h" -#include "nsArrayUtils.h" #include "mozilla/dom/WakeLock.h" -#include "mozilla/dom/power/PowerManagerService.h" +#include "mozilla/dom/WebIDLGlobalNameHash.h" +#include "mozilla/dom/WindowBinding.h" +#include "mozilla/dom/WindowContext.h" +#include "mozilla/dom/WindowGlobalChild.h" +#include "mozilla/dom/WindowProxyHolder.h" +#include "mozilla/dom/WorkerCommon.h" +#include "mozilla/dom/Worklet.h" +#include "mozilla/dom/XRPermissionRequest.h" +#include "mozilla/dom/cache/CacheStorage.h" +#include "mozilla/dom/cache/Types.h" +#include "mozilla/fallible.h" +#include "mozilla/gfx/BasePoint.h" +#include "mozilla/gfx/BaseRect.h" +#include "mozilla/gfx/BaseSize.h" +#include "mozilla/gfx/Rect.h" +#include "mozilla/gfx/Types.h" +#include "mozilla/intl/LocaleService.h" +#include "mozilla/net/CookieJarSettings.h" +#include "nsAtom.h" +#include "nsBaseHashtable.h" +#include "nsCCUncollectableMarker.h" +#include "nsCOMPtr.h" +#include "nsCRT.h" +#include "nsCRTGlue.h" +#include "nsCanvasFrame.h" +#include "nsCharTraits.h" +#include "nsCheapSets.h" +#include "nsContentUtils.h" +#include "nsCoord.h" +#include "nsCycleCollectionNoteChild.h" +#include "nsCycleCollectionTraversalCallback.h" +#include "nsDOMNavigationTiming.h" +#include "nsDOMOfflineResourceList.h" +#include "nsDebug.h" +#include "nsDocShell.h" +#include "nsFocusManager.h" +#include "nsFrameMessageManager.h" +#include "nsGkAtoms.h" +#include "nsGlobalWindowOuter.h" +#include "nsHashKeys.h" +#include "nsHistory.h" +#include "nsIAddonPolicyService.h" +#include "nsIArray.h" +#include "nsIBaseWindow.h" +#include "nsIBrowserChild.h" +#include "nsICancelableRunnable.h" +#include "nsIChannel.h" #include "nsIContentSecurityPolicy.h" +#include "nsIControllers.h" +#include "nsICookieJarSettings.h" +#include "nsICookieService.h" +#include "nsID.h" +#include "nsIDOMStorageManager.h" +#include "nsIDeviceSensors.h" +#include "nsIDocShell.h" +#include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeOwner.h" #include "nsIDocumentLoader.h" -#include "nsIInterfaceRequestorUtils.h" -#include "nsIScriptContext.h" -#include "nsIController.h" -#include "nsISlowScriptDebug.h" -#include "nsWindowMemoryReporter.h" -#include "nsWindowSizes.h" -#include "WindowNamedPropertiesHandler.h" -#include "nsFrameSelection.h" -#include "nsNetUtil.h" -#include "nsVariant.h" -#include "nsPrintfCString.h" -#include "mozilla/intl/LocaleService.h" -#include "WindowDestroyedEvent.h" - -// Helper Classes -#include "nsJSUtils.h" -#include "jsapi.h" -#include "jsfriendapi.h" -#include "js/Warnings.h" // JS::WarnASCII -#include "js/Wrapper.h" -#include "nsCharSeparatedTokenizer.h" -#include "nsReadableUtils.h" -#include "nsJSEnvironment.h" -#include "mozilla/dom/ScriptSettings.h" -#include "mozilla/Preferences.h" -#include "mozilla/Likely.h" -#include "mozilla/SpinEventLoopUntil.h" -#include "mozilla/Sprintf.h" -#include "mozilla/StorageAccess.h" -#include "mozilla/Unused.h" - -// Other Classes -#include "mozilla/dom/BarProps.h" -#include "nsContentCID.h" -#include "nsLayoutStatics.h" -#include "nsCCUncollectableMarker.h" -#include "mozilla/dom/WorkerCommon.h" -#include "mozilla/dom/ToJSValue.h" -#include "nsJSPrincipals.h" -#include "mozilla/Attributes.h" -#include "mozilla/Debug.h" -#include "mozilla/EventListenerManager.h" -#include "mozilla/EventStates.h" -#include "mozilla/MouseEvents.h" -#include "mozilla/PresShell.h" -#include "mozilla/ProcessHangMonitor.h" -#include "mozilla/ScrollTypes.h" -#include "mozilla/ThrottledEventQueue.h" -#include "AudioChannelService.h" -#include "nsAboutProtocolUtils.h" -#include "nsCharTraits.h" // NS_IS_HIGH/LOW_SURROGATE -#include "PostMessageEvent.h" -#include "mozilla/dom/DocGroup.h" -#include "mozilla/StaticPrefs_browser.h" -#include "mozilla/StaticPrefs_dom.h" -#include "PaintWorkletImpl.h" - -// Interfaces Needed +#include "nsIDragService.h" +#include "nsIFocusManager.h" #include "nsIFrame.h" -#include "nsCanvasFrame.h" +#include "nsIGlobalObject.h" +#include "nsIIOService.h" +#include "nsIIdleRunnable.h" +#include "nsIInterfaceRequestorUtils.h" +#include "nsILoadContext.h" +#include "nsILoadGroup.h" +#include "nsILoadInfo.h" +#include "nsINamed.h" +#include "nsINode.h" +#include "nsIObserver.h" +#include "nsIObserverService.h" +#include "nsIPermission.h" +#include "nsIPermissionManager.h" +#include "nsIPrefBranch.h" +#include "nsIPrincipal.h" +#include "nsIPrompt.h" +#include "nsIRunnable.h" +#include "nsIScreen.h" +#include "nsIScreenManager.h" +#include "nsIScriptContext.h" +#include "nsIScriptGlobalObject.h" +#include "nsIScriptObjectPrincipal.h" +#include "nsIScrollableFrame.h" +#include "nsISerialEventTarget.h" +#include "nsISimpleEnumerator.h" +#include "nsISizeOfEventTarget.h" +#include "nsISlowScriptDebug.h" +#include "nsISupportsUtils.h" +#include "nsIThread.h" +#include "nsITimedChannel.h" +#include "nsIURI.h" +#include "nsIVariant.h" +#include "nsIWeakReference.h" +#include "nsIWebBrowserChrome.h" +#include "nsIWebNavigation.h" +#include "nsIWebProgressListener.h" #include "nsIWidget.h" #include "nsIWidgetListener.h" -#include "nsIBaseWindow.h" -#include "nsIDeviceSensors.h" -#include "nsIContent.h" -#include "nsIDocShell.h" -#include "mozilla/dom/Document.h" -#include "Crypto.h" -#include "nsDOMString.h" -#include "nsThreadUtils.h" -#include "nsILoadContext.h" -#include "nsIScrollableFrame.h" -#include "nsView.h" -#include "nsViewManager.h" -#include "nsIPrompt.h" -#include "nsIAddonPolicyService.h" -#include "nsIWebNavigation.h" -#include "nsIWebBrowserChrome.h" -#include "nsDOMCID.h" -#include "nsDOMWindowUtils.h" -#include "nsIControllers.h" -#include "nsGlobalWindowCommands.h" +#include "nsJSPrincipals.h" +#include "nsJSUtils.h" +#include "nsLayoutStatics.h" +#include "nsLiteralString.h" +#include "nsNetUtil.h" +#include "nsPIDOMWindow.h" +#include "nsPIDOMWindowInlines.h" +#include "nsPIWindowRoot.h" +#include "nsPoint.h" +#include "nsPresContext.h" #include "nsQueryObject.h" -#include "nsContentUtils.h" -#include "nsCSSProps.h" -#include "mozilla/EventDispatcher.h" -#include "mozilla/EventStateManager.h" -#include "nsIObserverService.h" -#include "nsFocusManager.h" -#include "nsITimedChannel.h" +#include "nsRefPtrHashtable.h" +#include "nsSandboxFlags.h" +#include "nsScreen.h" #include "nsServiceManagerUtils.h" +#include "nsString.h" +#include "nsStringFlags.h" +#include "nsStringFwd.h" +#include "nsTArray.h" +#include "nsTLiteralString.h" +#include "nsTObserverArray.h" +#include "nsTStringRepr.h" +#include "nsThreadUtils.h" +#include "nsWeakReference.h" +#include "nsWindowMemoryReporter.h" +#include "nsWindowSizes.h" +#include "nsWrapperCache.h" +#include "nsWrapperCacheInlines.h" +#include "nsXULAppAPI.h" +#include "nsrootidl.h" +#include "prclist.h" +#include "prtypes.h" +#include "xpcprivate.h" +#include "xpcpublic.h" + #ifdef MOZ_XUL # include "nsIDOMXULControlElement.h" # include "nsMenuPopupFrame.h" #endif -#include "mozilla/dom/CustomEvent.h" -#include "nsIScreenManager.h" -#include "nsICSSDeclaration.h" -#include "nsIPermission.h" - -#include "xpcprivate.h" #ifdef NS_PRINTING # include "nsIPrintSettings.h" @@ -174,72 +309,6 @@ # include "nsIWebBrowserPrint.h" #endif -#include "nsWindowRoot.h" -#include "nsNetCID.h" -#include "nsIArray.h" - -#include "nsIDragService.h" -#include "mozilla/dom/Element.h" -#include "mozilla/dom/Selection.h" -#include "nsFrameLoader.h" -#include "nsXPCOMCID.h" -#include "mozilla/Logging.h" -#include "prenv.h" - -#include "mozilla/dom/IDBFactory.h" -#include "mozilla/dom/MessageChannel.h" -#include "mozilla/dom/Promise.h" - -#include "mozilla/dom/Gamepad.h" -#include "mozilla/dom/GamepadManager.h" - -#include "gfxVR.h" -#include "mozilla/dom/VRDisplay.h" -#include "mozilla/dom/VRDisplayEvent.h" -#include "mozilla/dom/VRDisplayEventBinding.h" -#include "mozilla/dom/VREventObserver.h" -#include "mozilla/dom/XRPermissionRequest.h" - -#include "nsRefreshDriver.h" -#include "Layers.h" - -#include "mozilla/BasePrincipal.h" -#include "mozilla/Services.h" -#include "mozilla/Telemetry.h" -#include "mozilla/dom/Location.h" -#include "nsHTMLDocument.h" -#include "nsWrapperCacheInlines.h" -#include "mozilla/DOMEventTargetHelper.h" -#include "prrng.h" -#include "nsSandboxFlags.h" -#include "mozilla/dom/AudioContext.h" -#include "mozilla/dom/BrowserElementDictionariesBinding.h" -#include "mozilla/dom/cache/CacheStorage.h" -#include "mozilla/dom/Console.h" -#include "mozilla/dom/Fetch.h" -#include "mozilla/dom/FunctionBinding.h" -#include "mozilla/dom/HashChangeEvent.h" -#include "mozilla/dom/IntlUtils.h" -#include "mozilla/dom/PopStateEvent.h" -#include "mozilla/dom/PopupBlocker.h" -#include "mozilla/dom/PopupBlockedEvent.h" -#include "mozilla/dom/PrimitiveConversions.h" -#include "mozilla/dom/WindowBinding.h" -#include "nsIBrowserChild.h" -#include "mozilla/dom/LoadedScript.h" -#include "mozilla/dom/MediaQueryList.h" -#include "mozilla/dom/ScriptSettings.h" -#include "mozilla/dom/NavigatorBinding.h" -#include "mozilla/dom/ImageBitmap.h" -#include "mozilla/dom/ImageBitmapBinding.h" -#include "mozilla/dom/InstallTriggerBinding.h" -#include "mozilla/dom/SharedWorker.h" -#include "mozilla/dom/ServiceWorker.h" -#include "mozilla/dom/ServiceWorkerRegistration.h" -#include "mozilla/dom/ServiceWorkerRegistrationDescriptor.h" -#include "mozilla/dom/U2F.h" -#include "mozilla/dom/WebIDLGlobalNameHash.h" -#include "mozilla/dom/Worklet.h" #ifdef HAVE_SIDEBAR # include "mozilla/dom/ExternalBinding.h" #endif @@ -248,23 +317,16 @@ # include "mozilla/dom/SpeechSynthesis.h" #endif -#include "mozilla/dom/ClientManager.h" -#include "mozilla/dom/ClientSource.h" -#include "mozilla/dom/ClientState.h" - -#include "mozilla/dom/WindowGlobalChild.h" -#include "mozilla/dom/BrowserChild.h" - -#include "mozilla/net/CookieJarSettings.h" - -#include "AccessCheck.h" -#include "SessionStorageCache.h" - #ifdef ANDROID # include #endif +#ifdef MOZ_WIDGET_ANDROID +# include "mozilla/dom/WindowOrientationObserver.h" +#endif + #ifdef XP_WIN +# include "mozilla/Debug.h" # include # define getpid _getpid #else diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h index 01e7f7b90efe..1ca89bddde98 100644 --- a/dom/base/nsGlobalWindowInner.h +++ b/dom/base/nsGlobalWindowInner.h @@ -41,7 +41,6 @@ #include "mozilla/dom/StorageEventBinding.h" #include "mozilla/dom/UnionTypes.h" #include "mozilla/CallState.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Attributes.h" #include "mozilla/LinkedList.h" #include "mozilla/OwningNonNull.h" @@ -98,6 +97,8 @@ class PromiseDocumentFlushedResolver; namespace mozilla { class AbstractThread; +class ErrorResult; + namespace dom { class BarProp; class BrowsingContext; diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h index 17eede45a1cc..10c915229479 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h @@ -39,7 +39,6 @@ #include "mozilla/dom/StorageEvent.h" #include "mozilla/dom/StorageEventBinding.h" #include "mozilla/dom/UnionTypes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Attributes.h" #include "mozilla/LinkedList.h" #include "nsWrapperCacheInlines.h" @@ -84,6 +83,7 @@ class nsWindowSizes; namespace mozilla { class AbstractThread; class DOMEventTargetHelper; +class ErrorResult; class ThrottledEventQueue; namespace dom { class BarProp; diff --git a/dom/base/nsHistory.h b/dom/base/nsHistory.h index 0f96a4a8cc30..2ee68df727e3 100644 --- a/dom/base/nsHistory.h +++ b/dom/base/nsHistory.h @@ -7,7 +7,6 @@ #define nsHistory_h___ #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/HistoryBinding.h" #include "mozilla/dom/ChildSHistory.h" #include "nsCOMPtr.h" @@ -22,6 +21,10 @@ class nsISHistory; class nsIWeakReference; class nsPIDOMWindowInner; +namespace mozilla { +class ErrorResult; +} + // Script "History" object class nsHistory final : public nsISupports, public nsWrapperCache { public: diff --git a/dom/base/nsIDocumentObserver.h b/dom/base/nsIDocumentObserver.h index f278b3c13d20..6bf08fce9146 100644 --- a/dom/base/nsIDocumentObserver.h +++ b/dom/base/nsIDocumentObserver.h @@ -6,13 +6,13 @@ #ifndef nsIDocumentObserver_h___ #define nsIDocumentObserver_h___ -#include "mozilla/EventStates.h" -#include "mozilla/StyleSheet.h" #include "nsISupports.h" #include "nsIMutationObserver.h" class nsIContent; namespace mozilla { +class EventStates; + namespace dom { class Document; } diff --git a/dom/base/nsImageLoadingContent.h b/dom/base/nsImageLoadingContent.h index 764b3ec3bf90..ec4286bed950 100644 --- a/dom/base/nsImageLoadingContent.h +++ b/dom/base/nsImageLoadingContent.h @@ -21,7 +21,6 @@ #include "nsIContentPolicy.h" #include "nsIImageLoadingContent.h" #include "nsIRequest.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/Promise.h" #include "nsAttrValue.h" @@ -35,6 +34,8 @@ class imgRequestProxy; namespace mozilla { class AsyncEventDispatcher; +class ErrorResult; + namespace dom { struct BindContext; class Document; diff --git a/dom/base/nsJSUtils.h b/dom/base/nsJSUtils.h index dd1bc7262365..f5c8ebb5755c 100644 --- a/dom/base/nsJSUtils.h +++ b/dom/base/nsJSUtils.h @@ -15,8 +15,6 @@ */ #include "mozilla/Assertions.h" -#include "mozilla/StaticPrefs_dom.h" -#include "mozilla/Utf8.h" // mozilla::Utf8Unit #include "GeckoProfiler.h" #include "jsapi.h" @@ -34,6 +32,8 @@ class nsIScriptGlobalObject; class nsXBLPrototypeBinding; namespace mozilla { +union Utf8Unit; + namespace dom { class AutoJSAPI; class Element; diff --git a/dom/base/nsTraversal.h b/dom/base/nsTraversal.h index d340f5cae050..801e4a291cce 100644 --- a/dom/base/nsTraversal.h +++ b/dom/base/nsTraversal.h @@ -13,11 +13,14 @@ #include "nsCOMPtr.h" #include "mozilla/dom/CallbackObject.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/NodeFilterBinding.h" class nsINode; +namespace mozilla { +class ErrorResult; +} + class nsTraversal { public: nsTraversal(nsINode* aRoot, uint32_t aWhatToShow, diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h index acb7c34100ea..88c170acb359 100644 --- a/dom/base/nsWrapperCache.h +++ b/dom/base/nsWrapperCache.h @@ -10,8 +10,6 @@ #include "nsCycleCollectionParticipant.h" #include "mozilla/Assertions.h" #include "js/HeapAPI.h" -#include "js/Id.h" // must come before js/RootingAPI.h -#include "js/Value.h" // must come before js/RootingAPI.h #include "js/RootingAPI.h" #include "js/TracingAPI.h" #include "jsfriendapi.h" diff --git a/dom/bindings/CallbackObject.h b/dom/bindings/CallbackObject.h index 883da716f5ed..296402920141 100644 --- a/dom/bindings/CallbackObject.h +++ b/dom/bindings/CallbackObject.h @@ -17,28 +17,47 @@ #ifndef mozilla_dom_CallbackObject_h #define mozilla_dom_CallbackObject_h -#include "nsISupports.h" -#include "nsISupportsImpl.h" -#include "nsCycleCollectionParticipant.h" +#include +#include +#include +#include "js/RootingAPI.h" #include "js/Wrapper.h" -#include "mozilla/Assertions.h" -#include "mozilla/ErrorResult.h" -#include "mozilla/HoldDropJSObjects.h" -#include "mozilla/MemoryReporting.h" -#include "mozilla/OwningNonNull.h" -#include "mozilla/dom/ScriptSettings.h" -#include "mozilla/dom/BindingCallContext.h" -#include "nsWrapperCache.h" -#include "nsJSEnvironment.h" -#include "xpcpublic.h" #include "jsapi.h" -#include "js/ContextOptions.h" -#include "js/Object.h" // JS::GetCompartment -#include "js/TracingAPI.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" +#include "mozilla/HoldDropJSObjects.h" +#include "mozilla/Maybe.h" +#include "mozilla/MemoryReporting.h" +#include "mozilla/RefPtr.h" +#include "mozilla/dom/BindingCallContext.h" +#include "mozilla/dom/ScriptSettings.h" +#include "nsCOMPtr.h" +#include "nsCycleCollectionParticipant.h" +#include "nsID.h" +#include "nsIGlobalObject.h" +#include "nsISupports.h" +#include "nsISupportsUtils.h" +#include "nsStringFwd.h" + +class JSAutoRealm; +class JSObject; +class JSTracer; +class nsCycleCollectionTraversalCallback; +struct JSContext; + +namespace JS { +class AutoSetAsyncStackForNewCalls; +class Realm; +class Value; +} // namespace JS namespace mozilla { +class ErrorResult; class PromiseJobRunnable; +template +class OwningNonNull; namespace dom { diff --git a/dom/bindings/IterableIterator.h b/dom/bindings/IterableIterator.h index 27aa2d6734fd..590c70e3ac0c 100644 --- a/dom/bindings/IterableIterator.h +++ b/dom/bindings/IterableIterator.h @@ -27,14 +27,12 @@ #ifndef mozilla_dom_IterableIterator_h #define mozilla_dom_IterableIterator_h +#include "js/TypeDecls.h" +#include "js/Value.h" #include "nsISupports.h" -#include "nsWrapperCache.h" -#include "nsPIDOMWindow.h" -#include "nsCOMPtr.h" +#include "mozilla/dom/IterableIteratorBinding.h" #include "mozilla/dom/RootedDictionary.h" #include "mozilla/dom/ToJSValue.h" -#include "js/Wrapper.h" -#include "mozilla/dom/IterableIteratorBinding.h" namespace mozilla { namespace dom { diff --git a/dom/bindings/PrimitiveConversions.h b/dom/bindings/PrimitiveConversions.h index e25b5b374481..c6f0daee1c69 100644 --- a/dom/bindings/PrimitiveConversions.h +++ b/dom/bindings/PrimitiveConversions.h @@ -18,7 +18,6 @@ #include "jsapi.h" #include "js/Conversions.h" #include "mozilla/Assertions.h" -#include "mozilla/ErrorResult.h" #include "mozilla/FloatingPoint.h" #include "mozilla/dom/BindingCallContext.h" diff --git a/dom/bindings/ToJSValue.h b/dom/bindings/ToJSValue.h index 97177d6503e6..63866f06cac0 100644 --- a/dom/bindings/ToJSValue.h +++ b/dom/bindings/ToJSValue.h @@ -7,24 +7,37 @@ #ifndef mozilla_dom_ToJSValue_h #define mozilla_dom_ToJSValue_h -#include "mozilla/Assertions.h" -#include "mozilla/UniquePtr.h" -#include "mozilla/dom/BindingUtils.h" -#include "mozilla/dom/CallbackObject.h" -#include "mozilla/dom/NonRefcountedDOMObject.h" -#include "mozilla/dom/TypedArray.h" -#include "jsapi.h" -#include "js/Array.h" // JS::NewArrayObject -#include "nsISupports.h" -#include "nsTArray.h" -#include "nsWrapperCache.h" -#include +#include // for size_t +#include // for int32_t, int64_t, uint32_t, uint64_t +#include // for is_base_of, enable_if_t, enable_if, is_pointer, is_same, void_t +#include // for forward +#include "ErrorList.h" // for nsresult +#include "js/Array.h" // for NewArrayObject +#include "js/GCVector.h" // for RootedVector, MutableWrappedPtrOperations +#include "js/RootingAPI.h" // for MutableHandle, Rooted, Handle, Heap +#include "js/Value.h" // for Value +#include "js/ValueArray.h" // for HandleValueArray +#include "jsapi.h" // for CurrentGlobalOrNull +#include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT, MOZ_ASSERT_HELPER1 +#include "mozilla/Attributes.h" // for MOZ_MUST_USE +#include "mozilla/UniquePtr.h" // for UniquePtr +#include "mozilla/Unused.h" // for Unused +#include "mozilla/dom/BindingUtils.h" // for MaybeWrapValue, MaybeWrapObjectOrNullValue, XPCOMObjectToJsval, GetOrCreateDOMReflector +#include "mozilla/dom/CallbackObject.h" // for CallbackObject +#include "nsID.h" // for NS_GET_TEMPLATE_IID, nsIID +#include "nsISupports.h" // for nsISupports +#include "nsStringFwd.h" // for nsAString +#include "nsTArrayForwardDeclare.h" +#include "xpcObjectHelper.h" // for xpcObjectHelper namespace mozilla { namespace dom { +class CallbackObject; class Promise; class WindowProxyHolder; +template +class TypedArrayCreator; // If ToJSValue returns false, it must set an exception on the // JSContext. diff --git a/dom/bindings/test/WrapperCachedNonISupportsTestInterface.h b/dom/bindings/test/WrapperCachedNonISupportsTestInterface.h index 45d563190f98..0b986325b2a3 100644 --- a/dom/bindings/test/WrapperCachedNonISupportsTestInterface.h +++ b/dom/bindings/test/WrapperCachedNonISupportsTestInterface.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" diff --git a/dom/cache/ReadStream.h b/dom/cache/ReadStream.h index 7a2e4b5b82e9..21c838099ead 100644 --- a/dom/cache/ReadStream.h +++ b/dom/cache/ReadStream.h @@ -7,7 +7,6 @@ #ifndef mozilla_dom_cache_ReadStream_h #define mozilla_dom_cache_ReadStream_h -#include "mozilla/ErrorResult.h" #include "mozilla/dom/SafeRefPtr.h" #include "mozilla/ipc/FileDescriptor.h" #include "mozilla/RefPtr.h" @@ -18,6 +17,8 @@ #include "nsTArrayForwardDeclare.h" namespace mozilla { +class ErrorResult; + namespace ipc { class AutoIPCStream; } // namespace ipc diff --git a/dom/canvas/CanvasPath.h b/dom/canvas/CanvasPath.h index 7c31a1180b08..7e109a96b505 100644 --- a/dom/canvas/CanvasPath.h +++ b/dom/canvas/CanvasPath.h @@ -10,9 +10,10 @@ #include "nsWrapperCache.h" #include "mozilla/gfx/2D.h" #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/ErrorResult.h" namespace mozilla { +class ErrorResult; + namespace dom { enum class CanvasWindingRule : uint8_t; diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h index 07b619491da0..211de441b360 100644 --- a/dom/canvas/CanvasRenderingContext2D.h +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -13,7 +13,6 @@ #include "mozilla/gfx/2D.h" #include "mozilla/Attributes.h" #include "mozilla/EnumeratedArray.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" #include "mozilla/SurfaceFromElementResult.h" #include "mozilla/UniquePtr.h" @@ -28,6 +27,7 @@ class nsGlobalWindowInner; class nsXULElement; namespace mozilla { +class ErrorResult; class PresShell; namespace gl { diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h index 0537222476cc..9bc03fcf2e11 100644 --- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -20,7 +20,6 @@ #include "mozilla/dom/Nullable.h" #include "mozilla/dom/TypedArray.h" #include "mozilla/EnumeratedArray.h" -#include "mozilla/ErrorResult.h" #include "mozilla/gfx/2D.h" #include "mozilla/Mutex.h" #include "mozilla/UniquePtr.h" diff --git a/dom/clients/api/ClientDOMUtil.h b/dom/clients/api/ClientDOMUtil.h index d71ad6f65fe3..485e6f6c07ac 100644 --- a/dom/clients/api/ClientDOMUtil.h +++ b/dom/clients/api/ClientDOMUtil.h @@ -10,7 +10,6 @@ #include "mozilla/dom/ClientOpPromise.h" #include "mozilla/dom/DOMMozPromiseRequestHolder.h" #include "mozilla/dom/WorkerPrivate.h" -#include "mozilla/ErrorResult.h" class nsIGlobalObject; diff --git a/dom/clients/manager/ClientHandleParent.h b/dom/clients/manager/ClientHandleParent.h index 5f2a7e842b03..3b0219a48082 100644 --- a/dom/clients/manager/ClientHandleParent.h +++ b/dom/clients/manager/ClientHandleParent.h @@ -7,7 +7,6 @@ #define _mozilla_dom_ClientHandleParent_h #include "mozilla/dom/PClientHandleParent.h" -#include "mozilla/ErrorResult.h" namespace mozilla { namespace dom { diff --git a/dom/clients/manager/ClientInfo.h b/dom/clients/manager/ClientInfo.h index 649b42b1c4f3..fd5f874b09f5 100644 --- a/dom/clients/manager/ClientInfo.h +++ b/dom/clients/manager/ClientInfo.h @@ -8,10 +8,14 @@ #define _mozilla_dom_ClientInfo_h #include "X11UndefineNone.h" -#include "mozilla/dom/ClientBinding.h" #include "mozilla/Maybe.h" #include "mozilla/TimeStamp.h" #include "mozilla/UniquePtr.h" +#include "nsCOMPtr.h" +#include "nsString.h" + +class nsIPrincipal; +struct nsID; namespace mozilla { @@ -23,6 +27,8 @@ class PrincipalInfo; namespace dom { class IPCClientInfo; +enum class FrameType : uint8_t; +enum class ClientType : uint8_t; // This class provides a simple structure that represents a global living // in the system. Its thread safe and can be transferred across process diff --git a/dom/clients/manager/ClientOpPromise.h b/dom/clients/manager/ClientOpPromise.h index 150c6494daf7..3658a8aabc82 100644 --- a/dom/clients/manager/ClientOpPromise.h +++ b/dom/clients/manager/ClientOpPromise.h @@ -6,10 +6,11 @@ #ifndef _mozilla_dom_ClientOpPromise_h #define _mozilla_dom_ClientOpPromise_h -#include "mozilla/ErrorResult.h" #include "mozilla/MozPromise.h" namespace mozilla { +class CopyableErrorResult; + namespace dom { class ClientOpResult; diff --git a/dom/console/Console.h b/dom/console/Console.h index 9c028c7f5380..05d83c365a7e 100644 --- a/dom/console/Console.h +++ b/dom/console/Console.h @@ -7,19 +7,18 @@ #ifndef mozilla_dom_Console_h #define mozilla_dom_Console_h +#include "domstubs.h" #include "mozilla/dom/ConsoleBinding.h" -#include "mozilla/JSObjectHolder.h" #include "mozilla/TimeStamp.h" #include "nsCycleCollectionParticipant.h" #include "nsDataHashtable.h" #include "nsHashKeys.h" #include "nsIObserver.h" #include "nsWeakReference.h" -#include "nsDOMNavigationTiming.h" -#include "nsPIDOMWindow.h" class nsIConsoleAPIStorage; -class nsIPrincipal; +class nsIGlobalObject; +class nsPIDOMWindowInner; class nsIStackFrame; namespace mozilla { @@ -28,7 +27,6 @@ namespace dom { class AnyCallback; class ConsoleCallData; class ConsoleInstance; -class ConsoleInstanceDumpCallback; class ConsoleRunnable; class ConsoleCallDataRunnable; class ConsoleProfileRunnable; diff --git a/dom/events/DataTransferItem.h b/dom/events/DataTransferItem.h index f80b358493cc..48c6784f7df7 100644 --- a/dom/events/DataTransferItem.h +++ b/dom/events/DataTransferItem.h @@ -7,12 +7,13 @@ #ifndef mozilla_dom_DataTransferItem_h #define mozilla_dom_DataTransferItem_h -#include "mozilla/ErrorResult.h" #include "mozilla/dom/DataTransfer.h" #include "mozilla/dom/DOMString.h" #include "mozilla/dom/File.h" namespace mozilla { +class ErrorResult; + namespace dom { class FileSystemEntry; diff --git a/dom/events/Event.h b/dom/events/Event.h index 50901194e38b..c8dd5d89110f 100644 --- a/dom/events/Event.h +++ b/dom/events/Event.h @@ -7,28 +7,33 @@ #ifndef mozilla_dom_Event_h_ #define mozilla_dom_Event_h_ -#include "mozilla/Attributes.h" -#include "mozilla/BasicEvents.h" -#include "nsISupports.h" -#include "nsCOMPtr.h" -#include "nsPIDOMWindow.h" -#include "nsPoint.h" -#include "nsCycleCollectionParticipant.h" -#include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/dom/EventBinding.h" -#include "mozilla/dom/PopupBlocker.h" -#include "nsIScriptGlobalObject.h" +#include #include "Units.h" #include "js/TypeDecls.h" -#include "nsIGlobalObject.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" +#include "mozilla/BasicEvents.h" +#include "mozilla/RefPtr.h" +#include "mozilla/dom/BindingDeclarations.h" +#include "nsCOMPtr.h" +#include "nsCycleCollectionParticipant.h" +#include "nsID.h" +#include "nsISupports.h" +#include "nsStringFwd.h" +#include "nsWrapperCache.h" // XXX(Bug 1674080) Remove this and let Codegen.py generate it instead when // needed. #include "mozilla/HoldDropJSObjects.h" -class nsIContent; -class nsPresContext; class PickleIterator; +class nsCycleCollectionTraversalCallback; +class nsIContent; +class nsIGlobalObject; +class nsIPrincipal; +class nsPIDOMWindowInner; +class nsPresContext; namespace IPC { class Message; @@ -39,6 +44,7 @@ namespace dom { class BeforeUnloadEvent; class CustomEvent; +class Document; class DragEvent; class EventTarget; class EventMessageAutoOverride; @@ -51,6 +57,8 @@ class TimeEvent; class UIEvent; class WantsPopupControlCheck; class XULCommandEvent; +struct EventInit; + #define GENERATED_EVENT(EventClass_) class EventClass_; #include "mozilla/dom/GeneratedEventList.h" #undef GENERATED_EVENT diff --git a/dom/events/TextClause.h b/dom/events/TextClause.h index ee59464d2343..7220d1976c0b 100644 --- a/dom/events/TextClause.h +++ b/dom/events/TextClause.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "nsCycleCollectionParticipant.h" #include "nsPIDOMWindow.h" diff --git a/dom/fetch/Fetch.h b/dom/fetch/Fetch.h index cbde04303fc6..d9176a4c20e9 100644 --- a/dom/fetch/Fetch.h +++ b/dom/fetch/Fetch.h @@ -13,7 +13,6 @@ #include "nsString.h" #include "mozilla/DebugOnly.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/AbortSignal.h" #include "mozilla/dom/BodyConsumer.h" #include "mozilla/dom/BodyStream.h" @@ -25,6 +24,8 @@ class nsIGlobalObject; class nsIEventTarget; namespace mozilla { +class ErrorResult; + namespace dom { class BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString; diff --git a/dom/fetch/FetchUtil.h b/dom/fetch/FetchUtil.h index be20d3c1948f..5907e209a4f7 100644 --- a/dom/fetch/FetchUtil.h +++ b/dom/fetch/FetchUtil.h @@ -10,7 +10,6 @@ #include "nsString.h" #include "nsError.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/File.h" #include "mozilla/dom/FormData.h" diff --git a/dom/file/BaseBlobImpl.h b/dom/file/BaseBlobImpl.h index 610849b0a167..6332278ade0a 100644 --- a/dom/file/BaseBlobImpl.h +++ b/dom/file/BaseBlobImpl.h @@ -8,6 +8,7 @@ #define mozilla_dom_BaseBlobImpl_h #include "mozilla/dom/BlobImpl.h" +#include "mozilla/ErrorResult.h" namespace mozilla { namespace dom { diff --git a/dom/file/Blob.h b/dom/file/Blob.h index 8c06e67b8450..120428d4fe31 100644 --- a/dom/file/Blob.h +++ b/dom/file/Blob.h @@ -8,7 +8,6 @@ #define mozilla_dom_Blob_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/BlobImpl.h" #include "mozilla/dom/BodyConsumer.h" @@ -21,6 +20,8 @@ class nsIGlobalObject; class nsIInputStream; namespace mozilla { +class ErrorResult; + namespace dom { struct BlobPropertyBag; diff --git a/dom/file/BlobImpl.h b/dom/file/BlobImpl.h index a3bfcde4fdfd..1177568ca8b1 100644 --- a/dom/file/BlobImpl.h +++ b/dom/file/BlobImpl.h @@ -8,7 +8,6 @@ #define mozilla_dom_BlobImpl_h #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/ErrorResult.h" #include "nsISupportsImpl.h" #include "nsString.h" @@ -22,6 +21,8 @@ class nsIInputStream; namespace mozilla { +class ErrorResult; + namespace dom { // This is the abstract class for any File backend. It must be nsISupports diff --git a/dom/file/FileCreatorHelper.h b/dom/file/FileCreatorHelper.h index 78eb7d7a6953..f0b666cc58af 100644 --- a/dom/file/FileCreatorHelper.h +++ b/dom/file/FileCreatorHelper.h @@ -8,7 +8,6 @@ #define mozilla_dom_FileCreatorHelper_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" #include "nsISupportsImpl.h" @@ -22,6 +21,8 @@ class nsIFile; class nsIGlobalObject; namespace mozilla { +class ErrorResult; + namespace dom { struct ChromeFilePropertyBag; diff --git a/dom/file/MultipartBlobImpl.h b/dom/file/MultipartBlobImpl.h index 46f0855bf130..6670ed5d446c 100644 --- a/dom/file/MultipartBlobImpl.h +++ b/dom/file/MultipartBlobImpl.h @@ -11,11 +11,12 @@ #include "Blob.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Maybe.h" #include "mozilla/dom/BaseBlobImpl.h" namespace mozilla { +class ErrorResult; + namespace dom { // This is just a sentinel value to be sure that we don't call diff --git a/dom/filesystem/Directory.h b/dom/filesystem/Directory.h index 61a5667f127b..11f1132cdaf2 100644 --- a/dom/filesystem/Directory.h +++ b/dom/filesystem/Directory.h @@ -8,13 +8,14 @@ #define mozilla_dom_Directory_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/File.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class FileSystemBase; diff --git a/dom/filesystem/FileSystemTaskBase.h b/dom/filesystem/FileSystemTaskBase.h index 4ed4ac9d9670..3d440403cc49 100644 --- a/dom/filesystem/FileSystemTaskBase.h +++ b/dom/filesystem/FileSystemTaskBase.h @@ -7,13 +7,14 @@ #ifndef mozilla_dom_FileSystemTaskBase_h #define mozilla_dom_FileSystemTaskBase_h -#include "mozilla/ErrorResult.h" #include "mozilla/dom/FileSystemRequestParent.h" #include "mozilla/dom/PFileSystemRequestChild.h" #include "nsIGlobalObject.h" #include "nsThreadUtils.h" namespace mozilla { +class ErrorResult; + namespace dom { class BlobImpl; diff --git a/dom/filesystem/GetDirectoryListingTask.h b/dom/filesystem/GetDirectoryListingTask.h index 23e05848048a..afb5296ac54e 100644 --- a/dom/filesystem/GetDirectoryListingTask.h +++ b/dom/filesystem/GetDirectoryListingTask.h @@ -9,9 +9,10 @@ #include "mozilla/dom/Directory.h" #include "mozilla/dom/FileSystemTaskBase.h" -#include "mozilla/ErrorResult.h" namespace mozilla { +class ErrorResult; + namespace dom { class BlobImpl; diff --git a/dom/filesystem/GetFileOrDirectoryTask.h b/dom/filesystem/GetFileOrDirectoryTask.h index 7a814faf8144..8d15d9804f40 100644 --- a/dom/filesystem/GetFileOrDirectoryTask.h +++ b/dom/filesystem/GetFileOrDirectoryTask.h @@ -9,9 +9,10 @@ #include "mozilla/dom/Directory.h" #include "mozilla/dom/FileSystemTaskBase.h" -#include "mozilla/ErrorResult.h" namespace mozilla { +class ErrorResult; + namespace dom { class BlobImpl; diff --git a/dom/filesystem/GetFilesTask.h b/dom/filesystem/GetFilesTask.h index 0c6a64d88e55..6f6f15e8796a 100644 --- a/dom/filesystem/GetFilesTask.h +++ b/dom/filesystem/GetFilesTask.h @@ -10,9 +10,10 @@ #include "mozilla/dom/Directory.h" #include "mozilla/dom/FileSystemTaskBase.h" #include "mozilla/dom/GetFilesHelper.h" -#include "mozilla/ErrorResult.h" namespace mozilla { +class ErrorResult; + namespace dom { class BlobImpl; diff --git a/dom/filesystem/compat/FileSystem.h b/dom/filesystem/compat/FileSystem.h index 0654b442137c..298d6ead90e2 100644 --- a/dom/filesystem/compat/FileSystem.h +++ b/dom/filesystem/compat/FileSystem.h @@ -8,7 +8,6 @@ #define mozilla_dom_FileSystem_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" diff --git a/dom/filesystem/compat/FileSystemDirectoryReader.h b/dom/filesystem/compat/FileSystemDirectoryReader.h index 4c3ac8132867..5aa9dce79fdf 100644 --- a/dom/filesystem/compat/FileSystemDirectoryReader.h +++ b/dom/filesystem/compat/FileSystemDirectoryReader.h @@ -8,13 +8,14 @@ #define mozilla_dom_FileSystemDirectoryReader_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/FileSystemDirectoryEntry.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class Directory; diff --git a/dom/filesystem/compat/FileSystemEntry.h b/dom/filesystem/compat/FileSystemEntry.h index 307dd3bbf457..ffdafc0a2cce 100644 --- a/dom/filesystem/compat/FileSystemEntry.h +++ b/dom/filesystem/compat/FileSystemEntry.h @@ -8,7 +8,6 @@ #define mozilla_dom_FileSystemEntry_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/FileSystemBinding.h" #include "nsCycleCollectionParticipant.h" @@ -16,6 +15,8 @@ #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class FileSystem; diff --git a/dom/gamepad/Gamepad.h b/dom/gamepad/Gamepad.h index d063482dee7c..a6e0a5cdd0cb 100644 --- a/dom/gamepad/Gamepad.h +++ b/dom/gamepad/Gamepad.h @@ -7,7 +7,6 @@ #ifndef mozilla_dom_gamepad_Gamepad_h #define mozilla_dom_gamepad_Gamepad_h -#include "mozilla/ErrorResult.h" #include "mozilla/dom/GamepadBinding.h" #include "mozilla/dom/GamepadButton.h" #include "mozilla/dom/GamepadPose.h" diff --git a/dom/html/HTMLOptionsCollection.h b/dom/html/HTMLOptionsCollection.h index 2c79846a3348..97fd7ccd0732 100644 --- a/dom/html/HTMLOptionsCollection.h +++ b/dom/html/HTMLOptionsCollection.h @@ -11,13 +11,14 @@ #include "nsWrapperCache.h" #include "mozilla/dom/HTMLOptionElement.h" -#include "mozilla/ErrorResult.h" #include "nsCOMPtr.h" #include "nsError.h" #include "nsGenericHTMLElement.h" #include "nsTArray.h" namespace mozilla { +class ErrorResult; + namespace dom { class DocGroup; diff --git a/dom/html/HTMLSelectElement.h b/dom/html/HTMLSelectElement.h index e8f847fcc807..f4bb48497762 100644 --- a/dom/html/HTMLSelectElement.h +++ b/dom/html/HTMLSelectElement.h @@ -13,7 +13,6 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/UnionTypes.h" #include "mozilla/dom/HTMLOptionsCollection.h" -#include "mozilla/ErrorResult.h" #include "nsCheapSets.h" #include "nsCOMPtr.h" #include "nsError.h" @@ -27,6 +26,7 @@ class nsISelectControlFrame; namespace mozilla { +class ErrorResult; class EventChainPostVisitor; class EventChainPreVisitor; class SelectContentData; diff --git a/dom/html/TimeRanges.h b/dom/html/TimeRanges.h index 708d3cccda4d..302d3070e7ad 100644 --- a/dom/html/TimeRanges.h +++ b/dom/html/TimeRanges.h @@ -11,10 +11,10 @@ #include "nsISupports.h" #include "nsTArray.h" #include "nsWrapperCache.h" -#include "mozilla/ErrorResult.h" #include "TimeUnits.h" namespace mozilla { +class ErrorResult; namespace dom { class TimeRanges; diff --git a/dom/html/nsGenericHTMLElement.h b/dom/html/nsGenericHTMLElement.h index 9a3be6621f4b..0bc095abc664 100644 --- a/dom/html/nsGenericHTMLElement.h +++ b/dom/html/nsGenericHTMLElement.h @@ -13,7 +13,6 @@ #include "nsIFormControl.h" #include "nsGkAtoms.h" #include "nsContentCreatorFunctions.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/DOMRect.h" @@ -27,6 +26,7 @@ class nsIURI; struct nsSize; namespace mozilla { +class ErrorResult; class EventChainPostVisitor; class EventChainPreVisitor; class EventChainVisitor; diff --git a/dom/html/nsGenericHTMLFrameElement.h b/dom/html/nsGenericHTMLFrameElement.h index 0ac600b6298e..09d607bb2c6a 100644 --- a/dom/html/nsGenericHTMLFrameElement.h +++ b/dom/html/nsGenericHTMLFrameElement.h @@ -8,7 +8,6 @@ #define nsGenericHTMLFrameElement_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/nsBrowserElement.h" #include "nsFrameLoader.h" @@ -17,6 +16,8 @@ #include "nsIMozBrowserFrame.h" namespace mozilla { +class ErrorResult; + namespace dom { class BrowserParent; template diff --git a/dom/indexedDB/Key.h b/dom/indexedDB/Key.h index b4cb55854a62..db274be56b32 100644 --- a/dom/indexedDB/Key.h +++ b/dom/indexedDB/Key.h @@ -12,7 +12,6 @@ #include "js/Array.h" // JS::GetArrayLength #include "js/RootingAPI.h" #include "jsapi.h" -#include "mozilla/ErrorResult.h" #include "nsString.h" class mozIStorageStatement; diff --git a/dom/ipc/BrowserParent.h b/dom/ipc/BrowserParent.h index 3929729a59d6..f4161f3dbe09 100644 --- a/dom/ipc/BrowserParent.h +++ b/dom/ipc/BrowserParent.h @@ -16,14 +16,9 @@ #include "mozilla/EventForwards.h" #include "mozilla/RefPtr.h" #include "mozilla/dom/BrowserBridgeParent.h" -#include "mozilla/dom/File.h" #include "mozilla/dom/PBrowserParent.h" -#include "mozilla/dom/PContent.h" -#include "mozilla/dom/PFilePickerParent.h" #include "mozilla/dom/TabContext.h" #include "mozilla/dom/ipc/IdType.h" -#include "mozilla/gfx/CrossProcessPaint.h" -#include "mozilla/layers/CompositorBridgeParent.h" #include "mozilla/layout/RemoteLayerTreeOwner.h" #include "nsCOMPtr.h" #include "nsIAuthPromptProvider.h" @@ -32,17 +27,24 @@ #include "nsIKeyEventInPluginCallback.h" #include "nsIRemoteTab.h" #include "nsIWidget.h" -#include "nsIXULBrowserWindow.h" #include "nsWeakReference.h" +class imgIContainer; +class nsCycleCollectionTraversalCallback; +class nsDocShellLoadState; class nsFrameLoader; +class nsIBrowser; class nsIContent; -class nsIPrincipal; -class nsIURI; -class nsILoadContext; +class nsIContentSecurityPolicy; class nsIDocShell; +class nsILoadContext; +class nsIPrincipal; +class nsIRequest; +class nsIURI; class nsIWebBrowserPersistDocumentReceiver; class nsIWebProgress; +class nsIXULBrowserWindow; +class nsPIDOMWindowOuter; namespace mozilla { @@ -50,17 +52,12 @@ namespace a11y { class DocAccessibleParent; } -namespace layers { -struct TextureFactoryIdentifier; -} // namespace layers - namespace widget { struct IMENotification; } // namespace widget namespace gfx { class SourceSurface; -class DataSourceSurface; } // namespace gfx namespace dom { diff --git a/dom/ipc/ClonedErrorHolder.h b/dom/ipc/ClonedErrorHolder.h index f406f2abdf36..1eb6af4b274b 100644 --- a/dom/ipc/ClonedErrorHolder.h +++ b/dom/ipc/ClonedErrorHolder.h @@ -13,12 +13,13 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/StructuredCloneHolder.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" class nsIGlobalObject; class nsQueryActorChild; namespace mozilla { +class ErrorResult; + namespace dom { class ClonedErrorHolder final { diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 284c93ea36c9..6981aa0f96c3 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -8,14 +8,13 @@ #define mozilla_dom_ContentChild_h #include "mozilla/Atomics.h" -#include "mozilla/dom/MediaControlKeySource.h" +#include "mozilla/dom/BlobImpl.h" +#include "mozilla/dom/GetFilesHelper.h" #include "mozilla/dom/PContentChild.h" #include "mozilla/dom/ProcessActor.h" #include "mozilla/dom/RemoteType.h" #include "mozilla/ipc/InputStreamUtils.h" #include "mozilla/ipc/ProtocolUtils.h" -#include "mozilla/widget/ThemeChangeKind.h" -#include "mozilla/LookAndFeel.h" #include "mozilla/StaticPtr.h" #include "mozilla/UniquePtr.h" #include "nsClassHashtable.h" @@ -46,10 +45,19 @@ class RemoteSpellcheckEngineChild; class ChildProfilerController; class BenchmarkStorageChild; +namespace ipc { +class PChildToParentStreamChild; +class PFileDescriptorSetChild; +} // namespace ipc + namespace loader { class PScriptCacheChild; } +namespace widget { +enum class ThemeChangeKind : uint8_t; +} + using mozilla::loader::PScriptCacheChild; #if !defined(XP_WIN) @@ -71,8 +79,8 @@ class AlertObserver; class ConsoleListener; class ClonedMessageData; class BrowserChild; -class GetFilesHelperChild; class TabContext; +enum class CallerType : uint32_t; class ContentChild final : public PContentChild, public nsIDOMProcessChild, diff --git a/dom/ipc/ProcessActor.h b/dom/ipc/ProcessActor.h index af906a3e5756..a80300b67243 100644 --- a/dom/ipc/ProcessActor.h +++ b/dom/ipc/ProcessActor.h @@ -7,19 +7,17 @@ #ifndef mozilla_dom_ProcessActor_h #define mozilla_dom_ProcessActor_h -#include "nsWrapperCache.h" -#include "nsISupports.h" -#include "mozilla/dom/BrowsingContext.h" -#include "mozilla/ErrorResult.h" -#include "nsIURI.h" -#include "nsRefPtrHashtable.h" -#include "nsString.h" -#include "mozilla/dom/JSActor.h" #include "mozilla/dom/JSActorManager.h" +#include "nsStringFwd.h" namespace mozilla { +class ErrorResult; + namespace dom { +class JSActorProtocol; +class JSActorService; + // Common base class for Content{Parent, Child} and InProcess{Parent, Child}. class ProcessActor : public JSActorManager { protected: diff --git a/dom/ipc/RemoteBrowser.h b/dom/ipc/RemoteBrowser.h index 40fdc21aae7f..41a890c73768 100644 --- a/dom/ipc/RemoteBrowser.h +++ b/dom/ipc/RemoteBrowser.h @@ -7,19 +7,15 @@ #ifndef mozilla_dom_ipc_RemoteBrowser_h #define mozilla_dom_ipc_RemoteBrowser_h -#include "mozilla/dom/BrowsingContext.h" #include "mozilla/dom/ipc/IdType.h" -#include "mozilla/dom/EffectsInfo.h" #include "mozilla/layers/LayersTypes.h" -#include "nsILoadContext.h" -#include "nsIPrincipal.h" #include "nsISupports.h" -#include "nsISupportsImpl.h" -#include "nsIURI.h" #include "nsRect.h" #include "Units.h" +class nsDocShellLoadState; class nsFrameLoader; +class nsILoadContext; class nsIContent; namespace mozilla { @@ -28,6 +24,8 @@ namespace dom { class BrowserHost; class BrowserBridgeHost; +class BrowsingContext; +class EffectsInfo; class OwnerShowInfo; /** diff --git a/dom/ipc/WindowGlobalActor.h b/dom/ipc/WindowGlobalActor.h index 0957e67ffea0..7ab19c292ecc 100644 --- a/dom/ipc/WindowGlobalActor.h +++ b/dom/ipc/WindowGlobalActor.h @@ -10,7 +10,6 @@ #include "nsWrapperCache.h" #include "nsISupports.h" #include "mozilla/dom/BrowsingContext.h" -#include "mozilla/ErrorResult.h" #include "nsIURI.h" #include "nsString.h" #include "mozilla/dom/JSActor.h" @@ -18,6 +17,8 @@ #include "mozilla/dom/WindowGlobalTypes.h" namespace mozilla { +class ErrorResult; + namespace dom { // Common base class for WindowGlobal{Parent, Child}. diff --git a/dom/ipc/jsactor/JSActor.h b/dom/ipc/jsactor/JSActor.h index 7c3d9584b6c4..5bdfac30b30e 100644 --- a/dom/ipc/jsactor/JSActor.h +++ b/dom/ipc/jsactor/JSActor.h @@ -10,7 +10,6 @@ #include "js/TypeDecls.h" #include "ipc/IPCMessageUtils.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/PromiseNativeHandler.h" #include "nsCycleCollectionParticipant.h" #include "nsDataHashtable.h" @@ -20,6 +19,8 @@ class nsIGlobalObject; class nsQueryJSActor; namespace mozilla { +class ErrorResult; + namespace dom { namespace ipc { diff --git a/dom/ipc/jsactor/JSActorManager.h b/dom/ipc/jsactor/JSActorManager.h index 923f7bdced38..80f4893b06d2 100644 --- a/dom/ipc/jsactor/JSActorManager.h +++ b/dom/ipc/jsactor/JSActorManager.h @@ -9,11 +9,12 @@ #include "js/TypeDecls.h" #include "mozilla/dom/JSActor.h" -#include "mozilla/ErrorResult.h" #include "nsRefPtrHashtable.h" #include "nsString.h" namespace mozilla { +class ErrorResult; + namespace ipc { class IProtocol; } diff --git a/dom/ipc/jsactor/JSActorService.h b/dom/ipc/jsactor/JSActorService.h index cd622ccd267d..610d0fc99604 100644 --- a/dom/ipc/jsactor/JSActorService.h +++ b/dom/ipc/jsactor/JSActorService.h @@ -8,7 +8,6 @@ #define mozilla_dom_JSActorService_h #include "mozilla/dom/BrowsingContext.h" -#include "mozilla/ErrorResult.h" #include "nsIURI.h" #include "nsRefPtrHashtable.h" #include "nsString.h" @@ -19,6 +18,8 @@ #include "mozilla/EventListenerManager.h" namespace mozilla { +class ErrorResult; + namespace dom { struct ProcessActorOptions; diff --git a/dom/ipc/jsactor/JSProcessActorParent.h b/dom/ipc/jsactor/JSProcessActorParent.h index abcc0e3feec2..239efbeb594d 100644 --- a/dom/ipc/jsactor/JSProcessActorParent.h +++ b/dom/ipc/jsactor/JSProcessActorParent.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/JSActor.h" @@ -18,6 +17,8 @@ #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class JSProcessActorParent final : public JSActor { diff --git a/dom/ipc/jsactor/JSProcessActorProtocol.h b/dom/ipc/jsactor/JSProcessActorProtocol.h index 47d5ec5066ab..2230283dcf61 100644 --- a/dom/ipc/jsactor/JSProcessActorProtocol.h +++ b/dom/ipc/jsactor/JSProcessActorProtocol.h @@ -9,13 +9,14 @@ #include "mozilla/dom/BrowsingContext.h" #include "mozilla/dom/JSActorService.h" -#include "mozilla/ErrorResult.h" #include "nsIURI.h" #include "nsString.h" #include "nsTArray.h" #include "nsIObserver.h" namespace mozilla { +class ErrorResult; + namespace dom { struct ProcessActorOptions; diff --git a/dom/ipc/jsactor/JSWindowActorChild.h b/dom/ipc/jsactor/JSWindowActorChild.h index 77b796889a15..73521c376a90 100644 --- a/dom/ipc/jsactor/JSWindowActorChild.h +++ b/dom/ipc/jsactor/JSWindowActorChild.h @@ -7,24 +7,30 @@ #ifndef mozilla_dom_JSWindowActorChild_h #define mozilla_dom_JSWindowActorChild_h -#include "js/TypeDecls.h" -#include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" +#include "js/RootingAPI.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/RefPtr.h" #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/JSActor.h" +#include "mozilla/dom/WindowGlobalChild.h" +#include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" -#include "nsWrapperCache.h" -#include "nsIDOMProcessChild.h" +#include "nsIGlobalObject.h" +#include "nsISupports.h" +#include "nsStringFwd.h" + +class nsIDocShell; namespace mozilla { +class ErrorResult; + namespace dom { template struct Nullable; +class BrowsingContext; class Document; -class WindowGlobalChild; class WindowProxyHolder; } // namespace dom diff --git a/dom/ipc/jsactor/JSWindowActorParent.h b/dom/ipc/jsactor/JSWindowActorParent.h index 56bae19d8444..56d6fd3f7de8 100644 --- a/dom/ipc/jsactor/JSWindowActorParent.h +++ b/dom/ipc/jsactor/JSWindowActorParent.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/JSActor.h" @@ -17,6 +16,8 @@ #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace dom { class WindowGlobalParent; diff --git a/dom/ipc/jsactor/JSWindowActorProtocol.h b/dom/ipc/jsactor/JSWindowActorProtocol.h index 03be5f4888b0..993e6b4e6ed3 100644 --- a/dom/ipc/jsactor/JSWindowActorProtocol.h +++ b/dom/ipc/jsactor/JSWindowActorProtocol.h @@ -10,7 +10,6 @@ #include "mozilla/dom/BrowsingContext.h" #include "mozilla/dom/JSActorService.h" #include "mozilla/extensions/MatchPattern.h" -#include "mozilla/ErrorResult.h" #include "nsIURI.h" #include "nsString.h" #include "nsTArray.h" @@ -18,6 +17,8 @@ #include "nsIDOMEventListener.h" namespace mozilla { +class ErrorResult; + namespace dom { struct WindowActorOptions; diff --git a/dom/media/MediaStreamError.h b/dom/media/MediaStreamError.h index 8beb56679b1a..68c35b53e59d 100644 --- a/dom/media/MediaStreamError.h +++ b/dom/media/MediaStreamError.h @@ -8,7 +8,6 @@ #define mozilla_dom_MediaStreamError_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" #include "js/TypeDecls.h" #include "nsPIDOMWindow.h" diff --git a/dom/media/eme/CDMProxy.h b/dom/media/eme/CDMProxy.h index 9ab15958c45b..aec178bc4ef5 100644 --- a/dom/media/eme/CDMProxy.h +++ b/dom/media/eme/CDMProxy.h @@ -9,7 +9,6 @@ #include "mozilla/CDMCaps.h" #include "mozilla/DataMutex.h" -#include "mozilla/ErrorResult.h" #include "mozilla/MozPromise.h" #include "mozilla/dom/MediaKeyMessageEvent.h" @@ -18,6 +17,7 @@ #include "nsIThread.h" namespace mozilla { +class ErrorResult; class MediaRawData; class ChromiumCDMProxy; diff --git a/dom/media/eme/DecryptorProxyCallback.h b/dom/media/eme/DecryptorProxyCallback.h index 05d2b4b4f021..6395bf8f6bd2 100644 --- a/dom/media/eme/DecryptorProxyCallback.h +++ b/dom/media/eme/DecryptorProxyCallback.h @@ -9,7 +9,10 @@ #include "mozilla/dom/MediaKeyStatusMapBinding.h" // For MediaKeyStatus #include "mozilla/dom/MediaKeyMessageEventBinding.h" // For MediaKeyMessageType #include "mozilla/CDMProxy.h" -#include "mozilla/ErrorResult.h" + +namespace mozilla { +class ErrorResult; +} class DecryptorProxyCallback { public: diff --git a/dom/media/eme/MediaKeyError.h b/dom/media/eme/MediaKeyError.h index 61fdee38e986..9e6007df39cf 100644 --- a/dom/media/eme/MediaKeyError.h +++ b/dom/media/eme/MediaKeyError.h @@ -8,7 +8,6 @@ #define mozilla_dom_MediaKeyError_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" #include "mozilla/dom/Event.h" #include "js/TypeDecls.h" diff --git a/dom/media/eme/MediaKeyMessageEvent.h b/dom/media/eme/MediaKeyMessageEvent.h index 420c1731d90c..400439b065fb 100644 --- a/dom/media/eme/MediaKeyMessageEvent.h +++ b/dom/media/eme/MediaKeyMessageEvent.h @@ -8,7 +8,6 @@ #define mozilla_dom_MediaKeyMessageEvent_h__ #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" #include "nsCOMPtr.h" @@ -18,6 +17,8 @@ #include "mozilla/dom/MediaKeyMessageEventBinding.h" namespace mozilla { +class ErrorResult; + namespace dom { struct MediaKeyMessageEventInit; diff --git a/dom/media/eme/MediaKeySession.h b/dom/media/eme/MediaKeySession.h index 3912bfef164f..e19488c311b1 100644 --- a/dom/media/eme/MediaKeySession.h +++ b/dom/media/eme/MediaKeySession.h @@ -9,7 +9,6 @@ #include "DecoderDoctorLogger.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "mozilla/DOMEventTargetHelper.h" #include "nsCOMPtr.h" @@ -24,6 +23,7 @@ struct JSContext; namespace mozilla { +class ErrorResult; namespace dom { class MediaKeySession; diff --git a/dom/media/eme/MediaKeyStatusMap.h b/dom/media/eme/MediaKeyStatusMap.h index 3eba0a9c6587..653e95093acf 100644 --- a/dom/media/eme/MediaKeyStatusMap.h +++ b/dom/media/eme/MediaKeyStatusMap.h @@ -7,7 +7,6 @@ #ifndef mozilla_dom_MediaKeyStatuses_h #define mozilla_dom_MediaKeyStatuses_h -#include "mozilla/ErrorResult.h" #include "mozilla/Attributes.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" @@ -19,6 +18,8 @@ class nsPIDOMWindowInner; namespace mozilla { +class ErrorResult; + namespace dom { class ArrayBufferViewOrArrayBuffer; diff --git a/dom/media/eme/MediaKeySystemAccess.h b/dom/media/eme/MediaKeySystemAccess.h index 1ec4a46cd867..50b36b081ef8 100644 --- a/dom/media/eme/MediaKeySystemAccess.h +++ b/dom/media/eme/MediaKeySystemAccess.h @@ -8,7 +8,6 @@ #define mozilla_dom_MediaKeySystemAccess_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" @@ -21,6 +20,7 @@ namespace mozilla { class DecoderDoctorDiagnostics; +class ErrorResult; namespace dom { diff --git a/dom/media/eme/mediadrm/MediaDrmCDMCallbackProxy.h b/dom/media/eme/mediadrm/MediaDrmCDMCallbackProxy.h index 9d3a752335f3..be2bb39dbfdc 100644 --- a/dom/media/eme/mediadrm/MediaDrmCDMCallbackProxy.h +++ b/dom/media/eme/mediadrm/MediaDrmCDMCallbackProxy.h @@ -8,11 +8,12 @@ #define MediaDrmCDMCallbackProxy_h_ #include "mozilla/CDMProxy.h" -#include "mozilla/ErrorResult.h" #include "mozilla/DecryptorProxyCallback.h" namespace mozilla { class CDMProxy; +class ErrorResult; + // Proxies call backs from the MediaDrmProxy -> MediaDrmProxySupport back to the // MediaKeys object on the main thread. We used annotation calledFrom = "gecko" // to ensure running on main thread. diff --git a/dom/media/gmp/ChromiumCDMCallback.h b/dom/media/gmp/ChromiumCDMCallback.h index 3481a81ec6fa..affcad3eb702 100644 --- a/dom/media/gmp/ChromiumCDMCallback.h +++ b/dom/media/gmp/ChromiumCDMCallback.h @@ -7,11 +7,14 @@ #define ChromiumCDMCallback_h_ #include "mozilla/CDMProxy.h" -#include "mozilla/ErrorResult.h" // For ErrorResult #include "mozilla/dom/MediaKeyStatusMapBinding.h" // For MediaKeyStatus #include "mozilla/dom/MediaKeyMessageEventBinding.h" // For MediaKeyMessageType #include "mozilla/gmp/GMPTypes.h" // For CDMKeyInformation +namespace mozilla { +class ErrorResult; +} + class ChromiumCDMCallback { public: virtual ~ChromiumCDMCallback() = default; diff --git a/dom/media/gmp/ChromiumCDMParent.h b/dom/media/gmp/ChromiumCDMParent.h index 00527841d8ba..37b1734d33a1 100644 --- a/dom/media/gmp/ChromiumCDMParent.h +++ b/dom/media/gmp/ChromiumCDMParent.h @@ -15,7 +15,6 @@ #include "nsDataHashtable.h" #include "PlatformDecoderModule.h" #include "ImageContainer.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Span.h" #include "ReorderQueue.h" @@ -23,6 +22,7 @@ class ChromiumCDMCallback; namespace mozilla { +class ErrorResult; class MediaRawData; class ChromiumCDMProxy; diff --git a/dom/media/gmp/ChromiumCDMProxy.h b/dom/media/gmp/ChromiumCDMProxy.h index 5c353c29bfc3..b543408aa197 100644 --- a/dom/media/gmp/ChromiumCDMProxy.h +++ b/dom/media/gmp/ChromiumCDMProxy.h @@ -8,12 +8,12 @@ #define ChromiumCDMProxy_h_ #include "mozilla/AbstractThread.h" -#include "mozilla/ErrorResult.h" #include "mozilla/CDMProxy.h" #include "ChromiumCDMParent.h" namespace mozilla { +class ErrorResult; class MediaRawData; class DecryptJob; class ChromiumCDMCallbackProxy; diff --git a/dom/media/gmp/GMPCrashHelper.h b/dom/media/gmp/GMPCrashHelper.h index e798fc23d12e..d1945321c063 100644 --- a/dom/media/gmp/GMPCrashHelper.h +++ b/dom/media/gmp/GMPCrashHelper.h @@ -9,7 +9,8 @@ # include "MainThreadUtils.h" # include "nsISupportsImpl.h" -# include "nsPIDOMWindow.h" + +class nsPIDOMWindowInner; namespace mozilla { diff --git a/dom/media/mediasession/MediaMetadata.h b/dom/media/mediasession/MediaMetadata.h index a9d83d71d788..63fae8f77641 100644 --- a/dom/media/mediasession/MediaMetadata.h +++ b/dom/media/mediasession/MediaMetadata.h @@ -11,13 +11,14 @@ #include "mozilla/Attributes.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/MediaSessionBinding.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" class nsIGlobalObject; namespace mozilla { +class ErrorResult; + namespace dom { class MediaMetadataBase { diff --git a/dom/media/mediasession/MediaSession.h b/dom/media/mediasession/MediaSession.h index 83b0177e2bc9..45cfd0411492 100644 --- a/dom/media/mediasession/MediaSession.h +++ b/dom/media/mediasession/MediaSession.h @@ -12,7 +12,6 @@ #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/MediaMetadata.h" #include "mozilla/dom/MediaSessionBinding.h" -#include "mozilla/ErrorResult.h" #include "mozilla/EnumeratedArray.h" #include "nsCycleCollectionParticipant.h" #include "nsIDocumentActivity.h" @@ -21,6 +20,8 @@ class nsPIDOMWindowInner; namespace mozilla { +class ErrorResult; + namespace dom { // https://w3c.github.io/mediasession/#position-state diff --git a/dom/media/webaudio/AudioParamTimeline.h b/dom/media/webaudio/AudioParamTimeline.h index 4a3fe0f8b09e..4c0c439da01d 100644 --- a/dom/media/webaudio/AudioParamTimeline.h +++ b/dom/media/webaudio/AudioParamTimeline.h @@ -9,7 +9,6 @@ #include "AudioEventTimeline.h" #include "AudioNodeTrack.h" -#include "mozilla/ErrorResult.h" #include "AudioSegment.h" namespace mozilla { diff --git a/dom/media/webspeech/recognition/SpeechGrammar.h b/dom/media/webspeech/recognition/SpeechGrammar.h index 6cd47eeabf53..ea4a6bab8ec7 100644 --- a/dom/media/webspeech/recognition/SpeechGrammar.h +++ b/dom/media/webspeech/recognition/SpeechGrammar.h @@ -14,9 +14,10 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" namespace mozilla { +class ErrorResult; + namespace dom { class GlobalObject; diff --git a/dom/media/webvtt/TextTrackCueList.h b/dom/media/webvtt/TextTrackCueList.h index 75623ecb1cbd..5669fe12ce49 100644 --- a/dom/media/webvtt/TextTrackCueList.h +++ b/dom/media/webvtt/TextTrackCueList.h @@ -11,9 +11,10 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" -#include "mozilla/ErrorResult.h" namespace mozilla { +class ErrorResult; + namespace dom { class TextTrackCue; diff --git a/dom/messagechannel/MessageChannel.h b/dom/messagechannel/MessageChannel.h index 8837bbc3edfb..861cd3122991 100644 --- a/dom/messagechannel/MessageChannel.h +++ b/dom/messagechannel/MessageChannel.h @@ -8,7 +8,6 @@ #define mozilla_dom_MessageChannel_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" @@ -17,6 +16,8 @@ class nsIGlobalObject; namespace mozilla { +class ErrorResult; + namespace dom { class MessagePort; diff --git a/dom/midi/MIDIAccess.h b/dom/midi/MIDIAccess.h index e9d60f89de7c..99071aa526b5 100644 --- a/dom/midi/MIDIAccess.h +++ b/dom/midi/MIDIAccess.h @@ -9,7 +9,6 @@ #include "mozilla/Attributes.h" #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Observer.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" @@ -17,6 +16,8 @@ struct JSContext; namespace mozilla { +class ErrorResult; + // Predeclare void_t here, as including IPCMessageUtils brings in windows.h and // causes binding compilation problems. struct void_t; diff --git a/dom/midi/MIDIOutput.h b/dom/midi/MIDIOutput.h index 254619be5b5a..72d0efb55e7a 100644 --- a/dom/midi/MIDIOutput.h +++ b/dom/midi/MIDIOutput.h @@ -9,12 +9,13 @@ #include "mozilla/dom/MIDIPort.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" struct JSContext; namespace mozilla { +class ErrorResult; + namespace dom { class MIDIPortInfo; diff --git a/dom/midi/MIDIPlatformService.h b/dom/midi/MIDIPlatformService.h index d83b238b54a9..74ca04b3b8bf 100644 --- a/dom/midi/MIDIPlatformService.h +++ b/dom/midi/MIDIPlatformService.h @@ -10,8 +10,6 @@ #include "nsClassHashtable.h" #include "mozilla/Mutex.h" #include "mozilla/dom/MIDIPortBinding.h" -#include "mozilla/dom/MIDITypes.h" -#include "mozilla/dom/MIDIPortInterface.h" #include "nsHashKeys.h" // XXX Avoid including this here by moving function implementations to the cpp @@ -23,7 +21,9 @@ namespace dom { class MIDIManagerParent; class MIDIPortParent; +class MIDIMessage; class MIDIMessageQueue; +class MIDIPortInfo; /** * Base class for platform specific MIDI implementations. Handles aggregation of diff --git a/dom/midi/MIDIPort.h b/dom/midi/MIDIPort.h index 9e4e71ceddb7..1d12030a7135 100644 --- a/dom/midi/MIDIPort.h +++ b/dom/midi/MIDIPort.h @@ -11,7 +11,6 @@ #include "mozilla/Attributes.h" #include "mozilla/Observer.h" #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/MIDIAccess.h" #include "mozilla/dom/MIDIPortInterface.h" diff --git a/dom/network/UDPSocket.h b/dom/network/UDPSocket.h index b32ba2c25f25..5453fe54481a 100644 --- a/dom/network/UDPSocket.h +++ b/dom/network/UDPSocket.h @@ -9,7 +9,6 @@ #include "mozilla/Attributes.h" #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/Promise.h" #include "mozilla/dom/SocketCommonBinding.h" #include "nsIUDPSocket.h" @@ -23,6 +22,7 @@ struct JSContext; // namespace mozilla { +class ErrorResult; class LazyLogModule; namespace net { diff --git a/dom/payments/MerchantValidationEvent.h b/dom/payments/MerchantValidationEvent.h index abbf21ef5d59..b7de875ea173 100644 --- a/dom/payments/MerchantValidationEvent.h +++ b/dom/payments/MerchantValidationEvent.h @@ -8,7 +8,6 @@ #define mozilla_dom_MerchantValidationEvent_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Result.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/MerchantValidationEventBinding.h" @@ -17,6 +16,8 @@ class nsIURI; namespace mozilla { +class ErrorResult; + namespace dom { class Promise; diff --git a/dom/payments/PaymentMethodChangeEvent.h b/dom/payments/PaymentMethodChangeEvent.h index 44f5e0112a10..9617214df4fd 100644 --- a/dom/payments/PaymentMethodChangeEvent.h +++ b/dom/payments/PaymentMethodChangeEvent.h @@ -7,7 +7,6 @@ #ifndef mozilla_dom_PaymentMethodChangeEvent_h #define mozilla_dom_PaymentMethodChangeEvent_h -#include "mozilla/ErrorResult.h" #include "mozilla/dom/PaymentMethodChangeEventBinding.h" #include "mozilla/dom/PaymentRequestUpdateEvent.h" #include "mozilla/dom/PaymentRequest.h" diff --git a/dom/payments/PaymentRequestUpdateEvent.h b/dom/payments/PaymentRequestUpdateEvent.h index 8fcf2af05302..cd5afb8ae9fc 100644 --- a/dom/payments/PaymentRequestUpdateEvent.h +++ b/dom/payments/PaymentRequestUpdateEvent.h @@ -8,12 +8,13 @@ #define mozilla_dom_PaymentRequestUpdateEvent_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/PaymentRequestUpdateEventBinding.h" #include "mozilla/dom/PromiseNativeHandler.h" namespace mozilla { +class ErrorResult; + namespace dom { class Promise; diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index c74bb07b022f..4cc7d89e59d3 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -5,79 +5,106 @@ /* nsPluginHost.cpp - top-level plugin management code */ -#include "nscore.h" #include "nsPluginHost.h" -#include +#include #include -#include "nsComponentManagerUtils.h" -#include "nsNPAPIPlugin.h" -#include "nsNPAPIPluginStreamListener.h" -#include "nsNPAPIPluginInstance.h" -#include "nsPluginInstanceOwner.h" -#include "nsObjectLoadingContent.h" -#include "nsIEventTarget.h" -#include "nsIObserverService.h" -#include "nsIHttpProtocolHandler.h" -#include "nsIHttpChannel.h" -#include "nsIUploadChannel.h" -#include "nsIStreamListener.h" -#include "nsIInputStream.h" -#include "nsTArray.h" -#include "nsReadableUtils.h" -#include "nsIFile.h" -#include "nsISeekableStream.h" -#include "nsNetUtil.h" -#include "nsISimpleEnumerator.h" -#include "nsIStringStream.h" -#include "mozilla/dom/Document.h" -#include "nsPluginLogging.h" -#include "nsIScriptChannel.h" -#include "nsIBlocklistService.h" -#include "nsVersionComparator.h" -#include "nsIObjectLoadingContent.h" -#include "nsIWritablePropertyBag2.h" -#include "nsICategoryManager.h" -#include "nsPluginStreamListenerPeer.h" -#include "mozilla/NullPrincipal.h" -#include "mozilla/dom/ContentChild.h" +#include +#include +#include +#include +#include "GeckoProfiler.h" +#include "ReferrerInfo.h" +#include "js/RootingAPI.h" +#include "mozilla/ArrayIterator.h" +#include "mozilla/Assertions.h" +#include "mozilla/ClearOnShutdown.h" +#include "mozilla/DebugOnly.h" +#include "mozilla/Logging.h" +#include "mozilla/MacroForEach.h" +#include "mozilla/NotNull.h" +#include "mozilla/PluginLibrary.h" +#include "mozilla/Preferences.h" +#include "mozilla/Services.h" +#include "mozilla/SpinEventLoopUntil.h" +#include "mozilla/StaticPtr.h" +#include "mozilla/Telemetry.h" +#include "mozilla/TelemetryHistogramEnums.h" +#include "mozilla/TextUtils.h" +#include "mozilla/TimeStamp.h" +#include "mozilla/Unused.h" +#include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/ContentParent.h" +#include "mozilla/dom/Document.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/FakePluginTagInitBinding.h" -#include "mozilla/ClearOnShutdown.h" -#include "mozilla/LoadInfo.h" -#include "mozilla/plugins/PluginBridge.h" -#include "mozilla/plugins/PluginTypes.h" -#include "mozilla/SpinEventLoopUntil.h" -#include "mozilla/TextUtils.h" -#include "mozilla/Preferences.h" +#include "mozilla/dom/Promise.h" +#include "mozilla/dom/PromiseNativeHandler.h" +#include "mozilla/dom/ReferrerPolicyBinding.h" +#include "mozilla/fallible.h" +#include "mozilla/ipc/URIParams.h" #include "mozilla/ipc/URIUtils.h" - -#include "nsEnumeratorUtils.h" +#include "mozilla/mozalloc.h" +#include "mozilla/plugins/PluginTypes.h" +#include "npapi.h" +#include "npfunctions.h" +#include "nsComponentManagerUtils.h" +#include "nsIAsyncShutdown.h" +#include "nsIBlocklistService.h" +#include "nsICategoryManager.h" +#include "nsIChannel.h" +#include "nsIContent.h" +#include "nsIContentPolicy.h" +#include "nsID.h" +#include "nsIEffectiveTLDService.h" +#include "nsIFile.h" +#include "nsIHttpChannel.h" +#include "nsIHttpProtocolHandler.h" +#include "nsIIDNService.h" +#include "nsIInputStream.h" +#include "nsILoadInfo.h" +#include "nsIObjectLoadingContent.h" +#include "nsIObserverService.h" +#include "nsIPluginInstanceOwner.h" +#include "nsIPluginTag.h" +#include "nsIPrefBranch.h" +#include "nsIProtocolHandler.h" +#include "nsIReferrerInfo.h" +#include "nsIRequest.h" +#include "nsIScriptChannel.h" +#include "nsISeekableStream.h" +#include "nsIStringStream.h" +#include "nsISupportsUtils.h" +#include "nsIURI.h" +#include "nsIUploadChannel.h" +#include "nsIWeakReference.h" +#include "nsIWeakReferenceUtils.h" +#include "nsIWritablePropertyBag2.h" +#include "nsLiteralString.h" +#include "nsNPAPIPlugin.h" +#include "nsNPAPIPluginInstance.h" +#include "nsNetCID.h" +#include "nsNetUtil.h" +#include "nsObjectLoadingContent.h" +#include "nsPluginInstanceOwner.h" +#include "nsPluginLogging.h" +#include "nsPluginNativeWindow.h" +#include "nsPluginStreamListenerPeer.h" +#include "nsPluginTags.h" +#include "nsServiceManagerUtils.h" +#include "nsString.h" +#include "nsStringFlags.h" +#include "nsTArray.h" +#include "nsTLiteralString.h" +#include "nsTPromiseFlatString.h" +#include "nsTStringRepr.h" +#include "nsThreadUtils.h" +#include "nsVersionComparator.h" #include "nsXPCOM.h" #include "nsXPCOMCID.h" - #include "nsXULAppAPI.h" - -// for the dialog - -#include "nsNetCID.h" -#include "mozilla/Sprintf.h" -#include "nsThreadUtils.h" -#include "nsQueryObject.h" - -#include "nsIWeakReferenceUtils.h" -#include "nsPluginNativeWindow.h" -#include "nsIContentPolicy.h" -#include "nsContentPolicyUtils.h" -#include "mozilla/ResultExtensions.h" -#include "mozilla/TimeStamp.h" -#include "mozilla/Telemetry.h" -#include "nsIImageLoadingContent.h" -#include "nsVersionComparator.h" -#include "ReferrerInfo.h" - -#include "mozilla/dom/Promise.h" +#include "nscore.h" +#include "plstr.h" #if defined(XP_WIN) # include "nsIWindowMediator.h" @@ -90,8 +117,6 @@ # include #endif -#include "npapi.h" - using namespace mozilla; using mozilla::TimeStamp; using mozilla::dom::Document; diff --git a/dom/power/WakeLock.h b/dom/power/WakeLock.h index 0174ceaa38d8..25038db8b10e 100644 --- a/dom/power/WakeLock.h +++ b/dom/power/WakeLock.h @@ -14,11 +14,12 @@ #include "nsString.h" #include "nsWeakReference.h" #include "nsWrapperCache.h" -#include "mozilla/ErrorResult.h" class nsPIDOMWindowInner; namespace mozilla { +class ErrorResult; + namespace dom { class ContentParent; diff --git a/dom/presentation/PresentationReceiver.h b/dom/presentation/PresentationReceiver.h index eaae182ad044..b71cf0b8945d 100644 --- a/dom/presentation/PresentationReceiver.h +++ b/dom/presentation/PresentationReceiver.h @@ -7,7 +7,6 @@ #ifndef mozilla_dom_PresentationReceiver_h #define mozilla_dom_PresentationReceiver_h -#include "mozilla/ErrorResult.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsIPresentationListener.h" @@ -17,6 +16,8 @@ class nsPIDOMWindowInner; namespace mozilla { +class ErrorResult; + namespace dom { class PresentationConnection; diff --git a/dom/push/PushManager.h b/dom/push/PushManager.h index 261e265f4473..fd2aa38e7dd0 100644 --- a/dom/push/PushManager.h +++ b/dom/push/PushManager.h @@ -29,7 +29,6 @@ #include "nsWrapperCache.h" #include "mozilla/AlreadyAddRefed.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/TypedArray.h" @@ -40,6 +39,8 @@ class nsIGlobalObject; class nsIPrincipal; namespace mozilla { +class ErrorResult; + namespace dom { class OwningArrayBufferViewOrArrayBufferOrString; diff --git a/dom/push/PushSubscription.h b/dom/push/PushSubscription.h index bd09b0f4369d..ed8706eeff06 100644 --- a/dom/push/PushSubscription.h +++ b/dom/push/PushSubscription.h @@ -12,7 +12,6 @@ #include "nsWrapperCache.h" #include "mozilla/AlreadyAddRefed.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" #include "mozilla/dom/BindingDeclarations.h" @@ -23,6 +22,8 @@ class nsIGlobalObject; namespace mozilla { +class ErrorResult; + namespace dom { class Promise; diff --git a/dom/script/ScriptLoader.h b/dom/script/ScriptLoader.h index bd3e0208c8ec..b1f23f28d36c 100644 --- a/dom/script/ScriptLoader.h +++ b/dom/script/ScriptLoader.h @@ -7,27 +7,30 @@ #ifndef mozilla_dom_ScriptLoader_h #define mozilla_dom_ScriptLoader_h +#include "js/TypeDecls.h" #include "nsCOMPtr.h" #include "nsRefPtrHashtable.h" -#include "mozilla/Encoding.h" #include "nsIScriptElement.h" #include "nsCOMArray.h" #include "nsCycleCollectionParticipant.h" #include "nsTArray.h" -#include "nsIIncrementalStreamLoader.h" #include "nsINode.h" #include "nsIObserver.h" +#include "nsIScriptLoaderObserver.h" #include "nsURIHashKey.h" #include "mozilla/CORSMode.h" +#include "mozilla/dom/LoadedScript.h" #include "mozilla/dom/ScriptLoadRequest.h" -#include "mozilla/dom/SRIMetadata.h" -#include "mozilla/dom/SRICheck.h" #include "mozilla/MaybeOneOf.h" #include "mozilla/MozPromise.h" -#include "mozilla/Utf8.h" // mozilla::Utf8Unit -#include "mozilla/Vector.h" #include "ScriptKind.h" +class nsCycleCollectionTraversalCallback; +class nsIChannel; +class nsIConsoleReportCollector; +class nsIContent; +class nsIIncrementalStreamLoader; +class nsIPrincipal; class nsIScriptGlobalObject; class nsIURI; @@ -39,17 +42,26 @@ class SourceText; } // namespace JS namespace mozilla { + +class LazyLogModule; +union Utf8Unit; + namespace dom { class AutoJSAPI; +class DocGroup; class Document; class LoadedScript; class ModuleLoadRequest; class ModuleScript; +class SRICheckDataVerifier; +class SRIMetadata; class ScriptLoadHandler; class ScriptLoader; class ScriptRequestProcessor; +enum class ReferrerPolicy : uint8_t; + class AsyncCompileShutdownObserver final : public nsIObserver { ~AsyncCompileShutdownObserver() { Unregister(); } diff --git a/dom/storage/Storage.h b/dom/storage/Storage.h index 5b659cd04afa..f197e1cb9d32 100644 --- a/dom/storage/Storage.h +++ b/dom/storage/Storage.h @@ -14,6 +14,8 @@ #include "nsCOMPtr.h" #include "nsWrapperCache.h" #include "nsISupports.h" +#include "nsTArrayForwardDeclare.h" +#include "nsString.h" class nsIPrincipal; class nsPIDOMWindowInner; diff --git a/dom/svg/DOMSVGLengthList.h b/dom/svg/DOMSVGLengthList.h index 582d8945c48a..e488fa7286fb 100644 --- a/dom/svg/DOMSVGLengthList.h +++ b/dom/svg/DOMSVGLengthList.h @@ -14,7 +14,6 @@ #include "nsTArray.h" #include "SVGLengthList.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Unused.h" // {cbecb7a4-d6f3-47b5-b5a3-3e5bdbf5b2f9} @@ -26,6 +25,7 @@ } namespace mozilla { +class ErrorResult; namespace dom { class DOMSVGLength; diff --git a/dom/svg/DOMSVGNumber.h b/dom/svg/DOMSVGNumber.h index 186981399189..08804f141372 100644 --- a/dom/svg/DOMSVGNumber.h +++ b/dom/svg/DOMSVGNumber.h @@ -12,13 +12,13 @@ #include "nsCycleCollectionParticipant.h" #include "nsTArray.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" #include "nsWrapperCache.h" #define MOZ_SVG_LIST_INDEX_BIT_COUNT 27 // supports > 134 million list items namespace mozilla { +class ErrorResult; namespace dom { class SVGElement; diff --git a/dom/svg/DOMSVGNumberList.h b/dom/svg/DOMSVGNumberList.h index 68e7b92d4c87..b0fce39d5ca0 100644 --- a/dom/svg/DOMSVGNumberList.h +++ b/dom/svg/DOMSVGNumberList.h @@ -14,10 +14,10 @@ #include "nsTArray.h" #include "SVGNumberList.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" namespace mozilla { +class ErrorResult; namespace dom { class DOMSVGNumber; diff --git a/dom/svg/DOMSVGPathSegList.h b/dom/svg/DOMSVGPathSegList.h index 540df534269a..5fc833a9d28b 100644 --- a/dom/svg/DOMSVGPathSegList.h +++ b/dom/svg/DOMSVGPathSegList.h @@ -13,12 +13,12 @@ #include "nsTArray.h" #include "SVGPathData.h" // IWYU pragma: keep #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" #include "mozilla/dom/SVGElement.h" namespace mozilla { +class ErrorResult; class SVGAnimatedPathSegList; namespace dom { diff --git a/dom/svg/DOMSVGPointList.h b/dom/svg/DOMSVGPointList.h index 364d43ebc0cd..2e5ad109c140 100644 --- a/dom/svg/DOMSVGPointList.h +++ b/dom/svg/DOMSVGPointList.h @@ -13,7 +13,6 @@ #include "nsTArray.h" #include "SVGPointList.h" // IWYU pragma: keep #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" // {61812ad1-c078-4cd1-87e6-bc1c1b8d7284} @@ -26,6 +25,7 @@ namespace mozilla { +class ErrorResult; class SVGAnimatedPointList; namespace dom { diff --git a/dom/svg/DOMSVGTransformList.h b/dom/svg/DOMSVGTransformList.h index bb6dfabce04c..83776fe5f0f4 100644 --- a/dom/svg/DOMSVGTransformList.h +++ b/dom/svg/DOMSVGTransformList.h @@ -14,9 +14,9 @@ #include "SVGTransformList.h" #include "nsTArray.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" namespace mozilla { +class ErrorResult; namespace dom { struct DOMMatrix2DInit; diff --git a/dom/svg/SVGAnimatedRect.h b/dom/svg/SVGAnimatedRect.h index 09c5f34fd46a..ee43014c019c 100644 --- a/dom/svg/SVGAnimatedRect.h +++ b/dom/svg/SVGAnimatedRect.h @@ -10,7 +10,6 @@ #include "nsCycleCollectionParticipant.h" #include "mozilla/dom/SVGElement.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" namespace mozilla { diff --git a/dom/svg/SVGPreserveAspectRatio.h b/dom/svg/SVGPreserveAspectRatio.h index ce041dfcff7d..d591f6f36c9a 100644 --- a/dom/svg/SVGPreserveAspectRatio.h +++ b/dom/svg/SVGPreserveAspectRatio.h @@ -12,10 +12,10 @@ #include "nsWrapperCache.h" #include "nsCycleCollectionParticipant.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/SVGElement.h" namespace mozilla { +class ErrorResult; // These constants represent the range of valid enum values for the // parameter. They exclude the sentinel _UNKNOWN value. diff --git a/dom/system/PathUtils.h b/dom/system/PathUtils.h index 62fe404bf60b..93ab77acd865 100644 --- a/dom/system/PathUtils.h +++ b/dom/system/PathUtils.h @@ -8,16 +8,17 @@ #define mozilla_dom_PathUtils__ #include "mozilla/DataMutex.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Maybe.h" #include "mozilla/MozPromise.h" #include "mozilla/Mutex.h" -#include "mozilla/dom/DOMParser.h" +#include "mozilla/Result.h" #include "mozilla/dom/Promise.h" #include "nsString.h" #include "nsTArray.h" namespace mozilla { +class ErrorResult; + namespace dom { class PathUtils final { diff --git a/dom/u2f/U2F.h b/dom/u2f/U2F.h index a78841c21d3c..1e57e4bb22a6 100644 --- a/dom/u2f/U2F.h +++ b/dom/u2f/U2F.h @@ -13,7 +13,6 @@ #include "mozilla/dom/Nullable.h" #include "mozilla/dom/U2FBinding.h" #include "mozilla/dom/WebAuthnManagerBase.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Maybe.h" #include "mozilla/MozPromise.h" #include "nsProxyRelease.h" @@ -25,6 +24,8 @@ #include "mozilla/dom/Document.h" namespace mozilla { +class ErrorResult; + namespace dom { class WebAuthnMakeCredentialResult; diff --git a/dom/vr/VRDisplay.h b/dom/vr/VRDisplay.h index e37c2826cfda..1f4de0ee0cf0 100644 --- a/dom/vr/VRDisplay.h +++ b/dom/vr/VRDisplay.h @@ -9,7 +9,6 @@ #include -#include "mozilla/ErrorResult.h" #include "mozilla/dom/TypedArray.h" #include "mozilla/dom/VRDisplayBinding.h" #include "mozilla/DOMEventTargetHelper.h" @@ -25,6 +24,8 @@ #include "gfxVR.h" namespace mozilla { +class ErrorResult; + namespace gfx { class VRDisplayClient; class VRDisplayPresentation; diff --git a/dom/webauthn/AuthenticatorAssertionResponse.h b/dom/webauthn/AuthenticatorAssertionResponse.h index 19931a735cb7..899b1369b112 100644 --- a/dom/webauthn/AuthenticatorAssertionResponse.h +++ b/dom/webauthn/AuthenticatorAssertionResponse.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/AuthenticatorResponse.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/CryptoBuffer.h" diff --git a/dom/webauthn/AuthenticatorAttestationResponse.h b/dom/webauthn/AuthenticatorAttestationResponse.h index 896915729d54..45f96c702667 100644 --- a/dom/webauthn/AuthenticatorAttestationResponse.h +++ b/dom/webauthn/AuthenticatorAttestationResponse.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/AuthenticatorResponse.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/CryptoBuffer.h" diff --git a/dom/webauthn/AuthenticatorResponse.h b/dom/webauthn/AuthenticatorResponse.h index 821365d16593..195ec181ac08 100644 --- a/dom/webauthn/AuthenticatorResponse.h +++ b/dom/webauthn/AuthenticatorResponse.h @@ -9,7 +9,6 @@ #include "js/TypeDecls.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/CryptoBuffer.h" #include "nsCycleCollectionParticipant.h" diff --git a/dom/webauthn/PublicKeyCredential.h b/dom/webauthn/PublicKeyCredential.h index da7c98de7866..ffdb2b055e30 100644 --- a/dom/webauthn/PublicKeyCredential.h +++ b/dom/webauthn/PublicKeyCredential.h @@ -11,7 +11,6 @@ #include "mozilla/Attributes.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/Credential.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" #include "mozilla/dom/CryptoBuffer.h" diff --git a/dom/websocket/WebSocket.h b/dom/websocket/WebSocket.h index 563b48834168..52e55361cf5f 100644 --- a/dom/websocket/WebSocket.h +++ b/dom/websocket/WebSocket.h @@ -12,7 +12,6 @@ #include "mozilla/dom/TypedArray.h" #include "mozilla/dom/WebSocketBinding.h" // for BinaryType #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Mutex.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" @@ -28,6 +27,8 @@ class nsIInputStream; class nsITransportProvider; namespace mozilla { +class ErrorResult; + namespace dom { class Blob; diff --git a/dom/workers/WorkerNavigator.h b/dom/workers/WorkerNavigator.h index c6a9f7cd2bae..df8206254948 100644 --- a/dom/workers/WorkerNavigator.h +++ b/dom/workers/WorkerNavigator.h @@ -11,7 +11,6 @@ #include "js/RootingAPI.h" #include "mozilla/AlreadyAddRefed.h" #include "mozilla/Assertions.h" -#include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/workerinternals/RuntimeService.h" @@ -22,6 +21,8 @@ #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace webgpu { class Instance; } // namespace webgpu diff --git a/dom/workers/WorkerScope.h b/dom/workers/WorkerScope.h index 9eb5fe1e8a8c..daf13a15dff1 100644 --- a/dom/workers/WorkerScope.h +++ b/dom/workers/WorkerScope.h @@ -10,7 +10,6 @@ #include "mozilla/Assertions.h" #include "mozilla/Attributes.h" #include "mozilla/DOMEventTargetHelper.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Maybe.h" #include "mozilla/NotNull.h" #include "mozilla/RefPtr.h" @@ -37,6 +36,8 @@ class nsAtom; class nsISerialEventTarget; namespace mozilla { +class ErrorResult; + namespace dom { class AnyCallback; diff --git a/dom/worklet/Worklet.h b/dom/worklet/Worklet.h index a0e1f8058cea..5d7627428f43 100644 --- a/dom/worklet/Worklet.h +++ b/dom/worklet/Worklet.h @@ -8,7 +8,6 @@ #define mozilla_dom_Worklet_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsRefPtrHashtable.h" #include "nsWrapperCache.h" #include "nsCOMPtr.h" @@ -17,6 +16,7 @@ class nsPIDOMWindowInner; namespace mozilla { +class ErrorResult; class WorkletImpl; namespace dom { diff --git a/dom/worklet/WorkletGlobalScope.h b/dom/worklet/WorkletGlobalScope.h index 338b454c0000..3f24415d424b 100644 --- a/dom/worklet/WorkletGlobalScope.h +++ b/dom/worklet/WorkletGlobalScope.h @@ -8,7 +8,6 @@ #define mozilla_dom_WorkletGlobalScope_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Maybe.h" #include "mozilla/TimeStamp.h" #include "mozilla/dom/BindingDeclarations.h" @@ -25,6 +24,7 @@ namespace mozilla { +class ErrorResult; class WorkletImpl; namespace dom { diff --git a/dom/xslt/xpath/XPathEvaluator.h b/dom/xslt/xpath/XPathEvaluator.h index d661c5d82dee..7401d9321440 100644 --- a/dom/xslt/xpath/XPathEvaluator.h +++ b/dom/xslt/xpath/XPathEvaluator.h @@ -9,7 +9,6 @@ #include "mozilla/dom/NonRefcountedDOMObject.h" #include "nsString.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/Document.h" class nsINode; @@ -17,6 +16,8 @@ class txIParseContext; class txResultRecycler; namespace mozilla { +class ErrorResult; + namespace dom { class GlobalObject; diff --git a/dom/xslt/xslt/txMozillaXSLTProcessor.h b/dom/xslt/xslt/txMozillaXSLTProcessor.h index 7582c7333f4b..a02877b175a4 100644 --- a/dom/xslt/xslt/txMozillaXSLTProcessor.h +++ b/dom/xslt/xslt/txMozillaXSLTProcessor.h @@ -13,7 +13,6 @@ #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/ReferrerPolicyBinding.h" #include "mozilla/dom/XSLTProcessorBinding.h" @@ -26,6 +25,8 @@ class txResultRecycler; class txIGlobalParameter; namespace mozilla { +class ErrorResult; + namespace dom { class DocGroup; diff --git a/dom/xul/XULFrameElement.h b/dom/xul/XULFrameElement.h index 251b2195e1c5..72247c7f0684 100644 --- a/dom/xul/XULFrameElement.h +++ b/dom/xul/XULFrameElement.h @@ -8,7 +8,6 @@ #define XULFrameElement_h__ #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/Nullable.h" #include "mozilla/dom/WindowProxyHolder.h" #include "js/TypeDecls.h" @@ -23,6 +22,8 @@ class nsIWebNavigation; class nsFrameLoader; namespace mozilla { +class ErrorResult; + namespace dom { class BrowsingContext; diff --git a/dom/xul/XULPopupElement.h b/dom/xul/XULPopupElement.h index ac5065c88afb..825a69be4049 100644 --- a/dom/xul/XULPopupElement.h +++ b/dom/xul/XULPopupElement.h @@ -8,7 +8,6 @@ #define XULPopupElement_h__ #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" #include "nsString.h" @@ -17,6 +16,8 @@ struct JSContext; namespace mozilla { +class ErrorResult; + namespace dom { class DOMRect; diff --git a/dom/xul/XULTreeElement.h b/dom/xul/XULTreeElement.h index 78e4926986c0..f80f7cbb51e2 100644 --- a/dom/xul/XULTreeElement.h +++ b/dom/xul/XULTreeElement.h @@ -8,7 +8,6 @@ #define XULTreeElement_h__ #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" #include "nsString.h" @@ -20,6 +19,8 @@ class nsTreeColumn; class nsTreeColumns; namespace mozilla { +class ErrorResult; + namespace dom { struct TreeCellInfo; diff --git a/editor/libeditor/ReplaceTextTransaction.h b/editor/libeditor/ReplaceTextTransaction.h index 17651fb68f15..d07bbf018f49 100644 --- a/editor/libeditor/ReplaceTextTransaction.h +++ b/editor/libeditor/ReplaceTextTransaction.h @@ -10,7 +10,6 @@ #include "mozilla/EditorBase.h" #include "mozilla/EditorDOMPoint.h" #include "mozilla/EditTransactionBase.h" -#include "mozilla/ErrorResult.h" #include "mozilla/Maybe.h" #include "mozilla/RefPtr.h" #include "mozilla/dom/Text.h" diff --git a/gfx/2d/BezierUtils.h b/gfx/2d/BezierUtils.h index 2a315380c46f..3ffcd7021452 100644 --- a/gfx/2d/BezierUtils.h +++ b/gfx/2d/BezierUtils.h @@ -7,8 +7,8 @@ #ifndef mozilla_BezierUtils_h_ #define mozilla_BezierUtils_h_ -#include "mozilla/gfx/2D.h" -#include "gfxRect.h" +#include "mozilla/gfx/Point.h" +#include "mozilla/gfx/Types.h" namespace mozilla { namespace gfx { diff --git a/gfx/2d/RecordedEvent.h b/gfx/2d/RecordedEvent.h index 4b68798dd69c..4bbd72e05f92 100644 --- a/gfx/2d/RecordedEvent.h +++ b/gfx/2d/RecordedEvent.h @@ -7,7 +7,6 @@ #ifndef MOZILLA_GFX_RECORDEDEVENT_H_ #define MOZILLA_GFX_RECORDEDEVENT_H_ -#include "2D.h" #include #include #include @@ -15,6 +14,8 @@ #include #include "RecordingTypes.h" +#include "mozilla/gfx/Point.h" +#include "mozilla/gfx/Types.h" #include "mozilla/ipc/ByteBuf.h" namespace mozilla { diff --git a/gfx/gl/GLScreenBuffer.h b/gfx/gl/GLScreenBuffer.h index f796e1568a7e..17a4bd9c2f8c 100644 --- a/gfx/gl/GLScreenBuffer.h +++ b/gfx/gl/GLScreenBuffer.h @@ -15,12 +15,9 @@ #ifndef SCREEN_BUFFER_H_ #define SCREEN_BUFFER_H_ -#include "GLContextTypes.h" -#include "GLDefs.h" -#include "mozilla/gfx/2D.h" +#include "GLTypes.h" #include "mozilla/gfx/Point.h" #include "mozilla/UniquePtr.h" -#include "SurfaceTypes.h" #include #include diff --git a/gfx/ipc/CrossProcessPaint.h b/gfx/ipc/CrossProcessPaint.h index 531589c104eb..eb7907d59b32 100644 --- a/gfx/ipc/CrossProcessPaint.h +++ b/gfx/ipc/CrossProcessPaint.h @@ -9,10 +9,9 @@ #include "nsISupportsImpl.h" #include "mozilla/dom/ipc/IdType.h" -#include "mozilla/dom/Promise.h" -#include "mozilla/dom/DOMRect.h" -#include "mozilla/gfx/2D.h" -#include "mozilla/Maybe.h" +#include "mozilla/gfx/Point.h" +#include "mozilla/gfx/RecordedEvent.h" +#include "mozilla/gfx/Rect.h" #include "mozilla/MozPromise.h" #include "mozilla/ipc/ByteBuf.h" #include "nsColor.h" @@ -20,7 +19,8 @@ #include "nsHashKeys.h" #include "nsRefPtrHashtable.h" #include "nsTHashtable.h" -#include "mozilla/gfx/RecordedEvent.h" + +class nsIDocShell; namespace IPC { template @@ -30,6 +30,8 @@ struct ParamTraits; namespace mozilla { namespace dom { +class DOMRect; +class Promise; class WindowGlobalParent; } // namespace dom diff --git a/gfx/layers/Effects.h b/gfx/layers/Effects.h index 2698e9de2ee4..b138fefcc76e 100644 --- a/gfx/layers/Effects.h +++ b/gfx/layers/Effects.h @@ -14,10 +14,9 @@ #include "mozilla/gfx/Rect.h" // for Rect #include "mozilla/gfx/Types.h" // for SamplingFilter, etc #include "mozilla/layers/CompositorTypes.h" // for EffectTypes, etc -#include "mozilla/layers/LayersTypes.h" -#include "mozilla/layers/TextureHost.h" // for CompositingRenderTarget, etc -#include "mozilla/mozalloc.h" // for operator delete, etc -#include "nscore.h" // for nsACString +#include "mozilla/layers/TextureHost.h" // for CompositingRenderTarget, etc +#include "mozilla/mozalloc.h" // for operator delete, etc +#include "nscore.h" // for nsACString #include "mozilla/EnumeratedArray.h" namespace mozilla { diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index 6f4a3818fece..66fd6d193eea 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -7,28 +7,24 @@ #ifndef GFX_IMAGECONTAINER_H #define GFX_IMAGECONTAINER_H -#include // for uint32_t, uint8_t, uint64_t -#include // for int32_t -#include "gfxTypes.h" -#include "ImageTypes.h" // for ImageFormat, etc +#include // for int32_t, uint32_t, uint8_t, uint64_t +#include "ImageTypes.h" // for ImageFormat, etc +#include "mozilla/AlreadyAddRefed.h" #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2 #include "mozilla/Mutex.h" // for Mutex #include "mozilla/RecursiveMutex.h" // for RecursiveMutex, etc #include "mozilla/ThreadSafeWeakPtr.h" -#include "mozilla/TimeStamp.h" // for TimeStamp -#include "mozilla/gfx/Point.h" // For IntSize +#include "mozilla/TimeStamp.h" // for TimeStamp +#include "mozilla/gfx/Point.h" // For IntSize +#include "mozilla/gfx/Rect.h" #include "mozilla/gfx/Types.h" // For ColorDepth #include "mozilla/layers/LayersTypes.h" // for LayersBackend, etc #include "mozilla/layers/CompositorTypes.h" #include "mozilla/mozalloc.h" // for operator delete, etc -#include "nsCOMPtr.h" // for already_AddRefed #include "nsDebug.h" // for NS_ASSERTION #include "nsISupportsImpl.h" // for Image::Release, etc -#include "nsRect.h" // for mozilla::gfx::IntRect #include "nsTArray.h" // for nsTArray #include "mozilla/Atomics.h" -#include "mozilla/WeakPtr.h" -#include "nsThreadUtils.h" #include "mozilla/gfx/2D.h" #include "nsDataHashtable.h" #include "mozilla/EnumeratedArray.h" diff --git a/gfx/layers/RotatedBuffer.h b/gfx/layers/RotatedBuffer.h index eaaa152e2214..ceda001b031a 100644 --- a/gfx/layers/RotatedBuffer.h +++ b/gfx/layers/RotatedBuffer.h @@ -9,16 +9,15 @@ #include "gfxTypes.h" #include // for uint32_t +#include "mozilla/AlreadyAddRefed.h" // for already_AddRefed #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/gfx/2D.h" // for DrawTarget, etc #include "mozilla/gfx/MatrixFwd.h" // for Matrix #include "mozilla/layers/TextureClient.h" // for TextureClient #include "mozilla/mozalloc.h" // for operator delete -#include "nsCOMPtr.h" // for already_AddRefed #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc #include "nsRegion.h" // for nsIntRegion -#include "LayersTypes.h" namespace mozilla { namespace layers { diff --git a/gfx/layers/apz/public/APZPublicUtils.h b/gfx/layers/apz/public/APZPublicUtils.h index b24130d2ea77..671f3186f4fe 100644 --- a/gfx/layers/apz/public/APZPublicUtils.h +++ b/gfx/layers/apz/public/APZPublicUtils.h @@ -10,25 +10,20 @@ // This file is for APZ-related utilities that need to be consumed from outside // of gfx/layers. For internal utilities, prefer APZUtils.h. -#include // for uint32_t -#include +#include #include -#include "gfxTypes.h" -#include "FrameMetrics.h" -#include "LayersTypes.h" -#include "UnitTransforms.h" -#include "mozilla/gfx/CompositorHitTestInfo.h" -#include "mozilla/gfx/Point.h" -#include "mozilla/DefineEnum.h" -#include "mozilla/EnumSet.h" -#include "mozilla/FloatingPoint.h" -#include "mozilla/ScrollOrigin.h" #include "ScrollAnimationBezierPhysics.h" +#include "Units.h" +#include "mozilla/DefineEnum.h" +#include "mozilla/ScrollOrigin.h" +#include "mozilla/gfx/Point.h" namespace mozilla { namespace layers { +struct FrameMetrics; + // clang-format off MOZ_DEFINE_ENUM_CLASS_WITH_BASE(APZWheelAction, uint8_t, ( Scroll, diff --git a/gfx/layers/apz/util/CheckerboardReportService.h b/gfx/layers/apz/util/CheckerboardReportService.h index ff3da310c258..3062255f95bc 100644 --- a/gfx/layers/apz/util/CheckerboardReportService.h +++ b/gfx/layers/apz/util/CheckerboardReportService.h @@ -10,7 +10,6 @@ #include #include "js/TypeDecls.h" // for JSContext, JSObject -#include "mozilla/ErrorResult.h" // for ErrorResult #include "mozilla/StaticPtr.h" // for StaticRefPtr #include "nsCOMPtr.h" // for nsCOMPtr #include "nsISupports.h" // for NS_INLINE_DECL_REFCOUNTING diff --git a/gfx/layers/composite/TextureHost.h b/gfx/layers/composite/TextureHost.h index 84c8e6e6f392..f6e7a3fa1fb8 100644 --- a/gfx/layers/composite/TextureHost.h +++ b/gfx/layers/composite/TextureHost.h @@ -7,18 +7,17 @@ #ifndef MOZILLA_GFX_TEXTUREHOST_H #define MOZILLA_GFX_TEXTUREHOST_H -#include -#include // for size_t -#include // for uint64_t, uint32_t, uint8_t -#include "gfxTypes.h" +#include // for size_t +#include // for uint64_t, uint32_t, uint8_t #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/Attributes.h" // for override #include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed, etc -#include "mozilla/gfx/2D.h" // for DataSourceSurface -#include "mozilla/gfx/Point.h" // for IntSize, IntPoint -#include "mozilla/gfx/Types.h" // for SurfaceFormat, etc +#include "mozilla/gfx/Logging.h" +#include "mozilla/gfx/Matrix.h" +#include "mozilla/gfx/Point.h" // for IntSize, IntPoint +#include "mozilla/gfx/Rect.h" +#include "mozilla/gfx/Types.h" // for SurfaceFormat, etc #include "mozilla/ipc/FileDescriptor.h" -#include "mozilla/layers/Compositor.h" // for Compositor #include "mozilla/layers/CompositorTypes.h" // for TextureFlags, etc #include "mozilla/layers/LayersTypes.h" // for LayerRenderState, etc #include "mozilla/layers/LayersSurfaces.h" @@ -29,14 +28,18 @@ #include "nsCOMPtr.h" // for already_AddRefed #include "nsDebug.h" // for NS_WARNING #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 "nsRect.h" +#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 MacIOSurface; namespace mozilla { +namespace gfx { +class DataSourceSurface; +} + namespace ipc { class Shmem; } // namespace ipc @@ -66,6 +69,7 @@ class TextureReadLock; class TextureSourceOGL; class TextureSourceD3D11; class TextureSourceBasic; +class TextureSourceProvider; class DataTextureSource; class PTextureParent; class TextureParent; diff --git a/gfx/layers/ipc/ISurfaceAllocator.h b/gfx/layers/ipc/ISurfaceAllocator.h index 736a33a15fc6..740c3b2b3ede 100644 --- a/gfx/layers/ipc/ISurfaceAllocator.h +++ b/gfx/layers/ipc/ISurfaceAllocator.h @@ -16,7 +16,6 @@ #include "nsIMemoryReporter.h" // for nsIMemoryReporter #include "mozilla/Atomics.h" // for Atomic #include "mozilla/layers/LayersMessages.h" // for ShmemSection -#include "LayersTypes.h" namespace mozilla { namespace ipc { diff --git a/gfx/src/nsColor.h b/gfx/src/nsColor.h index 5e850c7f9ae3..e47f5a4575c7 100644 --- a/gfx/src/nsColor.h +++ b/gfx/src/nsColor.h @@ -7,9 +7,7 @@ #ifndef nsColor_h___ #define nsColor_h___ -#include // for size_t #include // for uint8_t, uint32_t -#include "nscore.h" // for nsAString #include "nsCoord.h" // for NSToIntRound #include "nsStringFwd.h" diff --git a/gfx/src/nsCoord.h b/gfx/src/nsCoord.h index 00fa802c3be9..fe90127411d2 100644 --- a/gfx/src/nsCoord.h +++ b/gfx/src/nsCoord.h @@ -7,17 +7,13 @@ #ifndef NSCOORD_H #define NSCOORD_H -#include "mozilla/FloatingPoint.h" - -#include "nsAlgorithm.h" -#include "nscore.h" -#include "nsMathUtils.h" -#include -#include -#include - -#include "nsDebug.h" #include +#include +#include +#include + +#include "mozilla/Assertions.h" +#include "nsMathUtils.h" /* * Basic type used for the geometry classes. diff --git a/gfx/src/nsFont.h b/gfx/src/nsFont.h index 9a454a3064e6..9217aeab104b 100644 --- a/gfx/src/nsFont.h +++ b/gfx/src/nsFont.h @@ -7,19 +7,16 @@ #ifndef nsFont_h___ #define nsFont_h___ -#include // for uint8_t, uint16_t -#include // for int16_t +#include #include "gfxFontFamilyList.h" #include "gfxFontConstants.h" // for NS_FONT_KERNING_AUTO, etc -#include "gfxFontFeatures.h" #include "gfxFontVariations.h" #include "mozilla/FontPropertyTypes.h" -#include "mozilla/RefPtr.h" // for RefPtr #include "mozilla/ServoStyleConstsInlines.h" #include "mozilla/StyleColorInlines.h" // for StyleRGBA -#include "nsCoord.h" // for nscoord #include "nsTArray.h" // for nsTArray +struct gfxFontFeature; struct gfxFontStyle; // Font structure. diff --git a/gfx/src/nsFontMetrics.h b/gfx/src/nsFontMetrics.h index b2f9554a0aef..c98dac005177 100644 --- a/gfx/src/nsFontMetrics.h +++ b/gfx/src/nsFontMetrics.h @@ -15,7 +15,8 @@ #include "nsError.h" // for nsresult #include "nsFont.h" // for nsFont #include "nsISupports.h" // for NS_INLINE_DECL_REFCOUNTING -#include "nscore.h" // for char16_t +#include "nsStyleConsts.h" +#include "nscore.h" // for char16_t class gfxContext; class gfxFontGroup; diff --git a/gfx/src/nsITheme.h b/gfx/src/nsITheme.h index 1208d77c1a17..fdda5e3b5a90 100644 --- a/gfx/src/nsITheme.h +++ b/gfx/src/nsITheme.h @@ -9,9 +9,10 @@ #ifndef nsITheme_h_ #define nsITheme_h_ +#include "mozilla/AlreadyAddRefed.h" #include "nsISupports.h" -#include "nsCOMPtr.h" -#include "nsColor.h" +#include "nsID.h" +#include "nscore.h" #include "Units.h" struct nsRect; diff --git a/gfx/src/nsMargin.h b/gfx/src/nsMargin.h index 7659693bcbc8..cf05894ff375 100644 --- a/gfx/src/nsMargin.h +++ b/gfx/src/nsMargin.h @@ -8,7 +8,6 @@ #define NSMARGIN_H #include "nsCoord.h" -#include "nsPoint.h" #include "mozilla/gfx/BaseMargin.h" #include "mozilla/gfx/Rect.h" diff --git a/gfx/src/nsPoint.h b/gfx/src/nsPoint.h index 9d2932afebc4..86688d214240 100644 --- a/gfx/src/nsPoint.h +++ b/gfx/src/nsPoint.h @@ -7,10 +7,9 @@ #ifndef NSPOINT_H #define NSPOINT_H +#include #include "nsCoord.h" -#include "mozilla/gfx/BaseSize.h" #include "mozilla/gfx/BasePoint.h" -#include "nsSize.h" #include "mozilla/gfx/Point.h" // nsIntPoint represents a point in one of the types of pixels. diff --git a/gfx/src/nsRect.h b/gfx/src/nsRect.h index 53982e57a179..4119b7b83d55 100644 --- a/gfx/src/nsRect.h +++ b/gfx/src/nsRect.h @@ -7,19 +7,15 @@ #ifndef NSRECT_H #define NSRECT_H -#include // for FILE #include // for int32_t, int64_t #include // for min/max #include "mozilla/Likely.h" // for MOZ_UNLIKELY +#include "mozilla/gfx/BaseRect.h" #include "mozilla/gfx/Rect.h" -#include "mozilla/gfx/2D.h" -#include "mozilla/gfx/Logging.h" -#include "nsCoord.h" // for nscoord, etc -#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc -#include "nsPoint.h" // for nsIntPoint, nsPoint -#include "nsMargin.h" // for nsIntMargin, nsMargin -#include "nsSize.h" // for IntSize, nsSize -#include "nscore.h" // for NS_BUILD_REFCNT_LOGGING +#include "nsCoord.h" // for nscoord, etc +#include "nsISupports.h" // for MOZ_COUNT_CTOR, etc +#include "nsPoint.h" // for nsIntPoint, nsPoint +#include "nsSize.h" // for IntSize, nsSize #if !defined(ANDROID) && (defined(__SSE2__) || defined(_M_X64) || \ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)) # if defined(_MSC_VER) && !defined(__clang__) @@ -29,6 +25,8 @@ # endif #endif +struct nsMargin; + typedef mozilla::gfx::IntRect nsIntRect; struct nsRect : public mozilla::gfx::BaseRect // for size_t -#include // for uint32_t, uint64_t -#include // for int32_t +#include // for size_t +#include // for uint32_t, uint64_t #include // for std::ostream #include // for mozilla::Move -#include "mozilla/ArrayView.h" // for ArrayView -#include "mozilla/gfx/Logging.h" +#include "mozilla/ArrayView.h" // for ArrayView #include "mozilla/gfx/MatrixFwd.h" // for mozilla::gfx::Matrix4x4 #include "nsCoord.h" // for nscoord -#include "nsError.h" // for nsresult #include "nsMargin.h" // for nsIntMargin #include "nsPoint.h" // for nsIntPoint, nsPoint #include "nsRect.h" // for mozilla::gfx::IntRect, nsRect diff --git a/gfx/thebes/gfx2DGlue.h b/gfx/thebes/gfx2DGlue.h index 41342bff1ba6..578d7425026e 100644 --- a/gfx/thebes/gfx2DGlue.h +++ b/gfx/thebes/gfx2DGlue.h @@ -12,8 +12,9 @@ #include "gfxRect.h" #include "gfxTypes.h" #include "mozilla/gfx/Matrix.h" +#include "mozilla/gfx/Point.h" #include "mozilla/gfx/Rect.h" -#include "mozilla/gfx/2D.h" +#include "mozilla/gfx/Types.h" namespace mozilla { namespace gfx { diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 636883e8a4ee..2d4b7be96f45 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -7,46 +7,76 @@ #ifndef GFX_FONT_H #define GFX_FONT_H +#include +#include +#include "PLDHashTable.h" +#include "ThebesRLBoxTypes.h" +#include "gfxFontVariations.h" +#include "gfxRect.h" #include "gfxTypes.h" -#include "gfxFontEntry.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/Attributes.h" +#include "mozilla/FontPropertyTypes.h" +#include "mozilla/MemoryReporting.h" +#include "mozilla/RefPtr.h" +#include "mozilla/ServoStyleConsts.h" +#include "mozilla/TypedEnumBits.h" +#include "mozilla/UniquePtr.h" +#include "mozilla/gfx/MatrixFwd.h" +#include "mozilla/gfx/Point.h" +#include "nsCOMPtr.h" +#include "nsColor.h" +#include "nsDataHashtable.h" +#include "nsExpirationTracker.h" +#include "nsFontMetrics.h" +#include "nsHashKeys.h" +#include "nsIMemoryReporter.h" +#include "nsIObserver.h" +#include "nsISupports.h" #include "nsString.h" #include "nsTArray.h" #include "nsTHashtable.h" -#include "nsHashKeys.h" -#include "gfxRect.h" -#include "nsExpirationTracker.h" +#include "nsUnicodeScriptCodes.h" +#include "nscore.h" + +// Only required for function bodys +#include +#include +#include +#include "mozilla/Assertions.h" +#include "mozilla/HashFunctions.h" +#include "mozilla/ServoUtils.h" +#include "mozilla/gfx/2D.h" +#include "gfxFontEntry.h" +#include "gfxFontFeatures.h" +#include "gfxFontUtils.h" #include "gfxPlatform.h" #include "nsAtom.h" -#include "mozilla/HashFunctions.h" -#include "nsIMemoryReporter.h" -#include "nsIObserver.h" -#include "mozilla/MemoryReporting.h" -#include "mozilla/Attributes.h" -#include "mozilla/FontPropertyTypes.h" -#include "mozilla/TypedEnumBits.h" -#include -#include "DrawMode.h" -#include "nsDataHashtable.h" -#include "mozilla/gfx/2D.h" -#include "nsColor.h" -#include "nsFontMetrics.h" -#include "mozilla/ServoUtils.h" -#include "ThebesRLBoxTypes.h" +#include "nsDebug.h" +#include "nsMathUtils.h" -typedef struct _cairo cairo_t; -typedef struct _cairo_scaled_font cairo_scaled_font_t; - -#ifdef DEBUG -# include -#endif - -class gfxTextRun; +class gfxContext; class gfxGlyphExtents; +class gfxMathTable; class gfxPattern; class gfxShapedText; class gfxShapedWord; class gfxSkipChars; -class gfxMathTable; +class gfxTextRun; +class nsIEventTarget; +class nsITimer; +struct gfxTextRunDrawCallbacks; +enum class DrawMode : int; + +namespace mozilla { +class SVGContextPaint; +namespace layout { +class TextDrawTarget; +} +} // namespace mozilla + +typedef struct _cairo cairo_t; +typedef struct _cairo_scaled_font cairo_scaled_font_t; #define FONT_MAX_SIZE 2000.0 @@ -62,16 +92,6 @@ class gfxMathTable; # define OBLIQUE_SKEW_FACTOR 0.25f #endif -struct gfxTextRunDrawCallbacks; - -namespace mozilla { -class SVGContextPaint; - -namespace layout { -class TextDrawTarget; -} -} // namespace mozilla - struct gfxFontStyle { typedef mozilla::FontStretch FontStretch; typedef mozilla::FontSlantStyle FontSlantStyle; diff --git a/gfx/thebes/gfxFontEntry.h b/gfx/thebes/gfxFontEntry.h index 1d69025be0d4..6ab6f08d7f35 100644 --- a/gfx/thebes/gfxFontEntry.h +++ b/gfx/thebes/gfxFontEntry.h @@ -6,54 +6,63 @@ #ifndef GFX_FONTENTRY_H #define GFX_FONTENTRY_H -#include "gfxTypes.h" -#include "nsString.h" -#include "gfxFontConstants.h" -#include "gfxFontFeatures.h" +#include +#include +#include +#include "ThebesRLBoxTypes.h" #include "gfxFontUtils.h" #include "gfxFontVariations.h" -#include "gfxPlatform.h" #include "gfxRect.h" -#include "nsTArray.h" -#include "nsTHashtable.h" -#include "mozilla/HashFunctions.h" -#include "mozilla/MemoryReporting.h" -#include "MainThreadUtils.h" -#include "nsUnicodeScriptCodes.h" -#include "nsDataHashtable.h" +#include "gfxTypes.h" #include "harfbuzz/hb.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/Assertions.h" #include "mozilla/FontPropertyTypes.h" -#include "mozilla/gfx/2D.h" +#include "mozilla/MemoryReporting.h" +#include "mozilla/RefPtr.h" +#include "mozilla/TypedEnumBits.h" #include "mozilla/UniquePtr.h" -#include "mozilla/WeakPtr.h" -#include "ThebesRLBoxTypes.h" -#include +#include "nsDataHashtable.h" +#include "nsDebug.h" +#include "nsHashKeys.h" +#include "nsISupports.h" +#include "nsStringFwd.h" +#include "nsTArray.h" +#include "nsUnicodeScriptCodes.h" +#include "nscore.h" -typedef struct gr_face gr_face; -typedef struct FT_MM_Var_ FT_MM_Var; - -#ifdef DEBUG -# include -#endif - -struct gfxFontStyle; +class FontInfoData; class gfxContext; class gfxFont; class gfxFontFamily; -class gfxUserFontData; +class gfxPlatformFontList; class gfxSVGGlyphs; -class FontInfoData; -struct FontListSizes; +class gfxUserFontData; class nsAtom; +struct FontListSizes; +struct gfxFontFeature; +struct gfxFontStyle; +enum class eFontPresentation : uint8_t; + +namespace IPC { +template +struct ParamTraits; +} namespace mozilla { class SVGContextPaint; namespace fontlist { -struct Family; struct Face; +struct Family; } // namespace fontlist +namespace gfx { +struct DeviceColor; +} } // namespace mozilla +typedef struct gr_face gr_face; +typedef struct FT_MM_Var_ FT_MM_Var; + #define NO_FONT_LANGUAGE_OVERRIDE 0 class gfxCharacterMap : public gfxSparseBitSet { diff --git a/gfx/thebes/gfxFontFamilyList.h b/gfx/thebes/gfxFontFamilyList.h index 94f10a0b93d7..2eb926f97315 100644 --- a/gfx/thebes/gfxFontFamilyList.h +++ b/gfx/thebes/gfxFontFamilyList.h @@ -10,13 +10,12 @@ #include "nsDebug.h" #include "nsISupportsImpl.h" #include "nsString.h" -#include "nsStyleConsts.h" #include "nsUnicharUtils.h" #include "nsTArray.h" #include "mozilla/MemoryReporting.h" #include "mozilla/NotNull.h" +#include "mozilla/ServoStyleConsts.h" #include "mozilla/StaticPtr.h" -#include "mozilla/TimeStamp.h" namespace mozilla { diff --git a/gfx/thebes/gfxFontInfoLoader.h b/gfx/thebes/gfxFontInfoLoader.h index c300621acdc6..2f0b053a9031 100644 --- a/gfx/thebes/gfxFontInfoLoader.h +++ b/gfx/thebes/gfxFontInfoLoader.h @@ -10,12 +10,11 @@ #include "nsIObserver.h" #include "nsITimer.h" #include "nsIThread.h" -#include "nsRefPtrHashtable.h" #include "nsString.h" -#include "gfxFont.h" +#include "gfxFontEntry.h" #include "mozilla/Atomics.h" #include "mozilla/TimeStamp.h" -#include "nsISupportsImpl.h" +#include "nsISupports.h" // data retrieved for a given face diff --git a/gfx/thebes/gfxFontSrcPrincipal.h b/gfx/thebes/gfxFontSrcPrincipal.h index bdf3ce612913..406d26915d4d 100644 --- a/gfx/thebes/gfxFontSrcPrincipal.h +++ b/gfx/thebes/gfxFontSrcPrincipal.h @@ -7,9 +7,10 @@ #define MOZILLA_GFX_FONTSRCPRINCIPAL_H #include "nsCOMPtr.h" -#include "nsIPrincipal.h" #include "PLDHashTable.h" +class nsIPrincipal; + namespace mozilla { namespace net { class nsSimpleURI; diff --git a/gfx/thebes/gfxFontSrcURI.h b/gfx/thebes/gfxFontSrcURI.h index 6a1206218dbc..26ea173b618a 100644 --- a/gfx/thebes/gfxFontSrcURI.h +++ b/gfx/thebes/gfxFontSrcURI.h @@ -7,9 +7,10 @@ #define MOZILLA_GFX_FONTSRCURI_H #include "nsCOMPtr.h" -#include "nsIURI.h" #include "PLDHashTable.h" +class nsIURI; + namespace mozilla { namespace net { class nsSimpleURI; diff --git a/gfx/thebes/gfxFontUtils.h b/gfx/thebes/gfxFontUtils.h index 83d32ffa83da..0c60ca3153bb 100644 --- a/gfx/thebes/gfxFontUtils.h +++ b/gfx/thebes/gfxFontUtils.h @@ -6,20 +6,35 @@ #ifndef GFX_FONT_UTILS_H #define GFX_FONT_UTILS_H -#include "gfxFontVariations.h" +#include +#include +#include +#include #include "gfxPlatform.h" -#include "nsComponentManagerUtils.h" -#include "nsTArray.h" #include "ipc/IPCMessageUtils.h" +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" #include "mozilla/Casting.h" -#include "mozilla/Encoding.h" #include "mozilla/EndianUtils.h" -#include "mozilla/Likely.h" +#include "mozilla/FontPropertyTypes.h" #include "mozilla/MemoryReporting.h" #include "mozilla/UniquePtr.h" - +#include "nsStringFwd.h" +#include "nsTArray.h" +#include "nscore.h" #include "zlib.h" -#include + +class PickleIterator; +class gfxFontEntry; +struct gfxFontVariationAxis; +struct gfxFontVariationInstance; + +namespace mozilla { +class Encoding; +namespace gfx { +struct DeviceColor; +} +} // namespace mozilla /* Bug 341128 - w32api defines min/max which causes problems with */ #ifdef __MINGW32__ diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 3abf029880df..919992d852ed 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -7,7 +7,6 @@ #define GFX_PLATFORM_H #include "mozilla/FontPropertyTypes.h" -#include "mozilla/Logging.h" #include "mozilla/gfx/Types.h" #include "nsTArray.h" #include "nsString.h" @@ -15,9 +14,7 @@ #include "nsUnicodeScriptCodes.h" #include "gfxTypes.h" -#include "gfxBlur.h" #include "gfxSkipChars.h" -#include "nsRect.h" #include "qcms.h" @@ -25,6 +22,7 @@ #include "GfxInfoCollector.h" #include "mozilla/layers/CompositorTypes.h" +#include "mozilla/layers/LayersTypes.h" #include "mozilla/layers/MemoryPressureObserver.h" class gfxASurface; @@ -45,6 +43,7 @@ typedef struct FT_LibraryRec_* FT_Library; namespace mozilla { class FontFamilyList; +class LogModule; namespace layers { class FrameStats; } diff --git a/gfx/thebes/gfxUserFontSet.h b/gfx/thebes/gfxUserFontSet.h index 8ce181f498e2..71ae925f1372 100644 --- a/gfx/thebes/gfxUserFontSet.h +++ b/gfx/thebes/gfxUserFontSet.h @@ -6,33 +6,53 @@ #ifndef GFX_USER_FONT_SET_H #define GFX_USER_FONT_SET_H +#include +#include "PLDHashTable.h" #include "gfxFontEntry.h" -#include "gfxFontFamilyList.h" -#include "gfxFontSrcPrincipal.h" -#include "gfxFontSrcURI.h" -#include "nsProxyRelease.h" -#include "nsRefPtrHashtable.h" -#include "nsCOMPtr.h" -#include "nsIFontLoadCompleteCallback.h" -#include "nsIMemoryReporter.h" -#include "nsIRunnable.h" -#include "nsIScriptError.h" -#include "nsIReferrerInfo.h" -#include "nsURIHashKey.h" +#include "gfxFontUtils.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/Attributes.h" #include "mozilla/FontPropertyTypes.h" -#include "gfxFontConstants.h" -#include "mozilla/LazyIdleThread.h" -#include "mozilla/StaticPtr.h" +#include "mozilla/MemoryReporting.h" +#include "mozilla/RefPtr.h" +#include "nsCOMPtr.h" +#include "nsHashKeys.h" +#include "nsIMemoryReporter.h" +#include "nsIObserver.h" +#include "nsIScriptError.h" +#include "nsISupports.h" +#include "nsRefPtrHashtable.h" +#include "nsString.h" +#include "nsTArray.h" +#include "nscore.h" + +// Only needed for function bodies. +#include // for move, forward +#include "MainThreadUtils.h" // for NS_IsMainThread +#include "gfxFontFeatures.h" // for gfxFontFeature +#include "gfxFontSrcPrincipal.h" // for gfxFontSrcPrincipal +#include "gfxFontSrcURI.h" // for gfxFontSrcURI +#include "mozilla/Assertions.h" // for AssertionConditionType, MOZ_ASSERT_HELPER2, MOZ_ASSERT, MOZ_ASSERT_UNREACHABLE, MOZ_ASSER... +#include "mozilla/HashFunctions.h" // for HashBytes, HashGeneric +#include "mozilla/TimeStamp.h" // for TimeStamp +#include "mozilla/gfx/FontVariation.h" // for FontVariation +#include "nsDebug.h" // for NS_WARNING +#include "nsIReferrerInfo.h" // for nsIReferrerInfo class gfxFont; +class gfxUserFontSet; +class nsIFontLoadCompleteCallback; +class nsIRunnable; +struct gfxFontStyle; +struct gfxFontVariationAxis; +struct gfxFontVariationInstance; +template +class nsMainThreadPtrHandle; namespace mozilla { +class LogModule; class PostTraversalTask; enum class StyleFontDisplay : uint8_t; - -namespace gfx { -struct FontVariation; -} } // namespace mozilla class nsFontFaceLoader; diff --git a/image/imgIContainer.idl b/image/imgIContainer.idl index 8e6c5f89498c..41cd795cebd9 100644 --- a/image/imgIContainer.idl +++ b/image/imgIContainer.idl @@ -10,10 +10,8 @@ webidl Document; %{C++ #include "ImgDrawResult.h" -#include "gfxContext.h" -#include "gfxMatrix.h" -#include "gfxRect.h" -#include "mozilla/gfx/2D.h" +#include "gfxPoint.h" +#include "mozilla/gfx/Types.h" #include "mozilla/AspectRatio.h" #include "mozilla/Maybe.h" #include "mozilla/RefPtr.h" @@ -22,7 +20,15 @@ webidl Document; #include "nsTArray.h" #include "limits.h" +class gfxContext; + namespace mozilla { +struct AspectRatio; + +namespace gfx { +class SourceSurface; +} + namespace layers { class LayerManager; class ImageContainer; diff --git a/intl/l10n/FluentBundle.h b/intl/l10n/FluentBundle.h index b0f23163d06b..8a7e22706acf 100644 --- a/intl/l10n/FluentBundle.h +++ b/intl/l10n/FluentBundle.h @@ -8,7 +8,6 @@ #define mozilla_intl_l10n_FluentBundle_h #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" #include "mozilla/dom/FluentBinding.h" @@ -19,6 +18,7 @@ class nsIGlobalObject; namespace mozilla { +class ErrorResult; namespace dom { struct FluentMessage; diff --git a/intl/l10n/FluentResource.h b/intl/l10n/FluentResource.h index d51ce9f76c59..1d7f8b5e7eac 100644 --- a/intl/l10n/FluentResource.h +++ b/intl/l10n/FluentResource.h @@ -8,7 +8,6 @@ #define mozilla_intl_l10n_FluentResource_h #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/ErrorResult.h" #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" #include "mozilla/dom/FluentBinding.h" diff --git a/intl/l10n/Localization.h b/intl/l10n/Localization.h index d7e78e610d3b..3595721cb20d 100644 --- a/intl/l10n/Localization.h +++ b/intl/l10n/Localization.h @@ -10,7 +10,6 @@ #include "nsWeakReference.h" #include "nsIObserver.h" #include "mozILocalization.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/Promise.h" #include "mozilla/dom/LocalizationBinding.h" #include "mozilla/dom/PromiseNativeHandler.h" @@ -20,6 +19,8 @@ class nsIGlobalObject; using namespace mozilla::dom; namespace mozilla { +class ErrorResult; + namespace intl { typedef Record> L10nArgs; diff --git a/ipc/chromium/src/base/process_util.h b/ipc/chromium/src/base/process_util.h index a6204d33475f..8876d79936f6 100644 --- a/ipc/chromium/src/base/process_util.h +++ b/ipc/chromium/src/base/process_util.h @@ -13,6 +13,7 @@ #include "base/basictypes.h" #if defined(OS_WIN) +# include "mozilla/ipc/EnvironmentMap.h" # include # include #elif defined(OS_LINUX) || defined(__GLIBC__) @@ -23,19 +24,18 @@ # include #endif -#include +#include #include #include +#include #include -#include "base/command_line.h" #include "base/process.h" #include "mozilla/UniquePtr.h" -#include "mozilla/ipc/EnvironmentMap.h" #if defined(MOZ_ENABLE_FORKSERVER) -# include "nsString.h" +# include "nsStringFwd.h" # include "mozilla/Tuple.h" # include "mozilla/ipc/FileDescriptorShuffle.h" @@ -50,6 +50,8 @@ class FileDescriptor; struct kinfo_proc; #endif +class CommandLine; + namespace base { enum ProcessArchitecture { diff --git a/ipc/chromium/src/base/process_util_linux.cc b/ipc/chromium/src/base/process_util_linux.cc index 9cd7f26d9ff6..d3d946956242 100644 --- a/ipc/chromium/src/base/process_util_linux.cc +++ b/ipc/chromium/src/base/process_util_linux.cc @@ -31,6 +31,7 @@ using namespace mozilla::ipc; #endif +#include "base/command_line.h" #include "base/eintr_wrapper.h" #include "base/logging.h" #include "mozilla/ipc/FileDescriptor.h" diff --git a/ipc/chromium/src/base/process_util_mac.mm b/ipc/chromium/src/base/process_util_mac.mm index 30917ba02235..44db73c74024 100644 --- a/ipc/chromium/src/base/process_util_mac.mm +++ b/ipc/chromium/src/base/process_util_mac.mm @@ -12,6 +12,7 @@ #include +#include "base/command_line.h" #include "base/eintr_wrapper.h" #include "base/logging.h" #include "mozilla/ipc/FileDescriptorShuffle.h" diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc index 513396d87e56..929d0cba35d7 100644 --- a/ipc/chromium/src/base/process_util_posix.cc +++ b/ipc/chromium/src/base/process_util_posix.cc @@ -20,6 +20,7 @@ #include #include "base/basictypes.h" +#include "base/command_line.h" #include "base/eintr_wrapper.h" #include "base/logging.h" #include "base/platform_thread.h" diff --git a/ipc/chromium/src/base/process_util_win.cc b/ipc/chromium/src/base/process_util_win.cc index e79f3054eb16..c37b6ebe2e0c 100644 --- a/ipc/chromium/src/base/process_util_win.cc +++ b/ipc/chromium/src/base/process_util_win.cc @@ -18,6 +18,7 @@ # define STDOUT_FILENO 1 #endif +#include "base/command_line.h" #include "base/histogram.h" #include "base/logging.h" #include "base/win_util.h" diff --git a/ipc/chromium/src/chrome/common/ipc_channel.h b/ipc/chromium/src/chrome/common/ipc_channel.h index 12a7bffb8640..92280bb0ebb0 100644 --- a/ipc/chromium/src/chrome/common/ipc_channel.h +++ b/ipc/chromium/src/chrome/common/ipc_channel.h @@ -7,10 +7,10 @@ #ifndef CHROME_COMMON_IPC_CHANNEL_H_ #define CHROME_COMMON_IPC_CHANNEL_H_ -#include - +#include #include -#include "chrome/common/ipc_message.h" +#include "base/basictypes.h" +#include "build/build_config.h" #include "mozilla/UniquePtr.h" #ifdef OS_WIN @@ -19,6 +19,8 @@ namespace IPC { +class Message; + //------------------------------------------------------------------------------ class Channel { diff --git a/ipc/chromium/src/chrome/common/ipc_message_utils.h b/ipc/chromium/src/chrome/common/ipc_message_utils.h index 910f673282e6..d8bed78ac7b9 100644 --- a/ipc/chromium/src/chrome/common/ipc_message_utils.h +++ b/ipc/chromium/src/chrome/common/ipc_message_utils.h @@ -7,16 +7,19 @@ #ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_ #define CHROME_COMMON_IPC_MESSAGE_UTILS_H_ +#include +#include #include #include -#include -#include - -#include "base/file_path.h" -#include "base/process.h" +#include +#include "ErrorList.h" +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "base/logging.h" +#include "base/pickle.h" #include "base/string_util.h" -#include "base/string16.h" -#include "base/time.h" +#include "build/build_config.h" +#include "chrome/common/ipc_message.h" #if defined(OS_POSIX) # include "chrome/common/file_descriptor_set_posix.h" @@ -24,7 +27,6 @@ #if defined(OS_WIN) # include "windows.h" #endif -#include "chrome/common/ipc_message.h" template class RefPtr; diff --git a/ipc/glue/BackgroundUtils.h b/ipc/glue/BackgroundUtils.h index b2b0f66fe8cc..8a9c4e2aa0fa 100644 --- a/ipc/glue/BackgroundUtils.h +++ b/ipc/glue/BackgroundUtils.h @@ -9,7 +9,7 @@ #include "ipc/IPCMessageUtils.h" #include "mozilla/Attributes.h" -#include "mozilla/BasePrincipal.h" +#include "mozilla/OriginAttributes.h" #include "nsCOMPtr.h" #include "nscore.h" @@ -48,6 +48,11 @@ struct ParamTraits } // namespace IPC namespace mozilla { + +namespace dom { +class Document; +} + namespace net { class ChildLoadInfoForwarderArgs; class LoadInfoArgs; diff --git a/js/public/Value.h b/js/public/Value.h index 3228c811c397..de73fb6fdd0c 100644 --- a/js/public/Value.h +++ b/js/public/Value.h @@ -11,8 +11,6 @@ #include "mozilla/Attributes.h" #include "mozilla/Casting.h" -#include "mozilla/Compiler.h" -#include "mozilla/EndianUtils.h" #include "mozilla/FloatingPoint.h" #include "mozilla/Likely.h" #include "mozilla/Maybe.h" @@ -22,9 +20,8 @@ #include "js-config.h" #include "jstypes.h" -#include "js/GCAPI.h" #include "js/RootingAPI.h" -#include "js/Utility.h" +#include "js/TypeDecls.h" namespace JS { class JS_PUBLIC_API Value; diff --git a/layout/base/GeometryUtils.h b/layout/base/GeometryUtils.h index d6fe8d7f1227..eabbad530500 100644 --- a/layout/base/GeometryUtils.h +++ b/layout/base/GeometryUtils.h @@ -7,7 +7,6 @@ #ifndef MOZILLA_GEOMETRYUTILS_H_ #define MOZILLA_GEOMETRYUTILS_H_ -#include "mozilla/ErrorResult.h" #include "nsTArray.h" #include "nsCOMPtr.h" @@ -19,6 +18,7 @@ class nsINode; namespace mozilla { +class ErrorResult; namespace dom { struct BoxQuadOptions; diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index dbaed664c605..787b2c5dc06d 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -13,7 +13,6 @@ #include // for FILE definition #include "FrameMetrics.h" -#include "GeckoProfiler.h" #include "TouchManager.h" #include "Units.h" #include "Visibility.h" @@ -96,6 +95,10 @@ class GeckoMVMContext; class OverflowChangedTracker; class StyleSheet; +#ifdef MOZ_GECKO_PROFILER +class ProfileChunkedBuffer; +#endif + #ifdef ACCESSIBILITY namespace a11y { class DocAccessible; diff --git a/layout/base/PresShellInlines.h b/layout/base/PresShellInlines.h index cb79a245b2e2..6a6d858e38de 100644 --- a/layout/base/PresShellInlines.h +++ b/layout/base/PresShellInlines.h @@ -7,6 +7,7 @@ #ifndef mozilla_PresShellInlines_h #define mozilla_PresShellInlines_h +#include "GeckoProfiler.h" #include "mozilla/PresShell.h" #include "mozilla/dom/Document.h" #include "mozilla/dom/Element.h" diff --git a/layout/base/SurfaceFromElementResult.h b/layout/base/SurfaceFromElementResult.h index 4cf714c478d1..65c0e24f983f 100644 --- a/layout/base/SurfaceFromElementResult.h +++ b/layout/base/SurfaceFromElementResult.h @@ -7,6 +7,7 @@ #ifndef mozilla_SurfaceFromElementResult_h #define mozilla_SurfaceFromElementResult_h +#include "ImageContainer.h" #include "gfxTypes.h" #include "mozilla/gfx/Point.h" #include "nsCOMPtr.h" @@ -27,10 +28,6 @@ namespace gfx { class SourceSurface; } -namespace layers { -class Image; -} - struct DirectDrawInfo { /* imgIContainer to directly draw to a context */ nsCOMPtr mImgContainer; diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 5f5947ccd3f8..b55d4f1c2928 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -12,7 +12,6 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/LookAndFeel.h" #include "mozilla/Maybe.h" -#include "mozilla/ReflowOutput.h" #include "mozilla/RelativeTo.h" #include "mozilla/StaticPrefs_nglayout.h" #include "mozilla/SurfaceFromElementResult.h" @@ -20,18 +19,15 @@ #include "mozilla/ToString.h" #include "mozilla/TypedEnumBits.h" #include "mozilla/UniquePtr.h" +#include "mozilla/WritingModes.h" #include "mozilla/layout/FrameChildList.h" #include "mozilla/layers/ScrollableLayerGuid.h" #include "mozilla/gfx/2D.h" -#include "gfx2DGlue.h" #include "gfxPoint.h" #include "nsBoundingMetrics.h" #include "nsCSSPropertyIDSet.h" -#include "nsClassHashtable.h" -#include "nsGkAtoms.h" #include "nsThreadUtils.h" -#include "ImageContainer.h" // for layers::Image #include "Units.h" #include "mozilla/layers/LayersTypes.h" #include @@ -80,6 +76,7 @@ class EventListenerManager; enum class LayoutFrameType : uint8_t; struct IntrinsicSize; struct ContainerLayerParameters; +class ReflowOutput; class WritingMode; class DisplayItemClip; class EffectSet; diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index b0e98754e2ff..6f855fdd4935 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -18,7 +18,6 @@ #include "mozilla/PreferenceSheet.h" #include "mozilla/PresShellForwards.h" #include "mozilla/ScrollStyles.h" -#include "mozilla/ServoStyleSet.h" #include "mozilla/TimeStamp.h" #include "mozilla/UniquePtr.h" #include "mozilla/WeakPtr.h" @@ -27,23 +26,20 @@ #include "nsCompatibility.h" #include "nsCoord.h" #include "nsCOMPtr.h" +#include "nsHashKeys.h" #include "nsRect.h" #include "nsStringFwd.h" -#include "gfxFontConstants.h" +#include "nsTHashtable.h" #include "nsAtom.h" -#include "nsCRT.h" #include "nsIWidgetListener.h" // for nsSizeMode #include "nsGkAtoms.h" #include "nsCycleCollectionParticipant.h" #include "nsChangeHint.h" -#include #include "gfxTypes.h" #include "gfxRect.h" #include "nsTArray.h" -#include "prclist.h" #include "nsThreadUtils.h" #include "Units.h" -#include "prenv.h" class nsBidi; class nsIPrintSettings; @@ -81,6 +77,7 @@ class EventStateManager; class CounterStyleManager; class PresShell; class RestyleManager; +class ServoStyleSet; class StaticPresData; struct MediaFeatureChange; enum class MediaFeatureChangePropagation : uint8_t; diff --git a/layout/generic/nsIAnonymousContentCreator.h b/layout/generic/nsIAnonymousContentCreator.h index 789759202890..2d27e4455f58 100644 --- a/layout/generic/nsIAnonymousContentCreator.h +++ b/layout/generic/nsIAnonymousContentCreator.h @@ -13,13 +13,11 @@ #define nsIAnonymousContentCreator_h___ #include "mozilla/AnonymousContentKey.h" -#include "mozilla/ComputedStyle.h" #include "nsQueryFrame.h" #include "nsTArrayForwardDeclare.h" class nsIContent; -class nsIFrame; /** * Any source for anonymous content can implement this interface to provide it. diff --git a/layout/style/ComputedStyleInlines.h b/layout/style/ComputedStyleInlines.h index 56a3054ec0c5..81646c95d116 100644 --- a/layout/style/ComputedStyleInlines.h +++ b/layout/style/ComputedStyleInlines.h @@ -15,9 +15,11 @@ #define ComputedStyleInlines_h #include "mozilla/ComputedStyle.h" -#include "mozilla/ServoComputedDataInlines.h" -#include "mozilla/ServoUtils.h" -#include "nsPresContext.h" + +#include "MainThreadUtils.h" +#include "mozilla/Assertions.h" +#include "mozilla/Unused.h" +#include "nsStyleStruct.h" namespace mozilla { diff --git a/layout/style/GroupRule.h b/layout/style/GroupRule.h index df357f446654..258e23def11a 100644 --- a/layout/style/GroupRule.h +++ b/layout/style/GroupRule.h @@ -13,7 +13,6 @@ #define mozilla_css_GroupRule_h__ #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/MemoryReporting.h" #include "mozilla/ServoCSSRuleList.h" #include "mozilla/css/Rule.h" @@ -21,6 +20,7 @@ namespace mozilla { +class ErrorResult; class StyleSheet; namespace dom { diff --git a/layout/style/MediaList.h b/layout/style/MediaList.h index 338c0f3cdc88..fd8ca84fc17c 100644 --- a/layout/style/MediaList.h +++ b/layout/style/MediaList.h @@ -10,7 +10,6 @@ #define mozilla_dom_MediaList_h #include "mozilla/dom/BindingDeclarations.h" -#include "mozilla/ErrorResult.h" #include "mozilla/ServoBindingTypes.h" #include "mozilla/ServoUtils.h" @@ -19,6 +18,7 @@ class nsMediaQueryResultCacheKey; namespace mozilla { +class ErrorResult; class StyleSheet; namespace dom { diff --git a/layout/style/StyleSheet.h b/layout/style/StyleSheet.h index 1696e25dde17..0eb0eb7ac423 100644 --- a/layout/style/StyleSheet.h +++ b/layout/style/StyleSheet.h @@ -14,17 +14,17 @@ #include "mozilla/MozPromise.h" #include "mozilla/RefPtr.h" #include "mozilla/ServoBindingTypes.h" -#include "mozilla/ServoUtils.h" +#include "mozilla/ServoTypes.h" #include "mozilla/StyleSheetInfo.h" -#include "mozilla/URLExtraData.h" #include "nsICSSLoaderObserver.h" +#include "nsIPrincipal.h" #include "nsWrapperCache.h" -#include "nsCompatibility.h" #include "nsStringFwd.h" +class nsIGlobalObject; class nsINode; class nsIPrincipal; -struct RawServoSharedMemoryBuilder; +struct ServoCssRules; class nsIReferrerInfo; namespace mozilla { @@ -53,7 +53,6 @@ class CSSRuleList; class DocumentOrShadowRoot; class MediaList; class ShadowRoot; -class SRIMetadata; struct CSSStyleSheetInit; } // namespace dom diff --git a/layout/style/StyleSheetInfo.h b/layout/style/StyleSheetInfo.h index 1fb111b955dd..158a731ddaa7 100644 --- a/layout/style/StyleSheetInfo.h +++ b/layout/style/StyleSheetInfo.h @@ -11,10 +11,11 @@ #include "mozilla/dom/SRIMetadata.h" #include "mozilla/CORSMode.h" -#include "nsIURI.h" #include "nsIReferrerInfo.h" class nsIPrincipal; +class nsIURI; +struct RawServoStyleSheetContents; namespace mozilla { class StyleSheet; diff --git a/layout/style/URLExtraData.h b/layout/style/URLExtraData.h index e2eebad91c0c..71c002de90a8 100644 --- a/layout/style/URLExtraData.h +++ b/layout/style/URLExtraData.h @@ -11,7 +11,6 @@ #include -#include "ReferrerInfo.h" #include "mozilla/StaticPtr.h" #include "mozilla/UserAgentStyleSheetID.h" #include "mozilla/dom/URL.h" diff --git a/layout/style/nsICSSDeclaration.h b/layout/style/nsICSSDeclaration.h index e249f6637589..8ec2d275d59e 100644 --- a/layout/style/nsICSSDeclaration.h +++ b/layout/style/nsICSSDeclaration.h @@ -24,12 +24,13 @@ #include "mozilla/ErrorResult.h" #include "nsWrapperCache.h" #include "nsStringFwd.h" -#include "mozilla/ErrorResult.h" #include "nsCOMPtr.h" class nsINode; class nsIPrincipal; namespace mozilla { +class ErrorResult; + namespace css { class Rule; } // namespace css diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index cf934e291f66..2a748455078a 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -16,8 +16,6 @@ #include "mozilla/Maybe.h" #include "mozilla/ServoStyleConstsInlines.h" #include "mozilla/StaticPrefs_layout.h" -#include "mozilla/StaticPtr.h" -#include "mozilla/StyleColorInlines.h" #include "mozilla/UniquePtr.h" #include "nsColor.h" #include "nsCoord.h" @@ -27,28 +25,21 @@ #include "nsStyleConsts.h" #include "nsChangeHint.h" #include "nsTimingFunction.h" -#include "nsCOMPtr.h" #include "nsTArray.h" -#include "nsCSSValue.h" #include "imgIContainer.h" #include "imgRequestProxy.h" -#include "Orientation.h" #include "CounterStyleManager.h" #include // offsetof() -#include #include "X11UndefineNone.h" class nsIFrame; class nsIURI; class nsTextFrame; -class nsPresContext; struct nsStyleDisplay; struct nsStyleVisibility; namespace mozilla { class ComputedStyle; -namespace dom { -class ImageTracker; -} // namespace dom + } // namespace mozilla namespace mozilla { diff --git a/mfbt/ArrayUtils.h b/mfbt/ArrayUtils.h index 89fcfdc820a7..0d55bb1f6546 100644 --- a/mfbt/ArrayUtils.h +++ b/mfbt/ArrayUtils.h @@ -14,18 +14,22 @@ #include "mozilla/Assertions.h" #include "mozilla/Attributes.h" -#include #include +#include #ifdef __cplusplus +# include # include # include "mozilla/Alignment.h" -# include "mozilla/Array.h" -# include "mozilla/EnumeratedArray.h" namespace mozilla { +template +class Array; +template +class EnumeratedArray; + /* * Safely subtract two pointers when it is known that aEnd >= aBegin, yielding a * size_t result. diff --git a/mfbt/Buffer.h b/mfbt/Buffer.h index 4d90ee874135..c4e0a4be92e0 100644 --- a/mfbt/Buffer.h +++ b/mfbt/Buffer.h @@ -5,9 +5,10 @@ #ifndef mozilla_Buffer_h #define mozilla_Buffer_h -#include +#include #include +#include "mozilla/Assertions.h" #include "mozilla/Maybe.h" #include "mozilla/Span.h" #include "mozilla/UniquePtr.h" diff --git a/mfbt/BufferList.h b/mfbt/BufferList.h index 7bcba36b61b7..b59a4c27cabb 100644 --- a/mfbt/BufferList.h +++ b/mfbt/BufferList.h @@ -7,17 +7,14 @@ #ifndef mozilla_BufferList_h #define mozilla_BufferList_h -#include - #include -#include -#include +#include +#include -#include "mozilla/AllocPolicy.h" +#include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" #include "mozilla/Maybe.h" #include "mozilla/MemoryReporting.h" -#include "mozilla/ScopeExit.h" -#include "mozilla/Types.h" #include "mozilla/Vector.h" // BufferList represents a sequence of buffers of data. A BufferList can choose diff --git a/mfbt/DoublyLinkedList.h b/mfbt/DoublyLinkedList.h index 0b93f85ff228..f9c374550622 100644 --- a/mfbt/DoublyLinkedList.h +++ b/mfbt/DoublyLinkedList.h @@ -10,7 +10,9 @@ #define mozilla_DoublyLinkedList_h #include +#include #include +#include #include "mozilla/Assertions.h" diff --git a/mfbt/FloatingPoint.h b/mfbt/FloatingPoint.h index 28d41ef19984..a2625a4e2232 100644 --- a/mfbt/FloatingPoint.h +++ b/mfbt/FloatingPoint.h @@ -20,7 +20,6 @@ #include #include #include -#include namespace mozilla { diff --git a/mfbt/LinkedList.h b/mfbt/LinkedList.h index 5ca0c5d33d4e..a05e21cd2f9c 100644 --- a/mfbt/LinkedList.h +++ b/mfbt/LinkedList.h @@ -64,6 +64,7 @@ #ifndef mozilla_LinkedList_h #define mozilla_LinkedList_h +#include #include #include "mozilla/Assertions.h" diff --git a/mfbt/PodOperations.h b/mfbt/PodOperations.h index c76e1b2557c0..f4e5da4c799c 100644 --- a/mfbt/PodOperations.h +++ b/mfbt/PodOperations.h @@ -15,16 +15,17 @@ #ifndef mozilla_PodOperations_h #define mozilla_PodOperations_h -#include "mozilla/Array.h" -#include "mozilla/ArrayUtils.h" +#include "mozilla/Assertions.h" #include "mozilla/Attributes.h" -#include #include #include namespace mozilla { +template +class Array; + template class NotNull; diff --git a/mfbt/SPSCQueue.h b/mfbt/SPSCQueue.h index 4d872251086c..0e116c546831 100644 --- a/mfbt/SPSCQueue.h +++ b/mfbt/SPSCQueue.h @@ -14,9 +14,11 @@ #include "mozilla/PodOperations.h" #include #include -#include +#include +#include #include #include +#include namespace mozilla { diff --git a/mfbt/SmallPointerArray.h b/mfbt/SmallPointerArray.h index 7863f6e04e52..c63e3980f9a5 100644 --- a/mfbt/SmallPointerArray.h +++ b/mfbt/SmallPointerArray.h @@ -13,7 +13,7 @@ #include "mozilla/PodOperations.h" #include -#include +#include #include #include diff --git a/mfbt/Span.h b/mfbt/Span.h index dc14de213728..6f1d1d437200 100644 --- a/mfbt/Span.h +++ b/mfbt/Span.h @@ -22,22 +22,25 @@ #ifndef mozilla_Span_h #define mozilla_Span_h -#include #include +#include +#include #include #include #include #include #include -#include "mozilla/Array.h" #include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" #include "mozilla/Casting.h" -#include "mozilla/IntegerTypeTraits.h" #include "mozilla/UniquePtr.h" namespace mozilla { +template +class Array; + // Stuff from gsl_util // narrow_cast(): a searchable way to do narrowing casts of values diff --git a/modules/libpref/Preferences.h b/modules/libpref/Preferences.h index 4b5f2c1f2284..137f0fdb75de 100644 --- a/modules/libpref/Preferences.h +++ b/modules/libpref/Preferences.h @@ -15,7 +15,6 @@ #include "mozilla/Atomics.h" #include "mozilla/MemoryReporting.h" -#include "mozilla/Result.h" #include "mozilla/StaticPtr.h" #include "nsCOMPtr.h" #include "nsIObserver.h" diff --git a/netwerk/base/nsILoadInfo.idl b/netwerk/base/nsILoadInfo.idl index 34946f980b88..be5af09a5df1 100644 --- a/netwerk/base/nsILoadInfo.idl +++ b/netwerk/base/nsILoadInfo.idl @@ -21,8 +21,8 @@ webidl BrowsingContext; native LoadContextRef(already_AddRefed); %{C++ #include "nsTArray.h" -#include "mozilla/BasePrincipal.h" #include "mozilla/LoadTainting.h" +#include "mozilla/OriginAttributes.h" #include "mozilla/UniquePtr.h" #include "nsStringFwd.h" diff --git a/netwerk/base/nsNetworkInfoService.h b/netwerk/base/nsNetworkInfoService.h index 7f40b840e623..d7b449b96fcd 100644 --- a/netwerk/base/nsNetworkInfoService.h +++ b/netwerk/base/nsNetworkInfoService.h @@ -8,7 +8,6 @@ #define mozilla_net_nsNetworkInfoService_h #include "nsISupportsImpl.h" -#include "mozilla/ErrorResult.h" #include "nsINetworkInfoService.h" diff --git a/netwerk/ipc/DocumentChannel.cpp b/netwerk/ipc/DocumentChannel.cpp index e62ce6780b47..426ef9267bd0 100644 --- a/netwerk/ipc/DocumentChannel.cpp +++ b/netwerk/ipc/DocumentChannel.cpp @@ -5,34 +5,41 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "DocumentChannel.h" +#include "mozilla/net/DocumentChannel.h" -#include "SerializedLoadContext.h" -#include "mozIThirdPartyUtil.h" +#include +#include +#include "mozIDOMWindow.h" +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/Assertions.h" #include "mozilla/LoadInfo.h" -#include "mozilla/StaticPrefs_browser.h" -#include "mozilla/dom/BrowserChild.h" -#include "mozilla/dom/ContentChild.h" -#include "mozilla/dom/nsCSPContext.h" -#include "mozilla/extensions/StreamFilterParent.h" -#include "mozilla/ipc/IPCStreamUtils.h" -#include "mozilla/ipc/URIUtils.h" +#include "mozilla/Logging.h" +#include "mozilla/RefPtr.h" +#include "mozilla/TimeStamp.h" +#include "mozilla/Unused.h" +#include "mozilla/dom/Document.h" #include "mozilla/net/DocumentChannelChild.h" -#include "mozilla/net/HttpChannelChild.h" -#include "mozilla/net/NeckoChild.h" #include "mozilla/net/ParentProcessDocumentChannel.h" -#include "mozilla/net/UrlClassifierCommon.h" -#include "nsContentSecurityManager.h" +#include "nsCOMPtr.h" +#include "nsDebug.h" #include "nsDocShell.h" #include "nsDocShellLoadState.h" #include "nsHttpHandler.h" -#include "nsIInputStreamChannel.h" +#include "nsIContentPolicy.h" +#include "nsIInterfaceRequestor.h" +#include "nsILoadContext.h" +#include "nsILoadGroup.h" +#include "nsILoadInfo.h" +#include "nsIStreamListener.h" +#include "nsIURI.h" #include "nsMimeTypes.h" #include "nsNetUtil.h" -#include "nsQueryObject.h" -#include "nsSerializationHelper.h" -#include "nsStringStream.h" -#include "nsURLHelper.h" +#include "nsPIDOMWindow.h" +#include "nsPIDOMWindowInlines.h" +#include "nsStringFwd.h" +#include "nsThreadUtils.h" +#include "nsXULAppAPI.h" +#include "nscore.h" using namespace mozilla::dom; using namespace mozilla::ipc; diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index d327316b02ed..a26ad5a9e530 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -11,23 +11,15 @@ #include #include "mozilla/Atomics.h" -#include "mozilla/IntegerPrintfMacros.h" -#include "mozilla/Tuple.h" #include "mozilla/dom/DOMTypes.h" -#include "mozilla/dom/ReferrerInfo.h" -#include "mozilla/net/ChannelEventQueue.h" #include "mozilla/net/DNS.h" #include "mozilla/net/NeckoCommon.h" #include "mozilla/net/PrivateBrowsingChannel.h" -#include "nsCOMArray.h" #include "nsCOMPtr.h" #include "nsHashPropertyBag.h" #include "nsHttp.h" -#include "nsHttpConnectionInfo.h" #include "nsHttpHandler.h" #include "nsHttpRequestHead.h" -#include "nsHttpResponseHead.h" -#include "nsIApplicationCache.h" #include "nsIClassOfService.h" #include "nsIClassifiedChannel.h" #include "nsIConsoleReportCollector.h" @@ -37,9 +29,7 @@ #include "nsIHttpChannel.h" #include "nsIHttpChannelInternal.h" #include "nsILoadInfo.h" -#include "nsIProgressEventSink.h" #include "nsIResumableChannel.h" -#include "nsISecurityConsoleMessage.h" #include "nsIStringEnumerator.h" #include "nsISupportsPriority.h" #include "nsIThrottledInputChannel.h" @@ -47,7 +37,6 @@ #include "nsITraceableChannel.h" #include "nsIURI.h" #include "nsIUploadChannel2.h" -#include "nsProxyInfo.h" #include "nsStringEnumerator.h" #include "nsTArray.h" #include "nsThreadUtils.h" @@ -59,6 +48,7 @@ } \ } +class nsIProgressEventSink; class nsISecurityConsoleMessage; class nsIPrincipal; diff --git a/storage/mozStorageAsyncStatementParams.h b/storage/mozStorageAsyncStatementParams.h index 3d0697531a4f..4c6f97052c87 100644 --- a/storage/mozStorageAsyncStatementParams.h +++ b/storage/mozStorageAsyncStatementParams.h @@ -8,11 +8,12 @@ #define mozilla_storage_mozStorageAsyncStatementParams_h_ #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsPIDOMWindow.h" #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace storage { class AsyncStatement; diff --git a/storage/mozStorageStatementParams.h b/storage/mozStorageStatementParams.h index ea2b078d0010..647e111b42ec 100644 --- a/storage/mozStorageStatementParams.h +++ b/storage/mozStorageStatementParams.h @@ -8,11 +8,12 @@ #define MOZSTORAGESTATEMENTPARAMS_H #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsPIDOMWindow.h" #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace storage { class Statement; diff --git a/storage/mozStorageStatementRow.h b/storage/mozStorageStatementRow.h index 5c783b4ad82b..02c43749c630 100644 --- a/storage/mozStorageStatementRow.h +++ b/storage/mozStorageStatementRow.h @@ -8,11 +8,12 @@ #define MOZSTORAGESTATEMENTROW_H #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "nsPIDOMWindow.h" #include "nsWrapperCache.h" namespace mozilla { +class ErrorResult; + namespace storage { class Statement; diff --git a/toolkit/components/antitracking/ContentBlockingLog.cpp b/toolkit/components/antitracking/ContentBlockingLog.cpp index d8cd4e508a26..42d5a9ccd71e 100644 --- a/toolkit/components/antitracking/ContentBlockingLog.cpp +++ b/toolkit/components/antitracking/ContentBlockingLog.cpp @@ -8,19 +8,17 @@ #include "ContentBlockingLog.h" #include "nsITrackingDBService.h" -#include "nsStringStream.h" +#include "nsServiceManagerUtils.h" #include "nsTArray.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/HashFunctions.h" #include "mozilla/Preferences.h" #include "mozilla/RandomNum.h" +#include "mozilla/ReverseIterator.h" #include "mozilla/StaticPrefs_browser.h" #include "mozilla/StaticPrefs_privacy.h" #include "mozilla/StaticPrefs_telemetry.h" #include "mozilla/Telemetry.h" -#include "mozilla/Unused.h" #include "mozilla/XorShift128PlusRNG.h" -#include "mozilla/ipc/IPCStreamUtils.h" namespace mozilla { diff --git a/toolkit/components/extensions/webrequest/StreamFilterChild.h b/toolkit/components/extensions/webrequest/StreamFilterChild.h index 641f4250516c..9cc6e04cce30 100644 --- a/toolkit/components/extensions/webrequest/StreamFilterChild.h +++ b/toolkit/components/extensions/webrequest/StreamFilterChild.h @@ -11,12 +11,13 @@ #include "mozilla/extensions/PStreamFilterChild.h" #include "mozilla/extensions/StreamFilter.h" -#include "mozilla/ErrorResult.h" #include "mozilla/LinkedList.h" #include "mozilla/dom/StreamFilterBinding.h" #include "nsISupportsImpl.h" namespace mozilla { +class ErrorResult; + namespace extensions { using mozilla::dom::StreamFilterStatus; diff --git a/toolkit/components/perfmonitoring/PerformanceUtils.cpp b/toolkit/components/perfmonitoring/PerformanceUtils.cpp index 9abcc60d0969..5822c4d225ca 100644 --- a/toolkit/components/perfmonitoring/PerformanceUtils.cpp +++ b/toolkit/components/perfmonitoring/PerformanceUtils.cpp @@ -4,22 +4,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "nsThreadUtils.h" #include "mozilla/PerformanceUtils.h" -#include "mozilla/ResultExtensions.h" + +#include "mozilla/dom/DOMTypes.h" #include "mozilla/dom/DocGroup.h" -#include "mozilla/dom/BrowserChild.h" #include "mozilla/dom/BrowsingContextGroup.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/Document.h" #include "mozilla/dom/WorkerDebugger.h" #include "mozilla/dom/WorkerDebuggerManager.h" #include "MediaDecoder.h" -#include "XPCJSMemoryReporter.h" #include "jsfriendapi.h" -#include "js/MemoryMetrics.h" -#include "nsWindowMemoryReporter.h" +#include "nsGlobalWindowOuter.h" #include "nsWindowSizes.h" using namespace mozilla; diff --git a/toolkit/components/sessionstore/SessionStoreUtils.h b/toolkit/components/sessionstore/SessionStoreUtils.h index 054bcb6b6f5d..b52ab4f48335 100644 --- a/toolkit/components/sessionstore/SessionStoreUtils.h +++ b/toolkit/components/sessionstore/SessionStoreUtils.h @@ -8,7 +8,6 @@ #define mozilla_dom_SessionStoreUtils_h #include "mozilla/Attributes.h" -#include "mozilla/ErrorResult.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/SessionStoreUtilsBinding.h" #include "SessionStoreData.h" @@ -17,6 +16,8 @@ class nsIDocument; class nsGlobalWindowInner; namespace mozilla { +class ErrorResult; + namespace dom { class GlobalObject; diff --git a/toolkit/components/telemetry/core/ipc/TelemetryComms.h b/toolkit/components/telemetry/core/ipc/TelemetryComms.h index 367214b0ac25..83d3216bc775 100644 --- a/toolkit/components/telemetry/core/ipc/TelemetryComms.h +++ b/toolkit/components/telemetry/core/ipc/TelemetryComms.h @@ -9,8 +9,8 @@ #include "ipc/IPCMessageUtils.h" #include "mozilla/TelemetryProcessEnums.h" #include "mozilla/TimeStamp.h" +#include "mozilla/Variant.h" #include "nsITelemetry.h" -#include "nsVariant.h" namespace mozilla { namespace Telemetry { diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp index c9ce8bcdb97f..b689b1fa2c66 100644 --- a/toolkit/xre/nsEmbedFunctions.cpp +++ b/toolkit/xre/nsEmbedFunctions.cpp @@ -4,8 +4,6 @@ #include "mozilla/DebugOnly.h" -#include "base/basictypes.h" - #include "nsXULAppAPI.h" #include @@ -17,7 +15,6 @@ #include "nsIAppShell.h" #include "nsAppStartupNotifier.h" -#include "nsIFile.h" #include "nsIToolkitProfile.h" #ifdef XP_WIN @@ -27,10 +24,7 @@ # include "mozilla/WinDllServices.h" #endif -#include "nsAppDirectoryServiceDefs.h" #include "nsAppRunner.h" -#include "nsAutoRef.h" -#include "nsDirectoryServiceDefs.h" #include "nsExceptionHandler.h" #include "nsString.h" #include "nsThreadUtils.h" @@ -39,6 +33,7 @@ #include "nsXREDirProvider.h" #ifdef MOZ_ASAN_REPORTER # include "CmdLineAndEnvUtils.h" +# include "nsIFile.h" #endif #include "mozilla/Omnijar.h" @@ -46,13 +41,10 @@ # include "nsVersionComparator.h" # include "chrome/common/mach_ipc_mac.h" #endif -#include "nsX11ErrorHandler.h" #include "nsGDKErrorHandler.h" #include "base/at_exit.h" -#include "base/command_line.h" #include "base/message_loop.h" #include "base/process_util.h" -#include "chrome/common/child_process.h" #if defined(MOZ_WIDGET_ANDROID) # include "chrome/common/ipc_channel.h" # include "mozilla/jni/Utils.h" @@ -66,18 +58,14 @@ #include "mozilla/UniquePtr.h" #include "mozilla/ipc/BrowserProcessSubThread.h" -#include "mozilla/ipc/GeckoChildProcessHost.h" #include "mozilla/ipc/IOThreadChild.h" #include "mozilla/ipc/ProcessChild.h" -#include "ScopedXREEmbed.h" #include "mozilla/plugins/PluginProcessChild.h" #include "mozilla/dom/ContentProcess.h" #include "mozilla/dom/ContentParent.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/ipc/TestShellParent.h" -#include "mozilla/ipc/XPCShellEnvironment.h" #if defined(XP_WIN) # include "mozilla/WindowsConsole.h" # include "mozilla/WindowsDllBlocklist.h" @@ -99,7 +87,6 @@ #if defined(MOZ_SANDBOX) # include "XREChildData.h" # include "mozilla/SandboxSettings.h" -# include "mozilla/Preferences.h" #endif #if defined(XP_LINUX) && defined(MOZ_SANDBOX) diff --git a/tools/profiler/core/ProfiledThreadData.cpp b/tools/profiler/core/ProfiledThreadData.cpp index 6626b6b377df..a6c2527cb7cc 100644 --- a/tools/profiler/core/ProfiledThreadData.cpp +++ b/tools/profiler/core/ProfiledThreadData.cpp @@ -9,8 +9,9 @@ #include "ProfileBuffer.h" #include "js/TraceLoggerAPI.h" -#include "mozilla/dom/ContentChild.h" #include "mozilla/ProfileJSONWriter.h" +#include "mozilla/Span.h" +#include "nsXULAppAPI.h" #if defined(GP_OS_darwin) # include @@ -216,9 +217,9 @@ int StreamSamplesAndMarkers(const char* aName, int aThreadId, int processedThreadId = 0; aWriter.StringProperty("processType", - MakeStringSpan(XRE_GetProcessTypeString())); + mozilla::MakeStringSpan(XRE_GetProcessTypeString())); - aWriter.StringProperty("name", MakeStringSpan(aName)); + aWriter.StringProperty("name", mozilla::MakeStringSpan(aName)); // Use given process name (if any), unless we're the parent process. if (XRE_IsParentProcess()) { diff --git a/uriloader/preload/PreloaderBase.h b/uriloader/preload/PreloaderBase.h index acbc41cb97ba..dcd37382178f 100644 --- a/uriloader/preload/PreloaderBase.h +++ b/uriloader/preload/PreloaderBase.h @@ -8,14 +8,12 @@ #include "mozilla/Maybe.h" #include "mozilla/PreloadHashKey.h" #include "mozilla/WeakPtr.h" -#include "nsIChannelEventSink.h" -#include "nsIInterfaceRequestor.h" -#include "nsIRedirectResultListener.h" +#include "nsCOMPtr.h" +#include "nsISupports.h" #include "nsITimer.h" #include "nsIURI.h" +#include "nsIWeakReferenceUtils.h" #include "nsTArray.h" -#include "nsProxyRelease.h" -#include "nsWeakReference.h" class nsIChannel; class nsINode; diff --git a/widget/CompositorWidget.h b/widget/CompositorWidget.h index 34237a288b13..6417926a8377 100644 --- a/widget/CompositorWidget.h +++ b/widget/CompositorWidget.h @@ -8,10 +8,13 @@ #include "nsISupports.h" #include "mozilla/RefPtr.h" #include "Units.h" -#include "mozilla/gfx/2D.h" +#include "mozilla/gfx/Rect.h" #include "mozilla/layers/CompositorOptions.h" #include "mozilla/layers/LayersTypes.h" -#include "mozilla/layers/NativeLayer.h" + +#ifdef MOZ_IS_GCC +# include "mozilla/layers/NativeLayer.h" +#endif class nsIWidget; class nsBaseWidget; @@ -25,7 +28,7 @@ namespace layers { class Compositor; class LayerManager; class LayerManagerComposite; -class Compositor; +class NativeLayerRoot; } // namespace layers namespace gfx { class DrawTarget; diff --git a/widget/ContentCache.h b/widget/ContentCache.h index 8c202fd27537..8fcc6fec96f1 100644 --- a/widget/ContentCache.h +++ b/widget/ContentCache.h @@ -10,15 +10,17 @@ #include +#include "mozilla/widget/IMEData.h" #include "mozilla/Assertions.h" #include "mozilla/CheckedInt.h" #include "mozilla/EventForwards.h" #include "mozilla/WritingModes.h" -#include "nsIWidget.h" #include "nsString.h" #include "nsTArray.h" #include "Units.h" +class nsIWidget; + namespace mozilla { class ContentCacheInParent; diff --git a/widget/WidgetUtils.h b/widget/WidgetUtils.h index a93fe27f06bb..0a0435ddd6f5 100644 --- a/widget/WidgetUtils.h +++ b/widget/WidgetUtils.h @@ -8,12 +8,11 @@ #ifndef mozilla_WidgetUtils_h #define mozilla_WidgetUtils_h -#include "mozilla/EventForwards.h" +#include "mozilla/AlreadyAddRefed.h" #include "mozilla/gfx/Matrix.h" -#include "nsCOMPtr.h" -#include "nsIWidget.h" #include "nsRect.h" +class nsIWidget; class nsPIDOMWindowOuter; namespace mozilla { diff --git a/xpcom/base/CodeAddressService.h b/xpcom/base/CodeAddressService.h index 028c61aa3900..2050a346b06a 100644 --- a/xpcom/base/CodeAddressService.h +++ b/xpcom/base/CodeAddressService.h @@ -7,14 +7,15 @@ #ifndef CodeAddressService_h__ #define CodeAddressService_h__ +#include +#include +#include #include "mozilla/AllocPolicy.h" #include "mozilla/Assertions.h" #include "mozilla/HashFunctions.h" #include "mozilla/HashTable.h" -#include "mozilla/IntegerPrintfMacros.h" #include "mozilla/MemoryReporting.h" #include "mozilla/StackWalk.h" -#include "mozilla/Types.h" namespace mozilla { diff --git a/xpcom/base/CountingAllocatorBase.h b/xpcom/base/CountingAllocatorBase.h index 6c4d7ab0c3be..68a405eaee2d 100644 --- a/xpcom/base/CountingAllocatorBase.h +++ b/xpcom/base/CountingAllocatorBase.h @@ -7,6 +7,7 @@ #ifndef CountingAllocatorBase_h #define CountingAllocatorBase_h +#include #include "mozilla/Assertions.h" #include "mozilla/Atomics.h" #include "mozilla/mozalloc.h" diff --git a/xpcom/base/CycleCollectedJSRuntime.h b/xpcom/base/CycleCollectedJSRuntime.h index 72db47428d0a..fa0d63559ba2 100644 --- a/xpcom/base/CycleCollectedJSRuntime.h +++ b/xpcom/base/CycleCollectedJSRuntime.h @@ -7,27 +7,25 @@ #ifndef mozilla_CycleCollectedJSRuntime_h #define mozilla_CycleCollectedJSRuntime_h -#include - #include "mozilla/CycleCollectedJSContext.h" #include "mozilla/DeferredFinalize.h" #include "mozilla/HashTable.h" -#include "mozilla/LinkedList.h" -#include "mozilla/mozalloc.h" +#include "mozilla/Maybe.h" #include "mozilla/MemoryReporting.h" +#include "mozilla/RefPtr.h" #include "mozilla/SegmentedVector.h" #include "jsapi.h" #include "jsfriendapi.h" -#include "js/TraceKind.h" +#include "js/TypeDecls.h" #include "nsCycleCollectionParticipant.h" #include "nsDataHashtable.h" #include "nsHashKeys.h" +#include "nsStringFwd.h" #include "nsTHashtable.h" class nsCycleCollectionNoteRootCallback; class nsIException; -class nsIRunnable; class nsWrapperCache; namespace mozilla { diff --git a/xpcom/base/HoldDropJSObjects.h b/xpcom/base/HoldDropJSObjects.h index 0338d58c0786..8cc3c137c61f 100644 --- a/xpcom/base/HoldDropJSObjects.h +++ b/xpcom/base/HoldDropJSObjects.h @@ -7,11 +7,16 @@ #ifndef mozilla_HoldDropJSObjects_h #define mozilla_HoldDropJSObjects_h -#include "nsCycleCollectionParticipant.h" +#include +#include "nsCycleCollectionNoteChild.h" class nsISupports; class nsScriptObjectTracer; +namespace JS { +class Zone; +} + // Only HoldJSObjects and DropJSObjects should be called directly. namespace mozilla { diff --git a/xpcom/base/Logging.h b/xpcom/base/Logging.h index 05c8bad476fa..c417bdbf770b 100644 --- a/xpcom/base/Logging.h +++ b/xpcom/base/Logging.h @@ -7,6 +7,8 @@ #ifndef mozilla_logging_h #define mozilla_logging_h +#include +#include #include #include @@ -14,7 +16,6 @@ #include "mozilla/Atomics.h" #include "mozilla/Attributes.h" #include "mozilla/Likely.h" -#include "mozilla/TimeStamp.h" // We normally have logging enabled everywhere, but measurements showed that // having logging enabled on Android is quite expensive (hundreds of kilobytes @@ -40,6 +41,8 @@ namespace mozilla { +class TimeStamp; + // While not a 100% mapping to PR_LOG's numeric values, mozilla::LogLevel does // maintain a direct mapping for the Disabled, Debug and Verbose levels. // diff --git a/xpcom/base/MemoryInfo.h b/xpcom/base/MemoryInfo.h index 920880bc31c3..d122f6d3775f 100644 --- a/xpcom/base/MemoryInfo.h +++ b/xpcom/base/MemoryInfo.h @@ -7,9 +7,10 @@ #ifndef mozilla_MemoryInfo_h #define mozilla_MemoryInfo_h +#include +#include +#include "mozilla/Attributes.h" #include "mozilla/EnumSet.h" -#include "nsTArray.h" - /** * MemoryInfo is a helper class which describes the attributes and sizes of a * particular region of VM memory on Windows. It roughtly corresponds to the diff --git a/xpcom/base/MemoryMapping.h b/xpcom/base/MemoryMapping.h index f549631b2b50..2dc61a421565 100644 --- a/xpcom/base/MemoryMapping.h +++ b/xpcom/base/MemoryMapping.h @@ -7,9 +7,10 @@ #ifndef mozilla_MemoryMapping_h #define mozilla_MemoryMapping_h +#include #include "mozilla/EnumSet.h" -#include "nsString.h" -#include "nsTArray.h" +#include "nsStringFwd.h" +#include "nsTArrayForwardDeclare.h" /** * MemoryMapping is a helper class which describes an entry in the Linux diff --git a/xpcom/base/MemoryReportingProcess.h b/xpcom/base/MemoryReportingProcess.h index 4adfb574e2fa..36410e702b46 100644 --- a/xpcom/base/MemoryReportingProcess.h +++ b/xpcom/base/MemoryReportingProcess.h @@ -15,6 +15,9 @@ namespace ipc { class FileDescriptor; } // namespace ipc +template +class Maybe; + // Top-level process actors should implement this to integrate with // nsMemoryReportManager. class MemoryReportingProcess { diff --git a/xpcom/base/MemoryTelemetry.h b/xpcom/base/MemoryTelemetry.h index 90ec329a82cd..48a5ceccbca0 100644 --- a/xpcom/base/MemoryTelemetry.h +++ b/xpcom/base/MemoryTelemetry.h @@ -9,7 +9,6 @@ #include "mozilla/TimeStamp.h" #include "mozilla/Result.h" -#include "nsIEventTarget.h" #include "nsIObserver.h" #include "nsITimer.h" #include "nsTArray.h" @@ -17,6 +16,8 @@ #include +class nsIEventTarget; + namespace mozilla { namespace ipc { diff --git a/xpcom/base/SizeOfState.h b/xpcom/base/SizeOfState.h index f73da0d9c7f5..2df0b24e93f5 100644 --- a/xpcom/base/SizeOfState.h +++ b/xpcom/base/SizeOfState.h @@ -8,7 +8,6 @@ #define SizeOfState_h #include "mozilla/fallible.h" -#include "mozilla/Maybe.h" #include "mozilla/MemoryReporting.h" #include "mozilla/Unused.h" #include "nsTHashtable.h" diff --git a/xpcom/base/TupleCycleCollection.h b/xpcom/base/TupleCycleCollection.h index 55bf67094e30..215855fdd870 100644 --- a/xpcom/base/TupleCycleCollection.h +++ b/xpcom/base/TupleCycleCollection.h @@ -8,7 +8,9 @@ #define TupleCycleCollection_h #include "mozilla/Tuple.h" -#include "nsCycleCollectionTraversalCallback.h" +#include "nsCycleCollectionNoteChild.h" + +class nsCycleCollectionTraversalCallback; template inline void ImplCycleCollectionUnlink(mozilla::Tuple& aField) { diff --git a/xpcom/base/nsAlgorithm.h b/xpcom/base/nsAlgorithm.h index 2b4b850aacdb..1c4bb0e9dce3 100644 --- a/xpcom/base/nsAlgorithm.h +++ b/xpcom/base/nsAlgorithm.h @@ -7,7 +7,8 @@ #ifndef nsAlgorithm_h___ #define nsAlgorithm_h___ -#include "nsCharTraits.h" // for |nsCharSourceTraits|, |nsCharSinkTraits| +#include +#include "mozilla/Assertions.h" template inline T NS_ROUNDUP(const T& aA, const T& aB) { diff --git a/xpcom/base/nsCOMPtr.h b/xpcom/base/nsCOMPtr.h index 002a0fc526e4..23682c615557 100644 --- a/xpcom/base/nsCOMPtr.h +++ b/xpcom/base/nsCOMPtr.h @@ -21,7 +21,6 @@ */ #include -#include #include "mozilla/AlreadyAddRefed.h" #include "mozilla/Assertions.h" diff --git a/xpcom/base/nsConsoleService.cpp b/xpcom/base/nsConsoleService.cpp index 3646d1b134cf..61fc6c613c1f 100644 --- a/xpcom/base/nsConsoleService.cpp +++ b/xpcom/base/nsConsoleService.cpp @@ -11,7 +11,6 @@ /* Threadsafe. */ -#include "nsMemory.h" #include "nsCOMArray.h" #include "nsThreadUtils.h" @@ -28,7 +27,6 @@ #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/BrowserParent.h" -#include "mozilla/Preferences.h" #include "mozilla/SchedulerGroup.h" #include "mozilla/Services.h" diff --git a/xpcom/base/nsConsoleService.h b/xpcom/base/nsConsoleService.h index bc8f3840678e..a5f34e477f15 100644 --- a/xpcom/base/nsConsoleService.h +++ b/xpcom/base/nsConsoleService.h @@ -11,14 +11,26 @@ #ifndef __nsconsoleservice_h__ #define __nsconsoleservice_h__ -#include "mozilla/Attributes.h" +#include +#include + +#include "mozilla/Assertions.h" +#include "mozilla/LinkedList.h" #include "mozilla/Mutex.h" +#include "MainThreadUtils.h" +#include "nsCOMPtr.h" #include "nsInterfaceHashtable.h" #include "nsHashKeys.h" +#include "nsIConsoleListener.h" +#include "nsIConsoleMessage.h" #include "nsIConsoleService.h" #include "nsIObserver.h" +#include "nsISupports.h" + +template +class nsCOMArray; class nsConsoleService final : public nsIConsoleService, public nsIObserver { public: diff --git a/xpcom/base/nsCycleCollectionNoteRootCallback.h b/xpcom/base/nsCycleCollectionNoteRootCallback.h index e1c011851e02..21dc89394ad0 100644 --- a/xpcom/base/nsCycleCollectionNoteRootCallback.h +++ b/xpcom/base/nsCycleCollectionNoteRootCallback.h @@ -7,8 +7,15 @@ #ifndef nsCycleCollectionNoteRootCallback_h__ #define nsCycleCollectionNoteRootCallback_h__ +#include "nscore.h" + class nsCycleCollectionParticipant; class nsISupports; +class JSObject; + +namespace JS { +class GCCellPtr; +} class nsCycleCollectionNoteRootCallback { public: diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index f9552a868113..8246b0ee2c34 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -166,6 +166,7 @@ #include #include "GeckoProfiler.h" +#include "js/SliceBudget.h" #include "mozilla/Attributes.h" #include "mozilla/AutoGlobalTimelineMarker.h" #include "mozilla/Likely.h" diff --git a/xpcom/base/nsCycleCollector.h b/xpcom/base/nsCycleCollector.h index 18cb7dcd4df1..0ecdd7393eb0 100644 --- a/xpcom/base/nsCycleCollector.h +++ b/xpcom/base/nsCycleCollector.h @@ -13,11 +13,12 @@ class nsISupports; template struct already_AddRefed; -#include "nsError.h" -#include "nsID.h" - +#include #include "mozilla/Attributes.h" -#include "js/SliceBudget.h" + +namespace js { +class SliceBudget; +} namespace mozilla { class CycleCollectedJSContext; diff --git a/xpcom/base/nsError.h b/xpcom/base/nsError.h index d72fe79bfb3a..040cd4612c2d 100644 --- a/xpcom/base/nsError.h +++ b/xpcom/base/nsError.h @@ -19,7 +19,7 @@ #define NS_ERROR_SEVERITY_SUCCESS 0 #define NS_ERROR_SEVERITY_ERROR 1 -#include "ErrorList.h" +#include "ErrorList.h" // IWYU pragma: export /** * @name Standard Error Handling Macros diff --git a/xpcom/base/nsMemory.h b/xpcom/base/nsMemory.h index 6c07fb8f12bc..b64b7b66be06 100644 --- a/xpcom/base/nsMemory.h +++ b/xpcom/base/nsMemory.h @@ -7,7 +7,7 @@ #ifndef nsMemory_h__ #define nsMemory_h__ -#include "nsXPCOM.h" +#include "nsError.h" class nsIMemory; diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index ad8c45cf0849..c8322db99b2b 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -4,13 +4,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "nsMemoryReporterManager.h" + #include "nsAtomTable.h" #include "nsCOMPtr.h" #include "nsCOMArray.h" #include "nsPrintfCString.h" #include "nsProxyRelease.h" #include "nsServiceManagerUtils.h" -#include "nsMemoryReporterManager.h" #include "nsITimer.h" #include "nsThreadUtils.h" #include "nsPIDOMWindow.h" diff --git a/xpcom/base/nsMemoryReporterManager.h b/xpcom/base/nsMemoryReporterManager.h index f827f25b99ae..a60ec9227407 100644 --- a/xpcom/base/nsMemoryReporterManager.h +++ b/xpcom/base/nsMemoryReporterManager.h @@ -10,11 +10,9 @@ #include "mozilla/Mutex.h" #include "nsDataHashtable.h" #include "nsHashKeys.h" -#include "nsIEventTarget.h" #include "nsIMemoryReporter.h" -#include "nsITimer.h" +#include "nsISupports.h" #include "nsServiceManagerUtils.h" -#include "nsDataHashtable.h" #ifdef XP_WIN # include @@ -27,6 +25,9 @@ class MemoryReport; } // namespace dom } // namespace mozilla +class mozIDOMWindowProxy; +class nsIEventTarget; +class nsIRunnable; class nsITimer; class nsMemoryReporterManager final : public nsIMemoryReporterManager, diff --git a/xpcom/base/nsSystemInfo.h b/xpcom/base/nsSystemInfo.h index 58881ae51e30..6d12c8e34db2 100644 --- a/xpcom/base/nsSystemInfo.h +++ b/xpcom/base/nsSystemInfo.h @@ -10,12 +10,13 @@ #include "nsHashPropertyBag.h" #include "nsISystemInfo.h" #include "mozilla/MozPromise.h" -#include "mozilla/LazyIdleThread.h" #ifdef MOZ_WIDGET_ANDROID # include "mozilla/dom/PContent.h" #endif // MOZ_WIDGET_ANDROID +class nsISerialEventTarget; + struct FolderDiskInfo { nsCString model; nsCString revision; diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h index 6392e495585a..f7baacd79861 100644 --- a/xpcom/base/nscore.h +++ b/xpcom/base/nscore.h @@ -12,7 +12,7 @@ * c++ definitions needed by nscore.h */ #ifndef _XPCOM_CONFIG_H_ -# include "xpcom-config.h" +# include "xpcom-config.h" // IWYU pragma: export #endif /* Definitions of functions and operators that allocate memory. */ @@ -23,10 +23,10 @@ /** * Incorporate the integer data types which XPCOM uses. */ -#include -#include +#include // IWYU pragma: export +#include // IWYU pragma: export -#include "mozilla/HelperMacros.h" +#include "mozilla/HelperMacros.h" // IWYU pragma: export #include "mozilla/RefCountType.h" /* Core XPCOM declarations. */ @@ -200,7 +200,7 @@ /** * Generic XPCOM result data type */ -#include "nsError.h" +#include "nsError.h" // IWYU pragma: export typedef MozRefCountType nsrefcnt; diff --git a/xpcom/build/nsXULAppAPI.h b/xpcom/build/nsXULAppAPI.h index 695583233749..a143bb10be9d 100644 --- a/xpcom/build/nsXULAppAPI.h +++ b/xpcom/build/nsXULAppAPI.h @@ -7,25 +7,31 @@ #ifndef _nsXULAppAPI_h__ #define _nsXULAppAPI_h__ -#include "nsID.h" -#include "xrecore.h" -#include "nsXPCOM.h" -#include "nsISupports.h" -#include "mozilla/Logging.h" -#include "mozilla/XREAppData.h" #include "js/TypeDecls.h" - #include "mozilla/ArrayUtils.h" -#include "mozilla/Assertions.h" -#include "mozilla/Vector.h" #include "mozilla/TimeStamp.h" -#include "XREChildData.h" -#include "XREShellData.h" +#include "nscore.h" +#include "xrecore.h" #if defined(MOZ_WIDGET_ANDROID) # include #endif +class JSString; +class MessageLoop; +class nsIDirectoryServiceProvider; +class nsIFile; +class nsISupports; +struct JSContext; +struct XREChildData; +struct XREShellData; + +namespace mozilla { +class XREAppData; +struct BootstrapConfig; +struct Module; +} // namespace mozilla + /** * A directory service key which provides the platform-correct "application * data" directory as follows, where $name and $vendor are as defined above and @@ -205,9 +211,6 @@ * @note If the binary is linked against the standalone XPCOM glue, * XPCOMGlueStartup() should be called before this method. */ -namespace mozilla { -struct BootstrapConfig; -} XRE_API(int, XRE_main, (int argc, char* argv[], const mozilla::BootstrapConfig& aConfig)) @@ -454,8 +457,6 @@ XRE_API(nsresult, XRE_InitCommandLine, (int aArgc, char* aArgv[])) XRE_API(nsresult, XRE_DeinitCommandLine, ()) -class MessageLoop; - XRE_API(void, XRE_ShutdownChildProcess, ()) XRE_API(MessageLoop*, XRE_GetIOMessageLoop, ()) diff --git a/xpcom/ds/ArenaAllocator.h b/xpcom/ds/ArenaAllocator.h index 51c08f29365a..76498986ce4f 100644 --- a/xpcom/ds/ArenaAllocator.h +++ b/xpcom/ds/ArenaAllocator.h @@ -9,7 +9,6 @@ #include #include -#include #include "mozilla/Assertions.h" #include "mozilla/fallible.h" diff --git a/xpcom/ds/PLDHashTable.h b/xpcom/ds/PLDHashTable.h index d28186c760b2..8b9097882bce 100644 --- a/xpcom/ds/PLDHashTable.h +++ b/xpcom/ds/PLDHashTable.h @@ -12,12 +12,10 @@ #include +#include "mozilla/Assertions.h" #include "mozilla/Atomics.h" -#include "mozilla/Attributes.h" // for MOZ_ALWAYS_INLINE -#include "mozilla/FunctionTypeTraits.h" #include "mozilla/HashFunctions.h" #include "mozilla/MemoryReporting.h" -#include "mozilla/Types.h" #include "mozilla/fallible.h" #include "nscore.h" diff --git a/xpcom/ds/nsAtom.h b/xpcom/ds/nsAtom.h index f17bba09b6c1..240e9ffcb0c2 100644 --- a/xpcom/ds/nsAtom.h +++ b/xpcom/ds/nsAtom.h @@ -9,10 +9,11 @@ #include -#include "nsISupportsImpl.h" -#include "nsString.h" #include "mozilla/Atomics.h" -#include "mozilla/UniquePtr.h" +#include "mozilla/Char16.h" +#include "mozilla/MemoryReporting.h" +#include "nsISupports.h" +#include "nsString.h" namespace mozilla { struct AtomsSizes; diff --git a/xpcom/ds/nsCharSeparatedTokenizer.h b/xpcom/ds/nsCharSeparatedTokenizer.h index d1c22c9674f4..7685fb7681c4 100644 --- a/xpcom/ds/nsCharSeparatedTokenizer.h +++ b/xpcom/ds/nsCharSeparatedTokenizer.h @@ -10,7 +10,7 @@ #include "mozilla/RangedPtr.h" #include "nsDependentSubstring.h" -#include "nsCRT.h" +#include "nsCRTGlue.h" /** * This parses a SeparatorChar-separated string into tokens. diff --git a/xpcom/ds/nsDeque.h b/xpcom/ds/nsDeque.h index cff3b5739bd4..7cec06602917 100644 --- a/xpcom/ds/nsDeque.h +++ b/xpcom/ds/nsDeque.h @@ -28,11 +28,9 @@ #include "mozilla/AlreadyAddRefed.h" #include "mozilla/Assertions.h" -#include "mozilla/Attributes.h" #include "mozilla/fallible.h" #include "mozilla/MemoryReporting.h" #include "mozilla/RefPtr.h" -#include "nscore.h" #include "nsDebug.h" #include "nsISupports.h" diff --git a/xpcom/ds/nsExpirationTracker.h b/xpcom/ds/nsExpirationTracker.h index 0906f3c0b825..a5100b3bd5d9 100644 --- a/xpcom/ds/nsExpirationTracker.h +++ b/xpcom/ds/nsExpirationTracker.h @@ -7,16 +7,25 @@ #ifndef NSEXPIRATIONTRACKER_H_ #define NSEXPIRATIONTRACKER_H_ -#include "mozilla/Logging.h" +#include +#include "MainThreadUtils.h" +#include "nsAlgorithm.h" +#include "nsDebug.h" #include "nsTArray.h" #include "nsITimer.h" #include "nsCOMPtr.h" -#include "nsComponentManagerUtils.h" #include "nsIEventTarget.h" #include "nsIObserver.h" #include "nsIObserverService.h" +#include "nsISupports.h" +#include "nsIThread.h" #include "nsThreadUtils.h" -#include "mozilla/Attributes.h" +#include "nscore.h" +#include "mozilla/Assertions.h" +#include "mozilla/Likely.h" +#include "mozilla/MemoryReporting.h" +#include "mozilla/RefCountType.h" +#include "mozilla/RefPtr.h" #include "mozilla/Services.h" /** diff --git a/xpcom/ds/nsObserverList.h b/xpcom/ds/nsObserverList.h index b3c32a1fd750..9f209e40d662 100644 --- a/xpcom/ds/nsObserverList.h +++ b/xpcom/ds/nsObserverList.h @@ -8,7 +8,6 @@ #define nsObserverList_h___ #include "nsISupports.h" -#include "nsCOMPtr.h" #include "nsCOMArray.h" #include "nsIObserver.h" #include "nsHashKeys.h" diff --git a/xpcom/ds/nsObserverService.h b/xpcom/ds/nsObserverService.h index 389bc7ac05e8..b616be936597 100644 --- a/xpcom/ds/nsObserverService.h +++ b/xpcom/ds/nsObserverService.h @@ -21,8 +21,6 @@ } \ } -class nsIMemoryReporter; - class nsObserverService final : public nsIObserverService, public nsIMemoryReporter { public: diff --git a/xpcom/ds/nsTObserverArray.h b/xpcom/ds/nsTObserverArray.h index 691294c6f8f1..eec33957255d 100644 --- a/xpcom/ds/nsTObserverArray.h +++ b/xpcom/ds/nsTObserverArray.h @@ -12,8 +12,6 @@ #include "nsTArray.h" #include "nsCycleCollectionNoteChild.h" -#include - /** * An array of observers. Like a normal array, but supports iterators that are * stable even if the array is modified during iteration. diff --git a/xpcom/ds/nsTPriorityQueue.h b/xpcom/ds/nsTPriorityQueue.h index f1052f9de1de..1fa1cc1e50db 100644 --- a/xpcom/ds/nsTPriorityQueue.h +++ b/xpcom/ds/nsTPriorityQueue.h @@ -7,8 +7,8 @@ #ifndef NS_TPRIORITY_QUEUE_H_ #define NS_TPRIORITY_QUEUE_H_ +#include "mozilla/Assertions.h" #include "nsTArray.h" -#include "nsDebug.h" /** * A templatized priority queue data structure that uses an nsTArray to serve as diff --git a/xpcom/ds/nsWhitespaceTokenizer.h b/xpcom/ds/nsWhitespaceTokenizer.h index 99ecc8afaa03..77fea708504b 100644 --- a/xpcom/ds/nsWhitespaceTokenizer.h +++ b/xpcom/ds/nsWhitespaceTokenizer.h @@ -9,7 +9,7 @@ #include "mozilla/RangedPtr.h" #include "nsDependentSubstring.h" -#include "nsCRT.h" +#include "nsCRTGlue.h" template class nsTWhitespaceTokenizer { diff --git a/xpcom/threads/AbstractThread.h b/xpcom/threads/AbstractThread.h index 227bd75b76b7..ef339986ddf9 100644 --- a/xpcom/threads/AbstractThread.h +++ b/xpcom/threads/AbstractThread.h @@ -7,13 +7,15 @@ #if !defined(AbstractThread_h_) # define AbstractThread_h_ -# include "mozilla/RefPtr.h" +# include "mozilla/AlreadyAddRefed.h" # include "mozilla/ThreadLocal.h" # include "nscore.h" -# include "nsIRunnable.h" # include "nsISerialEventTarget.h" -# include "nsISupportsImpl.h" -# include "nsIThread.h" +# include "nsISupports.h" + +class nsIEventTarget; +class nsIRunnable; +class nsIThread; namespace mozilla { diff --git a/xpcom/threads/BlockingResourceBase.h b/xpcom/threads/BlockingResourceBase.h index 6c8039c8f406..b5501599f159 100644 --- a/xpcom/threads/BlockingResourceBase.h +++ b/xpcom/threads/BlockingResourceBase.h @@ -7,13 +7,13 @@ #ifndef mozilla_BlockingResourceBase_h #define mozilla_BlockingResourceBase_h -#include "mozilla/Logging.h" +#include "mozilla/MemoryReporting.h" #include "mozilla/ThreadLocal.h" #include "nscore.h" #include "nsDebug.h" -#include "nsError.h" -#include "nsISupportsImpl.h" + +#include "prtypes.h" #ifdef DEBUG @@ -22,13 +22,11 @@ # include "prinit.h" -# include "nsString.h" - # ifndef MOZ_CALLSTACK_DISABLED +# include "mozilla/Maybe.h" # include "nsTArray.h" # endif -# include "nsXPCOM.h" #endif // diff --git a/xpcom/threads/CPUUsageWatcher.h b/xpcom/threads/CPUUsageWatcher.h index cf3f50b154d9..c3a643378a4c 100644 --- a/xpcom/threads/CPUUsageWatcher.h +++ b/xpcom/threads/CPUUsageWatcher.h @@ -10,7 +10,6 @@ #include #include "mozilla/HangAnnotations.h" -#include "mozilla/BackgroundHangMonitor.h" #include "mozilla/Result.h" // We only support OSX and Windows, because on Linux we're forced to read diff --git a/xpcom/threads/InputEventStatistics.h b/xpcom/threads/InputEventStatistics.h index c90f73767c6f..e5531302b5dc 100644 --- a/xpcom/threads/InputEventStatistics.h +++ b/xpcom/threads/InputEventStatistics.h @@ -7,10 +7,8 @@ #if !defined(InputEventStatistics_h_) # define InputEventStatistics_h_ -# include "mozilla/ClearOnShutdown.h" -# include "mozilla/Maybe.h" -# include "mozilla/Preferences.h" # include "mozilla/TimeStamp.h" +# include "mozilla/UniquePtr.h" # include "nsTArray.h" namespace mozilla { diff --git a/xpcom/threads/LazyIdleThread.h b/xpcom/threads/LazyIdleThread.h index f0f60f5bb3ec..43a660b92f5e 100644 --- a/xpcom/threads/LazyIdleThread.h +++ b/xpcom/threads/LazyIdleThread.h @@ -18,7 +18,7 @@ #include "mozilla/Mutex.h" #include "nsCOMPtr.h" -#include "nsTArray.h" +#include "nsTArrayForwardDeclare.h" #include "nsString.h" #include "mozilla/Attributes.h" diff --git a/xpcom/threads/MozPromise.h b/xpcom/threads/MozPromise.h index 8cd8ae93330f..2f6245a9ccc9 100644 --- a/xpcom/threads/MozPromise.h +++ b/xpcom/threads/MozPromise.h @@ -15,7 +15,6 @@ # include "mozilla/Monitor.h" # include "mozilla/Mutex.h" # include "mozilla/RefPtr.h" -# include "mozilla/Tuple.h" # include "mozilla/UniquePtr.h" # include "mozilla/Variant.h" # include "nsIDirectTaskDispatcher.h" diff --git a/xpcom/threads/Mutex.h b/xpcom/threads/Mutex.h index 0fa6e1700921..e6d58806c9ca 100644 --- a/xpcom/threads/Mutex.h +++ b/xpcom/threads/Mutex.h @@ -9,6 +9,7 @@ #include "mozilla/BlockingResourceBase.h" #include "mozilla/PlatformMutex.h" +#include "nsISupports.h" // // Provides: diff --git a/xpcom/threads/SchedulerGroup.h b/xpcom/threads/SchedulerGroup.h index 342cbc69452c..7221ce3bb752 100644 --- a/xpcom/threads/SchedulerGroup.h +++ b/xpcom/threads/SchedulerGroup.h @@ -7,17 +7,15 @@ #ifndef mozilla_SchedulerGroup_h #define mozilla_SchedulerGroup_h -#include "mozilla/EventQueue.h" -#include "mozilla/AlreadyAddRefed.h" -#include "mozilla/LinkedList.h" -#include "mozilla/Queue.h" +#include "mozilla/RefPtr.h" #include "mozilla/TaskCategory.h" -#include "mozilla/ThreadLocal.h" -#include "mozilla/ThrottledEventQueue.h" -#include "mozilla/TimeStamp.h" #include "nsCOMPtr.h" -#include "nsISupportsImpl.h" +#include "nsID.h" +#include "nsIRunnable.h" +#include "nsISupports.h" +#include "nsStringFwd.h" #include "nsThreadUtils.h" +#include "nscore.h" class nsIEventTarget; class nsIRunnable; diff --git a/xpcom/threads/SharedThreadPool.h b/xpcom/threads/SharedThreadPool.h index 86c9b751e6db..936cac5cd8bb 100644 --- a/xpcom/threads/SharedThreadPool.h +++ b/xpcom/threads/SharedThreadPool.h @@ -7,13 +7,17 @@ #ifndef SharedThreadPool_h_ #define SharedThreadPool_h_ -#include -#include "mozilla/RefPtr.h" -#include "nsThreadUtils.h" -#include "nsIThreadPool.h" -#include "nsISupports.h" -#include "nsISupportsImpl.h" +#include +#include "mozilla/AlreadyAddRefed.h" +#include "mozilla/RefCountType.h" #include "nsCOMPtr.h" +#include "nsID.h" +#include "nsIEventTarget.h" +#include "nsIThreadPool.h" +#include "nsString.h" +#include "nscore.h" + +class nsIRunnable; namespace mozilla { diff --git a/xpcom/threads/StateMirroring.h b/xpcom/threads/StateMirroring.h index b5dfc5602ba9..c233116962d9 100644 --- a/xpcom/threads/StateMirroring.h +++ b/xpcom/threads/StateMirroring.h @@ -7,15 +7,19 @@ #if !defined(StateMirroring_h_) # define StateMirroring_h_ -# include "mozilla/Maybe.h" -# include "mozilla/MozPromise.h" -# include "mozilla/StateWatching.h" -# include "mozilla/TaskDispatcher.h" -# include "mozilla/UniquePtr.h" -# include "mozilla/Unused.h" - +# include +# include "mozilla/AbstractThread.h" +# include "mozilla/AlreadyAddRefed.h" +# include "mozilla/Assertions.h" # include "mozilla/Logging.h" -# include "nsISupportsImpl.h" +# include "mozilla/Maybe.h" +# include "mozilla/RefPtr.h" +# include "mozilla/StateWatching.h" +# include "nsCOMPtr.h" +# include "nsIRunnable.h" +# include "nsISupports.h" +# include "nsTArray.h" +# include "nsThreadUtils.h" /* * The state-mirroring machinery allows pieces of interesting state to be diff --git a/xpcom/threads/StateWatching.h b/xpcom/threads/StateWatching.h index 71381a609661..3da0c63bfeef 100644 --- a/xpcom/threads/StateWatching.h +++ b/xpcom/threads/StateWatching.h @@ -7,13 +7,16 @@ #if !defined(StateWatching_h_) # define StateWatching_h_ +# include +# include +# include # include "mozilla/AbstractThread.h" +# include "mozilla/Assertions.h" # include "mozilla/Logging.h" -# include "mozilla/TaskDispatcher.h" -# include "mozilla/UniquePtr.h" -# include "mozilla/Unused.h" - -# include "nsISupportsImpl.h" +# include "mozilla/RefPtr.h" +# include "nsISupports.h" +# include "nsTArray.h" +# include "nsThreadUtils.h" /* * The state-watching machinery automates the process of responding to changes diff --git a/xpcom/threads/TaskDispatcher.h b/xpcom/threads/TaskDispatcher.h index f2f3cf8bad1d..558221aa9589 100644 --- a/xpcom/threads/TaskDispatcher.h +++ b/xpcom/threads/TaskDispatcher.h @@ -12,7 +12,6 @@ # include "mozilla/AbstractThread.h" # include "mozilla/Maybe.h" # include "mozilla/UniquePtr.h" -# include "mozilla/Unused.h" # include "nsIDirectTaskDispatcher.h" # include "nsISupportsImpl.h" # include "nsTArray.h" diff --git a/xpcom/threads/TaskQueue.h b/xpcom/threads/TaskQueue.h index ce039bef9bc2..5b9837ecbd53 100644 --- a/xpcom/threads/TaskQueue.h +++ b/xpcom/threads/TaskQueue.h @@ -15,7 +15,6 @@ #include "mozilla/MozPromise.h" #include "mozilla/RefPtr.h" #include "mozilla/TaskDispatcher.h" -#include "mozilla/Unused.h" #include "nsIDirectTaskDispatcher.h" #include "nsThreadUtils.h" diff --git a/xpcom/threads/nsProcess.h b/xpcom/threads/nsProcess.h index bf1e8ca0f1c4..c7cd0a3d055f 100644 --- a/xpcom/threads/nsProcess.h +++ b/xpcom/threads/nsProcess.h @@ -14,8 +14,6 @@ #include "mozilla/Attributes.h" #include "mozilla/Mutex.h" #include "nsIProcess.h" -#include "nsIFile.h" -#include "nsIObserver.h" #include "nsIObserver.h" #include "nsMaybeWeakPtr.h" #include "nsString.h" @@ -34,6 +32,8 @@ } \ } +class nsIFile; + class nsProcess final : public nsIProcess, public nsIObserver { public: NS_DECL_THREADSAFE_ISUPPORTS diff --git a/xpcom/threads/nsProxyRelease.h b/xpcom/threads/nsProxyRelease.h index b494706ba9c2..0c132d362bb6 100644 --- a/xpcom/threads/nsProxyRelease.h +++ b/xpcom/threads/nsProxyRelease.h @@ -14,6 +14,7 @@ #include "mozilla/Unused.h" #include "nsCOMPtr.h" #include "nsIEventTarget.h" +#include "nsISerialEventTarget.h" #include "nsIThread.h" #include "nsPrintfCString.h" #include "nsThreadUtils.h" @@ -22,6 +23,8 @@ # error NS_ProxyRelease implementation depends on NSPR. #endif +class nsIRunnable; + namespace detail { template diff --git a/xpcom/threads/nsThread.h b/xpcom/threads/nsThread.h index bf85fb2460e1..305f092dbaa8 100644 --- a/xpcom/threads/nsThread.h +++ b/xpcom/threads/nsThread.h @@ -7,37 +7,41 @@ #ifndef nsThread_h__ #define nsThread_h__ +#include "MainThreadUtils.h" #include "mozilla/AlreadyAddRefed.h" -#include "mozilla/Array.h" #include "mozilla/Atomics.h" #include "mozilla/Attributes.h" -#include "mozilla/IntegerTypeTraits.h" +#include "mozilla/EventQueue.h" #include "mozilla/LinkedList.h" #include "mozilla/MemoryReporting.h" #include "mozilla/Mutex.h" #include "mozilla/NotNull.h" -#include "mozilla/SynchronizedEventQueue.h" +#include "mozilla/PerformanceCounter.h" +#include "mozilla/RefPtr.h" #include "mozilla/TaskDispatcher.h" #include "mozilla/TimeStamp.h" #include "mozilla/UniquePtr.h" -#include "mozilla/dom/DocGroup.h" #include "nsIDirectTaskDispatcher.h" +#include "nsIEventTarget.h" +#include "nsISerialEventTarget.h" #include "nsISupportsPriority.h" +#include "nsIThread.h" #include "nsIThreadInternal.h" -#include "nsString.h" -#include "nsTObserverArray.h" -#include "nsThreadUtils.h" -#include "prenv.h" +#include "nsTArray.h" namespace mozilla { class CycleCollectedJSContext; -class EventQueue; +class SynchronizedEventQueue; class ThreadEventQueue; class ThreadEventTarget; + +template +class Array; } // namespace mozilla using mozilla::NotNull; +class nsIRunnable; class nsLocalExecutionRecord; class nsThreadEnumerator; @@ -377,8 +381,6 @@ struct nsThreadShutdownContext { bool mIsMainThreadJoining; }; -class nsLocalExecutionRecord; - // This RAII class controls the duration of the associated nsThread's local // execution mode and provides access to the local event target. (See // nsThread::EnterLocalExecution() for details.) It is constructed from an diff --git a/xpcom/threads/nsThreadManager.h b/xpcom/threads/nsThreadManager.h index c85e936ed21c..fa223702aaa7 100644 --- a/xpcom/threads/nsThreadManager.h +++ b/xpcom/threads/nsThreadManager.h @@ -7,12 +7,18 @@ #ifndef nsThreadManager_h__ #define nsThreadManager_h__ -#include "mozilla/Mutex.h" -#include "mozilla/TaskController.h" #include "nsIThreadManager.h" #include "nsThread.h" class nsIRunnable; +class nsIEventTarget; +class nsISerialEventTarget; +class nsIThread; + +namespace mozilla { +class IdleTaskManager; +class SynchronizedEventQueue; +} // namespace mozilla class BackgroundEventTarget; diff --git a/xpcom/threads/nsThreadPool.h b/xpcom/threads/nsThreadPool.h index 2606eb33e01f..7bdafde57c66 100644 --- a/xpcom/threads/nsThreadPool.h +++ b/xpcom/threads/nsThreadPool.h @@ -8,17 +8,17 @@ #define nsThreadPool_h__ #include "nsIThreadPool.h" -#include "nsIThread.h" #include "nsIRunnable.h" #include "nsCOMArray.h" #include "nsCOMPtr.h" #include "nsThreadUtils.h" #include "mozilla/Atomics.h" -#include "mozilla/Attributes.h" #include "mozilla/AlreadyAddRefed.h" +#include "mozilla/CondVar.h" #include "mozilla/EventQueue.h" #include "mozilla/Mutex.h" -#include "mozilla/Monitor.h" + +class nsIThread; class nsThreadPool final : public mozilla::Runnable, public nsIThreadPool { public: diff --git a/xpcom/threads/nsTimerImpl.h b/xpcom/threads/nsTimerImpl.h index bf659478eacd..30bcc76ed3b7 100644 --- a/xpcom/threads/nsTimerImpl.h +++ b/xpcom/threads/nsTimerImpl.h @@ -14,7 +14,6 @@ #include "nsCOMPtr.h" #include "mozilla/Attributes.h" -#include "mozilla/Logging.h" #include "mozilla/Mutex.h" #include "mozilla/TimeStamp.h" #include "mozilla/Variant.h" @@ -32,8 +31,13 @@ extern mozilla::LogModule* GetTimerLog(); } \ } +class nsIObserver; class nsTimerImplHolder; +namespace mozilla { +class LogModule; +} + // TimerThread, nsTimerEvent, and nsTimer have references to these. nsTimer has // a separate lifecycle so we can Cancel() the underlying timer when the user of // the nsTimer has let go of its last reference.