https://bugs.webkit.org/show_bug.cgi?id=78022
Patch by Scott Graham <scottmg@chromium.org> on 2012-02-17
Reviewed by Darin Fisher.
Add #pragma pack around definition of shared memory structures to
avoid differences across compilers and platforms. Add COMPILE_ASSERT
to verify expected size.
* public/platform/WebGamepad.h:
(WebKit):
* public/platform/WebGamepads.h:
(WebKit):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108099
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-17 Scott Graham <scottmg@chromium.org>
+
+ [Chromium] pack Gamepad shared memory structure
+ https://bugs.webkit.org/show_bug.cgi?id=78022
+
+ Reviewed by Darin Fisher.
+
+ Add #pragma pack around definition of shared memory structures to
+ avoid differences across compilers and platforms. Add COMPILE_ASSERT
+ to verify expected size.
+
+ * public/platform/WebGamepad.h:
+ (WebKit):
+ * public/platform/WebGamepads.h:
+ (WebKit):
+
2012-02-17 Tim Dresser <tdresser@chromium.org>
[chromium] Refactor video drawing to be more data driven
#include "WebCommon.h"
+#if WEBKIT_IMPLEMENTATION
+#include <wtf/Assertions.h>
+#endif
+
namespace WebKit {
+#pragma pack(push, 1)
+
// This structure is intentionally POD and fixed size so that it can be shared
// memory between hardware polling threads and the rest of the browser. See
// also WebGamepads.h.
float buttons[buttonsLengthCap];
};
+#if WEBKIT_IMPLEMENTATION
+COMPILE_ASSERT(sizeof(WebGamepad) == 465, WebGamepad_has_wrong_size);
+#endif
+
+#pragma pack(pop)
+
}
#endif // WebGamepad_h
#include "WebGamepad.h"
+#if WEBKIT_IMPLEMENTATION
+#include <wtf/Assertions.h>
+#endif
+
namespace WebKit {
+#pragma pack(push, 1)
+
// 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.
WebGamepad items[itemsLengthCap];
};
+#if WEBKIT_IMPLEMENTATION
+COMPILE_ASSERT(sizeof(WebGamepads) == 1864, WebGamepads_has_wrong_size);
+#endif
+
+#pragma pack(pop)
+
}
#endif // WebGamepads_h