<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[280454] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/280454">280454</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2021-07-29 16:02:09 -0700 (Thu, 29 Jul 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[ Mac ] fast/dom/webtiming-document-open.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=228571

Reviewed by Chris Dumez.

Source/WebCore:

In <a href="http://trac.webkit.org/projects/webkit/changeset/278391">r278391</a> I made PerformanceTiming::monotonicTimeToIntegerMilliseconds call MonotonicTime::approximateWallTime,
which, if called multiple times, can give slightly different values, usually differing by 1 (millisecond, in this case).
To fix this, cache the value from the first call.  This uses an additional 168 bytes per frame in pages that use PerformanceTiming.
Once bug 227336 is turned on and the web is given a year or so to move to that replacement API, this whole API will be removed.

* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::navigationStart const):
(WebCore::PerformanceTiming::unloadEventStart const):
(WebCore::PerformanceTiming::unloadEventEnd const):
(WebCore::PerformanceTiming::redirectStart const):
(WebCore::PerformanceTiming::redirectEnd const):
(WebCore::PerformanceTiming::fetchStart const):
(WebCore::PerformanceTiming::domainLookupStart const):
(WebCore::PerformanceTiming::domainLookupEnd const):
(WebCore::PerformanceTiming::connectStart const):
(WebCore::PerformanceTiming::connectEnd const):
(WebCore::PerformanceTiming::secureConnectionStart const):
(WebCore::PerformanceTiming::requestStart const):
(WebCore::PerformanceTiming::responseStart const):
(WebCore::PerformanceTiming::responseEnd const):
(WebCore::PerformanceTiming::domLoading const):
(WebCore::PerformanceTiming::domInteractive const):
(WebCore::PerformanceTiming::domContentLoadedEventStart const):
(WebCore::PerformanceTiming::domContentLoadedEventEnd const):
(WebCore::PerformanceTiming::domComplete const):
(WebCore::PerformanceTiming::loadEventStart const):
(WebCore::PerformanceTiming::loadEventEnd const):
* page/PerformanceTiming.h:

LayoutTests:

* platform/mac/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceTimingcpp">trunk/Source/WebCore/page/PerformanceTiming.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceTimingh">trunk/Source/WebCore/page/PerformanceTiming.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (280453 => 280454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2021-07-29 22:52:27 UTC (rev 280453)
+++ trunk/LayoutTests/ChangeLog 2021-07-29 23:02:09 UTC (rev 280454)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2021-07-29  Alex Christensen  <achristensen@webkit.org>
+
+        [ Mac ] fast/dom/webtiming-document-open.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=228571
+
+        Reviewed by Chris Dumez.
+
+        * platform/mac/TestExpectations:
+
</ins><span class="cx"> 2021-07-29  Ayumi Kojima  <ayumi_kojima@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [ iOS ] 2 http/tests/cookies/same-site tests are flaky timing out.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (280453 => 280454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations  2021-07-29 22:52:27 UTC (rev 280453)
+++ trunk/LayoutTests/platform/mac/TestExpectations     2021-07-29 23:02:09 UTC (rev 280454)
</span><span class="lines">@@ -2363,7 +2363,5 @@
</span><span class="cx"> [ Monterey ] model-element/model-element-graphics-layers-opacity.html [ Pass Failure ]
</span><span class="cx"> [ Monterey Debug arm64 ] imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-restartIce.https.html [ Pass Failure Crash ]
</span><span class="cx"> 
</span><del>-webkit.org/b/228571 fast/dom/webtiming-document-open.html [ Pass Failure ]
-
</del><span class="cx"> webkit.org/b/228396 fast/speechsynthesis/speech-synthesis-speak-empty-string.html [ Pass Failure ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (280453 => 280454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-07-29 22:52:27 UTC (rev 280453)
+++ trunk/Source/WebCore/ChangeLog      2021-07-29 23:02:09 UTC (rev 280454)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2021-07-29  Alex Christensen  <achristensen@webkit.org>
+
+        [ Mac ] fast/dom/webtiming-document-open.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=228571
+
+        Reviewed by Chris Dumez.
+
+        In r278391 I made PerformanceTiming::monotonicTimeToIntegerMilliseconds call MonotonicTime::approximateWallTime,
+        which, if called multiple times, can give slightly different values, usually differing by 1 (millisecond, in this case).
+        To fix this, cache the value from the first call.  This uses an additional 168 bytes per frame in pages that use PerformanceTiming.
+        Once bug 227336 is turned on and the web is given a year or so to move to that replacement API, this whole API will be removed.
+
+        * page/PerformanceTiming.cpp:
+        (WebCore::PerformanceTiming::navigationStart const):
+        (WebCore::PerformanceTiming::unloadEventStart const):
+        (WebCore::PerformanceTiming::unloadEventEnd const):
+        (WebCore::PerformanceTiming::redirectStart const):
+        (WebCore::PerformanceTiming::redirectEnd const):
+        (WebCore::PerformanceTiming::fetchStart const):
+        (WebCore::PerformanceTiming::domainLookupStart const):
+        (WebCore::PerformanceTiming::domainLookupEnd const):
+        (WebCore::PerformanceTiming::connectStart const):
+        (WebCore::PerformanceTiming::connectEnd const):
+        (WebCore::PerformanceTiming::secureConnectionStart const):
+        (WebCore::PerformanceTiming::requestStart const):
+        (WebCore::PerformanceTiming::responseStart const):
+        (WebCore::PerformanceTiming::responseEnd const):
+        (WebCore::PerformanceTiming::domLoading const):
+        (WebCore::PerformanceTiming::domInteractive const):
+        (WebCore::PerformanceTiming::domContentLoadedEventStart const):
+        (WebCore::PerformanceTiming::domContentLoadedEventEnd const):
+        (WebCore::PerformanceTiming::domComplete const):
+        (WebCore::PerformanceTiming::loadEventStart const):
+        (WebCore::PerformanceTiming::loadEventEnd const):
+        * page/PerformanceTiming.h:
+
</ins><span class="cx"> 2021-07-29  Michael Catanzaro  <mcatanzaro@gnome.org>
</span><span class="cx"> 
</span><span class="cx">         -Wreturn-type warning in SQLiteDatabase.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceTimingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceTiming.cpp (280453 => 280454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceTiming.cpp  2021-07-29 22:52:27 UTC (rev 280453)
+++ trunk/Source/WebCore/page/PerformanceTiming.cpp     2021-07-29 23:02:09 UTC (rev 280454)
</span><span class="lines">@@ -50,15 +50,22 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::navigationStart() const
</span><span class="cx"> {
</span><ins>+    if (m_navigationStart)
+        return m_navigationStart;
+
</ins><span class="cx">     auto* timing = documentLoadTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->startTime());
</del><ins>+    m_navigationStart = monotonicTimeToIntegerMilliseconds(timing->startTime());
+    return m_navigationStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::unloadEventStart() const
</span><span class="cx"> {
</span><ins>+    if (m_unloadEventStart)
+        return m_unloadEventStart;
+
</ins><span class="cx">     auto* timing = documentLoadTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="lines">@@ -70,11 +77,15 @@
</span><span class="cx">     if (metrics->failsTAOCheck || !timing->hasSameOriginAsPreviousDocument())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->unloadEventStart());
</del><ins>+    m_unloadEventStart = monotonicTimeToIntegerMilliseconds(timing->unloadEventStart());
+    return m_unloadEventStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::unloadEventEnd() const
</span><span class="cx"> {
</span><ins>+    if (m_unloadEventEnd)
+        return m_unloadEventEnd;
+
</ins><span class="cx">     auto* timing = documentLoadTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="lines">@@ -86,11 +97,15 @@
</span><span class="cx">     if (metrics->failsTAOCheck || !timing->hasSameOriginAsPreviousDocument())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->unloadEventEnd());
</del><ins>+    m_unloadEventEnd = monotonicTimeToIntegerMilliseconds(timing->unloadEventEnd());
+    return m_unloadEventEnd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::redirectStart() const
</span><span class="cx"> {
</span><ins>+    if (m_redirectStart)
+        return m_redirectStart;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics
</span><span class="cx">         || metrics->failsTAOCheck
</span><span class="lines">@@ -97,11 +112,15 @@
</span><span class="cx">         || !metrics->redirectCount)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->redirectStart);
</del><ins>+    m_redirectStart = monotonicTimeToIntegerMilliseconds(metrics->redirectStart);
+    return m_redirectStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::redirectEnd() const
</span><span class="cx"> {
</span><ins>+    if (m_redirectEnd)
+        return m_redirectEnd;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics
</span><span class="cx">         || metrics->failsTAOCheck
</span><span class="lines">@@ -108,57 +127,81 @@
</span><span class="cx">         || !metrics->redirectCount)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->fetchStart);
</del><ins>+    m_redirectEnd = monotonicTimeToIntegerMilliseconds(metrics->fetchStart);
+    return m_redirectEnd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::fetchStart() const
</span><span class="cx"> {
</span><ins>+    if (m_fetchStart)
+        return m_fetchStart;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->fetchStart);
</del><ins>+    m_fetchStart = monotonicTimeToIntegerMilliseconds(metrics->fetchStart);
+    return m_fetchStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::domainLookupStart() const
</span><span class="cx"> {
</span><ins>+    if (m_domainLookupStart)
+        return m_domainLookupStart;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics || !metrics->domainLookupStart)
</span><span class="cx">         return fetchStart();
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->domainLookupStart);
</del><ins>+    m_domainLookupStart = monotonicTimeToIntegerMilliseconds(metrics->domainLookupStart);
+    return m_domainLookupStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::domainLookupEnd() const
</span><span class="cx"> {
</span><ins>+    if (m_domainLookupEnd)
+        return m_domainLookupEnd;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics || !metrics->domainLookupEnd)
</span><span class="cx">         return domainLookupStart();
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->domainLookupEnd);
</del><ins>+    m_domainLookupEnd = monotonicTimeToIntegerMilliseconds(metrics->domainLookupEnd);
+    return m_domainLookupEnd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::connectStart() const
</span><span class="cx"> {
</span><ins>+    if (m_connectStart)
+        return m_connectStart;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics || !metrics->connectStart
</span><span class="cx">         || metrics->domainLookupEnd.secondsSinceEpoch() > metrics->connectStart.secondsSinceEpoch())
</span><span class="cx">         return domainLookupEnd();
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->connectStart);
</del><ins>+    m_connectStart = monotonicTimeToIntegerMilliseconds(metrics->connectStart);
+    return m_connectStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::connectEnd() const
</span><span class="cx"> {
</span><ins>+    if (m_connectEnd)
+        return m_connectEnd;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics || !metrics->connectEnd)
</span><span class="cx">         return connectStart();
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->connectEnd);
</del><ins>+    m_connectEnd = monotonicTimeToIntegerMilliseconds(metrics->connectEnd);
+    return m_connectEnd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::secureConnectionStart() const
</span><span class="cx"> {
</span><ins>+    if (m_secureConnectionStart)
+        return m_secureConnectionStart;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics)
</span><span class="cx">         return connectEnd();
</span><span class="lines">@@ -167,97 +210,138 @@
</span><span class="cx">         || metrics->secureConnectionStart == reusedTLSConnectionSentinel)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->secureConnectionStart);
</del><ins>+    m_secureConnectionStart = monotonicTimeToIntegerMilliseconds(metrics->secureConnectionStart);
+    return m_secureConnectionStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::requestStart() const
</span><span class="cx"> {
</span><ins>+    if (m_requestStart)
+        return m_requestStart;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics || !metrics->requestStart)
</span><span class="cx">         return connectEnd();
</span><span class="cx">     
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->requestStart);
</del><ins>+    m_requestStart = monotonicTimeToIntegerMilliseconds(metrics->requestStart);
+    return m_requestStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::responseStart() const
</span><span class="cx"> {
</span><ins>+    if (m_responseStart)
+        return m_responseStart;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics || !metrics->responseStart)
</span><span class="cx">         return requestStart();
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->responseStart);
</del><ins>+    m_responseStart = monotonicTimeToIntegerMilliseconds(metrics->responseStart);
+    return m_responseStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::responseEnd() const
</span><span class="cx"> {
</span><ins>+    if (m_responseEnd)
+        return m_responseEnd;
+
</ins><span class="cx">     auto* metrics = networkLoadMetrics();
</span><span class="cx">     if (!metrics || !metrics->responseEnd)
</span><span class="cx">         return responseStart();
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(metrics->responseEnd);
</del><ins>+    m_responseEnd = monotonicTimeToIntegerMilliseconds(metrics->responseEnd);
+    return m_responseEnd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::domLoading() const
</span><span class="cx"> {
</span><ins>+    if (m_domLoading)
+        return m_domLoading;
+
</ins><span class="cx">     auto* timing = documentEventTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return fetchStart();
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->domLoading);
</del><ins>+    m_domLoading = monotonicTimeToIntegerMilliseconds(timing->domLoading);
+    return m_domLoading;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::domInteractive() const
</span><span class="cx"> {
</span><ins>+    if (m_domInteractive)
+        return m_domInteractive;
+
</ins><span class="cx">     auto* timing = documentEventTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->domInteractive);
</del><ins>+    m_domInteractive = monotonicTimeToIntegerMilliseconds(timing->domInteractive);
+    return m_domInteractive;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::domContentLoadedEventStart() const
</span><span class="cx"> {
</span><ins>+    if (m_domContentLoadedEventStart)
+        return m_domContentLoadedEventStart;
+
</ins><span class="cx">     auto* timing = documentEventTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->domContentLoadedEventStart);
</del><ins>+    m_domContentLoadedEventStart = monotonicTimeToIntegerMilliseconds(timing->domContentLoadedEventStart);
+    return m_domContentLoadedEventStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::domContentLoadedEventEnd() const
</span><span class="cx"> {
</span><ins>+    if (m_domContentLoadedEventEnd)
+        return m_domContentLoadedEventEnd;
+
</ins><span class="cx">     auto* timing = documentEventTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->domContentLoadedEventEnd);
</del><ins>+    m_domContentLoadedEventEnd = monotonicTimeToIntegerMilliseconds(timing->domContentLoadedEventEnd);
+    return m_domContentLoadedEventEnd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::domComplete() const
</span><span class="cx"> {
</span><ins>+    if (m_domComplete)
+        return m_domComplete;
+
</ins><span class="cx">     auto* timing = documentEventTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->domComplete);
</del><ins>+    m_domComplete = monotonicTimeToIntegerMilliseconds(timing->domComplete);
+    return m_domComplete;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::loadEventStart() const
</span><span class="cx"> {
</span><ins>+    if (m_loadEventStart)
+        return m_loadEventStart;
+
</ins><span class="cx">     auto* timing = documentLoadTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->loadEventStart());
</del><ins>+    m_loadEventStart = monotonicTimeToIntegerMilliseconds(timing->loadEventStart());
+    return m_loadEventStart;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long PerformanceTiming::loadEventEnd() const
</span><span class="cx"> {
</span><ins>+    if (m_loadEventEnd)
+        return m_loadEventEnd;
+
</ins><span class="cx">     auto* timing = documentLoadTiming();
</span><span class="cx">     if (!timing)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return monotonicTimeToIntegerMilliseconds(timing->loadEventEnd());
</del><ins>+    m_loadEventEnd = monotonicTimeToIntegerMilliseconds(timing->loadEventEnd());
+    return m_loadEventEnd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const DocumentLoader* PerformanceTiming::documentLoader() const
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceTimingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceTiming.h (280453 => 280454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceTiming.h    2021-07-29 22:52:27 UTC (rev 280453)
+++ trunk/Source/WebCore/page/PerformanceTiming.h       2021-07-29 23:02:09 UTC (rev 280454)
</span><span class="lines">@@ -78,6 +78,28 @@
</span><span class="cx">     const DocumentLoadTiming* documentLoadTiming() const;
</span><span class="cx">     const NetworkLoadMetrics* networkLoadMetrics() const;
</span><span class="cx">     unsigned long long monotonicTimeToIntegerMilliseconds(MonotonicTime) const;
</span><ins>+
+    mutable unsigned long long m_navigationStart { 0 };
+    mutable unsigned long long m_unloadEventStart { 0 };
+    mutable unsigned long long m_unloadEventEnd { 0 };
+    mutable unsigned long long m_redirectStart { 0 };
+    mutable unsigned long long m_redirectEnd { 0 };
+    mutable unsigned long long m_fetchStart { 0 };
+    mutable unsigned long long m_domainLookupStart { 0 };
+    mutable unsigned long long m_domainLookupEnd { 0 };
+    mutable unsigned long long m_connectStart { 0 };
+    mutable unsigned long long m_connectEnd { 0 };
+    mutable unsigned long long m_secureConnectionStart { 0 };
+    mutable unsigned long long m_requestStart { 0 };
+    mutable unsigned long long m_responseStart { 0 };
+    mutable unsigned long long m_responseEnd { 0 };
+    mutable unsigned long long m_domLoading { 0 };
+    mutable unsigned long long m_domInteractive { 0 };
+    mutable unsigned long long m_domContentLoadedEventStart { 0 };
+    mutable unsigned long long m_domContentLoadedEventEnd { 0 };
+    mutable unsigned long long m_domComplete { 0 };
+    mutable unsigned long long m_loadEventStart { 0 };
+    mutable unsigned long long m_loadEventEnd { 0 };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>