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

Unified Diff: webkit/api/public/WebInputEvent.h

Issue 235038: Fix an uninitialized memory error reported by valgrind.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/public/WebInputEvent.h
===================================================================
--- webkit/api/public/WebInputEvent.h (revision 27358)
+++ webkit/api/public/WebInputEvent.h (working copy)
@@ -172,7 +172,11 @@
// http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for
// details). Other platforms don't have this concept, but it's just
// easier to leave it always false than ifdef.
- bool isSystemKey;
+ // int is used instead of bool to ensure the size of this structure is
+ // strictly aligned to a factor of 4 bytes, otherwise memory check tools
+ // like valgrind may complain about uninitialized memory usage when
+ // transfering it over the wire.
+ int isSystemKey;
WebKeyboardEvent(unsigned sizeParam = sizeof(WebKeyboardEvent))
: WebInputEvent(sizeParam)
@@ -233,8 +237,13 @@
float deltaY;
float wheelTicksX;
float wheelTicksY;
- bool scrollByPage;
+ // int is used instead of bool to ensure the size of this structure is
+ // strictly aligned to a factor of 4 bytes, otherwise memory check tools
+ // like valgrind may complain about uninitialized memory usage when
+ // transfering it over the wire.
+ int scrollByPage;
+
WebMouseWheelEvent(unsigned sizeParam = sizeof(WebMouseWheelEvent))
: WebMouseEvent(sizeParam)
, deltaX(0.0f)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698