summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 18:14:36 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 18:14:36 +0000
commit89d156b666af4d4f4c83579be31e9092155bbaf7 (patch)
tree86b7eae2f72ac787c08e524df8fcaab9ccf8b9ec
parentb322410675b8f505ef0820792a2494b4037d4c50 (diff)
downloadchromium_src-89d156b666af4d4f4c83579be31e9092155bbaf7.zip
chromium_src-89d156b666af4d4f4c83579be31e9092155bbaf7.tar.gz
chromium_src-89d156b666af4d4f4c83579be31e9092155bbaf7.tar.bz2
Fix a UMR that happens while trying to forward mouse events.
The input param gets clobbered so we need to make a copy before using it. TEST=Run chrome via valgrind and move the mouse over the content area. There should be no errors. Review URL: http://codereview.chromium.org/126081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18404 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index fff947a..fec161a 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1419,11 +1419,14 @@ gfx::Rect RenderViewHost::GetRootWindowResizerRect() const {
void RenderViewHost::ForwardMouseEvent(
const WebKit::WebMouseEvent& mouse_event) {
- RenderWidgetHost::ForwardMouseEvent(mouse_event);
+ // We make a copy of the mouse event because
+ // RenderWidgetHost::ForwardMouseEvent will delete |mouse_event|.
+ WebKit::WebMouseEvent event_copy(mouse_event);
+ RenderWidgetHost::ForwardMouseEvent(event_copy);
RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
if (view) {
- switch (mouse_event.type) {
+ switch (event_copy.type) {
case WebInputEvent::MouseMove:
view->HandleMouseEvent();
break;