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

Unified Diff: chrome/browser/sync/engine/syncer_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_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
diff --git a/chrome/browser/sync/engine/syncer_util.cc b/chrome/browser/sync/engine/syncer_util.cc
index ba21c3a81c18b92e94961dd97a49b53d3f5ca61a..8b8e5eff80bb41bf5fe99f6fe5bc01ec9de7d5d2 100644
--- a/chrome/browser/sync/engine/syncer_util.cc
+++ b/chrome/browser/sync/engine/syncer_util.cc
@@ -23,6 +23,7 @@
#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;
@@ -425,10 +426,8 @@ void SyncerUtil::UpdateServerFieldsFromUpdate(
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,
- ServerTimeToClientTime(update.ctime()));
- target->Put(SERVER_MTIME,
- ServerTimeToClientTime(update.mtime()));
+ target->Put(SERVER_CTIME, ProtoTimeToTime(update.ctime()));
+ target->Put(SERVER_MTIME, ProtoTimeToTime(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();
@@ -495,8 +494,7 @@ bool SyncerUtil::ServerAndLocalOrdersMatch(syncable::Entry* entry) {
// static
bool SyncerUtil::ServerAndLocalEntriesMatch(syncable::Entry* entry) {
- if (!ClientAndServerTimeMatch(
- entry->Get(CTIME), ClientTimeToServerTime(entry->Get(SERVER_CTIME)))) {
+ if (entry->Get(CTIME) != entry->Get(SERVER_CTIME)) {
LOG(WARNING) << "Client and server time mismatch";
return false;
}
@@ -530,12 +528,11 @@ bool SyncerUtil::ServerAndLocalEntriesMatch(syncable::Entry* entry) {
return true;
// For historical reasons, a folder's MTIME changes when its contents change.
// TODO(ncarter): Remove the special casing of MTIME.
- bool time_match = ClientAndServerTimeMatch(entry->Get(MTIME),
- ClientTimeToServerTime(entry->Get(SERVER_MTIME)));
- if (!time_match) {
+ if (entry->Get(MTIME) != entry->Get(SERVER_MTIME)) {
LOG(WARNING) << "Time mismatch";
+ return false;
}
- return time_match;
+ return true;
}
// 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