Relanding docus manager crasher work-around.

TBR=ben
Review URL: http://codereview.chromium.org/12685

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6050 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc
index 9bdca3c1..faabb543 100644
--- a/chrome/browser/tab_contents.cc
+++ b/chrome/browser/tab_contents.cc
@@ -46,7 +46,8 @@
       shelf_visible_(false),
       max_page_id_(-1),
       blocked_popups_(NULL),
-      capturing_contents_(false) {
+      capturing_contents_(false),
+      is_being_destroyed_(false) {
   last_focused_view_storage_id_ =
       views::ViewStorage::GetSharedInstance()->CreateStorageID();
 }
@@ -75,6 +76,11 @@
 }
 
 void TabContents::Destroy() {
+  // TODO(jcampan): reenable that DCHECK. It seems to cause the RendererCrash
+  //                ui tests to hang for some unclear reason.
+  // DCHECK(!is_being_destroyed_);
+  is_being_destroyed_ = true;
+
   // First cleanly close all child windows.
   // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked
   // some of these to close.  CloseWindows is async, so it might get called