#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "services/device/generic_sensor/platform_sensor_reader_linux.h"
#include <memory>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/sequence_checker.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/threading/sequence_bound.h"
#include "base/timer/timer.h"
#include "services/device/generic_sensor/linux/sensor_data_linux.h"
#include "services/device/generic_sensor/platform_sensor_linux.h"
#include "services/device/public/cpp/generic_sensor/sensor_reading.h"
namespace device {
class PollingSensorReader : public SensorReader { … };
PollingSensorReader::BlockingTaskRunnerHelper::BlockingTaskRunnerHelper(
base::WeakPtr<PollingSensorReader> polling_sensor_reader,
scoped_refptr<base::SequencedTaskRunner> task_runner,
const SensorInfoLinux& sensor_info)
: … { … }
PollingSensorReader::BlockingTaskRunnerHelper::~BlockingTaskRunnerHelper() { … }
void PollingSensorReader::BlockingTaskRunnerHelper::StartPolling(
double frequency) { … }
void PollingSensorReader::BlockingTaskRunnerHelper::StopPolling() { … }
void PollingSensorReader::BlockingTaskRunnerHelper::StopWithError() { … }
void PollingSensorReader::BlockingTaskRunnerHelper::PollForData() { … }
PollingSensorReader::PollingSensorReader(
const SensorInfoLinux& sensor_info,
base::WeakPtr<PlatformSensorLinux> sensor)
: … { … }
PollingSensorReader::~PollingSensorReader() { … }
void PollingSensorReader::StartFetchingData(
const PlatformSensorConfiguration& configuration) { … }
void PollingSensorReader::StopFetchingData() { … }
void PollingSensorReader::OnReadingAvailable(SensorReading reading) { … }
void PollingSensorReader::OnReadingError() { … }
std::unique_ptr<SensorReader> SensorReader::Create(
const SensorInfoLinux& sensor_info,
base::WeakPtr<PlatformSensorLinux> sensor) { … }
SensorReader::SensorReader(base::WeakPtr<PlatformSensorLinux> sensor)
: … { … }
SensorReader::~SensorReader() = default;
void SensorReader::NotifyReadError() { … }
}