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_platform.h" | |
| 7 | |
| 8 namespace content { | |
| 9 | |
| 10 SharedMemoryPlatformDataFetcherEmpty::SharedMemoryPlatformDataFetcherEmpty() | |
| 11 : device_motion_buffer_(0) { | |
|
bulach
2013/07/04 08:23:36
nit: NULL
timvolodine
2013/07/04 12:02:52
Done.
| |
| 12 } | |
| 13 | |
| 14 SharedMemoryPlatformDataFetcherEmpty* | |
| 15 SharedMemoryPlatformDataFetcherEmpty::instance() { | |
| 16 CR_DEFINE_STATIC_LOCAL(SharedMemoryPlatformDataFetcherEmpty, | |
| 17 s_data_fetcher, ()); | |
| 18 return &s_data_fetcher; | |
| 19 } | |
| 20 | |
| 21 bool SharedMemoryPlatformDataFetcherEmpty::NeedsPolling() { | |
| 22 return false; | |
| 23 } | |
| 24 | |
| 25 bool SharedMemoryPlatformDataFetcherEmpty::FetchDeviceMotionDataIntoBuffer() { | |
| 26 DCHECK(NeedsPolling()); | |
| 27 return false; | |
| 28 } | |
| 29 | |
| 30 bool SharedMemoryPlatformDataFetcherEmpty::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 SharedMemoryPlatformDataFetcherEmpty::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 |