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

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

Issue 665033003: Removing Migraction code from M17 in session restore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the unit test which tested the migration code as well Created 6 years, 2 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/session_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_service.cc
diff --git a/chrome/browser/sessions/session_service.cc b/chrome/browser/sessions/session_service.cc
index 0a0ac5a6c65288e31cfe8a539c92e909cc807a2e..57c5a6259251c0a860d5730a687bd13f44d7b93a 100644
--- a/chrome/browser/sessions/session_service.cc
+++ b/chrome/browser/sessions/session_service.cc
@@ -60,10 +60,9 @@ static const SessionCommand::id_type kCommandSetTabWindow = 0;
// OBSOLETE Superseded by kCommandSetWindowBounds3.
// static const SessionCommand::id_type kCommandSetWindowBounds = 1;
static const SessionCommand::id_type kCommandSetTabIndexInWindow = 2;
-// Original kCommandTabClosed/kCommandWindowClosed. See comment in
-// MigrateClosedPayload for details on why they were replaced.
-static const SessionCommand::id_type kCommandTabClosedObsolete = 3;
-static const SessionCommand::id_type kCommandWindowClosedObsolete = 4;
+// OBSOLETE Superseded kCommandTabClosed/kCommandWindowClosed commands.
+// static const SessionCommand::id_type kCommandTabClosedObsolete = 3;
+// static const SessionCommand::id_type kCommandWindowClosedObsolete = 4;
static const SessionCommand::id_type
kCommandTabNavigationPathPrunedFromBack = 5;
static const SessionCommand::id_type kCommandUpdateTabNavigation = 6;
@@ -198,31 +197,6 @@ ui::WindowShowState PersistedShowStateToShowState(int state) {
return ui::SHOW_STATE_NORMAL;
}
-// Migrates a |ClosedPayload|, returning true on success (migration was
-// necessary and happened), or false (migration was not necessary or was not
-// successful).
-bool MigrateClosedPayload(const SessionCommand& command,
- ClosedPayload* payload) {
-#if defined(OS_CHROMEOS)
- // Pre M17 versions of chromeos were 32bit. Post M17 is 64 bit. Apparently the
- // 32 bit versions of chrome on pre M17 resulted in a sizeof 12 for the
- // ClosedPayload, where as post M17 64-bit gives a sizeof 16 (presumably the
- // struct is padded).
- if ((command.id() == kCommandWindowClosedObsolete ||
- command.id() == kCommandTabClosedObsolete) &&
- command.size() == 12 && sizeof(payload->id) == 4 &&
- sizeof(payload->close_time) == 8) {
- memcpy(&payload->id, command.contents(), 4);
- memcpy(&payload->close_time, command.contents() + 4, 8);
- return true;
- } else {
- return false;
- }
-#else
- return false;
-#endif
-}
-
} // namespace
// SessionService -------------------------------------------------------------
@@ -1143,18 +1117,14 @@ bool SessionService::CreateTabsAndWindows(
break;
}
- case kCommandTabClosedObsolete:
- case kCommandWindowClosedObsolete:
case kCommandTabClosed:
case kCommandWindowClosed: {
ClosedPayload payload;
- if (!command->GetPayload(&payload, sizeof(payload)) &&
- !MigrateClosedPayload(*command, &payload)) {
+ if (!command->GetPayload(&payload, sizeof(payload))) {
VLOG(1) << "Failed reading command " << command->id();
return true;
}
- if (command->id() == kCommandTabClosed ||
- command->id() == kCommandTabClosedObsolete) {
+ if (command->id() == kCommandTabClosed) {
delete GetTab(payload.id, tabs);
tabs->erase(payload.id);
} else {
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698