--- a/content/base/public/nsDeprecatedOperationList.h
+++ b/content/base/public/nsDeprecatedOperationList.h
@@ -1,11 +1,12 @@
/* 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
* designed to be used as input to the C preprocessor *only*.
*/
DEPRECATED_OPERATION(GetAttributeNode)
DEPRECATED_OPERATION(SetAttributeNode)
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -1,13 +1,12 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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"
/*
This file contains the list of all atoms used by gklayout;
see nsGkAtoms for access to the atoms.
*/
/*
--- a/content/events/public/nsVKList.h
+++ b/content/events/public/nsVKList.h
@@ -1,13 +1,14 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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.
* You must define NS_DEFINE_VK macro before including this.
*
* It must have two arguments, (aDOMKeyName, aDOMKeyCode)
* aDOMKeyName is a key name in DOM.
* aDOMKeyCode is one of nsIDOMKeyEvent::DOM_VK_*.
--- a/content/html/content/src/HTMLBodyElement.cpp
+++ b/content/html/content/src/HTMLBodyElement.cpp
@@ -536,17 +536,17 @@ HTMLBodyElement::IsEventAttributeName(ns
nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports); \
return globalWin->SetOn##name_(handler, error); \
} \
FORWARDED_EVENT_HELPER(name_, HTMLBodyElement, type_, type_*)
#define WINDOW_EVENT(name_, id_, type_, struct_) \
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
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef FORWARDED_EVENT_HELPER
#undef EVENT
--- a/content/html/content/src/HTMLBodyElement.h
+++ b/content/html/content/src/HTMLBodyElement.h
@@ -60,17 +60,17 @@ public:
NS_IMETHOD SetOn##name_(JSContext *cx, const JS::Value &v);
#define WINDOW_EVENT_HELPER(name_, type_) \
type_* GetOn##name_(); \
void SetOn##name_(type_* handler, ErrorResult& error);
#define WINDOW_EVENT(name_, id_, type_, struct_) \
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
#undef FORWARDED_EVENT
#undef EVENT
void GetText(nsString& aText)
{
--- a/content/html/content/src/HTMLFrameSetElement.cpp
+++ b/content/html/content/src/HTMLFrameSetElement.cpp
@@ -395,17 +395,17 @@ HTMLFrameSetElement::IsEventAttributeNam
nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports); \
return globalWin->SetOn##name_(handler, error); \
} \
FORWARDED_EVENT_HELPER(name_, HTMLFrameSetElement, type_, type_*)
#define WINDOW_EVENT(name_, id_, type_, struct_) \
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
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef FORWARDED_EVENT_HELPER
#undef EVENT
--- a/content/html/content/src/HTMLFrameSetElement.h
+++ b/content/html/content/src/HTMLFrameSetElement.h
@@ -90,17 +90,17 @@ public:
NS_IMETHOD SetOn##name_(JSContext *cx, const JS::Value &v);
#define WINDOW_EVENT_HELPER(name_, type_) \
type_* GetOn##name_(); \
void SetOn##name_(type_* handler, ErrorResult& error);
#define WINDOW_EVENT(name_, id_, type_, struct_) \
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
#undef FORWARDED_EVENT
#undef EVENT
// These override the SetAttr methods in nsGenericHTMLElement (need
// both here to silence compiler warnings).
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -815,17 +815,17 @@ nsGenericHTMLElement::GetEventListenerMa
if ((mNodeInfo->Equals(nsGkAtoms::body) ||
mNodeInfo->Equals(nsGkAtoms::frameset)) &&
// We only forward some event attributes from body/frameset to window
(0
#define EVENT(name_, id_, type_, struct_) /* nothing */
#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
)
) {
nsPIDOMWindow *win;
// If we have a document, and it has a window, add the event
@@ -923,17 +923,17 @@ nsGenericHTMLElement::SetOn##name_(Event
if (handler) { \
errorHandler = new OnErrorEventHandlerNonNull(handler); \
} \
return globalWin->SetOn##name_(errorHandler, error); \
} \
\
return nsINode::SetOn##name_(handler, error); \
}
-#include "nsEventNameList.h"
+#include "nsEventNameList.h" // IWYU pragma: keep
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef EVENT
nsresult
nsGenericHTMLElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
bool aNotify)
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -242,17 +242,17 @@ public:
void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler, \
mozilla::ErrorResult& error);
#define ERROR_EVENT(name_, id_, type_, struct_) \
using nsINode::GetOn##name_; \
using nsINode::SetOn##name_; \
already_AddRefed<mozilla::dom::EventHandlerNonNull> 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
void GetClassName(nsString& aClassName)
{
GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aClassName);
}
void SetClassName(const nsAString& aClassName)
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -1,12 +1,13 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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)
DOMCI_CLASS(DOMPrototype)
DOMCI_CLASS(DOMConstructor)
// Core classes
DOMCI_CLASS(DOMException)
--- a/tools/profiler/GeckoProfilerImpl.h
+++ b/tools/profiler/GeckoProfilerImpl.h
@@ -1,12 +1,13 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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_
#include <stdlib.h>
#include <signal.h>
#include <stdarg.h>
#include <algorithm>
--- a/xpcom/base/ErrorList.h
+++ b/xpcom/base/ErrorList.h
@@ -1,8 +1,9 @@
+// IWYU pragma: private, include "nsError.h"
/* Helper file for nsError.h, via preprocessor magic */
/* Standard "it worked" return value */
ERROR(NS_OK, 0),
/* ======================================================================= */
/* Core errors, not part of any modules */
/* ======================================================================= */
ERROR(NS_ERROR_BASE, 0xC1F30000),
--- a/xpcom/base/Makefile.in
+++ b/xpcom/base/Makefile.in
@@ -38,17 +38,18 @@ LOCAL_INCLUDES += \
-I$(srcdir)/../build \
-I$(topsrcdir)/xpcom/ds \
$(NULL)
# We generate ErrorListCxxDefines.h from ErrorList.h using regex. The -n option
# 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))/' < $< > $@
GARBAGE += \
ErrorListCxxDefines.h \
ErrorListCDefines.h \
$(NULL)
--- a/xpcom/base/nsISupportsBase.h
+++ b/xpcom/base/nsISupportsBase.h
@@ -1,11 +1,12 @@
/* 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__
#ifndef nscore_h___
#include "nscore.h"
#endif
--- a/xpcom/build/ServiceList.h
+++ b/xpcom/build/ServiceList.h
@@ -1,12 +1,11 @@
/* 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
MOZ_SERVICE(AccessibilityService, nsIAccessibilityService, "@mozilla.org/accessibilityService;1")
#endif
MOZ_SERVICE(ChromeRegistryService, nsIChromeRegistry, "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(ToolkitChromeRegistryService, nsIToolkitChromeRegistry, "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(XULChromeRegistryService, nsIXULChromeRegistry, "@mozilla.org/chrome/chrome-registry;1")
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -1,12 +1,13 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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__
#define nsISupportsImpl_h__
#ifndef nscore_h___
#include "nscore.h"
#endif
--- a/xpcom/string/public/nsAString.h
+++ b/xpcom/string/public/nsAString.h
@@ -1,13 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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___
#ifndef nsStringFwd_h___
#include "nsStringFwd.h"
#endif
--- a/xpcom/string/public/nsReadableUtils.h
+++ b/xpcom/string/public/nsReadableUtils.h
@@ -1,12 +1,13 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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___
/**
* I guess all the routines in this file are all mis-named.
* According to our conventions, they should be |NS_xxx|.
*/
--- a/xpcom/string/public/nsString.h
+++ b/xpcom/string/public/nsString.h
@@ -1,13 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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___
#include "mozilla/Attributes.h"
#ifndef nsSubstring_h___
#include "nsSubstring.h"
--- a/xpcom/string/public/nsTDependentSubstring.h
+++ b/xpcom/string/public/nsTDependentSubstring.h
@@ -1,15 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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
*
* A string class which wraps an external array of string characters. It
* is the client code's responsibility to ensure that the external buffer
* remains valid for a long as the string is alive.
*
--- a/xpcom/string/public/nsTString.h
+++ b/xpcom/string/public/nsTString.h
@@ -1,15 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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
* promise null-terminated storage. Instances of this class allocate
* strings on the heap.
*
* NAMES:
* nsString for wide characters
--- a/xpcom/string/public/nsTSubstring.h
+++ b/xpcom/string/public/nsTSubstring.h
@@ -1,15 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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"
#ifndef MOZILLA_INTERNAL_API
#error Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead.
#endif
/**
--- a/xpcom/string/public/nsTSubstringTuple.h
+++ b/xpcom/string/public/nsTSubstringTuple.h
@@ -1,15 +1,14 @@
//* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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
*
* Represents a tuple of string fragments. Built as a recursive binary tree.
* It is used to implement the concatenation of two or more string objects.
*
* NOTE: This class is a private implementation detail and should never be
--- a/xpcom/string/public/string-template-def-char.h
+++ b/xpcom/string/public/string-template-def-char.h
@@ -1,15 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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
#define nsTAString_IncompatibleCharT nsAString
#define nsTString_CharT nsCString
#define nsTFixedString_CharT nsFixedCString
#define nsTAutoString_CharT nsAutoCString
#define nsTSubstring_CharT nsACString
--- a/xpcom/string/public/string-template-def-unichar.h
+++ b/xpcom/string/public/string-template-def-unichar.h
@@ -1,15 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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
#define nsTAString_IncompatibleCharT nsACString
#define nsTString_CharT nsString
#define nsTFixedString_CharT nsFixedString
#define nsTAutoString_CharT nsAutoString
#define nsTSubstring_CharT nsAString
--- a/xpcom/string/public/string-template-undef.h
+++ b/xpcom/string/public/string-template-undef.h
@@ -1,13 +1,14 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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
#undef CharT_is_char
#undef nsTAString_IncompatibleCharT
#undef nsTString_CharT
#undef nsTFixedString_CharT
#undef nsTAutoString_CharT