| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/sensors/device_sensor_service.h" | 5 #include "services/device/sensors/device_sensor_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| 11 #include "device/sensors/data_fetcher_shared_memory.h" | 11 #include "services/device/sensors/data_fetcher_shared_memory.h" |
| 12 | 12 |
| 13 namespace device { | 13 namespace device { |
| 14 | 14 |
| 15 DeviceSensorService::DeviceSensorService() | 15 DeviceSensorService::DeviceSensorService() |
| 16 : num_light_readers_(0), | 16 : num_light_readers_(0), |
| 17 num_motion_readers_(0), | 17 num_motion_readers_(0), |
| 18 num_orientation_readers_(0), | 18 num_orientation_readers_(0), |
| 19 num_orientation_absolute_readers_(0), | 19 num_orientation_absolute_readers_(0), |
| 20 is_shutdown_(false) { | 20 is_shutdown_(false) { |
| 21 base::MessageLoop::current()->AddDestructionObserver(this); | 21 base::MessageLoop::current()->AddDestructionObserver(this); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 void DeviceSensorService::SetDataFetcherForTesting( | 115 void DeviceSensorService::SetDataFetcherForTesting( |
| 116 DataFetcherSharedMemory* test_data_fetcher) { | 116 DataFetcherSharedMemory* test_data_fetcher) { |
| 117 if (data_fetcher_) | 117 if (data_fetcher_) |
| 118 data_fetcher_->Shutdown(); | 118 data_fetcher_->Shutdown(); |
| 119 data_fetcher_.reset(test_data_fetcher); | 119 data_fetcher_.reset(test_data_fetcher); |
| 120 is_shutdown_ = false; | 120 is_shutdown_ = false; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace device | 123 } // namespace device |
| OLD | NEW |