diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 18:28:43 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 18:28:43 +0000 |
commit | 27684f3c6386a47e5f3ca27e16eff9eba98273a3 (patch) | |
tree | 3e247a723392764c70ab8d1ce8795308d3550664 /sync/protocol | |
parent | 81a92963a30b70f2f497c629932e6881d4a948f2 (diff) | |
download | chromium_src-27684f3c6386a47e5f3ca27e16eff9eba98273a3.zip chromium_src-27684f3c6386a47e5f3ca27e16eff9eba98273a3.tar.gz chromium_src-27684f3c6386a47e5f3ca27e16eff9eba98273a3.tar.bz2 |
[Sync] Add per-navigation timestamps/unique ids to tab sync.
A navigation's timestamps are updated only if the navigation is new
or if the user recently moved back/foward to the navigation entry.
Otherwise, we preserve old timestamps.
To do this, we switch to using SyncedTabNavigations, which also contains
the unique id of the navigation (pulled from NavigationEntry) and the
timestamp of the navgation, and SyncedSessionTab (which we have to
use in order to support SyncedTabNavigations).
Lastly, the protos have been updated to include unique_id/timestamp per
navigation, remove some obsolete fields that were unimportant, and add
comments about what transitions mean and when they're set.
BUG=98892
TEST=unit_tests, manually inspecting timestamps in sync node browser.
Review URL: http://codereview.chromium.org/10125002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/protocol')
-rw-r--r-- | sync/protocol/proto_value_conversions.cc | 3 | ||||
-rw-r--r-- | sync/protocol/session_specifics.proto | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc index 472626c..70b3ea1 100644 --- a/sync/protocol/proto_value_conversions.cc +++ b/sync/protocol/proto_value_conversions.cc @@ -157,13 +157,14 @@ DictionaryValue* SessionWindowToValue( DictionaryValue* TabNavigationToValue( const sync_pb::TabNavigation& proto) { DictionaryValue* value = new DictionaryValue(); - SET_INT32(index); SET_STR(virtual_url); SET_STR(referrer); SET_STR(title); SET_STR(state); SET_ENUM(page_transition, GetPageTransitionString); SET_ENUM(navigation_qualifier, GetPageTransitionQualifierString); + SET_INT32(unique_id); + SET_INT64(timestamp); return value; } diff --git a/sync/protocol/session_specifics.proto b/sync/protocol/session_specifics.proto index e2b441d..4389243 100644 --- a/sync/protocol/session_specifics.proto +++ b/sync/protocol/session_specifics.proto @@ -91,7 +91,7 @@ message SessionTab { message TabNavigation { // The index in the NavigationController. If this is -1, it means this // TabNavigation is bogus. - optional int32 index = 1 [default = -1]; + // optional int32 index = 1 [default = -1]; // obsolete. // The virtual URL, when nonempty, will override the actual URL of the page // when we display it to the user. optional string virtual_url = 2; @@ -126,5 +126,10 @@ message TabNavigation { } optional PageTransition page_transition = 6 [default = TYPED]; optional PageTransitionQualifier navigation_qualifier = 7; + // The unique navigation id (within this client). + optional int32 unique_id = 8; + // Timestamp for when this navigation last occurred (in client time). + // If the user goes back/foward in history the timestamp may refresh. + optional int64 timestamp = 9; } |