Remove unneeded base/metrics/histogram_macros.h includes in headers
Remove includes of histogram_macros.h from headers, for headers that do
not use histogram macros. Then do IWYU to fix the build.
Change-Id: I4c08d681f67857780435d0edc2578e0b477632a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5505170
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1295561}
diff --git a/base/task/thread_pool/thread_group_worker_delegate.h b/base/task/thread_pool/thread_group_worker_delegate.h
index 42a53b2..c9a32d11 100644
--- a/base/task/thread_pool/thread_group_worker_delegate.h
+++ b/base/task/thread_pool/thread_group_worker_delegate.h
@@ -7,7 +7,6 @@
#include <optional>
-#include "base/metrics/histogram_macros.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool/thread_group.h"
#include "base/task/thread_pool/worker_thread.h"
diff --git a/cc/base/devtools_instrumentation.h b/cc/base/devtools_instrumentation.h
index d0b2712..f6613f7 100644
--- a/cc/base/devtools_instrumentation.h
+++ b/cc/base/devtools_instrumentation.h
@@ -11,7 +11,6 @@
#include <utility>
#include "base/metrics/histogram_functions.h"
-#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/traced_value.h"
diff --git a/cc/metrics/compositor_frame_reporting_controller.cc b/cc/metrics/compositor_frame_reporting_controller.cc
index ee898b7a2..1ef53ce 100644
--- a/cc/metrics/compositor_frame_reporting_controller.cc
+++ b/cc/metrics/compositor_frame_reporting_controller.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/debug/dump_without_crashing.h"
+#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_id_helper.h"
#include "cc/metrics/compositor_frame_reporter.h"
diff --git a/cc/trees/proxy_main.cc b/cc/trees/proxy_main.cc
index 7d1b04f..6322cd8 100644
--- a/cc/trees/proxy_main.cc
+++ b/cc/trees/proxy_main.cc
@@ -11,6 +11,7 @@
#include <vector>
#include "base/functional/bind.h"
+#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/synchronization/waitable_event.h"
#include "base/trace_event/trace_event.h"
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index b5e7a33e..cd415748 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -11,6 +11,7 @@
#include "base/auto_reset.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
+#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/synchronization/waitable_event.h"
#include "base/trace_event/trace_event.h"
diff --git a/components/performance_manager/public/metrics/metrics_collector.h b/components/performance_manager/public/metrics/metrics_collector.h
index fbb2954c..3264c04 100644
--- a/components/performance_manager/public/metrics/metrics_collector.h
+++ b/components/performance_manager/public/metrics/metrics_collector.h
@@ -6,7 +6,6 @@
#define COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_METRICS_METRICS_COLLECTOR_H_
#include "base/memory/raw_ptr.h"
-#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "components/performance_manager/public/graph/frame_node.h"
#include "components/performance_manager/public/graph/graph.h"
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/phishing_image_embedder_delegate.cc b/components/safe_browsing/content/renderer/phishing_classifier/phishing_image_embedder_delegate.cc
index 0d7d92250..290ef62 100644
--- a/components/safe_browsing/content/renderer/phishing_classifier/phishing_image_embedder_delegate.cc
+++ b/components/safe_browsing/content/renderer/phishing_classifier/phishing_image_embedder_delegate.cc
@@ -9,6 +9,7 @@
#include <set>
#include <utility>
+#include "base/metrics/histogram_macros.h"
#include "components/safe_browsing/content/common/safe_browsing.mojom-shared.h"
#include "components/safe_browsing/content/renderer/phishing_classifier/phishing_image_embedder.h"
#include "components/safe_browsing/content/renderer/phishing_classifier/scorer.h"
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/scorer.cc b/components/safe_browsing/content/renderer/phishing_classifier/scorer.cc
index a4ad46f..95da348 100644
--- a/components/safe_browsing/content/renderer/phishing_classifier/scorer.cc
+++ b/components/safe_browsing/content/renderer/phishing_classifier/scorer.cc
@@ -14,6 +14,7 @@
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/shared_memory_mapping.h"
#include "base/metrics/histogram_functions.h"
+#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/scorer.h b/components/safe_browsing/content/renderer/phishing_classifier/scorer.h
index 68acb20..dbc844c 100644
--- a/components/safe_browsing/content/renderer/phishing_classifier/scorer.h
+++ b/components/safe_browsing/content/renderer/phishing_classifier/scorer.h
@@ -24,7 +24,6 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/weak_ptr.h"
-#include "base/metrics/histogram_macros.h"
#include "base/observer_list.h"
#include "base/strings/string_piece.h"
#include "base/task/sequenced_task_runner.h"
diff --git a/components/sync/base/data_type_histogram.h b/components/sync/base/data_type_histogram.h
index 694965af..f206f20 100644
--- a/components/sync/base/data_type_histogram.h
+++ b/components/sync/base/data_type_histogram.h
@@ -5,7 +5,6 @@
#ifndef COMPONENTS_SYNC_BASE_DATA_TYPE_HISTOGRAM_H_
#define COMPONENTS_SYNC_BASE_DATA_TYPE_HISTOGRAM_H_
-#include "base/metrics/histogram_macros.h"
#include "components/sync/base/model_type.h"
namespace syncer {
diff --git a/content/browser/payments/respond_with_callback.h b/content/browser/payments/respond_with_callback.h
index 3b1722f..a483f09 100644
--- a/content/browser/payments/respond_with_callback.h
+++ b/content/browser/payments/respond_with_callback.h
@@ -6,7 +6,6 @@
#define CONTENT_BROWSER_PAYMENTS_RESPOND_WITH_CALLBACK_H_
#include "base/functional/callback_forward.h"
-#include "base/metrics/histogram_macros.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/payment_app_provider.h"
diff --git a/content/browser/speech/tts_controller_impl.h b/content/browser/speech/tts_controller_impl.h
index 46c9bb1..3bc1938a 100644
--- a/content/browser/speech/tts_controller_impl.h
+++ b/content/browser/speech/tts_controller_impl.h
@@ -14,7 +14,6 @@
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/singleton.h"
-#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/observer_list.h"
#include "base/values.h"
diff --git a/content/common/service_worker/service_worker_resource_loader.cc b/content/common/service_worker/service_worker_resource_loader.cc
index 75366cc..8f5c7ce 100644
--- a/content/common/service_worker/service_worker_resource_loader.cc
+++ b/content/common/service_worker/service_worker_resource_loader.cc
@@ -6,6 +6,7 @@
#include "base/check_op.h"
#include "base/feature_list.h"
+#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
#include "content/common/features.h"
#include "services/network/public/mojom/service_worker_router_info.mojom-shared.h"
diff --git a/content/common/service_worker/service_worker_resource_loader.h b/content/common/service_worker/service_worker_resource_loader.h
index 1e1d108..5a15dd2 100644
--- a/content/common/service_worker/service_worker_resource_loader.h
+++ b/content/common/service_worker/service_worker_resource_loader.h
@@ -8,7 +8,6 @@
#include <optional>
#include "base/check_op.h"
-#include "base/metrics/histogram_macros.h"
#include "content/common/content_export.h"
#include "services/network/public/mojom/service_worker_router_info.mojom-shared.h"
#include "services/network/public/mojom/url_loader.mojom.h"
diff --git a/gpu/ipc/service/gpu_watchdog_thread.cc b/gpu/ipc/service/gpu_watchdog_thread.cc
index fb7f513..4e0aa4fe 100644
--- a/gpu/ipc/service/gpu_watchdog_thread.cc
+++ b/gpu/ipc/service/gpu_watchdog_thread.cc
@@ -20,6 +20,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
+#include "base/metrics/histogram_macros.h"
#include "base/native_library.h"
#include "base/numerics/safe_conversions.h"
#include "base/power_monitor/power_monitor.h"
diff --git a/gpu/ipc/service/gpu_watchdog_thread.h b/gpu/ipc/service/gpu_watchdog_thread.h
index 36bfb45..46d0d1d 100644
--- a/gpu/ipc/service/gpu_watchdog_thread.h
+++ b/gpu/ipc/service/gpu_watchdog_thread.h
@@ -9,7 +9,6 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/memory/weak_ptr.h"
-#include "base/metrics/histogram_macros.h"
#include "base/power_monitor/power_observer.h"
#include "base/task/task_observer.h"
#include "base/threading/thread.h"
diff --git a/services/metrics/public/cpp/ukm_recorder_impl_utils.cc b/services/metrics/public/cpp/ukm_recorder_impl_utils.cc
index 2484f9f..73e9978 100644
--- a/services/metrics/public/cpp/ukm_recorder_impl_utils.cc
+++ b/services/metrics/public/cpp/ukm_recorder_impl_utils.cc
@@ -5,6 +5,7 @@
#include "services/metrics/public/cpp/ukm_recorder_impl_utils.h"
#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
namespace ukm {
diff --git a/services/metrics/public/cpp/ukm_recorder_impl_utils.h b/services/metrics/public/cpp/ukm_recorder_impl_utils.h
index 34d8f647..69d5bbc 100644
--- a/services/metrics/public/cpp/ukm_recorder_impl_utils.h
+++ b/services/metrics/public/cpp/ukm_recorder_impl_utils.h
@@ -5,7 +5,8 @@
#ifndef SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_IMPL_UTILS_H_
#define SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_IMPL_UTILS_H_
-#include "base/metrics/histogram_macros.h"
+#include <stdint.h>
+
#include "services/metrics/public/cpp/metrics_export.h"
namespace ukm {
diff --git a/third_party/blink/renderer/core/animation/timing_calculations.cc b/third_party/blink/renderer/core/animation/timing_calculations.cc
index e8b4637..ed9c6e3 100644
--- a/third_party/blink/renderer/core/animation/timing_calculations.cc
+++ b/third_party/blink/renderer/core/animation/timing_calculations.cc
@@ -4,6 +4,8 @@
#include "third_party/blink/renderer/core/animation/timing_calculations.h"
+#include "base/metrics/histogram_macros.h"
+
namespace blink {
namespace {
diff --git a/third_party/blink/renderer/core/animation/timing_calculations.h b/third_party/blink/renderer/core/animation/timing_calculations.h
index 4cc7bc2..0b2b9d4 100644
--- a/third_party/blink/renderer/core/animation/timing_calculations.h
+++ b/third_party/blink/renderer/core/animation/timing_calculations.h
@@ -34,7 +34,6 @@
#include <optional>
#include "base/debug/dump_without_crashing.h"
-#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "third_party/blink/renderer/core/animation/timing.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"
diff --git a/third_party/blink/renderer/core/html/html_meta_element.cc b/third_party/blink/renderer/core/html/html_meta_element.cc
index 223d0abf..fb48a130 100644
--- a/third_party/blink/renderer/core/html/html_meta_element.cc
+++ b/third_party/blink/renderer/core/html/html_meta_element.cc
@@ -22,6 +22,7 @@
#include "third_party/blink/renderer/core/html/html_meta_element.h"
+#include "base/metrics/histogram_macros.h"
#include "third_party/blink/public/mojom/frame/color_scheme.mojom-blink.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/dom/document.h"
diff --git a/third_party/blink/renderer/core/workers/dedicated_worker.cc b/third_party/blink/renderer/core/workers/dedicated_worker.cc
index e3ac0e25..e357a2a 100644
--- a/third_party/blink/renderer/core/workers/dedicated_worker.cc
+++ b/third_party/blink/renderer/core/workers/dedicated_worker.cc
@@ -8,6 +8,7 @@
#include <utility>
#include "base/feature_list.h"
+#include "base/metrics/histogram_macros.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/typed_macros.h"
#include "base/unguessable_token.h"
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
index 408a2079..a6dbfb49 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
@@ -12,6 +12,7 @@
#include "base/functional/bind.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
+#include "base/metrics/histogram_macros.h"
#include "base/observer_list.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
diff --git a/ui/accessibility/platform/ax_platform_relation_win.h b/ui/accessibility/platform/ax_platform_relation_win.h
index e8d81b0b..d4074ef4 100644
--- a/ui/accessibility/platform/ax_platform_relation_win.h
+++ b/ui/accessibility/platform/ax_platform_relation_win.h
@@ -12,7 +12,6 @@
#include <vector>
#include "base/component_export.h"
-#include "base/metrics/histogram_macros.h"
#include "base/win/atl.h"
#include "third_party/iaccessible2/ia2_api_all.h"
#include "ui/accessibility/ax_text_utils.h"
diff --git a/ui/compositor/presentation_time_recorder.cc b/ui/compositor/presentation_time_recorder.cc
index fa6cada..527b72d 100644
--- a/ui/compositor/presentation_time_recorder.cc
+++ b/ui/compositor/presentation_time_recorder.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
+#include "base/metrics/histogram.h"
namespace ui {
diff --git a/ui/compositor/presentation_time_recorder.h b/ui/compositor/presentation_time_recorder.h
index 29f69da..b3ce477 100644
--- a/ui/compositor/presentation_time_recorder.h
+++ b/ui/compositor/presentation_time_recorder.h
@@ -8,7 +8,6 @@
#include "base/gtest_prod_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "ui/compositor/compositor.h"