summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 02:14:32 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 02:14:32 +0000
commite91a92c7c3a84d16b41232987213ef916bc6876a (patch)
treef03773cf9caa1444cbe1e59a0dd607811a793a3e /sync
parent1cb860667c51472ff266e6b74042414d8bb0cbc0 (diff)
downloadchromium_src-e91a92c7c3a84d16b41232987213ef916bc6876a.zip
chromium_src-e91a92c7c3a84d16b41232987213ef916bc6876a.tar.gz
chromium_src-e91a92c7c3a84d16b41232987213ef916bc6876a.tar.bz2
[Sync] Fix reassociation when tab nodes have been only partially removed.
We would reassociate under the assumption that the number of free tab nodes matched the tags of the tab nodes (i.e. all tab nodes have a tag based on an id < the number of free tab nodes). When other clients delete stale sessions, they're not guaranteed to have all the nodes, and so may delete only a subset of the tab nodes. On the next reassociation, the previously-stale client will not properly track the pre-existing tab nodes. Specifically, the tab nodes it adds to its free pool may have tags based on ids larger than the free pool. To simplify this, we just delete all pre-existing tab nodes at association time. In addition, to lay the groundwork for future support of reassociation, we now also have a field in each tab node that provides the actual tab id used to create the client tag for that node. We can then eventually use that id to do tag based lookups instead of relying on size of our tab pool. BUG=121783 TEST=unit_tests Review URL: https://chromiumcodereview.appspot.com/9968114 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/protocol/proto_value_conversions.cc1
-rw-r--r--sync/protocol/session_specifics.proto3
2 files changed, 4 insertions, 0 deletions
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index 265939e..828c9f5 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -351,6 +351,7 @@ DictionaryValue* SessionSpecificsToValue(
SET_STR(session_tag);
SET(header, SessionHeaderToValue);
SET(tab, SessionTabToValue);
+ SET_INT32(tab_node_id);
return value;
}
diff --git a/sync/protocol/session_specifics.proto b/sync/protocol/session_specifics.proto
index 07323b1..cf31aed 100644
--- a/sync/protocol/session_specifics.proto
+++ b/sync/protocol/session_specifics.proto
@@ -19,6 +19,9 @@ message SessionSpecifics {
optional string session_tag = 1;
optional SessionHeader header = 2;
optional SessionTab tab = 3;
+
+ // The local tab id used by sync. Unique across all nodes for that client.
+ optional int32 tab_node_id = 4 [default = -1];
}
// Properties of session sync objects.
message SessionHeader {