NavigationManager:GetItemCount is confusing |
|||||
Issue descriptionIn 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.
,
Mar 22 2017
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.
,
Mar 22 2017
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? :)
,
Mar 22 2017
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.
,
Apr 13 2017
,
Jul 11 2017
,
Jul 12
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
,
Jul 12
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by eugene...@chromium.org
, Mar 22 2017Status: Available (was: Untriaged)