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

Unified Diff: chrome/browser/sync/engine/syncer_proto_util.cc

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.cc ('k') | chrome/browser/sync/engine/syncer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncer_proto_util.cc
diff --git a/chrome/browser/sync/engine/syncer_proto_util.cc b/chrome/browser/sync/engine/syncer_proto_util.cc
index f382793cff8392cda04c34413f2edac660baa5f6..26eed05cb70a36c211394a58ce8269ff6ed074a5 100644
--- a/chrome/browser/sync/engine/syncer_proto_util.cc
+++ b/chrome/browser/sync/engine/syncer_proto_util.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/sync/engine/net/server_connection_manager.h"
#include "chrome/browser/sync/engine/syncer.h"
#include "chrome/browser/sync/engine/syncer_types.h"
-#include "chrome/browser/sync/engine/syncer_util.h"
#include "chrome/browser/sync/protocol/service_constants.h"
#include "chrome/browser/sync/protocol/sync.pb.h"
#include "chrome/browser/sync/protocol/sync_protocol_error.h"
@@ -18,6 +17,7 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/syncable/syncable-inl.h"
#include "chrome/browser/sync/syncable/syncable.h"
+#include "chrome/browser/sync/util/time.h"
using browser_sync::SyncProtocolErrorType;
using std::string;
@@ -364,7 +364,7 @@ bool SyncerProtoUtil::Compare(const syncable::Entry& local_entry,
if (local_entry.Get(IS_DEL) && server_entry.deleted())
return true;
- if (!ClientAndServerTimeMatch(local_entry.Get(CTIME), server_entry.ctime())) {
+ if (local_entry.Get(CTIME) != ProtoTimeToTime(server_entry.ctime())) {
LOG(WARNING) << "ctime mismatch";
return false;
}
@@ -389,8 +389,7 @@ bool SyncerProtoUtil::Compare(const syncable::Entry& local_entry,
return false;
}
if (!local_entry.Get(IS_DIR) &&
- !ClientAndServerTimeMatch(local_entry.Get(MTIME),
- server_entry.mtime())) {
+ (local_entry.Get(MTIME) != ProtoTimeToTime(server_entry.mtime()))) {
LOG(WARNING) << "mtime mismatch";
return false;
}
@@ -438,18 +437,22 @@ const std::string& SyncerProtoUtil::NameFromCommitEntryResponse(
std::string SyncerProtoUtil::SyncEntityDebugString(
const sync_pb::SyncEntity& entry) {
+ const std::string& mtime_str =
+ GetTimeDebugString(ProtoTimeToTime(entry.mtime()));
+ const std::string& ctime_str =
+ GetTimeDebugString(ProtoTimeToTime(entry.ctime()));
return base::StringPrintf(
"id: %s, parent_id: %s, "
"version: %"PRId64"d, "
- "mtime: %" PRId64"d (client: %" PRId64"d), "
- "ctime: %" PRId64"d (client: %" PRId64"d), "
+ "mtime: %" PRId64"d (%s), "
+ "ctime: %" PRId64"d (%s), "
"name: %s, sync_timestamp: %" PRId64"d, "
"%s ",
entry.id_string().c_str(),
entry.parent_id_string().c_str(),
entry.version(),
- entry.mtime(), ServerTimeToClientTime(entry.mtime()),
- entry.ctime(), ServerTimeToClientTime(entry.ctime()),
+ entry.mtime(), mtime_str.c_str(),
+ entry.ctime(), ctime_str.c_str(),
entry.name().c_str(), entry.sync_timestamp(),
entry.deleted() ? "deleted, ":"");
}
« no previous file with comments | « chrome/browser/sync/engine/syncer.cc ('k') | chrome/browser/sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698