0

[tvos] Exclude power_monitor_device_source_ios.mm

This excludes power_monitor_device_source_ios.mm for tvOS since it
doesn’t have anything related to battery such as `batteryState` from
`UIDevice`.

Bug: 391914246
Change-Id: I9dbb11b1e821b9624dfd34eb180ca32224d6fd7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6429465
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1444413}
This commit is contained in:
Julie Jeongeun Kim
2025-04-08 15:25:40 -07:00
committed by Chromium LUCI CQ
parent cbd0bd4781
commit 218ac69538
3 changed files with 12 additions and 7 deletions

@ -2172,7 +2172,6 @@ component("base") {
"ios/ns_error_util.h",
"ios/ns_error_util.mm",
"ios/ns_range.h",
"power_monitor/power_monitor_device_source_ios.mm",
"process/process_metrics_ios.cc",
"process/process_metrics_posix.cc",
"profiler/core_unwinders_ios.cc",
@ -2210,13 +2209,18 @@ component("base") {
]
if (target_platform == "tvos") {
# tvOS apps must be single-process. Build a Process version that does
# the bare minimum and does not use Mach ports.
sources += [ "process/process_tvos.cc" ]
sources += [
"power_monitor/power_monitor_device_source_stub.cc",
# tvOS apps must be single-process. Build a Process version that does
# the bare minimum and does not use Mach ports.
"process/process_tvos.cc",
]
} else {
sources += [
"apple/mach_port_rendezvous_ios.cc",
"apple/mach_port_rendezvous_ios.h",
"power_monitor/power_monitor_device_source_ios.mm",
"process/process_mac.cc",
]
}
@ -2234,6 +2238,7 @@ component("base") {
}
} else {
sources += [
"power_monitor/power_monitor_device_source_ios.mm",
"process/launch_ios.cc",
"process/memory_stubs.cc",
"process/process_stubs.cc",

@ -9,13 +9,13 @@
namespace base {
PowerMonitorDeviceSource::PowerMonitorDeviceSource() {
#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN)
#if (BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_IOS_TVOS)) || BUILDFLAG(IS_WIN)
PlatformInit();
#endif
}
PowerMonitorDeviceSource::~PowerMonitorDeviceSource() {
#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN)
#if (BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_IOS_TVOS)) || BUILDFLAG(IS_WIN)
PlatformDestroy();
#endif
}

@ -93,7 +93,7 @@ class BASE_EXPORT PowerMonitorDeviceSource : public PowerMonitorSource {
};
#endif // BUILDFLAG(IS_WIN)
#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN)
#if (BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_IOS_TVOS)) || BUILDFLAG(IS_WIN)
void PlatformInit();
void PlatformDestroy();
#endif // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN)