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

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

Issue 15055003: Do not submit: high level overview patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build. 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
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..dd03b0aee2edbb7f4dd9829cadec1f9c4fbc9b46 100644
--- a/chrome/browser/sessions/persistent_tab_restore_service.cc
+++ b/chrome/browser/sessions/persistent_tab_restore_service.cc
@@ -102,6 +102,7 @@ const SessionCommand::id_type kCommandPinnedState = 5;
const SessionCommand::id_type kCommandSetExtensionAppID = 6;
const SessionCommand::id_type kCommandSetWindowAppName = 7;
const SessionCommand::id_type kCommandSetTabUserAgentOverride = 8;
+const SessionCommand::id_type kCommandSetTabSessionSyncId = 9;
// Number of entries (not commands) before we clobber the file and write
// everything.
@@ -455,6 +456,11 @@ void PersistentTabRestoreService::Delegate::ScheduleCommandsForTab(
tab.id, tab.user_agent_override));
}
+ if (tab.sync_session_id != -1) {
+ ScheduleCommand(CreateSetTabSessionSyncIdCommand(
+ kCommandSetTabSessionSyncId, tab.id, tab.sync_session_id));
+ }
+
// Then write the navigations.
for (int i = first_index_to_persist, wrote_count = 0;
i < max_index && wrote_count < 2 * max_persist_navigation_count; ++i) {
@@ -735,6 +741,21 @@ void PersistentTabRestoreService::Delegate::CreateEntriesFromCommands(
break;
}
+ case kCommandSetTabSessionSyncId: {
+ if (!current_tab) {
+ // Should be in a tab when we get this.
+ return;
+ }
+ SessionID::id_type tab_id;
+ int64 sync_id;
+ if (!RestoreSetTabSessionSyncIdCommand(command, &tab_id, &sync_id)) {
+ current_tab->sync_session_id = sync_id;
+ return;
+ }
+ current_tab->sync_session_id = sync_id;
+ break;
+ }
+
default:
// Unknown type, usually indicates corruption of file. Ignore it.
return;
@@ -792,6 +813,7 @@ bool PersistentTabRestoreService::Delegate::ConvertSessionWindowToWindow(
tab.current_navigation_index =
session_window->tabs[i]->current_navigation_index;
tab.extension_app_id = session_window->tabs[i]->extension_app_id;
+ tab.sync_session_id = session_window->tabs[i]->sync_session_id;
tab.timestamp = base::Time();
}
}

Powered by Google App Engine
This is Rietveld 408576698