Chromium Code Reviews| 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 } | |
| 12 | |
| 13 DataFetcherSharedMemory* | |
| 14 DataFetcherSharedMemory::instance() { | |
| 15 CR_DEFINE_STATIC_LOCAL(SharedMemoryPlatformDataFetcherEmpty, | |
| 16 s_data_fetcher, ()); | |
| 17 return &s_data_fetcher; | |
| 18 } | |
| 19 | |
| 20 bool DataFetcherSharedMemory::NeedsPolling() { | |
| 21 return false; | |
| 22 } | |
| 23 | |
| 24 bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() { | |
| 25 DCHECK(NeedsPolling()); | |
|
bulach
2013/07/09 09:03:29
nit: NOTREACHED() ?
timvolodine
2013/07/09 18:59:56
Done.
| |
| 26 return false; | |
| 27 } | |
| 28 | |
| 29 bool DataFetcherSharedMemory::StartFetchingDeviceMotionData( | |
| 30 DeviceMotionHardwareBuffer* buffer) { | |
| 31 DCHECK(buffer); | |
| 32 device_motion_buffer_->seqlock.WriteBegin(); | |
| 33 device_motion_buffer_->data.allAvailableSensorsAreActive = true; | |
| 34 device_motion_buffer_->seqlock.WriteEnd(); | |
| 35 return true; | |
| 36 } | |
| 37 | |
| 38 void DataFetcherSharedMemory::StopFetchingDeviceMotionData() { | |
| 39 device_motion_buffer_->seqlock.WriteBegin(); | |
| 40 device_motion_buffer_->data.allAvailableSensorsAreActive = false; | |
| 41 device_motion_buffer_->seqlock.WriteEnd(); | |
| 42 } | |
| 43 | |
| 44 } // namespace content | |
| OLD | NEW |