IWYU modules/portal
using
find modules/portal/ -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner
followed by
tools_webrtc/gn_check_autofix.py -C out/Default
followed by
git cl format
Also revert some glib includes in video_capture based on feedback from
https://webrtc-review.googlesource.com/c/src/+/399061
Bug: webrtc:42226242
Change-Id: I7790ad8f97b947fd0b1f04665d20442a9ed3913d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/399820
Reviewed-by: Jan Grulich <grulja@gmail.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#45174}
diff --git a/modules/desktop_capture/linux/wayland/screencast_portal.cc b/modules/desktop_capture/linux/wayland/screencast_portal.cc
index d3c8c07..8c9d5de 100644
--- a/modules/desktop_capture/linux/wayland/screencast_portal.cc
+++ b/modules/desktop_capture/linux/wayland/screencast_portal.cc
@@ -12,9 +12,7 @@
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
-#include <glib-object.h>
#include <glib.h>
-#include <glibconfig.h>
#include <unistd.h>
#include <cstdint>
diff --git a/modules/portal/pipewire_utils.h b/modules/portal/pipewire_utils.h
index c1327b8..c3d4f34 100644
--- a/modules/portal/pipewire_utils.h
+++ b/modules/portal/pipewire_utils.h
@@ -11,11 +11,13 @@
#ifndef MODULES_PORTAL_PIPEWIRE_UTILS_H_
#define MODULES_PORTAL_PIPEWIRE_UTILS_H_
-#include <errno.h>
-#include <stdint.h>
+#include <asm-generic/ioctl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <cerrno>
+#include <cstdint>
+
// static
struct dma_buf_sync {
uint64_t flags;
diff --git a/modules/portal/scoped_glib.cc b/modules/portal/scoped_glib.cc
index 31ba8cb..3f040be 100644
--- a/modules/portal/scoped_glib.cc
+++ b/modules/portal/scoped_glib.cc
@@ -10,6 +10,11 @@
#include "modules/portal/scoped_glib.h"
+#include <gio/gio.h>
+
+#include "rtc_base/system/rtc_export.h"
+#include "rtc_base/system/rtc_export_template.h"
+
namespace webrtc {
template class RTC_EXPORT_TEMPLATE_DEFINE(RTC_EXPORT) Scoped<GError>;
diff --git a/modules/portal/scoped_glib.h b/modules/portal/scoped_glib.h
index d97e47a..61e140b 100644
--- a/modules/portal/scoped_glib.h
+++ b/modules/portal/scoped_glib.h
@@ -14,6 +14,7 @@
#include <gio/gio.h>
#include "rtc_base/checks.h"
+#include "rtc_base/system/rtc_export.h"
#include "rtc_base/system/rtc_export_template.h"
namespace webrtc {
diff --git a/modules/portal/xdg_desktop_portal_utils.cc b/modules/portal/xdg_desktop_portal_utils.cc
index d911f0d..ad4c661 100644
--- a/modules/portal/xdg_desktop_portal_utils.cc
+++ b/modules/portal/xdg_desktop_portal_utils.cc
@@ -9,10 +9,13 @@
*/
#include "modules/portal/xdg_desktop_portal_utils.h"
+#include <cstdint>
#include <string>
+#include <vector>
#include "absl/strings/str_replace.h"
#include "absl/strings/string_view.h"
+#include "modules/portal/portal_request_response.h"
#include "modules/portal/scoped_glib.h"
#include "rtc_base/logging.h"
#include "rtc_base/strings/str_join.h"
diff --git a/modules/portal/xdg_desktop_portal_utils.h b/modules/portal/xdg_desktop_portal_utils.h
index eff46a0..feb7da3 100644
--- a/modules/portal/xdg_desktop_portal_utils.h
+++ b/modules/portal/xdg_desktop_portal_utils.h
@@ -12,17 +12,13 @@
#define MODULES_PORTAL_XDG_DESKTOP_PORTAL_UTILS_H_
#include <gio/gio.h>
-#include <stdint.h>
+#include <cstdint>
#include <string>
-#include <vector>
#include "absl/strings/string_view.h"
#include "modules/portal/portal_request_response.h"
-#include "modules/portal/scoped_glib.h"
-#include "modules/portal/xdg_session_details.h"
-#include "rtc_base/checks.h"
-#include "rtc_base/logging.h"
+#include "rtc_base/system/rtc_export.h"
namespace webrtc {
namespace xdg_portal {
diff --git a/modules/video_capture/linux/camera_portal.cc b/modules/video_capture/linux/camera_portal.cc
index 6466a91..b6c703f 100644
--- a/modules/video_capture/linux/camera_portal.cc
+++ b/modules/video_capture/linux/camera_portal.cc
@@ -10,11 +10,7 @@
#include "modules/video_capture/linux/camera_portal.h"
-#include <gio/gio.h>
#include <gio/gunixfdlist.h>
-#include <glib-object.h>
-#include <glib.h>
-#include <glibconfig.h>
#include <cstdint>
#include <memory>
diff --git a/tools_webrtc/iwyu/apply_include_cleaner.py b/tools_webrtc/iwyu/apply_include_cleaner.py
index 6f2a535..ad89a52 100755
--- a/tools_webrtc/iwyu/apply_include_cleaner.py
+++ b/tools_webrtc/iwyu/apply_include_cleaner.py
@@ -75,6 +75,10 @@
"\\.pb\\.h", # generated protobuf files.
"pipewire\\/.*\\.h", # pipewire.
"spa\\/.*\\.h", # pipewire.
+ "glib\\.h", # glib.
+ "glibconfig\\.h", # glib.
+ "glib-object\\.h", # glib.
+ "gio\\/.*\\.h", # glib.
"openssl\\/.*\\.h", # openssl/boringssl.
"alsa\\/.*\\.h", # ALSA.
"pulse\\/.*\\.h", # PulseAudio.