Chromium Code Reviews| Index: cc/base/time_util.h |
| diff --git a/cc/base/time_util.h b/cc/base/time_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6a7ee71291db0d1aa1ae7a967c604a224c7573e5 |
| --- /dev/null |
| +++ b/cc/base/time_util.h |
| @@ -0,0 +1,27 @@ |
| +// 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. |
| + |
| +#ifndef CC_BASE_TIME_UTIL_H_ |
| +#define CC_BASE_TIME_UTIL_H_ |
| + |
| +namespace base { |
| +class TimeDelta; |
| +} |
| + |
| +namespace cc { |
| + |
|
ajuma
2014/11/07 15:58:00
Please define a TimeUtil class and make these func
patro
2014/11/10 09:46:52
Done.
|
| +static base::TimeDelta Scale(const base::TimeDelta time_delta, double value) { |
|
ajuma
2014/11/07 15:58:00
I assume you meant "const base::TimeDelta&"? A Tim
patro
2014/11/10 09:46:52
Done.
|
| + return base::TimeDelta::FromInternalValue(static_cast<int64>( |
| + static_cast<double>(time_delta.ToInternalValue()) * value)); |
| +} |
| + |
| +static base::TimeDelta Mod(const base::TimeDelta dividend, |
| + const base::TimeDelta divisor) { |
|
ajuma
2014/11/07 15:58:00
Same comment as above, please remove the consts he
patro
2014/11/10 09:46:52
Done.
|
| + return base::TimeDelta::FromInternalValue(dividend.ToInternalValue() % |
| + divisor.ToInternalValue()); |
| +} |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_BASE_TIME_UTIL_H_ |