New issue
Advanced search Search tips

Issue 703863 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug



Sign in to add a comment

Remove GetCurrentItemIndex in NavigationManager

Project Member Reported by liaoyuke@chromium.org, Mar 21 2017

Issue description

GetCurrentItemIndex returns exactly same thing as GetLastCommittedItemIndex, and should be removed.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c833f1b7fee45abebea16b04eeaf62d198af3157

commit c833f1b7fee45abebea16b04eeaf62d198af3157
Author: liaoyuke <liaoyuke@chromium.org>
Date: Thu Mar 23 15:56:35 2017

Remove the concept of currentItemIndex

In NavigationManager and SessionController, the concept of current item
index is simply a duplicate of last committed item, and what's worse,
this results in GetCurrentItemIndex != GetItemIndex(GetCurrentItem),
which is counter-intuitive.

This CL removes the concept of currentItemIndex and converts callers to
use lastCommittedItemIndex instead.

This CL will diverges us from web content, but I think it's totally
worth it given that APIs containing "current" have become quite
untrustworthy, and removing this API will make our web code less
confusing.

NOTE: this CL doesn't touch the concept of currentItem.

BUG= 703863 

Review-Url: https://codereview.chromium.org/2766063002
Cr-Commit-Position: refs/heads/master@{#459097}

[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/components/sessions/ios/ios_live_tab.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/chrome/browser/native_app_launcher/native_app_navigation_util.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/chrome/browser/web/navigation_manager_util.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/shared/chrome/browser/tabs/web_state_list.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/shared/chrome/browser/tabs/web_state_list_order_controller_unittest.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/shared/chrome/browser/tabs/web_state_list_unittest.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/crw_session_controller+private_constructors.h
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/crw_session_controller.h
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/crw_session_controller.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/crw_session_controller_unittest.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/crw_session_storage_unittest.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/navigation_manager_impl.h
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/navigation_manager_impl.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/navigation_manager_impl_unittest.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/navigation/session_storage_builder.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/net/crw_ssl_status_updater_unittest.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/public/crw_session_storage.h
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/public/crw_session_storage.mm
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/public/navigation_manager.h
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/public/test/fakes/test_navigation_manager.h
[modify] https://crrev.com/c833f1b7fee45abebea16b04eeaf62d198af3157/ios/web/public/test/fakes/test_navigation_manager.mm

Status: Fixed (was: Started)

Sign in to add a comment