summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-26 05:28:10 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-26 05:28:10 +0000
commite09220af6b6acfad612e5cc90009113bf37fee0e (patch)
tree8b8b7e47d4304884e388dceac39c763d93eed1ad /content
parent68058112868010b16e3e3fa419c54f2a0d8b7806 (diff)
downloadchromium_src-e09220af6b6acfad612e5cc90009113bf37fee0e.zip
chromium_src-e09220af6b6acfad612e5cc90009113bf37fee0e.tar.gz
chromium_src-e09220af6b6acfad612e5cc90009113bf37fee0e.tar.bz2
Avoid the need for a valgrind suppression by initializing memory
fully. The use of memcmp to compare two WebMouseEvent objects causes us to need to worry about how the structure padding is initialized. R=jamesr@chromium.org BUG=102622 Review URL: https://chromiumcodereview.appspot.com/10445048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139190 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/gpu/input_event_filter_unittest.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/content/renderer/gpu/input_event_filter_unittest.cc b/content/renderer/gpu/input_event_filter_unittest.cc
index 0923caf..b264417 100644
--- a/content/renderer/gpu/input_event_filter_unittest.cc
+++ b/content/renderer/gpu/input_event_filter_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -93,6 +93,9 @@ class IPCMessageRecorder : public IPC::Channel::Listener {
void InitMouseEvent(WebMouseEvent* event, WebInputEvent::Type type,
int x, int y) {
+ // Avoid valgrind false positives by initializing memory completely.
+ memset(event, 0, sizeof(*event));
+
new (event) WebMouseEvent();
event->type = type;
event->x = x;