Log NavigationPredictor metrics when links enter the viewport.

NavigationPredictorAnchorElementMetrics will now be logged only for
links that enter the viewport. Links that are inserted after onload
will also be reported.Only a fraction (1% by default) of links entering
the viewport are reported.

Aggregate statistic on all links on the page
(NavigationPredictorPageLinkMetrics) will now be reported for all
links on the page (regardless of whether then enter the viewport),
including links inserted after onload.

Also remove obsolete Prefetching code in NavigationPredictor.
Now that we have Speculation Rules, prefetching code should be distinct
from link click prediction. Also we already have prefetching logic for
the prefetch proxy in chrome/browser/prefetch/prefetch_proxy. Despite
the name, most of that code is not proxy specific. If we want to
reintroduce non-proxied prefetching, that code can likely be
generalized.

Bug: 1157161, 1199367
Change-Id: Ie6f718bec09fc1e69415dce620a1164b07b20381
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2724978
Commit-Queue: Simon Pelchat <spelchat@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#875463}
GitOrigin-RevId: 60e8ab3f3be7eef75f5b43ba8d01a2136ff0f85b
3 files changed
tree: 0c5cf296f087f4b0bfa5b9aafc855754e2092ac0
  1. .style.yapf
  2. DEPS
  3. DIR_METADATA
  4. OWNERS
  5. accessibility/
  6. android/
  7. apply_cpplint_header_guard.py
  8. auto-nav.py
  9. autotest.py
  10. bash-completion
  11. binary_size/
  12. bisect-builds.py
  13. bisect_repackage/
  14. bisect_test.py
  15. boilerplate.py
  16. buildstate.bat
  17. buildstate.py
  18. cfi/
  19. check_ecs_deps/
  20. check_git_config.py
  21. check_grd_for_unused_strings.py
  22. checkbins/
  23. checklicenses/
  24. checkperms/
  25. checkteamtags/
  26. chrome_extensions/
  27. clang-format-js
  28. clang/
  29. code_coverage/
  30. compile_test/
  31. coverity/
  32. cr/
  33. cros/
  34. cygprofile/
  35. determinism/
  36. diagnose-me.py
  37. diagnosis/
  38. download_optimization_profile.py
  39. dromaeo_benchmark_runner/
  40. dump_process_memory/
  41. emacs/
  42. find_runtime_symbols/
  43. flags/
  44. flakiness/
  45. fuchsia/
  46. gdb/
  47. generate_library_loader/
  48. generate_shim_headers/
  49. generate_stubs/
  50. get_swarming_logs/
  51. git/
  52. gn/
  53. grit/
  54. gritsettings/
  55. gypv8sh.py
  56. idl_parser/
  57. imagediff/
  58. include_tracer.py
  59. infra/
  60. ipc_fuzzer/
  61. ipc_messages_log.py
  62. json_comment_eater/
  63. json_schema_compiler/
  64. json_to_struct/
  65. l10n/
  66. licenses.py
  67. linux/
  68. lldb/
  69. luci-go/
  70. mac/
  71. make-gtest-filter.py
  72. mb/
  73. md_browser/
  74. media_engagement_preload/
  75. memory/
  76. memory_inspector/
  77. metrics/
  78. msan/
  79. multi_process_rss.py
  80. nocompile_driver.py
  81. omahaproxy.py
  82. oopif/
  83. origin_trials/
  84. page_cycler/
  85. perf/
  86. perry.py
  87. polymer/
  88. privacy_budget/
  89. protoc_wrapper/
  90. python/
  91. real_world_impact/
  92. remove_duplicate_includes.py
  93. remove_stale_pyc_files.py
  94. resources/
  95. resultdb/
  96. roll_webgl_conformance.py
  97. run-swarmed.py
  98. security/
  99. site_compare/
  100. sort-headers.py
  101. sort_sources.py
  102. stats_viewer/
  103. strict_enum_value_checker/
  104. style_variable_generator/
  105. sublime/
  106. symsrc/
  107. tcmalloc/
  108. tests/
  109. traceline/
  110. traffic_annotation/
  111. translation/
  112. typescript/
  113. uberblame.py
  114. ubsan/
  115. unused-symbols-report.py
  116. update_pgo_profiles.py
  117. usb_gadget/
  118. v8_context_snapshot/
  119. valgrind/
  120. variations/
  121. vim/
  122. vscode/
  123. web_bluetooth/
  124. web_dev_style/
  125. win/
  126. yes_no.py