| 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_DATA_FETCHER_SHARED_MEMORY_BASE_H_ | 5 #ifndef SERVICES_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ |
| 6 #define DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ | 6 #define SERVICES_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 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/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "device/sensors/device_sensor_export.h" | |
| 15 #include "device/sensors/device_sensors_consts.h" | |
| 16 #include "mojo/public/cpp/system/buffer.h" | 14 #include "mojo/public/cpp/system/buffer.h" |
| 15 #include "services/device/sensors/device_sensor_export.h" |
| 16 #include "services/device/sensors/device_sensors_consts.h" |
| 17 | 17 |
| 18 namespace device { | 18 namespace device { |
| 19 | 19 |
| 20 // Sensor data fetchers should derive from this base class and implement | 20 // Sensor data fetchers should derive from this base class and implement |
| 21 // the abstract Start() and Stop() methods. | 21 // the abstract Start() and Stop() methods. |
| 22 // If the fetcher requires polling it should also implement IsPolling() | 22 // If the fetcher requires polling it should also implement IsPolling() |
| 23 // to return true and the Fetch() method which will be called from the | 23 // to return true and the Fetch() method which will be called from the |
| 24 // polling thread to fetch data at regular intervals. | 24 // polling thread to fetch data at regular intervals. |
| 25 class DEVICE_SENSOR_EXPORT DataFetcherSharedMemoryBase { | 25 class DEVICE_SENSOR_EXPORT DataFetcherSharedMemoryBase { |
| 26 public: | 26 public: |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 using SharedMemoryMap = std::map<ConsumerType, | 93 using SharedMemoryMap = std::map<ConsumerType, |
| 94 std::pair<mojo::ScopedSharedBufferHandle, | 94 std::pair<mojo::ScopedSharedBufferHandle, |
| 95 mojo::ScopedSharedBufferMapping>>; | 95 mojo::ScopedSharedBufferMapping>>; |
| 96 SharedMemoryMap shared_memory_map_; | 96 SharedMemoryMap shared_memory_map_; |
| 97 | 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemoryBase); | 98 DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemoryBase); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace device | 101 } // namespace device |
| 102 | 102 |
| 103 #endif // DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ | 103 #endif // SERVICES_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ |
| OLD | NEW |