Commit 99d003ca authored by horo's avatar horo Committed by Commit bot

Use completion_time to call LoadingFinished of DevTools's Network event for navigation preload

Currently NetworkHandler::NavigationPreloadCompleted() is using TimeTicks::Now()
to call LoadingFinished() of DevTools's Network event. But for normal requests
from the renderer, FrameFetchContext::DispatchDidFinishLoading() is using the
|finish_time| which is originated from ResourceRequestCompletionStatus's
completion_time.

NetworkHandler::NavigationPreloadCompleted() should use the same timing
information.

I found this difference while investigating the issue 712809. |completion_time|
is set when the request finished but, NavigationPreloadCompleted() isn't called
before the service worker finishes starting up.

BUG=712809

Review-Url: https://codereview.chromium.org/2844133005
Cr-Commit-Position: refs/heads/master@{#467896}
parent 08879a12
...@@ -704,8 +704,9 @@ void NetworkHandler::NavigationPreloadCompleted( ...@@ -704,8 +704,9 @@ void NetworkHandler::NavigationPreloadCompleted(
completion_status.error_code == net::Error::ERR_ABORTED); completion_status.error_code == net::Error::ERR_ABORTED);
} }
frontend_->LoadingFinished( frontend_->LoadingFinished(
request_id, base::TimeTicks::Now().ToInternalValue() / request_id,
static_cast<double>(base::Time::kMicrosecondsPerSecond), completion_status.completion_time.ToInternalValue() /
static_cast<double>(base::Time::kMicrosecondsPerSecond),
completion_status.encoded_data_length); completion_status.encoded_data_length);
} }
......
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