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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 155548: Merge 20436 - Fix a crash that happens if a tab is closed while... (Closed) Base URL: svn://chrome-svn/chrome/branches/193/src/
Patch Set: Created 11 years, 5 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 | « base/base_drag_source.cc ('k') | chrome/browser/tab_contents/tab_contents_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 20694)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -1883,6 +1883,13 @@
}
void TabContents::Close(RenderViewHost* rvh) {
+ // If we close the tab while we're in the middle of a drag, we'll crash.
+ // Instead, cancel the drag and close it as soon as the drag ends.
+ if (view()->IsDoingDrag()) {
+ view()->CancelDragAndCloseTab();
+ return;
+ }
+
// Ignore this if it comes from a RenderViewHost that we aren't showing.
if (delegate() && rvh == render_view_host())
delegate()->CloseContents(this);
Property changes on: chrome\browser\tab_contents\tab_contents.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/tab_contents/tab_contents.cc:r20436
« no previous file with comments | « base/base_drag_source.cc ('k') | chrome/browser/tab_contents/tab_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698