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_SHARED_MEMORY_SEQLOCK_BUFFER_H_ | |
6 #define CONTENT_COMMON_SHARED_MEMORY_SEQLOCK_BUFFER_H_ | |
7 | |
8 #include "content/common/gamepad_seqlock.h" | |
9 | |
10 namespace content { | |
11 | |
12 // This structure is stored in shared memory that's shared between the browser | |
13 // which does the hardware polling, and the consumers of the device motion | |
14 // data, i.e. the renderers. The performance characteristics are that | |
15 // we want low latency (so would like to avoid explicit communication via IPC | |
16 // between producer and consumer) and relatively large data size. | |
17 // | |
18 // Writer and reader operate on the same buffer assuming contention is low, and | |
19 // contention is detected by using the associated SeqLock. | |
20 | |
21 template<class Data> | |
22 struct SharedMemorySeqLockBuffer { | |
23 GamepadSeqLock sequence; | |
darin (slow to review)
2013/06/17 20:23:44
nit: seems like GamepadSeqLock needs to be renamed
timvolodine
2013/06/18 16:44:31
Done.
renamed to OneWriterSeqLock.
| |
24 Data buffer; | |
darin (slow to review)
2013/06/17 20:23:44
nit: maybe "buffer" should be named "data" to matc
timvolodine
2013/06/18 16:44:31
absolutely agree, Done.
| |
25 bool is_ready_for_read; | |
26 }; | |
27 | |
28 } // namespace content | |
29 | |
30 #endif // CONTENT_COMMON_SHARED_MEMORY_SEQLOCK_BUFFER_H_ | |
OLD | NEW |