Commit e46e36a0 authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

Fix observing loading behavior in DocumentLoader

Regressed by crrev.com/83d5d416.

DidObserveLoadingBehavior should come after DispatchDidCommitLoad,
and the order got reversed while moving DispatchDidCommitLoad call
a bit later in the navigation commit process.

Bug: 1020082
Change-Id: I0c636f8d64b917a49902e560a38b1f0cb3c7bfe8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893688Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711622}
parent 0f4a93ac
...@@ -1420,15 +1420,6 @@ void DocumentLoader::DidCommitNavigation() { ...@@ -1420,15 +1420,6 @@ void DocumentLoader::DidCommitNavigation() {
// resumed. // resumed.
frame_->ResumeSubresourceLoading(); frame_->ResumeSubresourceLoading();
// DidObserveLoadingBehavior() must be called after DispatchDidCommitLoad() is
// called for the metrics tracking logic to handle it properly.
if (service_worker_network_provider_ &&
service_worker_network_provider_->GetControllerServiceWorkerMode() ==
blink::mojom::ControllerServiceWorkerMode::kControlled) {
GetLocalFrameClient().DidObserveLoadingBehavior(
kLoadingBehaviorServiceWorkerControlled);
}
Document* document = frame_->GetDocument(); Document* document = frame_->GetDocument();
InteractiveDetector* interactive_detector = InteractiveDetector* interactive_detector =
InteractiveDetector::From(*document); InteractiveDetector::From(*document);
...@@ -1600,6 +1591,15 @@ void DocumentLoader::InstallNewDocument( ...@@ -1600,6 +1591,15 @@ void DocumentLoader::InstallNewDocument(
void DocumentLoader::CreateParserPostCommit() { void DocumentLoader::CreateParserPostCommit() {
Document* document = frame_->GetDocument(); Document* document = frame_->GetDocument();
// DidObserveLoadingBehavior() must be called after DispatchDidCommitLoad() is
// called for the metrics tracking logic to handle it properly.
if (service_worker_network_provider_ &&
service_worker_network_provider_->GetControllerServiceWorkerMode() ==
blink::mojom::ControllerServiceWorkerMode::kControlled) {
GetLocalFrameClient().DidObserveLoadingBehavior(
kLoadingBehaviorServiceWorkerControlled);
}
// Links with media values need more information (like viewport information). // Links with media values need more information (like viewport information).
// This happens after the first chunk is parsed in HTMLDocumentParser. // This happens after the first chunk is parsed in HTMLDocumentParser.
DispatchLinkHeaderPreloads(base::nullopt /* viewport */, DispatchLinkHeaderPreloads(base::nullopt /* viewport */,
......
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