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 "base/logging.h" |
| 6 #include "data_fetcher_shared_memory.h" |
| 7 |
| 8 namespace content { |
| 9 |
| 10 DataFetcherSharedMemory::~DataFetcherSharedMemory() { |
| 11 NOTREACHED(); |
| 12 } |
| 13 |
| 14 DataFetcherSharedMemory* |
| 15 DataFetcherSharedMemory::instance() { |
| 16 CR_DEFINE_STATIC_LOCAL(SharedMemoryPlatformDataFetcherEmpty, |
| 17 s_data_fetcher, ()); |
| 18 return &s_data_fetcher; |
| 19 } |
| 20 |
| 21 bool DataFetcherSharedMemory::NeedsPolling() { |
| 22 return false; |
| 23 } |
| 24 |
| 25 bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() { |
| 26 NOTREACHED(); |
| 27 return false; |
| 28 } |
| 29 |
| 30 bool DataFetcherSharedMemory::StartFetchingDeviceMotionData( |
| 31 DeviceMotionHardwareBuffer* buffer) { |
| 32 DCHECK(buffer); |
| 33 device_motion_buffer_->seqlock.WriteBegin(); |
| 34 device_motion_buffer_->data.allAvailableSensorsAreActive = true; |
| 35 device_motion_buffer_->seqlock.WriteEnd(); |
| 36 return true; |
| 37 } |
| 38 |
| 39 void DataFetcherSharedMemory::StopFetchingDeviceMotionData() { |
| 40 device_motion_buffer_->seqlock.WriteBegin(); |
| 41 device_motion_buffer_->data.allAvailableSensorsAreActive = false; |
| 42 device_motion_buffer_->seqlock.WriteEnd(); |
| 43 } |
| 44 |
| 45 } // namespace content |
OLD | NEW |