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

Unified Diff: public/platform/WebGamepad.h

Issue 170993002: Updating Blink-side WebGamepad interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minor cleanups Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: public/platform/WebGamepad.h
diff --git a/public/platform/WebGamepad.h b/public/platform/WebGamepad.h
index 93df8a28b67adaa5022aa13843b26a0908fe5a67..f2bd49d17c93aa7385a23a5dabfba7ca48358117 100644
--- a/public/platform/WebGamepad.h
+++ b/public/platform/WebGamepad.h
@@ -40,6 +40,7 @@ namespace blink {
class WebGamepad {
public:
static const size_t idLengthCap = 128;
+ static const size_t mappingLengthCap = 16;
static const size_t axesLengthCap = 16;
static const size_t buttonsLengthCap = 32;
@@ -50,6 +51,7 @@ public:
, buttonsLength(0)
{
id[0] = 0;
+ mapping[0] = 0;
}
// Is there a gamepad connected at this index?
@@ -58,6 +60,9 @@ public:
// Device identifier (based on manufacturer, model, etc.).
WebUChar id[idLengthCap];
+ // Mapping type (for example "standard")
+ WebUChar mapping[mappingLengthCap];
+
// Monotonically increasing value referring to when the data were last
// updated.
unsigned long long timestamp;
@@ -71,12 +76,11 @@ public:
// Number of valid entries in the buttons array.
unsigned buttonsLength;
- // Normalized values representing buttons, in the range [0..1].
float buttons[buttonsLengthCap];
};
#if BLINK_IMPLEMENTATION
-COMPILE_ASSERT(sizeof(WebGamepad) == 465, WebGamepad_has_wrong_size);
+COMPILE_ASSERT(sizeof(WebGamepad) == 497, WebGamepad_has_wrong_size);
#endif
#pragma pack(pop)

Powered by Google App Engine
This is Rietveld 408576698