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

Unified Diff: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc

Issue 23619025: Fix use after free when handling async touch events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 7 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 | « ui/views/widget/desktop_aura/desktop_root_window_host_win.h ('k') | ui/views/widget/native_widget_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
index d81aeb84a9b4c8d70f7811cdd61d019d2a58f52e..63f6be3f504a3bb56f16ee703610531b23a44bd3 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
@@ -765,9 +765,14 @@ bool DesktopRootWindowHostWin::HandleUntranslatedKeyEvent(
OnHostKeyEvent(duplicate_event.get());
}
-bool DesktopRootWindowHostWin::HandleTouchEvent(
+void DesktopRootWindowHostWin::HandleTouchEvent(
const ui::TouchEvent& event) {
- return root_window_host_delegate_->OnHostTouchEvent(
+ // HWNDMessageHandler asynchronously processes touch events. Because of this
+ // it's possible for the aura::RootWindow to have been destroyed by the time
+ // we attempt to process them.
+ if (!GetWidget()->GetNativeView())
+ return;
+ root_window_host_delegate_->OnHostTouchEvent(
const_cast<ui::TouchEvent*>(&event));
}
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_win.h ('k') | ui/views/widget/native_widget_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698