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

Unified Diff: chrome/browser/tabs/tab_strip_model.cc

Issue 7767010: Another round of debugging code. This time to TabStripModel. It seems (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/tabs/tab_strip_model.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tabs/tab_strip_model.cc
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 31349831f7ea831c58fbf61e5d675391076c45ee..23210025ba4c77e0f17188fb313ccf8016c01ed5 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -64,7 +64,8 @@ TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile)
: delegate_(delegate),
profile_(profile),
closing_all_(false),
- order_controller_(NULL) {
+ order_controller_(NULL),
+ magic_id_(0) {
DCHECK(delegate_);
registrar_.Add(this,
content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
@@ -76,10 +77,13 @@ TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile)
}
TabStripModel::~TabStripModel() {
+ magic_id_ = 0x1234567;
FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
TabStripModelDeleted());
- STLDeleteContainerPointers(contents_data_.begin(), contents_data_.end());
+ STLDeleteElements(&contents_data_);
delete order_controller_;
+ order_controller_ = NULL;
+ magic_id_ = 0x76543210;
}
void TabStripModel::AddObserver(TabStripModelObserver* observer) {
@@ -117,6 +121,7 @@ void TabStripModel::AppendTabContents(TabContentsWrapper* contents,
void TabStripModel::InsertTabContentsAt(int index,
TabContentsWrapper* contents,
int add_types) {
+ CHECK(wrapper);
bool active = add_types & ADD_ACTIVE;
// Force app tabs to be pinned.
bool pin =
@@ -169,7 +174,8 @@ void TabStripModel::InsertTabContentsAt(int index,
TabContentsWrapper* TabStripModel::ReplaceTabContentsAt(
int index,
TabContentsWrapper* new_contents) {
- DCHECK(ContainsIndex(index));
+ CHECK(new_contents);
+ CHECK(ContainsIndex(index));
TabContentsWrapper* old_contents = GetContentsAt(index);
ForgetOpenersAndGroupsReferencing(&(old_contents->controller()));
@@ -338,6 +344,8 @@ int TabStripModel::GetWrapperIndex(const TabContents* contents) const {
int index = 0;
TabContentsDataVector::const_iterator iter = contents_data_.begin();
for (; iter != contents_data_.end(); ++iter, ++index) {
+ CHECK(*iter) << magic_id_;
+ CHECK((*iter)->contents) << magic_id_;
if ((*iter)->contents->tab_contents() == contents)
return index;
}
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698