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

Unified Diff: chrome/browser/sync/engine/syncer_util.h

Issue 7981006: [Sync] use base::Time in sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux compile errors Created 9 years, 3 months 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 | « chrome/browser/sync/engine/syncer_unittest.cc ('k') | chrome/browser/sync/engine/syncer_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncer_util.h
diff --git a/chrome/browser/sync/engine/syncer_util.h b/chrome/browser/sync/engine/syncer_util.h
index 90de980b9396f38a0e8820b17a7a7dda3173cf53..e500e6cfaf48aa824d1316578fe5b9451a05d097 100644
--- a/chrome/browser/sync/engine/syncer_util.h
+++ b/chrome/browser/sync/engine/syncer_util.h
@@ -13,7 +13,6 @@
#include <string>
#include <vector>
-#include "build/build_config.h"
#include "chrome/browser/sync/engine/syncer.h"
#include "chrome/browser/sync/engine/syncer_types.h"
#include "chrome/browser/sync/syncable/syncable.h"
@@ -140,43 +139,6 @@ class SyncerUtil {
DISALLOW_IMPLICIT_CONSTRUCTORS(SyncerUtil);
};
-#ifndef OS_WIN
-
-// time.h on Linux and Mac both return seconds since the epoch, this should
-// be converted to milliseconds.
-inline int64 ServerTimeToClientTime(int64 server_time) {
- return server_time / GG_LONGLONG(1000);
-}
-
-inline int64 ClientTimeToServerTime(int64 client_time) {
- return client_time * GG_LONGLONG(1000);
-}
-
-// As we truncate server times on the client for posix and on the server for
-// windows we need two ClientAndServerTimeMatch fucntions.
-inline bool ClientAndServerTimeMatch(int64 client_time, int64 server_time) {
- // Compare at the coarser timescale (client)
- return client_time == ServerTimeToClientTime(server_time);
-}
-#else
-// The sync server uses Java Times (ms since 1970)
-// and the client uses FILETIMEs (ns since 1601) so we need to convert
-// between the timescales.
-// TODO(sync): Fix this. No need to use two timescales.
-inline int64 ServerTimeToClientTime(int64 server_time) {
- return server_time * GG_LONGLONG(10000) + GG_LONGLONG(116444736000000000);
-}
-
-inline int64 ClientTimeToServerTime(int64 client_time) {
- return (client_time - GG_LONGLONG(116444736000000000)) / GG_LONGLONG(10000);
-}
-
-inline bool ClientAndServerTimeMatch(int64 client_time, int64 server_time) {
- // Compare at the coarser timescale (server)
- return ClientTimeToServerTime(client_time) == server_time;
-}
-#endif
-
} // namespace browser_sync
#endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_UTIL_H_
« no previous file with comments | « chrome/browser/sync/engine/syncer_unittest.cc ('k') | chrome/browser/sync/engine/syncer_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698