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

Unified Diff: base/time/time_logging.h

Issue 665023002: Post-commit fixes for "stale-while-revalidate..." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make DCHECK_EQ work for TimeDelta objects. Created 6 years, 2 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: base/time/time_logging.h
diff --git a/base/time/time_logging.h b/base/time/time_logging.h
new file mode 100644
index 0000000000000000000000000000000000000000..f546048ed1f8ab56f2b6bf52d4632d8dbb9889ad
--- /dev/null
+++ b/base/time/time_logging.h
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// C++ iostream operators for logging base::Time, base::TimeDelta and
+// base::TimeTicks objects. For use with DCHECK_EQ(), DCHECK_LE(), etc. This
+// file is separated from time.h to avoid the iostream dependency, and also
+// because these operators should only be used for logging.
+//
+// Never use these methods to format user-visible strings. See
+// "base/i18n/time_formatting.h" instead.
mmenke 2014/10/21 14:20:09 Optional: I think it's more common to put file-le
Adam Rice 2014/10/23 01:13:02 True. I merged the functionality into time.h anywa
+
+#ifndef BASE_TIME_TIME_LOGGING_H_
+#define BASE_TIME_TIME_LOGGING_H_
+
+#include <iosfwd>
+
+#include "base/base_export.h"
+
+namespace base {
+
+class Time;
+class TimeDelta;
+class TimeTicks;
+
+BASE_EXPORT std::ostream& operator<<(std::ostream& os,
+ const TimeDelta& time_delta);
+BASE_EXPORT std::ostream& operator<<(std::ostream& os, const Time& time);
+BASE_EXPORT std::ostream& operator<<(std::ostream& os,
+ const TimeTicks& time_ticks);
+
+} // namespace base
+
+#endif // BASE_TIME_TIME_LOGGING_H_
« no previous file with comments | « base/time/time.h ('k') | base/time/time_logging.cc » ('j') | base/time/time_logging.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698