diff --git a/accessible/generic/LocalAccessible.h b/accessible/generic/LocalAccessible.h index 1a262ef0e074..334da902b3a1 100644 --- a/accessible/generic/LocalAccessible.h +++ b/accessible/generic/LocalAccessible.h @@ -90,7 +90,7 @@ class LocalAccessible : public nsISupports, public Accessible { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(LocalAccessible) - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLE_IMPL_IID) + NS_INLINE_DECL_STATIC_IID(NS_ACCESSIBLE_IMPL_IID) ////////////////////////////////////////////////////////////////////////////// // Public methods @@ -1034,8 +1034,6 @@ class LocalAccessible : public nsISupports, public Accessible { LocalAccessible* GetPopoverTargetDetailsRelation() const; }; -NS_DEFINE_STATIC_IID_ACCESSOR(LocalAccessible, NS_ACCESSIBLE_IMPL_IID) - //////////////////////////////////////////////////////////////////////////////// // LocalAccessible downcasting method diff --git a/accessible/xpcom/xpcAccessibleTextRange.h b/accessible/xpcom/xpcAccessibleTextRange.h index 01ca228ade28..d9bb5acc964c 100644 --- a/accessible/xpcom/xpcAccessibleTextRange.h +++ b/accessible/xpcom/xpcAccessibleTextRange.h @@ -18,12 +18,12 @@ namespace a11y { class TextRange; -#define NS_ACCESSIBLETEXTRANGE_IMPL_IID \ - { /* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */ \ - 0xb17652d9, 0x4f54, 0x4c56, { \ - 0xbb, 0x62, 0x6d, 0x5b, 0xf1, 0xef, 0x91, 0x0c \ - } \ - } +#define NS_ACCESSIBLETEXTRANGE_IMPL_IID \ + {/* 133c8bf4-4913-4355-bd50-426bd1d6e1ad */ \ + 0xb17652d9, \ + 0x4f54, \ + 0x4c56, \ + {0xbb, 0x62, 0x6d, 0x5b, 0xf1, 0xef, 0x91, 0x0c}} class xpcAccessibleTextRange final : public nsIAccessibleTextRange { public: @@ -43,7 +43,7 @@ class xpcAccessibleTextRange final : public nsIAccessibleTextRange { int32_t* aResult) final; NS_IMETHOD Crop(nsIAccessible* aContainer, bool* aSuccess) final; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLETEXTRANGE_IMPL_IID) + NS_INLINE_DECL_STATIC_IID(NS_ACCESSIBLETEXTRANGE_IMPL_IID) private: xpcAccessibleTextRange() {} @@ -69,9 +69,6 @@ class xpcAccessibleTextRange final : public nsIAccessibleTextRange { int32_t mEndOffset; }; -NS_DEFINE_STATIC_IID_ACCESSOR(xpcAccessibleTextRange, - NS_ACCESSIBLETEXTRANGE_IMPL_IID) - } // namespace a11y } // namespace mozilla diff --git a/docshell/base/IHistory.h b/docshell/base/IHistory.h index 30da778f45c6..636009e5dd62 100644 --- a/docshell/base/IHistory.h +++ b/docshell/base/IHistory.h @@ -24,16 +24,12 @@ class Link; } // namespace dom // 0057c9d3-b98e-4933-bdc5-0275d06705e1 -#define IHISTORY_IID \ - { \ - 0x0057c9d3, 0xb98e, 0x4933, { \ - 0xbd, 0xc5, 0x02, 0x75, 0xd0, 0x67, 0x05, 0xe1 \ - } \ - } +#define IHISTORY_IID \ + {0x0057c9d3, 0xb98e, 0x4933, {0xbd, 0xc5, 0x02, 0x75, 0xd0, 0x67, 0x05, 0xe1}} class IHistory : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(IHISTORY_IID) + NS_INLINE_DECL_STATIC_IID(IHISTORY_IID) using ContentParentSet = nsTHashSet>; @@ -168,8 +164,6 @@ class IHistory : public nsISupports { NS_IMETHOD SetURITitle(nsIURI* aURI, const nsAString& aTitle) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(IHistory, IHISTORY_IID) - } // namespace mozilla #endif // mozilla_IHistory_h_ diff --git a/docshell/base/nsIScrollObserver.h b/docshell/base/nsIScrollObserver.h index 165e3d64154d..d4c3e3616b29 100644 --- a/docshell/base/nsIScrollObserver.h +++ b/docshell/base/nsIScrollObserver.h @@ -11,16 +11,12 @@ #include "Units.h" // Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs -#define NS_ISCROLLOBSERVER_IID \ - { \ - 0xaa5026eb, 0x2f88, 0x4026, { \ - 0xa4, 0x6b, 0xf4, 0x59, 0x6b, 0x4e, 0xdf, 0x00 \ - } \ - } +#define NS_ISCROLLOBSERVER_IID \ + {0xaa5026eb, 0x2f88, 0x4026, {0xa4, 0x6b, 0xf4, 0x59, 0x6b, 0x4e, 0xdf, 0x00}} class nsIScrollObserver : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCROLLOBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_ISCROLLOBSERVER_IID) /** * Called when the scroll position of some element has changed. @@ -40,6 +36,4 @@ class nsIScrollObserver : public nsISupports { MOZ_CAN_RUN_SCRIPT virtual void AsyncPanZoomStopped() {}; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIScrollObserver, NS_ISCROLLOBSERVER_IID) - #endif /* nsIScrollObserver_h___ */ diff --git a/docshell/shistory/SessionHistoryEntry.h b/docshell/shistory/SessionHistoryEntry.h index 7ea6c6fcc3a3..4f9f9e3866ff 100644 --- a/docshell/shistory/SessionHistoryEntry.h +++ b/docshell/shistory/SessionHistoryEntry.h @@ -375,7 +375,7 @@ class SessionHistoryEntry : public nsISHEntry, public nsSupportsWeakReference { NS_DECL_ISUPPORTS NS_DECL_NSISHENTRY - NS_DECLARE_STATIC_IID_ACCESSOR(NS_SESSIONHISTORYENTRY_IID) + NS_INLINE_DECL_STATIC_IID(NS_SESSIONHISTORYENTRY_IID) bool IsInSessionHistory() { SessionHistoryEntry* entry = this; @@ -461,8 +461,6 @@ class SessionHistoryEntry : public nsISHEntry, public nsSupportsWeakReference { static nsTHashMap* sLoadIdToEntry; }; -NS_DEFINE_STATIC_IID_ACCESSOR(SessionHistoryEntry, NS_SESSIONHISTORYENTRY_IID) - } // namespace dom namespace ipc { diff --git a/dom/base/ContentFrameMessageManager.h b/dom/base/ContentFrameMessageManager.h index 49c0676bcb1e..bb007c376922 100644 --- a/dom/base/ContentFrameMessageManager.h +++ b/dom/base/ContentFrameMessageManager.h @@ -18,12 +18,8 @@ template struct Nullable; class WindowProxyHolder; -#define NS_CONTENTFRAMEMESSAGEMANAGER_IID \ - { \ - 0x97e192a6, 0xab7a, 0x4c8f, { \ - 0xb7, 0xdd, 0xf7, 0xec, 0x36, 0x38, 0x71, 0xb5 \ - } \ - } +#define NS_CONTENTFRAMEMESSAGEMANAGER_IID \ + {0x97e192a6, 0xab7a, 0x4c8f, {0xb7, 0xdd, 0xf7, 0xec, 0x36, 0x38, 0x71, 0xb5}} /** * Base class for implementing the WebIDL ContentFrameMessageManager class. @@ -34,7 +30,7 @@ class ContentFrameMessageManager : public DOMEventTargetHelper, using DOMEventTargetHelper::AddRef; using DOMEventTargetHelper::Release; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_CONTENTFRAMEMESSAGEMANAGER_IID) + NS_INLINE_DECL_STATIC_IID(NS_CONTENTFRAMEMESSAGEMANAGER_IID) virtual Nullable GetContent(ErrorResult& aError) = 0; virtual already_AddRefed GetDocShell(ErrorResult& aError) = 0; @@ -54,9 +50,6 @@ class ContentFrameMessageManager : public DOMEventTargetHelper, MessageManagerGlobal(aMessageManager) {} }; -NS_DEFINE_STATIC_IID_ACCESSOR(ContentFrameMessageManager, - NS_CONTENTFRAMEMESSAGEMANAGER_IID) - } // namespace mozilla::dom #endif // mozilla_dom_ContentFrameMessageManager_h diff --git a/dom/base/DOMException.h b/dom/base/DOMException.h index aff096bbc055..865768af02d0 100644 --- a/dom/base/DOMException.h +++ b/dom/base/DOMException.h @@ -39,16 +39,12 @@ namespace dom { class GlobalObject; -#define MOZILLA_EXCEPTION_IID \ - { \ - 0x55eda557, 0xeba0, 0x4fe3, { \ - 0xae, 0x2e, 0xf3, 0x94, 0x49, 0x23, 0x62, 0xd6 \ - } \ - } +#define MOZILLA_EXCEPTION_IID \ + {0x55eda557, 0xeba0, 0x4fe3, {0xae, 0x2e, 0xf3, 0x94, 0x49, 0x23, 0x62, 0xd6}} class Exception : public nsIException, public nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_EXCEPTION_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_EXCEPTION_IID) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Exception) @@ -135,8 +131,6 @@ class Exception : public nsIException, public nsWrapperCache { JS::Heap mThrownJSVal; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Exception, MOZILLA_EXCEPTION_IID) - class DOMException : public Exception { public: DOMException(nsresult aRv, const nsACString& aMessage, diff --git a/dom/base/DOMIntersectionObserver.h b/dom/base/DOMIntersectionObserver.h index 944f31746a89..b807bc69f123 100644 --- a/dom/base/DOMIntersectionObserver.h +++ b/dom/base/DOMIntersectionObserver.h @@ -73,12 +73,8 @@ class DOMIntersectionObserverEntry final : public nsISupports, double mIntersectionRatio; }; -#define NS_DOM_INTERSECTION_OBSERVER_IID \ - { \ - 0x8570a575, 0xe303, 0x4d18, { \ - 0xb6, 0xb1, 0x4d, 0x2b, 0x49, 0xd8, 0xef, 0x94 \ - } \ - } +#define NS_DOM_INTERSECTION_OBSERVER_IID \ + {0x8570a575, 0xe303, 0x4d18, {0xb6, 0xb1, 0x4d, 0x2b, 0x49, 0xd8, 0xef, 0x94}} // An input suitable to compute intersections with multiple targets. struct IntersectionInput { @@ -119,7 +115,7 @@ class DOMIntersectionObserver final : public nsISupports, dom::IntersectionCallback& aCb); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMIntersectionObserver) - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_INTERSECTION_OBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_DOM_INTERSECTION_OBSERVER_IID) static already_AddRefed Constructor( const GlobalObject&, dom::IntersectionCallback&, ErrorResult&); @@ -210,9 +206,6 @@ class DOMIntersectionObserver final : public nsISupports, bool mConnected = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DOMIntersectionObserver, - NS_DOM_INTERSECTION_OBSERVER_IID) - } // namespace mozilla::dom #endif diff --git a/dom/base/Document.h b/dom/base/Document.h index 04ef53e3858b..ef8e8a3a8ac4 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -577,7 +577,7 @@ class Document : public nsINode, */ static void Shutdown(); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_IDOCUMENT_IID) NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD_(void) DeleteCycleCollectable() override; @@ -3710,9 +3710,9 @@ class Document : public nsINode, // effect once per document, and so is called during document destruction. void ReportDocumentUseCounters(); - // Report the names of the HTMLDocument properties thad had been shadowed using id/name - // and were then accessed ("DOM clobbering"). - // This data is collected by nsHTMLDocument::NamedGetter and limited to 10 unique entries. + // Report the names of the HTMLDocument properties thad had been shadowed + // using id/name and were then accessed ("DOM clobbering"). This data is + // collected by nsHTMLDocument::NamedGetter and limited to 10 unique entries. void ReportShadowedHTMLDocumentProperties(); // Reports largest contentful paint via telemetry. We want the most up to @@ -5569,8 +5569,8 @@ class Document : public nsINode, // See SetNotifyFormOrPasswordRemoved and ShouldNotifyFormOrPasswordRemoved. bool mShouldNotifyFormOrPasswordRemoved; - // Used by the shadowed_html_document_property_access telemetry probe to collected shadowed - // HTMLDocument properties. (Limited to 10 entries) + // Used by the shadowed_html_document_property_access telemetry probe to + // collected shadowed HTMLDocument properties. (Limited to 10 entries) nsTArray mShadowedHTMLDocumentProperties; // Bitfield to be collected in the pageload event, recording relevant features @@ -5628,8 +5628,6 @@ class Document : public nsINode, ErrorResult& aError); }; -NS_DEFINE_STATIC_IID_ACCESSOR(Document, NS_IDOCUMENT_IID) - /** * mozAutoSubtreeModified batches DOM mutations so that a DOMSubtreeModified * event is dispatched, if necessary, when the outermost mozAutoSubtreeModified diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 44db22be88f5..7db8a9c0e061 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -4741,8 +4741,8 @@ void Element::ClearDataset() { template void Element::GetCustomInterface(nsGetterAddRefs aResult) { - nsCOMPtr iface = CustomElementRegistry::CallGetCustomInterface( - this, NS_GET_TEMPLATE_IID(T)); + nsCOMPtr iface = + CustomElementRegistry::CallGetCustomInterface(this, NS_GET_IID(T)); if (iface) { if (NS_SUCCEEDED(CallQueryInterface(iface, static_cast(aResult)))) { return; diff --git a/dom/base/Element.h b/dom/base/Element.h index e4b57da2098d..f5ce91010d11 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -309,7 +309,7 @@ class Element : public FragmentOrElement { #endif // MOZILLA_INTERNAL_API - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ELEMENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_ELEMENT_IID) NS_DECL_ADDSIZEOFEXCLUDINGTHIS @@ -2350,8 +2350,6 @@ class Element : public FragmentOrElement { AttrArray mAttrs; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID) - inline bool Element::HasNonEmptyAttr(int32_t aNameSpaceID, const nsAtom* aName) const { MOZ_ASSERT(aNameSpaceID > kNameSpaceID_Unknown, "Must have namespace"); diff --git a/dom/base/Link.h b/dom/base/Link.h index cee1e1c5ca23..05cce7c045fb 100644 --- a/dom/base/Link.h +++ b/dom/base/Link.h @@ -27,16 +27,12 @@ class Document; class Element; struct BindContext; -#define MOZILLA_DOM_LINK_IMPLEMENTATION_IID \ - { \ - 0xb25edee6, 0xdd35, 0x4f8b, { \ - 0xab, 0x90, 0x66, 0xd0, 0xbd, 0x3c, 0x22, 0xd5 \ - } \ - } +#define MOZILLA_DOM_LINK_IMPLEMENTATION_IID \ + {0xb25edee6, 0xdd35, 0x4f8b, {0xab, 0x90, 0x66, 0xd0, 0xbd, 0x3c, 0x22, 0xd5}} class Link : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_LINK_IMPLEMENTATION_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_DOM_LINK_IMPLEMENTATION_IID) enum class State : uint8_t { Unvisited = 0, @@ -141,8 +137,6 @@ class Link : public nsISupports { const bool mHistory : 1; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Link, MOZILLA_DOM_LINK_IMPLEMENTATION_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/base/nsDOMMutationObserver.h b/dom/base/nsDOMMutationObserver.h index 92ab53d43a92..1de608240586 100644 --- a/dom/base/nsDOMMutationObserver.h +++ b/dom/base/nsDOMMutationObserver.h @@ -402,12 +402,8 @@ class nsAnimationReceiver : public nsMutationReceiver { AnimationMutation aMutationType); }; -#define NS_DOM_MUTATION_OBSERVER_IID \ - { \ - 0x0c3b91f8, 0xcc3b, 0x4b08, { \ - 0x9e, 0xab, 0x07, 0x47, 0xa9, 0xe4, 0x65, 0xb4 \ - } \ - } +#define NS_DOM_MUTATION_OBSERVER_IID \ + {0x0c3b91f8, 0xcc3b, 0x4b08, {0x9e, 0xab, 0x07, 0x47, 0xa9, 0xe4, 0x65, 0xb4}} class nsDOMMutationObserver final : public nsISupports, public nsWrapperCache { public: @@ -422,7 +418,7 @@ class nsDOMMutationObserver final : public nsISupports, public nsWrapperCache { mId(++sCount) {} NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMMutationObserver) - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_MUTATION_OBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_DOM_MUTATION_OBSERVER_IID) static already_AddRefed Constructor( const mozilla::dom::GlobalObject&, mozilla::dom::MutationCallback&, @@ -571,9 +567,6 @@ class nsDOMMutationObserver final : public nsISupports, public nsWrapperCache { sCurrentlyHandlingObservers; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMMutationObserver, - NS_DOM_MUTATION_OBSERVER_IID) - class nsAutoMutationBatch { public: nsAutoMutationBatch() diff --git a/dom/base/nsFrameLoader.h b/dom/base/nsFrameLoader.h index 7023d78deee5..096b57e55dfc 100644 --- a/dom/base/nsFrameLoader.h +++ b/dom/base/nsFrameLoader.h @@ -102,12 +102,8 @@ typedef struct _GtkWidget GtkWidget; #endif // IID for nsFrameLoader, because some places want to QI to it. -#define NS_FRAMELOADER_IID \ - { \ - 0x297fd0ea, 0x1b4a, 0x4c9a, { \ - 0xa4, 0x04, 0xe5, 0x8b, 0xe8, 0x95, 0x10, 0x50 \ - } \ - } +#define NS_FRAMELOADER_IID \ + {0x297fd0ea, 0x1b4a, 0x4c9a, {0xa4, 0x04, 0xe5, 0x8b, 0xe8, 0x95, 0x10, 0x50}} class nsFrameLoader final : public nsStubMutationObserver, public mozilla::dom::ipc::MessageManagerCallback, @@ -137,7 +133,7 @@ class nsFrameLoader final : public nsStubMutationObserver, const mozilla::dom::NavigationIsolationOptions& aRemotenessOptions, bool aIsRemote, bool aNetworkCreated, bool aPreserveContext); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_FRAMELOADER_IID) + NS_INLINE_DECL_STATIC_IID(NS_FRAMELOADER_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsFrameLoader) @@ -568,8 +564,6 @@ class nsFrameLoader final : public nsStubMutationObserver, bool mTabProcessCrashFired : 1; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsFrameLoader, NS_FRAMELOADER_IID) - inline nsISupports* ToSupports(nsFrameLoader* aFrameLoader) { return aFrameLoader; } diff --git a/dom/base/nsFrameLoaderOwner.h b/dom/base/nsFrameLoaderOwner.h index ae57269076f8..7741cb77561d 100644 --- a/dom/base/nsFrameLoaderOwner.h +++ b/dom/base/nsFrameLoaderOwner.h @@ -25,12 +25,8 @@ struct NavigationIsolationOptions; } // namespace mozilla // IID for the FrameLoaderOwner interface -#define NS_FRAMELOADEROWNER_IID \ - { \ - 0x1b4fd25c, 0x2e57, 0x11e9, { \ - 0x9e, 0x5a, 0x5b, 0x86, 0xe9, 0x89, 0xa5, 0xc0 \ - } \ - } +#define NS_FRAMELOADEROWNER_IID \ + {0x1b4fd25c, 0x2e57, 0x11e9, {0x9e, 0x5a, 0x5b, 0x86, 0xe9, 0x89, 0xa5, 0xc0}} // Mixin that handles ownership of nsFrameLoader for Frame elements // (XULFrameElement, HTMLI/FrameElement, etc...). Manages information when doing @@ -41,7 +37,7 @@ struct NavigationIsolationOptions; // nsFrameLoaderOwner to actually implement ISupports for us. class nsFrameLoaderOwner : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_FRAMELOADEROWNER_IID) + NS_INLINE_DECL_STATIC_IID(NS_FRAMELOADEROWNER_IID) nsFrameLoaderOwner() = default; already_AddRefed GetFrameLoader(); @@ -138,6 +134,4 @@ class nsFrameLoaderOwner : public nsISupports { mozilla::LinkedList mFrameLoaderList; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsFrameLoaderOwner, NS_FRAMELOADEROWNER_IID) - #endif // nsFrameLoaderOwner_h_ diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index cd75485b7368..42ee50b53a66 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -1812,7 +1812,7 @@ void nsGlobalWindowOuter::SetInitialPrincipal( class WindowStateHolder final : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(WINDOWSTATEHOLDER_IID) + NS_INLINE_DECL_STATIC_IID(WINDOWSTATEHOLDER_IID) NS_DECL_ISUPPORTS explicit WindowStateHolder(nsGlobalWindowInner* aWindow); @@ -1833,8 +1833,6 @@ class WindowStateHolder final : public nsISupports { JS::PersistentRooted mInnerWindowReflector; }; -NS_DEFINE_STATIC_IID_ACCESSOR(WindowStateHolder, WINDOWSTATEHOLDER_IID) - WindowStateHolder::WindowStateHolder(nsGlobalWindowInner* aWindow) : mInnerWindow(aWindow), mInnerWindowReflector(RootingCx(), aWindow->GetWrapper()) { diff --git a/dom/base/nsIAnimationObserver.h b/dom/base/nsIAnimationObserver.h index a692d2944c1b..aa65f381e5af 100644 --- a/dom/base/nsIAnimationObserver.h +++ b/dom/base/nsIAnimationObserver.h @@ -12,24 +12,18 @@ namespace mozilla::dom { class Animation; } // namespace mozilla::dom -#define NS_IANIMATION_OBSERVER_IID \ - { \ - 0xed025fc7, 0xdeda, 0x48b9, { \ - 0x9c, 0x35, 0xf2, 0xb6, 0x1e, 0xeb, 0xd0, 0x8d \ - } \ - } +#define NS_IANIMATION_OBSERVER_IID \ + {0xed025fc7, 0xdeda, 0x48b9, {0x9c, 0x35, 0xf2, 0xb6, 0x1e, 0xeb, 0xd0, 0x8d}} class nsIAnimationObserver : public nsIMutationObserver { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IANIMATION_OBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_IANIMATION_OBSERVER_IID) virtual void AnimationAdded(mozilla::dom::Animation* aAnimation) = 0; virtual void AnimationChanged(mozilla::dom::Animation* aAnimation) = 0; virtual void AnimationRemoved(mozilla::dom::Animation* aAnimation) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIAnimationObserver, NS_IANIMATION_OBSERVER_IID) - #define NS_DECL_NSIANIMATIONOBSERVER_ANIMATIONADDED \ virtual void AnimationAdded(mozilla::dom::Animation* aAnimation) override; diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h index 82f414e59460..1ae51ec416eb 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -73,7 +73,7 @@ class nsIContent : public nsINode { } #endif // MOZILLA_INTERNAL_API - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_ICONTENT_IID) NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD_(void) DeleteCycleCollectable(void) final; @@ -772,6 +772,4 @@ class nsIContent : public nsINode { NON_VIRTUAL_ADDREF_RELEASE(nsIContent) -NS_DEFINE_STATIC_IID_ACCESSOR(nsIContent, NS_ICONTENT_IID) - #endif /* nsIContent_h___ */ diff --git a/dom/base/nsIDocumentObserver.h b/dom/base/nsIDocumentObserver.h index ff20f1834326..4f0e03283b7c 100644 --- a/dom/base/nsIDocumentObserver.h +++ b/dom/base/nsIDocumentObserver.h @@ -18,17 +18,13 @@ class Element; } // namespace dom } // namespace mozilla -#define NS_IDOCUMENT_OBSERVER_IID \ - { \ - 0x71041fa3, 0x6dd7, 0x4cde, { \ - 0xbb, 0x76, 0xae, 0xcc, 0x69, 0xe1, 0x75, 0x78 \ - } \ - } +#define NS_IDOCUMENT_OBSERVER_IID \ + {0x71041fa3, 0x6dd7, 0x4cde, {0xbb, 0x76, 0xae, 0xcc, 0x69, 0xe1, 0x75, 0x78}} // Document observer interface class nsIDocumentObserver : public nsIMutationObserver { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_OBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_IDOCUMENT_OBSERVER_IID) /** * Notify that a content model update is beginning. This call can be @@ -73,8 +69,6 @@ class nsIDocumentObserver : public nsIMutationObserver { mozilla::dom::ElementState) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID) - #define NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE \ virtual void BeginUpdate(mozilla::dom::Document*) override; diff --git a/dom/base/nsIGlobalObject.h b/dom/base/nsIGlobalObject.h index 8c36e32355c2..0bb6cf22c5f8 100644 --- a/dom/base/nsIGlobalObject.h +++ b/dom/base/nsIGlobalObject.h @@ -88,7 +88,7 @@ class nsIGlobalObject : public nsISupports { public: using RTPCallerType = mozilla::RTPCallerType; using RFPTarget = mozilla::RFPTarget; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IGLOBALOBJECT_IID) + NS_INLINE_DECL_STATIC_IID(NS_IGLOBALOBJECT_IID) /** * This check is added to deal with Promise microtask queues. On the main @@ -414,6 +414,4 @@ class nsIGlobalObject : public nsISupports { RefPtr mByteLengthQueuingStrategySizeFunction; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIGlobalObject, NS_IGLOBALOBJECT_IID) - #endif // nsIGlobalObject_h__ diff --git a/dom/base/nsIMutationObserver.h b/dom/base/nsIMutationObserver.h index f092de41a5ab..50fec86e224d 100644 --- a/dom/base/nsIMutationObserver.h +++ b/dom/base/nsIMutationObserver.h @@ -110,7 +110,7 @@ class nsIMutationObserver friend struct mozilla::GetDoublyLinkedListElement; public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMUTATION_OBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_IMUTATION_OBSERVER_IID) /** * Notification that the node value of a data node (text, cdata, pi, comment) @@ -339,8 +339,6 @@ class nsIMutationObserver uint32_t mEnabledCallbacks = kAll; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIMutationObserver, NS_IMUTATION_OBSERVER_IID) - #define NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATAWILLCHANGE \ virtual void CharacterDataWillChange( \ nsIContent* aContent, const CharacterDataChangeInfo& aInfo) override; diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index d8465dcd3830..2bdf92b941ce 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -382,7 +382,7 @@ class nsINode : public mozilla::dom::EventTarget { template using Sequence = mozilla::dom::Sequence; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_INODE_IID) + NS_INLINE_DECL_STATIC_IID(NS_INODE_IID) // The |aNodeSize| outparam on this function is where the actual node size // value is put. It gets added to the appropriate value within |aSizes| by @@ -2624,8 +2624,6 @@ inline nsINode* NODE_FROM(C& aContent, D& aDocument) { return static_cast(aDocument); } -NS_DEFINE_STATIC_IID_ACCESSOR(nsINode, NS_INODE_IID) - inline nsISupports* ToSupports(nsINode* aPointer) { return aPointer; } // Some checks are faster to do on nsIContent or Element than on diff --git a/dom/base/nsINodeList.h b/dom/base/nsINodeList.h index 329c06df9b94..87b970c9d255 100644 --- a/dom/base/nsINodeList.h +++ b/dom/base/nsINodeList.h @@ -12,12 +12,8 @@ #include "nsIContent.h" // IID for the nsINodeList interface -#define NS_INODELIST_IID \ - { \ - 0xadb5e54c, 0x6e96, 0x4102, { \ - 0x8d, 0x40, 0xe0, 0x12, 0x3d, 0xcf, 0x48, 0x7a \ - } \ - } +#define NS_INODELIST_IID \ + {0xadb5e54c, 0x6e96, 0x4102, {0x8d, 0x40, 0xe0, 0x12, 0x3d, 0xcf, 0x48, 0x7a}} class nsIContent; class nsINode; @@ -27,7 +23,7 @@ class nsINode; */ class nsINodeList : public nsISupports, public nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_INODELIST_IID) + NS_INLINE_DECL_STATIC_IID(NS_INODELIST_IID) /** * Get the index of the given node in the list. Will return -1 if the node @@ -49,6 +45,4 @@ class nsINodeList : public nsISupports, public nsWrapperCache { } }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsINodeList, NS_INODELIST_IID) - #endif /* nsINodeList_h___ */ diff --git a/dom/base/nsIScriptContext.h b/dom/base/nsIScriptContext.h index a43f5316eb4b..fac3cb888438 100644 --- a/dom/base/nsIScriptContext.h +++ b/dom/base/nsIScriptContext.h @@ -18,12 +18,8 @@ class nsIScriptGlobalObject; // Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs -#define NS_ISCRIPTCONTEXT_IID \ - { \ - 0x54cbe9cf, 0x7282, 0x421a, { \ - 0x91, 0x6f, 0xd0, 0x70, 0x73, 0xde, 0xb8, 0xc0 \ - } \ - } +#define NS_ISCRIPTCONTEXT_IID \ + {0x54cbe9cf, 0x7282, 0x421a, {0x91, 0x6f, 0xd0, 0x70, 0x73, 0xde, 0xb8, 0xc0}} class nsIOffThreadScriptReceiver; @@ -33,7 +29,7 @@ class nsIOffThreadScriptReceiver; */ class nsIScriptContext : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTCONTEXT_IID) + NS_INLINE_DECL_STATIC_IID(NS_ISCRIPTCONTEXT_IID) /** * Return the global object. @@ -65,18 +61,12 @@ class nsIScriptContext : public nsISupports { virtual JSObject* GetWindowProxy() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContext, NS_ISCRIPTCONTEXT_IID) - -#define NS_IOFFTHREADSCRIPTRECEIVER_IID \ - { \ - 0x3a980010, 0x878d, 0x46a9, { \ - 0x93, 0xad, 0xbc, 0xfd, 0xd3, 0x8e, 0xa0, 0xc2 \ - } \ - } +#define NS_IOFFTHREADSCRIPTRECEIVER_IID \ + {0x3a980010, 0x878d, 0x46a9, {0x93, 0xad, 0xbc, 0xfd, 0xd3, 0x8e, 0xa0, 0xc2}} class nsIOffThreadScriptReceiver : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOFFTHREADSCRIPTRECEIVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_IOFFTHREADSCRIPTRECEIVER_IID) /** * Notify this object that a previous Compile call specifying this as @@ -87,7 +77,4 @@ class nsIOffThreadScriptReceiver : public nsISupports { nsresult aStatus) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIOffThreadScriptReceiver, - NS_IOFFTHREADSCRIPTRECEIVER_IID) - #endif // nsIScriptContext_h__ diff --git a/dom/base/nsIScriptGlobalObject.h b/dom/base/nsIScriptGlobalObject.h index 51c122f8ad08..456ed2e5c661 100644 --- a/dom/base/nsIScriptGlobalObject.h +++ b/dom/base/nsIScriptGlobalObject.h @@ -30,12 +30,8 @@ MOZ_CAN_RUN_SCRIPT_BOUNDARY bool NS_HandleScriptError( const mozilla::dom::ErrorEventInit& aErrorEvent, nsEventStatus* aStatus); // Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs -#define NS_ISCRIPTGLOBALOBJECT_IID \ - { \ - 0x876f83bd, 0x6314, 0x460a, { \ - 0xa0, 0x45, 0x1c, 0x8f, 0x46, 0x2f, 0xb8, 0xe1 \ - } \ - } +#define NS_ISCRIPTGLOBALOBJECT_IID \ + {0x876f83bd, 0x6314, 0x460a, {0xa0, 0x45, 0x1c, 0x8f, 0x46, 0x2f, 0xb8, 0xe1}} /** * The global object which keeps a script context for each supported script @@ -46,7 +42,7 @@ MOZ_CAN_RUN_SCRIPT_BOUNDARY bool NS_HandleScriptError( class nsIScriptGlobalObject : public nsIGlobalObject { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTGLOBALOBJECT_IID) + NS_INLINE_DECL_STATIC_IID(NS_ISCRIPTGLOBALOBJECT_IID) /** * Ensure that the script global object is initialized for working with the @@ -79,6 +75,4 @@ class nsIScriptGlobalObject : public nsIGlobalObject { virtual ~nsIScriptGlobalObject() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptGlobalObject, NS_ISCRIPTGLOBALOBJECT_IID) - #endif diff --git a/dom/base/nsIScriptObjectPrincipal.h b/dom/base/nsIScriptObjectPrincipal.h index 67b8bffb43aa..13d93eb64e28 100644 --- a/dom/base/nsIScriptObjectPrincipal.h +++ b/dom/base/nsIScriptObjectPrincipal.h @@ -11,19 +11,15 @@ class nsIPrincipal; -#define NS_ISCRIPTOBJECTPRINCIPAL_IID \ - { \ - 0x3eedba38, 0x8d22, 0x41e1, { \ - 0x81, 0x7a, 0x0e, 0x43, 0xe1, 0x65, 0xb6, 0x64 \ - } \ - } +#define NS_ISCRIPTOBJECTPRINCIPAL_IID \ + {0x3eedba38, 0x8d22, 0x41e1, {0x81, 0x7a, 0x0e, 0x43, 0xe1, 0x65, 0xb6, 0x64}} /** * JS Object Principal information. */ class nsIScriptObjectPrincipal : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTOBJECTPRINCIPAL_IID) + NS_INLINE_DECL_STATIC_IID(NS_ISCRIPTOBJECTPRINCIPAL_IID) virtual nsIPrincipal* GetPrincipal() = 0; @@ -34,7 +30,4 @@ class nsIScriptObjectPrincipal : public nsISupports { virtual nsIPrincipal* PartitionedPrincipal() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptObjectPrincipal, - NS_ISCRIPTOBJECTPRINCIPAL_IID) - #endif // nsIScriptObjectPrincipal_h__ diff --git a/dom/base/nsISizeOfEventTarget.h b/dom/base/nsISizeOfEventTarget.h index 1e58fc24eb63..f062f49d867a 100644 --- a/dom/base/nsISizeOfEventTarget.h +++ b/dom/base/nsISizeOfEventTarget.h @@ -10,12 +10,8 @@ #include "mozilla/MemoryReporting.h" #include "nsISupports.h" -#define NS_ISIZEOFEVENTTARGET_IID \ - { \ - 0xa1e08cb9, 0x5455, 0x4593, { \ - 0xb4, 0x1f, 0x38, 0x7a, 0x85, 0x44, 0xd0, 0xb5 \ - } \ - } +#define NS_ISIZEOFEVENTTARGET_IID \ + {0xa1e08cb9, 0x5455, 0x4593, {0xb4, 0x1f, 0x38, 0x7a, 0x85, 0x44, 0xd0, 0xb5}} /** * This class is much the same as nsISizeOf, but is specifically for measuring @@ -27,7 +23,7 @@ */ class nsISizeOfEventTarget : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISIZEOFEVENTTARGET_IID) + NS_INLINE_DECL_STATIC_IID(NS_ISIZEOFEVENTTARGET_IID) /** * Measures the size of the things pointed to by the object, plus the object @@ -37,6 +33,4 @@ class nsISizeOfEventTarget : public nsISupports { mozilla::MallocSizeOf aMallocSizeOf) const = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsISizeOfEventTarget, NS_ISIZEOFEVENTTARGET_IID) - #endif /* nsISizeOfEventTarget_h___ */ diff --git a/dom/base/nsJSEnvironment.h b/dom/base/nsJSEnvironment.h index 6e4edf05f001..8ee4732e6eb8 100644 --- a/dom/base/nsJSEnvironment.h +++ b/dom/base/nsJSEnvironment.h @@ -198,22 +198,16 @@ class AsyncErrorReporter final : public mozilla::Runnable { // supports this interface, JS can reach directly in for the argv, and avoid // nsISupports conversion. If this interface is not supported, the object will // be queried for nsIArray, and everything converted via xpcom objects. -#define NS_IJSARGARRAY_IID \ - { \ - 0xb6acdac8, 0xf5c6, 0x432c, { \ - 0xa8, 0x6e, 0x33, 0xee, 0xb1, 0xb0, 0xcd, 0xdc \ - } \ - } +#define NS_IJSARGARRAY_IID \ + {0xb6acdac8, 0xf5c6, 0x432c, {0xa8, 0x6e, 0x33, 0xee, 0xb1, 0xb0, 0xcd, 0xdc}} class nsIJSArgArray : public nsIArray { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IJSARGARRAY_IID) + NS_INLINE_DECL_STATIC_IID(NS_IJSARGARRAY_IID) // Bug 312003 describes why this must be "void **", but after calling argv // may be cast to JS::Value* and the args found at: // ((JS::Value*)argv)[0], ..., ((JS::Value*)argv)[argc - 1] virtual nsresult GetArgs(uint32_t* argc, void** argv) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIJSArgArray, NS_IJSARGARRAY_IID) - #endif /* nsJSEnvironment_h */ diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 53c53254799b..4b4de94f0d6f 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -103,7 +103,7 @@ class nsPIDOMWindowInner : public mozIDOMWindow { ~nsPIDOMWindowInner(); public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMWINDOWINNER_IID) + NS_INLINE_DECL_STATIC_IID(NS_PIDOMWINDOWINNER_IID) nsIGlobalObject* AsGlobal(); const nsIGlobalObject* AsGlobal() const; @@ -743,8 +743,6 @@ class nsPIDOMWindowInner : public mozIDOMWindow { RefPtr mCloseWatcherManager; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowInner, NS_PIDOMWINDOWINNER_IID) - class nsPIDOMWindowOuter : public mozIDOMWindowProxy { protected: using Document = mozilla::dom::Document; @@ -756,7 +754,7 @@ class nsPIDOMWindowOuter : public mozIDOMWindowProxy { void NotifyResumingDelayedMedia(); public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMWINDOWOUTER_IID) + NS_INLINE_DECL_STATIC_IID(NS_PIDOMWINDOWOUTER_IID) NS_IMPL_FROMEVENTTARGET_HELPER_WITH_GETTER(nsPIDOMWindowOuter, GetAsOuterWindow()) @@ -1144,8 +1142,6 @@ class nsPIDOMWindowOuter : public mozIDOMWindowProxy { uint32_t mMarkedCCGeneration; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowOuter, NS_PIDOMWINDOWOUTER_IID) - #include "nsPIDOMWindowInlines.h" #endif // nsPIDOMWindow_h__ diff --git a/dom/base/nsPIWindowRoot.h b/dom/base/nsPIWindowRoot.h index fe4a0df484c0..da6d3dee60de 100644 --- a/dom/base/nsPIWindowRoot.h +++ b/dom/base/nsPIWindowRoot.h @@ -16,16 +16,12 @@ class nsIController; class nsINode; class nsIRemoteTab; -#define NS_IWINDOWROOT_IID \ - { \ - 0xb8724c49, 0xc398, 0x4f9b, { \ - 0x82, 0x59, 0x87, 0x27, 0xa6, 0x47, 0xdd, 0x0f \ - } \ - } +#define NS_IWINDOWROOT_IID \ + {0xb8724c49, 0xc398, 0x4f9b, {0x82, 0x59, 0x87, 0x27, 0xa6, 0x47, 0xdd, 0x0f}} class nsPIWindowRoot : public mozilla::dom::EventTarget { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWINDOWROOT_IID) + NS_INLINE_DECL_STATIC_IID(NS_IWINDOWROOT_IID) bool IsRootWindow() const final { return true; } @@ -91,6 +87,4 @@ inline const nsPIWindowRoot* EventTarget::AsWindowRoot() const { } // namespace mozilla::dom -NS_DEFINE_STATIC_IID_ACCESSOR(nsPIWindowRoot, NS_IWINDOWROOT_IID) - #endif // nsPIWindowRoot_h__ diff --git a/dom/base/nsStyledElement.h b/dom/base/nsStyledElement.h index 670c838fc9f1..2984ae240e02 100644 --- a/dom/base/nsStyledElement.h +++ b/dom/base/nsStyledElement.h @@ -23,12 +23,8 @@ struct MutationClosureData; } // namespace mozilla // IID for nsStyledElement interface -#define NS_STYLED_ELEMENT_IID \ - { \ - 0xacbd9ea6, 0x15aa, 0x4f37, { \ - 0x8c, 0xe0, 0x35, 0x1e, 0xd7, 0x21, 0xca, 0xe9 \ - } \ - } +#define NS_STYLED_ELEMENT_IID \ + {0xacbd9ea6, 0x15aa, 0x4f37, {0x8c, 0xe0, 0x35, 0x1e, 0xd7, 0x21, 0xca, 0xe9}} using nsStyledElementBase = mozilla::dom::Element; @@ -54,7 +50,7 @@ class nsStyledElement : public nsStyledElementBase { nsICSSDeclaration* Style(); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_STYLED_ELEMENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_STYLED_ELEMENT_IID) NS_IMPL_FROMNODE_HELPER(nsStyledElement, IsStyledElement()); bool IsStyledElement() const final { return true; } @@ -95,5 +91,4 @@ class nsStyledElement : public nsStyledElementBase { const nsAttrValue* aValue, bool aNotify) override; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsStyledElement, NS_STYLED_ELEMENT_IID) #endif // __NS_STYLEDELEMENT_H_ diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h index 4ea9b7c6e101..7b6d6997ea49 100644 --- a/dom/base/nsWrapperCache.h +++ b/dom/base/nsWrapperCache.h @@ -84,7 +84,7 @@ static_assert(sizeof(void*) == 4, "Only support 32-bit and 64-bit"); class JS_HAZ_ROOTED nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_WRAPPERCACHE_IID) + NS_INLINE_DECL_STATIC_IID(NS_WRAPPERCACHE_IID) nsWrapperCache() = default; ~nsWrapperCache() { @@ -412,8 +412,6 @@ class JS_HAZ_ROOTED nsWrapperCache { enum { WRAPPER_CACHE_FLAGS_BITS_USED = 1 }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID) - #define NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY \ if (aIID.Equals(NS_GET_IID(nsWrapperCache))) { \ *aInstancePtr = static_cast(this); \ diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index fec0be53dd3f..f076cfa189f0 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -82,7 +82,7 @@ nsresult UnwrapArgImpl(JSContext* cx, JS::Handle src, template inline nsresult UnwrapArg(JSContext* cx, JS::Handle src, Interface** ppArg) { - return UnwrapArgImpl(cx, src, NS_GET_TEMPLATE_IID(Interface), + return UnwrapArgImpl(cx, src, NS_GET_IID(Interface), reinterpret_cast(ppArg)); } diff --git a/dom/bindings/CallbackObject.h b/dom/bindings/CallbackObject.h index d17ba60e9e83..e6e550fe8926 100644 --- a/dom/bindings/CallbackObject.h +++ b/dom/bindings/CallbackObject.h @@ -310,7 +310,7 @@ class CallbackObject : public nsISupports, public CallbackObjectBase, public JSHolderBase { public: - NS_DECLARE_STATIC_IID_ACCESSOR(DOM_CALLBACKOBJECT_IID) + NS_INLINE_DECL_STATIC_IID(DOM_CALLBACKOBJECT_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(CallbackObject) @@ -566,7 +566,7 @@ class CallbackObjectHolder : CallbackObjectHolderBase { } nsCOMPtr supp = CallbackObjectHolderBase::ToXPCOMCallback( - GetWebIDLCallback(), NS_GET_TEMPLATE_IID(XPCOMCallbackT)); + GetWebIDLCallback(), NS_GET_IID(XPCOMCallbackT)); if (supp) { // ToXPCOMCallback already did the right QI for us. return supp.forget().downcast(); @@ -600,8 +600,6 @@ class CallbackObjectHolder : CallbackObjectHolderBase { uintptr_t mPtrBits; }; -NS_DEFINE_STATIC_IID_ACCESSOR(CallbackObject, DOM_CALLBACKOBJECT_IID) - template inline void ImplCycleCollectionTraverse( nsCycleCollectionTraversalCallback& aCallback, diff --git a/dom/bindings/ToJSValue.h b/dom/bindings/ToJSValue.h index 0dd5862eb6f6..3cb0b8ae7b53 100644 --- a/dom/bindings/ToJSValue.h +++ b/dom/bindings/ToJSValue.h @@ -25,7 +25,7 @@ #include "mozilla/dom/BindingUtils.h" // for MaybeWrapValue, MaybeWrapObjectOrNullValue, XPCOMObjectToJsval, GetOrCreateDOMReflector #include "mozilla/dom/CallbackObject.h" // for CallbackObject #include "mozilla/dom/Record.h" -#include "nsID.h" // for NS_GET_TEMPLATE_IID, nsIID +#include "nsID.h" // for NS_GET_IID, nsIID #include "nsISupports.h" // for nsISupports #include "nsStringFwd.h" // for nsAString #include "nsTArrayForwardDeclare.h" @@ -247,8 +247,7 @@ ToJSValue(JSContext* aCx, T& aArgument, JS::MutableHandle aValue) { xpcObjectHelper helper(ToSupports(&aArgument)); JS::Rooted scope(aCx, JS::CurrentGlobalOrNull(aCx)); - const nsIID& iid = - NS_GET_TEMPLATE_IID(binding_detail::ScriptableInterfaceType); + const nsIID& iid = NS_GET_IID(binding_detail::ScriptableInterfaceType); return XPCOMObjectToJsval(aCx, scope, helper, &iid, true, aValue); } diff --git a/dom/bindings/test/TestBindingHeader.h b/dom/bindings/test/TestBindingHeader.h index e12fe2ac4e1d..1433ced9f79a 100644 --- a/dom/bindings/test/TestBindingHeader.h +++ b/dom/bindings/test/TestBindingHeader.h @@ -43,27 +43,22 @@ namespace dom { class nsRenamedInterface : public nsISupports, public nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_RENAMED_INTERFACE_IID) + NS_INLINE_DECL_STATIC_IID(NS_RENAMED_INTERFACE_IID) NS_DECL_ISUPPORTS // We need a GetParentObject to make binding codegen happy virtual nsISupports* GetParentObject(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsRenamedInterface, NS_RENAMED_INTERFACE_IID) - // IID for the TestExternalInterface #define NS_TEST_EXTERNAL_INTERFACE_IID \ {0xd5ba0c99, 0x9b1d, 0x4e71, {0x8a, 0x94, 0x56, 0x38, 0x6c, 0xa3, 0xda, 0x3d}} class TestExternalInterface : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEST_EXTERNAL_INTERFACE_IID) + NS_INLINE_DECL_STATIC_IID(NS_TEST_EXTERNAL_INTERFACE_IID) NS_DECL_ISUPPORTS }; -NS_DEFINE_STATIC_IID_ACCESSOR(TestExternalInterface, - NS_TEST_EXTERNAL_INTERFACE_IID) - class TestNonWrapperCacheInterface : public nsISupports { public: NS_DECL_ISUPPORTS diff --git a/dom/cache/ReadStream.h b/dom/cache/ReadStream.h index d6b4e1d97968..cd0d5d9fa9e5 100644 --- a/dom/cache/ReadStream.h +++ b/dom/cache/ReadStream.h @@ -25,12 +25,8 @@ class CacheReadStream; class PCacheStreamControlParent; // IID for the dom::cache::ReadStream interface -#define NS_DOM_CACHE_READSTREAM_IID \ - { \ - 0x8e5da7c9, 0x0940, 0x4f1d, { \ - 0x97, 0x25, 0x5c, 0x59, 0x38, 0xdd, 0xb9, 0x9f \ - } \ - } +#define NS_DOM_CACHE_READSTREAM_IID \ + {0x8e5da7c9, 0x0940, 0x4f1d, {0x97, 0x25, 0x5c, 0x59, 0x38, 0xdd, 0xb9, 0x9f}} // Custom stream class for Request and Response bodies being read from // a Cache. The main purpose of this class is to report back to the @@ -92,13 +88,11 @@ class ReadStream final : public nsIInputStream { public: explicit ReadStream(SafeRefPtr aInner); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_CACHE_READSTREAM_IID); + NS_INLINE_DECL_STATIC_IID(NS_DOM_CACHE_READSTREAM_IID); NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM }; -NS_DEFINE_STATIC_IID_ACCESSOR(ReadStream, NS_DOM_CACHE_READSTREAM_IID); - } // namespace dom::cache } // namespace mozilla diff --git a/dom/canvas/nsICanvasRenderingContextInternal.h b/dom/canvas/nsICanvasRenderingContextInternal.h index 7956c0ceeb12..550a806ad544 100644 --- a/dom/canvas/nsICanvasRenderingContextInternal.h +++ b/dom/canvas/nsICanvasRenderingContextInternal.h @@ -24,12 +24,8 @@ #include "mozilla/WeakPtr.h" #include "mozilla/layers/LayersSurfaces.h" -#define NS_ICANVASRENDERINGCONTEXTINTERNAL_IID \ - { \ - 0xb84f2fed, 0x9d4b, 0x430b, { \ - 0xbd, 0xfb, 0x85, 0x57, 0x8a, 0xc2, 0xb4, 0x4b \ - } \ - } +#define NS_ICANVASRENDERINGCONTEXTINTERNAL_IID \ + {0xb84f2fed, 0x9d4b, 0x430b, {0xbd, 0xfb, 0x85, 0x57, 0x8a, 0xc2, 0xb4, 0x4b}} class nsICookieJarSettings; class nsIDocShell; @@ -70,7 +66,7 @@ class nsICanvasRenderingContextInternal : public nsISupports, using CanvasRenderer = mozilla::layers::CanvasRenderer; using WebRenderCanvasData = mozilla::layers::WebRenderCanvasData; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANVASRENDERINGCONTEXTINTERNAL_IID) + NS_INLINE_DECL_STATIC_IID(NS_ICANVASRENDERINGCONTEXTINTERNAL_IID) nsICanvasRenderingContextInternal(); @@ -240,7 +236,4 @@ class nsICanvasRenderingContextInternal : public nsISupports, RefPtr mRefreshDriver; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasRenderingContextInternal, - NS_ICANVASRENDERINGCONTEXTINTERNAL_IID) - #endif /* nsICanvasRenderingContextInternal_h___ */ diff --git a/dom/console/nsIConsoleReportCollector.h b/dom/console/nsIConsoleReportCollector.h index 3e972184e3d2..b185e03de068 100644 --- a/dom/console/nsIConsoleReportCollector.h +++ b/dom/console/nsIConsoleReportCollector.h @@ -13,12 +13,8 @@ #include "nsTArrayForwardDeclare.h" // Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs -#define NS_NSICONSOLEREPORTCOLLECTOR_IID \ - { \ - 0xdd98a481, 0xd2c4, 0x4203, { \ - 0x8d, 0xfa, 0x85, 0xbf, 0xd7, 0xdc, 0xd7, 0x05 \ - } \ - } +#define NS_NSICONSOLEREPORTCOLLECTOR_IID \ + {0xdd98a481, 0xd2c4, 0x4203, {0x8d, 0xfa, 0x85, 0xbf, 0xd7, 0xdc, 0xd7, 0x05}} namespace mozilla::net { class ConsoleReportCollected; @@ -28,7 +24,7 @@ class ConsoleReportCollected; // window at a later time. class NS_NO_VTABLE nsIConsoleReportCollector : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_NSICONSOLEREPORTCOLLECTOR_IID) + NS_INLINE_DECL_STATIC_IID(NS_NSICONSOLEREPORTCOLLECTOR_IID) // Add a pending report to be later displayed on the console. This may be // called from any thread. @@ -126,7 +122,4 @@ class NS_NO_VTABLE nsIConsoleReportCollector : public nsISupports { virtual void ClearConsoleReports() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIConsoleReportCollector, - NS_NSICONSOLEREPORTCOLLECTOR_IID) - #endif // nsIConsoleReportCollector_h diff --git a/dom/events/DOMEventTargetHelper.h b/dom/events/DOMEventTargetHelper.h index c38d4f8ad3aa..299f8cd3c726 100644 --- a/dom/events/DOMEventTargetHelper.h +++ b/dom/events/DOMEventTargetHelper.h @@ -38,12 +38,8 @@ class Event; enum class CallerType : uint32_t; } // namespace dom -#define NS_DOMEVENTTARGETHELPER_IID \ - { \ - 0xa28385c6, 0x9451, 0x4d7e, { \ - 0xa3, 0xdd, 0xf4, 0xb6, 0x87, 0x2f, 0xa4, 0x76 \ - } \ - } +#define NS_DOMEVENTTARGETHELPER_IID \ + {0xa28385c6, 0x9451, 0x4d7e, {0xa3, 0xdd, 0xf4, 0xb6, 0x87, 0x2f, 0xa4, 0x76}} class DOMEventTargetHelper : public dom::EventTarget, public GlobalTeardownObserver { @@ -73,7 +69,7 @@ class DOMEventTargetHelper : public dom::EventTarget, nsresult PostHandleEvent(EventChainPostVisitor& aVisitor) override; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMEVENTTARGETHELPER_IID) + NS_INLINE_DECL_STATIC_IID(NS_DOMEVENTTARGETHELPER_IID) nsIGlobalObject* GetOwnerGlobal() const override { return GlobalTeardownObserver::GetOwnerGlobal(); @@ -147,8 +143,6 @@ class DOMEventTargetHelper : public dom::EventTarget, bool mIsKeptAlive = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DOMEventTargetHelper, NS_DOMEVENTTARGETHELPER_IID) - } // namespace mozilla // WebIDL event handlers diff --git a/dom/events/DataTransfer.h b/dom/events/DataTransfer.h index c1999e967e1b..fd85eb80ce39 100644 --- a/dom/events/DataTransfer.h +++ b/dom/events/DataTransfer.h @@ -47,19 +47,15 @@ template class Optional; class WindowContext; -#define NS_DATATRANSFER_IID \ - { \ - 0x6c5f90d1, 0xa886, 0x42c8, { \ - 0x85, 0x06, 0x10, 0xbe, 0x5c, 0x0d, 0xc6, 0x77 \ - } \ - } +#define NS_DATATRANSFER_IID \ + {0x6c5f90d1, 0xa886, 0x42c8, {0x85, 0x06, 0x10, 0xbe, 0x5c, 0x0d, 0xc6, 0x77}} /** * See . */ class DataTransfer final : public nsISupports, public nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DATATRANSFER_IID) + NS_INLINE_DECL_STATIC_IID(NS_DATATRANSFER_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -558,8 +554,6 @@ class DataTransfer final : public nsISupports, public nsWrapperCache { bool mShowFailAnimation = true; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DataTransfer, NS_DATATRANSFER_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/events/Event.h b/dom/events/Event.h index 9d3af8149b8d..181519c99446 100644 --- a/dom/events/Event.h +++ b/dom/events/Event.h @@ -70,7 +70,7 @@ struct EventInit; class Event : public nsISupports, public nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_EVENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_EVENT_IID) Event(EventTarget* aOwner, nsPresContext* aPresContext, WidgetEvent* aEvent); explicit Event(nsPIDOMWindowInner* aWindow); @@ -492,8 +492,6 @@ class MOZ_STACK_CLASS WantsPopupControlCheck { bool mOriginalWantsPopupControlCheck; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Event, NS_EVENT_IID) - } // namespace mozilla::dom already_AddRefed NS_NewDOMEvent( diff --git a/dom/events/EventTarget.h b/dom/events/EventTarget.h index fca5d63aa371..2ddaf7b35b69 100644 --- a/dom/events/EventTarget.h +++ b/dom/events/EventTarget.h @@ -41,16 +41,12 @@ enum class CallerType : uint32_t; enum class EventCallbackDebuggerNotificationType : uint8_t; // IID for the dom::EventTarget interface -#define NS_EVENTTARGET_IID \ - { \ - 0xde651c36, 0x0053, 0x4c67, { \ - 0xb1, 0x3d, 0x67, 0xb9, 0x40, 0xfc, 0x82, 0xe4 \ - } \ - } +#define NS_EVENTTARGET_IID \ + {0xde651c36, 0x0053, 0x4c67, {0xb1, 0x3d, 0x67, 0xb9, 0x40, 0xfc, 0x82, 0xe4}} class EventTarget : public nsISupports, public nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_EVENTTARGET_IID) + NS_INLINE_DECL_STATIC_IID(NS_EVENTTARGET_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -364,8 +360,6 @@ class EventTarget : public nsISupports, public nsWrapperCache { const Nullable& aWantsUntrusted); }; -NS_DEFINE_STATIC_IID_ACCESSOR(EventTarget, NS_EVENTTARGET_IID) - #define NS_IMPL_FROMEVENTTARGET_GENERIC(_class, _check, _const) \ template \ static auto FromEventTarget(_const T& aEventTarget) \ diff --git a/dom/events/JSEventHandler.h b/dom/events/JSEventHandler.h index 60a3a259e359..aed2da34757c 100644 --- a/dom/events/JSEventHandler.h +++ b/dom/events/JSEventHandler.h @@ -144,16 +144,12 @@ class TypedEventHandler { * is expected to call Disconnect()! */ -#define NS_JSEVENTHANDLER_IID \ - { \ - 0x4f486881, 0x1956, 0x4079, { \ - 0x8c, 0xa0, 0xf3, 0xbd, 0x60, 0x5c, 0xc2, 0x79 \ - } \ - } +#define NS_JSEVENTHANDLER_IID \ + {0x4f486881, 0x1956, 0x4079, {0x8c, 0xa0, 0xf3, 0xbd, 0x60, 0x5c, 0xc2, 0x79}} class JSEventHandler : public nsIDOMEventListener { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_JSEVENTHANDLER_IID) + NS_INLINE_DECL_STATIC_IID(NS_JSEVENTHANDLER_IID) JSEventHandler(dom::EventTarget* aTarget, nsAtom* aType, const TypedEventHandler& aTypedHandler); @@ -216,8 +212,6 @@ class JSEventHandler : public nsIDOMEventListener { TypedEventHandler mTypedHandler; }; -NS_DEFINE_STATIC_IID_ACCESSOR(JSEventHandler, NS_JSEVENTHANDLER_IID) - } // namespace mozilla /** diff --git a/dom/file/Blob.h b/dom/file/Blob.h index 09b992e4b3da..fa70eb854e87 100644 --- a/dom/file/Blob.h +++ b/dom/file/Blob.h @@ -30,18 +30,14 @@ class Promise; class ReadableStream; -#define NS_DOM_BLOB_IID \ - { \ - 0x648c2a83, 0xbdb1, 0x4a7d, { \ - 0xb5, 0x0a, 0xca, 0xcd, 0x92, 0x87, 0x45, 0xc2 \ - } \ - } +#define NS_DOM_BLOB_IID \ + {0x648c2a83, 0xbdb1, 0x4a7d, {0xb5, 0x0a, 0xca, 0xcd, 0x92, 0x87, 0x45, 0xc2}} class Blob : public nsSupportsWeakReference, public nsWrapperCache { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Blob) - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_BLOB_IID) + NS_INLINE_DECL_STATIC_IID(NS_DOM_BLOB_IID) using BlobPart = OwningArrayBufferViewOrArrayBufferOrBlobOrUTF8String; @@ -146,8 +142,6 @@ class Blob : public nsSupportsWeakReference, public nsWrapperCache { nsCOMPtr mGlobal; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Blob, NS_DOM_BLOB_IID) - // Override BindingJSObjectMallocBytes for blobs to tell the JS GC how much // memory is held live by the binding object. size_t BindingJSObjectMallocBytes(Blob* aBlob); diff --git a/dom/file/BlobImpl.h b/dom/file/BlobImpl.h index 720c398cdd08..49cd71e694bc 100644 --- a/dom/file/BlobImpl.h +++ b/dom/file/BlobImpl.h @@ -10,12 +10,8 @@ #include "nsISupports.h" #include "nsString.h" -#define BLOBIMPL_IID \ - { \ - 0xbccb3275, 0x6778, 0x4ac5, { \ - 0xaf, 0x03, 0x90, 0xed, 0x37, 0xad, 0xdf, 0x5d \ - } \ - } +#define BLOBIMPL_IID \ + {0xbccb3275, 0x6778, 0x4ac5, {0xaf, 0x03, 0x90, 0xed, 0x37, 0xad, 0xdf, 0x5d}} class nsIInputStream; @@ -32,7 +28,7 @@ class Optional; // because this class must be ref-counted and it has to work with IPC. class BlobImpl : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(BLOBIMPL_IID) + NS_INLINE_DECL_STATIC_IID(BLOBIMPL_IID) NS_DECL_THREADSAFE_ISUPPORTS BlobImpl() = default; @@ -106,8 +102,6 @@ class BlobImpl : public nsISupports { virtual ~BlobImpl() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(BlobImpl, BLOBIMPL_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/file/FileReader.h b/dom/file/FileReader.h index 1c07b6193f2c..c8ee93e46db1 100644 --- a/dom/file/FileReader.h +++ b/dom/file/FileReader.h @@ -36,12 +36,8 @@ extern const uint64_t kUnknownSize; class FileReaderDecreaseBusyCounter; // 26a79031-c94b-47e9-850a-f04fe17bc026 -#define FILEREADER_ID \ - { \ - 0x26a79031, 0xc94b, 0x47e9, { \ - 0x85, 0x0a, 0xf0, 0x4f, 0xe1, 0x7b, 0xc0, 0x26 \ - } \ - } +#define FILEREADER_ID \ + {0x26a79031, 0xc94b, 0x47e9, {0x85, 0x0a, 0xf0, 0x4f, 0xe1, 0x7b, 0xc0, 0x26}} class FileReader final : public DOMEventTargetHelper, public nsIInterfaceRequestor, @@ -61,7 +57,7 @@ class FileReader final : public DOMEventTargetHelper, NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSINAMED - NS_DECLARE_STATIC_IID_ACCESSOR(FILEREADER_ID) + NS_INLINE_DECL_STATIC_IID(FILEREADER_ID) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(FileReader, DOMEventTargetHelper) @@ -200,8 +196,6 @@ class FileReader final : public DOMEventTargetHelper, RefPtr mAsyncWaitRunnable; }; -NS_DEFINE_STATIC_IID_ACCESSOR(FileReader, FILEREADER_ID) - } // namespace mozilla::dom #endif // mozilla_dom_FileReader_h diff --git a/dom/file/uri/BlobURL.h b/dom/file/uri/BlobURL.h index 4a3d41f23cc7..603f4fedadb9 100644 --- a/dom/file/uri/BlobURL.h +++ b/dom/file/uri/BlobURL.h @@ -20,14 +20,12 @@ class NS_NO_VTABLE nsIBlobURLMutator : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBLOBURLMUTATOR_IID) + NS_INLINE_DECL_STATIC_IID(NS_IBLOBURLMUTATOR_IID) NS_IMETHOD SetRevoked(bool aRevoked) = 0; }; inline NS_DEFINE_CID(kHOSTOBJECTURICID, NS_HOSTOBJECTURI_CID); -NS_DEFINE_STATIC_IID_ACCESSOR(nsIBlobURLMutator, NS_IBLOBURLMUTATOR_IID) - namespace mozilla::dom { /** diff --git a/dom/fs/test/gtest/FileSystemMocks.h b/dom/fs/test/gtest/FileSystemMocks.h index 8c44ce8ee8b8..b6f88a86f20a 100644 --- a/dom/fs/test/gtest/FileSystemMocks.h +++ b/dom/fs/test/gtest/FileSystemMocks.h @@ -353,7 +353,7 @@ class MockGlobalObject : public nsIGlobalObject, public nsWrapperCache { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MockGlobalObject) - NS_DECLARE_STATIC_IID_ACCESSOR(MOCKGLOBALOBJECT_IID) + NS_INLINE_DECL_STATIC_IID(MOCKGLOBALOBJECT_IID) explicit MockGlobalObject(nsCOMPtr&& aGlobal) : mGlobal(std::move(aGlobal)) {} @@ -399,6 +399,4 @@ class MockGlobalObject : public nsIGlobalObject, public nsWrapperCache { nsCOMPtr mGlobal; }; -NS_DEFINE_STATIC_IID_ACCESSOR(MockGlobalObject, MOCKGLOBALOBJECT_IID) - #endif // DOM_FS_TEST_GTEST_FILESYSTEMMOCKS_H_ diff --git a/dom/html/HTMLUnknownElement.h b/dom/html/HTMLUnknownElement.h index 3bed35a4f6f1..d41dbbe29c59 100644 --- a/dom/html/HTMLUnknownElement.h +++ b/dom/html/HTMLUnknownElement.h @@ -11,16 +11,12 @@ namespace mozilla::dom { -#define NS_HTMLUNKNOWNELEMENT_IID \ - { \ - 0xc09e665b, 0x3876, 0x40dd, { \ - 0x85, 0x28, 0x44, 0xc2, 0x3f, 0xd4, 0x58, 0xf2 \ - } \ - } +#define NS_HTMLUNKNOWNELEMENT_IID \ + {0xc09e665b, 0x3876, 0x40dd, {0x85, 0x28, 0x44, 0xc2, 0x3f, 0xd4, 0x58, 0xf2}} class HTMLUnknownElement final : public nsGenericHTMLElement { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTMLUNKNOWNELEMENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_HTMLUNKNOWNELEMENT_IID) NS_DECL_ISUPPORTS_INHERITED @@ -36,8 +32,6 @@ class HTMLUnknownElement final : public nsGenericHTMLElement { JS::Handle aGivenProto) override; }; -NS_DEFINE_STATIC_IID_ACCESSOR(HTMLUnknownElement, NS_HTMLUNKNOWNELEMENT_IID) - } // namespace mozilla::dom #endif /* mozilla_dom_HTMLUnknownElement_h */ diff --git a/dom/html/RadioNodeList.h b/dom/html/RadioNodeList.h index 965bbb007c94..e320963c7bd2 100644 --- a/dom/html/RadioNodeList.h +++ b/dom/html/RadioNodeList.h @@ -13,11 +13,7 @@ #include "mozilla/dom/BindingDeclarations.h" #define MOZILLA_DOM_RADIONODELIST_IMPLEMENTATION_IID \ - { \ - 0xbba7f3e8, 0xf3b5, 0x42e5, { \ - 0x82, 0x08, 0xa6, 0x8b, 0xe0, 0xbc, 0x22, 0x19 \ - } \ - } + {0xbba7f3e8, 0xf3b5, 0x42e5, {0x82, 0x08, 0xa6, 0x8b, 0xe0, 0xbc, 0x22, 0x19}} namespace mozilla::dom { @@ -31,14 +27,11 @@ class RadioNodeList final : public nsSimpleContentList { void SetValue(const nsAString& value, CallerType aCallerType); NS_DECL_ISUPPORTS_INHERITED - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_RADIONODELIST_IMPLEMENTATION_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_DOM_RADIONODELIST_IMPLEMENTATION_IID) private: ~RadioNodeList() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(RadioNodeList, - MOZILLA_DOM_RADIONODELIST_IMPLEMENTATION_IID) - } // namespace mozilla::dom #endif // mozilla_dom_RadioNodeList_h diff --git a/dom/html/nsGenericHTMLFrameElement.h b/dom/html/nsGenericHTMLFrameElement.h index c61fea2c02f2..6bc09e43592b 100644 --- a/dom/html/nsGenericHTMLFrameElement.h +++ b/dom/html/nsGenericHTMLFrameElement.h @@ -25,12 +25,8 @@ class XULFrameElement; } // namespace dom } // namespace mozilla -#define NS_GENERICHTMLFRAMEELEMENT_IID \ - { \ - 0x8190db72, 0xdab0, 0x4d72, { \ - 0x94, 0x26, 0x87, 0x5f, 0x5a, 0x8a, 0x2a, 0xe5 \ - } \ - } +#define NS_GENERICHTMLFRAMEELEMENT_IID \ + {0x8190db72, 0xdab0, 0x4d72, {0x94, 0x26, 0x87, 0x5f, 0x5a, 0x8a, 0x2a, 0xe5}} /** * A helper class for frame elements @@ -47,7 +43,7 @@ class nsGenericHTMLFrameElement : public nsGenericHTMLElement, NS_DECL_ISUPPORTS_INHERITED - NS_DECLARE_STATIC_IID_ACCESSOR(NS_GENERICHTMLFRAMEELEMENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_GENERICHTMLFRAMEELEMENT_IID) // nsIContent bool IsHTMLFocusable(mozilla::IsFocusableFlags, bool* aIsFocusable, @@ -148,7 +144,4 @@ class nsGenericHTMLFrameElement : public nsGenericHTMLElement, mozilla::dom::BrowsingContext* GetContentWindowInternal(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsGenericHTMLFrameElement, - NS_GENERICHTMLFRAMEELEMENT_IID) - #endif // nsGenericHTMLFrameElement_h diff --git a/dom/html/nsIConstraintValidation.h b/dom/html/nsIConstraintValidation.h index 14f7cee77fb5..d2ae922770c4 100644 --- a/dom/html/nsIConstraintValidation.h +++ b/dom/html/nsIConstraintValidation.h @@ -15,12 +15,8 @@ namespace mozilla::dom { class ValidityState; } // namespace mozilla::dom -#define NS_ICONSTRAINTVALIDATION_IID \ - { \ - 0x983829da, 0x1aaf, 0x449c, { \ - 0xa3, 0x06, 0x85, 0xd4, 0xf0, 0x31, 0x1c, 0xf6 \ - } \ - } +#define NS_ICONSTRAINTVALIDATION_IID \ + {0x983829da, 0x1aaf, 0x449c, {0xa3, 0x06, 0x85, 0xd4, 0xf0, 0x31, 0x1c, 0xf6}} /** * This interface is for form elements implementing the validity constraint API. @@ -31,7 +27,7 @@ class ValidityState; */ class nsIConstraintValidation : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONSTRAINTVALIDATION_IID); + NS_INLINE_DECL_STATIC_IID(NS_ICONSTRAINTVALIDATION_IID); friend class mozilla::dom::ValidityState; @@ -105,7 +101,4 @@ class nsIConstraintValidation : public nsISupports { bool mBarredFromConstraintValidation; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIConstraintValidation, - NS_ICONSTRAINTVALIDATION_IID) - #endif // nsIConstraintValidation_h___ diff --git a/dom/html/nsIFormControl.h b/dom/html/nsIFormControl.h index 3f2fafb9caa4..fe229537c9c4 100644 --- a/dom/html/nsIFormControl.h +++ b/dom/html/nsIFormControl.h @@ -77,12 +77,8 @@ static_assert(uint8_t(FormControlType::LastButtonElement) < static_assert(uint32_t(FormControlType::LastInputElement) < (1 << 8), "Too many form control types"); -#define NS_IFORMCONTROL_IID \ - { \ - 0x4b89980c, 0x4dcd, 0x428f, { \ - 0xb7, 0xad, 0x43, 0x5b, 0x93, 0x29, 0x79, 0xec \ - } \ - } +#define NS_IFORMCONTROL_IID \ + {0x4b89980c, 0x4dcd, 0x428f, {0xb7, 0xad, 0x43, 0x5b, 0x93, 0x29, 0x79, 0xec}} /** * Interface which all form controls (e.g. buttons, checkboxes, text, @@ -93,7 +89,7 @@ class nsIFormControl : public nsISupports { public: nsIFormControl(FormControlType aType) : mType(aType) {} - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFORMCONTROL_IID) + NS_INLINE_DECL_STATIC_IID(NS_IFORMCONTROL_IID) static nsIFormControl* FromEventTarget(mozilla::dom::EventTarget* aTarget); static nsIFormControl* FromEventTargetOrNull( @@ -298,6 +294,4 @@ bool nsIFormControl::AllowDraggableChildren() const { type == FormControlType::Output; } -NS_DEFINE_STATIC_IID_ACCESSOR(nsIFormControl, NS_IFORMCONTROL_IID) - #endif /* nsIFormControl_h___ */ diff --git a/dom/html/nsIHTMLCollection.h b/dom/html/nsIHTMLCollection.h index 17d0c1fbcf17..b569e486fdb3 100644 --- a/dom/html/nsIHTMLCollection.h +++ b/dom/html/nsIHTMLCollection.h @@ -20,19 +20,15 @@ class Element; } // namespace mozilla::dom // IID for the nsIHTMLCollection interface -#define NS_IHTMLCOLLECTION_IID \ - { \ - 0x4e169191, 0x5196, 0x4e17, { \ - 0xa4, 0x79, 0xd5, 0x35, 0x0b, 0x5b, 0x0a, 0xcd \ - } \ - } +#define NS_IHTMLCOLLECTION_IID \ + {0x4e169191, 0x5196, 0x4e17, {0xa4, 0x79, 0xd5, 0x35, 0x0b, 0x5b, 0x0a, 0xcd}} /** * An internal interface */ class nsIHTMLCollection : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTMLCOLLECTION_IID) + NS_INLINE_DECL_STATIC_IID(NS_IHTMLCOLLECTION_IID) /** * Get the root node for this HTML collection. @@ -82,6 +78,4 @@ class nsIHTMLCollection : public nsISupports { virtual void PreserveWrapperInternal(nsISupports* aScriptObjectHolder) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLCollection, NS_IHTMLCOLLECTION_IID) - #endif /* nsIHTMLCollection_h___ */ diff --git a/dom/html/nsIRadioVisitor.h b/dom/html/nsIRadioVisitor.h index 308d75170a35..37243bc1cc58 100644 --- a/dom/html/nsIRadioVisitor.h +++ b/dom/html/nsIRadioVisitor.h @@ -14,12 +14,8 @@ class HTMLInputElement; } // namespace mozilla::dom // IID for the nsIRadioControl interface -#define NS_IRADIOVISITOR_IID \ - { \ - 0xc6bed232, 0x1181, 0x4ab2, { \ - 0xa1, 0xda, 0x55, 0xc2, 0x13, 0x6d, 0xea, 0x3d \ - } \ - } +#define NS_IRADIOVISITOR_IID \ + {0xc6bed232, 0x1181, 0x4ab2, {0xa1, 0xda, 0x55, 0xc2, 0x13, 0x6d, 0xea, 0x3d}} /** * This interface is used for the text control frame to store its value away @@ -27,7 +23,7 @@ class HTMLInputElement; */ class nsIRadioVisitor : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRADIOVISITOR_IID) + NS_INLINE_DECL_STATIC_IID(NS_IRADIOVISITOR_IID) /** * Visit a node in the tree. This is meant to be called on all radios in a @@ -43,6 +39,4 @@ class nsIRadioVisitor : public nsISupports { virtual bool Visit(mozilla::dom::HTMLInputElement* aRadio) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioVisitor, NS_IRADIOVISITOR_IID) - #endif // nsIRadioVisitor_h___ diff --git a/dom/indexedDB/IDBEvents.h b/dom/indexedDB/IDBEvents.h index 2b27261404ba..28281b5beb00 100644 --- a/dom/indexedDB/IDBEvents.h +++ b/dom/indexedDB/IDBEvents.h @@ -13,12 +13,8 @@ #include "mozilla/dom/Nullable.h" #include "nsStringFwd.h" -#define IDBVERSIONCHANGEEVENT_IID \ - { \ - 0x3b65d4c3, 0x73ad, 0x492e, { \ - 0xb1, 0x2d, 0x15, 0xf9, 0xda, 0xc2, 0x08, 0x4b \ - } \ - } +#define IDBVERSIONCHANGEEVENT_IID \ + {0x3b65d4c3, 0x73ad, 0x492e, {0xb1, 0x2d, 0x15, 0xf9, 0xda, 0xc2, 0x08, 0x4b}} namespace mozilla { @@ -73,7 +69,7 @@ class IDBVersionChangeEvent final : public Event { Nullable GetNewVersion() const { return mNewVersion; } - NS_DECLARE_STATIC_IID_ACCESSOR(IDBVERSIONCHANGEEVENT_IID) + NS_INLINE_DECL_STATIC_IID(IDBVERSIONCHANGEEVENT_IID) NS_DECL_ISUPPORTS_INHERITED @@ -91,8 +87,6 @@ class IDBVersionChangeEvent final : public Event { const Nullable& aNewVersion); }; -NS_DEFINE_STATIC_IID_ACCESSOR(IDBVersionChangeEvent, IDBVERSIONCHANGEEVENT_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/indexedDB/IDBRequest.h b/dom/indexedDB/IDBRequest.h index 88e03c7c5f73..db246d4173af 100644 --- a/dom/indexedDB/IDBRequest.h +++ b/dom/indexedDB/IDBRequest.h @@ -20,12 +20,8 @@ #include "ReportInternalError.h" #include "SafeRefPtr.h" -#define PRIVATE_IDBREQUEST_IID \ - { \ - 0xe68901e5, 0x1d50, 0x4ee9, { \ - 0xaf, 0x49, 0x90, 0x99, 0x4a, 0xff, 0xc8, 0x39 \ - } \ - } +#define PRIVATE_IDBREQUEST_IID \ + {0xe68901e5, 0x1d50, 0x4ee9, {0xaf, 0x49, 0x90, 0x99, 0x4a, 0xff, 0xc8, 0x39}} class nsIGlobalObject; @@ -50,11 +46,9 @@ namespace detail { // This class holds the IID for use with NS_GET_IID. class PrivateIDBRequest { public: - NS_DECLARE_STATIC_IID_ACCESSOR(PRIVATE_IDBREQUEST_IID) + NS_INLINE_DECL_STATIC_IID(PRIVATE_IDBREQUEST_IID) }; -NS_DEFINE_STATIC_IID_ACCESSOR(PrivateIDBRequest, PRIVATE_IDBREQUEST_IID) - } // namespace detail class IDBRequest : public DOMEventTargetHelper { diff --git a/dom/ipc/BrowserChild.h b/dom/ipc/BrowserChild.h index c41e13086802..5c8e8de21146 100644 --- a/dom/ipc/BrowserChild.h +++ b/dom/ipc/BrowserChild.h @@ -184,7 +184,7 @@ class BrowserChild final : public nsMessageManagerScriptExecutor, return mUniqueId; } - NS_DECLARE_STATIC_IID_ACCESSOR(DOM_BROWSERCHILD_IID) + NS_INLINE_DECL_STATIC_IID(DOM_BROWSERCHILD_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_NSIWEBBROWSERCHROME NS_DECL_NSIINTERFACEREQUESTOR @@ -929,8 +929,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor, DISALLOW_EVIL_CONSTRUCTORS(BrowserChild); }; -NS_DEFINE_STATIC_IID_ACCESSOR(BrowserChild, DOM_BROWSERCHILD_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/ipc/BrowserParent.h b/dom/ipc/BrowserParent.h index 3ec5cc6ea79c..07acae211e99 100644 --- a/dom/ipc/BrowserParent.h +++ b/dom/ipc/BrowserParent.h @@ -78,12 +78,8 @@ namespace ipc { class StructuredCloneData; } // namespace ipc -#define DOM_BROWSERPARENT_IID \ - { \ - 0x58b47b52, 0x77dc, 0x44cf, { \ - 0x8b, 0xe5, 0x8e, 0x78, 0x24, 0xd9, 0xae, 0xc5 \ - } \ - } +#define DOM_BROWSERPARENT_IID \ + {0x58b47b52, 0x77dc, 0x44cf, {0x8b, 0xe5, 0x8e, 0x78, 0x24, 0xd9, 0xae, 0xc5}} /** * BrowserParent implements the parent actor part of the PBrowser protocol. See @@ -106,7 +102,7 @@ class BrowserParent final : public PBrowserParent, // Helper class for ContentParent::RecvCreateWindow. struct AutoUseNewTab; - NS_DECLARE_STATIC_IID_ACCESSOR(DOM_BROWSERPARENT_IID) + NS_INLINE_DECL_STATIC_IID(DOM_BROWSERPARENT_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_NSIAUTHPROMPTPROVIDER // nsIDOMEventListener interfaces @@ -1018,8 +1014,6 @@ class BrowserParent final : public PBrowserParent, bool mShowingTooltip : 1; }; -NS_DEFINE_STATIC_IID_ACCESSOR(BrowserParent, DOM_BROWSERPARENT_IID) - struct MOZ_STACK_CLASS BrowserParent::AutoUseNewTab final { public: explicit AutoUseNewTab(BrowserParent* aNewTab) : mNewTab(aNewTab) { diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 3dfd3f67cd8b..bc3ca9677e5f 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -141,7 +141,7 @@ class ContentParent final : public PContentParent, using LaunchPromise = mozilla::MozPromise; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_CONTENTPARENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_CONTENTPARENT_IID) static LogModule* GetLog(); @@ -1624,8 +1624,6 @@ class ContentParent final : public PContentParent, nsCOMPtr mClipboardContentAnalysisThread; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ContentParent, NS_CONTENTPARENT_IID) - // Threadsafe handle object allowing off-main-thread code to get some // information and maintain a weak reference to a ContentParent. class ThreadsafeContentParentHandle final { diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index 05056b6c3625..78895f167202 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -36,12 +36,8 @@ class ImageContainer; class OverlayImage; } // namespace layers -#define NS_DOMMEDIASTREAM_IID \ - { \ - 0x8cb65468, 0x66c0, 0x444e, { \ - 0x89, 0x9f, 0x89, 0x1d, 0x9e, 0xd2, 0xbe, 0x7c \ - } \ - } +#define NS_DOMMEDIASTREAM_IID \ + {0x8cb65468, 0x66c0, 0x444e, {0x89, 0x9f, 0x89, 0x1d, 0x9e, 0xd2, 0xbe, 0x7c}} /** * DOMMediaStream is the implementation of the js-exposed MediaStream interface. @@ -104,7 +100,7 @@ class DOMMediaStream : public DOMEventTargetHelper, NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMMediaStream, DOMEventTargetHelper) - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMMEDIASTREAM_IID) + NS_INLINE_DECL_STATIC_IID(NS_DOMMEDIASTREAM_IID) virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; @@ -249,8 +245,6 @@ class DOMMediaStream : public DOMEventTargetHelper, bool mAudible = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DOMMediaStream, NS_DOMMEDIASTREAM_IID) - } // namespace mozilla #endif /* NSDOMMEDIASTREAM_H_ */ diff --git a/dom/media/MediaDeviceInfo.h b/dom/media/MediaDeviceInfo.h index e68ffba9dce0..373cc20f439f 100644 --- a/dom/media/MediaDeviceInfo.h +++ b/dom/media/MediaDeviceInfo.h @@ -17,11 +17,7 @@ namespace mozilla::dom { #define MOZILLA_DOM_MEDIADEVICEINFO_IMPLEMENTATION_IID \ - { \ - 0x25091870, 0x84d6, 0x4acf, { \ - 0xaf, 0x97, 0x6e, 0xd5, 0x5b, 0xe0, 0x47, 0xb2 \ - } \ - } + {0x25091870, 0x84d6, 0x4acf, {0xaf, 0x97, 0x6e, 0xd5, 0x5b, 0xe0, 0x47, 0xb2}} class MediaDeviceInfo final : public nsISupports, public nsWrapperCache { public: @@ -30,7 +26,7 @@ class MediaDeviceInfo final : public nsISupports, public nsWrapperCache { NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaDeviceInfo) - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_MEDIADEVICEINFO_IMPLEMENTATION_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_DOM_MEDIADEVICEINFO_IMPLEMENTATION_IID) JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; @@ -51,9 +47,6 @@ class MediaDeviceInfo final : public nsISupports, public nsWrapperCache { virtual ~MediaDeviceInfo() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(MediaDeviceInfo, - MOZILLA_DOM_MEDIADEVICEINFO_IMPLEMENTATION_IID) - } // namespace mozilla::dom #endif // mozilla_dom_MediaDeviceInfo_h diff --git a/dom/media/MediaStreamError.h b/dom/media/MediaStreamError.h index 3e84cf67909a..d60e66336ae7 100644 --- a/dom/media/MediaStreamError.h +++ b/dom/media/MediaStreamError.h @@ -22,11 +22,7 @@ namespace mozilla { namespace dom { #define MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID \ - { \ - 0x95fa29aa, 0x0cc2, 0x4698, { \ - 0x9d, 0xa9, 0xf2, 0xeb, 0x03, 0x91, 0x0b, 0xd1 \ - } \ - } + {0x95fa29aa, 0x0cc2, 0x4698, {0x9d, 0xa9, 0xf2, 0xeb, 0x03, 0x91, 0x0b, 0xd1}} class MediaStreamError; } // namespace dom @@ -88,8 +84,7 @@ class MediaStreamError final : public nsISupports, NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaStreamError) - NS_DECLARE_STATIC_IID_ACCESSOR( - MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID) JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; @@ -105,8 +100,6 @@ class MediaStreamError final : public nsISupports, RefPtr mParent; }; -NS_DEFINE_STATIC_IID_ACCESSOR(MediaStreamError, - MOZILLA_DOM_MEDIASTREAMERROR_IMPLEMENTATION_IID) } // namespace dom } // namespace mozilla diff --git a/dom/media/mediasource/MediaSource.h b/dom/media/mediasource/MediaSource.h index 3d8f40ae7eb1..2608e631e8fd 100644 --- a/dom/media/mediasource/MediaSource.h +++ b/dom/media/mediasource/MediaSource.h @@ -47,12 +47,8 @@ class SourceBufferList; template class Optional; -#define MOZILLA_DOM_MEDIASOURCE_IMPLEMENTATION_IID \ - { \ - 0x3839d699, 0x22c5, 0x439f, { \ - 0x94, 0xca, 0x0e, 0x0b, 0x26, 0xf9, 0xca, 0xbf \ - } \ - } +#define MOZILLA_DOM_MEDIASOURCE_IMPLEMENTATION_IID \ + {0x3839d699, 0x22c5, 0x439f, {0x94, 0xca, 0x0e, 0x0b, 0x26, 0xf9, 0xca, 0xbf}} class MediaSource final : public DOMEventTargetHelper, public DecoderDoctorLifeLogger { @@ -94,7 +90,7 @@ class MediaSource final : public DOMEventTargetHelper, NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaSource, DOMEventTargetHelper) - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOM_MEDIASOURCE_IMPLEMENTATION_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_DOM_MEDIASOURCE_IMPLEMENTATION_IID) nsPIDOMWindowInner* GetParentObject() const; @@ -173,9 +169,6 @@ class MediaSource final : public DOMEventTargetHelper, nsTArray> mCompletionPromises; }; -NS_DEFINE_STATIC_IID_ACCESSOR(MediaSource, - MOZILLA_DOM_MEDIASOURCE_IMPLEMENTATION_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/media/nsIDocumentActivity.h b/dom/media/nsIDocumentActivity.h index 2b2824759897..8fc9a5d47cbc 100644 --- a/dom/media/nsIDocumentActivity.h +++ b/dom/media/nsIDocumentActivity.h @@ -8,22 +8,16 @@ #include "nsISupports.h" -#define NS_IDOCUMENTACTIVITY_IID \ - { \ - 0x9b9f584e, 0xefa8, 0x11e3, { \ - 0xbb, 0x74, 0x5e, 0xdd, 0x1d, 0x5d, 0x46, 0xb0 \ - } \ - } +#define NS_IDOCUMENTACTIVITY_IID \ + {0x9b9f584e, 0xefa8, 0x11e3, {0xbb, 0x74, 0x5e, 0xdd, 0x1d, 0x5d, 0x46, 0xb0}} class nsIDocumentActivity : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENTACTIVITY_IID) + NS_INLINE_DECL_STATIC_IID(NS_IDOCUMENTACTIVITY_IID) virtual void NotifyOwnerDocumentActivityChanged() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentActivity, NS_IDOCUMENTACTIVITY_IID) - /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIDOCUMENTACTIVITY \ virtual void NotifyOwnerDocumentActivityChanged() override; diff --git a/dom/quota/RemoteQuotaObjectParentTracker.h b/dom/quota/RemoteQuotaObjectParentTracker.h index d712e08c0d73..603da9f44431 100644 --- a/dom/quota/RemoteQuotaObjectParentTracker.h +++ b/dom/quota/RemoteQuotaObjectParentTracker.h @@ -11,11 +11,7 @@ #include "nsISupports.h" #define MOZILLA_DOM_QUOTA_REMOTEQUOTAOBJECTPARENTTRACKER_IID \ - { \ - 0x42f96136, 0x5b2b, 0x4487, { \ - 0xa4, 0x4e, 0x45, 0x0a, 0x00, 0x8f, 0xc5, 0xd4 \ - } \ - } + {0x42f96136, 0x5b2b, 0x4487, {0xa4, 0x4e, 0x45, 0x0a, 0x00, 0x8f, 0xc5, 0xd4}} namespace mozilla::dom::quota { @@ -23,8 +19,8 @@ class RemoteQuotaObjectParent; class RemoteQuotaObjectParentTracker : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR( - NS_DOM_QUOTA_REMOTEQUOTAOBJECTPARENTTRACKER_IID) + NS_INLINE_DECL_STATIC_IID( + MOZILLA_DOM_QUOTA_REMOTEQUOTAOBJECTPARENTTRACKER_IID) virtual void RegisterRemoteQuotaObjectParent( NotNull aActor) = 0; @@ -36,10 +32,6 @@ class RemoteQuotaObjectParentTracker : public nsISupports { virtual ~RemoteQuotaObjectParentTracker() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR( - RemoteQuotaObjectParentTracker, - MOZILLA_DOM_QUOTA_REMOTEQUOTAOBJECTPARENTTRACKER_IID) - } // namespace mozilla::dom::quota #endif // DOM_QUOTA_REMOTEQUOTAOBJECTPARENTTRACKER_H_ diff --git a/dom/script/ShadowRealmGlobalScope.h b/dom/script/ShadowRealmGlobalScope.h index c5f7998208ab..1ebec6aa2435 100644 --- a/dom/script/ShadowRealmGlobalScope.h +++ b/dom/script/ShadowRealmGlobalScope.h @@ -21,12 +21,12 @@ namespace mozilla::dom { -#define SHADOWREALMGLOBALSCOPE_IID \ - { /* 1b0a59dd-c1cb-429a-bb90-cea17994dba2 */ \ - 0x1b0a59dd, 0xc1cb, 0x429a, { \ - 0xbb, 0x90, 0xce, 0xa1, 0x79, 0x94, 0xdb, 0xa2 \ - } \ - } +#define SHADOWREALMGLOBALSCOPE_IID \ + {/* 1b0a59dd-c1cb-429a-bb90-cea17994dba2 */ \ + 0x1b0a59dd, \ + 0xc1cb, \ + 0x429a, \ + {0xbb, 0x90, 0xce, 0xa1, 0x79, 0x94, 0xdb, 0xa2}} // Required for providing the wrapper, as this is the global used inside a Gecko // backed ShadowRealm, but also required to power module resolution. @@ -36,7 +36,7 @@ class ShadowRealmGlobalScope final : public nsIGlobalObject, NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(ShadowRealmGlobalScope) - NS_DECLARE_STATIC_IID_ACCESSOR(SHADOWREALMGLOBALSCOPE_IID) + NS_INLINE_DECL_STATIC_IID(SHADOWREALMGLOBALSCOPE_IID) explicit ShadowRealmGlobalScope(nsIGlobalObject* aCreatingGlobal) : mCreatingGlobal(aCreatingGlobal) {}; @@ -80,9 +80,6 @@ class ShadowRealmGlobalScope final : public nsIGlobalObject, nsCOMPtr mCreatingGlobal; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ShadowRealmGlobalScope, - SHADOWREALMGLOBALSCOPE_IID) - JSObject* NewShadowRealmGlobal(JSContext* aCx, JS::RealmOptions& aOptions, JSPrincipals* aPrincipals, JS::Handle aGlobalObj); diff --git a/dom/script/nsIScriptElement.h b/dom/script/nsIScriptElement.h index 8601dbd18292..93252a7c0f04 100644 --- a/dom/script/nsIScriptElement.h +++ b/dom/script/nsIScriptElement.h @@ -35,19 +35,15 @@ enum class ReferrerPolicy : uint8_t; } // namespace mozilla::dom // Must be kept in sync with xpcom/rust/xpcom/src/interfaces/nonidl.rs -#define NS_ISCRIPTELEMENT_IID \ - { \ - 0xe60fca9b, 0x1b96, 0x4e4e, { \ - 0xa9, 0xb4, 0xdc, 0x98, 0x4f, 0x88, 0x3f, 0x9c \ - } \ - } +#define NS_ISCRIPTELEMENT_IID \ + {0xe60fca9b, 0x1b96, 0x4e4e, {0xa9, 0xb4, 0xdc, 0x98, 0x4f, 0x88, 0x3f, 0x9c}} /** * Internal interface implemented by script elements */ class nsIScriptElement : public nsIScriptLoaderObserver { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTELEMENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_ISCRIPTELEMENT_IID) explicit nsIScriptElement(mozilla::dom::FromParser aFromParser) : mLineNumber(1), @@ -370,6 +366,4 @@ class nsIScriptElement : public nsIScriptLoaderObserver { nsWeakPtr mCreatorParser; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptElement, NS_ISCRIPTELEMENT_IID) - #endif // nsIScriptElement_h___ diff --git a/dom/script/nsIScriptLoaderObserver.h b/dom/script/nsIScriptLoaderObserver.h index 449812c6e35f..9e7fae971ea4 100644 --- a/dom/script/nsIScriptLoaderObserver.h +++ b/dom/script/nsIScriptLoaderObserver.h @@ -12,16 +12,12 @@ class nsIScriptElement; class nsIURI; -#define NS_ISCRIPTLOADEROBSERVER_IID \ - { \ - 0x7b787204, 0x76fb, 0x4764, { \ - 0x96, 0xf1, 0xfb, 0x7a, 0x66, 0x6d, 0xb4, 0xf4 \ - } \ - } +#define NS_ISCRIPTLOADEROBSERVER_IID \ + {0x7b787204, 0x76fb, 0x4764, {0x96, 0xf1, 0xfb, 0x7a, 0x66, 0x6d, 0xb4, 0xf4}} class NS_NO_VTABLE nsIScriptLoaderObserver : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTLOADEROBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_ISCRIPTLOADEROBSERVER_IID) /** * The script is available for evaluation. For inline scripts, this @@ -57,9 +53,6 @@ class NS_NO_VTABLE nsIScriptLoaderObserver : public nsISupports { nsresult aResult, nsIScriptElement* aElement, bool aIsInline) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptLoaderObserver, - NS_ISCRIPTLOADEROBSERVER_IID) - #define NS_DECL_NSISCRIPTLOADEROBSERVER \ NS_IMETHOD ScriptAvailable(nsresult aResult, nsIScriptElement* aElement, \ bool aIsInlineClassicScript, nsIURI* aURI, \ diff --git a/dom/serializers/nsIContentSerializer.h b/dom/serializers/nsIContentSerializer.h index 18e9e5b4cd76..d1e5a3332a1e 100644 --- a/dom/serializers/nsIContentSerializer.h +++ b/dom/serializers/nsIContentSerializer.h @@ -23,16 +23,12 @@ class ProcessingInstruction; } // namespace dom } // namespace mozilla -#define NS_ICONTENTSERIALIZER_IID \ - { \ - 0xb1ee32f2, 0xb8c4, 0x49b9, { \ - 0x93, 0xdf, 0xb6, 0xfa, 0xb5, 0xd5, 0x46, 0x88 \ - } \ - } +#define NS_ICONTENTSERIALIZER_IID \ + {0xb1ee32f2, 0xb8c4, 0x49b9, {0x93, 0xdf, 0xb6, 0xfa, 0xb5, 0xd5, 0x46, 0x88}} class nsIContentSerializer : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTSERIALIZER_IID) + NS_INLINE_DECL_STATIC_IID(NS_ICONTENTSERIALIZER_IID) /** * @param aOutput The `Append*` methods will append to this string. The @@ -89,8 +85,6 @@ class nsIContentSerializer : public nsISupports { NS_IMETHOD ForgetElementForPreformat(mozilla::dom::Element* aElement) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSerializer, NS_ICONTENTSERIALIZER_IID) - #define NS_CONTENTSERIALIZER_CONTRACTID_PREFIX \ "@mozilla.org/layout/contentserializer;1?mimetype=" diff --git a/dom/serviceworkers/ServiceWorker.h b/dom/serviceworkers/ServiceWorker.h index e28d410d2155..e009c8f9076f 100644 --- a/dom/serviceworkers/ServiceWorker.h +++ b/dom/serviceworkers/ServiceWorker.h @@ -24,16 +24,12 @@ class ServiceWorkerChild; class ServiceWorkerCloneData; struct StructuredSerializeOptions; -#define NS_DOM_SERVICEWORKER_IID \ - { \ - 0xd42e0611, 0x3647, 0x4319, { \ - 0xae, 0x05, 0x19, 0x89, 0x59, 0xba, 0x99, 0x5e \ - } \ - } +#define NS_DOM_SERVICEWORKER_IID \ + {0xd42e0611, 0x3647, 0x4319, {0xae, 0x05, 0x19, 0x89, 0x59, 0xba, 0x99, 0x5e}} class ServiceWorker final : public DOMEventTargetHelper { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_SERVICEWORKER_IID) + NS_INLINE_DECL_STATIC_IID(NS_DOM_SERVICEWORKER_IID) NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorker, DOMEventTargetHelper) @@ -87,8 +83,6 @@ class ServiceWorker final : public DOMEventTargetHelper { ServiceWorkerState mLastNotifiedState; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ServiceWorker, NS_DOM_SERVICEWORKER_IID) - } // namespace mozilla::dom #endif // mozilla_dom_serviceworker_h__ diff --git a/dom/serviceworkers/ServiceWorkerRegistration.h b/dom/serviceworkers/ServiceWorkerRegistration.h index a713baa68ebc..c60b072d6635 100644 --- a/dom/serviceworkers/ServiceWorkerRegistration.h +++ b/dom/serviceworkers/ServiceWorkerRegistration.h @@ -33,7 +33,7 @@ class ServiceWorkerRegistrationChild; class ServiceWorkerRegistration final : public DOMEventTargetHelper { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_SERVICEWORKERREGISTRATION_IID) + NS_INLINE_DECL_STATIC_IID(NS_DOM_SERVICEWORKERREGISTRATION_IID) NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServiceWorkerRegistration, DOMEventTargetHelper) @@ -152,9 +152,6 @@ class ServiceWorkerRegistration final : public DOMEventTargetHelper { uint64_t mDispatchedUpdateFoundId; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ServiceWorkerRegistration, - NS_DOM_SERVICEWORKERREGISTRATION_IID) - } // namespace mozilla::dom #endif /* mozilla_dom_ServiceWorkerRegistration_h */ diff --git a/dom/svg/DOMSVGLengthList.h b/dom/svg/DOMSVGLengthList.h index c744b77bb0b2..8d050fb5ad8b 100644 --- a/dom/svg/DOMSVGLengthList.h +++ b/dom/svg/DOMSVGLengthList.h @@ -87,7 +87,7 @@ class DOMSVGLengthList final : public nsISupports, public nsWrapperCache { } public: - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGLENGTHLIST_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_DOMSVGLENGTHLIST_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGLengthList) @@ -195,8 +195,6 @@ class DOMSVGLengthList final : public nsISupports, public nsWrapperCache { RefPtr mAList; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DOMSVGLengthList, MOZILLA_DOMSVGLENGTHLIST_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/svg/DOMSVGPointList.h b/dom/svg/DOMSVGPointList.h index 5961d0d8114c..586a1012d23c 100644 --- a/dom/svg/DOMSVGPointList.h +++ b/dom/svg/DOMSVGPointList.h @@ -93,7 +93,7 @@ class DOMSVGPointList final : public nsISupports, public nsWrapperCache { friend class DOMSVGPoint; public: - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGPOINTLIST_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_DOMSVGPOINTLIST_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPointList) @@ -253,8 +253,6 @@ class DOMSVGPointList final : public nsISupports, public nsWrapperCache { bool mIsInTearoffTable = true; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DOMSVGPointList, MOZILLA_DOMSVGPOINTLIST_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/svg/SVGElement.h b/dom/svg/SVGElement.h index 85390ac0c4ab..a41454aaa0ed 100644 --- a/dom/svg/SVGElement.h +++ b/dom/svg/SVGElement.h @@ -29,12 +29,8 @@ #include "gfxMatrix.h" // {70db954d-e452-4be3-83aa-f54a51cf7890} -#define MOZILLA_SVGELEMENT_IID \ - { \ - 0x70db954d, 0xe452, 0x4be3, { \ - 0x82, 0xaa, 0xf5, 0x4a, 0x51, 0xcf, 0x78, 0x90 \ - } \ - } +#define MOZILLA_SVGELEMENT_IID \ + {0x70db954d, 0xe452, 0x4be3, {0x82, 0xaa, 0xf5, 0x4a, 0x51, 0xcf, 0x78, 0x90}} nsresult NS_NewSVGElement(mozilla::dom::Element** aResult, already_AddRefed&& aNodeInfo); @@ -89,7 +85,7 @@ class SVGElement : public SVGElementBase // nsIContent // From Element nsresult CopyInnerTo(mozilla::dom::Element* aDest); - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_SVGELEMENT_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_SVGELEMENT_IID) // nsISupports NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGElement, SVGElementBase) @@ -531,8 +527,6 @@ class SVGElement : public SVGElementBase // nsIContent UniquePtr mClassAnimAttr; }; -NS_DEFINE_STATIC_IID_ACCESSOR(SVGElement, MOZILLA_SVGELEMENT_IID) - /** * A macro to implement the NS_NewSVGXXXElement() functions. */ diff --git a/dom/svg/SVGSVGElement.h b/dom/svg/SVGSVGElement.h index 60a8e54e4ff7..3e8d52a1e85a 100644 --- a/dom/svg/SVGSVGElement.h +++ b/dom/svg/SVGSVGElement.h @@ -72,7 +72,7 @@ class SVGSVGElement final : public SVGSVGElementBase { NS_IMPL_FROMNODE_WITH_TAG(SVGSVGElement, kNameSpaceID_SVG, svg) // interfaces: - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_SVGSVGELEMENT_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_SVGSVGELEMENT_IID) NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGSVGElement, SVGSVGElementBase) @@ -224,8 +224,6 @@ class SVGSVGElement final : public SVGSVGElementBase { UniquePtr mSVGView; }; -NS_DEFINE_STATIC_IID_ACCESSOR(SVGSVGElement, MOZILLA_SVGSVGELEMENT_IID) - } // namespace dom class MOZ_RAII AutoSVGTimeSetRestore { diff --git a/dom/svg/SVGTests.h b/dom/svg/SVGTests.h index 90991fd60dfa..83afea8b4deb 100644 --- a/dom/svg/SVGTests.h +++ b/dom/svg/SVGTests.h @@ -23,12 +23,8 @@ class DOMSVGStringList; class SVGSwitchElement; } // namespace dom -#define MOZILLA_DOMSVGTESTS_IID \ - { \ - 0x92370da8, 0xda28, 0x4895, { \ - 0x9b, 0x1b, 0xe0, 0x06, 0x0d, 0xb7, 0x3f, 0xc3 \ - } \ - } +#define MOZILLA_DOMSVGTESTS_IID \ + {0x92370da8, 0xda28, 0x4895, {0x9b, 0x1b, 0xe0, 0x06, 0x0d, 0xb7, 0x3f, 0xc3}} namespace dom { @@ -36,7 +32,7 @@ class SVGElement; class SVGTests : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGTESTS_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_DOMSVGTESTS_IID) SVGTests(); @@ -106,8 +102,6 @@ class SVGTests : public nsISupports { mutable Maybe mPassesConditionalProcessingTests = Some(true); }; -NS_DEFINE_STATIC_IID_ACCESSOR(SVGTests, MOZILLA_DOMSVGTESTS_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/worklet/WorkletGlobalScope.h b/dom/worklet/WorkletGlobalScope.h index 7cb86f12d4a8..35000c68993d 100644 --- a/dom/worklet/WorkletGlobalScope.h +++ b/dom/worklet/WorkletGlobalScope.h @@ -15,12 +15,8 @@ #include "nsIGlobalObject.h" #include "nsWrapperCache.h" -#define WORKLET_IID \ - { \ - 0x1b3f62e7, 0xe357, 0x44be, { \ - 0xbf, 0xe0, 0xdf, 0x85, 0xe6, 0x56, 0x85, 0xac \ - } \ - } +#define WORKLET_IID \ + {0x1b3f62e7, 0xe357, 0x44be, {0xbf, 0xe0, 0xdf, 0x85, 0xe6, 0x56, 0x85, 0xac}} namespace JS { class RealmOptions; @@ -45,7 +41,7 @@ class Console; class WorkletGlobalScope : public nsIGlobalObject, public nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(WORKLET_IID) + NS_INLINE_DECL_STATIC_IID(WORKLET_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(WorkletGlobalScope) @@ -101,8 +97,6 @@ class WorkletGlobalScope : public nsIGlobalObject, public nsWrapperCache { RefPtr mModuleLoader; }; -NS_DEFINE_STATIC_IID_ACCESSOR(WorkletGlobalScope, WORKLET_IID) - } // namespace dom } // namespace mozilla diff --git a/dom/xml/nsIXMLContentSink.h b/dom/xml/nsIXMLContentSink.h index eba9b356f09f..88836cdfe80f 100644 --- a/dom/xml/nsIXMLContentSink.h +++ b/dom/xml/nsIXMLContentSink.h @@ -15,12 +15,8 @@ namespace mozilla::dom { class Document; } // namespace mozilla::dom -#define NS_IXMLCONTENT_SINK_IID \ - { \ - 0x63fedea0, 0x9b0f, 0x4d64, { \ - 0x9b, 0xa5, 0x37, 0xc6, 0x99, 0x73, 0x29, 0x35 \ - } \ - } +#define NS_IXMLCONTENT_SINK_IID \ + {0x63fedea0, 0x9b0f, 0x4d64, {0x9b, 0xa5, 0x37, 0xc6, 0x99, 0x73, 0x29, 0x35}} /** * This interface represents a content sink for generic XML files. @@ -47,13 +43,11 @@ class Document; class nsIXMLContentSink : public nsIContentSink { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXMLCONTENT_SINK_IID) + NS_INLINE_DECL_STATIC_IID(NS_IXMLCONTENT_SINK_IID) virtual bool IsPrettyPrintXML() const { return false; } virtual bool IsPrettyPrintHasSpecialRoot() const { return false; } }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIXMLContentSink, NS_IXMLCONTENT_SINK_IID) - nsresult NS_NewXMLContentSink(nsIXMLContentSink** aInstancePtrResult, mozilla::dom::Document* aDoc, nsIURI* aURL, nsISupports* aContainer, nsIChannel* aChannel); diff --git a/dom/xslt/nsIDocumentTransformer.h b/dom/xslt/nsIDocumentTransformer.h index 3df790dae010..4afe316c311c 100644 --- a/dom/xslt/nsIDocumentTransformer.h +++ b/dom/xslt/nsIDocumentTransformer.h @@ -22,16 +22,12 @@ class Document; } } // namespace mozilla -#define NS_ITRANSFORMOBSERVER_IID \ - { \ - 0x04b2d17c, 0xe98d, 0x45f5, { \ - 0x9a, 0x67, 0xb7, 0x01, 0x19, 0x59, 0x7d, 0xe7 \ - } \ - } +#define NS_ITRANSFORMOBSERVER_IID \ + {0x04b2d17c, 0xe98d, 0x45f5, {0x9a, 0x67, 0xb7, 0x01, 0x19, 0x59, 0x7d, 0xe7}} class nsITransformObserver : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITRANSFORMOBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_ITRANSFORMOBSERVER_IID) virtual nsresult OnDocumentCreated( mozilla::dom::Document* aSourceDocument, @@ -42,18 +38,12 @@ class nsITransformObserver : public nsISupports { mozilla::dom::Document* aResultDocument) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsITransformObserver, NS_ITRANSFORMOBSERVER_IID) - -#define NS_IDOCUMENTTRANSFORMER_IID \ - { \ - 0xf45e1ff8, 0x50f3, 0x4496, { \ - 0xb3, 0xa2, 0x0e, 0x03, 0xe8, 0x4a, 0x57, 0x11 \ - } \ - } +#define NS_IDOCUMENTTRANSFORMER_IID \ + {0xf45e1ff8, 0x50f3, 0x4496, {0xb3, 0xa2, 0x0e, 0x03, 0xe8, 0x4a, 0x57, 0x11}} class nsIDocumentTransformer : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENTTRANSFORMER_IID) + NS_INLINE_DECL_STATIC_IID(NS_IDOCUMENTTRANSFORMER_IID) NS_IMETHOD SetTransformObserver(nsITransformObserver* aObserver) = 0; NS_IMETHOD LoadStyleSheet(nsIURI* aUri, @@ -68,7 +58,4 @@ class nsIDocumentTransformer : public nsISupports { nsINode* aContextNode) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentTransformer, - NS_IDOCUMENTTRANSFORMER_IID) - #endif // nsIDocumentTransformer_h__ diff --git a/editor/libeditor/InsertTextTransaction.h b/editor/libeditor/InsertTextTransaction.h index fbb61b069f51..8664887fa9c8 100644 --- a/editor/libeditor/InsertTextTransaction.h +++ b/editor/libeditor/InsertTextTransaction.h @@ -13,7 +13,7 @@ #include "mozilla/dom/Text.h" #include "nsCycleCollectionParticipant.h" // various macros -#include "nsID.h" // NS_DECLARE_STATIC_IID_ACCESSOR +#include "nsID.h" // NS_INLINE_DECL_STATIC_IID #include "nsISupportsImpl.h" // NS_DECL_ISUPPORTS_INHERITED #include "nsString.h" // nsString members #include "nscore.h" // NS_IMETHOD, nsAString diff --git a/gfx/src/nsITheme.h b/gfx/src/nsITheme.h index 4f39d84e44d8..7c2b56e6fb9e 100644 --- a/gfx/src/nsITheme.h +++ b/gfx/src/nsITheme.h @@ -66,7 +66,7 @@ class nsITheme : public nsISupports { using ComputedStyle = mozilla::ComputedStyle; public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITHEME_IID) + NS_INLINE_DECL_STATIC_IID(NS_ITHEME_IID) /** * Draw the actual theme background. @@ -240,8 +240,6 @@ class nsITheme : public nsISupports { virtual bool ThemeSupportsScrollbarButtons() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsITheme, NS_ITHEME_IID) - // Singleton accessor functions, these should never return null. // // Do not use directly, use nsPresContext::Theme instead. diff --git a/image/imgRequestProxy.h b/image/imgRequestProxy.h index 0354f461ac83..b31bf7e3ca1f 100644 --- a/image/imgRequestProxy.h +++ b/image/imgRequestProxy.h @@ -21,12 +21,12 @@ #include "IProgressObserver.h" -#define NS_IMGREQUESTPROXY_CID \ - { /* 20557898-1dd2-11b2-8f65-9c462ee2bc95 */ \ - 0x20557898, 0x1dd2, 0x11b2, { \ - 0x8f, 0x65, 0x9c, 0x46, 0x2e, 0xe2, 0xbc, 0x95 \ - } \ - } +#define NS_IMGREQUESTPROXY_CID \ + {/* 20557898-1dd2-11b2-8f65-9c462ee2bc95 */ \ + 0x20557898, \ + 0x1dd2, \ + 0x11b2, \ + {0x8f, 0x65, 0x9c, 0x46, 0x2e, 0xe2, 0xbc, 0x95}} class imgCacheValidator; class imgINotificationObserver; @@ -54,7 +54,7 @@ class imgRequestProxy : public mozilla::PreloaderBase, typedef mozilla::image::Image Image; typedef mozilla::image::ProgressTracker ProgressTracker; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMGREQUESTPROXY_CID) + NS_INLINE_DECL_STATIC_IID(NS_IMGREQUESTPROXY_CID) MOZ_DECLARE_REFCOUNTED_TYPENAME(imgRequestProxy) NS_DECL_ISUPPORTS NS_DECL_IMGIREQUEST @@ -252,8 +252,6 @@ inline nsISupports* ToSupports(imgRequestProxy* p) { return NS_ISUPPORTS_CAST(imgIRequest*, p); } -NS_DEFINE_STATIC_IID_ACCESSOR(imgRequestProxy, NS_IMGREQUESTPROXY_CID) - // Used for static image proxies for which no requests are available, so // certain behaviours must be overridden to compensate. class imgRequestProxyStatic : public imgRequestProxy { diff --git a/intl/strres/nsStringBundle.cpp b/intl/strres/nsStringBundle.cpp index f39056666bcb..c6ae55661c1c 100644 --- a/intl/strres/nsStringBundle.cpp +++ b/intl/strres/nsStringBundle.cpp @@ -111,7 +111,7 @@ namespace { class StringBundleProxy : public nsIStringBundle { NS_DECL_THREADSAFE_ISUPPORTS - NS_DECLARE_STATIC_IID_ACCESSOR(STRINGBUNDLEPROXY_IID) + NS_INLINE_DECL_STATIC_IID(STRINGBUNDLEPROXY_IID) explicit StringBundleProxy(already_AddRefed aTarget) : mMutex("StringBundleProxy::mMutex"), mTarget(aTarget) {} @@ -177,8 +177,6 @@ class StringBundleProxy : public nsIStringBundle { } }; -NS_DEFINE_STATIC_IID_ACCESSOR(StringBundleProxy, STRINGBUNDLEPROXY_IID) - NS_IMPL_ISUPPORTS(StringBundleProxy, nsIStringBundle, StringBundleProxy) #define SHAREDSTRINGBUNDLE_IID \ @@ -203,7 +201,7 @@ class SharedStringBundle final : public nsStringBundleBase { void SetMapFile(mozilla::ipc::ReadOnlySharedMemoryHandle&& aHandle); NS_DECL_ISUPPORTS_INHERITED - NS_DECLARE_STATIC_IID_ACCESSOR(SHAREDSTRINGBUNDLE_IID) + NS_INLINE_DECL_STATIC_IID(SHAREDSTRINGBUNDLE_IID) nsresult LoadProperties() override; @@ -266,8 +264,6 @@ class SharedStringBundle final : public nsStringBundleBase { Maybe mMapHandle; }; -NS_DEFINE_STATIC_IID_ACCESSOR(SharedStringBundle, SHAREDSTRINGBUNDLE_IID) - class StringMapEnumerator final : public nsSimpleEnumerator { public: NS_DECL_NSISIMPLEENUMERATOR diff --git a/ipc/glue/DataPipe.h b/ipc/glue/DataPipe.h index cfeb0fb69f2b..ea2940a6212a 100644 --- a/ipc/glue/DataPipe.h +++ b/ipc/glue/DataPipe.h @@ -88,7 +88,7 @@ class DataPipeReceiver; class DataPipeSender final : public nsIAsyncOutputStream, public data_pipe_detail::DataPipeBase { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DATAPIPESENDER_IID) + NS_INLINE_DECL_STATIC_IID(NS_DATAPIPESENDER_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOUTPUTSTREAM NS_DECL_NSIASYNCOUTPUTSTREAM @@ -114,8 +114,6 @@ class DataPipeSender final : public nsIAsyncOutputStream, ~DataPipeSender() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DataPipeSender, NS_DATAPIPESENDER_IID) - #define NS_DATAPIPERECEIVER_IID \ {0x0a185f83, 0x499e, 0x450c, {0x95, 0x82, 0x27, 0x67, 0xad, 0x6d, 0x64, 0xb5}} @@ -124,7 +122,7 @@ class DataPipeReceiver final : public nsIAsyncInputStream, public nsIIPCSerializableInputStream, public data_pipe_detail::DataPipeBase { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DATAPIPERECEIVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_DATAPIPERECEIVER_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM NS_DECL_NSIASYNCINPUTSTREAM @@ -150,8 +148,6 @@ class DataPipeReceiver final : public nsIAsyncInputStream, ~DataPipeReceiver() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DataPipeReceiver, NS_DATAPIPERECEIVER_IID) - constexpr uint32_t kDefaultDataPipeCapacity = 64 * 1024; /** diff --git a/ipc/glue/nsIIPCSerializableInputStream.h b/ipc/glue/nsIIPCSerializableInputStream.h index acc7594f66c2..206d082e1eb6 100644 --- a/ipc/glue/nsIIPCSerializableInputStream.h +++ b/ipc/glue/nsIIPCSerializableInputStream.h @@ -22,16 +22,12 @@ class InputStreamParams; } // namespace mozilla -#define NS_IIPCSERIALIZABLEINPUTSTREAM_IID \ - { \ - 0xb0211b14, 0xea6d, 0x40d4, { \ - 0x87, 0xb5, 0x7b, 0xe3, 0xdf, 0xac, 0x09, 0xd1 \ - } \ - } +#define NS_IIPCSERIALIZABLEINPUTSTREAM_IID \ + {0xb0211b14, 0xea6d, 0x40d4, {0x87, 0xb5, 0x7b, 0xe3, 0xdf, 0xac, 0x09, 0xd1}} class NS_NO_VTABLE nsIIPCSerializableInputStream : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIPCSERIALIZABLEINPUTSTREAM_IID) + NS_INLINE_DECL_STATIC_IID(NS_IIPCSERIALIZABLEINPUTSTREAM_IID) // Determine the serialized complexity of this input stream, initializing // `*aSizeUsed`, `*aPipes` and `*aTransferables` to the number of inline @@ -72,9 +68,6 @@ class NS_NO_VTABLE nsIIPCSerializableInputStream : public nsISupports { virtual bool Deserialize(const mozilla::ipc::InputStreamParams& aParams) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableInputStream, - NS_IIPCSERIALIZABLEINPUTSTREAM_IID) - #define NS_DECL_NSIIPCSERIALIZABLEINPUTSTREAM \ virtual void SerializedComplexity(uint32_t aMaxSize, uint32_t* aSizeUsed, \ uint32_t* aPipes, \ diff --git a/js/xpconnect/src/nsIXPConnect.h b/js/xpconnect/src/nsIXPConnect.h index 07703182f459..c069476c339a 100644 --- a/js/xpconnect/src/nsIXPConnect.h +++ b/js/xpconnect/src/nsIXPConnect.h @@ -29,35 +29,24 @@ class nsIVariant; /***************************************************************************/ #define NS_IXPCONNECTJSOBJECTHOLDER_IID_STR \ "73e6ff4a-ab99-4d99-ac00-ba39ccb8e4d7" -#define NS_IXPCONNECTJSOBJECTHOLDER_IID \ - { \ - 0x73e6ff4a, 0xab99, 0x4d99, { \ - 0xac, 0x00, 0xba, 0x39, 0xcc, 0xb8, 0xe4, 0xd7 \ - } \ - } +#define NS_IXPCONNECTJSOBJECTHOLDER_IID \ + {0x73e6ff4a, 0xab99, 0x4d99, {0xac, 0x00, 0xba, 0x39, 0xcc, 0xb8, 0xe4, 0xd7}} class NS_NO_VTABLE nsIXPConnectJSObjectHolder : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCONNECTJSOBJECTHOLDER_IID) + NS_INLINE_DECL_STATIC_IID(NS_IXPCONNECTJSOBJECTHOLDER_IID) virtual JSObject* GetJSObject() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnectJSObjectHolder, - NS_IXPCONNECTJSOBJECTHOLDER_IID) - #define NS_IXPCONNECTWRAPPEDNATIVE_IID_STR \ "e787be29-db5d-4a45-a3d6-1de1d6b85c30" -#define NS_IXPCONNECTWRAPPEDNATIVE_IID \ - { \ - 0xe787be29, 0xdb5d, 0x4a45, { \ - 0xa3, 0xd6, 0x1d, 0xe1, 0xd6, 0xb8, 0x5c, 0x30 \ - } \ - } +#define NS_IXPCONNECTWRAPPEDNATIVE_IID \ + {0xe787be29, 0xdb5d, 0x4a45, {0xa3, 0xd6, 0x1d, 0xe1, 0xd6, 0xb8, 0x5c, 0x30}} class nsIXPConnectWrappedNative : public nsIXPConnectJSObjectHolder { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCONNECTWRAPPEDNATIVE_IID) + NS_INLINE_DECL_STATIC_IID(NS_IXPCONNECTWRAPPEDNATIVE_IID) nsresult DebugDump(int16_t depth); @@ -70,20 +59,13 @@ class nsIXPConnectWrappedNative : public nsIXPConnectJSObjectHolder { XPCWrappedNative* AsXPCWrappedNative(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnectWrappedNative, - NS_IXPCONNECTWRAPPEDNATIVE_IID) - #define NS_IXPCONNECTWRAPPEDJS_IID_STR "3a01b0d6-074b-49ed-bac3-08c76366cae4" -#define NS_IXPCONNECTWRAPPEDJS_IID \ - { \ - 0x3a01b0d6, 0x074b, 0x49ed, { \ - 0xba, 0xc3, 0x08, 0xc7, 0x63, 0x66, 0xca, 0xe4 \ - } \ - } +#define NS_IXPCONNECTWRAPPEDJS_IID \ + {0x3a01b0d6, 0x074b, 0x49ed, {0xba, 0xc3, 0x08, 0xc7, 0x63, 0x66, 0xca, 0xe4}} class nsIXPConnectWrappedJS : public nsIXPConnectJSObjectHolder { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCONNECTWRAPPEDJS_IID) + NS_INLINE_DECL_STATIC_IID(NS_IXPCONNECTWRAPPEDJS_IID) nsresult GetInterfaceIID(nsIID** aInterfaceIID); @@ -102,16 +84,10 @@ class nsIXPConnectWrappedJS : public nsIXPConnectJSObjectHolder { nsXPCWrappedJS* AsXPCWrappedJS(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnectWrappedJS, NS_IXPCONNECTWRAPPEDJS_IID) - #define NS_IXPCONNECTWRAPPEDJSUNMARKGRAY_IID_STR \ "c02a0ce6-275f-4ea1-9c23-08494898b070" -#define NS_IXPCONNECTWRAPPEDJSUNMARKGRAY_IID \ - { \ - 0xc02a0ce6, 0x275f, 0x4ea1, { \ - 0x9c, 0x23, 0x08, 0x49, 0x48, 0x98, 0xb0, 0x70 \ - } \ - } +#define NS_IXPCONNECTWRAPPEDJSUNMARKGRAY_IID \ + {0xc02a0ce6, 0x275f, 0x4ea1, {0x9c, 0x23, 0x08, 0x49, 0x48, 0x98, 0xb0, 0x70}} // Special interface to unmark the internal JSObject. // QIing to nsIXPConnectWrappedJSUnmarkGray does *not* addref, it only unmarks, @@ -119,25 +95,18 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnectWrappedJS, NS_IXPCONNECTWRAPPEDJS_IID) class NS_NO_VTABLE nsIXPConnectWrappedJSUnmarkGray : public nsIXPConnectWrappedJS { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCONNECTWRAPPEDJSUNMARKGRAY_IID) + NS_INLINE_DECL_STATIC_IID(NS_IXPCONNECTWRAPPEDJSUNMARKGRAY_IID) }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnectWrappedJSUnmarkGray, - NS_IXPCONNECTWRAPPEDJSUNMARKGRAY_IID) - /***************************************************************************/ #define NS_IXPCONNECT_IID_STR "768507b5-b981-40c7-8276-f6a1da502a24" -#define NS_IXPCONNECT_IID \ - { \ - 0x768507b5, 0xb981, 0x40c7, { \ - 0x82, 0x76, 0xf6, 0xa1, 0xda, 0x50, 0x2a, 0x24 \ - } \ - } +#define NS_IXPCONNECT_IID \ + {0x768507b5, 0xb981, 0x40c7, {0x82, 0x76, 0xf6, 0xa1, 0xda, 0x50, 0x2a, 0x24}} class nsIXPConnect : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCONNECT_IID) + NS_INLINE_DECL_STATIC_IID(NS_IXPCONNECT_IID) // This gets a non-addref'd pointer. static nsIXPConnect* XPConnect(); @@ -286,6 +255,4 @@ class nsIXPConnect : public nsISupports { JS::MutableHandle rval); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnect, NS_IXPCONNECT_IID) - #endif // defined nsIXPConnect_h diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index b3e75034e2ab..dfe8c168b6e5 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -2097,7 +2097,7 @@ class XPCVariant : public nsIVariant { // We #define and iid so that out module local code can use QI to detect // if a given nsIVariant is in fact an XPCVariant. - NS_DECLARE_STATIC_IID_ACCESSOR(XPCVARIANT_IID) + NS_INLINE_DECL_STATIC_IID(XPCVARIANT_IID) static already_AddRefed newVariant(JSContext* cx, const JS::Value& aJSVal); @@ -2148,8 +2148,6 @@ class XPCVariant : public nsIVariant { bool mReturnRawObject; }; -NS_DEFINE_STATIC_IID_ACCESSOR(XPCVariant, XPCVARIANT_IID) - /***************************************************************************/ // Utilities diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index 9d6925d9a51f..a033f08cd10e 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -169,7 +169,7 @@ class PresShell final : public nsStubDocumentObserver, // nsISupports NS_DECL_ISUPPORTS - NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRESSHELL_IID) + NS_INLINE_DECL_STATIC_IID(NS_PRESSHELL_IID) static bool AccessibleCaretEnabled(nsIDocShell* aDocShell); @@ -3320,8 +3320,6 @@ class PresShell final : public nsStubDocumentObserver, static bool sProcessInteractable; }; -NS_DEFINE_STATIC_IID_ACCESSOR(PresShell, NS_PRESSHELL_IID) - } // namespace mozilla #endif // mozilla_PresShell_h diff --git a/layout/base/nsIDocumentViewerPrint.h b/layout/base/nsIDocumentViewerPrint.h index b08b409b365f..2e8a9211ab47 100644 --- a/layout/base/nsIDocumentViewerPrint.h +++ b/layout/base/nsIDocumentViewerPrint.h @@ -18,12 +18,8 @@ class nsPresContext; class nsViewManager; // {c6f255cf-cadd-4382-b57f-cd2a9874169b} -#define NS_IDOCUMENT_VIEWER_PRINT_IID \ - { \ - 0xc6f255cf, 0xcadd, 0x4382, { \ - 0xb5, 0x7f, 0xcd, 0x2a, 0x98, 0x74, 0x16, 0x9b \ - } \ - } +#define NS_IDOCUMENT_VIEWER_PRINT_IID \ + {0xc6f255cf, 0xcadd, 0x4382, {0xb5, 0x7f, 0xcd, 0x2a, 0x98, 0x74, 0x16, 0x9b}} /** * A DocumentViewerPrint is an INTERNAL Interface used for interaction @@ -31,7 +27,7 @@ class nsViewManager; */ class nsIDocumentViewerPrint : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_VIEWER_PRINT_IID) + NS_INLINE_DECL_STATIC_IID(NS_IDOCUMENT_VIEWER_PRINT_IID) virtual bool GetIsPrinting() const = 0; @@ -56,9 +52,6 @@ class nsIDocumentViewerPrint : public nsISupports { mozilla::PresShell* aPresShell) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewerPrint, - NS_IDOCUMENT_VIEWER_PRINT_IID) - /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIDOCUMENTVIEWERPRINT \ bool GetIsPrinting() const override; \ diff --git a/layout/style/nsICSSDeclaration.h b/layout/style/nsICSSDeclaration.h index 53dcbed4ecb0..a88dba1ecac8 100644 --- a/layout/style/nsICSSDeclaration.h +++ b/layout/style/nsICSSDeclaration.h @@ -40,16 +40,12 @@ class DocGroup; } // namespace mozilla // dbeabbfa-6cb3-4f5c-aec2-dd558d9d681f -#define NS_ICSSDECLARATION_IID \ - { \ - 0xdbeabbfa, 0x6cb3, 0x4f5c, { \ - 0xae, 0xc2, 0xdd, 0x55, 0x8d, 0x9d, 0x68, 0x1f \ - } \ - } +#define NS_ICSSDECLARATION_IID \ + {0xdbeabbfa, 0x6cb3, 0x4f5c, {0xae, 0xc2, 0xdd, 0x55, 0x8d, 0x9d, 0x68, 0x1f}} class nsICSSDeclaration : public nsISupports, public nsWrapperCache { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSDECLARATION_IID) + NS_INLINE_DECL_STATIC_IID(NS_ICSSDECLARATION_IID) virtual nsINode* GetAssociatedNode() const = 0; virtual nsISupports* GetParentObject() const = 0; @@ -110,8 +106,6 @@ class nsICSSDeclaration : public nsISupports, public nsWrapperCache { bool IsReadOnly(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSDeclaration, NS_ICSSDECLARATION_IID) - #define NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER \ void GetCssText(nsACString& aCssText) override; \ void SetCssText(const nsACString& aCssText, nsIPrincipal* aSubjectPrincipal, \ diff --git a/layout/style/nsICSSLoaderObserver.h b/layout/style/nsICSSLoaderObserver.h index 1f0d5b5130b9..3c14678aab90 100644 --- a/layout/style/nsICSSLoaderObserver.h +++ b/layout/style/nsICSSLoaderObserver.h @@ -11,12 +11,8 @@ #include "nsISupports.h" -#define NS_ICSSLOADEROBSERVER_IID \ - { \ - 0xf51fbf2c, 0xfe4b, 0x4a15, { \ - 0xaf, 0x7e, 0x5e, 0x20, 0x64, 0x5f, 0xaf, 0x58 \ - } \ - } +#define NS_ICSSLOADEROBSERVER_IID \ + {0xf51fbf2c, 0xfe4b, 0x4a15, {0xaf, 0x7e, 0x5e, 0x20, 0x64, 0x5f, 0xaf, 0x58}} namespace mozilla { class StyleSheet; @@ -24,7 +20,7 @@ class StyleSheet; class nsICSSLoaderObserver : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSLOADEROBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(NS_ICSSLOADEROBSERVER_IID) /** * StyleSheetLoaded is called after aSheet is marked complete and before any @@ -43,6 +39,4 @@ class nsICSSLoaderObserver : public nsISupports { nsresult aStatus) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSLoaderObserver, NS_ICSSLOADEROBSERVER_IID) - #endif // nsICSSLoaderObserver_h___ diff --git a/layout/svg/SVGObserverUtils.h b/layout/svg/SVGObserverUtils.h index e6c1d1fa73ae..00c259eb0ed7 100644 --- a/layout/svg/SVGObserverUtils.h +++ b/layout/svg/SVGObserverUtils.h @@ -49,7 +49,7 @@ namespace mozilla { class ISVGFilterObserverList : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_ICANVASFILTEROBSERVER_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_ICANVASFILTEROBSERVER_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(ISVGFilterObserverList) @@ -60,9 +60,6 @@ class ISVGFilterObserverList : public nsISupports { virtual ~ISVGFilterObserverList() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ISVGFilterObserverList, - MOZILLA_ICANVASFILTEROBSERVER_IID) - /** * This interface allows us to be notified when a piece of SVG content is * re-rendered. diff --git a/layout/xul/tree/nsTreeColumns.h b/layout/xul/tree/nsTreeColumns.h index 677206a89dba..8e0cacde2ecd 100644 --- a/layout/xul/tree/nsTreeColumns.h +++ b/layout/xul/tree/nsTreeColumns.h @@ -32,12 +32,12 @@ class XULTreeElement; } // namespace dom } // namespace mozilla -#define NS_TREECOLUMN_IMPL_CID \ - { /* 02cd1963-4b5d-4a6c-9223-814d3ade93a3 */ \ - 0x02cd1963, 0x4b5d, 0x4a6c, { \ - 0x92, 0x23, 0x81, 0x4d, 0x3a, 0xde, 0x93, 0xa3 \ - } \ - } +#define NS_TREECOLUMN_IMPL_CID \ + {/* 02cd1963-4b5d-4a6c-9223-814d3ade93a3 */ \ + 0x02cd1963, \ + 0x4b5d, \ + 0x4a6c, \ + {0x92, 0x23, 0x81, 0x4d, 0x3a, 0xde, 0x93, 0xa3}} // This class is our column info. We use it to iterate our columns and to // obtain information about each column. @@ -45,7 +45,7 @@ class nsTreeColumn final : public nsISupports, public nsWrapperCache { public: nsTreeColumn(nsTreeColumns* aColumns, mozilla::dom::Element* aElement); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_TREECOLUMN_IMPL_CID) + NS_INLINE_DECL_STATIC_IID(NS_TREECOLUMN_IMPL_CID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsTreeColumn) @@ -148,8 +148,6 @@ class nsTreeColumn final : public nsISupports, public nsWrapperCache { nsTreeColumn* mPrevious; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsTreeColumn, NS_TREECOLUMN_IMPL_CID) - class nsTreeColumns final : public nsISupports, public nsWrapperCache { private: ~nsTreeColumns(); diff --git a/modules/libjar/nsJARURI.h b/modules/libjar/nsJARURI.h index 7be600f0216a..42665b245d1a 100644 --- a/modules/libjar/nsJARURI.h +++ b/modules/libjar/nsJARURI.h @@ -14,26 +14,26 @@ #include "nsINestedURI.h" #include "nsIURIMutator.h" -#define NS_THIS_JARURI_IMPL_CID \ - { /* 9a55f629-730b-4d08-b75b-fa7d9570a691 */ \ - 0x9a55f629, 0x730b, 0x4d08, { \ - 0xb7, 0x5b, 0xfa, 0x7d, 0x95, 0x70, 0xa6, 0x91 \ - } \ - } +#define NS_THIS_JARURI_IMPL_CID \ + {/* 9a55f629-730b-4d08-b75b-fa7d9570a691 */ \ + 0x9a55f629, \ + 0x730b, \ + 0x4d08, \ + {0xb7, 0x5b, 0xfa, 0x7d, 0x95, 0x70, 0xa6, 0x91}} -#define NS_JARURI_CID \ - { /* 245abae2-b947-4ded-a46d-9829d3cca462 */ \ - 0x245abae2, 0xb947, 0x4ded, { \ - 0xa4, 0x6d, 0x98, 0x29, 0xd3, 0xcc, 0xa4, 0x62 \ - } \ - } +#define NS_JARURI_CID \ + {/* 245abae2-b947-4ded-a46d-9829d3cca462 */ \ + 0x245abae2, \ + 0xb947, \ + 0x4ded, \ + {0xa4, 0x6d, 0x98, 0x29, 0xd3, 0xcc, 0xa4, 0x62}} -#define NS_JARURIMUTATOR_CID \ - { /* 19d9161b-a2a9-4518-b2c9-fcb8296d6dcd */ \ - 0x19d9161b, 0xa2a9, 0x4518, { \ - 0xb2, 0xc9, 0xfc, 0xb8, 0x29, 0x6d, 0x6d, 0xcd \ - } \ - } +#define NS_JARURIMUTATOR_CID \ + {/* 19d9161b-a2a9-4518-b2c9-fcb8296d6dcd */ \ + 0x19d9161b, \ + 0xa2a9, \ + 0x4518, \ + {0xb2, 0xc9, 0xfc, 0xb8, 0x29, 0x6d, 0x6d, 0xcd}} class nsJARURI final : public nsIJARURI, public nsISerializable, @@ -46,7 +46,7 @@ class nsJARURI final : public nsIJARURI, NS_DECL_NSISERIALIZABLE NS_DECL_NSINESTEDURI - NS_DECLARE_STATIC_IID_ACCESSOR(NS_THIS_JARURI_IMPL_CID) + NS_INLINE_DECL_STATIC_IID(NS_THIS_JARURI_IMPL_CID) // nsJARURI nsresult FormatSpec(const nsACString& entryPath, nsACString& result, @@ -151,6 +151,4 @@ class nsJARURI final : public nsIJARURI, friend BaseURIMutator; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsJARURI, NS_THIS_JARURI_IMPL_CID) - #endif // nsJARURI_h__ diff --git a/netwerk/base/Tickler.h b/netwerk/base/Tickler.h index 264ecefebb1d..a1dbca5ee927 100644 --- a/netwerk/base/Tickler.h +++ b/netwerk/base/Tickler.h @@ -53,17 +53,16 @@ namespace net { #ifdef MOZ_USE_WIFI_TICKLER // 8f769ed6-207c-4af9-9f7e-9e832da3754e -# define NS_TICKLER_IID \ - { \ - 0x8f769ed6, 0x207c, 0x4af9, { \ - 0x9f, 0x7e, 0x9e, 0x83, 0x2d, 0xa3, 0x75, 0x4e \ - } \ - } +# define NS_TICKLER_IID \ + {0x8f769ed6, \ + 0x207c, \ + 0x4af9, \ + {0x9f, 0x7e, 0x9e, 0x83, 0x2d, 0xa3, 0x75, 0x4e}} class Tickler final : public nsSupportsWeakReference { public: NS_DECL_THREADSAFE_ISUPPORTS - NS_DECLARE_STATIC_IID_ACCESSOR(NS_TICKLER_IID) + NS_INLINE_DECL_STATIC_IID(NS_TICKLER_IID) // These methods are main thread only Tickler(); @@ -106,8 +105,6 @@ class Tickler final : public nsSupportsWeakReference { void StopTickler(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(Tickler, NS_TICKLER_IID) - #else // not defined MOZ_USE_WIFI_TICKLER class Tickler final : public nsISupports { @@ -119,7 +116,7 @@ class Tickler final : public nsISupports { Tickler() = default; nsresult Init() { return NS_ERROR_NOT_IMPLEMENTED; } void Cancel() {} - void SetIPV4Address(uint32_t){}; + void SetIPV4Address(uint32_t) {}; void SetIPV4Port(uint16_t) {} void Tickle() {} }; diff --git a/netwerk/base/nsBaseChannel.h b/netwerk/base/nsBaseChannel.h index c0db8e2500ae..ad7e17252c72 100644 --- a/netwerk/base/nsBaseChannel.h +++ b/netwerk/base/nsBaseChannel.h @@ -205,7 +205,7 @@ class nsBaseChannel // Helper function for querying the channel's notification callbacks. template void GetCallback(nsCOMPtr& result) { - GetInterface(NS_GET_TEMPLATE_IID(T), getter_AddRefs(result)); + GetInterface(NS_GET_IID(T), getter_AddRefs(result)); } // If a subclass does not want to feed transport-layer progress events to the diff --git a/netwerk/base/nsInputStreamPump.h b/netwerk/base/nsInputStreamPump.h index 21e75c027666..4e8f2738ffd8 100644 --- a/netwerk/base/nsInputStreamPump.h +++ b/netwerk/base/nsInputStreamPump.h @@ -22,12 +22,8 @@ class nsIInputStream; class nsILoadGroup; class nsIStreamListener; -#define NS_INPUT_STREAM_PUMP_IID \ - { \ - 0x42f1cc9b, 0xdf5f, 0x4c9b, { \ - 0xbd, 0x71, 0x8d, 0x4a, 0xe2, 0x27, 0xc1, 0x8a \ - } \ - } +#define NS_INPUT_STREAM_PUMP_IID \ + {0x42f1cc9b, 0xdf5f, 0x4c9b, {0xbd, 0x71, 0x8d, 0x4a, 0xe2, 0x27, 0xc1, 0x8a}} class nsInputStreamPump final : public nsIInputStreamPump, public nsIInputStreamCallback, @@ -42,7 +38,7 @@ class nsInputStreamPump final : public nsIInputStreamPump, NS_DECL_NSIINPUTSTREAMPUMP NS_DECL_NSIINPUTSTREAMCALLBACK NS_DECL_NSITHREADRETARGETABLEREQUEST - NS_DECLARE_STATIC_IID_ACCESSOR(NS_INPUT_STREAM_PUMP_IID) + NS_INLINE_DECL_STATIC_IID(NS_INPUT_STREAM_PUMP_IID) nsInputStreamPump(); @@ -124,6 +120,4 @@ class nsInputStreamPump final : public nsIInputStreamPump, mozilla::RecursiveMutex mMutex{"nsInputStreamPump"}; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsInputStreamPump, NS_INPUT_STREAM_PUMP_IID) - #endif // !nsInputStreamChannel_h__ diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h index 6fbd162f2d0b..caa39ea104dd 100644 --- a/netwerk/base/nsNetUtil.h +++ b/netwerk/base/nsNetUtil.h @@ -683,8 +683,7 @@ inline void NS_QueryNotificationCallbacks(T* channel, const nsIID& iid, template inline void NS_QueryNotificationCallbacks(C* channel, nsCOMPtr& result) { - NS_QueryNotificationCallbacks(channel, NS_GET_TEMPLATE_IID(T), - getter_AddRefs(result)); + NS_QueryNotificationCallbacks(channel, NS_GET_IID(T), getter_AddRefs(result)); } /** @@ -761,7 +760,7 @@ template inline void NS_QueryNotificationCallbacks(nsIInterfaceRequestor* callbacks, nsILoadGroup* loadGroup, nsCOMPtr& result) { - NS_QueryNotificationCallbacks(callbacks, loadGroup, NS_GET_TEMPLATE_IID(T), + NS_QueryNotificationCallbacks(callbacks, loadGroup, NS_GET_IID(T), getter_AddRefs(result)); } diff --git a/netwerk/base/nsProtocolProxyService.h b/netwerk/base/nsProtocolProxyService.h index 1f10779b6d06..61da12d663cd 100644 --- a/netwerk/base/nsProtocolProxyService.h +++ b/netwerk/base/nsProtocolProxyService.h @@ -48,7 +48,7 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2, NS_DECL_NSITIMERCALLBACK NS_DECL_NSINAMED - NS_DECLARE_STATIC_IID_ACCESSOR(NS_PROTOCOL_PROXY_SERVICE_IMPL_CID) + NS_INLINE_DECL_STATIC_IID(NS_PROTOCOL_PROXY_SERVICE_IMPL_CID) nsProtocolProxyService(); @@ -425,9 +425,6 @@ class nsProtocolProxyService final : public nsIProtocolProxyService2, nsCOMPtr mReloadPACTimer; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsProtocolProxyService, - NS_PROTOCOL_PROXY_SERVICE_IMPL_CID) - } // namespace net } // namespace mozilla diff --git a/netwerk/base/nsProxyInfo.h b/netwerk/base/nsProxyInfo.h index ca8602edc07a..e31a813fb025 100644 --- a/netwerk/base/nsProxyInfo.h +++ b/netwerk/base/nsProxyInfo.h @@ -13,12 +13,12 @@ #include "mozilla/Attributes.h" // Use to support QI nsIProxyInfo to nsProxyInfo -#define NS_PROXYINFO_IID \ - { /* ed42f751-825e-4cc2-abeb-3670711a8b85 */ \ - 0xed42f751, 0x825e, 0x4cc2, { \ - 0xab, 0xeb, 0x36, 0x70, 0x71, 0x1a, 0x8b, 0x85 \ - } \ - } +#define NS_PROXYINFO_IID \ + {/* ed42f751-825e-4cc2-abeb-3670711a8b85 */ \ + 0xed42f751, \ + 0x825e, \ + 0x4cc2, \ + {0xab, 0xeb, 0x36, 0x70, 0x71, 0x1a, 0x8b, 0x85}} namespace mozilla { namespace net { @@ -29,7 +29,7 @@ class ProxyInfoCloneArgs; // to the nsIProxyInfo attributes. class nsProxyInfo final : public nsIProxyInfo { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_PROXYINFO_IID) + NS_INLINE_DECL_STATIC_IID(NS_PROXYINFO_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROXYINFO @@ -92,8 +92,6 @@ class nsProxyInfo final : public nsIProxyInfo { nsProxyInfo* mNext{nullptr}; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsProxyInfo, NS_PROXYINFO_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/cache2/CacheFile.h b/netwerk/cache2/CacheFile.h index 94901646e98e..aff1ce7bdb91 100644 --- a/netwerk/cache2/CacheFile.h +++ b/netwerk/cache2/CacheFile.h @@ -39,14 +39,12 @@ class CacheFileLock; class CacheFileListener : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(CACHEFILELISTENER_IID) + NS_INLINE_DECL_STATIC_IID(CACHEFILELISTENER_IID) NS_IMETHOD OnFileReady(nsresult aResult, bool aIsNew) = 0; NS_IMETHOD OnFileDoomed(nsresult aResult) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(CacheFileListener, CACHEFILELISTENER_IID) - class MOZ_CAPABILITY("mutex") CacheFile final : public CacheFileChunkListener, public CacheFileIOListener, diff --git a/netwerk/cache2/CacheFileChunk.h b/netwerk/cache2/CacheFileChunk.h index 4d20bf19eb27..137bc7456e06 100644 --- a/netwerk/cache2/CacheFileChunk.h +++ b/netwerk/cache2/CacheFileChunk.h @@ -89,16 +89,16 @@ class CacheFileChunkWriteHandle : public CacheFileChunkHandle { void UpdateDataSize(uint32_t aOffset, uint32_t aLen); }; -#define CACHEFILECHUNKLISTENER_IID \ - { /* baf16149-2ab5-499c-a9c2-5904eb95c288 */ \ - 0xbaf16149, 0x2ab5, 0x499c, { \ - 0xa9, 0xc2, 0x59, 0x04, 0xeb, 0x95, 0xc2, 0x88 \ - } \ - } +#define CACHEFILECHUNKLISTENER_IID \ + {/* baf16149-2ab5-499c-a9c2-5904eb95c288 */ \ + 0xbaf16149, \ + 0x2ab5, \ + 0x499c, \ + {0xa9, 0xc2, 0x59, 0x04, 0xeb, 0x95, 0xc2, 0x88}} class CacheFileChunkListener : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(CACHEFILECHUNKLISTENER_IID) + NS_INLINE_DECL_STATIC_IID(CACHEFILECHUNKLISTENER_IID) NS_IMETHOD OnChunkRead(nsresult aResult, CacheFileChunk* aChunk) = 0; NS_IMETHOD OnChunkWritten(nsresult aResult, CacheFileChunk* aChunk) = 0; @@ -107,9 +107,6 @@ class CacheFileChunkListener : public nsISupports { NS_IMETHOD OnChunkUpdated(CacheFileChunk* aChunk) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(CacheFileChunkListener, - CACHEFILECHUNKLISTENER_IID) - class ChunkListenerItem { public: MOZ_COUNTED_DEFAULT_CTOR(ChunkListenerItem) diff --git a/netwerk/cache2/CacheFileIOManager.h b/netwerk/cache2/CacheFileIOManager.h index f340f2a4f027..e1bb87d5dd13 100644 --- a/netwerk/cache2/CacheFileIOManager.h +++ b/netwerk/cache2/CacheFileIOManager.h @@ -218,16 +218,16 @@ class WriteEvent; class MetadataWriteScheduleEvent; class CacheFileContextEvictor; -#define CACHEFILEIOLISTENER_IID \ - { /* dcaf2ddc-17cf-4242-bca1-8c86936375a5 */ \ - 0xdcaf2ddc, 0x17cf, 0x4242, { \ - 0xbc, 0xa1, 0x8c, 0x86, 0x93, 0x63, 0x75, 0xa5 \ - } \ - } +#define CACHEFILEIOLISTENER_IID \ + {/* dcaf2ddc-17cf-4242-bca1-8c86936375a5 */ \ + 0xdcaf2ddc, \ + 0x17cf, \ + 0x4242, \ + {0xbc, 0xa1, 0x8c, 0x86, 0x93, 0x63, 0x75, 0xa5}} class CacheFileIOListener : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(CACHEFILEIOLISTENER_IID) + NS_INLINE_DECL_STATIC_IID(CACHEFILEIOLISTENER_IID) NS_IMETHOD OnFileOpened(CacheFileHandle* aHandle, nsresult aResult) = 0; NS_IMETHOD OnDataWritten(CacheFileHandle* aHandle, const char* aBuf, @@ -241,8 +241,6 @@ class CacheFileIOListener : public nsISupports { virtual bool IsKilled() { return false; } }; -NS_DEFINE_STATIC_IID_ACCESSOR(CacheFileIOListener, CACHEFILEIOLISTENER_IID) - class CacheFileIOManager final : public nsITimerCallback, public nsINamed { public: NS_DECL_THREADSAFE_ISUPPORTS diff --git a/netwerk/cache2/CacheFileMetadata.h b/netwerk/cache2/CacheFileMetadata.h index 72a9870a72f1..649af3ca9835 100644 --- a/netwerk/cache2/CacheFileMetadata.h +++ b/netwerk/cache2/CacheFileMetadata.h @@ -124,16 +124,13 @@ class CacheFileMetadataHeader { class CacheFileMetadataListener : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(CACHEFILEMETADATALISTENER_IID) + NS_INLINE_DECL_STATIC_IID(CACHEFILEMETADATALISTENER_IID) NS_IMETHOD OnMetadataRead(nsresult aResult) = 0; NS_IMETHOD OnMetadataWritten(nsresult aResult) = 0; virtual bool IsKilled() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(CacheFileMetadataListener, - CACHEFILEMETADATALISTENER_IID) - class CacheFileMetadata final : public CacheFileIOListener, public CacheMemoryConsumer { public: diff --git a/netwerk/dns/DNSListenerProxy.h b/netwerk/dns/DNSListenerProxy.h index 5baddfd8e7c3..cc0cf727730b 100644 --- a/netwerk/dns/DNSListenerProxy.h +++ b/netwerk/dns/DNSListenerProxy.h @@ -18,12 +18,8 @@ class nsICancelable; namespace mozilla { namespace net { -#define DNS_LISTENER_PROXY_IID \ - { \ - 0x8f172ca3, 0x7a7f, 0x4941, { \ - 0xa7, 0x0b, 0xbc, 0x72, 0x80, 0x2e, 0x9d, 0x9b \ - } \ - } +#define DNS_LISTENER_PROXY_IID \ + {0x8f172ca3, 0x7a7f, 0x4941, {0xa7, 0x0b, 0xbc, 0x72, 0x80, 0x2e, 0x9d, 0x9b}} class DNSListenerProxy final : public nsIDNSListener { public: @@ -39,7 +35,7 @@ class DNSListenerProxy final : public nsIDNSListener { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIDNSLISTENER - NS_DECLARE_STATIC_IID_ACCESSOR(DNS_LISTENER_PROXY_IID) + NS_INLINE_DECL_STATIC_IID(DNS_LISTENER_PROXY_IID) uintptr_t GetOriginalListenerAddress() const { return mListenerAddress; } @@ -54,8 +50,6 @@ class DNSListenerProxy final : public nsIDNSListener { uintptr_t mListenerAddress; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DNSListenerProxy, DNS_LISTENER_PROXY_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/dns/nsHostRecord.h b/netwerk/dns/nsHostRecord.h index 15517c1e14db..4b9f6cd1fbb7 100644 --- a/netwerk/dns/nsHostRecord.h +++ b/netwerk/dns/nsHostRecord.h @@ -266,7 +266,7 @@ class AddrHostRecord final : public nsHostRecord { using Mutex = mozilla::Mutex; public: - NS_DECLARE_STATIC_IID_ACCESSOR(ADDRHOSTRECORD_IID) + NS_INLINE_DECL_STATIC_IID(ADDRHOSTRECORD_IID) NS_DECL_ISUPPORTS_INHERITED /* a fully resolved host record has either a non-null |addr_info| or |addr| @@ -350,8 +350,6 @@ class AddrHostRecord final : public nsHostRecord { nsTArray mUnusableItems; }; -NS_DEFINE_STATIC_IID_ACCESSOR(AddrHostRecord, ADDRHOSTRECORD_IID) - // 77b786a7-04be-44f2-987c-ab8aa96676e0 #define TYPEHOSTRECORD_IID \ {0x77b786a7, 0x04be, 0x44f2, {0x98, 0x7c, 0xab, 0x8a, 0xa9, 0x66, 0x76, 0xe0}} @@ -361,7 +359,7 @@ class TypeHostRecord final : public nsHostRecord, public nsIDNSHTTPSSVCRecord, public mozilla::net::DNSHTTPSSVCRecordBase { public: - NS_DECLARE_STATIC_IID_ACCESSOR(TYPEHOSTRECORD_IID) + NS_INLINE_DECL_STATIC_IID(TYPEHOSTRECORD_IID) NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDNSTXTRECORD NS_DECL_NSIDNSHTTPSSVCRECORD @@ -394,8 +392,6 @@ class TypeHostRecord final : public nsHostRecord, bool mAllRecordsExcluded = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(TypeHostRecord, TYPEHOSTRECORD_IID) - static inline bool IsHighPriority(nsIDNSService::DNSFlags flags) { return !(flags & (nsHostRecord::DNS_PRIORITY_LOW | nsHostRecord::DNS_PRIORITY_MEDIUM)); diff --git a/netwerk/ipc/DocumentChannel.h b/netwerk/ipc/DocumentChannel.h index f6a75d4f1b59..8dd92c60d6c3 100644 --- a/netwerk/ipc/DocumentChannel.h +++ b/netwerk/ipc/DocumentChannel.h @@ -16,12 +16,8 @@ class nsDocShell; -#define DOCUMENT_CHANNEL_IID \ - { \ - 0x6977bc44, 0xb1db, 0x41b7, { \ - 0xb5, 0xc5, 0xe2, 0x13, 0x68, 0x22, 0xc9, 0x8f \ - } \ - } +#define DOCUMENT_CHANNEL_IID \ + {0x6977bc44, 0xb1db, 0x41b7, {0xb5, 0xc5, 0xe2, 0x13, 0x68, 0x22, 0xc9, 0x8f}} namespace mozilla { namespace net { @@ -45,7 +41,7 @@ class DocumentChannel : public nsIIdentChannel { NS_DECL_NSICHANNEL NS_DECL_NSIIDENTCHANNEL - NS_DECLARE_STATIC_IID_ACCESSOR(DOCUMENT_CHANNEL_IID) + NS_INLINE_DECL_STATIC_IID(DOCUMENT_CHANNEL_IID) void SetNavigationTiming(nsDOMNavigationTiming* aTiming) { mTiming = aTiming; @@ -112,8 +108,6 @@ class DocumentChannel : public nsIIdentChannel { bool mIsEmbeddingBlockedError = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DocumentChannel, DOCUMENT_CHANNEL_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/ipc/DocumentLoadListener.h b/netwerk/ipc/DocumentLoadListener.h index 6fe4080ac9fb..3510ba56251b 100644 --- a/netwerk/ipc/DocumentLoadListener.h +++ b/netwerk/ipc/DocumentLoadListener.h @@ -222,7 +222,7 @@ class DocumentLoadListener : public nsIInterfaceRequestor, // Returns true if the channel was finished before we could resume it. bool ResumeSuspendedChannel(nsIStreamListener* aListener); - NS_DECLARE_STATIC_IID_ACCESSOR(DOCUMENT_LOAD_LISTENER_IID) + NS_INLINE_DECL_STATIC_IID(DOCUMENT_LOAD_LISTENER_IID) // Called by the DocumentChannel if cancelled. void Cancel(const nsresult& aStatusCode, const nsACString& aReason); @@ -626,8 +626,6 @@ class DocumentLoadListener : public nsIInterfaceRequestor, RefPtr mHTTPSFirstDowngradeData; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DocumentLoadListener, DOCUMENT_LOAD_LISTENER_IID) - inline nsISupports* ToSupports(DocumentLoadListener* aObj) { return static_cast(aObj); } diff --git a/netwerk/ipc/InputChannelThrottleQueueParent.h b/netwerk/ipc/InputChannelThrottleQueueParent.h index 74d1a00bd70e..6e9a80208e44 100644 --- a/netwerk/ipc/InputChannelThrottleQueueParent.h +++ b/netwerk/ipc/InputChannelThrottleQueueParent.h @@ -13,12 +13,8 @@ namespace mozilla { namespace net { -#define INPUT_CHANNEL_THROTTLE_QUEUE_PARENT_IID \ - { \ - 0x4f151655, 0x70b3, 0x4350, { \ - 0x9b, 0xd9, 0xe3, 0x2b, 0xe5, 0xeb, 0xb2, 0x9e \ - } \ - } +#define INPUT_CHANNEL_THROTTLE_QUEUE_PARENT_IID \ + {0x4f151655, 0x70b3, 0x4350, {0x9b, 0xd9, 0xe3, 0x2b, 0xe5, 0xeb, 0xb2, 0x9e}} class InputChannelThrottleQueueParent final : public PInputChannelThrottleQueueParent, @@ -26,7 +22,7 @@ class InputChannelThrottleQueueParent final public: NS_DECL_ISUPPORTS NS_DECL_NSIINPUTCHANNELTHROTTLEQUEUE - NS_DECLARE_STATIC_IID_ACCESSOR(INPUT_CHANNEL_THROTTLE_QUEUE_PARENT_IID) + NS_INLINE_DECL_STATIC_IID(INPUT_CHANNEL_THROTTLE_QUEUE_PARENT_IID) friend class PInputChannelThrottleQueueParent; @@ -42,9 +38,6 @@ class InputChannelThrottleQueueParent final uint32_t mMaxBytesPerSecond{0}; }; -NS_DEFINE_STATIC_IID_ACCESSOR(InputChannelThrottleQueueParent, - INPUT_CHANNEL_THROTTLE_QUEUE_PARENT_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/AltSvcTransactionParent.h b/netwerk/protocol/http/AltSvcTransactionParent.h index dc910ad30144..c01d8720e25c 100644 --- a/netwerk/protocol/http/AltSvcTransactionParent.h +++ b/netwerk/protocol/http/AltSvcTransactionParent.h @@ -15,18 +15,14 @@ namespace net { class AltSvcMappingValidator; // 03d22e57-c364-4871-989a-6593eb909d24 -#define ALTSVCTRANSACTIONPARENT_IID \ - { \ - 0x03d22e57, 0xc364, 0x4871, { \ - 0x98, 0x9a, 0x65, 0x93, 0xeb, 0x90, 0x9d, 0x24 \ - } \ - } +#define ALTSVCTRANSACTIONPARENT_IID \ + {0x03d22e57, 0xc364, 0x4871, {0x98, 0x9a, 0x65, 0x93, 0xeb, 0x90, 0x9d, 0x24}} class AltSvcTransactionParent final : public PAltSvcTransactionParent, public SpeculativeTransaction { public: NS_DECL_ISUPPORTS_INHERITED - NS_DECLARE_STATIC_IID_ACCESSOR(ALTSVCTRANSACTIONPARENT_IID) + NS_INLINE_DECL_STATIC_IID(ALTSVCTRANSACTIONPARENT_IID) explicit AltSvcTransactionParent(nsHttpConnectionInfo* aConnInfo, nsIInterfaceRequestor* aCallbacks, @@ -43,9 +39,6 @@ class AltSvcTransactionParent final : public PAltSvcTransactionParent, RefPtr mValidator; }; -NS_DEFINE_STATIC_IID_ACCESSOR(AltSvcTransactionParent, - ALTSVCTRANSACTIONPARENT_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/DnsAndConnectSocket.h b/netwerk/protocol/http/DnsAndConnectSocket.h index 87b7c973cdc2..5288697edfd9 100644 --- a/netwerk/protocol/http/DnsAndConnectSocket.h +++ b/netwerk/protocol/http/DnsAndConnectSocket.h @@ -40,7 +40,7 @@ class DnsAndConnectSocket final : public nsIOutputStreamCallback, ~DnsAndConnectSocket(); public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_DNSANDCONNECTSOCKET_IID) + NS_INLINE_DECL_STATIC_IID(NS_DNSANDCONNECTSOCKET_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOUTPUTSTREAMCALLBACK NS_DECL_NSITRANSPORTEVENTSINK @@ -266,8 +266,6 @@ class DnsAndConnectSocket final : public nsIOutputStreamCallback, bool mProxyTransparentResolvesHost = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(DnsAndConnectSocket, NS_DNSANDCONNECTSOCKET_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/Http2Session.h b/netwerk/protocol/http/Http2Session.h index 04968f89608f..ead1db6f289a 100644 --- a/netwerk/protocol/http/Http2Session.h +++ b/netwerk/protocol/http/Http2Session.h @@ -49,7 +49,7 @@ class Http2Session final : public ASpdySession, ~Http2Session(); public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTTP2SESSION_IID) + NS_INLINE_DECL_STATIC_IID(NS_HTTP2SESSION_IID) NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSAHTTPTRANSACTION @@ -643,8 +643,6 @@ class Http2Session final : public ASpdySession, bool mHasTransactionWaitingForExtendedCONNECT = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Http2Session, NS_HTTP2SESSION_IID); - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/Http2StreamTunnel.h b/netwerk/protocol/http/Http2StreamTunnel.h index 188939d8cbaf..bae8abf9aa7e 100644 --- a/netwerk/protocol/http/Http2StreamTunnel.h +++ b/netwerk/protocol/http/Http2StreamTunnel.h @@ -24,7 +24,7 @@ class Http2StreamTunnel : public Http2StreamBase, public nsISocketTransport, public nsSupportsWeakReference { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTTP2STREAMTUNNEL_IID) + NS_INLINE_DECL_STATIC_IID(NS_HTTP2STREAMTUNNEL_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITRANSPORT NS_DECL_NSISOCKETTRANSPORT @@ -85,7 +85,7 @@ class Http2StreamTunnel : public Http2StreamBase, class OutputStreamTunnel : public nsIAsyncOutputStream { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_OUTPUTSTREAMTUNNEL_IID) + NS_INLINE_DECL_STATIC_IID(NS_OUTPUTSTREAMTUNNEL_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOUTPUTSTREAM NS_DECL_NSIASYNCOUTPUTSTREAM @@ -128,9 +128,6 @@ class InputStreamTunnel : public nsIAsyncInputStream { nsresult mCondition{NS_OK}; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Http2StreamTunnel, NS_HTTP2STREAMTUNNEL_IID) -NS_DEFINE_STATIC_IID_ACCESSOR(OutputStreamTunnel, NS_OUTPUTSTREAMTUNNEL_IID) - class Http2StreamWebSocket : public Http2StreamTunnel { public: Http2StreamWebSocket(Http2Session* session, int32_t priority, uint64_t bcId, diff --git a/netwerk/protocol/http/Http3Session.h b/netwerk/protocol/http/Http3Session.h index 9a986b5a80db..56126552e40d 100644 --- a/netwerk/protocol/http/Http3Session.h +++ b/netwerk/protocol/http/Http3Session.h @@ -119,7 +119,7 @@ enum class EchExtensionStatus { class Http3Session final : public nsAHttpTransaction, public nsAHttpConnection { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTTP3SESSION_IID) + NS_INLINE_DECL_STATIC_IID(NS_HTTP3SESSION_IID) NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSAHTTPTRANSACTION @@ -387,8 +387,6 @@ class Http3Session final : public nsAHttpTransaction, public nsAHttpConnection { nsIUDPSocket* mSocket; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Http3Session, NS_HTTP3SESSION_IID); - } // namespace mozilla::net #endif // Http3Session_H__ diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h index ddea30d95641..afbd0cb3cf46 100644 --- a/netwerk/protocol/http/HttpBaseChannel.h +++ b/netwerk/protocol/http/HttpBaseChannel.h @@ -120,7 +120,7 @@ class HttpBaseChannel : public nsHashPropertyBag, NS_DECL_NSITHROTTLEDINPUTCHANNEL NS_DECL_NSICLASSIFIEDCHANNEL - NS_DECLARE_STATIC_IID_ACCESSOR(HTTP_BASE_CHANNEL_IID) + NS_INLINE_DECL_STATIC_IID(HTTP_BASE_CHANNEL_IID) HttpBaseChannel(); @@ -658,8 +658,7 @@ class HttpBaseChannel : public nsHashPropertyBag, // Helper function to simplify getting notification callbacks. template void GetCallback(nsCOMPtr& aResult) { - NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, - NS_GET_TEMPLATE_IID(T), + NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, NS_GET_IID(T), getter_AddRefs(aResult)); } @@ -1123,8 +1122,6 @@ class HttpBaseChannel : public nsHashPropertyBag, bool PerformCORSCheck(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(HttpBaseChannel, HTTP_BASE_CHANNEL_IID) - // Share some code while working around C++'s absurd inability to handle casting // of member functions between base/derived types. // - We want to store member function pointer to call at resume time, but one diff --git a/netwerk/protocol/http/HttpChannelChild.h b/netwerk/protocol/http/HttpChannelChild.h index c952065b91b9..8a50f4d9e8a9 100644 --- a/netwerk/protocol/http/HttpChannelChild.h +++ b/netwerk/protocol/http/HttpChannelChild.h @@ -38,12 +38,8 @@ class nsISerialEventTarget; class nsITransportSecurityInfo; class nsInputStreamPump; -#define HTTP_CHANNEL_CHILD_IID \ - { \ - 0x321bd99e, 0x2242, 0x4dc6, { \ - 0xbb, 0xec, 0xd5, 0x06, 0x29, 0x7c, 0x39, 0x83 \ - } \ - } +#define HTTP_CHANNEL_CHILD_IID \ + {0x321bd99e, 0x2242, 0x4dc6, {0xbb, 0xec, 0xd5, 0x06, 0x29, 0x7c, 0x39, 0x83}} namespace mozilla::net { @@ -71,7 +67,7 @@ class HttpChannelChild final : public PHttpChannelChild, NS_DECL_NSIHTTPCHANNELCHILD NS_DECL_NSIMULTIPARTCHANNEL NS_DECL_NSITHREADRETARGETABLEREQUEST - NS_DECLARE_STATIC_IID_ACCESSOR(HTTP_CHANNEL_CHILD_IID) + NS_INLINE_DECL_STATIC_IID(HTTP_CHANNEL_CHILD_IID) HttpChannelChild(); @@ -472,8 +468,6 @@ class HttpChannelChild final : public PHttpChannelChild, friend class NeckoTargetChannelFunctionEvent; }; -NS_DEFINE_STATIC_IID_ACCESSOR(HttpChannelChild, HTTP_CHANNEL_CHILD_IID) - //----------------------------------------------------------------------------- // inline functions //----------------------------------------------------------------------------- diff --git a/netwerk/protocol/http/HttpChannelParent.h b/netwerk/protocol/http/HttpChannelParent.h index 6155ed6e9c02..40fd97b4f712 100644 --- a/netwerk/protocol/http/HttpChannelParent.h +++ b/netwerk/protocol/http/HttpChannelParent.h @@ -64,7 +64,7 @@ class HttpChannelParent final : public nsIInterfaceRequestor, NS_DECL_NSIREDIRECTRESULTLISTENER NS_DECL_NSIMULTIPARTCHANNELLISTENER - NS_DECLARE_STATIC_IID_ACCESSOR(HTTP_CHANNEL_PARENT_IID) + NS_INLINE_DECL_STATIC_IID(HTTP_CHANNEL_PARENT_IID) HttpChannelParent(dom::BrowserParent* iframeEmbedding, nsILoadContext* aLoadContext, @@ -321,8 +321,6 @@ class HttpChannelParent final : public nsIInterfaceRequestor, uint8_t mDataSentToChildProcess : 1; }; -NS_DEFINE_STATIC_IID_ACCESSOR(HttpChannelParent, HTTP_CHANNEL_PARENT_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/HttpConnectionBase.h b/netwerk/protocol/http/HttpConnectionBase.h index b23f9f327735..cbc03a255390 100644 --- a/netwerk/protocol/http/HttpConnectionBase.h +++ b/netwerk/protocol/http/HttpConnectionBase.h @@ -64,7 +64,7 @@ MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ConnectionExperienceState); class HttpConnectionBase : public nsSupportsWeakReference { public: - NS_DECLARE_STATIC_IID_ACCESSOR(HTTPCONNECTIONBASE_IID) + NS_INLINE_DECL_STATIC_IID(HTTPCONNECTIONBASE_IID) HttpConnectionBase(); @@ -200,8 +200,6 @@ class HttpConnectionBase : public nsSupportsWeakReference { ConnectionCloseReason mCloseReason = ConnectionCloseReason::UNSET; }; -NS_DEFINE_STATIC_IID_ACCESSOR(HttpConnectionBase, HTTPCONNECTIONBASE_IID) - #define NS_DECL_HTTPCONNECTIONBASE \ [[nodiscard]] nsresult Activate(nsAHttpTransaction*, uint32_t, int32_t) \ override; \ diff --git a/netwerk/protocol/http/HttpConnectionMgrShell.h b/netwerk/protocol/http/HttpConnectionMgrShell.h index 8d88f67f4eb8..40bbd080880e 100644 --- a/netwerk/protocol/http/HttpConnectionMgrShell.h +++ b/netwerk/protocol/http/HttpConnectionMgrShell.h @@ -33,7 +33,7 @@ class ClassOfService; class HttpConnectionMgrShell : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(HTTPCONNECTIONMGRSHELL_IID) + NS_INLINE_DECL_STATIC_IID(HTTPCONNECTIONMGRSHELL_IID) enum nsParamName : uint32_t { MAX_URGENT_START_Q, @@ -166,9 +166,6 @@ class HttpConnectionMgrShell : public nsISupports { virtual HttpConnectionMgrParent* AsHttpConnectionMgrParent() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(HttpConnectionMgrShell, - HTTPCONNECTIONMGRSHELL_IID) - #define NS_DECL_HTTPCONNECTIONMGRSHELL \ virtual nsresult Init( \ uint16_t maxUrgentExcessiveConns, uint16_t maxConnections, \ diff --git a/netwerk/protocol/http/HttpConnectionUDP.h b/netwerk/protocol/http/HttpConnectionUDP.h index e727d0bae75f..ab702664ebbd 100644 --- a/netwerk/protocol/http/HttpConnectionUDP.h +++ b/netwerk/protocol/http/HttpConnectionUDP.h @@ -53,7 +53,7 @@ class HttpConnectionUDP final : public HttpConnectionBase, virtual ~HttpConnectionUDP(); public: - NS_DECLARE_STATIC_IID_ACCESSOR(HTTPCONNECTIONUDP_IID) + NS_INLINE_DECL_STATIC_IID(HTTPCONNECTIONUDP_IID) NS_DECL_HTTPCONNECTIONBASE NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIUDPSOCKETSYNCLISTENER @@ -128,8 +128,6 @@ class HttpConnectionUDP final : public HttpConnectionBase, nsCString mAlpnToken; }; -NS_DEFINE_STATIC_IID_ACCESSOR(HttpConnectionUDP, HTTPCONNECTIONUDP_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/HttpTransactionParent.h b/netwerk/protocol/http/HttpTransactionParent.h index 529d85242ddd..4249852495fb 100644 --- a/netwerk/protocol/http/HttpTransactionParent.h +++ b/netwerk/protocol/http/HttpTransactionParent.h @@ -37,7 +37,7 @@ class HttpTransactionParent final : public PHttpTransactionParent, NS_DECL_HTTPTRANSACTIONSHELL NS_DECL_NSIREQUEST NS_DECL_NSITHREADRETARGETABLEREQUEST - NS_DECLARE_STATIC_IID_ACCESSOR(HTTP_TRANSACTION_PARENT_IID) + NS_INLINE_DECL_STATIC_IID(HTTP_TRANSACTION_PARENT_IID) explicit HttpTransactionParent(bool aIsDocumentLoad); @@ -185,9 +185,6 @@ class HttpTransactionParent final : public PHttpTransactionParent, bool mSupportsHTTP3 = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(HttpTransactionParent, - HTTP_TRANSACTION_PARENT_IID) - } // namespace mozilla::net #endif // nsHttpTransactionParent_h__ diff --git a/netwerk/protocol/http/HttpTransactionShell.h b/netwerk/protocol/http/HttpTransactionShell.h index a47b035c5d85..38dfb7df0d0b 100644 --- a/netwerk/protocol/http/HttpTransactionShell.h +++ b/netwerk/protocol/http/HttpTransactionShell.h @@ -46,7 +46,7 @@ union NetAddr; class HttpTransactionShell : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(HTTPTRANSACTIONSHELL_IID) + NS_INLINE_DECL_STATIC_IID(HTTPTRANSACTIONSHELL_IID) using TransactionObserverFunc = std::function; @@ -173,8 +173,6 @@ class HttpTransactionShell : public nsISupports { virtual TimeStamp GetOnStopRequestStartTime() const { return TimeStamp(); } }; -NS_DEFINE_STATIC_IID_ACCESSOR(HttpTransactionShell, HTTPTRANSACTIONSHELL_IID) - #define NS_DECL_HTTPTRANSACTIONSHELL \ virtual nsresult Init( \ uint32_t caps, nsHttpConnectionInfo* connInfo, \ diff --git a/netwerk/protocol/http/NullHttpTransaction.h b/netwerk/protocol/http/NullHttpTransaction.h index cedbc6fd638c..3c9ed06c6709 100644 --- a/netwerk/protocol/http/NullHttpTransaction.h +++ b/netwerk/protocol/http/NullHttpTransaction.h @@ -26,16 +26,12 @@ class nsHttpConnectionInfo; class nsHttpRequestHead; // 6c445340-3b82-4345-8efa-4902c3b8805a -#define NS_NULLHTTPTRANSACTION_IID \ - { \ - 0x6c445340, 0x3b82, 0x4345, { \ - 0x8e, 0xfa, 0x49, 0x02, 0xc3, 0xb8, 0x80, 0x5a \ - } \ - } +#define NS_NULLHTTPTRANSACTION_IID \ + {0x6c445340, 0x3b82, 0x4345, {0x8e, 0xfa, 0x49, 0x02, 0xc3, 0xb8, 0x80, 0x5a}} class NullHttpTransaction : public nsAHttpTransaction { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_NULLHTTPTRANSACTION_IID) + NS_INLINE_DECL_STATIC_IID(NS_NULLHTTPTRANSACTION_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPTRANSACTION @@ -86,8 +82,6 @@ class NullHttpTransaction : public nsAHttpTransaction { nsCOMPtr mActivityDistributor; }; -NS_DEFINE_STATIC_IID_ACCESSOR(NullHttpTransaction, NS_NULLHTTPTRANSACTION_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/ParentChannelListener.h b/netwerk/protocol/http/ParentChannelListener.h index cd0fbfeadb53..d072150e45af 100644 --- a/netwerk/protocol/http/ParentChannelListener.h +++ b/netwerk/protocol/http/ParentChannelListener.h @@ -19,12 +19,8 @@ namespace mozilla { namespace net { -#define PARENT_CHANNEL_LISTENER \ - { \ - 0xa4e2c10c, 0xceba, 0x457f, { \ - 0xa8, 0x0d, 0x78, 0x2b, 0x23, 0xba, 0xbd, 0x16 \ - } \ - } +#define PARENT_CHANNEL_LISTENER \ + {0xa4e2c10c, 0xceba, 0x457f, {0xa8, 0x0d, 0x78, 0x2b, 0x23, 0xba, 0xbd, 0x16}} class ParentChannelListener final : public nsIInterfaceRequestor, public nsIMultiPartChannelListener, @@ -41,7 +37,7 @@ class ParentChannelListener final : public nsIInterfaceRequestor, NS_DECL_NSIAUTHPROMPTPROVIDER NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER - NS_DECLARE_STATIC_IID_ACCESSOR(PARENT_CHANNEL_LISTENER) + NS_INLINE_DECL_STATIC_IID(PARENT_CHANNEL_LISTENER) explicit ParentChannelListener( nsIStreamListener* aListener, @@ -74,8 +70,6 @@ class ParentChannelListener final : public nsIInterfaceRequestor, bool mIsMultiPart = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ParentChannelListener, PARENT_CHANNEL_LISTENER) - inline nsISupports* ToSupports(ParentChannelListener* aDoc) { return static_cast(aDoc); } diff --git a/netwerk/protocol/http/QuicSocketControl.h b/netwerk/protocol/http/QuicSocketControl.h index 891ee8caafde..ffec6d76f9c6 100644 --- a/netwerk/protocol/http/QuicSocketControl.h +++ b/netwerk/protocol/http/QuicSocketControl.h @@ -16,16 +16,12 @@ namespace net { class Http3Session; // IID for the QuicSocketControl interface -#define NS_QUICSOCKETCONTROL_IID \ - { \ - 0xdbc67fd0, 0x1ac6, 0x457b, { \ - 0x91, 0x4e, 0x4c, 0x86, 0x60, 0xff, 0x00, 0x69 \ - } \ - } +#define NS_QUICSOCKETCONTROL_IID \ + {0xdbc67fd0, 0x1ac6, 0x457b, {0x91, 0x4e, 0x4c, 0x86, 0x60, 0xff, 0x00, 0x69}} class QuicSocketControl final : public CommonSocketControl { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_QUICSOCKETCONTROL_IID); + NS_INLINE_DECL_STATIC_IID(NS_QUICSOCKETCONTROL_IID); NS_INLINE_DECL_REFCOUNTING_INHERITED(QuicSocketControl, CommonSocketControl); @@ -60,8 +56,6 @@ class QuicSocketControl final : public CommonSocketControl { nsCString mRetryEchConfig; }; -NS_DEFINE_STATIC_IID_ACCESSOR(QuicSocketControl, NS_QUICSOCKETCONTROL_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/TLSTransportLayer.h b/netwerk/protocol/http/TLSTransportLayer.h index 85489ffa40e2..cf15430132bf 100644 --- a/netwerk/protocol/http/TLSTransportLayer.h +++ b/netwerk/protocol/http/TLSTransportLayer.h @@ -37,18 +37,14 @@ namespace mozilla::net { // nsSocketOutputStream::Write // 9d6a3bc6-1f90-41d0-9b02-33ccd169052b -#define NS_TLSTRANSPORTLAYER_IID \ - { \ - 0x9d6a3bc6, 0x1f90, 0x41d0, { \ - 0x9b, 0x02, 0x33, 0xcc, 0xd1, 0x69, 0x05, 0x2b \ - } \ - } +#define NS_TLSTRANSPORTLAYER_IID \ + {0x9d6a3bc6, 0x1f90, 0x41d0, {0x9b, 0x02, 0x33, 0xcc, 0xd1, 0x69, 0x05, 0x2b}} class TLSTransportLayer final : public nsISocketTransport, public nsIInputStreamCallback, public nsIOutputStreamCallback { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_TLSTRANSPORTLAYER_IID) + NS_INLINE_DECL_STATIC_IID(NS_TLSTRANSPORTLAYER_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITRANSPORT NS_DECL_NSISOCKETTRANSPORT @@ -159,8 +155,6 @@ class TLSTransportLayer final : public nsISocketTransport, nsCOMPtr mOwner; }; -NS_DEFINE_STATIC_IID_ACCESSOR(TLSTransportLayer, NS_TLSTRANSPORTLAYER_IID) - } // namespace mozilla::net inline nsISupports* ToSupports(mozilla::net::TLSTransportLayer* aTransport) { diff --git a/netwerk/protocol/http/TRRServiceChannel.h b/netwerk/protocol/http/TRRServiceChannel.h index 8366d931344a..22990756996a 100644 --- a/netwerk/protocol/http/TRRServiceChannel.h +++ b/netwerk/protocol/http/TRRServiceChannel.h @@ -45,7 +45,7 @@ class TRRServiceChannel : public HttpBaseChannel, NS_DECL_NSITRANSPORTEVENTSINK NS_DECL_NSIPROXIEDCHANNEL NS_DECL_NSIPROTOCOLPROXYCALLBACK - NS_DECLARE_STATIC_IID_ACCESSOR(NS_TRRSERVICECHANNEL_IID) + NS_INLINE_DECL_STATIC_IID(NS_TRRSERVICECHANNEL_IID) // nsIRequest NS_IMETHOD SetCanceledReason(const nsACString& aReason) override; @@ -167,8 +167,6 @@ class TRRServiceChannel : public HttpBaseChannel, friend class nsHttpHandler; }; -NS_DEFINE_STATIC_IID_ACCESSOR(TRRServiceChannel, NS_TRRSERVICECHANNEL_IID) - } // namespace mozilla::net #endif // mozilla_net_TRRServiceChannel_h diff --git a/netwerk/protocol/http/nsAHttpConnection.h b/netwerk/protocol/http/nsAHttpConnection.h index a235b25bf629..24c00f949eb1 100644 --- a/netwerk/protocol/http/nsAHttpConnection.h +++ b/netwerk/protocol/http/nsAHttpConnection.h @@ -36,7 +36,7 @@ class nsHttpResponseHead; class nsAHttpConnection : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_AHTTPCONNECTION_IID) + NS_INLINE_DECL_STATIC_IID(NS_AHTTPCONNECTION_IID) NS_DECL_THREADSAFE_ISUPPORTS @@ -180,8 +180,6 @@ class nsAHttpConnection : public nsISupports { virtual ~nsAHttpConnection(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsAHttpConnection, NS_AHTTPCONNECTION_IID) - #define NS_DECL_NSAHTTPCONNECTION(fwdObject) \ [[nodiscard]] nsresult OnHeadersAvailable( \ nsAHttpTransaction*, nsHttpRequestHead*, nsHttpResponseHead*, \ diff --git a/netwerk/protocol/http/nsAHttpTransaction.h b/netwerk/protocol/http/nsAHttpTransaction.h index 83da79a47402..20501da5349e 100644 --- a/netwerk/protocol/http/nsAHttpTransaction.h +++ b/netwerk/protocol/http/nsAHttpTransaction.h @@ -53,7 +53,7 @@ enum class ExtendedCONNECTSupport { UNSURE, NO_SUPPORT, SUPPORTED }; class nsAHttpTransaction : public nsSupportsWeakReference { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_AHTTPTRANSACTION_IID) + NS_INLINE_DECL_STATIC_IID(NS_AHTTPTRANSACTION_IID) // called by the connection when it takes ownership of the transaction. virtual void SetConnection(nsAHttpConnection*) = 0; @@ -231,8 +231,6 @@ class nsAHttpTransaction : public nsSupportsWeakReference { virtual void SetResettingForTunnelConn(bool aValue) {} }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsAHttpTransaction, NS_AHTTPTRANSACTION_IID) - #define NS_DECL_NSAHTTPTRANSACTION \ void SetConnection(nsAHttpConnection*) override; \ nsAHttpConnection* Connection() override; \ diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h index f6dd7bbea05a..fb16e050efea 100644 --- a/netwerk/protocol/http/nsHttpChannel.h +++ b/netwerk/protocol/http/nsHttpChannel.h @@ -89,7 +89,7 @@ class nsHttpChannel final : public HttpBaseChannel, NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK NS_DECL_NSITHREADRETARGETABLEREQUEST NS_DECL_NSIDNSLISTENER - NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTTPCHANNEL_IID) + NS_INLINE_DECL_STATIC_IID(NS_HTTPCHANNEL_IID) NS_DECL_NSIRACECACHEWITHNETWORK NS_DECL_NSIREQUESTTAILUNBLOCKCALLBACK NS_DECL_NSIEARLYHINTOBSERVER @@ -857,7 +857,6 @@ class nsHttpChannel final : public HttpBaseChannel, nsMainThreadPtrHandle mOverrideResponse; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsHttpChannel, NS_HTTPCHANNEL_IID) } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/nsHttpConnection.h b/netwerk/protocol/http/nsHttpConnection.h index ad2b1cd7790a..0ef186dd0db8 100644 --- a/netwerk/protocol/http/nsHttpConnection.h +++ b/netwerk/protocol/http/nsHttpConnection.h @@ -59,7 +59,7 @@ class nsHttpConnection final : public HttpConnectionBase, virtual ~nsHttpConnection(); public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTTPCONNECTION_IID) + NS_INLINE_DECL_STATIC_IID(NS_HTTPCONNECTION_IID) NS_DECL_HTTPCONNECTIONBASE NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSAHTTPSEGMENTREADER @@ -380,8 +380,6 @@ class nsHttpConnection final : public HttpConnectionBase, bool mTransactionDisallowHttp3{false}; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsHttpConnection, NS_HTTPCONNECTION_IID) - } // namespace net } // namespace mozilla diff --git a/netwerk/protocol/http/nsICorsPreflightCallback.h b/netwerk/protocol/http/nsICorsPreflightCallback.h index aa16dbf12d03..6491ffc68e70 100644 --- a/netwerk/protocol/http/nsICorsPreflightCallback.h +++ b/netwerk/protocol/http/nsICorsPreflightCallback.h @@ -11,21 +11,14 @@ #include "nsID.h" #include "nsError.h" -#define NS_ICORSPREFLIGHTCALLBACK_IID \ - { \ - 0x3758cfbb, 0x259f, 0x4074, { \ - 0xa8, 0xc0, 0x98, 0xe0, 0x4b, 0x3c, 0xc0, 0xe3 \ - } \ - } +#define NS_ICORSPREFLIGHTCALLBACK_IID \ + {0x3758cfbb, 0x259f, 0x4074, {0xa8, 0xc0, 0x98, 0xe0, 0x4b, 0x3c, 0xc0, 0xe3}} class nsICorsPreflightCallback : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(nsICorsPreflightCallback); + NS_INLINE_DECL_STATIC_IID(NS_ICORSPREFLIGHTCALLBACK_IID); NS_IMETHOD OnPreflightSucceeded() = 0; NS_IMETHOD OnPreflightFailed(nsresult aError) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsICorsPreflightCallback, - NS_ICORSPREFLIGHTCALLBACK_IID); - #endif diff --git a/netwerk/protocol/res/SubstitutingJARURI.h b/netwerk/protocol/res/SubstitutingJARURI.h index 85976d490849..fa3b0d00cff6 100644 --- a/netwerk/protocol/res/SubstitutingJARURI.h +++ b/netwerk/protocol/res/SubstitutingJARURI.h @@ -15,12 +15,12 @@ namespace mozilla { namespace net { -#define NS_SUBSTITUTINGJARURI_IMPL_CID \ - { /* 8f8c54ed-aba7-4ebf-ba6f-e58aec0aba4c */ \ - 0x8f8c54ed, 0xaba7, 0x4ebf, { \ - 0xba, 0x6f, 0xe5, 0x8a, 0xec, 0x0a, 0xba, 0x4c \ - } \ - } +#define NS_SUBSTITUTINGJARURI_IMPL_CID \ + {/* 8f8c54ed-aba7-4ebf-ba6f-e58aec0aba4c */ \ + 0x8f8c54ed, \ + 0xaba7, \ + 0x4ebf, \ + {0xba, 0x6f, 0xe5, 0x8a, 0xec, 0x0a, 0xba, 0x4c}} // Provides a Substituting URI for resource://-like substitutions which // allows consumers to access the underlying jar resource. @@ -44,7 +44,7 @@ class SubstitutingJARURI : public nsIJARURI, NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISERIALIZABLE - NS_DECLARE_STATIC_IID_ACCESSOR(NS_SUBSTITUTINGJARURI_IMPL_CID) + NS_INLINE_DECL_STATIC_IID(NS_SUBSTITUTINGJARURI_IMPL_CID) NS_FORWARD_SAFE_NSIURL(mSource) NS_FORWARD_SAFE_NSIJARURI(mResolved) @@ -220,9 +220,6 @@ class SubstitutingJARURI : public nsIJARURI, friend BaseURIMutator; }; -NS_DEFINE_STATIC_IID_ACCESSOR(SubstitutingJARURI, - NS_SUBSTITUTINGJARURI_IMPL_CID) - } // namespace net } // namespace mozilla diff --git a/parser/htmlparser/nsIContentSink.h b/parser/htmlparser/nsIContentSink.h index 863cefa1247d..5c95c6f2dbf0 100644 --- a/parser/htmlparser/nsIContentSink.h +++ b/parser/htmlparser/nsIContentSink.h @@ -38,7 +38,7 @@ class nsIContentSink : public nsISupports { using NotNull = mozilla::NotNull; public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENT_SINK_IID) + NS_INLINE_DECL_STATIC_IID(NS_ICONTENT_SINK_IID) /** * This method is called by the parser when it is entered from @@ -136,6 +136,4 @@ class nsIContentSink : public nsISupports { virtual void InitialTranslationCompleted() {} }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentSink, NS_ICONTENT_SINK_IID) - #endif /* nsIContentSink_h___ */ diff --git a/parser/htmlparser/nsIDTD.h b/parser/htmlparser/nsIDTD.h index 67f7af4ec2a2..e41a075614bc 100644 --- a/parser/htmlparser/nsIDTD.h +++ b/parser/htmlparser/nsIDTD.h @@ -24,12 +24,8 @@ #include "nsISupports.h" #include "nsString.h" -#define NS_IDTD_IID \ - { \ - 0x3de05873, 0xefa7, 0x410d, { \ - 0xa4, 0x61, 0x80, 0x33, 0xaf, 0xd9, 0xe3, 0x26 \ - } \ - } +#define NS_IDTD_IID \ + {0x3de05873, 0xefa7, 0x410d, {0xa4, 0x61, 0x80, 0x33, 0xaf, 0xd9, 0xe3, 0x26}} enum eAutoDetectResult { eUnknownDetect, @@ -47,7 +43,7 @@ class CParserContext; class nsIDTD : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDTD_IID) + NS_INLINE_DECL_STATIC_IID(NS_IDTD_IID) /** * Called by the parser after the parsing process has concluded @@ -79,8 +75,6 @@ class nsIDTD : public nsISupports { NS_IMETHOD_(void) Terminate() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDTD, NS_IDTD_IID) - #define NS_DECL_NSIDTD \ void DidBuildModel() override; \ NS_IMETHOD BuildModel(nsIContentSink* aSink) override; \ diff --git a/parser/htmlparser/nsIFragmentContentSink.h b/parser/htmlparser/nsIFragmentContentSink.h index 351963cfa3a5..7319401d463d 100644 --- a/parser/htmlparser/nsIFragmentContentSink.h +++ b/parser/htmlparser/nsIFragmentContentSink.h @@ -14,12 +14,8 @@ class DocumentFragment; } // namespace dom } // namespace mozilla -#define NS_I_FRAGMENT_CONTENT_SINK_IID \ - { \ - 0x1a8ce30b, 0x63fc, 0x441a, { \ - 0xa3, 0xaa, 0xf7, 0x16, 0xc0, 0xfe, 0x96, 0x69 \ - } \ - } +#define NS_I_FRAGMENT_CONTENT_SINK_IID \ + {0x1a8ce30b, 0x63fc, 0x441a, {0xa3, 0xaa, 0xf7, 0x16, 0xc0, 0xfe, 0x96, 0x69}} /** * The fragment sink allows a client to parse a fragment of sink, possibly @@ -29,7 +25,7 @@ class DocumentFragment; */ class nsIFragmentContentSink : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_I_FRAGMENT_CONTENT_SINK_IID) + NS_INLINE_DECL_STATIC_IID(NS_I_FRAGMENT_CONTENT_SINK_IID) /** * This method is used to obtain the fragment created by * a fragment content sink and to release resources held by the parser. @@ -76,9 +72,6 @@ class nsIFragmentContentSink : public nsISupports { NS_IMETHOD SetPreventScriptExecution(bool aPreventScriptExecution) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIFragmentContentSink, - NS_I_FRAGMENT_CONTENT_SINK_IID) - nsresult NS_NewXMLFragmentContentSink( nsIFragmentContentSink** aInstancePtrResult); diff --git a/parser/htmlparser/nsIHTMLContentSink.h b/parser/htmlparser/nsIHTMLContentSink.h index 3e81d5d77090..27538ad84f49 100644 --- a/parser/htmlparser/nsIHTMLContentSink.h +++ b/parser/htmlparser/nsIHTMLContentSink.h @@ -52,12 +52,8 @@ #include "nsIContentSink.h" #include "nsHTMLTags.h" -#define NS_IHTML_CONTENT_SINK_IID \ - { \ - 0xefc5af86, 0x5cfd, 0x4918, { \ - 0x9d, 0xd3, 0x5f, 0x7a, 0xb2, 0x88, 0xb2, 0x68 \ - } \ - } +#define NS_IHTML_CONTENT_SINK_IID \ + {0xefc5af86, 0x5cfd, 0x4918, {0x9d, 0xd3, 0x5f, 0x7a, 0xb2, 0x88, 0xb2, 0x68}} /** * This interface is OBSOLETE and in the process of being REMOVED. @@ -65,7 +61,7 @@ */ class nsIHTMLContentSink : public nsIContentSink { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTML_CONTENT_SINK_IID) + NS_INLINE_DECL_STATIC_IID(NS_IHTML_CONTENT_SINK_IID) enum ElementType { eHTML, eBody }; @@ -91,6 +87,4 @@ class nsIHTMLContentSink : public nsIContentSink { virtual bool WaitForPendingSheets() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLContentSink, NS_IHTML_CONTENT_SINK_IID) - #endif /* nsIHTMLContentSink_h___ */ diff --git a/parser/htmlparser/nsIParser.h b/parser/htmlparser/nsIParser.h index 8cf3940ffb57..30ab712e98c2 100644 --- a/parser/htmlparser/nsIParser.h +++ b/parser/htmlparser/nsIParser.h @@ -26,12 +26,8 @@ #include "nsParserBase.h" #include "mozilla/NotNull.h" -#define NS_IPARSER_IID \ - { \ - 0x2c4ad90a, 0x740e, 0x4212, { \ - 0xba, 0x3f, 0xfe, 0xac, 0xda, 0x4b, 0x92, 0x9e \ - } \ - } +#define NS_IPARSER_IID \ + {0x2c4ad90a, 0x740e, 0x4212, {0xba, 0x3f, 0xfe, 0xac, 0xda, 0x4b, 0x92, 0x9e}} class nsIContentSink; class nsIRequestObserver; @@ -64,7 +60,7 @@ class nsIParser : public nsParserBase { using NotNull = mozilla::NotNull; public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPARSER_IID) + NS_INLINE_DECL_STATIC_IID(NS_IPARSER_IID) /** * Select given content sink into parser for parser output @@ -181,6 +177,4 @@ class nsIParser : public nsParserBase { virtual bool IsScriptCreated() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIParser, NS_IPARSER_IID) - #endif diff --git a/storage/IStorageBindingParamsInternal.h b/storage/IStorageBindingParamsInternal.h index a056ae326980..4df6e4032538 100644 --- a/storage/IStorageBindingParamsInternal.h +++ b/storage/IStorageBindingParamsInternal.h @@ -15,12 +15,8 @@ class mozIStorageError; namespace mozilla { namespace storage { -#define ISTORAGEBINDINGPARAMSINTERNAL_IID \ - { \ - 0x4c43d33a, 0xc620, 0x41b8, { \ - 0xba, 0x1d, 0x50, 0xc5, 0xb1, 0xe9, 0x1a, 0x04 \ - } \ - } +#define ISTORAGEBINDINGPARAMSINTERNAL_IID \ + {0x4c43d33a, 0xc620, 0x41b8, {0xba, 0x1d, 0x50, 0xc5, 0xb1, 0xe9, 0x1a, 0x04}} /** * Implementation-only interface for mozIStorageBindingParams. This defines the @@ -29,7 +25,7 @@ namespace storage { */ class IStorageBindingParamsInternal : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(ISTORAGEBINDINGPARAMSINTERNAL_IID) + NS_INLINE_DECL_STATIC_IID(ISTORAGEBINDINGPARAMSINTERNAL_IID) /** * Binds our stored data to the statement. @@ -42,9 +38,6 @@ class IStorageBindingParamsInternal : public nsISupports { virtual already_AddRefed bind(sqlite3_stmt* aStatement) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(IStorageBindingParamsInternal, - ISTORAGEBINDINGPARAMSINTERNAL_IID) - #define NS_DECL_ISTORAGEBINDINGPARAMSINTERNAL \ already_AddRefed bind(sqlite3_stmt* aStatement) override; diff --git a/storage/StorageBaseStatementInternal.h b/storage/StorageBaseStatementInternal.h index f88539d6075a..447f11d4423e 100644 --- a/storage/StorageBaseStatementInternal.h +++ b/storage/StorageBaseStatementInternal.h @@ -21,12 +21,8 @@ class mozIStoragePendingStatement; namespace mozilla { namespace storage { -#define STORAGEBASESTATEMENTINTERNAL_IID \ - { \ - 0xd18856c9, 0xbf07, 0x4ae2, { \ - 0x94, 0x5b, 0x1a, 0xdd, 0x49, 0x19, 0x55, 0x2a \ - } \ - } +#define STORAGEBASESTATEMENTINTERNAL_IID \ + {0xd18856c9, 0xbf07, 0x4ae2, {0x94, 0x5b, 0x1a, 0xdd, 0x49, 0x19, 0x55, 0x2a}} class Connection; class StatementData; @@ -45,7 +41,7 @@ class AsyncStatementFinalizer; */ class StorageBaseStatementInternal : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(STORAGEBASESTATEMENTINTERNAL_IID) + NS_INLINE_DECL_STATIC_IID(STORAGEBASESTATEMENTINTERNAL_IID) /** * @return the connection that this statement belongs to. @@ -147,9 +143,6 @@ class StorageBaseStatementInternal : public nsISupports { friend class AsyncStatementFinalizer; }; -NS_DEFINE_STATIC_IID_ACCESSOR(StorageBaseStatementInternal, - STORAGEBASESTATEMENTINTERNAL_IID) - #define NS_DECL_STORAGEBASESTATEMENTINTERNAL \ virtual Connection* getOwner(); \ virtual int getAsyncStatement(sqlite3_stmt** _stmt) override; \ @@ -288,7 +281,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(StorageBaseStatementInternal, BIND_GEN_IMPL( \ _class, _optionalGuard, AdoptedBlob, \ (const nsACString& aWhere, uint8_t* aValue, uint32_t aValueSize), \ - (uint32_t aWhere, uint8_t * aValue, uint32_t aValueSize), \ + (uint32_t aWhere, uint8_t* aValue, uint32_t aValueSize), \ (aWhere, aValue, aValueSize)) \ BIND_GEN_IMPL(_class, _optionalGuard, ArrayOfIntegers, \ (const nsACString& aWhere, const nsTArray& aValue), \ diff --git a/storage/Variant.h b/storage/Variant.h index 23ae7f4db271..98f72a8c6763 100644 --- a/storage/Variant.h +++ b/storage/Variant.h @@ -12,12 +12,12 @@ #include "nsCOMPtr.h" #include "nsString.h" -#define VARIANT_BASE_IID \ - { /* 78888042-0fa3-4f7a-8b19-7996f99bf1aa */ \ - 0x78888042, 0x0fa3, 0x4f7a, { \ - 0x8b, 0x19, 0x79, 0x96, 0xf9, 0x9b, 0xf1, 0xaa \ - } \ - } +#define VARIANT_BASE_IID \ + {/* 78888042-0fa3-4f7a-8b19-7996f99bf1aa */ \ + 0x78888042, \ + 0x0fa3, \ + 0x4f7a, \ + {0x8b, 0x19, 0x79, 0x96, 0xf9, 0x9b, 0xf1, 0xaa}} /** * This class is used by the storage module whenever an nsIVariant needs to be @@ -50,7 +50,7 @@ class Variant_base : public nsIVariant, public nsIInterfaceRequestor { public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIVARIANT - NS_DECLARE_STATIC_IID_ACCESSOR(VARIANT_BASE_IID) + NS_INLINE_DECL_STATIC_IID(VARIANT_BASE_IID) NS_IMETHOD GetInterface(const nsIID& aIID, void** aResult) override { @@ -72,8 +72,6 @@ class Variant_base : public nsIVariant, public nsIInterfaceRequestor { virtual ~Variant_base() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Variant_base, VARIANT_BASE_IID) - //////////////////////////////////////////////////////////////////////////////// //// Traits diff --git a/toolkit/components/contentanalysis/ContentAnalysis.h b/toolkit/components/contentanalysis/ContentAnalysis.h index 397a3c298453..336bfbbe0f9b 100644 --- a/toolkit/components/contentanalysis/ContentAnalysis.h +++ b/toolkit/components/contentanalysis/ContentAnalysis.h @@ -189,7 +189,7 @@ class ContentAnalysis final : public nsIContentAnalysis, public nsIObserver, public SupportsWeakPtr { public: - NS_DECLARE_STATIC_IID_ACCESSOR(CONTENTANALYSIS_IID) + NS_INLINE_DECL_STATIC_IID(CONTENTANALYSIS_IID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSICONTENTANALYSIS NS_DECL_NSIOBSERVER @@ -504,8 +504,6 @@ class ContentAnalysis final : public nsIContentAnalysis, friend class ::ContentAnalysisTest; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ContentAnalysis, CONTENTANALYSIS_IID) - class ContentAnalysisResponse final : public nsIContentAnalysisResponse { public: NS_DECL_ISUPPORTS diff --git a/toolkit/components/extensions/webrequest/ChannelWrapper.h b/toolkit/components/extensions/webrequest/ChannelWrapper.h index 494fcc5925af..18a7a3580294 100644 --- a/toolkit/components/extensions/webrequest/ChannelWrapper.h +++ b/toolkit/components/extensions/webrequest/ChannelWrapper.h @@ -34,12 +34,8 @@ #include "nsIWeakReferenceUtils.h" #include "nsWrapperCache.h" -#define NS_CHANNELWRAPPER_IID \ - { \ - 0xc06162d2, 0xb803, 0x43b4, { \ - 0xaa, 0x31, 0xcf, 0x69, 0x7f, 0x93, 0x68, 0x1c \ - } \ - } +#define NS_CHANNELWRAPPER_IID \ + {0xc06162d2, 0xb803, 0x43b4, {0xaa, 0x31, 0xcf, 0x69, 0x7f, 0x93, 0x68, 0x1c}} class nsILoadContext; class nsITraceableChannel; @@ -123,7 +119,7 @@ class ChannelWrapper final : public DOMEventTargetHelper, NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ChannelWrapper, DOMEventTargetHelper) - NS_DECLARE_STATIC_IID_ACCESSOR(NS_CHANNELWRAPPER_IID) + NS_INLINE_DECL_STATIC_IID(NS_CHANNELWRAPPER_IID) void Die(); @@ -353,8 +349,6 @@ class ChannelWrapper final : public DOMEventTargetHelper, }; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ChannelWrapper, NS_CHANNELWRAPPER_IID) - } // namespace extensions } // namespace mozilla diff --git a/toolkit/components/places/nsNavHistoryQuery.h b/toolkit/components/places/nsNavHistoryQuery.h index 3f170a44ce04..2cfdb4f0ca01 100644 --- a/toolkit/components/places/nsNavHistoryQuery.h +++ b/toolkit/components/places/nsNavHistoryQuery.h @@ -19,19 +19,15 @@ #include "mozilla/Attributes.h" -#define NS_NAVHISTORYQUERY_IID \ - { \ - 0xb10185e0, 0x86eb, 0x4612, { \ - 0x95, 0x7c, 0x09, 0x34, 0xf2, 0xb1, 0xce, 0xd7 \ - } \ - } +#define NS_NAVHISTORYQUERY_IID \ + {0xb10185e0, 0x86eb, 0x4612, {0x95, 0x7c, 0x09, 0x34, 0xf2, 0xb1, 0xce, 0xd7}} class nsNavHistoryQuery final : public nsINavHistoryQuery { public: nsNavHistoryQuery(); nsNavHistoryQuery(const nsNavHistoryQuery& aOther); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYQUERY_IID) + NS_INLINE_DECL_STATIC_IID(NS_NAVHISTORYQUERY_IID) NS_DECL_ISUPPORTS NS_DECL_NSINAVHISTORYQUERY @@ -81,23 +77,17 @@ class nsNavHistoryQuery final : public nsINavHistoryQuery { nsTArray mTransitions; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryQuery, NS_NAVHISTORYQUERY_IID) - // nsNavHistoryQueryOptions -#define NS_NAVHISTORYQUERYOPTIONS_IID \ - { \ - 0x95f8ba3b, 0xd681, 0x4d89, { \ - 0xab, 0xd1, 0xfd, 0xae, 0xf2, 0xa3, 0xde, 0x18 \ - } \ - } +#define NS_NAVHISTORYQUERYOPTIONS_IID \ + {0x95f8ba3b, 0xd681, 0x4d89, {0xab, 0xd1, 0xfd, 0xae, 0xf2, 0xa3, 0xde, 0x18}} class nsNavHistoryQueryOptions final : public nsINavHistoryQueryOptions { public: nsNavHistoryQueryOptions(); nsNavHistoryQueryOptions(const nsNavHistoryQueryOptions& other); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYQUERYOPTIONS_IID) + NS_INLINE_DECL_STATIC_IID(NS_NAVHISTORYQUERYOPTIONS_IID) NS_DECL_ISUPPORTS NS_DECL_NSINAVHISTORYQUERYOPTIONS @@ -135,7 +125,4 @@ class nsNavHistoryQueryOptions final : public nsINavHistoryQueryOptions { bool mAsyncEnabled; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryQueryOptions, - NS_NAVHISTORYQUERYOPTIONS_IID) - #endif // nsNavHistoryQuery_h_ diff --git a/toolkit/components/places/nsNavHistoryResult.h b/toolkit/components/places/nsNavHistoryResult.h index a61bc8db2402..0c1548c902a3 100644 --- a/toolkit/components/places/nsNavHistoryResult.h +++ b/toolkit/components/places/nsNavHistoryResult.h @@ -68,19 +68,15 @@ class nsTrimInt64HashKey : public PLDHashEntryHdr { // it through GetTopLevel()). Then FilledAllResults() is called to finish // object initialization. -#define NS_NAVHISTORYRESULT_IID \ - { \ - 0x455d1d40, 0x1b9b, 0x40e6, { \ - 0xa6, 0x41, 0x8b, 0xb7, 0xe8, 0x82, 0x23, 0x87 \ - } \ - } +#define NS_NAVHISTORYRESULT_IID \ + {0x455d1d40, 0x1b9b, 0x40e6, {0xa6, 0x41, 0x8b, 0xb7, 0xe8, 0x82, 0x23, 0x87}} class nsNavHistoryResult final : public nsSupportsWeakReference, public nsINavHistoryResult, public mozilla::places::INativePlacesEventCallback { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYRESULT_IID) + NS_INLINE_DECL_STATIC_IID(NS_NAVHISTORYRESULT_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_NSINAVHISTORYRESULT @@ -195,20 +191,14 @@ class nsNavHistoryResult final void StopObservingOnUnlink(); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryResult, NS_NAVHISTORYRESULT_IID) - // nsNavHistoryResultNode // // This is the base class for every node in a result set. The result itself // is a node (nsNavHistoryResult inherits from this), as well as every // leaf and branch on the tree. -#define NS_NAVHISTORYRESULTNODE_IID \ - { \ - 0x54b61d38, 0x57c1, 0x11da, { \ - 0x95, 0xb8, 0x00, 0x13, 0x21, 0xc9, 0xf6, 0x9e \ - } \ - } +#define NS_NAVHISTORYRESULTNODE_IID \ + {0x54b61d38, 0x57c1, 0x11da, {0x95, 0xb8, 0x00, 0x13, 0x21, 0xc9, 0xf6, 0x9e}} // These are all the simple getters, they can be used for the result node // implementation and all subclasses. More complex are GetIcon, GetParent @@ -289,7 +279,7 @@ class nsNavHistoryResultNode : public nsINavHistoryResultNode { nsNavHistoryResultNode(const nsACString& aURI, const nsACString& aTitle, uint32_t aAccessCount, PRTime aTime); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYRESULTNODE_IID) + NS_INLINE_DECL_STATIC_IID(NS_NAVHISTORYRESULTNODE_IID) NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(nsNavHistoryResultNode) @@ -413,9 +403,6 @@ class nsNavHistoryResultNode : public nsINavHistoryResultNode { nsCString mBookmarkGuid; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryResultNode, - NS_NAVHISTORYRESULTNODE_IID) - // nsNavHistoryContainerResultNode // // This is the base class for all nodes that can have children. It is @@ -447,12 +434,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryResultNode, return nsNavHistoryContainerResultNode::GetChildIndex(aNode, _retval); \ } -#define NS_NAVHISTORYCONTAINERRESULTNODE_IID \ - { \ - 0x6e3bf8d3, 0x22aa, 0x4065, { \ - 0x86, 0xbc, 0x37, 0x46, 0xb5, 0xb3, 0x2c, 0xe8 \ - } \ - } +#define NS_NAVHISTORYCONTAINERRESULTNODE_IID \ + {0x6e3bf8d3, 0x22aa, 0x4065, {0x86, 0xbc, 0x37, 0x46, 0xb5, 0xb3, 0x2c, 0xe8}} class nsNavHistoryContainerResultNode : public nsNavHistoryResultNode, @@ -465,7 +448,7 @@ class nsNavHistoryContainerResultNode virtual nsresult Refresh(); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYCONTAINERRESULTNODE_IID) + NS_INLINE_DECL_STATIC_IID(NS_NAVHISTORYCONTAINERRESULTNODE_IID) NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsNavHistoryContainerResultNode, @@ -619,9 +602,6 @@ class nsNavHistoryContainerResultNode AsyncCanceledState mAsyncCanceledState; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryContainerResultNode, - NS_NAVHISTORYCONTAINERRESULTNODE_IID) - // nsNavHistoryQueryResultNode // // Overridden container type for complex queries over history and/or diff --git a/toolkit/components/sessionstore/SessionStoreListener.h b/toolkit/components/sessionstore/SessionStoreListener.h index 1b671ed0284b..8b77825c618d 100644 --- a/toolkit/components/sessionstore/SessionStoreListener.h +++ b/toolkit/components/sessionstore/SessionStoreListener.h @@ -70,7 +70,7 @@ class TabListener : public nsIDOMEventListener, public nsIWebProgressListener, public nsSupportsWeakReference { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_TABLISTENER_IID) + NS_INLINE_DECL_STATIC_IID(NS_TABLISTENER_IID) explicit TabListener(nsIDocShell* aDocShell, Element* aElement); EventTarget* GetEventTarget(); @@ -116,8 +116,6 @@ class TabListener : public nsIDOMEventListener, uint32_t mEpoch; }; -NS_DEFINE_STATIC_IID_ACCESSOR(TabListener, NS_TABLISTENER_IID) - } // namespace mozilla::dom #endif // mozilla_dom_SessionStoreListener_h diff --git a/toolkit/components/sessionstore/SessionStoreRestoreData.h b/toolkit/components/sessionstore/SessionStoreRestoreData.h index 4952045e9d5d..65021aba28ca 100644 --- a/toolkit/components/sessionstore/SessionStoreRestoreData.h +++ b/toolkit/components/sessionstore/SessionStoreRestoreData.h @@ -13,12 +13,8 @@ namespace mozilla::dom { -#define NS_SESSIONSTORERESTOREDATA_IID \ - { \ - 0x88800c5b, 0xe142, 0x4ac6, { \ - 0x91, 0x52, 0xca, 0xbd, 0x3b, 0x74, 0xb9, 0xf8 \ - } \ - } +#define NS_SESSIONSTORERESTOREDATA_IID \ + {0x88800c5b, 0xe142, 0x4ac6, {0x91, 0x52, 0xca, 0xbd, 0x3b, 0x74, 0xb9, 0xf8}} class SessionStoreRestoreData final : public nsISessionStoreRestoreData { public: @@ -30,7 +26,7 @@ class SessionStoreRestoreData final : public nsISessionStoreRestoreData { NS_DECL_ISUPPORTS NS_DECL_NSISESSIONSTORERESTOREDATA - NS_DECLARE_STATIC_IID_ACCESSOR(NS_SESSIONSTORERESTOREDATA_IID) + NS_INLINE_DECL_STATIC_IID(NS_SESSIONSTORERESTOREDATA_IID) struct Entry { sessionstore::FormEntry mData; @@ -51,9 +47,6 @@ class SessionStoreRestoreData final : public nsISessionStoreRestoreData { friend struct mozilla::ipc::IPDLParamTraits; }; -NS_DEFINE_STATIC_IID_ACCESSOR(SessionStoreRestoreData, - NS_SESSIONSTORERESTOREDATA_IID) - } // namespace mozilla::dom #endif diff --git a/toolkit/components/telemetry/core/Stopwatch.cpp b/toolkit/components/telemetry/core/Stopwatch.cpp index 6a19c8661389..c2b36372fd3b 100644 --- a/toolkit/components/telemetry/core/Stopwatch.cpp +++ b/toolkit/components/telemetry/core/Stopwatch.cpp @@ -109,7 +109,7 @@ class Timer final : public mozilla::LinkedListElement> { class TimerKeys final : public nsISupports { public: NS_DECL_ISUPPORTS - NS_DECLARE_STATIC_IID_ACCESSOR(TIMER_KEYS_IID) + NS_INLINE_DECL_STATIC_IID(TIMER_KEYS_IID) Timer* Get(const nsAString& aKey, bool aCreate = true); @@ -127,8 +127,6 @@ class TimerKeys final : public nsISupports { nsRefPtrHashtable mTimers; }; -NS_DEFINE_STATIC_IID_ACCESSOR(TimerKeys, TIMER_KEYS_IID) - NS_IMPL_ISUPPORTS(TimerKeys, TimerKeys) Timer* TimerKeys::Get(const nsAString& aKey, bool aCreate) { diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.h b/toolkit/components/url-classifier/nsUrlClassifierDBService.h index dae363982c93..d26e54d900f7 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.h +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.h @@ -78,7 +78,7 @@ class nsUrlClassifierDBService final : public nsIUrlClassifierDBService, static already_AddRefed GetInstance( nsresult* result); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_URLCLASSIFIERDBSERVICE_CID) + NS_INLINE_DECL_STATIC_IID(NS_URLCLASSIFIERDBSERVICE_CID) NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIURLCLASSIFIERDBSERVICE @@ -273,7 +273,4 @@ class nsUrlClassifierDBServiceWorker final : public nsIUrlClassifierDBService { nsTArray mPendingLookups; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsUrlClassifierDBService, - NS_URLCLASSIFIERDBSERVICE_CID) - #endif // nsUrlClassifierDBService_h_ diff --git a/uriloader/base/nsDocLoader.h b/uriloader/base/nsDocLoader.h index 1aaf212e412b..d4f9aa3b0df4 100644 --- a/uriloader/base/nsDocLoader.h +++ b/uriloader/base/nsDocLoader.h @@ -39,12 +39,12 @@ class BrowsingContext; * nsDocLoader implementation... ****************************************************************************/ -#define NS_THIS_DOCLOADER_IMPL_CID \ - { /* b4ec8387-98aa-4c08-93b6-6d23069c06f2 */ \ - 0xb4ec8387, 0x98aa, 0x4c08, { \ - 0x93, 0xb6, 0x6d, 0x23, 0x06, 0x9c, 0x06, 0xf2 \ - } \ - } +#define NS_THIS_DOCLOADER_IMPL_CID \ + {/* b4ec8387-98aa-4c08-93b6-6d23069c06f2 */ \ + 0xb4ec8387, \ + 0x98aa, \ + 0x4c08, \ + {0x93, 0xb6, 0x6d, 0x23, 0x06, 0x9c, 0x06, 0xf2}} class nsDocLoader : public nsIDocumentLoader, public nsIRequestObserver, @@ -55,7 +55,7 @@ class nsDocLoader : public nsIDocumentLoader, public nsIChannelEventSink, public nsISupportsPriority { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_THIS_DOCLOADER_IMPL_CID) + NS_INLINE_DECL_STATIC_IID(NS_THIS_DOCLOADER_IMPL_CID) nsDocLoader() : nsDocLoader(false) {} @@ -376,8 +376,6 @@ class nsDocLoader : public nsIDocumentLoader, nsAString& aRetVal); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsDocLoader, NS_THIS_DOCLOADER_IMPL_CID) - static inline nsISupports* ToSupports(nsDocLoader* aDocLoader) { return static_cast(aDocLoader); } diff --git a/uriloader/exthandler/ExternalHelperAppParent.h b/uriloader/exthandler/ExternalHelperAppParent.h index 2f9096c2383a..fba9bb2cad61 100644 --- a/uriloader/exthandler/ExternalHelperAppParent.h +++ b/uriloader/exthandler/ExternalHelperAppParent.h @@ -30,16 +30,12 @@ class PChannelDiverterParent; namespace dom { -#define NS_IEXTERNALHELPERAPPPARENT_IID \ - { \ - 0x127a01bc, 0x2a49, 0x46a8, { \ - 0x8c, 0x63, 0x4b, 0x5d, 0x3c, 0xa4, 0x07, 0x9c \ - } \ - } +#define NS_IEXTERNALHELPERAPPPARENT_IID \ + {0x127a01bc, 0x2a49, 0x46a8, {0x8c, 0x63, 0x4b, 0x5d, 0x3c, 0xa4, 0x07, 0x9c}} class nsIExternalHelperAppParent : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEXTERNALHELPERAPPPARENT_IID) + NS_INLINE_DECL_STATIC_IID(NS_IEXTERNALHELPERAPPPARENT_IID) /** * Returns true if this fake channel represented a file channel in the child. @@ -47,9 +43,6 @@ class nsIExternalHelperAppParent : public nsISupports { virtual bool WasFileChannel() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIExternalHelperAppParent, - NS_IEXTERNALHELPERAPPPARENT_IID) - class ContentParent; class PBrowserParent; diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h index 2dd4ff87bda3..68f240c9f928 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.h +++ b/uriloader/exthandler/nsExternalHelperAppService.h @@ -39,12 +39,8 @@ class nsITransfer; class nsIPrincipal; class MaybeCloseWindowHelper; -#define EXTERNAL_APP_HANDLER_IID \ - { \ - 0x50eb7479, 0x71ff, 0x4ef8, { \ - 0xb3, 0x1e, 0x3b, 0x59, 0xc8, 0xab, 0xb9, 0x24 \ - } \ - } +#define EXTERNAL_APP_HANDLER_IID \ + {0x50eb7479, 0x71ff, 0x4ef8, {0xb3, 0x1e, 0x3b, 0x59, 0xc8, 0xab, 0xb9, 0x24}} /** * The helper app service. Responsible for handling content that Mozilla @@ -281,7 +277,7 @@ class nsExternalAppHandler final : public nsIStreamListener, NS_DECL_NSIBACKGROUNDFILESAVEROBSERVER NS_DECL_NSINAMED - NS_DECLARE_STATIC_IID_ACCESSOR(EXTERNAL_APP_HANDLER_IID) + NS_INLINE_DECL_STATIC_IID(EXTERNAL_APP_HANDLER_IID) /** * @param aMIMEInfo MIMEInfo object, representing the type of the @@ -559,6 +555,5 @@ class nsExternalAppHandler final : public nsIStreamListener, RefPtr mExtProtSvc; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsExternalAppHandler, EXTERNAL_APP_HANDLER_IID) #endif // nsExternalHelperAppService_h__ diff --git a/widget/TextEventDispatcherListener.h b/widget/TextEventDispatcherListener.h index cd846c6d3851..8ef407891a16 100644 --- a/widget/TextEventDispatcherListener.h +++ b/widget/TextEventDispatcherListener.h @@ -22,7 +22,7 @@ struct IMENotificationRequests; class TextEventDispatcherListener : public nsSupportsWeakReference { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_TEXT_INPUT_PROXY_LISTENER_IID) + NS_INLINE_DECL_STATIC_IID(NS_TEXT_INPUT_PROXY_LISTENER_IID) /** * NotifyIME() is called by TextEventDispatcher::NotifyIME(). This is a @@ -86,9 +86,6 @@ class TextEventDispatcherListener : public nsSupportsWeakReference { uint32_t aIndexOfKeypress, void* aData) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(TextEventDispatcherListener, - NS_TEXT_INPUT_PROXY_LISTENER_IID) - } // namespace widget } // namespace mozilla diff --git a/widget/cocoa/nsPrintDialogX.h b/widget/cocoa/nsPrintDialogX.h index 9c4b55647bef..d8f0ff8d3d3f 100644 --- a/widget/cocoa/nsPrintDialogX.h +++ b/widget/cocoa/nsPrintDialogX.h @@ -57,6 +57,4 @@ class nsPrintDialogServiceX final : public nsIPrintDialogService { @end -NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintDialogServiceX, NS_IPRINTDIALOGSERVICE_IID) - #endif // nsPrintDialog_h_ diff --git a/widget/cocoa/nsPrintSettingsX.h b/widget/cocoa/nsPrintSettingsX.h index e771df25b0df..1d62c7c89f39 100644 --- a/widget/cocoa/nsPrintSettingsX.h +++ b/widget/cocoa/nsPrintSettingsX.h @@ -20,7 +20,7 @@ class nsPrintSettingsX : public nsPrintSettings { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSX_IID) + NS_INLINE_DECL_STATIC_IID(NS_PRINTSETTINGSX_IID) NS_DECL_ISUPPORTS_INHERITED nsPrintSettingsX(); @@ -101,6 +101,4 @@ class nsPrintSettingsX : public nsPrintSettings { NSPrintInfo* mSystemPrintInfo = nullptr; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintSettingsX, NS_PRINTSETTINGSX_IID) - #endif // nsPrintSettingsX_h_ diff --git a/widget/gtk/nsPrintDialogGTK.h b/widget/gtk/nsPrintDialogGTK.h index 43889628587a..2f9b89b96e6c 100644 --- a/widget/gtk/nsPrintDialogGTK.h +++ b/widget/gtk/nsPrintDialogGTK.h @@ -29,7 +29,4 @@ class nsPrintDialogServiceGTK final : public nsIPrintDialogService { NS_DECL_NSIPRINTDIALOGSERVICE }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintDialogServiceGTK, - NS_IPRINTDIALOGSERVICE_IID) - #endif diff --git a/widget/gtk/nsPrintSettingsGTK.h b/widget/gtk/nsPrintSettingsGTK.h index c2d97a62083c..fd15048b83f4 100644 --- a/widget/gtk/nsPrintSettingsGTK.h +++ b/widget/gtk/nsPrintSettingsGTK.h @@ -14,12 +14,8 @@ extern "C" { #include } -#define NS_PRINTSETTINGSGTK_IID \ - { \ - 0x758df520, 0xc7c3, 0x11dc, { \ - 0x95, 0xff, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 \ - } \ - } +#define NS_PRINTSETTINGSGTK_IID \ + {0x758df520, 0xc7c3, 0x11dc, {0x95, 0xff, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66}} //***************************************************************************** //*** nsPrintSettingsGTK @@ -28,7 +24,7 @@ extern "C" { class nsPrintSettingsGTK : public nsPrintSettings { public: NS_DECL_ISUPPORTS_INHERITED - NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSGTK_IID) + NS_INLINE_DECL_STATIC_IID(NS_PRINTSETTINGSGTK_IID) nsPrintSettingsGTK(); explicit nsPrintSettingsGTK(const PrintSettingsInitializer& aSettings); @@ -142,6 +138,4 @@ class nsPrintSettingsGTK : public nsPrintSettings { GtkPrinter* mGTKPrinter; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintSettingsGTK, NS_PRINTSETTINGSGTK_IID) - #endif // nsPrintSettingsGTK_h_ diff --git a/widget/nsClipboardProxy.h b/widget/nsClipboardProxy.h index 33b47d90bb51..e2d0e4da454e 100644 --- a/widget/nsClipboardProxy.h +++ b/widget/nsClipboardProxy.h @@ -9,12 +9,8 @@ #include "mozilla/dom/PContent.h" #include "nsIClipboard.h" -#define NS_CLIPBOARDPROXY_IID \ - { \ - 0xa64c82da, 0x7326, 0x4681, { \ - 0xa0, 0x95, 0x81, 0x2c, 0xc9, 0x86, 0xe6, 0xde \ - } \ - } +#define NS_CLIPBOARDPROXY_IID \ + {0xa64c82da, 0x7326, 0x4681, {0xa0, 0x95, 0x81, 0x2c, 0xc9, 0x86, 0xe6, 0xde}} // Hack for ContentChild to be able to know that we're an nsClipboardProxy. class nsIClipboardProxy : public nsIClipboard { @@ -22,13 +18,11 @@ class nsIClipboardProxy : public nsIClipboard { typedef mozilla::dom::ClipboardCapabilities ClipboardCapabilities; public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_CLIPBOARDPROXY_IID) + NS_INLINE_DECL_STATIC_IID(NS_CLIPBOARDPROXY_IID) virtual void SetCapabilities(const ClipboardCapabilities& aClipboardCaps) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIClipboardProxy, NS_CLIPBOARDPROXY_IID) - class nsClipboardProxy final : public nsIClipboardProxy { public: NS_DECL_ISUPPORTS diff --git a/widget/nsIDeviceContextSpec.h b/widget/nsIDeviceContextSpec.h index 33ebaecd6214..42c13633d74a 100644 --- a/widget/nsIDeviceContextSpec.h +++ b/widget/nsIDeviceContextSpec.h @@ -23,19 +23,15 @@ class PrintTarget; } // namespace gfx } // namespace mozilla -#define NS_IDEVICE_CONTEXT_SPEC_IID \ - { \ - 0xf407cfba, 0xbe28, 0x46c9, { \ - 0x8a, 0xba, 0x04, 0x2d, 0xae, 0xbb, 0x4f, 0x23 \ - } \ - } +#define NS_IDEVICE_CONTEXT_SPEC_IID \ + {0xf407cfba, 0xbe28, 0x46c9, {0x8a, 0xba, 0x04, 0x2d, 0xae, 0xbb, 0x4f, 0x23}} class nsIDeviceContextSpec : public nsISupports { public: typedef mozilla::gfx::PrintTarget PrintTarget; using IntSize = mozilla::gfx::IntSize; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDEVICE_CONTEXT_SPEC_IID) + NS_INLINE_DECL_STATIC_IID(NS_IDEVICE_CONTEXT_SPEC_IID) /** * Initialize the device context spec. @@ -107,5 +103,4 @@ class nsIDeviceContextSpec : public nsISupports { #endif }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDeviceContextSpec, NS_IDEVICE_CONTEXT_SPEC_IID) #endif diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 2b0baf108e6d..e56f99dd6679 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -391,7 +391,7 @@ class nsIWidget : public nsISupports { : mType(aType), mRect(aRect) {} }; - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWIDGET_IID) + NS_INLINE_DECL_STATIC_IID(NS_IWIDGET_IID) nsIWidget() = default; @@ -2098,6 +2098,4 @@ class nsIWidget : public nsISupports { WidgetType mWidgetType = WidgetType::Native; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIWidget, NS_IWIDGET_IID) - #endif // nsIWidget_h__ diff --git a/widget/uikit/nsWindow.h b/widget/uikit/nsWindow.h index 5affb97f3ef1..e6d1a6a0f0a8 100644 --- a/widget/uikit/nsWindow.h +++ b/widget/uikit/nsWindow.h @@ -25,18 +25,14 @@ class EventDispatcher; class TextInputHandler; } // namespace mozilla::widget -#define NS_WINDOW_IID \ - { \ - 0x5e6fd559, 0xb3f9, 0x40c9, { \ - 0x92, 0xd1, 0xef, 0x80, 0xb4, 0xf9, 0x69, 0xe9 \ - } \ - } +#define NS_WINDOW_IID \ + {0x5e6fd559, 0xb3f9, 0x40c9, {0x92, 0xd1, 0xef, 0x80, 0xb4, 0xf9, 0x69, 0xe9}} class nsWindow final : public nsBaseWidget { public: nsWindow(); - NS_DECLARE_STATIC_IID_ACCESSOR(NS_WINDOW_IID) + NS_INLINE_DECL_STATIC_IID(NS_WINDOW_IID) NS_DECL_ISUPPORTS_INHERITED @@ -147,6 +143,4 @@ class nsWindow final : public nsBaseWidget { static void LogWindow(nsWindow* win, int index, int indent); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsWindow, NS_WINDOW_IID) - #endif /* NSWINDOW_H_ */ diff --git a/widget/windows/nsPrintDialogWin.h b/widget/windows/nsPrintDialogWin.h index bb8f212eb5bb..ad77bc84b35c 100644 --- a/widget/windows/nsPrintDialogWin.h +++ b/widget/windows/nsPrintDialogWin.h @@ -33,7 +33,4 @@ class nsPrintDialogServiceWin final : public nsIPrintDialogService { nsCOMPtr mWatcher; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsPrintDialogServiceWin, - NS_IPRINTDIALOGSERVICE_IID) - #endif diff --git a/xpcom/base/nsCOMPtr.h b/xpcom/base/nsCOMPtr.h index d45209d5aa23..c58eb92ea157 100644 --- a/xpcom/base/nsCOMPtr.h +++ b/xpcom/base/nsCOMPtr.h @@ -27,8 +27,8 @@ #include "mozilla/Attributes.h" #include "mozilla/RefPtr.h" #include "nsCycleCollectionNoteChild.h" -#include "nsDebug.h" // for |NS_ASSERTION| -#include "nsISupportsUtils.h" // for |nsresult|, |NS_ADDREF|, |NS_GET_TEMPLATE_IID| et al +#include "nsDebug.h" // for |NS_ASSERTION| +#include "nsISupportsUtils.h" // for |nsresult|, |NS_ADDREF|, |NS_GET_IID| et al /* * WARNING: This file defines several macros for internal use only. These @@ -290,7 +290,7 @@ class MOZ_STACK_CLASS nsQueryReferent final { // Helper for assert_validity method template -char (&TestForIID(decltype(&NS_GET_TEMPLATE_IID(T))))[2]; +char (&TestForIID(decltype(&NS_GET_IID(T))))[2]; template char TestForIID(...); @@ -330,8 +330,8 @@ class MOZ_IS_REFPTR nsCOMPtr final { static_assert(1 < sizeof(TestForIID(nullptr)), "nsCOMPtr only works " "for types with IIDs. Either use RefPtr; add an IID to " - "your type with NS_DECLARE_STATIC_IID_ACCESSOR/" - "NS_DEFINE_STATIC_IID_ACCESSOR; or make the nsCOMPtr point " + "your type with NS_INLINE_DECL_STATIC_IID/ ;" + "or make the nsCOMPtr point " "to a base class with an IID."); } @@ -358,7 +358,7 @@ class MOZ_IS_REFPTR nsCOMPtr final { // This can't be defined in terms of do_QueryInterface because // that bans casts from a class to itself. void* out = nullptr; - mRawPtr->QueryInterface(NS_GET_TEMPLATE_IID(T), &out); + mRawPtr->QueryInterface(NS_GET_IID(T), &out); T* query_result = static_cast(out); MOZ_ASSERT(query_result == mRawPtr, "QueryInterface needed"); NS_RELEASE(query_result); @@ -479,7 +479,7 @@ class MOZ_IS_REFPTR nsCOMPtr final { MOZ_IMPLICIT nsCOMPtr(const nsQueryInterface aQI) : mRawPtr(nullptr) { assert_validity(); NSCAP_LOG_ASSIGNMENT(this, nullptr); - assign_from_qi(aQI, NS_GET_TEMPLATE_IID(T)); + assign_from_qi(aQI, NS_GET_IID(T)); } // Construct from |do_QueryInterface(expr, &rv)|. @@ -488,14 +488,14 @@ class MOZ_IS_REFPTR nsCOMPtr final { : mRawPtr(nullptr) { assert_validity(); NSCAP_LOG_ASSIGNMENT(this, nullptr); - assign_from_qi_with_error(aQI, NS_GET_TEMPLATE_IID(T)); + assign_from_qi_with_error(aQI, NS_GET_IID(T)); } // Construct from |do_GetService(cid_expr)|. MOZ_IMPLICIT nsCOMPtr(const nsGetServiceByCID aGS) : mRawPtr(nullptr) { assert_validity(); NSCAP_LOG_ASSIGNMENT(this, nullptr); - assign_from_gs_cid(aGS, NS_GET_TEMPLATE_IID(T)); + assign_from_gs_cid(aGS, NS_GET_IID(T)); } // Construct from |do_GetService(cid_expr, &rv)|. @@ -503,14 +503,14 @@ class MOZ_IS_REFPTR nsCOMPtr final { : mRawPtr(nullptr) { assert_validity(); NSCAP_LOG_ASSIGNMENT(this, nullptr); - assign_from_gs_cid_with_error(aGS, NS_GET_TEMPLATE_IID(T)); + assign_from_gs_cid_with_error(aGS, NS_GET_IID(T)); } // Construct from |do_GetService(contractid_expr)|. MOZ_IMPLICIT nsCOMPtr(const nsGetServiceByContractID aGS) : mRawPtr(nullptr) { assert_validity(); NSCAP_LOG_ASSIGNMENT(this, nullptr); - assign_from_gs_contractid(aGS, NS_GET_TEMPLATE_IID(T)); + assign_from_gs_contractid(aGS, NS_GET_IID(T)); } // Construct from |do_GetService(contractid_expr, &rv)|. @@ -518,7 +518,7 @@ class MOZ_IS_REFPTR nsCOMPtr final { : mRawPtr(nullptr) { assert_validity(); NSCAP_LOG_ASSIGNMENT(this, nullptr); - assign_from_gs_contractid_with_error(aGS, NS_GET_TEMPLATE_IID(T)); + assign_from_gs_contractid_with_error(aGS, NS_GET_IID(T)); } // Construct from |do_QueryReferent(ptr)| @@ -526,7 +526,7 @@ class MOZ_IS_REFPTR nsCOMPtr final { : mRawPtr(nullptr) { assert_validity(); NSCAP_LOG_ASSIGNMENT(this, nullptr); - assign_from_query_referent(aQueryReferent, NS_GET_TEMPLATE_IID(T)); + assign_from_query_referent(aQueryReferent, NS_GET_IID(T)); } // And finally, anything else we might need to construct from can exploit the @@ -534,7 +534,7 @@ class MOZ_IS_REFPTR nsCOMPtr final { MOZ_IMPLICIT nsCOMPtr(const nsCOMPtr_helper& aHelper) : mRawPtr(nullptr) { assert_validity(); NSCAP_LOG_ASSIGNMENT(this, nullptr); - assign_from_helper(aHelper, NS_GET_TEMPLATE_IID(T)); + assign_from_helper(aHelper, NS_GET_IID(T)); NSCAP_ASSERT_NO_QUERY_NEEDED(); } @@ -631,51 +631,51 @@ class MOZ_IS_REFPTR nsCOMPtr final { // Assign from |do_QueryInterface(expr)|. template nsCOMPtr& operator=(const nsQueryInterface aRhs) { - assign_from_qi(aRhs, NS_GET_TEMPLATE_IID(T)); + assign_from_qi(aRhs, NS_GET_IID(T)); return *this; } // Assign from |do_QueryInterface(expr, &rv)|. template nsCOMPtr& operator=(const nsQueryInterfaceWithError& aRhs) { - assign_from_qi_with_error(aRhs, NS_GET_TEMPLATE_IID(T)); + assign_from_qi_with_error(aRhs, NS_GET_IID(T)); return *this; } // Assign from |do_GetService(cid_expr)|. nsCOMPtr& operator=(const nsGetServiceByCID aRhs) { - assign_from_gs_cid(aRhs, NS_GET_TEMPLATE_IID(T)); + assign_from_gs_cid(aRhs, NS_GET_IID(T)); return *this; } // Assign from |do_GetService(cid_expr, &rv)|. nsCOMPtr& operator=(const nsGetServiceByCIDWithError& aRhs) { - assign_from_gs_cid_with_error(aRhs, NS_GET_TEMPLATE_IID(T)); + assign_from_gs_cid_with_error(aRhs, NS_GET_IID(T)); return *this; } // Assign from |do_GetService(contractid_expr)|. nsCOMPtr& operator=(const nsGetServiceByContractID aRhs) { - assign_from_gs_contractid(aRhs, NS_GET_TEMPLATE_IID(T)); + assign_from_gs_contractid(aRhs, NS_GET_IID(T)); return *this; } // Assign from |do_GetService(contractid_expr, &rv)|. nsCOMPtr& operator=(const nsGetServiceByContractIDWithError& aRhs) { - assign_from_gs_contractid_with_error(aRhs, NS_GET_TEMPLATE_IID(T)); + assign_from_gs_contractid_with_error(aRhs, NS_GET_IID(T)); return *this; } // Assign from |do_QueryReferent(ptr)|. nsCOMPtr& operator=(const nsQueryReferent& aRhs) { - assign_from_query_referent(aRhs, NS_GET_TEMPLATE_IID(T)); + assign_from_query_referent(aRhs, NS_GET_IID(T)); return *this; } // And finally, anything else we might need to assign from can exploit the // nsCOMPtr_helper facility. nsCOMPtr& operator=(const nsCOMPtr_helper& aRhs) { - assign_from_helper(aRhs, NS_GET_TEMPLATE_IID(T)); + assign_from_helper(aRhs, NS_GET_IID(T)); NSCAP_ASSERT_NO_QUERY_NEEDED(); return *this; } @@ -1099,7 +1099,7 @@ inline nsresult CallQueryInterface(nsCOMPtr& aSourcePtr, template RefPtr::RefPtr(const nsQueryReferent& aQueryReferent) { void* newRawPtr; - if (NS_FAILED(aQueryReferent(NS_GET_TEMPLATE_IID(T), &newRawPtr))) { + if (NS_FAILED(aQueryReferent(NS_GET_IID(T), &newRawPtr))) { newRawPtr = nullptr; } mRawPtr = static_cast(newRawPtr); @@ -1108,7 +1108,7 @@ RefPtr::RefPtr(const nsQueryReferent& aQueryReferent) { template RefPtr::RefPtr(const nsCOMPtr_helper& aHelper) { void* newRawPtr; - if (NS_FAILED(aHelper(NS_GET_TEMPLATE_IID(T), &newRawPtr))) { + if (NS_FAILED(aHelper(NS_GET_IID(T), &newRawPtr))) { newRawPtr = nullptr; } mRawPtr = static_cast(newRawPtr); @@ -1117,7 +1117,7 @@ RefPtr::RefPtr(const nsCOMPtr_helper& aHelper) { template RefPtr& RefPtr::operator=(const nsQueryReferent& aQueryReferent) { void* newRawPtr; - if (NS_FAILED(aQueryReferent(NS_GET_TEMPLATE_IID(T), &newRawPtr))) { + if (NS_FAILED(aQueryReferent(NS_GET_IID(T), &newRawPtr))) { newRawPtr = nullptr; } assign_assuming_AddRef(static_cast(newRawPtr)); @@ -1127,7 +1127,7 @@ RefPtr& RefPtr::operator=(const nsQueryReferent& aQueryReferent) { template RefPtr& RefPtr::operator=(const nsCOMPtr_helper& aHelper) { void* newRawPtr; - if (NS_FAILED(aHelper(NS_GET_TEMPLATE_IID(T), &newRawPtr))) { + if (NS_FAILED(aHelper(NS_GET_IID(T), &newRawPtr))) { newRawPtr = nullptr; } assign_assuming_AddRef(static_cast(newRawPtr)); diff --git a/xpcom/base/nsCycleCollectionParticipant.h b/xpcom/base/nsCycleCollectionParticipant.h index 88812c7e8230..b0c480d7d0a0 100644 --- a/xpcom/base/nsCycleCollectionParticipant.h +++ b/xpcom/base/nsCycleCollectionParticipant.h @@ -118,12 +118,9 @@ static inline const char* CCReasonToString(CCReason aReason) { */ class nsCycleCollectionISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_CYCLECOLLECTIONISUPPORTS_IID) + NS_INLINE_DECL_STATIC_IID(NS_CYCLECOLLECTIONISUPPORTS_IID) }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionISupports, - NS_CYCLECOLLECTIONISUPPORTS_IID) - class nsCycleCollectionTraversalCallback; class nsISupports; class nsWrapperCache; @@ -450,7 +447,7 @@ class NS_NO_VTABLE nsXPCOMCycleCollectionParticipant constexpr explicit nsXPCOMCycleCollectionParticipant(Flags aFlags) : nsScriptObjectTracer(aFlags) {} - NS_DECLARE_STATIC_IID_ACCESSOR(NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID) + NS_INLINE_DECL_STATIC_IID(NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID) NS_IMETHOD_(void) Root(void* aPtr) override; NS_IMETHOD_(void) Unroot(void* aPtr) override; @@ -461,9 +458,6 @@ class NS_NO_VTABLE nsXPCOMCycleCollectionParticipant static bool CheckForRightISupports(nsISupports* aSupports); }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCOMCycleCollectionParticipant, - NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID) - /////////////////////////////////////////////////////////////////////////////// // Helpers for implementing a QI to nsXPCOMCycleCollectionParticipant /////////////////////////////////////////////////////////////////////////////// diff --git a/xpcom/base/nsID.h b/xpcom/base/nsID.h index c7feddd1ccfa..dc927469dab2 100644 --- a/xpcom/base/nsID.h +++ b/xpcom/base/nsID.h @@ -138,24 +138,11 @@ typedef nsID nsIID; #define REFNSIID const nsIID& /** - * A macro to build the static const IID accessor method. The Dummy - * template parameter only exists so that the kIID symbol will be linked - * properly (weak symbol on linux, gnu_linkonce on mac, multiple-definitions - * merged on windows). Dummy should always be instantiated as "void". + * A macro to add a static constexpr kIID variable. */ -#define NS_DECLARE_STATIC_IID_ACCESSOR(the_iid) \ - template \ - struct COMTypeInfo; - -#define NS_DEFINE_STATIC_IID_ACCESSOR(the_interface, the_iid) \ - template \ - struct the_interface::COMTypeInfo { \ - static const nsIID kIID NS_HIDDEN; \ - }; \ - template \ - const nsIID the_interface::COMTypeInfo::kIID NS_HIDDEN = \ - the_iid; +#define NS_INLINE_DECL_STATIC_IID(the_iid) \ + static constexpr nsIID kIID NS_HIDDEN = the_iid; /** * A macro to build the static const CID accessor method @@ -163,11 +150,10 @@ typedef nsID nsIID; #define NS_DEFINE_STATIC_CID_ACCESSOR(the_cid) \ static const nsID& GetCID() { \ - static const nsID cid = the_cid; \ + static constexpr nsID cid = the_cid; \ return cid; \ } -#define NS_GET_IID(T) (T::COMTypeInfo::kIID) -#define NS_GET_TEMPLATE_IID(T) (T::template COMTypeInfo::kIID) +#define NS_GET_IID(T) (T::kIID) #endif diff --git a/xpcom/base/nsIInterfaceRequestorUtils.h b/xpcom/base/nsIInterfaceRequestorUtils.h index c3116ea9f297..2d082e416ba5 100644 --- a/xpcom/base/nsIInterfaceRequestorUtils.h +++ b/xpcom/base/nsIInterfaceRequestorUtils.h @@ -16,7 +16,7 @@ inline nsresult CallGetInterface(T* aSource, DestinationType** aDestination) { MOZ_ASSERT(aSource, "null parameter"); MOZ_ASSERT(aDestination, "null parameter"); - return aSource->GetInterface(NS_GET_TEMPLATE_IID(DestinationType), + return aSource->GetInterface(NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } diff --git a/xpcom/base/nsISizeOf.h b/xpcom/base/nsISizeOf.h index 7d0ef4d74f32..99d148dfbb4b 100644 --- a/xpcom/base/nsISizeOf.h +++ b/xpcom/base/nsISizeOf.h @@ -10,16 +10,12 @@ #include "mozilla/MemoryReporting.h" #include "nsISupports.h" -#define NS_ISIZEOF_IID \ - { \ - 0x61d05579, 0xd7ec, 0x485c, { \ - 0xa4, 0x0c, 0x31, 0xc7, 0x9a, 0x5c, 0xf9, 0xf3 \ - } \ - } +#define NS_ISIZEOF_IID \ + {0x61d05579, 0xd7ec, 0x485c, {0xa4, 0x0c, 0x31, 0xc7, 0x9a, 0x5c, 0xf9, 0xf3}} class nsISizeOf : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISIZEOF_IID) + NS_INLINE_DECL_STATIC_IID(NS_ISIZEOF_IID) /** * Measures the size of the things pointed to by the object. @@ -34,6 +30,4 @@ class nsISizeOf : public nsISupports { mozilla::MallocSizeOf aMallocSizeOf) const = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsISizeOf, NS_ISIZEOF_IID) - #endif /* nsISizeOf_h___ */ diff --git a/xpcom/base/nsISupportsImpl.h b/xpcom/base/nsISupportsImpl.h index 476b9921c17d..b9b04598a604 100644 --- a/xpcom/base/nsISupportsImpl.h +++ b/xpcom/base/nsISupportsImpl.h @@ -1075,7 +1075,7 @@ constexpr const nsIID& GetImplementedIID() { "Cannot implement a threadsafe interface with " "non-threadsafe refcounting!"); } - return NS_GET_TEMPLATE_IID(Interface); + return NS_GET_IID(Interface); } template diff --git a/xpcom/base/nsISupportsUtils.h b/xpcom/base/nsISupportsUtils.h index a885c5cb149e..d07d1c1a75c9 100644 --- a/xpcom/base/nsISupportsUtils.h +++ b/xpcom/base/nsISupportsUtils.h @@ -129,7 +129,7 @@ inline nsresult CallQueryInterface(T* aSource, DestinationType** aDestination) { MOZ_ASSERT(aSource, "null parameter"); MOZ_ASSERT(aDestination, "null parameter"); - return aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType), + return aSource->QueryInterface(NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } diff --git a/xpcom/base/nsIWeakReferenceUtils.h b/xpcom/base/nsIWeakReferenceUtils.h index b76303096e33..3df4b0d62462 100644 --- a/xpcom/base/nsIWeakReferenceUtils.h +++ b/xpcom/base/nsIWeakReferenceUtils.h @@ -23,7 +23,7 @@ inline nsresult CallQueryReferent(T* aSource, DestinationType** aDestination) { MOZ_ASSERT(aSource, "null parameter"); MOZ_ASSERT(aDestination, "null parameter"); - return aSource->QueryReferent(NS_GET_TEMPLATE_IID(DestinationType), + return aSource->QueryReferent(NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } diff --git a/xpcom/components/nsComponentManagerUtils.h b/xpcom/components/nsComponentManagerUtils.h index b6f15aabaae0..208c7aa47c8b 100644 --- a/xpcom/components/nsComponentManagerUtils.h +++ b/xpcom/components/nsComponentManagerUtils.h @@ -125,7 +125,7 @@ inline nsresult CallCreateInstance(const nsCID& aClass, DestinationType** aDestination) { MOZ_ASSERT(aDestination, "null parameter"); - return CallCreateInstance(aClass, NS_GET_TEMPLATE_IID(DestinationType), + return CallCreateInstance(aClass, NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } @@ -135,7 +135,7 @@ inline nsresult CallCreateInstance(const char* aContractID, MOZ_ASSERT(aContractID, "null parameter"); MOZ_ASSERT(aDestination, "null parameter"); - return CallCreateInstance(aContractID, NS_GET_TEMPLATE_IID(DestinationType), + return CallCreateInstance(aContractID, NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } @@ -145,7 +145,7 @@ inline nsresult CallCreateInstance(nsIFactory* aFactory, MOZ_ASSERT(aFactory, "null parameter"); MOZ_ASSERT(aDestination, "null parameter"); - return aFactory->CreateInstance(nullptr, NS_GET_TEMPLATE_IID(DestinationType), + return aFactory->CreateInstance(nullptr, NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } @@ -154,7 +154,7 @@ inline nsresult CallGetClassObject(const nsCID& aClass, DestinationType** aDestination) { MOZ_ASSERT(aDestination, "null parameter"); - return CallGetClassObject(aClass, NS_GET_TEMPLATE_IID(DestinationType), + return CallGetClassObject(aClass, NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } @@ -163,7 +163,7 @@ inline nsresult CallGetClassObject(const char* aContractID, DestinationType** aDestination) { MOZ_ASSERT(aDestination, "null parameter"); - return CallGetClassObject(aContractID, NS_GET_TEMPLATE_IID(DestinationType), + return CallGetClassObject(aContractID, NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } diff --git a/xpcom/components/nsServiceManagerUtils.h b/xpcom/components/nsServiceManagerUtils.h index 4bfbc804ccc0..7149362a8630 100644 --- a/xpcom/components/nsServiceManagerUtils.h +++ b/xpcom/components/nsServiceManagerUtils.h @@ -39,7 +39,7 @@ inline nsresult CallGetService(const nsCID& aClass, DestinationType** aDestination) { MOZ_ASSERT(aDestination, "null parameter"); - return CallGetService(aClass, NS_GET_TEMPLATE_IID(DestinationType), + return CallGetService(aClass, NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } @@ -49,7 +49,7 @@ inline nsresult CallGetService(const char* aContractID, MOZ_ASSERT(aContractID, "null parameter"); MOZ_ASSERT(aDestination, "null parameter"); - return CallGetService(aContractID, NS_GET_TEMPLATE_IID(DestinationType), + return CallGetService(aContractID, NS_GET_IID(DestinationType), reinterpret_cast(aDestination)); } diff --git a/xpcom/ds/nsObserverService.h b/xpcom/ds/nsObserverService.h index f4e445995baa..bc69dcdfbcca 100644 --- a/xpcom/ds/nsObserverService.h +++ b/xpcom/ds/nsObserverService.h @@ -14,17 +14,13 @@ #include "mozilla/Attributes.h" // {D07F5195-E3D1-11d2-8ACD-00105A1B8860} -#define NS_OBSERVERSERVICE_CID \ - { \ - 0xd07f5195, 0xe3d1, 0x11d2, { \ - 0x8a, 0xcd, 0x0, 0x10, 0x5a, 0x1b, 0x88, 0x60 \ - } \ - } +#define NS_OBSERVERSERVICE_CID \ + {0xd07f5195, 0xe3d1, 0x11d2, {0x8a, 0xcd, 0x0, 0x10, 0x5a, 0x1b, 0x88, 0x60}} class nsObserverService final : public nsIObserverService, public nsIMemoryReporter { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_OBSERVERSERVICE_CID) + NS_INLINE_DECL_STATIC_IID(NS_OBSERVERSERVICE_CID) nsObserverService(); @@ -51,6 +47,4 @@ class nsObserverService final : public nsIObserverService, nsTHashtable mObserverTopicTable; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsObserverService, NS_OBSERVERSERVICE_CID) - #endif /* nsObserverService_h___ */ diff --git a/xpcom/idl-parser/xpidl/header.py b/xpcom/idl-parser/xpidl/header.py index 5f0cd007655c..011c5d79d8aa 100644 --- a/xpcom/idl-parser/xpidl/header.py +++ b/xpcom/idl-parser/xpidl/header.py @@ -375,7 +375,7 @@ uuid_decoder = re.compile( iface_prolog = """ { public: - NS_DECLARE_STATIC_IID_ACCESSOR(%(defname)s_IID) + NS_INLINE_DECL_STATIC_IID(%(defname)s_IID) """ @@ -386,8 +386,7 @@ iface_scriptable = """\ """ iface_epilog = """}; - - NS_DEFINE_STATIC_IID_ACCESSOR(%(name)s, %(defname)s_IID)""" +""" iface_decl = """ diff --git a/xpcom/tests/gtest/TestCOMArray.cpp b/xpcom/tests/gtest/TestCOMArray.cpp index 9e29e1523014..388689a6d9bc 100644 --- a/xpcom/tests/gtest/TestCOMArray.cpp +++ b/xpcom/tests/gtest/TestCOMArray.cpp @@ -10,23 +10,17 @@ #include "gtest/gtest.h" // {9e70a320-be02-11d1-8031-006008159b5a} -#define NS_IFOO_IID \ - { \ - 0x9e70a320, 0xbe02, 0x11d1, { \ - 0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a \ - } \ - } +#define NS_IFOO_IID \ + {0x9e70a320, 0xbe02, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} class IFoo : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID) + NS_INLINE_DECL_STATIC_IID(NS_IFOO_IID) NS_IMETHOD_(MozExternalRefCountType) RefCnt() = 0; NS_IMETHOD_(int32_t) ID() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(IFoo, NS_IFOO_IID) - class Foo final : public IFoo { ~Foo(); @@ -57,20 +51,14 @@ Foo::~Foo() { --gCount; } NS_IMPL_ISUPPORTS(Foo, IFoo) // {0e70a320-be02-11d1-8031-006008159b5a} -#define NS_IBAR_IID \ - { \ - 0x0e70a320, 0xbe02, 0x11d1, { \ - 0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a \ - } \ - } +#define NS_IBAR_IID \ + {0x0e70a320, 0xbe02, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} class IBar : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBAR_IID) + NS_INLINE_DECL_STATIC_IID(NS_IBAR_IID) }; -NS_DEFINE_STATIC_IID_ACCESSOR(IBar, NS_IBAR_IID) - class Bar final : public IBar { public: explicit Bar(nsCOMArray& aArray); diff --git a/xpcom/tests/gtest/TestCOMPtr.cpp b/xpcom/tests/gtest/TestCOMPtr.cpp index 01fde5632afb..5929deaf2999 100644 --- a/xpcom/tests/gtest/TestCOMPtr.cpp +++ b/xpcom/tests/gtest/TestCOMPtr.cpp @@ -9,18 +9,14 @@ #include "mozilla/gtest/MozAssertions.h" #include "mozilla/Unused.h" -#define NS_IFOO_IID \ - { \ - 0x6f7652e0, 0xee43, 0x11d1, { \ - 0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 \ - } \ - } +#define NS_IFOO_IID \ + {0x6f7652e0, 0xee43, 0x11d1, {0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3}} namespace TestCOMPtr { class IFoo : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID) + NS_INLINE_DECL_STATIC_IID(NS_IFOO_IID) public: IFoo(); @@ -38,8 +34,6 @@ class IFoo : public nsISupports { static int total_queries_; }; -NS_DEFINE_STATIC_IID_ACCESSOR(IFoo, NS_IFOO_IID) - int IFoo::total_constructions_; int IFoo::total_destructions_; int IFoo::total_queries_; @@ -108,16 +102,12 @@ static nsCOMPtr return_a_IFoo() { return foop; } -#define NS_IBAR_IID \ - { \ - 0x6f7652e1, 0xee43, 0x11d1, { \ - 0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 \ - } \ - } +#define NS_IBAR_IID \ + {0x6f7652e1, 0xee43, 0x11d1, {0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3}} class IBar : public IFoo { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBAR_IID) + NS_INLINE_DECL_STATIC_IID(NS_IBAR_IID) public: IBar(); @@ -129,8 +119,6 @@ class IBar : public IFoo { static int total_queries_; }; -NS_DEFINE_STATIC_IID_ACCESSOR(IBar, NS_IBAR_IID) - int IBar::total_destructions_; int IBar::total_queries_; diff --git a/xpcom/tests/gtest/TestCOMPtrEq.cpp b/xpcom/tests/gtest/TestCOMPtrEq.cpp index 2056ce136805..9d431ef54654 100644 --- a/xpcom/tests/gtest/TestCOMPtrEq.cpp +++ b/xpcom/tests/gtest/TestCOMPtrEq.cpp @@ -11,20 +11,14 @@ #include "nsCOMPtr.h" #include "gtest/gtest.h" -#define NS_ICOMPTREQTESTFOO_IID \ - { \ - 0x8eb5bbef, 0xd1a3, 0x4659, { \ - 0x9c, 0xf6, 0xfd, 0xf3, 0xe4, 0xd2, 0x00, 0x0e \ - } \ - } +#define NS_ICOMPTREQTESTFOO_IID \ + {0x8eb5bbef, 0xd1a3, 0x4659, {0x9c, 0xf6, 0xfd, 0xf3, 0xe4, 0xd2, 0x00, 0x0e}} class nsICOMPtrEqTestFoo : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOMPTREQTESTFOO_IID) + NS_INLINE_DECL_STATIC_IID(NS_ICOMPTREQTESTFOO_IID) }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsICOMPtrEqTestFoo, NS_ICOMPTREQTESTFOO_IID) - TEST(COMPtrEq, NullEquality) { nsCOMPtr s; diff --git a/xpcom/tests/gtest/TestCallTemplates.cpp b/xpcom/tests/gtest/TestCallTemplates.cpp index 90a03a8a8f58..79539c308df8 100644 --- a/xpcom/tests/gtest/TestCallTemplates.cpp +++ b/xpcom/tests/gtest/TestCallTemplates.cpp @@ -19,34 +19,22 @@ #include "nsServiceManagerUtils.h" #include "mozilla/Attributes.h" -#define NS_ITESTSERVICE_IID \ - { \ - 0x127b5253, 0x37b1, 0x43c7, { \ - 0x96, 0x2b, 0xab, 0xf1, 0x2d, 0x22, 0x56, 0xae \ - } \ - } +#define NS_ITESTSERVICE_IID \ + {0x127b5253, 0x37b1, 0x43c7, {0x96, 0x2b, 0xab, 0xf1, 0x2d, 0x22, 0x56, 0xae}} class NS_NO_VTABLE nsITestService : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITESTSERVICE_IID) + NS_INLINE_DECL_STATIC_IID(NS_ITESTSERVICE_IID) }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsITestService, NS_ITESTSERVICE_IID) - -#define NS_ITESTSERVICE2_IID \ - { \ - 0x137b5253, 0x37b1, 0x43c7, { \ - 0x96, 0x2b, 0xab, 0xf1, 0x2d, 0x22, 0x56, 0xaf \ - } \ - } +#define NS_ITESTSERVICE2_IID \ + {0x137b5253, 0x37b1, 0x43c7, {0x96, 0x2b, 0xab, 0xf1, 0x2d, 0x22, 0x56, 0xaf}} class NS_NO_VTABLE nsITestService2 : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITESTSERVICE2_IID) + NS_INLINE_DECL_STATIC_IID(NS_ITESTSERVICE2_IID) }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsITestService2, NS_ITESTSERVICE2_IID) - class nsTestService final : public nsITestService, public nsSupportsWeakReference { ~nsTestService() = default; @@ -58,12 +46,8 @@ class nsTestService final : public nsITestService, NS_IMPL_ISUPPORTS(nsTestService, nsITestService, nsISupportsWeakReference) #define NS_TEST_SERVICE_CONTRACTID "@mozilla.org/test/testservice;1" -#define NS_TEST_SERVICE_CID \ - { \ - 0xa00c1406, 0x283a, 0x45c9, { \ - 0xae, 0xd2, 0x1a, 0xb6, 0xdd, 0xba, 0xfe, 0x53 \ - } \ - } +#define NS_TEST_SERVICE_CID \ + {0xa00c1406, 0x283a, 0x45c9, {0xae, 0xd2, 0x1a, 0xb6, 0xdd, 0xba, 0xfe, 0x53}} static NS_DEFINE_CID(kTestServiceCID, NS_TEST_SERVICE_CID); inline void JustTestingCompilation() { diff --git a/xpcom/tests/gtest/TestHashtables.cpp b/xpcom/tests/gtest/TestHashtables.cpp index 65b60084472d..6f86a016279b 100644 --- a/xpcom/tests/gtest/TestHashtables.cpp +++ b/xpcom/tests/gtest/TestHashtables.cpp @@ -187,16 +187,12 @@ static void testTHashtable(nsTHashtable& hash, // all this nsIFoo stuff was copied wholesale from TestCOMPtr.cpp // -#define NS_IFOO_IID \ - { \ - 0x6f7652e0, 0xee43, 0x11d1, { \ - 0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 \ - } \ - } +#define NS_IFOO_IID \ + {0x6f7652e0, 0xee43, 0x11d1, {0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3}} class IFoo final : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID) + NS_INLINE_DECL_STATIC_IID(NS_IFOO_IID) IFoo(); @@ -219,8 +215,6 @@ class IFoo final : public nsISupports { nsCString mString; }; -NS_DEFINE_STATIC_IID_ACCESSOR(IFoo, NS_IFOO_IID) - unsigned int IFoo::total_constructions_; unsigned int IFoo::total_destructions_; diff --git a/xpcom/tests/gtest/TestNsRefPtr.cpp b/xpcom/tests/gtest/TestNsRefPtr.cpp index cd89f2e86f46..ad123baaed88 100644 --- a/xpcom/tests/gtest/TestNsRefPtr.cpp +++ b/xpcom/tests/gtest/TestNsRefPtr.cpp @@ -13,16 +13,12 @@ namespace TestNsRefPtr { -#define NS_FOO_IID \ - { \ - 0x6f7652e0, 0xee43, 0x11d1, { \ - 0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 \ - } \ - } +#define NS_FOO_IID \ + {0x6f7652e0, 0xee43, 0x11d1, {0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3}} class Foo : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_FOO_IID) + NS_INLINE_DECL_STATIC_IID(NS_FOO_IID) public: Foo(); @@ -47,8 +43,6 @@ class Foo : public nsISupports { static int total_queries_; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Foo, NS_FOO_IID) - int Foo::total_constructions_; int Foo::total_destructions_; int Foo::total_addrefs_; @@ -125,16 +119,12 @@ static RefPtr return_a_Foo() { return foop; } -#define NS_BAR_IID \ - { \ - 0x6f7652e1, 0xee43, 0x11d1, { \ - 0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 \ - } \ - } +#define NS_BAR_IID \ + {0x6f7652e1, 0xee43, 0x11d1, {0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3}} class Bar : public Foo { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_BAR_IID) + NS_INLINE_DECL_STATIC_IID(NS_BAR_IID) public: Bar(); @@ -150,8 +140,6 @@ class Bar : public Foo { static int total_queries_; }; -NS_DEFINE_STATIC_IID_ACCESSOR(Bar, NS_BAR_IID) - int Bar::total_constructions_; int Bar::total_destructions_; int Bar::total_queries_; diff --git a/xpcom/tests/gtest/TestThreadUtils.cpp b/xpcom/tests/gtest/TestThreadUtils.cpp index b6666d2cbaa3..5f1560cfb9fe 100644 --- a/xpcom/tests/gtest/TestThreadUtils.cpp +++ b/xpcom/tests/gtest/TestThreadUtils.cpp @@ -433,7 +433,9 @@ static void TestRunnableFactory(bool aNamed) { } TEST(ThreadUtils, NewRunnableFunction) -{ TestRunnableFactory(/*aNamed*/ false); } +{ + TestRunnableFactory(/*aNamed*/ false); +} TEST(ThreadUtils, NewNamedRunnableFunction) { @@ -450,7 +452,9 @@ TEST(ThreadUtils, NewNamedRunnableFunction) } TEST(ThreadUtils, NewCancelableRunnableFunction) -{ TestRunnableFactory(/*aNamed*/ false); } +{ + TestRunnableFactory(/*aNamed*/ false); +} TEST(ThreadUtils, NewNamedCancelableRunnableFunction) { @@ -595,7 +599,9 @@ static void TestNewRunnableMethod(bool aNamed) { } TEST(ThreadUtils, RunnableMethod) -{ TestNewRunnableMethod(/* aNamed */ false); } +{ + TestNewRunnableMethod(/* aNamed */ false); +} TEST(ThreadUtils, NamedRunnableMethod) { @@ -876,12 +882,8 @@ TEST(ThreadUtils, IdleTaskRunner) } // {9e70a320-be02-11d1-8031-006008159b5a} -#define NS_IFOO_IID \ - { \ - 0x9e70a320, 0xbe02, 0x11d1, { \ - 0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a \ - } \ - } +#define NS_IFOO_IID \ + {0x9e70a320, 0xbe02, 0x11d1, {0x80, 0x31, 0x00, 0x60, 0x08, 0x15, 0x9b, 0x5a}} TEST(ThreadUtils, TypeTraits) { @@ -1049,11 +1051,10 @@ struct Spy { }; struct ISpyWithISupports : public nsISupports { - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID) + NS_INLINE_DECL_STATIC_IID(NS_IFOO_IID) NS_IMETHOD_(nsrefcnt) RefCnt() = 0; NS_IMETHOD_(int32_t) ID() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(ISpyWithISupports, NS_IFOO_IID) struct SpyWithISupports : public ISpyWithISupports, public Spy { private: virtual ~SpyWithISupports() = default; @@ -1068,14 +1069,12 @@ NS_IMPL_ISUPPORTS(SpyWithISupports, ISpyWithISupports) class IThreadUtilsObject : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID) + NS_INLINE_DECL_STATIC_IID(NS_IFOO_IID) NS_IMETHOD_(nsrefcnt) RefCnt() = 0; NS_IMETHOD_(int32_t) ID() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(IThreadUtilsObject, NS_IFOO_IID) - struct ThreadUtilsObjectNonRefCountedBase { virtual void MethodFromNonRefCountedBase() {} }; diff --git a/xpcom/tests/windows/TestCOM.cpp b/xpcom/tests/windows/TestCOM.cpp index 49f67db83545..5dbab5eb9fe0 100644 --- a/xpcom/tests/windows/TestCOM.cpp +++ b/xpcom/tests/windows/TestCOM.cpp @@ -17,21 +17,15 @@ #include "gtest/gtest.h" // {5846BA30-B856-11d1-A98A-00805F8A7AC4} -#define NS_ITEST_COM_IID \ - { \ - 0x5846ba30, 0xb856, 0x11d1, { \ - 0xa9, 0x8a, 0x0, 0x80, 0x5f, 0x8a, 0x7a, 0xc4 \ - } \ - } +#define NS_ITEST_COM_IID \ + {0x5846ba30, 0xb856, 0x11d1, {0xa9, 0x8a, 0x0, 0x80, 0x5f, 0x8a, 0x7a, 0xc4}} class nsITestCom : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITEST_COM_IID) + NS_INLINE_DECL_STATIC_IID(NS_ITEST_COM_IID) NS_IMETHOD Test() = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsITestCom, NS_ITEST_COM_IID) - /* * nsTestCom */ diff --git a/xpcom/threads/TaskQueue.h b/xpcom/threads/TaskQueue.h index 0d99d385d3e9..de18b2d06394 100644 --- a/xpcom/threads/TaskQueue.h +++ b/xpcom/threads/TaskQueue.h @@ -236,12 +236,8 @@ class TaskQueue final : public AbstractThread, }; }; -#define MOZILLA_TASKQUEUETRACKER_IID \ - { \ - 0x765c4b56, 0xd5f6, 0x4a9f, { \ - 0x91, 0xcf, 0x51, 0x47, 0xb3, 0xc1, 0x7e, 0xa6 \ - } \ - } +#define MOZILLA_TASKQUEUETRACKER_IID \ + {0x765c4b56, 0xd5f6, 0x4a9f, {0x91, 0xcf, 0x51, 0x47, 0xb3, 0xc1, 0x7e, 0xa6}} // XPCOM "interface" which may be implemented by nsIEventTarget implementations // which want to keep track of what TaskQueue instances are currently targeting @@ -253,7 +249,7 @@ class TaskQueue final : public AbstractThread, // are asynchronous, which is not a requirement of that interface. class TaskQueueTracker : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_TASKQUEUETRACKER_IID) + NS_INLINE_DECL_STATIC_IID(MOZILLA_TASKQUEUETRACKER_IID) // Get a strong reference to every TaskQueue currently tracked by this // TaskQueueTracker. May be called from any thraed. @@ -269,8 +265,6 @@ class TaskQueueTracker : public nsISupports { LinkedList mEntries MOZ_GUARDED_BY(mMutex); }; -NS_DEFINE_STATIC_IID_ACCESSOR(TaskQueueTracker, MOZILLA_TASKQUEUETRACKER_IID) - } // namespace mozilla #endif // TaskQueue_h_ diff --git a/xpcom/threads/ThrottledEventQueue.h b/xpcom/threads/ThrottledEventQueue.h index cf37a10a6dc9..5d42d4265ce7 100644 --- a/xpcom/threads/ThrottledEventQueue.h +++ b/xpcom/threads/ThrottledEventQueue.h @@ -11,12 +11,8 @@ #include "nsISerialEventTarget.h" -#define NS_THROTTLEDEVENTQUEUE_IID \ - { \ - 0x8f3cf7dc, 0xfc14, 0x4ad5, { \ - 0x9f, 0xd5, 0xdb, 0x79, 0xbc, 0xe6, 0xd5, 0x08 \ - } \ - } +#define NS_THROTTLEDEVENTQUEUE_IID \ + {0x8f3cf7dc, 0xfc14, 0x4ad5, {0x9f, 0xd5, 0xdb, 0x79, 0xbc, 0xe6, 0xd5, 0x08}} namespace mozilla { @@ -108,11 +104,9 @@ class ThrottledEventQueue final : public nsISerialEventTarget { NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIEVENTTARGET_FULL - NS_DECLARE_STATIC_IID_ACCESSOR(NS_THROTTLEDEVENTQUEUE_IID); + NS_INLINE_DECL_STATIC_IID(NS_THROTTLEDEVENTQUEUE_IID); }; -NS_DEFINE_STATIC_IID_ACCESSOR(ThrottledEventQueue, NS_THROTTLEDEVENTQUEUE_IID); - } // namespace mozilla #endif // mozilla_ThrottledEventQueue_h diff --git a/xpcom/threads/nsICancelableRunnable.h b/xpcom/threads/nsICancelableRunnable.h index 7aa98c86b63e..471a13d04b40 100644 --- a/xpcom/threads/nsICancelableRunnable.h +++ b/xpcom/threads/nsICancelableRunnable.h @@ -9,16 +9,12 @@ #include "nsISupports.h" -#define NS_ICANCELABLERUNNABLE_IID \ - { \ - 0xde93dc4c, 0x5eea, 0x4eb7, { \ - 0xb6, 0xd1, 0xdb, 0xf1, 0xe0, 0xce, 0xf6, 0x5c \ - } \ - } +#define NS_ICANCELABLERUNNABLE_IID \ + {0xde93dc4c, 0x5eea, 0x4eb7, {0xb6, 0xd1, 0xdb, 0xf1, 0xe0, 0xce, 0xf6, 0x5c}} class nsICancelableRunnable : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANCELABLERUNNABLE_IID) + NS_INLINE_DECL_STATIC_IID(NS_ICANCELABLERUNNABLE_IID) /* * Cancels a pending task, so that calling run() on the task is a no-op. @@ -35,6 +31,4 @@ class nsICancelableRunnable : public nsISupports { virtual ~nsICancelableRunnable() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsICancelableRunnable, NS_ICANCELABLERUNNABLE_IID) - #endif // nsICancelableRunnable_h__ diff --git a/xpcom/threads/nsIDiscardableRunnable.h b/xpcom/threads/nsIDiscardableRunnable.h index 873b1f5d93e8..96ef39a41163 100644 --- a/xpcom/threads/nsIDiscardableRunnable.h +++ b/xpcom/threads/nsIDiscardableRunnable.h @@ -13,16 +13,12 @@ * An interface implemented by nsIRunnable tasks for which nsIRunnable::Run() * might not be called. */ -#define NS_IDISCARDABLERUNNABLE_IID \ - { \ - 0xde93dc4c, 0x755c, 0x4cdc, { \ - 0x96, 0x76, 0x35, 0xc6, 0x48, 0x81, 0x59, 0x78 \ - } \ - } +#define NS_IDISCARDABLERUNNABLE_IID \ + {0xde93dc4c, 0x755c, 0x4cdc, {0x96, 0x76, 0x35, 0xc6, 0x48, 0x81, 0x59, 0x78}} class NS_NO_VTABLE nsIDiscardableRunnable : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDISCARDABLERUNNABLE_IID) + NS_INLINE_DECL_STATIC_IID(NS_IDISCARDABLERUNNABLE_IID) /** * Called exactly once on a queued task only if nsIRunnable::Run() is not @@ -35,7 +31,4 @@ class NS_NO_VTABLE nsIDiscardableRunnable : public nsISupports { virtual ~nsIDiscardableRunnable() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIDiscardableRunnable, - NS_IDISCARDABLERUNNABLE_IID) - #endif // XPCOM_THREADS_NSIDISCARDABLERUNNABLE_H_ diff --git a/xpcom/threads/nsIIdleRunnable.h b/xpcom/threads/nsIIdleRunnable.h index 2b9e001a8566..1a7dcb2860e4 100644 --- a/xpcom/threads/nsIIdleRunnable.h +++ b/xpcom/threads/nsIIdleRunnable.h @@ -10,12 +10,8 @@ #include "nsISupports.h" #include "mozilla/TimeStamp.h" -#define NS_IIDLERUNNABLE_IID \ - { \ - 0x688be92e, 0x7ade, 0x4fdc, { \ - 0x9d, 0x83, 0x74, 0xcb, 0xef, 0xf4, 0xa5, 0x2c \ - } \ - } +#define NS_IIDLERUNNABLE_IID \ + {0x688be92e, 0x7ade, 0x4fdc, {0x9d, 0x83, 0x74, 0xcb, 0xef, 0xf4, 0xa5, 0x2c}} class nsIEventTarget; @@ -25,7 +21,7 @@ class nsIEventTarget; */ class nsIIdleRunnable : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIDLERUNNABLE_IID) + NS_INLINE_DECL_STATIC_IID(NS_IIDLERUNNABLE_IID) /** * Notify the task of a point in time in the future when the task @@ -43,6 +39,4 @@ class nsIIdleRunnable : public nsISupports { virtual ~nsIIdleRunnable() = default; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIIdleRunnable, NS_IIDLERUNNABLE_IID) - #endif // nsIIdleRunnable_h__ diff --git a/xpcom/threads/nsITargetShutdownTask.h b/xpcom/threads/nsITargetShutdownTask.h index 09ac3c5e5ff5..27e743b929ac 100644 --- a/xpcom/threads/nsITargetShutdownTask.h +++ b/xpcom/threads/nsITargetShutdownTask.h @@ -11,16 +11,12 @@ #include "nsIEventTarget.h" #include "nsThreadUtils.h" -#define NS_ITARGETSHUTDOWNTASK_IID \ - { \ - 0xb08647aa, 0xcfb5, 0x4630, { \ - 0x8e, 0x26, 0x9a, 0xbe, 0xb3, 0x3f, 0x08, 0x40 \ - } \ - } +#define NS_ITARGETSHUTDOWNTASK_IID \ + {0xb08647aa, 0xcfb5, 0x4630, {0x8e, 0x26, 0x9a, 0xbe, 0xb3, 0x3f, 0x08, 0x40}} class NS_NO_VTABLE nsITargetShutdownTask : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISHUTDOWNTASK_IID) + NS_INLINE_DECL_STATIC_IID(NS_ITARGETSHUTDOWNTASK_IID) virtual void TargetShutdown() = 0; @@ -32,6 +28,4 @@ class NS_NO_VTABLE nsITargetShutdownTask : public nsISupports { } }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsITargetShutdownTask, NS_ITARGETSHUTDOWNTASK_IID) - #endif diff --git a/xpfe/appshell/AppWindow.h b/xpfe/appshell/AppWindow.h index 85b89f81e360..6ffce7770629 100644 --- a/xpfe/appshell/AppWindow.h +++ b/xpfe/appshell/AppWindow.h @@ -121,7 +121,7 @@ class AppWindow final : public nsIBaseWindow, NS_DECL_NSIAPPWINDOW NS_DECL_NSIBASEWINDOW - NS_DECLARE_STATIC_IID_ACCESSOR(NS_APPWINDOW_IMPL_CID) + NS_INLINE_DECL_STATIC_IID(NS_APPWINDOW_IMPL_CID) void LockUntilChromeLoad() { mLockedUntilChromeLoad = true; } bool IsLocked() const { return mLockedUntilChromeLoad; } @@ -378,8 +378,6 @@ class AppWindow final : public nsIBaseWindow, bool mIsWidgetInFullscreen = false; }; -NS_DEFINE_STATIC_IID_ACCESSOR(AppWindow, NS_APPWINDOW_IMPL_CID) - } // namespace mozilla #endif /* mozilla_AppWindow_h__ */