When making next navigation prediction, after making the prediction, it's possible to take multiple actions such as preconnect or prefetch. In the dry run mode, we should record metrics on what action we wanted to take, and how accurate was that.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/13699353c77817fc22a182335e79a37f4d58de12 commit 13699353c77817fc22a182335e79a37f4d58de12 Author: Tarun Bansal <tbansal@chromium.org> Date: Fri Nov 09 23:19:16 2018 Navigation predictor: Normalize anchor elements score Normalize the score across all anchor elements. This makes it simpler to use anchor element score when predicting the next navigation when there are many anchors on the webpage, and all of them may have high score. Also, includes minor cleanups where some of the variables are added to the header file. These will be used in the next CL. Change-Id: Iad914682ef6d96c1b4d3cab040b555a6723f05de Bug: 903945 TBR: ryansturm@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/1328561 Commit-Queue: Tarun Bansal <tbansal@chromium.org> Reviewed-by: Tarun Bansal <tbansal@chromium.org> Cr-Commit-Position: refs/heads/master@{#607020} [modify] https://crrev.com/13699353c77817fc22a182335e79a37f4d58de12/chrome/browser/navigation_predictor/navigation_predictor.cc [modify] https://crrev.com/13699353c77817fc22a182335e79a37f4d58de12/chrome/browser/navigation_predictor/navigation_predictor.h [modify] https://crrev.com/13699353c77817fc22a182335e79a37f4d58de12/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1d3aee35420cda1b39b1786d3b5c17b54238feef commit 1d3aee35420cda1b39b1786d3b5c17b54238feef Author: Tarun Bansal <tbansal@chromium.org> Date: Thu Nov 15 01:17:01 2018 Navigation Predictor: Add UMA for action taken This CL adds logic for determining which URL to prefetch and records UMA around that. Note that navigation predictor is still running in dry-run mode, as in no prefetch is actually done. Change-Id: I620a3c10146f47b3bd2d8b042b54af0a5879fc90 Bug: 903945 TBR: ryansturm@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/1333247 Reviewed-by: Tarun Bansal <tbansal@chromium.org> Reviewed-by: Jesse Doherty <jwd@chromium.org> Commit-Queue: Tarun Bansal <tbansal@chromium.org> Cr-Commit-Position: refs/heads/master@{#608209} [modify] https://crrev.com/1d3aee35420cda1b39b1786d3b5c17b54238feef/chrome/browser/navigation_predictor/navigation_predictor.cc [modify] https://crrev.com/1d3aee35420cda1b39b1786d3b5c17b54238feef/chrome/browser/navigation_predictor/navigation_predictor.h [modify] https://crrev.com/1d3aee35420cda1b39b1786d3b5c17b54238feef/chrome/browser/navigation_predictor/navigation_predictor_browsertest.cc [modify] https://crrev.com/1d3aee35420cda1b39b1786d3b5c17b54238feef/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc [add] https://crrev.com/1d3aee35420cda1b39b1786d3b5c17b54238feef/chrome/test/data/navigation_predictor/page_with_same_host_anchor_element.html [modify] https://crrev.com/1d3aee35420cda1b39b1786d3b5c17b54238feef/tools/metrics/histograms/enums.xml [modify] https://crrev.com/1d3aee35420cda1b39b1786d3b5c17b54238feef/tools/metrics/histograms/histograms.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/312cadeb6f26c20660a0a7f85c57b4e6a4571a2e commit 312cadeb6f26c20660a0a7f85c57b4e6a4571a2e Author: Tarun Bansal <tbansal@chromium.org> Date: Wed Nov 21 20:55:39 2018 Navigation predictor: Record metrics around accuracy of action taken At the time of page load, navigation predictor may take some action (such as prefetch). This CL records metrics around the accuracy of the action taken. Bug: 903945 Change-Id: Id4bea8b7e7aec1f017e070213438b20905f1d96c TBR: ryansturm@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/1338944 Reviewed-by: Tarun Bansal <tbansal@chromium.org> Reviewed-by: Jesse Doherty <jwd@chromium.org> Commit-Queue: Tarun Bansal <tbansal@chromium.org> Cr-Commit-Position: refs/heads/master@{#610207} [modify] https://crrev.com/312cadeb6f26c20660a0a7f85c57b4e6a4571a2e/chrome/browser/navigation_predictor/navigation_predictor.cc [modify] https://crrev.com/312cadeb6f26c20660a0a7f85c57b4e6a4571a2e/chrome/browser/navigation_predictor/navigation_predictor.h [modify] https://crrev.com/312cadeb6f26c20660a0a7f85c57b4e6a4571a2e/chrome/browser/navigation_predictor/navigation_predictor_browsertest.cc [modify] https://crrev.com/312cadeb6f26c20660a0a7f85c57b4e6a4571a2e/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc [modify] https://crrev.com/312cadeb6f26c20660a0a7f85c57b4e6a4571a2e/tools/metrics/histograms/enums.xml [modify] https://crrev.com/312cadeb6f26c20660a0a7f85c57b4e6a4571a2e/tools/metrics/histograms/histograms.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/838bcedc94d859eac3ecbe964be9baabf792d64a commit 838bcedc94d859eac3ecbe964be9baabf792d64a Author: Tarun Bansal <tbansal@chromium.org> Date: Mon Nov 26 19:35:07 2018 Navigation Predictor: Simplify the browser tests Simplify the browser tests by not checking for when the experiment is disabled. Also, add DCHECKs to the cc file to ensure that the navigation predictor mojo binding object is created only if the field trial is enabled. Change-Id: I24189c75994e73a1f30d1a7aecc6d7bdaf4e8857 Bug: 903945 TBR: ryansturm@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/1349873 Reviewed-by: Tarun Bansal <tbansal@chromium.org> Commit-Queue: Tarun Bansal <tbansal@chromium.org> Cr-Commit-Position: refs/heads/master@{#610915} [modify] https://crrev.com/838bcedc94d859eac3ecbe964be9baabf792d64a/chrome/browser/navigation_predictor/navigation_predictor.cc [modify] https://crrev.com/838bcedc94d859eac3ecbe964be9baabf792d64a/chrome/browser/navigation_predictor/navigation_predictor_browsertest.cc [modify] https://crrev.com/838bcedc94d859eac3ecbe964be9baabf792d64a/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2b2c6007d6957997908921d2ee92709e364af75b commit 2b2c6007d6957997908921d2ee92709e364af75b Author: Tarun Bansal <tbansal@chromium.org> Date: Wed Nov 28 02:47:44 2018 NavigationPredictor: Set a threshold score for the prefetch URL Prefetch a URL only if it's score is more than the specified threshold. Additionally, only the highest ranking URL is now eligible for prefetching. Bug: 903945 Change-Id: I6c8166e8424da8c06f093998d606e1962184d20d TBR: ryansturm@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/1352034 Reviewed-by: Tarun Bansal <tbansal@chromium.org> Commit-Queue: Tarun Bansal <tbansal@chromium.org> Cr-Commit-Position: refs/heads/master@{#611533} [modify] https://crrev.com/2b2c6007d6957997908921d2ee92709e364af75b/chrome/browser/navigation_predictor/navigation_predictor.cc [modify] https://crrev.com/2b2c6007d6957997908921d2ee92709e364af75b/chrome/browser/navigation_predictor/navigation_predictor.h [modify] https://crrev.com/2b2c6007d6957997908921d2ee92709e364af75b/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f2854a0d56921d4c43a7afe6830c1503b9bf4a80 commit f2854a0d56921d4c43a7afe6830c1503b9bf4a80 Author: Tarun Bansal <tbansal@chromium.org> Date: Thu Nov 29 00:25:32 2018 Navigation Predictor: Add logic to preconnect to origins with highest preconnect score At onLoad, Preconnect to the origin that has the highest preconnect score as long as the score is above the specified threshold. Currently, due to privacy constraints, this is restricted to only the document origin. Effectively, this means that we preconnect to the document origin only if its preconnect score is more than the specified threshold. If not, no preconnect action is taken. The preconnect score of an origin is computed from the score of all the anchor elements on the webpage that point to that origin. Change-Id: Ie3178f352cb5106124e13cb6f7e39b9ecf81174c Bug: 903945 Reviewed-on: https://chromium-review.googlesource.com/c/1349874 Reviewed-by: Ryan Sturm <ryansturm@chromium.org> Commit-Queue: Tarun Bansal <tbansal@chromium.org> Cr-Commit-Position: refs/heads/master@{#611955} [modify] https://crrev.com/f2854a0d56921d4c43a7afe6830c1503b9bf4a80/chrome/browser/navigation_predictor/navigation_predictor.cc [modify] https://crrev.com/f2854a0d56921d4c43a7afe6830c1503b9bf4a80/chrome/browser/navigation_predictor/navigation_predictor.h [modify] https://crrev.com/f2854a0d56921d4c43a7afe6830c1503b9bf4a80/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc [modify] https://crrev.com/f2854a0d56921d4c43a7afe6830c1503b9bf4a80/tools/metrics/histograms/enums.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d3b21da315145de0ebe0f139387a5cbe160b1605 commit d3b21da315145de0ebe0f139387a5cbe160b1605 Author: Tarun Bansal <tbansal@chromium.org> Date: Wed Dec 19 00:56:48 2018 Navigation predictor: Skip same document url Skip URLs that differ from document URL by only ref params. This means if an anchor element contains an URL that differs from the document URL by only ref param, then that URL would not be selected for prefetching. Also, combine scores of anchor elements whose URLs differ only in query params. Change-Id: If39097fb451539784d773ecc19e6a6cdba28cccf Bug: 903945 Reviewed-on: https://chromium-review.googlesource.com/c/1378014 Commit-Queue: Tarun Bansal <tbansal@chromium.org> Reviewed-by: Ryan Sturm <ryansturm@chromium.org> Cr-Commit-Position: refs/heads/master@{#617697} [modify] https://crrev.com/d3b21da315145de0ebe0f139387a5cbe160b1605/chrome/browser/navigation_predictor/navigation_predictor.cc [modify] https://crrev.com/d3b21da315145de0ebe0f139387a5cbe160b1605/chrome/browser/navigation_predictor/navigation_predictor_browsertest.cc [modify] https://crrev.com/d3b21da315145de0ebe0f139387a5cbe160b1605/chrome/browser/navigation_predictor/navigation_predictor_unittest.cc [modify] https://crrev.com/d3b21da315145de0ebe0f139387a5cbe160b1605/chrome/test/data/navigation_predictor/simple_page_with_anchors.html
Comment 1 by tbansal@chromium.org
, Nov 9