OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "data_fetcher_shared_memory.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 DataFetcherSharedMemory::~DataFetcherSharedMemory() { |
| 12 StopFetchingDeviceMotionData(); |
| 13 } |
| 14 |
| 15 bool DataFetcherSharedMemory::NeedsPolling() { |
| 16 return false; |
| 17 } |
| 18 |
| 19 bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() { |
| 20 NOTREACHED(); |
| 21 return false; |
| 22 } |
| 23 |
| 24 bool DataFetcherSharedMemory::StartFetchingDeviceMotionData( |
| 25 DeviceMotionHardwareBuffer* buffer) { |
| 26 DCHECK(buffer); |
| 27 device_motion_buffer_->seqlock.WriteBegin(); |
| 28 device_motion_buffer_->data.allAvailableSensorsAreActive = true; |
| 29 device_motion_buffer_->seqlock.WriteEnd(); |
| 30 return true; |
| 31 } |
| 32 |
| 33 void DataFetcherSharedMemory::StopFetchingDeviceMotionData() { |
| 34 device_motion_buffer_->seqlock.WriteBegin(); |
| 35 device_motion_buffer_->data.allAvailableSensorsAreActive = false; |
| 36 device_motion_buffer_->seqlock.WriteEnd(); |
| 37 } |
| 38 |
| 39 } // namespace content |
OLD | NEW |