
This CL is based on wbjacksonjr@'s proposal. Currently, all prefetch triggers have a concept of referring document/origin. Specifically, potential value of PrefetchContainer::referring_origin_ is - If CCT (prefetch from App A that has verified associated origin): referring_origin == A’s origin - If CCT (otherwise): referring_origin == opaque origin [1] so that we can treat this request as a cross-site prefetch. Also, if nullopt is passed to PrefetchContainer's public ctor for browser- initiated prefetch, it is automatically converted to opaque origin [2] - If Speculation rules prefetch in document A: referring_origin == A’s origin In order to introduce WebView prefetch, which has no concepts that corresponds to referring document/origin and thus has no restriction related to it, this CL changes the type of PrefetchContainer::referring_origin_ to std::optional so that general browser-initiated prefetch can use this. Practically this case can be handled like same-site prefetch, in the same manner as normal browser-initiated prerender behaves like same-site prerender. [1] https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java;l=663;drc=8f3124aee72eb5cc75bec53fd9e7999592767e9a [2] https://source.chromium.org/chromium/chromium/src/+/main:content/browser/preloading/prefetch/prefetch_container.cc;l=426;drc=4d3dad034f8aefd3a1c6043eecbd901568546936 Bug: 40946257, 363946909 Co-authored-by: Wayne Jackson Jr. <wbjacksonjr@chromium.org> Change-Id: Ic0d1bf1e3350c719020a6a9b8232a50acc170ab4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5942243 Reviewed-by: Wayne Jackson Jr. <wbjacksonjr@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/main@{#1373194}
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.