Title: [108099] trunk/Source/WebKit/chromium
- Revision
- 108099
- Author
- [email protected]
- Date
- 2012-02-17 11:08:24 -0800 (Fri, 17 Feb 2012)
Log Message
[Chromium] pack Gamepad shared memory structure
https://bugs.webkit.org/show_bug.cgi?id=78022
Patch by Scott Graham <[email protected]> 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):
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (108098 => 108099)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-02-17 19:02:36 UTC (rev 108098)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-02-17 19:08:24 UTC (rev 108099)
@@ -1,3 +1,19 @@
+2012-02-17 Scott Graham <[email protected]>
+
+ [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 <[email protected]>
[chromium] Refactor video drawing to be more data driven
Modified: trunk/Source/WebKit/chromium/public/platform/WebGamepad.h (108098 => 108099)
--- trunk/Source/WebKit/chromium/public/platform/WebGamepad.h 2012-02-17 19:02:36 UTC (rev 108098)
+++ trunk/Source/WebKit/chromium/public/platform/WebGamepad.h 2012-02-17 19:08:24 UTC (rev 108099)
@@ -26,8 +26,14 @@
#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.
@@ -69,6 +75,12 @@
float buttons[buttonsLengthCap];
};
+#if WEBKIT_IMPLEMENTATION
+COMPILE_ASSERT(sizeof(WebGamepad) == 465, WebGamepad_has_wrong_size);
+#endif
+
+#pragma pack(pop)
+
}
#endif // WebGamepad_h
Modified: trunk/Source/WebKit/chromium/public/platform/WebGamepads.h (108098 => 108099)
--- trunk/Source/WebKit/chromium/public/platform/WebGamepads.h 2012-02-17 19:02:36 UTC (rev 108098)
+++ trunk/Source/WebKit/chromium/public/platform/WebGamepads.h 2012-02-17 19:08:24 UTC (rev 108099)
@@ -26,8 +26,14 @@
#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.
@@ -45,6 +51,12 @@
WebGamepad items[itemsLengthCap];
};
+#if WEBKIT_IMPLEMENTATION
+COMPILE_ASSERT(sizeof(WebGamepads) == 1864, WebGamepads_has_wrong_size);
+#endif
+
+#pragma pack(pop)
+
}
#endif // WebGamepads_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes