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

Unified Diff: ios/chrome/browser/tabs/tab_model_observers_bridge.mm

Issue 2712743008: Remove -insertTabWithWebState:atIndex: from TabModel. (Closed)
Patch Set: Rebase. Created 3 years, 10 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 | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_model_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_model_observers_bridge.mm
diff --git a/ios/chrome/browser/tabs/tab_model_observers_bridge.mm b/ios/chrome/browser/tabs/tab_model_observers_bridge.mm
index 780f14739dac169e11625af34ac41f41b710bf1a..df7be5f10cb365ea4928168c57798085d5734600 100644
--- a/ios/chrome/browser/tabs/tab_model_observers_bridge.mm
+++ b/ios/chrome/browser/tabs/tab_model_observers_bridge.mm
@@ -80,10 +80,14 @@
oldWebState:(web::WebState*)oldWebState
atIndex:(int)atIndex
userAction:(BOOL)userAction {
- DCHECK_GE(atIndex, 0);
if (!newWebState)
return;
+ // If there is no new active WebState, then it means that the atIndex will be
+ // set to WebStateList::kInvalidIndex, so only check for a positive index if
+ // there is a new WebState.
+ DCHECK_GE(atIndex, 0);
+
Tab* oldTab =
oldWebState ? LegacyTabHelper::GetTabForWebState(oldWebState) : nil;
[_tabModelObservers tabModel:_tabModel
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.mm ('k') | ios/chrome/browser/tabs/tab_model_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698