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

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

Issue 7977034: Revert 102184 - [Sync] use base::Time in sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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_util.h ('k') | chrome/browser/sync/glue/session_change_processor.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.cc
===================================================================
--- chrome/browser/sync/engine/syncer_util.cc (revision 102184)
+++ chrome/browser/sync/engine/syncer_util.cc (working copy)
@@ -23,7 +23,6 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/syncable/syncable_changes_version.h"
-#include "chrome/browser/sync/util/time.h"
using syncable::BASE_VERSION;
using syncable::Blob;
@@ -426,8 +425,10 @@
target->Put(SERVER_PARENT_ID, update.parent_id());
target->Put(SERVER_NON_UNIQUE_NAME, name);
target->Put(SERVER_VERSION, update.version());
- target->Put(SERVER_CTIME, ProtoTimeToTime(update.ctime()));
- target->Put(SERVER_MTIME, ProtoTimeToTime(update.mtime()));
+ target->Put(SERVER_CTIME,
+ ServerTimeToClientTime(update.ctime()));
+ target->Put(SERVER_MTIME,
+ ServerTimeToClientTime(update.mtime()));
target->Put(SERVER_IS_DIR, update.IsFolder());
if (update.has_server_defined_unique_tag()) {
const std::string& tag = update.server_defined_unique_tag();
@@ -494,7 +495,8 @@
// static
bool SyncerUtil::ServerAndLocalEntriesMatch(syncable::Entry* entry) {
- if (entry->Get(CTIME) != entry->Get(SERVER_CTIME)) {
+ if (!ClientAndServerTimeMatch(
+ entry->Get(CTIME), ClientTimeToServerTime(entry->Get(SERVER_CTIME)))) {
LOG(WARNING) << "Client and server time mismatch";
return false;
}
@@ -528,11 +530,12 @@
return true;
// For historical reasons, a folder's MTIME changes when its contents change.
// TODO(ncarter): Remove the special casing of MTIME.
- if (entry->Get(MTIME) != entry->Get(SERVER_MTIME)) {
+ bool time_match = ClientAndServerTimeMatch(entry->Get(MTIME),
+ ClientTimeToServerTime(entry->Get(SERVER_MTIME)));
+ if (!time_match) {
LOG(WARNING) << "Time mismatch";
- return false;
}
- return true;
+ return time_match;
}
// static
« no previous file with comments | « chrome/browser/sync/engine/syncer_util.h ('k') | chrome/browser/sync/glue/session_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698