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

Unified Diff: sync/util/time.cc

Issue 332923002: [sync] Add backup time in synced device info so that server can flag device (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
Index: sync/util/time.cc
diff --git a/sync/util/time.cc b/sync/util/time.cc
index 5f878a2ce206ac1e2a12940f7a38ac9bb2dd721a..bfa0d9eb490ae56df16b99e63e44969d8fd83820 100644
--- a/sync/util/time.cc
+++ b/sync/util/time.cc
@@ -10,7 +10,7 @@
namespace syncer {
int64 TimeToProtoTime(const base::Time& t) {
- return (t - base::Time::UnixEpoch()).InMilliseconds();
+ return t.is_null() ? 0 : (t - base::Time::UnixEpoch()).InMilliseconds();
}
base::Time ProtoTimeToTime(int64 proto_t) {

Powered by Google App Engine
This is Rietveld 408576698