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

Side by Side Diff: content/common/device_motion_hardware_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: implemented async messaging for obtaining the shared memory handle 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_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/public/platform/WebDeviceMotionData.h"
10
11 namespace content {
12
13 // This structure is stored in shared memory that's shared between the browser
14 // which does the hardware polling, and the consumers of the device motion
15 // data, i.e. the renderers. The performance characteristics are that
16 // we want low latency (so would like to avoid explicit communication via IPC
17 // between producer and consumer) and relatively large data size.
18 //
19 // Writer and reader operate on the same buffer assuming contention is low, and
20 // contention is detected by using the associated SeqLock.
21
22 struct DeviceMotionHardwareBuffer {
23 GamepadSeqLock sequence;
24 WebKit::WebDeviceMotionData buffer;
25
26 // This boolean flag indicates that the values in the buffer are reliable and
27 // ready for reading. This is needed in cases where no motion information is
28 // available, but the event should be fired anyway (with null values)
29 // according to spec: http://dev.w3.org/geo/api/spec-source-orientation.html.
30 bool is_ready_for_read;
31 };
32
33 } // namespace content
34
35 #endif // CONTENT_COMMON_DEVICE_MOTION_HARDWARE_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698