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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h"
6 6
7 #include "base/win/metro.h" 7 #include "base/win/metro.h"
8 #include "third_party/skia/include/core/SkPath.h" 8 #include "third_party/skia/include/core/SkPath.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/aura_constants.h" 10 #include "ui/aura/client/aura_constants.h"
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 return false; 758 return false;
759 } 759 }
760 760
761 bool DesktopRootWindowHostWin::HandleUntranslatedKeyEvent( 761 bool DesktopRootWindowHostWin::HandleUntranslatedKeyEvent(
762 const ui::KeyEvent& event) { 762 const ui::KeyEvent& event) {
763 scoped_ptr<ui::KeyEvent> duplicate_event(event.Copy()); 763 scoped_ptr<ui::KeyEvent> duplicate_event(event.Copy());
764 return static_cast<aura::RootWindowHostDelegate*>(root_window_)-> 764 return static_cast<aura::RootWindowHostDelegate*>(root_window_)->
765 OnHostKeyEvent(duplicate_event.get()); 765 OnHostKeyEvent(duplicate_event.get());
766 } 766 }
767 767
768 bool DesktopRootWindowHostWin::HandleTouchEvent( 768 void DesktopRootWindowHostWin::HandleTouchEvent(
769 const ui::TouchEvent& event) { 769 const ui::TouchEvent& event) {
770 return root_window_host_delegate_->OnHostTouchEvent( 770 // HWNDMessageHandler asynchronously processes touch events. Because of this
771 // it's possible for the aura::RootWindow to have been destroyed by the time
772 // we attempt to process them.
773 if (!GetWidget()->GetNativeView())
774 return;
775 root_window_host_delegate_->OnHostTouchEvent(
771 const_cast<ui::TouchEvent*>(&event)); 776 const_cast<ui::TouchEvent*>(&event));
772 } 777 }
773 778
774 bool DesktopRootWindowHostWin::HandleIMEMessage(UINT message, 779 bool DesktopRootWindowHostWin::HandleIMEMessage(UINT message,
775 WPARAM w_param, 780 WPARAM w_param,
776 LPARAM l_param, 781 LPARAM l_param,
777 LRESULT* result) { 782 LRESULT* result) {
778 MSG msg = {}; 783 MSG msg = {};
779 msg.hwnd = GetHWND(); 784 msg.hwnd = GetHWND();
780 msg.message = message; 785 msg.message = message;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 DesktopRootWindowHost* DesktopRootWindowHost::Create( 856 DesktopRootWindowHost* DesktopRootWindowHost::Create(
852 internal::NativeWidgetDelegate* native_widget_delegate, 857 internal::NativeWidgetDelegate* native_widget_delegate,
853 DesktopNativeWidgetAura* desktop_native_widget_aura, 858 DesktopNativeWidgetAura* desktop_native_widget_aura,
854 const gfx::Rect& initial_bounds) { 859 const gfx::Rect& initial_bounds) {
855 return new DesktopRootWindowHostWin(native_widget_delegate, 860 return new DesktopRootWindowHostWin(native_widget_delegate,
856 desktop_native_widget_aura, 861 desktop_native_widget_aura,
857 initial_bounds); 862 initial_bounds);
858 } 863 }
859 864
860 } // namespace views 865 } // namespace views
OLDNEW
« 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