summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-12 02:46:32 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-12 02:46:32 +0000
commit9b4773aed187d5c3c1cb9e8dc3a445cc7e48e42c (patch)
tree48dbcd1c4cba8aeee42de4cc394c8c3413132ef9 /net/tools
parent6dbc070c97a8a1f35a6bb9e5ac364223965c9469 (diff)
downloadchromium_src-9b4773aed187d5c3c1cb9e8dc3a445cc7e48e42c.zip
chromium_src-9b4773aed187d5c3c1cb9e8dc3a445cc7e48e42c.tar.gz
chromium_src-9b4773aed187d5c3c1cb9e8dc3a445cc7e48e42c.tar.bz2
[Sync] Remove logging/checks for case where server and local entries mismatch.
We will now reliably hit this code due to the server changing the MTIME of any committed item. As a result of this, and because the check and log is expensive, it's better to just remove them altogether. BUG=103838 TEST=none Review URL: http://codereview.chromium.org/8526018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rwxr-xr-xnet/tools/testserver/chromiumsync.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/tools/testserver/chromiumsync.py b/net/tools/testserver/chromiumsync.py
index 9e8cb84..338ecb0 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 = (int((time.mktime(time.gmtime()) -
+ time.mktime(UNIX_TIME_EPOCH))*1000))
def _ServerTagToId(self, tag):
"""Determine the server ID from a server-unique tag.