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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10966023: Fix the crash that could occur when the window is closed while web contents drag is in progress. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo per feedback Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c41f658a6a44d9aa5e0dbbcc28fef75cd7e2ae33..24033f8456b714819b3ec2734b05babee9a61f6b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2816,9 +2816,6 @@ void WebContentsImpl::Close(RenderViewHost* rvh) {
// mouse-down and mouse-up in text selection or a button click.
// Defer the close until after tracking is complete, so that we
// don't free objects out from under the UI.
- // TODO(shess): This could probably be integrated with the
- // IsDoingDrag() test below. Punting for now because I need more
- // research to understand how this impacts platforms other than Mac.
// TODO(shess): This could get more fine-grained. For instance,
// closing a tab in another window while selecting text in the
// current window's Omnibox should be just fine.
@@ -2827,13 +2824,6 @@ void WebContentsImpl::Close(RenderViewHost* rvh) {
return;
}
- // 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 (GetView()->IsDoingDrag()) {
- GetView()->CancelDragAndCloseTab();
- return;
- }
-
// Ignore this if it comes from a RenderViewHost that we aren't showing.
if (delegate_ && rvh == GetRenderViewHost())
delegate_->CloseContents(this);

Powered by Google App Engine
This is Rietveld 408576698