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 #ifndef CONTENT_COMMON_DEVICE_MOTION_HARDWARE_BUFFER_H_ | |
| 6 #define CONTENT_COMMON_DEVICE_MOTION_HARDWARE_BUFFER_H_ | |
| 7 | |
| 8 #include "content/common/gamepad_seqlock.h" | |
| 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebDeviceMotionData .h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 /* | |
|
jamesr
2013/05/16 19:53:05
we pretty much never use /* style comments in chro
timvolodine
2013/05/20 18:18:48
it is actually used in gamepad_hardware_buffer, on
| |
| 14 This structure is stored in shared memory that's shared between the browser | |
| 15 which does the hardware polling, and the consumers of the device motion | |
| 16 data, i.e. the renderers. The performance characteristics are that | |
| 17 we want low latency (so would like to avoid explicit communication via IPC | |
| 18 between producer and consumer) and relatively large data size. | |
| 19 | |
| 20 Writer and reader operate on the same buffer assuming contention is low, and | |
| 21 contention is detected by using the associated SeqLock. | |
| 22 */ | |
| 23 | |
| 24 struct DeviceMotionHardwareBuffer { | |
| 25 GamepadSeqLock sequence; | |
|
jamesr
2013/05/16 19:53:06
Gamepad? What does this have to do with game pad?
timvolodine
2013/05/20 18:18:48
As a first step the GamepadLock can be used for sh
| |
| 26 WebKit::WebDeviceMotionData buffer; | |
| 27 | |
| 28 // This boolean flag indicates that the values in the buffer are reliable and | |
| 29 // ready for reading. This is needed in cases where no motion information is | |
| 30 // available, but the event should be fired anyway (with null values) | |
| 31 // according to spec: http://dev.w3.org/geo/api/spec-source-orientation.html. | |
| 32 bool is_ready_for_read; | |
| 33 }; | |
| 34 | |
| 35 } // namespace content | |
| 36 | |
| 37 #endif // CONTENT_COMMON_DEVICE_MOTION_HARDWARE_BUFFER_H_ | |
| OLD | NEW |