Commit 60d0fd2b authored by Yoav Weiss's avatar Yoav Weiss Committed by Commit Bot

[Resource Timing] Initialize the WebResourceTimingInfo struct

The WebResourceTimingInfo struct was not properly initialized. Beyond
that, when copying values from the ResourceTimingInfo struct,
is_secure_context remained uninitialized, as it does not exist on the
other end. This CL initializes all of the above.

Bug: 969770
Change-Id: I4c4c1f5161fc196b05d5a7d828ef1310a53d8597
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643531Reviewed-by: default avatarNicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarBen Kelly <wanderview@chromium.org>
Commit-Queue: Yoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666163}
parent b3f5329a
...@@ -116,6 +116,9 @@ blink::WebResourceTimingInfo ResourceTimingInfoToWebResourceTimingInfo( ...@@ -116,6 +116,9 @@ blink::WebResourceTimingInfo ResourceTimingInfoToWebResourceTimingInfo(
info.decoded_body_size = resource_timing.decoded_body_size; info.decoded_body_size = resource_timing.decoded_body_size;
info.did_reuse_connection = resource_timing.did_reuse_connection; info.did_reuse_connection = resource_timing.did_reuse_connection;
// TODO(https://crbug.com/970242): This may result in errounous reporting of
// iframes with different schemes than its parent frame.
info.is_secure_context = false;
info.allow_timing_details = resource_timing.allow_timing_details; info.allow_timing_details = resource_timing.allow_timing_details;
info.allow_redirect_details = resource_timing.allow_redirect_details; info.allow_redirect_details = resource_timing.allow_redirect_details;
......
...@@ -35,7 +35,7 @@ struct WebServerTimingInfo { ...@@ -35,7 +35,7 @@ struct WebServerTimingInfo {
#endif #endif
WebString name; WebString name;
double duration; double duration = 0.0;
WebString description; WebString description;
}; };
...@@ -64,12 +64,12 @@ struct WebResourceTimingInfo { ...@@ -64,12 +64,12 @@ struct WebResourceTimingInfo {
base::TimeTicks last_redirect_end_time; base::TimeTicks last_redirect_end_time;
base::TimeTicks response_end; base::TimeTicks response_end;
uint64_t transfer_size; uint64_t transfer_size = 0U;
uint64_t encoded_body_size; uint64_t encoded_body_size = 0U;
uint64_t decoded_body_size; uint64_t decoded_body_size = 0U;
bool did_reuse_connection; bool did_reuse_connection = false;
bool is_secure_context; bool is_secure_context = false;
// TODO(dcheng): The way this code works is fairly confusing: it might seem // TODO(dcheng): The way this code works is fairly confusing: it might seem
// unusual to store policy members like |allow_timing_details| inline, rather // unusual to store policy members like |allow_timing_details| inline, rather
...@@ -77,8 +77,8 @@ struct WebResourceTimingInfo { ...@@ -77,8 +77,8 @@ struct WebResourceTimingInfo {
// PerformanceNavigationTiming inherits and shares many of the same fields // PerformanceNavigationTiming inherits and shares many of the same fields
// exposed by PerformanceResourceTiming, but the underlying behavior is a // exposed by PerformanceResourceTiming, but the underlying behavior is a
// little different. // little different.
bool allow_timing_details; bool allow_timing_details = false;
bool allow_redirect_details; bool allow_redirect_details = false;
// Normally, the timestamps are relative to the time origin. In most cases, // Normally, the timestamps are relative to the time origin. In most cases,
// these timestamps should be positive value, so 0 is used to mark invalid // these timestamps should be positive value, so 0 is used to mark invalid
...@@ -87,7 +87,7 @@ struct WebResourceTimingInfo { ...@@ -87,7 +87,7 @@ struct WebResourceTimingInfo {
// However, ServiceWorker navigation preloads may be negative, since these // However, ServiceWorker navigation preloads may be negative, since these
// requests may be started before the service worker started. In those cases, // requests may be started before the service worker started. In those cases,
// this flag should be set to true. // this flag should be set to true.
bool allow_negative_values; bool allow_negative_values = false;
WebVector<WebServerTimingInfo> server_timing; WebVector<WebServerTimingInfo> server_timing;
}; };
......
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