| 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 "content/browser/device_sensors/data_fetcher_shared_memory_base.h" | 5 #include "content/browser/device_sensors/data_fetcher_shared_memory_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
| 17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 18 #include "content/common/device_sensors/device_light_hardware_buffer.h" | 18 #include "device/sensors/public/cpp/device_light_hardware_buffer.h" |
| 19 #include "content/common/device_sensors/device_motion_hardware_buffer.h" | 19 #include "device/sensors/public/cpp/device_motion_hardware_buffer.h" |
| 20 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" | 20 #include "device/sensors/public/cpp/device_orientation_hardware_buffer.h" |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 size_t GetConsumerSharedMemoryBufferSize(ConsumerType consumer_type) { | 26 size_t GetConsumerSharedMemoryBufferSize(ConsumerType consumer_type) { |
| 27 switch (consumer_type) { | 27 switch (consumer_type) { |
| 28 case CONSUMER_TYPE_MOTION: | 28 case CONSUMER_TYPE_MOTION: |
| 29 return sizeof(DeviceMotionHardwareBuffer); | 29 return sizeof(DeviceMotionHardwareBuffer); |
| 30 case CONSUMER_TYPE_ORIENTATION: | 30 case CONSUMER_TYPE_ORIENTATION: |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 base::MessageLoop* DataFetcherSharedMemoryBase::GetPollingMessageLoop() const { | 238 base::MessageLoop* DataFetcherSharedMemoryBase::GetPollingMessageLoop() const { |
| 239 return polling_thread_ ? polling_thread_->message_loop() : nullptr; | 239 return polling_thread_ ? polling_thread_->message_loop() : nullptr; |
| 240 } | 240 } |
| 241 | 241 |
| 242 bool DataFetcherSharedMemoryBase::IsPollingTimerRunningForTesting() const { | 242 bool DataFetcherSharedMemoryBase::IsPollingTimerRunningForTesting() const { |
| 243 return polling_thread_ ? polling_thread_->IsTimerRunning() : false; | 243 return polling_thread_ ? polling_thread_->IsTimerRunning() : false; |
| 244 } | 244 } |
| 245 | 245 |
| 246 } // namespace content | 246 } // namespace content |
| OLD | NEW |