[Merge to M103] Cache Transparency

Squashed from the following CLs:
https://chromium-review.googlesource.com/c/chromium/src/+/3587953
https://chromium-review.googlesource.com/c/chromium/src/+/3636959
https://chromium-review.googlesource.com/c/chromium/src/+/3650158
https://chromium-review.googlesource.com/c/chromium/src/+/3655412
https://chromium-review.googlesource.com/c/chromium/src/+/3662860
https://chromium-review.googlesource.com/c/chromium/src/+/3661869
https://chromium-review.googlesource.com/c/chromium/src/+/3650287

Cache Transparency
The "CacheTransparency" feature enables a list of pervasive payloads to
be specified. These will be placed a single-keyed cache so that they can
be shared across many origins, improving load performance.
The feature is off by default, but can be enabled for experiments.
Significant changes will be required before it can be shipped as an
on-by-default feature.
See the "Intent to Experiment" thread at
https://groups.google.com/a/chromium.org/g/blink-dev/c/9xWJK3IgJb4/m/SYLfUccOBgAJ
Modify network::URLLoader to check each requested resource against the
list of pervasive payloads, and verify the necessary conditions are met
to use the single-keyed cache. Set a load flag and pass the expected
checksum to net::URLRequest.
Make net::HttpCache::Transaction and net::HttpCache::Writers check the
checksum when a resource is loaded into the single-keyed cache. If the
checksum doesn't match the expected value then the entry is marked
"unusable" and future fetches will use the split cache instead.
Cr-Commit-Position: refs/heads/main@{#1006120}
(cherry picked from commit 4b6fb11354bdbaaa71a45e44130722fb86d824e9)

Add CacheTransparency UMAs
Proposal:
https://docs.google.com/document/d/1x97ScebDLyc21uWfKxCydCH7etV40OSHeLG7uULdxeI
Cr-Commit-Position: refs/heads/main@{#1006323}
(cherry picked from commit 485395fb4cbb5d45a139571b127ee23250557c9c)

Introduce new feature flag kPervasivePayloadsList
This new feature flag will allow us to collect metrics on if there is a
resource request URL that matches any of the URLs in Cache
Transparency's pervasive payload list, even when the Cache Transparency
feature is not necessarily enabled. Hence, we'll be able to get data
for the control arm of our Finch experiment.
Cr-Commit-Position: refs/heads/main@{#1006346}
(cherry picked from commit 2fbb29eca19d8a529b637c76e986287c4ad29df2)

Add field trial test config for CacheTransparency
This is in preparation for an experiment.
Cr-Commit-Position: refs/heads/main@{#1006722}
(cherry picked from commit 5741c6ff7b43fb547b76b67638cc7391bd37342c)

Add version number to params in CacheTransparency fieldtrial test config
The pervasive payloads list for Cache Transparency expects the first
item in the list to be the version number, so this CL adds that in.
Cr-Commit-Position: refs/heads/main@{#1006788}
(cherry picked from commit 1d0ad60e15616e5160a8b1c42847a07ac1fb61ad)

Add histogram for Pervasive Payloads List Version
This UMA logs the version of the pervasive payloads list for Cache
Transparency. This will help us to differentiate between the collected
metrics when we use several versions of the URL list.
Cr-Commit-Position: refs/heads/main@{#1007262}
(cherry picked from commit bfeb166a1ef67f228e1d28b063512f9ac864841f)

Add Cache Transparency UKMs
This CL adds two UKMs:
- CacheTransparency.FoundPervasivePayload
- CacheTransparency.TotalBytesFetched
Proposal:
https://docs.google.com/document/d/1x97ScebDLyc21uWfKxCydCH7etV40OSHeLG7uULdxeI
Cr-Commit-Position: refs/heads/main@{#1007655}
(cherry picked from commit 72677af7e9f04d26d1a5522d208136708d5b5094)

Bug: 1309002
Change-Id: I3418ee08702f3728a2e1e1320580c4b38877206d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3670680
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/branch-heads/5060@{#393}
Cr-Branched-From: b83393d0f4038aeaf67f970a024d8101df7348d1-refs/heads/main@{#1002911}
42 files changed
tree: 863b9baa762f3e282993d235ea814d5263e08347
  1. android_webview/
  2. apps/
  3. ash/
  4. base/
  5. build/
  6. build_overrides/
  7. buildtools/
  8. cc/
  9. chrome/
  10. chromecast/
  11. chromeos/
  12. codelabs/
  13. components/
  14. content/
  15. courgette/
  16. crypto/
  17. dbus/
  18. device/
  19. docs/
  20. extensions/
  21. fuchsia/
  22. fuchsia_webengine/
  23. gin/
  24. google_apis/
  25. google_update/
  26. gpu/
  27. headless/
  28. infra/
  29. ios/
  30. ipc/
  31. media/
  32. mojo/
  33. native_client_sdk/
  34. net/
  35. pdf/
  36. ppapi/
  37. printing/
  38. remoting/
  39. rlz/
  40. sandbox/
  41. services/
  42. skia/
  43. sql/
  44. storage/
  45. styleguide/
  46. testing/
  47. third_party/
  48. tools/
  49. ui/
  50. url/
  51. weblayer/
  52. .clang-format
  53. .clang-tidy
  54. .eslintrc.js
  55. .git-blame-ignore-revs
  56. .gitattributes
  57. .gitignore
  58. .gn
  59. .mailmap
  60. .rustfmt.toml
  61. .vpython
  62. .vpython3
  63. .yapfignore
  64. AUTHORS
  65. BUILD.gn
  66. CODE_OF_CONDUCT.md
  67. codereview.settings
  68. DEPS
  69. DIR_METADATA
  70. ENG_REVIEW_OWNERS
  71. LICENSE
  72. LICENSE.chromium_os
  73. OWNERS
  74. PRESUBMIT.py
  75. PRESUBMIT_test.py
  76. PRESUBMIT_test_mocks.py
  77. README.md
  78. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure .

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.