⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280971 in webkit


Ignore:
Timestamp:
Aug 12, 2021, 9:26:56 AM (5 years ago)
Author:
Alan Coon
Message:

Cherry-pick r280931. rdar://problem/81852494

REGRESSION (r278392) performance.measure should never throw an InvalidAccessError for fetchStart
https://bugs.webkit.org/show_bug.cgi?id=229008
<rdar://79960877>

Patch by Alex Christensen <achristensen@webkit.org> on 2021-08-11
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/performance/performance-measure-fetch-start.html

PerformanceTiming::fetchStart is returning 0 when we get a main resource from the cache sometimes.
This is causing PerformanceUserTiming::convertMarkToTimestamp to throw an error, which it should.
Like PerformanceResourceTiming::fetchStart we need to fall back to ResourceLoadTiming::startTime
if the NetworkLoadMetrics doesn't have any useful data for us.

  • page/PerformanceTiming.cpp: (WebCore::PerformanceTiming::fetchStart const):

LayoutTests:

  • http/tests/performance/performance-measure-fetch-start-expected.txt: Added.
  • http/tests/performance/performance-measure-fetch-start.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280931 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612.1.27.0-branch
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.1.27.0-branch/LayoutTests/ChangeLog

    r280857 r280971  
     12021-08-12  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r280931. rdar://problem/81852494
     4
     5    REGRESSION (r278392) performance.measure should never throw an InvalidAccessError for fetchStart
     6    https://bugs.webkit.org/show_bug.cgi?id=229008
     7    <rdar://79960877>
     8   
     9    Patch by Alex Christensen <achristensen@webkit.org> on 2021-08-11
     10    Reviewed by Chris Dumez.
     11   
     12    Source/WebCore:
     13   
     14    Test: http/tests/performance/performance-measure-fetch-start.html
     15   
     16    PerformanceTiming::fetchStart is returning 0 when we get a main resource from the cache sometimes.
     17    This is causing PerformanceUserTiming::convertMarkToTimestamp to throw an error, which it should.
     18    Like PerformanceResourceTiming::fetchStart we need to fall back to ResourceLoadTiming::startTime
     19    if the NetworkLoadMetrics doesn't have any useful data for us.
     20   
     21    * page/PerformanceTiming.cpp:
     22    (WebCore::PerformanceTiming::fetchStart const):
     23   
     24    LayoutTests:
     25   
     26    * http/tests/performance/performance-measure-fetch-start-expected.txt: Added.
     27    * http/tests/performance/performance-measure-fetch-start.html: Added.
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2021-08-11  Alex Christensen  <achristensen@webkit.org>
     32
     33            REGRESSION (r278392) performance.measure should never throw an InvalidAccessError for fetchStart
     34            https://bugs.webkit.org/show_bug.cgi?id=229008
     35            <rdar://79960877>
     36
     37            Reviewed by Chris Dumez.
     38
     39            * http/tests/performance/performance-measure-fetch-start-expected.txt: Added.
     40            * http/tests/performance/performance-measure-fetch-start.html: Added.
     41
    1422021-08-10  Russell Epstein  <repstein@apple.com>
    243
  • branches/safari-612.1.27.0-branch/Source/WebCore/ChangeLog

    r280857 r280971  
     12021-08-12  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r280931. rdar://problem/81852494
     4
     5    REGRESSION (r278392) performance.measure should never throw an InvalidAccessError for fetchStart
     6    https://bugs.webkit.org/show_bug.cgi?id=229008
     7    <rdar://79960877>
     8   
     9    Patch by Alex Christensen <achristensen@webkit.org> on 2021-08-11
     10    Reviewed by Chris Dumez.
     11   
     12    Source/WebCore:
     13   
     14    Test: http/tests/performance/performance-measure-fetch-start.html
     15   
     16    PerformanceTiming::fetchStart is returning 0 when we get a main resource from the cache sometimes.
     17    This is causing PerformanceUserTiming::convertMarkToTimestamp to throw an error, which it should.
     18    Like PerformanceResourceTiming::fetchStart we need to fall back to ResourceLoadTiming::startTime
     19    if the NetworkLoadMetrics doesn't have any useful data for us.
     20   
     21    * page/PerformanceTiming.cpp:
     22    (WebCore::PerformanceTiming::fetchStart const):
     23   
     24    LayoutTests:
     25   
     26    * http/tests/performance/performance-measure-fetch-start-expected.txt: Added.
     27    * http/tests/performance/performance-measure-fetch-start.html: Added.
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2021-08-11  Alex Christensen  <achristensen@webkit.org>
     32
     33            REGRESSION (r278392) performance.measure should never throw an InvalidAccessError for fetchStart
     34            https://bugs.webkit.org/show_bug.cgi?id=229008
     35            <rdar://79960877>
     36
     37            Reviewed by Chris Dumez.
     38
     39            Test: http/tests/performance/performance-measure-fetch-start.html
     40
     41            PerformanceTiming::fetchStart is returning 0 when we get a main resource from the cache sometimes.
     42            This is causing PerformanceUserTiming::convertMarkToTimestamp to throw an error, which it should.
     43            Like PerformanceResourceTiming::fetchStart we need to fall back to ResourceLoadTiming::startTime
     44            if the NetworkLoadMetrics doesn't have any useful data for us.
     45
     46            * page/PerformanceTiming.cpp:
     47            (WebCore::PerformanceTiming::fetchStart const):
     48
    1492021-08-10  Russell Epstein  <repstein@apple.com>
    250
  • branches/safari-612.1.27.0-branch/Source/WebCore/page/PerformanceTiming.cpp

    r280454 r280971  
    138138
    139139    auto* metrics = networkLoadMetrics();
    140     if (!metrics)
    141         return 0;
    142 
    143     m_fetchStart = monotonicTimeToIntegerMilliseconds(metrics->fetchStart);
     140    if (metrics)
     141        m_fetchStart = monotonicTimeToIntegerMilliseconds(metrics->fetchStart);
     142
     143    if (!m_fetchStart) {
     144        if (auto* timing = documentLoadTiming())
     145            m_fetchStart = monotonicTimeToIntegerMilliseconds(timing->startTime());
     146    }
     147
     148    // Like PerformanceResourceTiming::fetchStart, fetchStart is a required property
     149    ASSERT(m_fetchStart);
    144150    return m_fetchStart;
    145151}
Note: See TracChangeset for help on using the changeset viewer.