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

Unified Diff: ios/web/navigation/crw_session_controller.mm

Issue 2915303002: Added NavigationManager::GetIndexOfItem(). (Closed)
Patch Set: rebase Created 3 years, 7 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/web/navigation/crw_session_controller.h ('k') | ios/web/navigation/navigation_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/crw_session_controller.mm
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm
index 5b3e0c540ee7151db9cb2c38a73a0a1fc1b9c13f..dfdd73bd22ed97371e391f5996dd7e9e67002032 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -599,14 +599,14 @@ - (BOOL)isSameDocumentNavigationBetweenItem:(web::NavigationItem*)firstItem
andItem:(web::NavigationItem*)secondItem {
if (!firstItem || !secondItem || firstItem == secondItem)
return NO;
- NSUInteger firstIndex = [self indexOfItem:firstItem];
- NSUInteger secondIndex = [self indexOfItem:secondItem];
- if (firstIndex == NSNotFound || secondIndex == NSNotFound)
+ int firstIndex = [self indexOfItem:firstItem];
+ int secondIndex = [self indexOfItem:secondItem];
+ if (firstIndex == -1 || secondIndex == -1)
return NO;
- NSUInteger startIndex = firstIndex < secondIndex ? firstIndex : secondIndex;
- NSUInteger endIndex = firstIndex < secondIndex ? secondIndex : firstIndex;
+ int startIndex = firstIndex < secondIndex ? firstIndex : secondIndex;
+ int endIndex = firstIndex < secondIndex ? secondIndex : firstIndex;
- for (NSUInteger i = startIndex + 1; i <= endIndex; i++) {
+ for (int i = startIndex + 1; i <= endIndex; i++) {
web::NavigationItemImpl* item = self.items[i].get();
// Every item in the sequence has to be created from a hash change or
// pushState() call.
@@ -621,13 +621,13 @@ - (BOOL)isSameDocumentNavigationBetweenItem:(web::NavigationItem*)firstItem
return YES;
}
-- (NSInteger)indexOfItem:(const web::NavigationItem*)item {
+- (int)indexOfItem:(const web::NavigationItem*)item {
DCHECK(item);
for (size_t index = 0; index < self.items.size(); ++index) {
if (self.items[index].get() == item)
return index;
}
- return NSNotFound;
+ return -1;
}
- (web::NavigationItemImpl*)itemAtIndex:(NSInteger)index {
« no previous file with comments | « ios/web/navigation/crw_session_controller.h ('k') | ios/web/navigation/navigation_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698