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

Unified Diff: chrome/browser/sync/sessions/sessions_sync_manager.cc

Issue 699033002: Sync: Handle duplicating tab IDs in foreign session data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/sync/sessions/sessions_sync_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sessions/sessions_sync_manager.cc
diff --git a/chrome/browser/sync/sessions/sessions_sync_manager.cc b/chrome/browser/sync/sessions/sessions_sync_manager.cc
index 05bc926903316b5d7c39ed3b85ada16d4375c583..06f33dd8cd3b573b3d03803ff16fb8c0b66a9b63 100644
--- a/chrome/browser/sync/sessions/sessions_sync_manager.cc
+++ b/chrome/browser/sync/sessions/sessions_sync_manager.cc
@@ -652,6 +652,16 @@ void SessionsSyncManager::UpdateTrackerWithForeignSession(
} else if (specifics.has_tab()) {
const sync_pb::SessionTab& tab_s = specifics.tab();
SessionID::id_type tab_id = tab_s.tab_id();
+
+ const SessionTab* existing_tab;
+ if (session_tracker_.LookupSessionTab(
+ foreign_session_tag, tab_id, &existing_tab) &&
+ existing_tab->timestamp > modification_time) {
+ DVLOG(1) << "Ignoring " << foreign_session_tag << "'s session tab "
+ << tab_id << " with earlier modification time";
+ return;
+ }
+
SessionTab* tab =
session_tracker_.GetTab(foreign_session_tag,
tab_id,
« no previous file with comments | « no previous file | chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698