0

Fix namespaces for sampling_event_source and derived classes

Those files were recently moved from tools/mac/power/ to
components/power_metrics/ and the namespaces were not updated.

Change-Id: I7392e2802ae8663e435ce6c7b2dfff50471d223a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3335018
Auto-Submit: Patrick Monette <pmonette@chromium.org>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#952430}
This commit is contained in:
Patrick Monette
2021-12-16 17:52:29 +00:00
committed by Chromium LUCI CQ
parent e5bbb0c7e0
commit 4a7e45371b
8 changed files with 17 additions and 17 deletions

@ -10,7 +10,7 @@
#include "base/check.h"
#include "base/logging.h"
namespace power_sampler {
namespace power_metrics {
IOPMPowerSourceSamplingEventSource::IOPMPowerSourceSamplingEventSource() =
default;
@ -64,4 +64,4 @@ void IOPMPowerSourceSamplingEventSource::OnNotification(
self->callback_.Run();
}
} // namespace power_sampler
} // namespace power_metrics

@ -10,7 +10,7 @@
#include "base/mac/scoped_ioobject.h"
#include "components/power_metrics/sampling_event_source.h"
namespace power_sampler {
namespace power_metrics {
// Generates a sampling event when a state change notification is dispatched by
// the IOPMPowerSource service.
@ -35,6 +35,6 @@ class IOPMPowerSourceSamplingEventSource : public SamplingEventSource {
SamplingEventCallback callback_;
};
} // namespace power_sampler
} // namespace power_metrics
#endif // COMPONENTS_POWER_METRICS_IOPM_POWER_SOURCE_SAMPLING_EVENT_SOURCE_H_

@ -4,8 +4,8 @@
#include "components/power_metrics/sampling_event_source.h"
namespace power_sampler {
namespace power_metrics {
SamplingEventSource::~SamplingEventSource() = default;
} // namespace power_sampler
} // namespace power_metrics

@ -7,7 +7,7 @@
#include "base/callback_forward.h"
namespace power_sampler {
namespace power_metrics {
// Invokes a callback when a Sample should be requested from all Samplers.
class SamplingEventSource {
@ -21,6 +21,6 @@ class SamplingEventSource {
virtual bool Start(SamplingEventCallback callback) = 0;
};
} // namespace power_sampler
} // namespace power_metrics
#endif // COMPONENTS_POWER_METRICS_SAMPLING_EVENT_SOURCE_H_

@ -6,7 +6,7 @@
#include "base/check.h"
namespace power_sampler {
namespace power_metrics {
TimerSamplingEventSource::TimerSamplingEventSource(base::TimeDelta interval)
: interval_(interval) {}
@ -19,4 +19,4 @@ bool TimerSamplingEventSource::Start(SamplingEventCallback callback) {
return true;
}
} // namespace power_sampler
} // namespace power_metrics

@ -9,7 +9,7 @@
#include "base/timer/timer.h"
#include "components/power_metrics/sampling_event_source.h"
namespace power_sampler {
namespace power_metrics {
// Generates a sampling event at regular time intervals.
class TimerSamplingEventSource : public SamplingEventSource {
@ -27,6 +27,6 @@ class TimerSamplingEventSource : public SamplingEventSource {
base::RepeatingTimer timer_;
};
} // namespace power_sampler
} // namespace power_metrics
#endif // COMPONENTS_POWER_METRICS_TIMER_SAMPLING_EVENT_SOURCE_H_

@ -8,7 +8,7 @@
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace power_sampler {
namespace power_metrics {
TEST(TimerSamplingEventSourceTest, Basic) {
constexpr base::TimeDelta kDelay = base::Seconds(1);
@ -28,4 +28,4 @@ TEST(TimerSamplingEventSourceTest, Basic) {
EXPECT_EQ(11, num_callbacks);
}
} // namespace power_sampler
} // namespace power_metrics

@ -196,12 +196,12 @@ int main(int argc, char** argv) {
}
}
std::unique_ptr<power_sampler::SamplingEventSource> event_source;
std::unique_ptr<power_metrics::SamplingEventSource> event_source;
if (command_line.HasSwitch(kSwitchSampleOnNotification)) {
event_source =
std::make_unique<power_sampler::IOPMPowerSourceSamplingEventSource>();
std::make_unique<power_metrics::IOPMPowerSourceSamplingEventSource>();
} else {
event_source = std::make_unique<power_sampler::TimerSamplingEventSource>(
event_source = std::make_unique<power_metrics::TimerSamplingEventSource>(
sampling_interval);
}