Reland: Record metrics and trace events for navigation start adjustments.
This reverts commit c33526f6aea9445541c7cf5b8866410792b9095f.
Record metrics and trace events for navigation start adjustments.
These metrics will indicate how large the adjustments are in practice,
and how consistently they are made.
The previous attempt did not account for negative time adjustments,
which unfortunately can occur in practice. This CL allows us to gather
metrics for negative adjustments as well (diff from PS1).
Bug: 385170155
Change-Id: Id10060ae8ef6e225c09442aa8c72784ef56c2898
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6120967
Reviewed-by: Tarun Bansal <[email protected]>
Commit-Queue: Charlie Reis <[email protected]>
Reviewed-by: Sharon Yang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1401543}
diff --git a/content/browser/renderer_host/navigator.h b/content/browser/renderer_host/navigator.h
index 22051fa..5db1e21ef 100644
--- a/content/browser/renderer_host/navigator.h
+++ b/content/browser/renderer_host/navigator.h
@@ -177,12 +177,16 @@
std::nullopt);
// Called after BeforeUnloadCompleted callback is invoked from the renderer.
- // If |frame_tree_node| has a NavigationRequest waiting for the renderer
+ // If `frame_tree_node` has a NavigationRequest waiting for the renderer
// response, then the request is either started or canceled, depending on the
- // value of |proceed|.
+ // value of `proceed`. If `for_legacy` is true, then this beforeunload flow
+ // was only used to post a task and no beforeunload handlers were run. If
+ // `showed_dialog` is true, then a beforeunload dialog was displayed.
void BeforeUnloadCompleted(FrameTreeNode* frame_tree_node,
bool proceed,
- const base::TimeTicks& proceed_time);
+ const base::TimeTicks& proceed_time,
+ bool for_legacy,
+ bool showed_dialog);
// Used to start a new renderer-initiated navigation, following a
// BeginNavigation IPC from the renderer.