Chromium Code Reviews| Index: device/gamepad/public/cpp/gamepads.h |
| diff --git a/device/gamepad/public/cpp/gamepads.h b/device/gamepad/public/cpp/gamepads.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..006ea4690c36ecd9b695aeec67c62d6481441dc5 |
| --- /dev/null |
| +++ b/device/gamepad/public/cpp/gamepads.h |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef DEVICE_GAMEPAD_PUBLIC_CPP_GAMEPADS_H_ |
| +#define DEVICE_GAMEPAD_PUBLIC_CPP_GAMEPADS_H_ |
| + |
| +#include "device/gamepad/public/cpp/gamepad.h" |
| + |
| +namespace device { |
| + |
| +#pragma pack(push, 4) |
| + |
| +// This structure is intentionally POD and fixed size so that it can be stored |
| +// in shared memory between hardware polling threads and the rest of the |
| +// browser. |
| +class Gamepads { |
| + public: |
| + static const size_t kItemsLengthCap = 4; |
|
dcheng
2017/04/12 23:33:27
Nit: constexpr
juncai
2017/04/13 23:55:52
Done.
|
| + |
| + // Gamepad data for N separate gamepad devices. |
| + Gamepad items[kItemsLengthCap]; |
| +}; |
| + |
| +#pragma pack(pop) |
| + |
| +} // namespace device |
| + |
| +#endif // DEVICE_GAMEPAD_PUBLIC_CPP_GAMEPADS_H_ |