0

Forward declare base::NoDestructor in headers when missing

Various headers contains `friend class base::NoDestructor<T>`, but does
not directly include base/no_destructor.h or forward declare
base::NoDestructor. Add missing forward declarations and includes to
avoid build errors in CLs that remove transitive includes of
base/no_destructor.h.

Change-Id: I89b5cefec9caf58ae9cea4b11ea902d992d93152
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6451809
Owners-Override: Kyle Charbonneau <kylechar@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1446731}
This commit is contained in:
Lei Zhang
2025-04-14 13:10:59 -07:00
committed by Chromium LUCI CQ
parent 8c2198da4f
commit fd3036eef7
8 changed files with 32 additions and 0 deletions
base/allocator/partition_allocator/src/partition_alloc/stack
chromeos/ash/experiences/arc/app
components/media_effects
media/gpu/chromeos
services/tracing/public/cpp/perfetto
ui/views/accessibility/tree

@ -20,6 +20,11 @@
namespace partition_alloc::internal {
namespace base {
template <typename T>
class NoDestructor;
}
// Returns the current stack pointer.
// TODO(bikineev,1202644): Remove this once base/stack_util.h lands.
PA_NOINLINE PA_COMPONENT_EXPORT(PARTITION_ALLOC) uintptr_t* GetStackPointer();

@ -12,6 +12,11 @@
#include "chromeos/ash/experiences/arc/arc_browser_context_keyed_service_factory_base.h"
#include "components/keyed_service/core/keyed_service.h"
namespace base {
template <typename T>
class NoDestructor;
}
namespace content {
class BrowserContext;
} // namespace content

@ -5,6 +5,7 @@
#include "components/media_effects/media_device_info.h"
#include "base/auto_reset.h"
#include "base/no_destructor.h"
#include "content/public/browser/audio_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/video_capture_service.h"

@ -12,6 +12,11 @@
#include "services/audio/public/mojom/system_info.mojom.h"
#include "services/video_capture/public/mojom/video_source_provider.mojom.h"
namespace base {
template <typename T>
class NoDestructor;
}
namespace media_effects {
// Get the id of the real default device if present in the passed `infos`,

@ -5,6 +5,7 @@
#include "media/gpu/chromeos/oop_video_decoder.h"
#include "base/memory/ptr_util.h"
#include "base/no_destructor.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "build/build_config.h"

@ -13,6 +13,11 @@
#include "base/trace_event/typed_macros.h"
#include "third_party/perfetto/include/perfetto/tracing/internal/track_event_internal.h"
namespace base {
template <typename T>
class NoDestructor;
}
namespace tracing {
// A class that accompanies TraceEventDataSource to record some additional

@ -16,6 +16,11 @@
#include "third_party/perfetto/include/perfetto/tracing/internal/track_event_internal.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_process_descriptor.gen.h"
namespace base {
template <typename T>
class NoDestructor;
}
namespace tracing {
// A class that emits track descriptors for Chrome processes and threads.

@ -25,6 +25,11 @@ namespace aura {
class Window;
} // namespace aura
namespace base {
template <typename T>
class NoDestructor;
}
namespace ui {
struct AXEvent;
}