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

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

Issue 14620014: Fixes couple of bugs triggered on chromeos when restoring a tab: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolve merge 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
diff --git a/chrome/browser/sessions/persistent_tab_restore_service.cc b/chrome/browser/sessions/persistent_tab_restore_service.cc
index d8df61b4bb9f9d367999cd88be363579823d9336..8f561f6c8b6a2f496e85318ecc6cac04cdbb7b79 100644
--- a/chrome/browser/sessions/persistent_tab_restore_service.cc
+++ b/chrome/browser/sessions/persistent_tab_restore_service.cc
@@ -318,10 +318,17 @@ void PersistentTabRestoreService::Delegate::OnAddEntry() {
}
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 @@ void PersistentTabRestoreService::Delegate::LoadStateChanged() {
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 @@ void PersistentTabRestoreService::Delegate::LoadStateChanged() {
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