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

Unified Diff: components/sessions/core/tab_restore_service_helper.cc

Issue 2762363002: Do not use GetPendingEntryIndex in TabRestoreServiceHelper::PopulateTab. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sessions/core/tab_restore_service_helper.cc
diff --git a/components/sessions/core/tab_restore_service_helper.cc b/components/sessions/core/tab_restore_service_helper.cc
index f4f111975bc8daabfb164e3953dcbd4cc415a35c..e792dd6b67f9fd726f6b013b37e7130b39c4343c 100644
--- a/components/sessions/core/tab_restore_service_helper.cc
+++ b/components/sessions/core/tab_restore_service_helper.cc
@@ -410,16 +410,11 @@ void TabRestoreServiceHelper::PopulateTab(Tab* tab,
int index,
LiveTabContext* context,
LiveTab* live_tab) {
- const int pending_index = live_tab->GetPendingEntryIndex();
int entry_count =
live_tab->IsInitialBlankNavigation() ? 0 : live_tab->GetEntryCount();
- if (entry_count == 0 && pending_index == 0)
Eugene But (OOO till 7-30) 2017/03/21 22:31:14 When entry_count is 0, then pending_index is alway
Charlie Reis 2017/03/22 22:49:49 Yes, I can't think of a case that both entry_count
- entry_count++;
tab->navigations.resize(static_cast<int>(entry_count));
for (int i = 0; i < entry_count; ++i) {
- SerializedNavigationEntry entry = (i == pending_index)
- ? live_tab->GetPendingEntry()
- : live_tab->GetEntryAtIndex(i);
+ SerializedNavigationEntry entry = live_tab->GetEntryAtIndex(i);
Eugene But (OOO till 7-30) 2017/03/21 22:31:15 Because |entry_count| does not include pending ite
sky 2017/03/22 03:20:16 Are you sure about that? I thought reload and poss
Eugene But (OOO till 7-30) 2017/03/22 14:38:40 It is true that reload and back-forward navigation
Charlie Reis 2017/03/22 22:49:49 Yeah, pointing to an existing one is fine-- your C
tab->navigations[i] = entry;
}
tab->timestamp = TimeNow();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698