diff --git a/fetch.bs b/fetch.bs index ce5814aef..30dceaceb 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1932,7 +1932,8 @@ message as HTTP/2 does not support them. cache state (the empty string or "local"). Unlesss stated otherwise, it is the empty string. -

This is intended solely for usage by service workers. [[SW]] +

This is intended for usage by Service Workers and +Resource Timing. [[SW]] [[RESOURCE-TIMING]] @@ -3512,7 +3513,7 @@ representing the number of bytes transmitted. If given, processRequestEndOf an algorithm accepting no arguments. If given, processResponse must be an algorithm accepting a response. If given, processResponseEndOfBody must be an algorithm accepting a response and null, failure, or a byte sequence. If -given, processResponseDone must be an algorithm accepting no arguments. +given, processResponseDone must be an algorithm accepting a response.

An ongoing fetch can be terminated with flag aborted, @@ -3986,9 +3987,9 @@ steps: done flag.

  • If fetchParams's process response done is not null, - then queue a fetch task given fetchParams's - process response done and fetchParams's - task destination. + then queue a fetch task to run fetchParams's + process response done given response, + with fetchParams's task destination.

    To finalize and report timing given a response @@ -4003,13 +4004,21 @@ steps:

  • Let timingInfo be response's timing info. +

  • Let cacheState be response's cache state. +

  • If timingInfo is null, then return. -

  • If response's timing allow passed flag is not set, then set - timingInfo to a new fetch timing info whose - start time and - post-redirect start time are timingInfo's - start time. +

  • +

    If response's timing allow passed flag is not set, then: + +

      +
    1. Set timingInfo to a new fetch timing info whose + start time and + post-redirect start time are timingInfo's + start time. + +

    2. Set cacheState to the empty string. +

  • Set timingInfo's end time to the coarsened shared current time given global's @@ -4018,9 +4027,8 @@ steps:

  • Set response's timing info to timingInfo. -

  • Mark resource timing for - timingInfo, originalURL, initiatorType, and global. - +

  • Mark resource timing for timingInfo, originalURL, + initiatorType, global, and cacheState. @@ -7269,8 +7277,9 @@ method steps are:

  • Terminate the ongoing fetch with the aborted flag set. -

  • Let handleFetchDone be to finalize and report timing with - response, globalObject, and "fetch". +

  • Let handleFetchDone given response response be to + finalize and report timing with response, globalObject, and + "fetch".

  • Fetch request with processResponseDone set to