diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 21:29:26 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 21:29:26 +0000 |
commit | e411d0e99212aca1d30366c82a9266a58bfadd98 (patch) | |
tree | c62b5ccad00d4f8dc586dfd3c06b49d848506003 /chrome/browser/views/tabs/dragged_tab_controller.h | |
parent | 5e767712d2ebec5966472021c90f9700a8a6eda1 (diff) | |
download | chromium_src-e411d0e99212aca1d30366c82a9266a58bfadd98.zip chromium_src-e411d0e99212aca1d30366c82a9266a58bfadd98.tar.gz chromium_src-e411d0e99212aca1d30366c82a9266a58bfadd98.tar.bz2 |
Applying patch for Mohamed Mansour (reviewed by pkasting): http://codereview.chromium.org/16246
CRASH at Tab::OnMouseReleased
Some strange thing is happening that it crashes for view::HitTest, it can never
ENTER that function. It seems that the tab is being destroyed and as pkasting
stated on IRC:
"Part of this may be because our retarded Views designs can't distinguish which
buttons are being held versus clicked in these sorts of cases (I filed a bug on
this about a year and a half ago, internally)"
When a tab has ended dragging (EndDrag), if something was being dragged and you
end it, it actually cleans the TabDelegate and assigns its value to 'freed
memory' which is 0xfeeefeee. Therefore it crashes while dragging, because the
object no longer exists. I couldn't do if (delegate_) cause that always returns
true since delegate has 0xfeeefeee.
So I just changed the return type from void to bool for underlying EndDragImpl
and pumped it to tab.cc. That way, we can know if a tab is destroyed or not.
BUG=5819 (http://crbug.com/5819)
TEST=Dragging tabs around, closing while dragging, and closing tabs.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tabs/dragged_tab_controller.h')
-rw-r--r-- | chrome/browser/views/tabs/dragged_tab_controller.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.h b/chrome/browser/views/tabs/dragged_tab_controller.h index 8141c67..a509aff 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.h +++ b/chrome/browser/views/tabs/dragged_tab_controller.h @@ -57,8 +57,8 @@ class DraggedTabController : public TabContentsDelegate, // Complete the current drag session. If the drag session was canceled // because the user pressed Escape or something interrupted it, |canceled| // is true so the helper can revert the state to the world before the drag - // begun. - void EndDrag(bool canceled); + // begun. Returns whether the tab has been destroyed. + bool EndDrag(bool canceled); // Retrieve the source Tab if the TabContents specified matches the one being // dragged by this controller, or NULL if the specified TabContents is not @@ -186,8 +186,8 @@ class DraggedTabController : public TabContentsDelegate, // dragged TabContents. Tab* GetTabMatchingDraggedContents(TabStrip* tabstrip) const; - // Does the work for EndDrag. - void EndDragImpl(EndDragType how_end); + // Does the work for EndDrag. Returns whether the tab has been destroyed. + bool EndDragImpl(EndDragType how_end); // If the drag was aborted for some reason, this function is called to un-do // the changes made during the drag operation. |