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

Unified Diff: ios/web/navigation/time_smoother.h

Issue 988383002: Upstream various ios/web utilities and helpers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-public-upstreaming
Patch Set: Created 5 years, 9 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: ios/web/navigation/time_smoother.h
diff --git a/ios/web/navigation/time_smoother.h b/ios/web/navigation/time_smoother.h
new file mode 100644
index 0000000000000000000000000000000000000000..59eb2a276a81feca12f47e66a28bfad33d0b5a4d
--- /dev/null
+++ b/ios/web/navigation/time_smoother.h
@@ -0,0 +1,32 @@
+// Copyright 2013 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.
+
+#ifndef IOS_WEB_NAVIGATION_TIME_SMOOTHER_H_
+#define IOS_WEB_NAVIGATION_TIME_SMOOTHER_H_
+
+#include "base/time/time.h"
+
+namespace web {
+
+// Helper class to smooth out runs of duplicate timestamps while still
+// allowing time to jump backwards.
+//
+// Duplicated from NavigationControllerImpl (until we have a better
+// idea how to handle NavigationController implementation overlap
+// in general).
+class TimeSmoother {
+ public:
+ // Returns |t| with possibly some time added on.
+ base::Time GetSmoothedTime(base::Time t);
+
+ private:
+ // |low_water_mark_| is the first time in a sequence of adjusted
+ // times and |high_water_mark_| is the last.
+ base::Time low_water_mark_;
+ base::Time high_water_mark_;
+};
+
+} // namespace web
+
+#endif // IOS_WEB_NAVIGATION_TIME_SMOOTHER_H_

Powered by Google App Engine
This is Rietveld 408576698