| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | |
| 5 // Time-related sync functions. | |
| 6 | 4 |
| 7 #ifndef COMPONENTS_SYNC_BASE_TIME_H_ | 5 #ifndef COMPONENTS_SYNC_BASE_TIME_H_ |
| 8 #define COMPONENTS_SYNC_BASE_TIME_H_ | 6 #define COMPONENTS_SYNC_BASE_TIME_H_ |
| 9 | 7 |
| 10 #include <stdint.h> | 8 #include <stdint.h> |
| 11 | 9 |
| 12 #include <string> | 10 #include <string> |
| 13 | 11 |
| 14 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 15 | 13 |
| 16 namespace syncer { | 14 namespace syncer { |
| 17 | 15 |
| 18 // Converts a time object to the format used in sync protobufs (ms | 16 // Converts a time object to the format used in sync protobufs (ms |
| 19 // since the Unix epoch). | 17 // since the Unix epoch). |
| 20 int64_t TimeToProtoTime(const base::Time& t); | 18 int64_t TimeToProtoTime(const base::Time& t); |
| 21 | 19 |
| 22 // Converts a time field from sync protobufs to a time object. | 20 // Converts a time field from sync protobufs to a time object. |
| 23 base::Time ProtoTimeToTime(int64_t proto_t); | 21 base::Time ProtoTimeToTime(int64_t proto_t); |
| 24 | 22 |
| 25 std::string GetTimeDebugString(const base::Time& t); | 23 std::string GetTimeDebugString(const base::Time& t); |
| 26 | 24 |
| 27 } // namespace syncer | 25 } // namespace syncer |
| 28 | 26 |
| 29 #endif // COMPONENTS_SYNC_BASE_TIME_H_ | 27 #endif // COMPONENTS_SYNC_BASE_TIME_H_ |
| OLD | NEW |