1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_page_load_event_utils_h__
8 #define mozilla_dom_page_load_event_utils_h__
10 #include "ipc/IPCMessageUtils.h"
11 #include "mozilla/glean/GleanMetrics.h"
16 struct ParamTraits
<mozilla::glean::perf::PageLoadExtra
> {
17 typedef mozilla::glean::perf::PageLoadExtra paramType
;
19 static void Write(MessageWriter
* aWriter
, const paramType
& aParam
) {
20 WriteParam(aWriter
, aParam
.fcpTime
);
21 WriteParam(aWriter
, aParam
.lcpTime
);
22 WriteParam(aWriter
, aParam
.jsExecTime
);
23 WriteParam(aWriter
, aParam
.loadTime
);
24 WriteParam(aWriter
, aParam
.loadType
);
25 WriteParam(aWriter
, aParam
.responseTime
);
26 WriteParam(aWriter
, aParam
.httpVer
);
27 WriteParam(aWriter
, aParam
.redirectCount
);
28 WriteParam(aWriter
, aParam
.redirectTime
);
29 WriteParam(aWriter
, aParam
.sameOriginNav
);
30 WriteParam(aWriter
, aParam
.trrDomain
);
31 WriteParam(aWriter
, aParam
.dnsLookupTime
);
34 static bool Read(MessageReader
* aReader
, paramType
* aResult
) {
35 return ReadParam(aReader
, &aResult
->fcpTime
) &&
36 ReadParam(aReader
, &aResult
->lcpTime
) &&
37 ReadParam(aReader
, &aResult
->jsExecTime
) &&
38 ReadParam(aReader
, &aResult
->loadTime
) &&
39 ReadParam(aReader
, &aResult
->loadType
) &&
40 ReadParam(aReader
, &aResult
->responseTime
) &&
41 ReadParam(aReader
, &aResult
->httpVer
) &&
42 ReadParam(aReader
, &aResult
->redirectCount
) &&
43 ReadParam(aReader
, &aResult
->redirectTime
) &&
44 ReadParam(aReader
, &aResult
->sameOriginNav
) &&
45 ReadParam(aReader
, &aResult
->trrDomain
) &&
46 ReadParam(aReader
, &aResult
->dnsLookupTime
);
52 #endif // mozilla_dom_page_load_event_utils_h__