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

Unified Diff: chrome/browser/sessions/persistent_tab_restore_service.cc

Issue 15131002: Merge 199540 "Fixes couple of bugs triggered on chromeos when re..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1500/src/
Patch Set: Created 7 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 | « no previous file | chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/persistent_tab_restore_service.cc
===================================================================
--- chrome/browser/sessions/persistent_tab_restore_service.cc (revision 199728)
+++ chrome/browser/sessions/persistent_tab_restore_service.cc (working copy)
@@ -318,10 +318,17 @@
}
void PersistentTabRestoreService::Delegate::LoadTabsFromLastSession() {
- if (load_state_ != NOT_LOADED ||
- tab_restore_service_helper_->entries().size() == kMaxEntries)
+ if (load_state_ != NOT_LOADED)
return;
+ if (tab_restore_service_helper_->entries().size() == kMaxEntries) {
+ // We already have the max number of entries we can take. There is no point
+ // in attempting to load since we'll just drop the results. Skip to loaded.
+ load_state_ = (LOADING | LOADED_LAST_SESSION | LOADED_LAST_TABS);
+ LoadStateChanged();
+ return;
+ }
+
#if !defined(ENABLE_SESSION_SERVICE)
// If sessions are not stored in the SessionService, default to
// |LOADED_LAST_SESSION| state.
@@ -818,6 +825,7 @@
const Entries& entries = tab_restore_service_helper_->entries();
if (staging_entries_.empty() || entries.size() >= kMaxEntries) {
staging_entries_.clear();
+ tab_restore_service_helper_->NotifyLoaded();
return;
}
@@ -850,6 +858,8 @@
tab_restore_service_helper_->PruneEntries();
tab_restore_service_helper_->NotifyTabsChanged();
+
+ tab_restore_service_helper_->NotifyLoaded();
}
void PersistentTabRestoreService::Delegate::RemoveEntryByID(
« no previous file with comments | « no previous file | chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698