diff --git a/content/base/public/nsDeprecatedOperationList.h b/content/base/public/nsDeprecatedOperationList.h index ff72fddd538..27c42a03472 100644 --- a/content/base/public/nsDeprecatedOperationList.h +++ b/content/base/public/nsDeprecatedOperationList.h @@ -1,6 +1,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsIDocument.h" /* * This file contains the list of deprecated DOM operations. It is diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index 14dd5bb5cdd..4f8f55e7ff7 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -2,7 +2,6 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - // IWYU pragma: private, include "nsGkAtoms.h" /* diff --git a/content/events/public/nsVKList.h b/content/events/public/nsVKList.h index 063de995f98..79dd880fd9b 100644 --- a/content/events/public/nsVKList.h +++ b/content/events/public/nsVKList.h @@ -3,6 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsGUIEvent.h" /** * This header file defines all DOM keys which are defined in nsIDOMKeyEvent. diff --git a/content/html/content/src/HTMLBodyElement.cpp b/content/html/content/src/HTMLBodyElement.cpp index 7e4ee379660..07591628dfd 100644 --- a/content/html/content/src/HTMLBodyElement.cpp +++ b/content/html/content/src/HTMLBodyElement.cpp @@ -541,7 +541,7 @@ HTMLBodyElement::IsEventAttributeName(nsIAtom *aName) WINDOW_EVENT_HELPER(name_, EventHandlerNonNull) #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \ WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull) -#include "nsEventNameList.h" +#include "nsEventNameList.h" // IWYU pragma: keep #undef BEFOREUNLOAD_EVENT #undef WINDOW_EVENT #undef WINDOW_EVENT_HELPER diff --git a/content/html/content/src/HTMLBodyElement.h b/content/html/content/src/HTMLBodyElement.h index 5db7abfd091..6bd61d026e6 100644 --- a/content/html/content/src/HTMLBodyElement.h +++ b/content/html/content/src/HTMLBodyElement.h @@ -65,7 +65,7 @@ public: WINDOW_EVENT_HELPER(name_, EventHandlerNonNull) #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \ WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull) -#include "nsEventNameList.h" +#include "nsEventNameList.h" // IWYU pragma: keep #undef BEFOREUNLOAD_EVENT #undef WINDOW_EVENT #undef WINDOW_EVENT_HELPER diff --git a/content/html/content/src/HTMLFrameSetElement.cpp b/content/html/content/src/HTMLFrameSetElement.cpp index ca05b634250..2f0bdf5c2ff 100644 --- a/content/html/content/src/HTMLFrameSetElement.cpp +++ b/content/html/content/src/HTMLFrameSetElement.cpp @@ -400,7 +400,7 @@ HTMLFrameSetElement::IsEventAttributeName(nsIAtom *aName) WINDOW_EVENT_HELPER(name_, EventHandlerNonNull) #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \ WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull) -#include "nsEventNameList.h" +#include "nsEventNameList.h" // IWYU pragma: keep #undef BEFOREUNLOAD_EVENT #undef WINDOW_EVENT #undef WINDOW_EVENT_HELPER diff --git a/content/html/content/src/HTMLFrameSetElement.h b/content/html/content/src/HTMLFrameSetElement.h index c1fe9c77d32..541dea6ba63 100644 --- a/content/html/content/src/HTMLFrameSetElement.h +++ b/content/html/content/src/HTMLFrameSetElement.h @@ -95,7 +95,7 @@ public: WINDOW_EVENT_HELPER(name_, EventHandlerNonNull) #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \ WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull) -#include "nsEventNameList.h" +#include "nsEventNameList.h" // IWYU pragma: keep #undef BEFOREUNLOAD_EVENT #undef WINDOW_EVENT #undef WINDOW_EVENT_HELPER diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index b96f979a531..eb9c6dd30e4 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -820,7 +820,7 @@ nsGenericHTMLElement::GetEventListenerManagerForAttr(nsIAtom* aAttrName, #define FORWARDED_EVENT(name_, id_, type_, struct_) \ || nsGkAtoms::on##name_ == aAttrName #define WINDOW_EVENT FORWARDED_EVENT -#include "nsEventNameList.h" +#include "nsEventNameList.h" // IWYU pragma: keep #undef WINDOW_EVENT #undef FORWARDED_EVENT #undef EVENT @@ -928,7 +928,7 @@ nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler, \ \ return nsINode::SetOn##name_(handler, error); \ } -#include "nsEventNameList.h" +#include "nsEventNameList.h" // IWYU pragma: keep #undef ERROR_EVENT #undef FORWARDED_EVENT #undef EVENT diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index da80bb593d5..56da1a3ad55 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -247,7 +247,7 @@ public: already_AddRefed GetOn##name_(); \ void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler, \ mozilla::ErrorResult& error); -#include "nsEventNameList.h" +#include "nsEventNameList.h" // IWYU pragma: keep #undef ERROR_EVENT #undef FORWARDED_EVENT #undef EVENT diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index 1d6cd8d7d40..128cc96b051 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -2,6 +2,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsDOMClassInfoID.h" DOMCI_CLASS(Window) DOMCI_CLASS(Location) diff --git a/tools/profiler/GeckoProfilerImpl.h b/tools/profiler/GeckoProfilerImpl.h index 02e53ba8b49..d147c2cc058 100644 --- a/tools/profiler/GeckoProfilerImpl.h +++ b/tools/profiler/GeckoProfilerImpl.h @@ -2,6 +2,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "GeckoProfiler.h" #ifndef TOOLS_SPS_SAMPLER_H_ #define TOOLS_SPS_SAMPLER_H_ diff --git a/xpcom/base/ErrorList.h b/xpcom/base/ErrorList.h index 904686dbb47..daf959d4af5 100644 --- a/xpcom/base/ErrorList.h +++ b/xpcom/base/ErrorList.h @@ -1,3 +1,4 @@ +// IWYU pragma: private, include "nsError.h" /* Helper file for nsError.h, via preprocessor magic */ /* Standard "it worked" return value */ ERROR(NS_OK, 0), diff --git a/xpcom/base/Makefile.in b/xpcom/base/Makefile.in index 4f1f39b7bd3..de07083a71c 100644 --- a/xpcom/base/Makefile.in +++ b/xpcom/base/Makefile.in @@ -43,7 +43,8 @@ LOCAL_INCLUDES += \ # suppresses printing the pattern space, and the p at the end prints it anyway, # so we don't print lines that don't match the pattern to start with. ErrorListCxxDefines.h: ErrorList.h Makefile - sed -n 's/.*ERROR(\([A-Z_0-9]*\).*/#define \1 nsresult::\1/p' < $< > $@ + echo '// IWYU pragma: private, include "nsError.h"' > $@ + sed -n 's/.*ERROR(\([A-Z_0-9]*\).*/#define \1 nsresult::\1/p' < $< >> $@ ErrorListCDefines.h: ErrorList.h Makefile sed 's/.*ERROR(\([A-Z_0-9]*\),\( *\)\(.*\))[^)]*/#define \1 \2((nsresult)(\3))/' < $< > $@ diff --git a/xpcom/base/nsISupportsBase.h b/xpcom/base/nsISupportsBase.h index e3b7419757e..d2f66f4a68f 100644 --- a/xpcom/base/nsISupportsBase.h +++ b/xpcom/base/nsISupportsBase.h @@ -1,6 +1,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsISupports.h" #ifndef nsISupportsBase_h__ #define nsISupportsBase_h__ diff --git a/xpcom/build/ServiceList.h b/xpcom/build/ServiceList.h index 2630948e1d8..78a9c5aa311 100644 --- a/xpcom/build/ServiceList.h +++ b/xpcom/build/ServiceList.h @@ -1,7 +1,6 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - // IWYU pragma: private, include "mozilla/Services.h" #ifdef ACCESSIBILITY diff --git a/xpcom/glue/nsISupportsImpl.h b/xpcom/glue/nsISupportsImpl.h index d5f08ff5667..ffd9a057081 100644 --- a/xpcom/glue/nsISupportsImpl.h +++ b/xpcom/glue/nsISupportsImpl.h @@ -2,6 +2,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsISupports.h" #ifndef nsISupportsImpl_h__ diff --git a/xpcom/string/public/nsAString.h b/xpcom/string/public/nsAString.h index 688ab1fa980..506d7bb1c23 100644 --- a/xpcom/string/public/nsAString.h +++ b/xpcom/string/public/nsAString.h @@ -3,6 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsStringGlue.h" #ifndef nsAString_h___ #define nsAString_h___ diff --git a/xpcom/string/public/nsReadableUtils.h b/xpcom/string/public/nsReadableUtils.h index 72e439ad18b..a222d8cc28d 100644 --- a/xpcom/string/public/nsReadableUtils.h +++ b/xpcom/string/public/nsReadableUtils.h @@ -2,6 +2,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsStringGlue.h" #ifndef nsReadableUtils_h___ #define nsReadableUtils_h___ diff --git a/xpcom/string/public/nsString.h b/xpcom/string/public/nsString.h index 39d83cd5dce..3f55072cb15 100644 --- a/xpcom/string/public/nsString.h +++ b/xpcom/string/public/nsString.h @@ -3,6 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsStringGlue.h" #ifndef nsString_h___ #define nsString_h___ diff --git a/xpcom/string/public/nsTDependentSubstring.h b/xpcom/string/public/nsTDependentSubstring.h index 88538e610d2..61c84c2f2d7 100644 --- a/xpcom/string/public/nsTDependentSubstring.h +++ b/xpcom/string/public/nsTDependentSubstring.h @@ -3,8 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// IWYU pragma: private, include "nsDependentSubstring.h" +// IWYU pragma: private, include "nsStringGlue.h" /** * nsTDependentSubstring_CharT diff --git a/xpcom/string/public/nsTString.h b/xpcom/string/public/nsTString.h index 0af5a5bd48d..be633bd56e2 100644 --- a/xpcom/string/public/nsTString.h +++ b/xpcom/string/public/nsTString.h @@ -3,8 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// IWYU pragma: private, include "nsString.h" +// IWYU pragma: private, include "nsStringGlue.h" /** * This is the canonical null-terminated string class. All subclasses diff --git a/xpcom/string/public/nsTSubstring.h b/xpcom/string/public/nsTSubstring.h index f73ce8b20b5..fa7099fd6f3 100644 --- a/xpcom/string/public/nsTSubstring.h +++ b/xpcom/string/public/nsTSubstring.h @@ -3,8 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// IWYU pragma: private, include "nsAString.h" +// IWYU pragma: private, include "nsStringGlue.h" #include "mozilla/MemoryReporting.h" diff --git a/xpcom/string/public/nsTSubstringTuple.h b/xpcom/string/public/nsTSubstringTuple.h index f96a45e713b..103d292528a 100644 --- a/xpcom/string/public/nsTSubstringTuple.h +++ b/xpcom/string/public/nsTSubstringTuple.h @@ -3,8 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// IWYU pragma: private, include "nsSubstringTuple.h" +// IWYU pragma: private, include "nsStringGlue.h" /** * nsTSubstringTuple_CharT diff --git a/xpcom/string/public/string-template-def-char.h b/xpcom/string/public/string-template-def-char.h index e61c96da9cc..2ca79228185 100644 --- a/xpcom/string/public/string-template-def-char.h +++ b/xpcom/string/public/string-template-def-char.h @@ -3,8 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// IWYU pragma: private, include "nsString.h" +// IWYU pragma: private, include "nsStringGlue.h" #define CharT char #define CharT_is_char 1 diff --git a/xpcom/string/public/string-template-def-unichar.h b/xpcom/string/public/string-template-def-unichar.h index 4141e10df52..70a8f40e3a9 100644 --- a/xpcom/string/public/string-template-def-unichar.h +++ b/xpcom/string/public/string-template-def-unichar.h @@ -3,8 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// IWYU pragma: private, include "nsString.h" +// IWYU pragma: private, include "nsStringGlue.h" #define CharT PRUnichar #define CharT_is_PRUnichar 1 diff --git a/xpcom/string/public/string-template-undef.h b/xpcom/string/public/string-template-undef.h index 22bb7236b65..ba558c2a619 100644 --- a/xpcom/string/public/string-template-undef.h +++ b/xpcom/string/public/string-template-undef.h @@ -3,6 +3,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// IWYU pragma: private, include "nsStringGlue.h" #undef CharT #undef CharT_is_PRUnichar