diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-24 21:59:32 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-24 21:59:32 +0000 |
commit | e07c75e4a0eae9c4e0416e5d4b1aee32327210d8 (patch) | |
tree | cf4992b6e7b42568b9d990ed0d3ba1eedc3cff3c | |
parent | c4f02c4b5e4c5bc9f38b65dfde707b0b83b3e147 (diff) | |
download | chromium_src-e07c75e4a0eae9c4e0416e5d4b1aee32327210d8.zip chromium_src-e07c75e4a0eae9c4e0416e5d4b1aee32327210d8.tar.gz chromium_src-e07c75e4a0eae9c4e0416e5d4b1aee32327210d8.tar.bz2 |
Removes debugging code as cause of crash was found.
I'm TBRing as this is just a removing of unneeded CHECKs.
BUG=34135
TEST=none
TBR=ben@chromium.org
Review URL: http://codereview.chromium.org/6291011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72396 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 11 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model_order_controller.cc | 21 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model_order_controller.h | 3 |
3 files changed, 8 insertions, 27 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index d6e5bc1..b58eb903 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -141,8 +141,6 @@ void TabStripModel::InsertTabContentsAt(int index, } // Anything opened by a link we deem to have an opener. data->SetGroup(&selected_contents->controller()); - // TODO(sky): nuke when we figure out what is causing 34135. - CHECK(data->opener != &(contents->controller())); } else if ((add_types & ADD_INHERIT_OPENER) && selected_contents) { if (foreground) { // Forget any existing relationships, we don't want to make things too @@ -150,8 +148,6 @@ void TabStripModel::InsertTabContentsAt(int index, ForgetAllOpeners(); } data->opener = &selected_contents->controller(); - // TODO(sky): nuke when we figure out what is causing 34135. - CHECK(data->opener != &(contents->controller())); } contents_data_.insert(contents_data_.begin() + index, data); @@ -213,12 +209,7 @@ TabContentsWrapper* TabStripModel::DetachTabContentsAt(int index) { DCHECK(ContainsIndex(index)); TabContentsWrapper* removed_contents = GetContentsAt(index); - // TODO(sky): nuke reason and old_data when we figure out what is causing - // 34135. - volatile int reason = 0; - int next_selected_index = - order_controller_->DetermineNewSelectedIndex(index, &reason); - volatile TabContentsData old_data = *contents_data_.at(index); + int next_selected_index = order_controller_->DetermineNewSelectedIndex(index); delete contents_data_.at(index); contents_data_.erase(contents_data_.begin() + index); ForgetOpenersAndGroupsReferencing(&(removed_contents->controller())); diff --git a/chrome/browser/tabs/tab_strip_model_order_controller.cc b/chrome/browser/tabs/tab_strip_model_order_controller.cc index 52730ef..bd309fa 100644 --- a/chrome/browser/tabs/tab_strip_model_order_controller.cc +++ b/chrome/browser/tabs/tab_strip_model_order_controller.cc @@ -64,7 +64,7 @@ int TabStripModelOrderController::DetermineInsertionIndexForAppending() { } int TabStripModelOrderController::DetermineNewSelectedIndex( - int removing_index, volatile int* reason) const { + int removing_index) const { int tab_count = tabstrip_->count(); DCHECK(removing_index >= 0 && removing_index < tab_count); NavigationController* parent_opener = @@ -75,43 +75,34 @@ int TabStripModelOrderController::DetermineNewSelectedIndex( NavigationController* removed_controller = &tabstrip_->GetTabContentsAt(removing_index)->controller(); // The parent opener should never be the same as the controller being removed. - CHECK(parent_opener != removed_controller); + DCHECK(parent_opener != removed_controller); int index = tabstrip_->GetIndexOfNextTabContentsOpenedBy(removed_controller, removing_index, false); - if (index != TabStripModel::kNoTab) { - *reason = 1; + if (index != TabStripModel::kNoTab) return GetValidIndex(index, removing_index); - } if (parent_opener) { // If the tab was in a group, shift selection to the next tab in the group. int index = tabstrip_->GetIndexOfNextTabContentsOpenedBy(parent_opener, removing_index, false); - if (index != TabStripModel::kNoTab) { - *reason = 2; + if (index != TabStripModel::kNoTab) return GetValidIndex(index, removing_index); - } // If we can't find a subsequent group member, just fall back to the // parent_opener itself. Note that we use "group" here since opener is // reset by select operations.. index = tabstrip_->GetIndexOfController(parent_opener); - if (index != TabStripModel::kNoTab) { - *reason = 3; + if (index != TabStripModel::kNoTab) return GetValidIndex(index, removing_index); - } } // No opener set, fall through to the default handler... int selected_index = tabstrip_->selected_index(); - if (selected_index >= (tab_count - 1)) { - *reason = 4; + if (selected_index >= (tab_count - 1)) return selected_index - 1; - } - *reason = 5; return selected_index; } diff --git a/chrome/browser/tabs/tab_strip_model_order_controller.h b/chrome/browser/tabs/tab_strip_model_order_controller.h index 2f36291..5ecaa2c 100644 --- a/chrome/browser/tabs/tab_strip_model_order_controller.h +++ b/chrome/browser/tabs/tab_strip_model_order_controller.h @@ -40,8 +40,7 @@ class TabStripModelOrderController : public TabStripModelObserver { int DetermineInsertionIndexForAppending(); // Determine where to shift selection after a tab is closed. - // TODO(sky): nuke reason when we figure out what is causing 34135. - int DetermineNewSelectedIndex(int removed_index, volatile int* reason) const; + int DetermineNewSelectedIndex(int removed_index) const; // Overridden from TabStripModelObserver: virtual void TabSelectedAt(TabContentsWrapper* old_contents, |