New issue
Advanced search Search tips

Issue 704332 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Task



Sign in to add a comment

NavigationManager:GetItemCount is confusing

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

Issue description

In NavigationManager, GetItemCount() returns the number of items in the excluding
pending and transient entries:
https://cs.chromium.org/chromium/src/ios/web/public/navigation_manager.h?q=navigation_manager.h+package:%5Echromium$&l=118

However, in NavigationController, GetEntryCount() returns the number of entries in the excluding the pending entry if there is one, but including the transient entry if any.
https://cs.chromium.org/chromium/src/content/public/browser/navigation_controller.h?q=navigation_controller.h&l=282

1. We should figure out which definition makes more sense.
2. Rename the function names to be more descriptive, like GetCommittedItemCount.
 
Labels: -Type-Bug Type-Feature
Status: Available (was: Untriaged)
//content is different because transient entry is a part of entries_ list and that's not the case for ios/web.

I think it is reasonable to change the way how transient entries are handled on iOS to match other platforms. GetCommittedItemCount name would not be correct if count includes transient entry.
I think the function name should be separated from the implementation details. It depends on how GetItem/EntryCount() is used, if they are mostly used to get the number of committed items/entries, then we should name it GetCommittedItem/EntryCount regardless of how pending and transient items/entries are handled.
If we add GetCommittedItem/EntryCount then it should only return number of committed items/entries. If there are 5 cats and 1 dog then GetCatCount should return 5, not 6 right? :)
Right! sorry for the confusion, I mean GetItem/EntryCount should not
blindly return the size of items_/entries_ because what's stored in
items_/entries_ may change in the future, like how transient item/entry is
handled. And of course, if it turns out to be reasonable to to rename
it to GetCommittedItem/EntryCount,
we will need to update the implementation to not count pending or transient
items.
Labels: -Type-Feature Type-Task
Labels: Proj-Not-WKBackForwardList
Project Member

Comment 7 by sheriffbot@chromium.org, Jul 12

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment