Bug 1964489 - Avoid duplication in NS_DECLARE_STATIC_IID_ACCESSOR / NS_DEFINE_STATIC_IID_ACCESSOR r=nika,necko-reviewers,media-playback-reviewers,places-reviewers,win-reviewers,dom-storage-reviewers,xpcom-reviewers,gstoll,janv,emilio,padenot,valentin,asuth

In modern C++, static constexpr member variables are automatically
inline (aka weak) so the template trick is not needed. This also avoid
duplication and reduces the amount of parsed code. No impact on
generated binary (actually: smaller debuginfo, close to identical
binary).

Differential Revision: https://phabricator.services.mozilla.com/D247825
This commit is contained in:
serge-sans-paille
2025-05-08 07:38:39 +00:00
committed by sguelton@mozilla.com
parent 3a69350af8
commit bf3516e81e
191 changed files with 577 additions and 1493 deletions

View File

@@ -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

View File

@@ -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