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( |