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

Side by Side Diff: device/gamepad/gamepad_shared_buffer.h

Issue 2466073002: Movw GamepadService out of content/browser/ and into device/ (Closed)
Patch Set: Fixed everything but one unittest Created 4 years, 1 month 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/gamepad/gamepad_service_unittest.cc ('k') | device/gamepad/gamepad_shared_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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_GAMEPAD_SHARED_BUFFER_H_ 5 #ifndef DEVICE_GAMEPAD_SHARED_BUFFER_H_
6 #define DEVICE_GAMEPAD_SHARED_BUFFER_H_ 6 #define DEVICE_GAMEPAD_SHARED_BUFFER_H_
7 7
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "device/base/synchronization/shared_memory_seqlock_buffer.h"
9 #include "device/gamepad/gamepad_export.h" 10 #include "device/gamepad/gamepad_export.h"
10 #include "third_party/WebKit/public/platform/WebGamepads.h" 11 #include "third_party/WebKit/public/platform/WebGamepads.h"
11 12
12 namespace device { 13 namespace device {
13 14
15 typedef SharedMemorySeqLockBuffer<blink::WebGamepads> GamepadHardwareBuffer;
16
14 class DEVICE_GAMEPAD_EXPORT GamepadSharedBuffer { 17 class DEVICE_GAMEPAD_EXPORT GamepadSharedBuffer {
15 public: 18 public:
16 virtual ~GamepadSharedBuffer() {} 19 GamepadSharedBuffer();
20 ~GamepadSharedBuffer();
17 21
18 virtual base::SharedMemory* shared_memory() = 0; 22 base::SharedMemory* shared_memory();
19 virtual blink::WebGamepads* buffer() = 0; 23 blink::WebGamepads* buffer();
24 GamepadHardwareBuffer* hardware_buffer();
20 25
21 virtual void WriteBegin() = 0; 26 void WriteBegin();
22 virtual void WriteEnd() = 0; 27 void WriteEnd();
28
29 private:
30 base::SharedMemory shared_memory_;
31 GamepadHardwareBuffer* hardware_buffer_;
23 }; 32 };
24 33
25 } // namespace device 34 } // namespace device
26 35
27 #endif // DEVICE_GAMEPAD_SHARED_BUFFER_H_ 36 #endif // DEVICE_GAMEPAD_SHARED_BUFFER_H_
OLDNEW
« no previous file with comments | « device/gamepad/gamepad_service_unittest.cc ('k') | device/gamepad/gamepad_shared_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698