0
Commit Graph

1189 Commits

Author SHA1 Message Date
Taiyo Mizuhashi
9aa95a9b6d Prefetch: Add a regression test that prefetch queue get stuck
This CL adds a regression test where PrefetchService::prefetch_queue_ is
not empty and PrefetchService::active_prefetch_ is std::nullopt, but no
additional prefetch is started.

Bug: 400233773, 390329781
Change-Id: Iaf4865c9aad60305d2c3c07da1c921a559c0e825
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6310958
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Ken Okada <kenoss@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1428475}
2025-03-05 11:35:04 -08:00
Raphael Kubo da Costa
784ba7033e user_agent_utils: Remove GetReducedUserAgent()
Its functionality is duplicated by GetUserAgent() these days, but we
could not use the latter while this component depended on //content.

Now that this is no longer an issue, remove the last call to
GetReducedUserAgent(), which also allows removing
GetMajorVersionNumber() from PrefetchServiceDelegate. All overrides had
the same implementation, and GetUserAgent() achieves the same thing
without requiring a version number to be passed.

Bug: 389970327
Change-Id: If7b7946d92eb78b9ff0983ded22699b968d1682e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6244462
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Raphael Kubo da Costa <kubo@igalia.com>
Reviewed-by: Mike Taylor <miketaylr@chromium.org>
Reviewed-by: Max Curran <curranmax@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1428427}
2025-03-05 10:21:51 -08:00
Taiyo Mizuhashi
1847c40afe Prefetch: Remove staled comment of PrefetchService::owned_prefetches_
Today all `PrefetchContainer`s will be added to
PrefetchService::owned_prefetches_ once
PrefetchService::AddPrefetchContainer =>
PrefetchService::AddPrefetchContainerWithoutStartingPrefetch is called.

Bug: n/a
Change-Id: I4558bb431c32c2a71d9dfffadbfe28d0ba59fd7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6312156
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1428033}
2025-03-04 15:51:09 -08:00
Hiroshige Hayashizaki
e51e2f26ef Return scoped_refptr from PrefetchNetworkContext::GetURLLoaderFactory()
This CL makes `PrefetchNetworkContext::GetURLLoaderFactory()` return
`scoped_refptr<network::SharedURLLoaderFactory>` instead of a raw
pointer, to allow the factory plumbed across tasks asynchronously without passing raw pointers. After https://chromium-review.googlesource.com/c/chromium/src/+/6228199, the URLLoaderFactory can be used after asynchronous ServiceWorker check.

Alternatively, we could call `PrefetchNetworkContext::GetURLLoaderFactory()` when the factory is needed (after ServiceWorker check), but instead we first call `GetURLLoaderFactory()` and then plumb the `scoped_refptr<network::SharedURLLoaderFactory>` asynchronously, to decouple the user of the factory (in `PrefetchStreamingURLLoader`) from its original owner (`PrefetchNetworkContext`).
https://docs.google.com/document/d/1kbs8YJuh93F_K6JqW84YSsjVWcAeU41Mj9nwPr6IXRs/edit?tab=t.0#bookmark=id.kohs7htfumek

This (and the subsequent CL) might extend the lifetime of the returned
URLLoaderFactory a little, but probably it's OK because the
URLLoaderFactory still doesn't outlive `PrefetchStreamingURLLoader`.

Bug: 40947546
Change-Id: I51fc017c9723760fe43881710574dfea3a0dc129
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6177744
Reviewed-by: Ken Okada <kenoss@chromium.org>
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1428015}
2025-03-04 15:14:38 -08:00
Raphael Kubo da Costa
b742ad8b4f Merge //content/common/user_agent.cc into //components/embedder_support:user_agent
The code in //content was present since the WebKit days, and the split
between //content and //components was unclear.

Move everything into //components/embedder_support:user_agent to make it
easier for callers to determine which functions to use as well as for
ease of maintenance.

The functions from //content have been moved wholesale; some will be
removed or made internal in other CLs in the chain.

NO_IFTT=The functions in embedder_support are called only on Android,
        there is no need to update the code in //ios

Bug: 389970327
Change-Id: Ic87e0691f54e392374dcd060faba744ab0ebfedb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6244461
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1427625}
2025-03-04 02:08:45 -08:00
Devon Loehr
c0138d8d14 Stringify bools consistently
This changes instances of `b ? "true" : "false"` to use `base::ToString(b)`
instead. It's a followup to previous changes to address things that were missed
or regressed in the meantime.

This change applies to the following directories: content

This CL was uploaded by an experimental version of git cl split
(https://crbug.com/389069356).

R=creis@chromium.org

Bug: 335797528
Change-Id: I4d4ec7cd9e8c13d09c91637bca88de27bb637842
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6318187
Auto-Submit: Devon Loehr <dloehr@google.com>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1427485}
2025-03-03 17:11:42 -08:00
Rulong Chen(陈汝龙)
64efe73b8d Fixes check failure in PrerenderHostRegistry::CancelHostInternal.
The initiator WebContents is kept in PrerenderAttributes. This is
WeakPtr (not rawptr) as the attributes can outlive the WebContents.

Bug: 397818464
Change-Id: I70789d027106a3e60edc74708ed3705d87e6dbfc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6286546
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426177}
2025-02-28 01:04:35 -08:00
Steven Wei
31fd0e5c03 Update PrerenderFinalStatus::kBrowsingDataRemoved to report failure to DevTools.
This change updates the logic in CL: https://chromium-review.googlesource.com/c/chromium/src/+/6173154
that was initially to not report failed attempt for prerender after clearing browsing data.
We want to give users visibilty of failed or canceled prererenders through DevTools.

Bug: 40262311
Change-Id: I02f8851446f922bafdb16b2d0e69e3d4c8ff8747
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6300663
Commit-Queue: Steven Wei <stevenwei@microsoft.com>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426053}
2025-02-27 16:51:14 -08:00
Kouhei Ueno
beb94c40a3 WebView Prerender: Fix activation mismatch due to additional headers
There was an unintentional behavior change introduced by crrev.com/6040420 , which made it impossible to activate speculation rules triggered prerendering on WebView.loadUrl with additional headers.
This CL provides an escape hatch to the behavior change.

Author: nhiroki@chromium.org
Bug: 399478939
Change-Id: Ic9f1a072ab242cfc9f2220965d5d6728c2a75da8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6306746
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1425584}
2025-02-26 22:38:09 -08:00
Raphael Kubo da Costa
2d21daa8bf Move kUseMobileUserAgent to //components/embedder_support
This is part of the process of making user_agent_utils.{cc,h} stop
depending on //content.

The flag has been moved to the main "embedder_support" target, which
does not depend on any other target and has other command-line
switches.

Bug: 389970327
Change-Id: Ib646ada998e8ea2eb23be2b9420d8049aa8f0bac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6242721
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Raphael Kubo da Costa <kubo@igalia.com>
Reviewed-by: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1425012}
2025-02-26 00:59:09 -08:00
kenoss
24fec1b963 PrefetchReusable: Update body_size_limit
This is a follow up CL of https://crrev.com/c/6286446.

This CL also updates a coefficient in a test as default allocation size
for ChromeOS is 4 times smaller and the test fails on ChromeOS.

Bug: 397882995
Change-Id: I82a8ec1071391d771e097bd88b9eda3345855b2b
Unresolved-Comment-Reason: Leaving non blocker todo
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6285149
Commit-Queue: Ken Okada <kenoss@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Auto-Submit: Ken Okada <kenoss@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1424922}
2025-02-25 18:30:27 -08:00
HuanPo Lin
fc5c6a24ee preload: Enable OT for Prerender2InNewTab
This CL associates Prerender2InNewTab with RuntimeEnabledFeature and put
the feature in the origin trial list.

1. Prerender2InNewTab will work as a kill-switch for the basic
functionality, so it is enabled by default.
2. SpeculationRulesTargetHint is used for origin trial that allows
sites to opt-in the target hint experiment.
3. Only if both Prerender2InNewTab and SpeculationRulesTargetHint
are enabled, the target hint of target="_blank" can be parsed, and
then UA will attempt to prerender the target page in a new tab, or it
will be prerendered into same tab as fallback.

Bug: 40234240
Change-Id: I4ee5768664e7bc13d5069e86b21872adff922719
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6261869
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Huanpo Lin <robertlin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1424410}
2025-02-25 02:42:23 -08:00
Taiyo Mizuhashi
5e50832b96 ExpectPreloading*Ukm test helpers can receive const UKM recorder
This is a follow-up of crrev.com/c/6289350

Bug: n/a
Change-Id: If786e2e1a9b1ad00dbd1981ac1df549f4a49ccec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6293744
Auto-Submit: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1424227}
2025-02-24 16:36:26 -08:00
Taiyo Mizuhashi
8b5ddccbf9 Reland "Prefetch: Keep listening cookie changes after the first serve"
This is a reland of commit 8ab9806911

The test was failed on linux-bfcache-rel, because The test assumed that
BFCache is used on the navigation we're testing.
This CL fixes to skip the test when disabled.

Original change's description:
> Prefetch: Keep listening cookie changes after the first serve
>
> Before this CL, PrefetchCookieLister stops listening after the first
> serve (more specifically, after first isolated cookie copy is started in
> `PrefetchContainer::Reader::OnIsolatedCookieCopyStart()`).
>
> This CL makes the listener keep listening after the first serve, which
> means that the cookie change for the prefetched site will be monitored
> after the first serve as well and will prevent corresponding prefetch
> being served anymore if changes.
>
> For more information, please see
> https://docs.google.com/document/d/1XuAt1pZ1T8SUyyPLuDZDo1Rb7XaOKa36ChegSAYYk1g/edit?resourcekey=0-VH-Hf_i0EyiVLNNVq9NBfA&tab=t.0#bookmark=id.9fgi9f3gi2gl
>
> Note that PrefetchCookieListener also detects as the default cookie is
> changed when isolated cookie copy itself. This is a false positive, so
> this CL pauses PrefetchCookieListener while the copy is happening.
>
> Bug: 377440445, 377440445
> Change-Id: Ib9262a17ac8726aa8d5405a45e10c3d1c9793771
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6288185
> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
> Reviewed-by: Ken Okada <kenoss@chromium.org>
> Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1423055}

Cq-Include-Trybots: luci.chromium.try:android-bfcache-rel,linux-bfcache-rel
Bug: 377440445, 377440445
Change-Id: I2aa9319acd6ad9c924737350c8b3458ffc5ef4df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6289350
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423415}
2025-02-21 14:12:12 -08:00
Haihan Chen
8f2767f4a7 [Gardener] Revert "Prefetch: Keep listening cookie changes after the first serve"
This reverts commit 8ab9806911.

Reason for revert: NavPrefetchBrowserTest.CrossSitePrefetchNotServedWhenCookieChange_AfterFirstServe failing on builder https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel

Failing builds:
https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel/69383/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/linux-bfcache-rel/69384/overview

Original change's description:
> Prefetch: Keep listening cookie changes after the first serve
>
> Before this CL, PrefetchCookieLister stops listening after the first
> serve (more specifically, after first isolated cookie copy is started in
> `PrefetchContainer::Reader::OnIsolatedCookieCopyStart()`).
>
> This CL makes the listener keep listening after the first serve, which
> means that the cookie change for the prefetched site will be monitored
> after the first serve as well and will prevent corresponding prefetch
> being served anymore if changes.
>
> For more information, please see
> https://docs.google.com/document/d/1XuAt1pZ1T8SUyyPLuDZDo1Rb7XaOKa36ChegSAYYk1g/edit?resourcekey=0-VH-Hf_i0EyiVLNNVq9NBfA&tab=t.0#bookmark=id.9fgi9f3gi2gl
>
> Note that PrefetchCookieListener also detects as the default cookie is
> changed when isolated cookie copy itself. This is a false positive, so
> this CL pauses PrefetchCookieListener while the copy is happening.
>
> Bug: 377440445, 377440445
> Change-Id: Ib9262a17ac8726aa8d5405a45e10c3d1c9793771
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6288185
> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
> Reviewed-by: Ken Okada <kenoss@chromium.org>
> Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1423055}

Bug: 377440445, 377440445
Change-Id: I59fc9d73002858331418c115c055b4c431c326b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6290548
Owners-Override: Haihan Chen <haihan@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Andrey Davydov <andreydav@google.com>
Reviewed-by: Andrey Davydov <andreydav@google.com>
Auto-Submit: Haihan Chen <haihan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Haihan Chen <haihan@google.com>
Cr-Commit-Position: refs/heads/main@{#1423175}
2025-02-21 08:38:28 -08:00
Taiyo Mizuhashi
8ab9806911 Prefetch: Keep listening cookie changes after the first serve
Before this CL, PrefetchCookieLister stops listening after the first
serve (more specifically, after first isolated cookie copy is started in
`PrefetchContainer::Reader::OnIsolatedCookieCopyStart()`).

This CL makes the listener keep listening after the first serve, which
means that the cookie change for the prefetched site will be monitored
after the first serve as well and will prevent corresponding prefetch
being served anymore if changes.

For more information, please see
https://docs.google.com/document/d/1XuAt1pZ1T8SUyyPLuDZDo1Rb7XaOKa36ChegSAYYk1g/edit?resourcekey=0-VH-Hf_i0EyiVLNNVq9NBfA&tab=t.0#bookmark=id.9fgi9f3gi2gl

Note that PrefetchCookieListener also detects as the default cookie is
changed when isolated cookie copy itself. This is a false positive, so
this CL pauses PrefetchCookieListener while the copy is happening.

Bug: 377440445, 377440445
Change-Id: Ib9262a17ac8726aa8d5405a45e10c3d1c9793771
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6288185
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Ken Okada <kenoss@chromium.org>
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423055}
2025-02-21 04:49:38 -08:00
Wayne Jackson Jr.
0118d2af56 [webview][prefetch] URL + No-Vary-Search Hint to Dedup Outgoing Requests
Bug: 391840170
Change-Id: I8712a58272d7450619778db98222dcfe9df16c0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219143
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Wayne Jackson Jr. <wbjacksonjr@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423022}
2025-02-21 02:53:46 -08:00
kenoss
5c2a7e0c05 PrefetchReusable: Make it default enabled
Bug: 397882995
Change-Id: Id96b6902fe757ad51d997c910248a358f2531d3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6286446
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Ken Okada <kenoss@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422487}
2025-02-20 05:25:29 -08:00
Minoru Chikamune
68aacaf82c Fix possible bug in PreloadingDeciderTest.UmaRecallStats
PreloadingDeciderTest.UmaRecallStats checks TruePositives and
FalseNegatives on navigation. Before this CL, the test didn't wait for
UMA to be recorded, hence TruePositive and FalseNegative were 0. But we
should wait for UMA. This CL adds a waiting logic for UMA, and checks
TruePositives and FalseNegatives correctly.

This CL is a preparation CL for an upcoming
feature (https://crbug.com/396998476).

Bug: 396998476
Change-Id: If4e5502a22cad87db62412ef6ce704d9edb21cb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6284766
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422418}
2025-02-20 01:48:01 -08:00
kenoss
c004566b2f PrefetchNewWaitLoop: Make it default enabled
Bug: 353490734
Change-Id: Id4f4128c053700dc691c283668c4d06198f3e55f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6275103
Commit-Queue: Ken Okada <kenoss@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1421879}
2025-02-19 04:25:31 -08:00
kenoss
ec07285944 Prerender2Fallback: Mitigate crash due to use-after-dtor of DocumentUserData
We found that there is a case that uses `DevToolsPreloadStorage` after
`DocumentAssociatedData::dtor()`, which is forbidden and cause a crash.
To mitigate this, this CL calls
`DevToolsPreloadStorage::GetOrCreateForCurrentDocument()` ahead and
checks `DevToolsPreloadStorage::GetForCurrentDocument()` to get knowing
`DocumentAssociatedData::dtor()` is already called or not.

For more details, see
https://docs.google.com/document/d/1ZP7lYrtqZL9jC2xXieNY_UBMJL1sCrfmzTB8K6v4sD4/edit?resourcekey=0-fkbeQhkT3PhBb9FnnPgnZA&tab=t.e4x3d1nxzmy3#heading=h.4lvl0yr9vmh7

Fixed: 394631076
Change-Id: I701ff6b0bb2bc50d4347d270dc4132490a437333
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6268901
Commit-Queue: Ken Okada <kenoss@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1421801}
2025-02-18 23:07:55 -08:00
Lei Zhang
52844bf425 Defining compile-time constants correctly in headers in //content
Follow the guidance in [1] and switch from "static constexpr" to
"inline constexpr".

[1] https://docs.google.com/document/d/1LVfOmlmry5rzbq6iiBSDmyAAvOxM1KpNqKUlyf0inCY/edit

NO_IFTTT=No functional change

Change-Id: I7f3ef419204f45d385767b52160399d1ab7ab883
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6267848
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420613}
2025-02-14 10:59:37 -08:00
elabadysayed
ab1b97c01b [AW] Add handling for maxPrefetches config
Adding the logic for handling the maxPrefetches, this logic is specific
to WebView and //content layer doesn't have a similar logic. This CL
also adds a test to make sure that we are handling it right.

Bug: 376014072
Change-Id: I32e02b6da78b427e000fd3d40a845a7e2f8a9f2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6249440
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Commit-Queue: Sayed Elabady <elabadysayed@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1419788}
2025-02-13 03:06:26 -08:00
elabadysayed
909e1a33ce [AW] Add prefetch config defaults
WebView is going to configure its defaults and these values doesn't have
to be aligned but //content later values.

This CL also adds a test to make sure that TTL value is respected in the
prefetch operation.


Bug: 376014072
Change-Id: Idd3c033a6b617990b794dd4354864fc718c20ef1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6243139
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Commit-Queue: Sayed Elabady <elabadysayed@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1419787}
2025-02-13 03:06:07 -08:00
Steven Wei
893cb02c28 Cancels prerenders when browsing data removal is run.
This change cancels all the existing prerenders when browsing data
removal is run on cached data. This can be triggered by the Delete Browsing Data option or with Clear-Site-Data response headers. Developer Tools will now also show the previously successful prerender(s) as failed. A new PrerenderFinalStatus is added specifically for this case.

nav-speculation spec PR: https://github.com/WICG/nav-speculation/pull/361

NO_IFTTT=Changes for PrerenderFinalStatus will be done in separate repositories.

Bug: 40262311
Change-Id: Ie82895e555f3a9d4e2576686223e67443d198353
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6173154
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Steven Wei <stevenwei@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1419494}
2025-02-12 12:51:30 -08:00
Ioana Pandele
e77024c76f [Gardener] Disable flaky NoVarySearchPrerenderBrowserTest
Bug: 395337644
Change-Id: I54c102785eaf3790230efcd6aa676e4bda868e4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6249121
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Owners-Override: Ioana Pandele <ioanap@chromium.org>
Reviewed-by: Anna Tsvirchkova <atsvirchkova@google.com>
Cr-Commit-Position: refs/heads/main@{#1418219}
2025-02-10 09:42:32 -08:00
Hiroki Nakagawa
179b6be6be Prerender: Cancel prerendering for effective URL on host reservation
If the navigation URL has an effective URL, it shouldn't activate a
prerendered page.

Before this CL, FindPotentialHostToActivate() in PrerenderHostRegistry
cancels prerendering in the case, and then ReserveHostToActivate()
CHECKs it. However, it turned out that the navigation URL can have an
effective URL during the period, and crashed due to the CHECK.

This CL cancels prerendering instead of CHECK in
ReserveHostToActivate(). The validation code is moved to
CanNavigationActivateHost() that is commonly called from both the
functions.

Bug: 380325632
Change-Id: I838433d79657f892ea82c839ea2f1d2b8c8d5a23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6239000
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1417981}
2025-02-09 22:47:20 -08:00
kenoss
8644f6bfc8 Prerender2Fallback: Move planned_max_preloading_type to PreloadPipelineInfo
This patch moves `planned_max_pleroading_type` from `PreloadingAttempt`
to `PreloadPipelineInfo`.

Behavioral change: Before this patch, `PrefetchContainer` used
`Sec-Purpose: prefetch` for a HTTP header if preloading attempt is not
available. This occurs a prefetch is queued and started after navigation
as `PreloadingDataImpl` clears `PreloadingAttempt` when
`DidFinishNavigation()`. This patch remedies the behavior.

Bug: 394215571
Change-Id: I58010fae0de6bffa3bad3c97bcaced54c2e5b533
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6229307
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Max Curran <curranmax@chromium.org>
Commit-Queue: Ken Okada <kenoss@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1417974}
2025-02-09 21:51:44 -08:00
Daniel Cheng
ec4c1897c2 Allow prerendering even when v8 optimizations are disabled
This was previously disabled due to a crash bug with how speculative
RFHs were created for prerendering pages. The crash bug has since been
fixed; while prerendering is somewhat less efficient, there is no
fundamental reason prerendering should be disabled in this case.

NO_IFTTT=deprecating an existing enum; no other changes needed

Bug: 40076091
Change-Id: I904b7aca52f05fb6db5de1abd8e599287892edb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6231569
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1417429}
2025-02-07 10:10:19 -08:00
Hiroshige Hayashizaki
fde8c0fbee Avoid ThrottlingURLLoader restart on SW fallback
Before this CL, on fallback, `ServiceWorkerMainResourceLoader`
asks `NavigationURLLoaderImpl` to restart its `ThrottlingURLLoader`.

After this CL, `ServiceWorkerMainResourceLoader` transfers the initial
request received by itself, by plumbing the original
`URLLoaderFactory::CreateLoaderAndStart` parameters and mojo pipes
to the fallback factory.

This is to simplify the interception/fallback mechanism:
After this CL, `NavigationURLLoaderImpl` just have to provide a
`FallbackCallback` which is more like merely a factory getter,
and `SharedURLLoaderFactory` returned by an interceptor can
perform the loading (and its fallback to the network) mostly on its
own.

this also simplifies the fallback implementation in speculation
rules prefetch + ServiceWorker support (crbug.com/40947546).

Bug: 40251638, 40947546
Change-Id: Iaeadf0c040c7fb06d944dee11f66a9e3c75fbbdf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5274112
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Keita Suzuki <suzukikeita@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1417110}
2025-02-06 17:59:48 -08:00
Kouhei Ueno
295957b599 Update a client-hints+prefetch comment and downgrade CHECK
Bug: 394716357
Change-Id: Ib9385f49febbffad0732cfcb0a0a94ffa5a65324
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6239081
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416698}
2025-02-06 03:14:58 -08:00
Kouhei Ueno
27f86cb71c ClientHints: remove is_javascript_enabled plumbing for prefetch
This CL intends to tidy up the code by removing `is_javascript_enabled`
plumbing to ClientHints impl. The CH currently just refuses to add the
Client Hints headers if Javascript is disabled. This CL modifies to that
the check is done in the caller side.

Bug: None
Change-Id: Icf8b737871325b766c8edf8035e6dd961310de4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6232361
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416653}
2025-02-06 01:03:36 -08:00
elabadysayed
f7d6b00fa0 [AW][3/N] Add TTL customization to PrefetchContainer
This CL adds the TTL customization to PrefetchContainer by adding a new
param to the constructor while setting the default to the old default
for the other constructors. This is only needed for WebView for now but
that should be working for any browser-initiated prefetches that don't
depend on the web content.


Bug: 376014072
Change-Id: Ic58f19c6067cd41366a9dadeb38fba697bcd4fd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6190451
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Sayed Elabady <elabadysayed@chromium.org>
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416084}
2025-02-05 03:27:00 -08:00
HuanPo Lin
d43c114cca Reland "preloading: Firing pagehide when prerendering"
This is a reland of commit 0e5d5e26ab

Difference from the original CL:
This CL replaces localStorage by fetchLater to verify pagehide is
properly dispatched. fetchLater is used as the feature is
designated to address pagehide or visibilitychange, as localStorage
or navigator.sendBeacon may be flaky if used in pagehide cases.
See https://developer.chrome.com/blog/fetch-later-api-origin-trial
for details.

This CL also adds a callback to `RenderFrameHostImpl::ClosePage` to
avoid PrerenderHost being destroyed before
`RenderFrameHostImpl::ClosePageIgnoringUnloadEvents` is called.

Verification:
The failure was reproducible by running mac*-arm64-rel trybots in
a few tries.
https://ci.chromium.org/ui/p/chromium/builders/try/mac11-arm64-rel/b8724450804496545825/test-results?q=ExactID%3Aninja%3A%2F%2Fcontent%2Ftest%3Acontent_browsertests%2FPrerenderBrowserTest.CancelOnSpeculationCandidateRemoved+VHash%3A40edfff8ea04cdf9&clean=&sortby=&groupby=
After the changes, the problem seems to no longer exist.

Original change's description:
> preloading: Firing pagehide when prerendering
>
> This CL makes prerender cancellation fire pagehide by calling
> RenderFrameHostImpl::ClosePage when the prerendered page is
> intentionally canceled (such as removing speculation rules,
> not by failure).
> Another CL https://crrev.com/c/6197678 is created as a follow-up to
> support the new-tab cases.
>
> Bug: 353628449
> Change-Id: Ie2903ec3d0782c102181bccc3ec3d6910207481e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6108648
> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Huanpo Lin <robertlin@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1411504}

Bug: 353628449
Change-Id: Ie2c0c9441ef21f1d322b63fcba53c7da3b014dea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6204843
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Huanpo Lin <robertlin@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1415385}
2025-02-03 22:17:22 -08:00
Yoshisato Yanagisawa
85b155a6e1 Change copy of TrustedParams to move
NO_IFTTT=This CL only update a comment in resource_request.h.

Bug: 332706093
Change-Id: Ib47dfdbe8b05a91641538f30de96b477c31a067a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6218121
Reviewed-by: Keita Suzuki <suzukikeita@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Auto-Submit: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414821}
2025-02-03 03:02:19 -08:00
Yoshisato Yanagisawa
d2c11f7993 Add trace event to understand how prefetch behaves
To understand how prefetch behaves and why resource request copy
is needed, let me add more traces.

Bug: 332706093
Change-Id: I2bc5770d2f0af974e911c8962b7501d068299e4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6218046
Reviewed-by: Keita Suzuki <suzukikeita@chromium.org>
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Reviewed-by: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414819}
2025-02-03 02:49:35 -08:00
Hiroki Nakagawa
0752e5523c WebView Prerender: Implement functions to update allowed prerendering count
This CL allows content embedders to override the max count of in-flight
prerendering. This is used by the WebView embedder that will have an API
to override the limit from AndroidX.

This doesn't change the current limit for Chrome (Omnibox, BookmarkBar,
and NTP).

Bug: 41490450
Change-Id: I7c68b429b52ab2c5a3040312514b72dfbf1abd3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6204481
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414780}
2025-02-03 00:06:40 -08:00
David Sanders
f583e506ff Add missing includes of //base/metrics/histogram_functions.h (1/N)
Bug: 40216326
Change-Id: Iba3932754d47e887dda53052b82a58d5cd4d92a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6183272
Owners-Override: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414729}
2025-02-02 17:55:00 -08:00
Wayne Jackson Jr.
3dfcf9479f [webview][prefetch] Return Correct Accept Language Header in Prefetch Service Delegate
NOTE - This CL is needed for an urgent cherry-pick to M133.

Previously `aw_prefetch_service_delegate` called `NOT_REACHED()`
within its `GetAcceptLanguageHeader()`. Now that the code path is
being hit in production, we need to return the correct "Accept Language"
header from `AwSettings`.

The changes in `//chrome` are strictly because of adding a new
method on `prefetch_service_delegate` to set the "Accept Language"
header. Chrome's version is currently no-op.

Bug: 391284744
Change-Id: I2006d5e38b03fee000719dc257d80e09b3566ce2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6218547
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Wayne Jackson Jr. <wbjacksonjr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414065}
2025-01-31 06:07:16 -08:00
Hiroki Nakagawa
56dbf1478e WebView Prerender: Support CancellationSignal for startPrerendering()
This CL supports CancellationSignal for AwContents.startPrerendering().

To identify which prerendering should be canceled, this CL introduces
the handle id (prerender id) in PrerenderHandle. StartPrerendering()
returns an id when prerendering successfully started. A caller of the
function can cancel prerendering by calling cancelPrerendering() with
the id.

CancellationSignal.OnCancelListener.onCancel() is fired when
CancellationSignal.cancel() is called. The listener takes the handle id
on prerendering start, and calls cancelPrerendering() with the id when
cancel() is called.

Bug: 41490450
Change-Id: Ifebb28089001aa1d02961ff0e7825d4da2452bdf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6204842
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412757}
2025-01-29 00:40:38 -08:00
Hiroki Nakagawa
68ba6ed953 WebView Prerender: Allow triggering multiple prerendering
Before this CL, only one prerendering could be triggered at a time. When
a new request was coming, the predecessor was cancelled.

This CL allows triggering multiple prerendering up to
kMaxNumOfRunningEmbedderPrerenders (currently it's 2). When more
prerendering is triggered, the oldest request is canceled.

Bug: 41490450
Change-Id: I7994d3875e7322e04b4245c66075e6fad7b405a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6196998
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412690}
2025-01-28 19:39:27 -08:00
Hiroki Nakagawa
3154fcfd11 WebView Prerender: Deduplicate prerendering for the same URL
Before this CL, when prerendering was triggered for the same URL twice,
the predecessor request was canceled and then a new request started.
This is obviously wasteful.

This CL deduplicates such requests. When prerendering is triggered for
the same URL, instead of starting a new request, it adds given
activation and error callbacks to PrerenderHandle (not overwrite
existing callbacks) and returns early. When prerendering is activated
or canceled, either the activation callbacks or the error callbacks are
called.

Bug: 41490450
Change-Id: I9a1a5aa1aa1dc72bcd28e681948be546f1c88d22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6197777
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412683}
2025-01-28 19:14:13 -08:00
Taiyo Mizuhashi
94ce74f2bf Prefetch: Introduce PrefetchHandle
Design Doc & discussions:
https://docs.google.com/document/d/1QOqxIbcFSW9db19RR-FXip3n_hTGVHMQVO85h17LXlc/edit?usp=sharing&resourcekey=0-AMeGftRRZYHuv22LUAPqIA

This CL introduces `PrefetchHandle`, which encapsulates
`PrefetchContainer` and provides the interface (especially for
embedders) to control started prefetch resources associated with that
container.

The prefetch caller is expected to receive the unique pointer of
`PrefetchHandle` when adding prefetch, by
`AddPrefetchContainerWithHandle()`. The prefetch caller may later
destroy the handle, in which case it will notify `PrefetchService` that
the corresponding `PrefetchContainer` is no longer needed, by calling
`PrefetchService::MayReleasePrefetch()`. `PrefetchService` will try to
release relevant resource by its own decision with best-effort (i.e.
based on current architecture, it might reset prefetch container if it
is still alive in `PrefetchService`)

Note that `PrefetchContainer` might be destructed before the prefetch
caller destructs `PrefetchHandle`. How the callers clean up staled
handle should be discussed and resolved in follow-ups.

Also note that, based on current implementation, this allows to reset
`PrefetchContainer` even if its LoadState is kStarted, which some codes
[1][2] today intentionally avoid due to the historical reason. [3]
summarizes the current observation that it may be legitimate and safe to
do this, yet some tests and non-critical follow-ups should be
introduced.

[1]
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/preloading/prefetch/prefetch_document_manager.cc;l=84;drc=f1f8b360aa0e5e406439ec99ade45e9fffb61975

[2]
https://source.chromium.org/chromium/chromium/src/+/main:content/browser/web_contents/web_contents_impl.cc;l=1413;drc=0c3a71188e12d0474a8481d54971d4f01734968c

[3]
https://docs.google.com/document/d/1QOqxIbcFSW9db19RR-FXip3n_hTGVHMQVO85h17LXlc/edit?resourcekey=0-AMeGftRRZYHuv22LUAPqIA&tab=t.0#bookmark=id.derkqrk3x411

Bug: 390329781, 40946257
Unresolved-Comment-Reason: To keep some comments that will be addressed as follow-ups
Change-Id: Idb1f9601286e7e746c68eba5c335f8ab529c9494
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5534282
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Ken Okada <kenoss@chromium.org>
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412078}
2025-01-27 20:20:14 -08:00
Peter Kasting
1557e5fbe4 [cleanup] Replace base::ranges with std::ranges: content/
Done entirely with `git grep` and `sed` + `git cl format`, no
hand-editing.

Bug: 386918226
Change-Id: I8561612cb02c9d62c455836dba414ab402e40694
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6199140
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412009}
2025-01-27 17:14:08 -08:00
Tsuyoshi Horo
61c36ea5cd Remove Pause/ResumeReadingBodyFromNet IPCs
As described in the bug (crbug.com/392023850), we don't need these
IPCs anymore.

Bug: 392023850
Change-Id: Ia79e6c2b5c0ce54588c892687dcd3671933f7778
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6197457
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411962}
2025-01-27 16:05:47 -08:00
Mark Pearson
91011c8d15 Revert "preloading: Firing pagehide when prerendering"
This reverts commit 0e5d5e26ab.

Reason for revert:

Causes flaky failures of 
PrerenderBrowserTest.CancelOnSpeculationCandidateRemoved
on many bots.  On some bots, like Linux CFI, it seems to fail more than half the time.

Bug: 392578265

Original change's description:
> preloading: Firing pagehide when prerendering
>
> This CL makes prerender cancellation fire pagehide by calling
> RenderFrameHostImpl::ClosePage when the prerendered page is
> intentionally canceled (such as removing speculation rules,
> not by failure).
> Another CL https://crrev.com/c/6197678 is created as a follow-up to
> support the new-tab cases.
>
> Bug: 353628449
> Change-Id: Ie2903ec3d0782c102181bccc3ec3d6910207481e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6108648
> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Huanpo Lin <robertlin@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1411504}

Bug: 353628449
Change-Id: I3c98c3fd04ad6fa3dd3749ea379512f261d95dfb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6203506
Auto-Submit: Mark Pearson <mpearson@chromium.org>
Owners-Override: Mark Pearson <mpearson@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411932}
2025-01-27 15:09:53 -08:00
HuanPo Lin
0e5d5e26ab preloading: Firing pagehide when prerendering
This CL makes prerender cancellation fire pagehide by calling
RenderFrameHostImpl::ClosePage when the prerendered page is
intentionally canceled (such as removing speculation rules,
not by failure).
Another CL https://crrev.com/c/6197678 is created as a follow-up to
support the new-tab cases.

Bug: 353628449
Change-Id: Ie2903ec3d0782c102181bccc3ec3d6910207481e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6108648
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Huanpo Lin <robertlin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411504}
2025-01-27 00:32:16 -08:00
David Sanders
1b28c24576 Add missing includes of //base/debug/dump_without_crashing.h (1/N)
Bug: 40216326
Change-Id: I5e5cb13b8fd47fdfad3991b2abde04a6d28edcbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6200018
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411449}
2025-01-26 16:46:53 -08:00
Domenic Denicola
049e141c3d PreloadingConfig: update default sampling rates
Bug: b/287509693
Change-Id: I2b743d84bf06890c64cdade04e2faf069fc7ec77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6197056
Commit-Queue: Domenic Denicola <domenic@chromium.org>
Auto-Submit: Domenic Denicola <domenic@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Commit-Queue: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1410754}
2025-01-24 00:11:23 -08:00
Ramon Cano Aparicio
1538c09880 Rename HistogramBase::Count type to Count32 in content and net.
Add size to type name so the size is known without needing to lookup
the typedef.

Changed occurrences under content and net

Bug: 40899968
Change-Id: I44e37eb95fe361218496a6ab6a7153a30e8177ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6182574
Commit-Queue: Ramon Cano Aparicio <rcanoaparicio@google.com>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Eric Orth <ericorth@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1410416}
2025-01-23 09:37:59 -08:00