| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void DataFetcherSharedMemoryBase::Fetch(unsigned consumer_bitmask) { | 200 void DataFetcherSharedMemoryBase::Fetch(unsigned consumer_bitmask) { |
| 201 NOTIMPLEMENTED(); | 201 NOTIMPLEMENTED(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 DataFetcherSharedMemoryBase::FetcherType | 204 DataFetcherSharedMemoryBase::FetcherType |
| 205 DataFetcherSharedMemoryBase::GetType() const { | 205 DataFetcherSharedMemoryBase::GetType() const { |
| 206 return FETCHER_TYPE_DEFAULT; | 206 return FETCHER_TYPE_DEFAULT; |
| 207 } | 207 } |
| 208 | 208 |
| 209 base::TimeDelta DataFetcherSharedMemoryBase::GetInterval() const { | 209 base::TimeDelta DataFetcherSharedMemoryBase::GetInterval() const { |
| 210 return base::TimeDelta::FromMilliseconds(kInertialSensorIntervalMillis); | 210 return base::TimeDelta::FromMicroseconds(kInertialSensorIntervalMicroseconds); |
| 211 } | 211 } |
| 212 | 212 |
| 213 base::SharedMemory* DataFetcherSharedMemoryBase::GetSharedMemory( | 213 base::SharedMemory* DataFetcherSharedMemoryBase::GetSharedMemory( |
| 214 ConsumerType consumer_type) { | 214 ConsumerType consumer_type) { |
| 215 SharedMemoryMap::const_iterator it = shared_memory_map_.find(consumer_type); | 215 SharedMemoryMap::const_iterator it = shared_memory_map_.find(consumer_type); |
| 216 if (it != shared_memory_map_.end()) | 216 if (it != shared_memory_map_.end()) |
| 217 return it->second; | 217 return it->second; |
| 218 | 218 |
| 219 size_t buffer_size = GetConsumerSharedMemoryBufferSize(consumer_type); | 219 size_t buffer_size = GetConsumerSharedMemoryBufferSize(consumer_type); |
| 220 if (buffer_size == 0) | 220 if (buffer_size == 0) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 242 | 242 |
| 243 base::MessageLoop* DataFetcherSharedMemoryBase::GetPollingMessageLoop() const { | 243 base::MessageLoop* DataFetcherSharedMemoryBase::GetPollingMessageLoop() const { |
| 244 return polling_thread_ ? polling_thread_->message_loop() : NULL; | 244 return polling_thread_ ? polling_thread_->message_loop() : NULL; |
| 245 } | 245 } |
| 246 | 246 |
| 247 bool DataFetcherSharedMemoryBase::IsPollingTimerRunningForTesting() const { | 247 bool DataFetcherSharedMemoryBase::IsPollingTimerRunningForTesting() const { |
| 248 return polling_thread_ ? polling_thread_->IsTimerRunning() : false; | 248 return polling_thread_ ? polling_thread_->IsTimerRunning() : false; |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace content | 251 } // namespace content |
| OLD | NEW |