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

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

Issue 14497003: Moves TabNavigation into components/sessions and renames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really remove webkit_support Created 7 years, 8 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 b30abd8ec7d572e54d426165b5bfc76cf6f3791a..2710ff083568837bd58674d441447ffbd41cfebe 100644
--- a/chrome/browser/sessions/base_session_service.cc
+++ b/chrome/browser/sessions/base_session_service.cc
@@ -148,11 +148,15 @@ void BaseSessionService::Save() {
SessionCommand* BaseSessionService::CreateUpdateTabNavigationCommand(
SessionID::id_type command_id,
SessionID::id_type tab_id,
- const TabNavigation& navigation) {
+ const sessions::SerializedNavigationEntry& navigation) {
// Use pickle to handle marshalling.
Pickle pickle;
pickle.WriteInt(tab_id);
- navigation.WriteToPickle(&pickle);
+ // We only allow navigations up to 63k (which should be completely
+ // reasonable).
+ static const size_t max_state_size =
+ std::numeric_limits<SessionCommand::size_type>::max() - 1024;
+ navigation.WriteToPickle(max_state_size, &pickle);
return new SessionCommand(command_id, pickle);
}
@@ -217,7 +221,7 @@ SessionCommand* BaseSessionService::CreateSetWindowAppNameCommand(
bool BaseSessionService::RestoreUpdateTabNavigationCommand(
const SessionCommand& command,
- TabNavigation* navigation,
+ sessions::SerializedNavigationEntry* navigation,
SessionID::id_type* tab_id) {
scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
if (!pickle.get())
« no previous file with comments | « chrome/browser/sessions/base_session_service.h ('k') | chrome/browser/sessions/persistent_tab_restore_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698