Record navigation_type correctly for debugging 1338089
NavigationRequest.navigation_type_ is not set at the point we capture it
so capture details->type instead which is set.
Bug: 1338089
Change-Id: I08f2c4d42fba7f3e362bd65f37a04f478a4b1083
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3726667
Commit-Queue: Rakina Zata Amni <[email protected]>
Auto-Submit: Fergal Daly <[email protected]>
Commit-Queue: Fergal Daly <[email protected]>
Reviewed-by: Rakina Zata Amni <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1018512}
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc
index 382b56b..1513d6d6 100644
--- a/content/browser/renderer_host/navigation_controller_impl.cc
+++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -1477,6 +1477,7 @@
NavigationEntryImpl* active_entry = GetLastCommittedEntry();
active_entry->SetTimestamp(timestamp);
active_entry->SetHttpStatusCode(params.http_status_code);
+
// TODO(altimin, crbug.com/933147): Remove this logic after we are done with
// implementing back-forward cache.
if (back_forward_cache_metrics &&
@@ -1488,6 +1489,13 @@
// `back_forward_cache_metrics()` may return null as we do not record
// back-forward cache metrics for navigations in non-primary frame trees.
if (active_entry->back_forward_cache_metrics()) {
+ // TODO(https://crbug.com/1338089): Remove this.
+ // These are both only available from details at this point, so we capture
+ // them here.
+ SCOPED_CRASH_KEY_NUMBER("BFCacheMismatch", "navigation_type",
+ details->type);
+ SCOPED_CRASH_KEY_BOOL("BFCacheMismatch", "did_replace",
+ details->did_replace_entry);
active_entry->back_forward_cache_metrics()->DidCommitNavigation(
navigation_request,
back_forward_cache_.IsAllowed(navigation_request->GetURL()));