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

Side by Side Diff: content/common/shared_memory_seqlock_buffer.h

Issue 14678012: Implement the content/renderer and content/browser part of the Device Motion API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: similarity=70 Created 7 years, 6 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
OLDNEW
(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/one_writer_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 data,
14 // 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 class SharedMemorySeqLockBufferBase {
darin (slow to review) 2013/06/27 17:33:26 Why do we need to carve out a Base class in this c
timvolodine 2013/06/27 21:08:43 ok, I've removed this base class and added an extr
22 public:
23 OneWriterSeqLock seqlock;
24 };
25
26 template<class Data>
27 class SharedMemorySeqLockBuffer : public SharedMemorySeqLockBufferBase {
28 public:
29 Data data;
30 };
31
32 } // namespace content
33
34 #endif // CONTENT_COMMON_SHARED_MEMORY_SEQLOCK_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698