[email protected] | 66250024 | 2011-07-08 16:35:38 | [diff] [blame] | 1 | // Copyright (c) 2011 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 | |||||
[email protected] | 0141ba3c | 2011-07-12 20:58:58 | [diff] [blame] | 5 | #ifndef PPAPI_SHARED_IMPL_TIME_CONVERSION_H_ |
6 | #define PPAPI_SHARED_IMPL_TIME_CONVERSION_H_ | ||||
[email protected] | 66250024 | 2011-07-08 16:35:38 | [diff] [blame] | 7 | |
8 | #include "base/time.h" | ||||
9 | #include "ppapi/c/pp_time.h" | ||||
[email protected] | f0a04c4 | 2011-08-26 22:43:20 | [diff] [blame] | 10 | #include "ppapi/shared_impl/ppapi_shared_export.h" |
[email protected] | 66250024 | 2011-07-08 16:35:38 | [diff] [blame] | 11 | |
[email protected] | 66250024 | 2011-07-08 16:35:38 | [diff] [blame] | 12 | namespace ppapi { |
13 | |||||
[email protected] | f0a04c4 | 2011-08-26 22:43:20 | [diff] [blame] | 14 | PPAPI_SHARED_EXPORT PP_Time TimeToPPTime(base::Time t); |
15 | PPAPI_SHARED_EXPORT base::Time PPTimeToTime(PP_Time t); | ||||
[email protected] | 66250024 | 2011-07-08 16:35:38 | [diff] [blame] | 16 | |
[email protected] | f0a04c4 | 2011-08-26 22:43:20 | [diff] [blame] | 17 | PPAPI_SHARED_EXPORT PP_TimeTicks TimeTicksToPPTimeTicks(base::TimeTicks t); |
[email protected] | 66250024 | 2011-07-08 16:35:38 | [diff] [blame] | 18 | |
19 | // Converts between WebKit event times and time ticks. WebKit event times are | ||||
20 | // currently expressed in terms of wall clock time. This function does the | ||||
21 | // proper mapping to time ticks, assuming the wall clock time doesn't change | ||||
22 | // (which isn't necessarily the case). | ||||
[email protected] | f0a04c4 | 2011-08-26 22:43:20 | [diff] [blame] | 23 | PPAPI_SHARED_EXPORT PP_TimeTicks EventTimeToPPTimeTicks(double event_time); |
24 | PPAPI_SHARED_EXPORT double PPTimeTicksToEventTime(PP_TimeTicks t); | ||||
[email protected] | 66250024 | 2011-07-08 16:35:38 | [diff] [blame] | 25 | |
26 | } // namespace ppapi | ||||
[email protected] | 66250024 | 2011-07-08 16:35:38 | [diff] [blame] | 27 | |
[email protected] | 0141ba3c | 2011-07-12 20:58:58 | [diff] [blame] | 28 | #endif // PPAPI_SHARED_IMPL_TIME_CONVERSION_H_ |