| OLD | NEW |
| 1 // Copyright (C) 2011, Google Inc. All rights reserved. | 1 // Copyright (C) 2011, Google Inc. All rights reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are met: | 4 // modification, are permitted provided that the following conditions are met: |
| 5 // | 5 // |
| 6 // 1. Redistributions of source code must retain the above copyright | 6 // 1. Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // 2. Redistributions in binary form must reproduce the above copyright | 8 // 2. Redistributions in binary form must reproduce the above copyright |
| 9 // notice, this list of conditions and the following disclaimer in the | 9 // notice, this list of conditions and the following disclaimer in the |
| 10 // documentation and/or other materials provided with the distribution. | 10 // documentation and/or other materials provided with the distribution. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 #pragma pack(push, 1) | 29 #pragma pack(push, 1) |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 // This structure is intentionally POD and fixed size so that it can be stored | 33 // This structure is intentionally POD and fixed size so that it can be stored |
| 34 // in shared memory between hardware polling threads and the rest of the | 34 // in shared memory between hardware polling threads and the rest of the |
| 35 // browser. | 35 // browser. |
| 36 class WebGamepads { | 36 class WebGamepads { |
| 37 public: | 37 public: |
| 38 WebGamepads() : length(0) {} | |
| 39 | |
| 40 static const size_t itemsLengthCap = 4; | 38 static const size_t itemsLengthCap = 4; |
| 41 | 39 |
| 42 // Number of valid entries in the items array. | |
| 43 unsigned length; | |
| 44 | |
| 45 // Gamepad data for N separate gamepad devices. | 40 // Gamepad data for N separate gamepad devices. |
| 46 WebGamepad items[itemsLengthCap]; | 41 WebGamepad items[itemsLengthCap]; |
| 47 }; | 42 }; |
| 48 | 43 |
| 49 #pragma pack(pop) | 44 #pragma pack(pop) |
| 50 } | 45 } |
| 51 | 46 |
| 52 #endif // WebGamepads_h | 47 #endif // WebGamepads_h |
| OLD | NEW |