Commit 09b1ecec authored by Ben Kelly's avatar Ben Kelly Committed by Commit Bot

Performance: Respect navigation's AllowTimingDetails() override in workerStart().

This change means we will now properly populate workerStart on the
PerformanceNavigationTiming entry.  Previously it was always being set
to zero.

Bug: 1044810
Change-Id: Idca297222a36dfb54a6ad84e1414267cfff56aa6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2043932Reviewed-by: default avatarYoav Weiss <yoavweiss@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739465}
parent 15424618
......@@ -178,7 +178,7 @@ bool IsDocumentDestination(mojom::RequestContextType context_type) {
DOMHighResTimeStamp PerformanceResourceTiming::workerStart() const {
ResourceLoadTiming* timing = GetResourceLoadTiming();
if (!timing || timing->WorkerStart().is_null() ||
(!allow_timing_details_ && IsDocumentDestination(context_type_))) {
(!AllowTimingDetails() && IsDocumentDestination(context_type_))) {
return 0.0;
}
......
......@@ -133,6 +133,8 @@ class CORE_EXPORT PerformanceResourceTiming
uint64_t encoded_body_size_ = 0;
uint64_t decoded_body_size_ = 0;
bool did_reuse_connection_ = false;
// Do not access allow_timing_details_ directly. Instead use the
// AllowTimingDetails() method which is overridden by some sub-classes.
bool allow_timing_details_ = false;
bool allow_redirect_details_ = false;
bool allow_negative_value_ = false;
......
......@@ -46,6 +46,7 @@ promise_test(t => {
return navigate_in_frame(frame, 'resources/empty.html');
})
.then(timing => {
assert_greater_than(timing.workerStart, 0);
verify(timing);
})
.catch(unreached_rejection(t))
......
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