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(); |
} |
} |