Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2374)

Unified Diff: device/generic_sensor/platform_sensor_reader_linux.cc

Issue 2878653002: Remove base::NonThreadSafe from //device/generic_sensor/ (Closed)
Patch Set: Remove base::NonThreadSafe from //device/generic_sensor/ Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/generic_sensor/platform_sensor_reader_linux.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/generic_sensor/platform_sensor_reader_linux.cc
diff --git a/device/generic_sensor/platform_sensor_reader_linux.cc b/device/generic_sensor/platform_sensor_reader_linux.cc
index bd750f3846233edc095e847497640d01435eb032..019df2636206dccee51bb43e722a40c2a05d9d02 100644
--- a/device/generic_sensor/platform_sensor_reader_linux.cc
+++ b/device/generic_sensor/platform_sensor_reader_linux.cc
@@ -64,26 +64,26 @@ PollingSensorReader::PollingSensorReader(
apply_scaling_func_(sensor_device->apply_scaling_func) {}
PollingSensorReader::~PollingSensorReader() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
}
void PollingSensorReader::StartFetchingData(
const PlatformSensorConfiguration& configuration) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (is_reading_active_)
StopFetchingData();
InitializeTimer(configuration);
}
void PollingSensorReader::StopFetchingData() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
is_reading_active_ = false;
timer_.Stop();
}
void PollingSensorReader::InitializeTimer(
const PlatformSensorConfiguration& configuration) {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!is_reading_active_);
timer_.Start(FROM_HERE, base::TimeDelta::FromMicroseconds(
base::Time::kMicrosecondsPerSecond /
@@ -93,7 +93,7 @@ void PollingSensorReader::InitializeTimer(
}
void PollingSensorReader::PollForData() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
SensorReading readings;
DCHECK_LE(sensor_file_paths_.size(), arraysize(readings.values));
@@ -143,15 +143,15 @@ SensorReader::SensorReader(
: sensor_(sensor),
task_runner_(std::move(task_runner)),
is_reading_active_(false) {
- thread_checker_.DetachFromThread();
+ DETACH_FROM_THREAD(thread_checker_);
}
SensorReader::~SensorReader() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
}
void SensorReader::NotifyReadError() {
- DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
if (is_reading_active_) {
task_runner_->PostTask(
FROM_HERE,
« no previous file with comments | « device/generic_sensor/platform_sensor_reader_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698