ResourceLoadTiming.h [plain text]
#ifndef ResourceLoadTiming_h
#define ResourceLoadTiming_h
namespace WebCore {
class ResourceLoadTiming {
public:
ResourceLoadTiming()
: domainLookupStart(-1)
, domainLookupEnd(-1)
, connectStart(-1)
, connectEnd(-1)
, requestStart(0)
, responseStart(0)
, secureConnectionStart(-1)
{
}
ResourceLoadTiming(const ResourceLoadTiming& other)
: domainLookupStart(other.domainLookupStart)
, domainLookupEnd(other.domainLookupEnd)
, connectStart(other.connectStart)
, connectEnd(other.connectEnd)
, requestStart(other.requestStart)
, responseStart(other.responseStart)
, secureConnectionStart(other.secureConnectionStart)
{
}
ResourceLoadTiming& operator=(const ResourceLoadTiming& other)
{
domainLookupStart = other.domainLookupStart;
domainLookupEnd = other.domainLookupEnd;
connectStart = other.connectStart;
connectEnd = other.connectEnd;
requestStart = other.requestStart;
responseStart = other.responseStart;
secureConnectionStart = other.secureConnectionStart;
return *this;
}
bool operator==(const ResourceLoadTiming& other) const
{
return domainLookupStart == other.domainLookupStart
&& domainLookupEnd == other.domainLookupEnd
&& connectStart == other.connectStart
&& connectEnd == other.connectEnd
&& requestStart == other.requestStart
&& responseStart == other.responseStart
&& secureConnectionStart == other.secureConnectionStart;
}
bool operator!=(const ResourceLoadTiming& other) const
{
return !(*this == other);
}
template<class Encoder> void encode(Encoder&) const;
template<class Decoder> static bool decode(Decoder&, ResourceLoadTiming&);
int domainLookupStart;
int domainLookupEnd;
int connectStart;
int connectEnd;
int requestStart;
int responseStart;
int secureConnectionStart;
};
template<class Encoder>
void ResourceLoadTiming::encode(Encoder& encoder) const
{
encoder << domainLookupStart;
encoder << domainLookupEnd;
encoder << connectStart;
encoder << connectEnd;
encoder << requestStart;
encoder << responseStart;
encoder << secureConnectionStart;
}
template<class Decoder>
bool ResourceLoadTiming::decode(Decoder& decoder, ResourceLoadTiming& timing)
{
return decoder.decode(timing.domainLookupStart)
&& decoder.decode(timing.domainLookupEnd)
&& decoder.decode(timing.connectStart)
&& decoder.decode(timing.connectEnd)
&& decoder.decode(timing.requestStart)
&& decoder.decode(timing.responseStart)
&& decoder.decode(timing.secureConnectionStart);
}
}
#endif