Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef CC_BASE_TIME_UTIL_H_ | |
| 6 #define CC_BASE_TIME_UTIL_H_ | |
| 7 | |
| 8 namespace base { | |
| 9 class TimeDelta; | |
| 10 } | |
| 11 | |
| 12 namespace cc { | |
| 13 | |
| 14 base::TimeDelta operator*(const base::TimeDelta time_delta, double value) { | |
|
ajuma
2014/11/06 18:03:23
Rather than overloading operator* (which will be c
patro
2014/11/07 07:03:40
Done.
| |
| 15 return base::TimeDelta::FromInternalValue(time_delta.ToInternalValue() * | |
|
ajuma
2014/11/06 18:03:23
Make the double/int64 conversions explicit, e.g:
ajuma
2014/11/06 18:07:20
Sorry, messed up the parentheses there. I meant:
b
patro
2014/11/07 07:03:40
Done.
| |
| 16 value); | |
| 17 } | |
| 18 | |
| 19 base::TimeDelta operator*(double value, const base::TimeDelta time_delta) { | |
| 20 return base::TimeDelta::FromInternalValue(time_delta.ToInternalValue() * | |
| 21 value); | |
| 22 } | |
| 23 | |
| 24 base::TimeDelta operator/(const base::TimeDelta time_delta, double value) { | |
| 25 return base::TimeDelta::FromInternalValue(time_delta.ToInternalValue() / | |
| 26 value); | |
| 27 } | |
| 28 | |
| 29 base::TimeDelta operator/(double value, const base::TimeDelta time_delta) { | |
| 30 return base::TimeDelta::FromInternalValue(time_delta.ToInternalValue() / | |
| 31 value); | |
| 32 } | |
| 33 | |
| 34 } // namespace cc | |
| 35 | |
| 36 #endif // CC_BASE_TIME_UTIL_H_ | |
| OLD | NEW |