Commit c78bcdb2 authored by Yoav Weiss's avatar Yoav Weiss Committed by Commit Bot

Change navigation preload initiatorType to "navigation"

As discussed at https://github.com/w3c/resource-timing/issues/110
the Resource Timing specification does not single out navigation
preload from other navigation types, and therefore the `initiatorType`
for it should be "navigation", rather than other.

This CL implements that change.

Intent-to-ship: https://groups.google.com/a/chromium.org/d/msg/blink-dev/W3InszDnV2k/AuJg4aAMDQAJ

Change-Id: Iba7fa038892936e164cd408355f1ac9f6592415b
Reviewed-on: https://chromium-review.googlesource.com/941342
Commit-Queue: Yoav Weiss <yoav@yoav.ws>
Reviewed-by: default avatarTsuyoshi Horo <horo@chromium.org>
Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540483}
parent 4b205302
...@@ -14,9 +14,9 @@ function check_timing_entry(entry, url, decodedBodySize, encodedBodySize) { ...@@ -14,9 +14,9 @@ function check_timing_entry(entry, url, decodedBodySize, encodedBodySize) {
'The entryType of preload response timing entry must be "resource' + 'The entryType of preload response timing entry must be "resource' +
'" :' + url); '" :' + url);
assert_equals( assert_equals(
entry.initiatorType, 'other', entry.initiatorType, 'navigation',
'The initiatorType of preload response timing entry must be ' + 'The initiatorType of preload response timing entry must be ' +
'"other":' + url); '"navigation":' + url);
// If the server returns the redirect response, |decodedBodySize| is null and // If the server returns the redirect response, |decodedBodySize| is null and
// |entry.decodedBodySize| shuld be 0. Otherwise |entry.decodedBodySize| must // |entry.decodedBodySize| shuld be 0. Otherwise |entry.decodedBodySize| must
......
...@@ -191,11 +191,10 @@ void FetchEvent::OnNavigationPreloadComplete( ...@@ -191,11 +191,10 @@ void FetchEvent::OnNavigationPreloadComplete(
resource_response.SetEncodedDataLength(encoded_data_length); resource_response.SetEncodedDataLength(encoded_data_length);
resource_response.SetEncodedBodyLength(encoded_body_length); resource_response.SetEncodedBodyLength(encoded_body_length);
resource_response.SetDecodedBodyLength(decoded_body_length); resource_response.SetDecodedBodyLength(decoded_body_length);
// According to the current spec of Resource Timing, the initiator type of // According to the Resource Timing spec, the initiator type of
// navigation preload request must be "other". But it may change when the spec // navigation preload request is "navigation".
// discussion is settled. https://github.com/w3c/resource-timing/issues/110
scoped_refptr<ResourceTimingInfo> info = ResourceTimingInfo::Create( scoped_refptr<ResourceTimingInfo> info = ResourceTimingInfo::Create(
"other", "navigation",
TimeTicksInSeconds( TimeTicksInSeconds(
resource_response.GetResourceLoadTiming()->RequestTime()), resource_response.GetResourceLoadTiming()->RequestTime()),
false /* is_main_resource */); false /* is_main_resource */);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment