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

Unified Diff: chrome/browser/sessions/base_session_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/base_session_service.cc
diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc
index 64c094c7e4ffe4a887f95006745bfa6a91b69162..7cdcb6e6b026a2a1ffb5c1fa5d71160d83a18559 100644
--- a/chrome/browser/sessions/base_session_service.cc
+++ b/chrome/browser/sessions/base_session_service.cc
@@ -219,6 +219,18 @@ SessionCommand* BaseSessionService::CreateSetWindowAppNameCommand(
return new SessionCommand(command_id, pickle);
}
+SessionCommand* BaseSessionService::CreateSetTabSessionSyncIdCommand(
+ SessionID::id_type command_id,
+ SessionID::id_type tab_id,
+ const int64& sync_id) {
+ // Use pickle to handle marshalling.
+ Pickle pickle;
+ pickle.WriteInt(tab_id);
+ pickle.WriteInt64(sync_id);
+
+ return new SessionCommand(command_id, pickle);
+}
+
bool BaseSessionService::RestoreUpdateTabNavigationCommand(
const SessionCommand& command,
sessions::SerializedNavigationEntry* navigation,
@@ -271,6 +283,19 @@ bool BaseSessionService::RestoreSetWindowAppNameCommand(
pickle->ReadString(&iterator, app_name);
}
+bool BaseSessionService::RestoreSetTabSessionSyncIdCommand(
+ const SessionCommand& command,
+ SessionID::id_type* tab_id,
+ int64* sync_id) {
+ scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
+ if (!pickle.get())
+ return false;
+
+ PickleIterator iterator(*pickle);
+ return pickle->ReadInt(&iterator, tab_id) &&
+ pickle->ReadInt64(&iterator, sync_id);
+}
+
bool BaseSessionService::ShouldTrackEntry(const GURL& url) {
return url.is_valid();
}

Powered by Google App Engine
This is Rietveld 408576698