Do not clear ephemeral device permissions when an app is suspended.
[chromium-blink-merge.git] / cc / base / time_util.h
blob06682c27e2fc1efd08142e65d6b4545eea937961
1 // Copyright 2014 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 CC_BASE_TIME_UTIL_H_
6 #define CC_BASE_TIME_UTIL_H_
8 namespace base {
9 class TimeDelta;
12 namespace cc {
14 class CC_EXPORT TimeUtil {
15 public:
16 static base::TimeDelta Scale(base::TimeDelta time_delta, double value) {
17 return base::TimeDelta::FromInternalValue(static_cast<int64>(
18 static_cast<double>(time_delta.ToInternalValue()) * value));
21 static double Divide(base::TimeDelta dividend, base::TimeDelta divisor) {
22 return static_cast<double>(dividend.ToInternalValue()) /
23 static_cast<double>(divisor.ToInternalValue());
26 static base::TimeDelta Mod(base::TimeDelta dividend,
27 base::TimeDelta divisor) {
28 return base::TimeDelta::FromInternalValue(dividend.ToInternalValue() %
29 divisor.ToInternalValue());
33 } // namespace cc
35 #endif // CC_BASE_TIME_UTIL_H_