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

Side by Side Diff: chrome/browser/tabs/tab_strip_model.cc

Issue 6291011: Removes debugging code as cause of crash was found. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/tabs/tab_strip_model_order_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tabs/tab_strip_model.h" 5 #include "chrome/browser/tabs/tab_strip_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 TabContentsData* data = new TabContentsData(contents); 134 TabContentsData* data = new TabContentsData(contents);
135 data->pinned = pin; 135 data->pinned = pin;
136 if ((add_types & ADD_INHERIT_GROUP) && selected_contents) { 136 if ((add_types & ADD_INHERIT_GROUP) && selected_contents) {
137 if (foreground) { 137 if (foreground) {
138 // Forget any existing relationships, we don't want to make things too 138 // Forget any existing relationships, we don't want to make things too
139 // confusing by having multiple groups active at the same time. 139 // confusing by having multiple groups active at the same time.
140 ForgetAllOpeners(); 140 ForgetAllOpeners();
141 } 141 }
142 // Anything opened by a link we deem to have an opener. 142 // Anything opened by a link we deem to have an opener.
143 data->SetGroup(&selected_contents->controller()); 143 data->SetGroup(&selected_contents->controller());
144 // TODO(sky): nuke when we figure out what is causing 34135.
145 CHECK(data->opener != &(contents->controller()));
146 } else if ((add_types & ADD_INHERIT_OPENER) && selected_contents) { 144 } else if ((add_types & ADD_INHERIT_OPENER) && selected_contents) {
147 if (foreground) { 145 if (foreground) {
148 // Forget any existing relationships, we don't want to make things too 146 // Forget any existing relationships, we don't want to make things too
149 // confusing by having multiple groups active at the same time. 147 // confusing by having multiple groups active at the same time.
150 ForgetAllOpeners(); 148 ForgetAllOpeners();
151 } 149 }
152 data->opener = &selected_contents->controller(); 150 data->opener = &selected_contents->controller();
153 // TODO(sky): nuke when we figure out what is causing 34135.
154 CHECK(data->opener != &(contents->controller()));
155 } 151 }
156 152
157 contents_data_.insert(contents_data_.begin() + index, data); 153 contents_data_.insert(contents_data_.begin() + index, data);
158 154
159 if (index <= selected_index_) { 155 if (index <= selected_index_) {
160 // If a tab is inserted before the current selected index, 156 // If a tab is inserted before the current selected index,
161 // then |selected_index| needs to be incremented. 157 // then |selected_index| needs to be incremented.
162 ++selected_index_; 158 ++selected_index_;
163 } 159 }
164 160
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 InternalCloseTabs(closing_tabs, CLOSE_NONE); 202 InternalCloseTabs(closing_tabs, CLOSE_NONE);
207 } 203 }
208 204
209 TabContentsWrapper* TabStripModel::DetachTabContentsAt(int index) { 205 TabContentsWrapper* TabStripModel::DetachTabContentsAt(int index) {
210 if (contents_data_.empty()) 206 if (contents_data_.empty())
211 return NULL; 207 return NULL;
212 208
213 DCHECK(ContainsIndex(index)); 209 DCHECK(ContainsIndex(index));
214 210
215 TabContentsWrapper* removed_contents = GetContentsAt(index); 211 TabContentsWrapper* removed_contents = GetContentsAt(index);
216 // TODO(sky): nuke reason and old_data when we figure out what is causing 212 int next_selected_index = order_controller_->DetermineNewSelectedIndex(index);
217 // 34135.
218 volatile int reason = 0;
219 int next_selected_index =
220 order_controller_->DetermineNewSelectedIndex(index, &reason);
221 volatile TabContentsData old_data = *contents_data_.at(index);
222 delete contents_data_.at(index); 213 delete contents_data_.at(index);
223 contents_data_.erase(contents_data_.begin() + index); 214 contents_data_.erase(contents_data_.begin() + index);
224 ForgetOpenersAndGroupsReferencing(&(removed_contents->controller())); 215 ForgetOpenersAndGroupsReferencing(&(removed_contents->controller()));
225 if (empty()) 216 if (empty())
226 closing_all_ = true; 217 closing_all_ = true;
227 FOR_EACH_OBSERVER(TabStripModelObserver, observers_, 218 FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
228 TabDetachedAt(removed_contents, index)); 219 TabDetachedAt(removed_contents, index));
229 if (empty()) { 220 if (empty()) {
230 // TabDetachedAt() might unregister observers, so send |TabStripEmtpy()| in 221 // TabDetachedAt() might unregister observers, so send |TabStripEmtpy()| in
231 // a second pass. 222 // a second pass.
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 void TabStripModel::ForgetOpenersAndGroupsReferencing( 1016 void TabStripModel::ForgetOpenersAndGroupsReferencing(
1026 const NavigationController* tab) { 1017 const NavigationController* tab) {
1027 for (TabContentsDataVector::const_iterator i = contents_data_.begin(); 1018 for (TabContentsDataVector::const_iterator i = contents_data_.begin();
1028 i != contents_data_.end(); ++i) { 1019 i != contents_data_.end(); ++i) {
1029 if ((*i)->group == tab) 1020 if ((*i)->group == tab)
1030 (*i)->group = NULL; 1021 (*i)->group = NULL;
1031 if ((*i)->opener == tab) 1022 if ((*i)->opener == tab)
1032 (*i)->opener = NULL; 1023 (*i)->opener = NULL;
1033 } 1024 }
1034 } 1025 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tabs/tab_strip_model_order_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698