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 5#ifndef PPAPI_SHARED_IMPL_TIME_CONVERSION_H_ 6#define PPAPI_SHARED_IMPL_TIME_CONVERSION_H_ 7 8#include "base/time/time.h" 9#include "ppapi/c/pp_time.h" 10#include "ppapi/shared_impl/ppapi_shared_export.h" 11 12namespace ppapi { 13 14PPAPI_SHARED_EXPORT PP_Time TimeToPPTime(base::Time t); 15PPAPI_SHARED_EXPORT base::Time PPTimeToTime(PP_Time t); 16 17PPAPI_SHARED_EXPORT PP_TimeTicks TimeTicksToPPTimeTicks(base::TimeTicks t); 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). 23PPAPI_SHARED_EXPORT PP_TimeTicks EventTimeToPPTimeTicks(double event_time); 24PPAPI_SHARED_EXPORT double PPTimeTicksToEventTime(PP_TimeTicks t); 25 26// Gets the local time zone offset for a given time. This works in the plugin 27// process only on Windows (the sandbox prevents this from working properly on 28// other platforms). 29PPAPI_SHARED_EXPORT double PPGetLocalTimeZoneOffset(const base::Time& time); 30 31} // namespace ppapi 32 33#endif // PPAPI_SHARED_IMPL_TIME_CONVERSION_H_ 34