-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[memories] Support async, piecewise construction of visits.
Visit construction is driven my multiple events that occur with nondeterministic order: 1) The history navigation occurs. 2) The history query for previous visits to the same URL is returned. 3) The omnibox URL is copied. 4) UKM begins tracking the navigation. 5) UKM stops tracking the navigation. 6) The |WebContents| is destroyed (i.e. the tab is closed). 7) Another history navigation occurs. The typical flow for a navigation that ends with the tab closing is: 1) History navigation occurs. 2) UKM begins tracking the navigation. 3) The history query resolves. 4) |WebContents| is destroyed. 5) UKM stops tracking the navigation. The typical flow for a navigation that ends with another navigation: 1) History navigation occurs. 2) UKM begins tracking the navigation. 3) The history query resolves. 4) Another history navigation occurs. 5) UKM stops tracking the navigation. 6) UKM begins tracking the 2nd navigation. The typical flow for a navigation that is followed by a same-app navigation: 1) History navigation occurs. 2) UKM begins tracking the navigation. 3) The history query resolves. 4) N same-app history navigation occurs & N history queries resolve. 5) |WebContents| is destroyed. 6) UKM stops tracking 1st navigation. The typical flow for a navigation that ends quickly: 1) History navigation occurs. 2) UKM begins tracking the navigation. 3) |WebContents| is destroyed. 4) UKM stops tracking the navigation. In other words, arbitrary timing, the lifetime of a navigation, the number of navigations in the same tab, and whether navigating within a single-page-app can all effect the order of events. This CL handles these and other possible permutations of the event timeline. Specifically, this CL: - Introduces |HistoryClustersTabHelper::ExpectUkmNavigationComplete()| invoked when (4) UKM begins tracking a navigation. This allows determining whether we expect |HistoryClustersTabHelper::OnUkmNavigationComplete()| to be invoked later for that navigation; otherwise, we would have to keep a navigation_id->visit mapping around forever. - Commits incomplete visits only after: 1) The history query resolves; otherwise, we'd have a memories visit without a history visit row which isn't useful. 2) Either the next same-tab navigation occurs or the tab is closed; otherwise we wouldn't have page end context signals. 3) Either UKM isn't tracking the navigation (i.e. same-app navigations) or UKM has stopped tracking the navigation; otherwise ths visit wouldn't have a |page_end_reason| context signal and UKM wouldn't be able to record the visits' context signals. - Likewise, records navigation end metrics only when both (1) the history request has resolved and (2) the navigation has ended. - Queries the history DB for previous 2 visits to the URL to 1) find the navigation's URL and visit rows, and 2) compute the |duration_since_last_visit_seconds| context signal. - Uses navigation IDs and URLs instead of |NavigationHandle| and |HistoryAddPageArgs| to identify visits in the memories layer and history DB. - No longer records the context signal |omnibox_url_copied| when copying to the |kSelection| buffer (i.e. when selecting text on linux). Bug: 1171352 Change-Id: I92a031c94ae16f9563c15bf2a5ff75581be1e75e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2762559 Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Tommy Li <tommycli@chromium.org> Commit-Queue: manuk hovanesian <manukh@chromium.org> Cr-Commit-Position: refs/heads/master@{#868140}
- Loading branch information
manukh
authored and
Chromium LUCI CQ
committed
Mar 31, 2021
1 parent
7276d70
commit 67f6040
Showing
17 changed files
with
1,079 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.