Chromium Code Reviews| Index: net/tools/testserver/chromiumsync.py |
| diff --git a/net/tools/testserver/chromiumsync.py b/net/tools/testserver/chromiumsync.py |
| index 9e8cb84e683a90103d41d01f68293e7edff7d404..b8a5f7079d364383c5018615640f8c85ace4e2c5 100755 |
| --- a/net/tools/testserver/chromiumsync.py |
| +++ b/net/tools/testserver/chromiumsync.py |
| @@ -16,6 +16,7 @@ import pickle |
| import random |
| import sys |
| import threading |
| +import time |
| import urlparse |
| import app_notification_specifics_pb2 |
| @@ -82,6 +83,9 @@ SYNC_TYPE_TO_EXTENSION = { |
| # The parent ID used to indicate a top-level node. |
| ROOT_ID = '0' |
| +# Unix time epoch in struct_time format. The tuple corresponds to UTC Wednesday |
| +# Jan 1 1970, 00:00:00, non-dst. |
| +UNIX_TIME_EPOCH = (1970, 1, 1, 0, 0, 0, 3, 1, 0) |
| class Error(Exception): |
| """Error class for this module.""" |
| @@ -462,6 +466,9 @@ class SyncDataModel(object): |
| entry.originator_client_item_id = base_entry.originator_client_item_id |
| self._entries[entry.id_string] = copy.deepcopy(entry) |
| + # Store the current time since the Unix epoch in milliseconds. |
| + self._entries[entry.id_string].mtime = \ |
|
ncarter (slow)
2011/11/11 03:07:53
Don't escape newlines, use parens instead.
Nicolas Zea
2011/11/11 19:23:33
Done.
|
| + int((time.mktime(time.gmtime()) - time.mktime(UNIX_TIME_EPOCH))*1000) |
| def _ServerTagToId(self, tag): |
| """Determine the server ID from a server-unique tag. |