diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-19 02:27:39 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-19 02:27:39 +0000 |
commit | fb0c3927221612b0d43e88c22c47491a5ea5a8cc (patch) | |
tree | 352abfbe27cbf67aca9671de555ed8ee21b99528 /views | |
parent | 56528124c9042a99f13b327f2374356b1f460a5b (diff) | |
download | chromium_src-fb0c3927221612b0d43e88c22c47491a5ea5a8cc.zip chromium_src-fb0c3927221612b0d43e88c22c47491a5ea5a8cc.tar.gz chromium_src-fb0c3927221612b0d43e88c22c47491a5ea5a8cc.tar.bz2 |
Adds some debugging code to track crash. It seems as though
ClearNativeFocus in View::OnFocus is triggering 'this' to be
deleted. I couldn't readily find any views that do anything
interesting when the native focus changes, but this should help us
find out if that's true.
BUG=89439
TEST=none
R=ben@chromium.org
Review URL: http://codereview.chromium.org/7670077
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/view.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/views/view.cc b/views/view.cc index 136f52a..46c5ed2 100644 --- a/views/view.cc +++ b/views/view.cc @@ -82,6 +82,9 @@ ViewsDelegate* ViewsDelegate::views_delegate = NULL; // static char View::kViewClassName[] = "views/View"; +// TODO(sky): remove this when we figure out 89439. +static View* view_being_focused_ = NULL; + //////////////////////////////////////////////////////////////////////////////// // View, public: @@ -120,6 +123,8 @@ View::View() } View::~View() { + CHECK_NE(view_being_focused_, this); + if (parent_) parent_->RemoveChildView(this); @@ -979,8 +984,11 @@ FocusManager* View::GetFocusManager() { void View::RequestFocus() { FocusManager* focus_manager = GetFocusManager(); - if (focus_manager && IsFocusableInRootView()) + if (focus_manager && IsFocusableInRootView()) { + view_being_focused_ = this; focus_manager->SetFocusedView(this); + view_being_focused_ = NULL; + } } bool View::SkipDefaultKeyEventProcessing(const KeyEvent& event) { |