Index: base/time/time.h |
diff --git a/base/time/time.h b/base/time/time.h |
index 3cf3746166ed8dc16cc937945d0918cfe6ef8ede..641f465af3e471afc3b4833b2c6b2a9faf122d8e 100644 |
--- a/base/time/time.h |
+++ b/base/time/time.h |
@@ -19,12 +19,18 @@ |
// |
// These classes are represented as only a 64-bit value, so they can be |
// efficiently passed by value. |
+// |
+// Definitions of operator<< are provided to make these types work with |
+// DCHECK_EQ() and other log macros. For human-readable formatting, see |
+// "base/i18n/time_formatting.h". |
#ifndef BASE_TIME_TIME_H_ |
#define BASE_TIME_TIME_H_ |
#include <time.h> |
+#include <iosfwd> |
+ |
#include "base/base_export.h" |
#include "base/basictypes.h" |
#include "build/build_config.h" |
@@ -206,6 +212,9 @@ inline TimeDelta operator*(int64 a, TimeDelta td) { |
return TimeDelta(a * td.delta_); |
} |
+// For logging use only. |
+BASE_EXPORT std::ostream& operator<<(std::ostream& os, TimeDelta time_delta); |
+ |
// Time ----------------------------------------------------------------------- |
// Represents a wall clock time in UTC. |
@@ -561,6 +570,9 @@ inline Time TimeDelta::operator+(Time t) const { |
return Time(t.us_ + delta_); |
} |
+// For logging use only. |
+BASE_EXPORT std::ostream& operator<<(std::ostream& os, Time time); |
+ |
// TimeTicks ------------------------------------------------------------------ |
class BASE_EXPORT TimeTicks { |
@@ -723,6 +735,9 @@ inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
return TimeTicks(t.ticks_ + delta_); |
} |
+// For logging use only. |
+BASE_EXPORT std::ostream& operator<<(std::ostream& os, TimeTicks time_ticks); |
+ |
} // namespace base |
#endif // BASE_TIME_TIME_H_ |