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