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

Unified Diff: chrome/browser/views/tabs/tab_strip.cc

Issue 275023: Adds some debugging code in hopes of isolating a crasher. From the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome/browser/views/tabs/tab_strip.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tabs/tab_strip.cc
===================================================================
--- chrome/browser/views/tabs/tab_strip.cc (revision 29021)
+++ chrome/browser/views/tabs/tab_strip.cc (working copy)
@@ -1192,6 +1192,37 @@
// the user is dragging.
if (IsAnimating() || tab->closing() || !HasAvailableDragActions())
return;
+ int index = GetIndexOfTab(tab);
+ if (!model_->ContainsIndex(index)) {
+ // It appears to be possible for a drag to start with an invalid tab.
+ // This records some extra information in hopes of tracking down why.
+ // The string contains the following, in order:
+ // . If a drag is already in progress, a 'D'.
+ // . Index of tab the user is dragging.
+ // . Number of tabs.
+ // . Size of the model.
+ // . Indices of any tabs that are being closed.
+ // . ! end marker.
+ std::string tmp;
+ if (drag_controller_.get())
+ tmp += "D";
+ tmp += " " + IntToString(index);
+ tmp += " " + IntToString(GetTabCount());
+ tmp += " " + IntToString(model_->count());
+ for (int i = 0; i < GetTabCount(); ++i) {
+ if (GetTabAt(i)->closing())
+ tmp += " " + IntToString(i);
+ }
+ tmp += "!"; // End marker so we know we got all closing tabs.
+
+ volatile char tab_state[128];
+ for (size_t i = 0; i < std::min(ARRAYSIZE_UNSAFE(tab_state),
+ tmp.size()); ++i) {
+ tab_state[i] = tmp[i];
+ }
+ CHECK(false);
+ return;
+ }
drag_controller_.reset(new DraggedTabController(tab, this));
drag_controller_->CaptureDragInfo(gfx::Point(event.x(), event.y()));
}
« no previous file with comments | « chrome/browser/views/tabs/tab_strip.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698