Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: device/base/synchronization/shared_memory_seqlock_buffer.h

Issue 2358123005: Move OneWriterSeqLock and SharedMemorySeqLockBuffer from content/ to device/base/synchronization (Closed)
Patch Set: Tim fixes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/base/synchronization/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_BASE_SYNCHRONIZATION_SHARED_MEMORY_SEQLOCK_BUFFER_H_ 5 #ifndef DEVICE_BASE_SYNCHRONIZATION_SHARED_MEMORY_SEQLOCK_BUFFER_H_
6 #define DEVICE_BASE_SYNCHRONIZATION_SHARED_MEMORY_SEQLOCK_BUFFER_H_ 6 #define DEVICE_BASE_SYNCHRONIZATION_SHARED_MEMORY_SEQLOCK_BUFFER_H_
7 7
8 #include "device/base/synchronization/one_writer_seqlock.h" 8 #include "device/base/synchronization/one_writer_seqlock.h"
9 9
10 namespace device { 10 namespace device {
11 11
12 // This structure is stored in shared memory that's shared between the browser 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 data, 13 // which does the hardware polling, and the consumers of the data,
14 // i.e. the renderers. The performance characteristics are that 14 // i.e. the renderers. The performance characteristics are that
15 // we want low latency (so would like to avoid explicit communication via IPC 15 // we want low latency (so would like to avoid explicit communication via IPC
16 // between producer and consumer) and relatively large data size. 16 // between producer and consumer) and relatively large data size.
17 // 17 //
18 // Writer and reader operate on the same buffer assuming contention is low, and 18 // Writer and reader operate on the same buffer assuming contention is low, and
19 // contention is detected by using the associated SeqLock. 19 // contention is detected by using the associated SeqLock.
20 20
21 template <class Data> 21 template <class Data>
22 class SharedMemorySeqLockBuffer { 22 class SharedMemorySeqLockBuffer {
23 public: 23 public:
24 OneWriterSeqLock seqlock; 24 OneWriterSeqLock seqlock;
25 Data data; 25 Data data;
26 }; 26 };
27 27
28 } // namespace device 28 } // namespace device
29 29
30 #endif // DEVICE_CORE_SHARED_MEMORY_SEQLOCK_BUFFER_H_ 30 #endif // DEVICE_BASE_SYNCHRONIZATION_SHARED_MEMORY_SEQLOCK_BUFFER_H_
OLDNEW
« no previous file with comments | « device/base/synchronization/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698