Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / web / navigation / time_smoother.h
blob59eb2a276a81feca12f47e66a28bfad33d0b5a4d
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_NAVIGATION_TIME_SMOOTHER_H_
6 #define IOS_WEB_NAVIGATION_TIME_SMOOTHER_H_
8 #include "base/time/time.h"
10 namespace web {
12 // Helper class to smooth out runs of duplicate timestamps while still
13 // allowing time to jump backwards.
15 // Duplicated from NavigationControllerImpl (until we have a better
16 // idea how to handle NavigationController implementation overlap
17 // in general).
18 class TimeSmoother {
19 public:
20 // Returns |t| with possibly some time added on.
21 base::Time GetSmoothedTime(base::Time t);
23 private:
24 // |low_water_mark_| is the first time in a sequence of adjusted
25 // times and |high_water_mark_| is the last.
26 base::Time low_water_mark_;
27 base::Time high_water_mark_;
30 } // namespace web
32 #endif // IOS_WEB_NAVIGATION_TIME_SMOOTHER_H_