#ifndef DocumentLoadTiming_h
#define DocumentLoadTiming_h
#include "wtf/CurrentTime.h"
namespace WebCore {
class LocalFrame;
class KURL;
class DocumentLoadTiming {
public:
DocumentLoadTiming();
double monotonicTimeToZeroBasedDocumentTime(double) const;
double monotonicTimeToPseudoWallTime(double) const;
void markNavigationStart();
void setNavigationStart(double);
void addRedirect(const KURL& redirectingUrl, const KURL& redirectedUrl);
void markUnloadEventStart() { m_unloadEventStart = monotonicallyIncreasingTime(); }
void markUnloadEventEnd() { m_unloadEventEnd = monotonicallyIncreasingTime(); }
void markRedirectStart() { m_redirectStart = monotonicallyIncreasingTime(); }
void markRedirectEnd() { m_redirectEnd = monotonicallyIncreasingTime(); }
void markFetchStart() { m_fetchStart = monotonicallyIncreasingTime(); }
void setResponseEnd(double monotonicTime) { m_responseEnd = monotonicTime; }
void markLoadEventStart() { m_loadEventStart = monotonicallyIncreasingTime(); }
void markLoadEventEnd() { m_loadEventEnd = monotonicallyIncreasingTime(); }
void setHasSameOriginAsPreviousDocument(bool value) { m_hasSameOriginAsPreviousDocument = value; }
double navigationStart() const { return m_navigationStart; }
double unloadEventStart() const { return m_unloadEventStart; }
double unloadEventEnd() const { return m_unloadEventEnd; }
double redirectStart() const { return m_redirectStart; }
double redirectEnd() const { return m_redirectEnd; }
short redirectCount() const { return m_redirectCount; }
double fetchStart() const { return m_fetchStart; }
double responseEnd() const { return m_responseEnd; }
double loadEventStart() const { return m_loadEventStart; }
double loadEventEnd() const { return m_loadEventEnd; }
bool hasCrossOriginRedirect() const { return m_hasCrossOriginRedirect; }
bool hasSameOriginAsPreviousDocument() const { return m_hasSameOriginAsPreviousDocument; }
double referenceMonotonicTime() const { return m_referenceMonotonicTime; }
private:
double m_referenceMonotonicTime;
double m_referenceWallTime;
double m_navigationStart;
double m_unloadEventStart;
double m_unloadEventEnd;
double m_redirectStart;
double m_redirectEnd;
short m_redirectCount;
double m_fetchStart;
double m_responseEnd;
double m_loadEventStart;
double m_loadEventEnd;
bool m_hasCrossOriginRedirect;
bool m_hasSameOriginAsPreviousDocument;
};
}
#endif