forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime_smoother.h
32 lines (25 loc) · 944 Bytes
/
time_smoother.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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_