| 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 #ifndef DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ | 5 #ifndef SERVICES_DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ |
| 6 #define DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ | 6 #define SERVICES_DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
| 13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
| 16 #include "device/sensors/device_sensor_export.h" | |
| 17 #include "device/sensors/device_sensors_consts.h" | |
| 18 #include "mojo/public/cpp/system/buffer.h" | 16 #include "mojo/public/cpp/system/buffer.h" |
| 17 #include "services/device/sensors/device_sensor_export.h" |
| 18 #include "services/device/sensors/device_sensors_consts.h" |
| 19 | 19 |
| 20 namespace device { | 20 namespace device { |
| 21 | 21 |
| 22 class DataFetcherSharedMemory; | 22 class DataFetcherSharedMemory; |
| 23 | 23 |
| 24 // Owns the data fetcher for Device Motion and Orientation and keeps track of | 24 // Owns the data fetcher for Device Motion and Orientation and keeps track of |
| 25 // the number of consumers currently using the data. The data fetcher is stopped | 25 // the number of consumers currently using the data. The data fetcher is stopped |
| 26 // when there are no consumers. | 26 // when there are no consumers. |
| 27 class DEVICE_SENSOR_EXPORT DeviceSensorService | 27 class DEVICE_SENSOR_EXPORT DeviceSensorService |
| 28 : public base::MessageLoop::DestructionObserver { | 28 : public base::MessageLoop::DestructionObserver { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 int num_orientation_absolute_readers_; | 68 int num_orientation_absolute_readers_; |
| 69 bool is_shutdown_; | 69 bool is_shutdown_; |
| 70 std::unique_ptr<DataFetcherSharedMemory> data_fetcher_; | 70 std::unique_ptr<DataFetcherSharedMemory> data_fetcher_; |
| 71 base::ThreadChecker thread_checker_; | 71 base::ThreadChecker thread_checker_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(DeviceSensorService); | 73 DISALLOW_COPY_AND_ASSIGN(DeviceSensorService); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace device | 76 } // namespace device |
| 77 | 77 |
| 78 #endif // DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ | 78 #endif // SERVICES_DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ |
| OLD | NEW |