diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 00:57:50 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 00:57:50 +0000 |
commit | 9368547c6b4d4a41117f99c6616faad0921d613a (patch) | |
tree | 38999856a04346a31d1ec896cc59c01290b5a7a8 /chrome/browser/external_tab_container.cc | |
parent | 883be7eb6ca869a87fa23e264a1a9905105c750e (diff) | |
download | chromium_src-9368547c6b4d4a41117f99c6616faad0921d613a.zip chromium_src-9368547c6b4d4a41117f99c6616faad0921d613a.tar.gz chromium_src-9368547c6b4d4a41117f99c6616faad0921d613a.tar.bz2 |
Fix a Chrome crash reported in chrome frame reliability test runs. The crash happens when the ExternalTabContainer is destroyed
and it attempts to unregister the accelerators via the focus manager. The call to GetFocusManager which is implemented by the widget
causes a pure virtual function error. I was able to repro this crash once and it looks like the ExternalTabContainer is valid at this
point.
Workaround is to remember the focus manager pointer during initialization and use the same during tear down.
Should fix bug http://code.google.com/p/chromium/issues/detail?id=42365
Bug=42365
Review URL: http://codereview.chromium.org/1734007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45393 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container.cc')
-rw-r--r-- | chrome/browser/external_tab_container.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index 42db662..0132be2 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -55,7 +55,8 @@ ExternalTabContainer::ExternalTabContainer( enabled_extension_automation_(false), waiting_for_unload_event_(false), pending_(false), - infobars_enabled_(true) { + infobars_enabled_(true), + focus_manager_(NULL) { } ExternalTabContainer::~ExternalTabContainer() { @@ -182,9 +183,8 @@ void ExternalTabContainer::Uninitialize() { tab_contents_ = NULL; } - views::FocusManager* focus_manager = GetFocusManager(); - if (focus_manager) { - focus_manager->UnregisterAccelerators(this); + if (focus_manager_) { + focus_manager_->UnregisterAccelerators(this); } request_context_ = NULL; @@ -234,7 +234,7 @@ void ExternalTabContainer::ProcessUnhandledAccelerator(const MSG& msg) { NativeWebKeyboardEvent keyboard_event(msg.hwnd, msg.message, msg.wParam, msg.lParam); unhandled_keyboard_event_handler_.HandleKeyboardEvent(keyboard_event, - GetFocusManager()); + focus_manager_); } void ExternalTabContainer::FocusThroughTabTraversal( @@ -895,8 +895,8 @@ void ExternalTabContainer::LoadAccelerators() { CopyAcceleratorTable(accelerator_table, accelerators, count); - views::FocusManager* focus_manager = GetFocusManager(); - DCHECK(focus_manager); + focus_manager_ = GetFocusManager(); + DCHECK(focus_manager_); // Let's fill our own accelerator table. for (int i = 0; i < count; ++i) { @@ -909,7 +909,8 @@ void ExternalTabContainer::LoadAccelerators() { accelerator_table_[accelerator] = accelerators[i].cmd; // Also register with the focus manager. - focus_manager->RegisterAccelerator(accelerator, this); + if (focus_manager_) + focus_manager_->RegisterAccelerator(accelerator, this); } } |