0
Commit Graph

443 Commits

Author SHA1 Message Date
Sandor Major
a9a29ad57e Move Permissions Policy switch and flags to the Network service
Permissions Policy code is being migrated out of Blink, to the Network
service. The code depends on these flags so it needs to be moved.

Bug: 382291442
Change-Id: I4e2bbb4d4c49392f0e845096cc8c62ae9ae9fb20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6282334
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Owen Min <zmin@chromium.org>
Commit-Queue: Sandor «Alex» Major <sandormajor@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422574}
2025-02-20 08:00:14 -08:00
Minoru Chikamune
a4a252fa9e Deflake DeferSpeculativeRFHCreationTest.CreationNotDeferredForWebUI
The following test sometimes fails with navigation_request->state()
check because the test depends on the timing of the check. This CL adds
nav_manager.WaitForRequestStart() so that the test can be run
deterministically.

- DeferSpeculativeRFHCreationTest.CreationNotDeferredForWebUI

Failure example:
navigation_browsertest.cc(9328): Expected equality of these values:
  navigation_request->state()
    Which is: 3
  NavigationRequest::NavigationState::WAITING_FOR_RENDERER_RESPONSE
    Which is: 1

Run history:
https://ci.chromium.org/ui/test/chromium/ninja%3A%2F%2Fcontent%2Ftest%3Acontent_browsertests%2FDeferSpeculativeRFHCreationTest.CreationNotDeferredForWebUI

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

Bug: 396998476
Change-Id: I36f8acc88961a6f0b83e70510c1733e9a8afbbb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6275505
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Reviewed-by: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1420962}
2025-02-17 01:13:31 -08:00
Jiacheng Guo
2978208790 Reland "Reland "Skip GetFrameHostForNavigation if the creation of the RFH is deferred""
This is a reland of commit 964be52ca6

The reland fixes the Android ARM failures caused by small RAM size.

Original change's description:
> Reland "Skip GetFrameHostForNavigation if the creation of the RFH is deferred"
>
> This is a reland of commit 2879994fc3
>
> The reland fixes the test failures when running Andrdoid tests without
> BFCache. The spare renderer will be created regardless of the BFCache
> state.
>
> Original change's description:
> > Skip GetFrameHostForNavigation if the creation of the RFH is deferred
> >
> > The CL skips the whole GetFrameHostForNavigation function if the
> > creation of the speculative RFH can be deferred. Navigation traces
> > showed that calling GetFrameHostForNavigation itself can be
> > time-consuming even if the creation of the RFH is deferred.
> >
> > The design doc can be found at:
> > https://docs.google.com/document/d/1J0D5-qireiIngmyeiaMtHrKKRWbiYOtrCqxqeuNhhxE/edit?usp=sharing
> >
> > Bug: 332435024
> > Change-Id: Id6fb4d92ccbfc3e334c4d3e84583736aaf053e79
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6224174
> > Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> > Commit-Queue: Jiacheng Guo <gjc@google.com>
> > Cr-Commit-Position: refs/heads/main@{#1419053}
>
> Bug: 332435024
> Change-Id: I85e5ab0fc81471bbc5ebb7563af1ec6ae7639da3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6255360
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Cr-Commit-Position: refs/heads/main@{#1420226}

Bug: 332435024
Change-Id: Id4c7837c43c12baf2a0d22d4f0ebfafcb470de0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6274684
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1420905}
2025-02-16 20:49:37 -08:00
Alex Ilin
67d66f4c69 Revert "Reland "Skip GetFrameHostForNavigation if the creation of the RFH is deferred""
This reverts commit 964be52ca6.

Reason for revert: the test starts failing again after the reland
https://crbug.com/396069352#comment4

Original change's description:
> Reland "Skip GetFrameHostForNavigation if the creation of the RFH is deferred"
>
> This is a reland of commit 2879994fc3
>
> The reland fixes the test failures when running Andrdoid tests without
> BFCache. The spare renderer will be created regardless of the BFCache
> state.
>
> Original change's description:
> > Skip GetFrameHostForNavigation if the creation of the RFH is deferred
> >
> > The CL skips the whole GetFrameHostForNavigation function if the
> > creation of the speculative RFH can be deferred. Navigation traces
> > showed that calling GetFrameHostForNavigation itself can be
> > time-consuming even if the creation of the RFH is deferred.
> >
> > The design doc can be found at:
> > https://docs.google.com/document/d/1J0D5-qireiIngmyeiaMtHrKKRWbiYOtrCqxqeuNhhxE/edit?usp=sharing
> >
> > Bug: 332435024
> > Change-Id: Id6fb4d92ccbfc3e334c4d3e84583736aaf053e79
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6224174
> > Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> > Commit-Queue: Jiacheng Guo <gjc@google.com>
> > Cr-Commit-Position: refs/heads/main@{#1419053}
>
> Bug: 332435024
> Change-Id: I85e5ab0fc81471bbc5ebb7563af1ec6ae7639da3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6255360
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Cr-Commit-Position: refs/heads/main@{#1420226}

Bug: 332435024, 396069352
Change-Id: Icf3b824fbebf1ab70ff9e629fbcfbb0009015331
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6268660
Owners-Override: Alex Ilin <alexilin@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Alex Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420405}
2025-02-14 02:52:40 -08:00
Chris Harrelson
8af71b99ff Rename visible_viewport_rect to visible_viewport_rect_device_px
Also rename new_size to new_size_device_px in the mojom file and
traits class.

Change-Id: I72b315a61f4b8e37a035a310d79be852ecfd32b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6265786
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420228}
2025-02-13 17:05:47 -08:00
Jiacheng Guo
964be52ca6 Reland "Skip GetFrameHostForNavigation if the creation of the RFH is deferred"
This is a reland of commit 2879994fc3

The reland fixes the test failures when running Andrdoid tests without
BFCache. The spare renderer will be created regardless of the BFCache
state.

Original change's description:
> Skip GetFrameHostForNavigation if the creation of the RFH is deferred
>
> The CL skips the whole GetFrameHostForNavigation function if the
> creation of the speculative RFH can be deferred. Navigation traces
> showed that calling GetFrameHostForNavigation itself can be
> time-consuming even if the creation of the RFH is deferred.
>
> The design doc can be found at:
> https://docs.google.com/document/d/1J0D5-qireiIngmyeiaMtHrKKRWbiYOtrCqxqeuNhhxE/edit?usp=sharing
>
> Bug: 332435024
> Change-Id: Id6fb4d92ccbfc3e334c4d3e84583736aaf053e79
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6224174
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Cr-Commit-Position: refs/heads/main@{#1419053}

Bug: 332435024
Change-Id: I85e5ab0fc81471bbc5ebb7563af1ec6ae7639da3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6255360
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1420226}
2025-02-13 17:03:57 -08:00
Taiyo Mizuhashi
ad8157bc4e Revert "Skip GetFrameHostForNavigation if the creation of the RFH is deferred"
This reverts commit 2879994fc3.

Reason for revert: This breaks android-bfcache-rel. Please see https://ci.chromium.org/ui/p/chromium/builders/ci/android-bfcache-rel/35016/overview for the failure reason.

Original change's description:
> Skip GetFrameHostForNavigation if the creation of the RFH is deferred
>
> The CL skips the whole GetFrameHostForNavigation function if the
> creation of the speculative RFH can be deferred. Navigation traces
> showed that calling GetFrameHostForNavigation itself can be
> time-consuming even if the creation of the RFH is deferred.
>
> The design doc can be found at:
> https://docs.google.com/document/d/1J0D5-qireiIngmyeiaMtHrKKRWbiYOtrCqxqeuNhhxE/edit?usp=sharing
>
> Bug: 332435024
> Change-Id: Id6fb4d92ccbfc3e334c4d3e84583736aaf053e79
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6224174
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Cr-Commit-Position: refs/heads/main@{#1419053}

Bug: 332435024
Change-Id: I9d14e65b03321f1cee9eb6015ecb5d0754316911
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6254162
Commit-Queue: Taiyo Mizuhashi <taiyo@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Taiyo Mizuhashi <taiyo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1419130}
2025-02-11 23:40:04 -08:00
Jiacheng Guo
2879994fc3 Skip GetFrameHostForNavigation if the creation of the RFH is deferred
The CL skips the whole GetFrameHostForNavigation function if the
creation of the speculative RFH can be deferred. Navigation traces
showed that calling GetFrameHostForNavigation itself can be
time-consuming even if the creation of the RFH is deferred.

The design doc can be found at:
https://docs.google.com/document/d/1J0D5-qireiIngmyeiaMtHrKKRWbiYOtrCqxqeuNhhxE/edit?usp=sharing

Bug: 332435024
Change-Id: Id6fb4d92ccbfc3e334c4d3e84583736aaf053e79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6224174
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1419053}
2025-02-11 18:45:53 -08:00
sbingler
ff91a35b00 Correct kHstsTopLevelNavigationsOnly to use IsOutermostMainFrameRequest
When kHstsTopLevelNavigationsOnly is active we want to apply HSTS
upgrades to "real" top-level navigations only, not MPArch frames such as
Fenced Frames. This CL corrects the usage of IsMainFrameRequest() to
IsOutermostMainFrameRequest().

Bug: 40725781
Change-Id: Idaaedc61b4bb1ed5cd3b24f891f895335274b78b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226288
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Steven Bingler <bingler@chromium.org>
Reviewed-by: mmenke <mmenke@chromium.org>
Reviewed-by: Chris Thompson <cthomp@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416936}
2025-02-06 11:34:18 -08:00
Sharon Yang
0227922587 Remove the AreDefaultSiteInstancesEnabled test util
Now that kProcessSharingWithDefaultSiteInstances has been removed, the
test util that checks the feature can be removed. This will also become
unnecessary once we replace the default SiteInstance with a default
SiteInstanceGroup

Test: Test cleanup
Bug: 356624048
Change-Id: Ib1f07a0c87e842d3cca8a6a463da7405de742bb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6175358
Commit-Queue: Sharon Yang <yangsharon@chromium.org>
Owners-Override: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406846}
2025-01-15 11:09:19 -08:00
Adem Derinel
29e2ff58aa [Gardener] Disable NavigationBrowserTest.IPCFlood_GoToEntryAtOffset on Linux ASAN
Bug: 379844650
Change-Id: I2e3c2b7898aca8e894f2c7644414128bd0dd144d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6106052
Owners-Override: Adem Derinel <derinel@google.com>
Reviewed-by: Rafał Godlewski <rgod@google.com>
Commit-Queue: Rafał Godlewski <rgod@google.com>
Auto-Submit: Adem Derinel <derinel@google.com>
Commit-Queue: Adem Derinel <derinel@google.com>
Cr-Commit-Position: refs/heads/main@{#1397974}
2024-12-18 08:34:23 -08:00
sbingler
e0bc09545a Implement enabling HSTS upgrades for top-level navigations only
This change adds a, default disabled, feature which when enabled will
only allow top-level navigations to be upgraded by HSTS.

This CL also refactors some tests that are broken by this change:
* Because websockets are considered sub-resource requests they'll never
be upgraded and so tests for this behavior only run with the feature
disabled.
* Other tests that aren't specifically testing for sub-resources are
changed to be main frame navigation requests.


Bug: 40725781
Change-Id: I072a06debbe0034802c601cd0620bc6e73bde3f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5859646
Reviewed-by: mmenke <mmenke@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Steven Bingler <bingler@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1396041}
2024-12-13 10:09:12 -08:00
Arthur Sonzogni
d5ce01f7ef C++11 std::array rewrite for memory safety [11/19]
Split from:
https://chromium-review.googlesource.com/c/chromium/src/+/6004959

Generated patch
---------------
- Tool: ./tool/clang/spanify/rewrite-multiple-platform.sh
- Platform: Linux.
- Filter: This includes 2400/4222 patches. I included the std::array
      ones and excluded build errors.

Google announcement:
--------------------
https://groups.google.com/a/google.com/g/chrome-memory-safety/c/RMiO4gaVLQA/m/Yz-3NCObAgAJ

Benchmarks:
----------
See design doc and
https://chromium-review.googlesource.com/c/chromium/src/+/6004959/21

Description
-----------
The consensus during the memory safety summit was to begin rewriting
relevant C-style arrays to C++11 std::array. It can be done immediately,
offers better developer ergonomics, and fix large chunks of the
-Wunsafe-buffer-usage errors in Chrome.

To clarify, this effort is complementary to the longer plan work with
enabling -fsanitize=array-bounds, and we plan to leverage both,
especially for protecting 3p code.

[Attached] is a document detailing the rationale, benefits, and
considerations for potential compile-time and performance impacts.

[Attached]:https://docs.google.com/document/d/1z5aBDg26lHmNDjXRCysElWKx7E4PAJXqykI_k7ondJI/edit?tab=t.0#heading=h.cqgo7wvp0kzt

NO_IFTTT=No need to update base/debug/stack_trace.h

Bug: 378069401
Change-Id: I6d36543c267f12c672cce00d75cf833fff238ebf
R: dcheng@chromium.org
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6039265
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395908}
2024-12-13 05:35:28 -08:00
Emily Andrews
d15fd76ecb Change RenderProcessHost::GetID to RenderProcessHost::GetDeprecatedID
This change bulk changes RenderProcessHost::GetID to
RenderProcessHost::GetDeprecatedID to support the transition to a
strongly typed ChildProcessId.

Bug: 379869738
Change-Id: Ib0c991536486ef29702ea166cdcf12ea68ed70ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6065543
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Emily Andrews <emiled@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1394500}
2024-12-10 20:41:54 +00:00
Peter Kasting
47250048d3 Remove StringPrintfNonConstexpr(): content/
This is discouraged due to unsafety.

Bug: none
Change-Id: Ib74f30a0652083bac7cbcd0b041bdbcdf9d4ff5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6037414
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1386333}
2024-11-21 18:36:25 +00:00
Sharon Yang
85d8ee75f5 data: URL subframes use SiteInstanceGroup
This CL introduces multiple SiteInstances per SiteInstanceGroup for
subframe data: URLs. This feature is behind the feature flag
kSiteInstanceGroupsForDataUrls, which is disabled by default, so there
is no behaviour change in this CL.

Subframe data: URLs will now have their own
SiteInstance that goes in the same SiteInstanceGroup as its initiator.
Currently, sandboxed data: subframes are excluded, as they require
computing a variation of the initiator SiteInstance, which is out of
scope for this CL and will be added in a followup.

Because the new data: subframe shares a SiteInstanceGroup with its
initiator, the number of processes remains the same as before.

Test: Added SiteInstanceGroup browsertests
Change-Id: If784b21ceccd440e35c0020053823ae287cf931d
Bug: 40269084
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4675093
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Elly FJ <ellyjones@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Sharon Yang <yangsharon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1382080}
2024-11-13 00:52:22 +00:00
Patrick Monette
c520126a4b [Spare RPH] Modify API to support multiple spares
The main complexity of this CL is from tests that assume the
existence of only 1 spare, and making sure the task_manager can
track multiple spares.

So for browser tests that check if a spare is used in a navigation,
the idea is to keep a copy of all spares before the navigation, and
check that the taken renderer is contained in that collection.

An exception is browser tests that uses
SpareRenderProcessHostStartedObserver. Those tests still assumes
only 1 spare, as the observer will still only be notified when
the first spare is created.

In unit tests, it is generally safe to assume there can only be 1
spare, because the actual spare management functions are called by
the tests (e.g. The test calls WarmupSpare exactly once, so there
will be only one spare).

Bug: 364635886
Change-Id: Id9c7c7bd88740571b3f238ba6c7115195409a6b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5889790
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1366339}
2024-10-09 18:36:57 +00:00
Patrick Monette
d17576881f Add SpareRenderProcessHostManager::Observer
There is code that wants to be notified when the spare renderer is
created and then used/deleted (Mostly the task manager, and also
some tests). This is currently achieved through the
RegisterSpareChangedCallback() function.

In a future world where there is potentially more than one spare
renderer, this approach doesn't work.

Instead, replace it with an observer interface that clearly
indicates when a spare is started, and when a spare either is
used or deleted.

With the callback approach, the callback was invoked immediately
upon registration if there was an existing spare. With the
observer approach, this is not done automatically and observers
must now call GetSpare(), which is now an official public method
for getting the spare renderer. This means the GetSpareForTesting
method is removed.

Bug: 364635886
Change-Id: Ida3afbc6c27318b6598d71e8657cdf824cff46b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868155
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1359580}
2024-09-24 20:59:19 +00:00
Patrick Monette
a451113419 Add public interface of SpareRenderProcessHostManager
Currently, the public interface (outside content/) for accessing¸
the spare RPH is through static methods of RenderProcessHost.

This CL splits SpareRenderProcessHostManager into a public interface
and a private implementation.

Inside content/, using SpareRenderProcessHostManagerImpl is
prefered.

No behavioral change, refactor only.

Bug: 364635886
Change-Id: I612de785dd709d5dff39ae37f01c15624dc00617
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5867079
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1359098}
2024-09-24 00:33:29 +00:00
Patrick Monette
1563c363b7 Simplify method names in SpareRenderProcessHostManager
This change is meant to improve readability by reducing the length
of the method names of a class with an already long name.

Bug: 364635886
Change-Id: Ie45c49a0ed47fc525050af7128df71cd2b280989
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5858280
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1356827}
2024-09-18 00:14:02 +00:00
Erik Anderson
edf4450016 Wait for lifecycle update to eliminate flakiness in VisualPropertiesSynchronization.RemoteToLocalTransition
This test was flaky on Fuchsia and ChromeOS Ash. The theory is that we
need to wait longer for the VisualProperties update to come in. Waiting
for a lifecycle update will hopefully ensure that update has happened.

Bug: 361299696
Change-Id: I2479f5f8b7daab68f05e3c23ec0b477e6d63640d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5857258
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Brandon Maslen <brandm@microsoft.com>
Auto-Submit: Erik Anderson <Erik.Anderson@microsoft.com>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1355281}
2024-09-13 17:18:33 +00:00
Alex Moshchuk
b7f08219ad Check if ref counts are disabled when changing keep alive ref count
There was a crash in the wild in RenderProcessHost and SiteInstanceGroup
DecrementNavigationStateKeepAliveCount. Fix that by checking if
ref counts are disabled before incrementing/decrementing the ref count.

Test: Added a regression test in NavigationBrowserTest
Bug: 348150830
Change-Id: Iefc032e60b4ae164f67ea4cae1712333da3e7484
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5841865
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1354245}
2024-09-11 22:57:35 +00:00
Avi Drissman
580a3da6e0 Use an opaque type for FrameTreeNode IDs, part 2
content/browser/loader and content/browser/renderer_host.

Bug: 361344235
Change-Id: I3e70d3e5bcc205e68566c5ff3a4b20c6849637af
Include-Ci-Only-Tests: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5829746
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1350844}
2024-09-04 16:16:56 +00:00
Avi Drissman
bd15364a66 Use an opaque type for FrameTreeNode IDs, part 1
The type FrameTreeNodeId is in a new file because otherwise it would
have to live in render_frame_host.h, which is very heavyweight, and
it would greatly increase the compile costs of files that didn't have
to include it before but have to include it now.

Bug: 361344235
Change-Id: I5841cd14eb246d4dc7bc20bd419be2760f1166d4
Include-Ci-Only-Tests: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5807683
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1350315}
2024-09-03 18:58:05 +00:00
Liam Brady
2141dc586e Refactor some sandbox top-navigation tests as browsertests.
A series of tentative WPTs were written to test updates to our
framebusting interventions. Some of the tests written test non-standard
behavior, and have been resulting in failures when other browsers (who
have not implemented our framebusting interventions) try to run them.
There are also issues with some of the tests themselves when running in
headless mode, as they require giving user activation to a subframe in a
separate window the test opens, which is something headless mode doesn't
currently support. To fix both of these problems, this CL refactors the
problematic tests into browser tests.

Most of the WPTs are staying as is, since they test standard behavior
and don't have compatibility issues with headless mode.

The following tests are being refactored into browser tests:
* sandbox-top-navigation-cross-origin-escalate
  * now FramebustingFromPrivilegeEscalationFails
* sandbox-top-navigation-child-cross-origin-delivered
  * now FramebustingFromDeliveredFlagsFails
* sandbox-top-navigation-cross-site
  * now FramebustingAfterCrossSiteNavigationFails
* sandbox-top-navigation-grandchild-sandboxed-escalate
  * now FramebustingFromGrandchildPrivilegeEscalationFails
* sandbox-top-navigation-same-site-no-activation
  * now FramebustingAfterSameSiteNavigationWithoutUserActivationFails
* sandbox-top-navigation-same-site
  * now FramebustingAfterSameSiteNavigationSucceeds

The following tests have duplicates and are being removed altogether:
* sandbox-top-navigation-child-frame-both
  * duplicate of iframe_sandbox_allow_top_navigation-3
* sandbox-top-navigation-child-frame
  * duplicate of iframe_sandbox_allow_top_navigation-1
* sandbox-top-navigation-grandchild-unsandboxed
  * duplicate of sandbox-top-navigation-grandchild-unsandboxed-cross-origin-parent
* sandbox-top-navigation-user-activation-no-sticky
  * duplicate of iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture
* sandbox-top-navigation-user-activation-sticky
  * duplicate of
    iframe_sandbox_allow_top_navigation_by_user_activation-manual

The following tests rely on manual behavior and, while not being
removed, are getting an equivalent browser test:
* iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture
  * now FramebustingWithAllowTopNavigationByUserActivation
* iframe_sandbox_allow_top_navigation_by_user_activation-manual
  * also now FramebustingWithAllowTopNavigationByUserActivation

Bug: 347782854
Change-Id: I3b39a9d51db3dd725c8a88eac0bb464fa4753c04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5813532
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Liam Brady <lbrady@google.com>
Cr-Commit-Position: refs/heads/main@{#1348945}
2024-08-29 23:04:00 +00:00
Rakina Zata Amni
14fe301c3a Carry over focused frame after LocalFrame<->LocalFrame swap
Previously same-origin navigations will keep the same LocalFrame,
and we track focused frames in the controller as LocalFrames. This
means the "focused" frame status will survive same-origin navigations.

With RenderDocument, we won't keep the same LocalFrame after
navigations, and will clear out the focused frames as the previous
LocalFrame gets swapped out/detached. This is causing regressions,
see also linked bug. This CL makes it so that we keep the previous
behavior by keeping track of whether the previous LocalFrame is
the focused frames, then marking the new LocalFrame as focused.

Fixed: 360705823
Change-Id: I9fcf2f936775fd17b63f381919b05805edeff3bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5802555
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1348396}
2024-08-29 01:45:48 +00:00
Erik Anderson
76406ad311 Disable VisualPropertiesSynchronization.RemoteToLocalTransition on Fuchsia.
This test appears to be flaky only on Fuchsia. We will investigate the
source of flakiness async.

Bug: 361299696
Change-Id: Ida9dded448be99cd7fc255470a6e61b48f565d08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5818545
Auto-Submit: Erik Anderson <Erik.Anderson@microsoft.com>
Commit-Queue: Erik Anderson <Erik.Anderson@microsoft.com>
Reviewed-by: Brandon Maslen <brandm@microsoft.com>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Brandon Maslen <brandm@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1348116}
2024-08-28 17:23:49 +00:00
Erik Anderson
4f7800c017 Speculative fix for VisualPropertiesSynchronization.RemoteToLocalTransition test flakiness
I've not been able to locally repro the flakiness seen with this test,
even with 1000 runs on both debug and release Linux builds. The failing
test logs indicate that the correct viewport size has not reached the
renderer. This is a speculative change to clear the "ack pending" flag
when we clear the visual properties with the expectation that it should
more immediately push down the correct size vs. waiting for a later
call to trigger the update.

Bug: 361299696
Change-Id: Iad6d236380094e03ddccda4bc4c4c2f4f1e74a29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5807530
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Erik Anderson <Erik.Anderson@microsoft.com>
Auto-Submit: Erik Anderson <Erik.Anderson@microsoft.com>
Reviewed-by: Brandon Maslen <brandm@microsoft.com>
Commit-Queue: Brandon Maslen <brandm@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1346896}
2024-08-26 19:24:43 +00:00
Khushal Sagar
90ee3332a6 content: Fix has ua visual transition api for navigation transitions
We currently miss plumbing this bit to the renderer since it's set on
the navigation request after the commit message is already sent. Fix
that timing and update the browser test to include the complete flow.

Bug: 331671779
Change-Id: I857dbe903e746945e5e5c06146bc0c83c8ade0f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5804907
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: William Liu <liuwilliam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1345671}
2024-08-22 21:41:26 +00:00
Mohamed Amir Yosef
62306d5281 [Gardener] Disable RemoteToLocalTransition
The test is very flaky.
Details are in the linked bug.

Bug: 361299696
Change-Id: I8182a0e6a63ee3404f4bbe45c4cbef595ee0de53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5803097
Commit-Queue: Rafał Godlewski <rgod@google.com>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Owners-Override: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: Rafał Godlewski <rgod@google.com>
Auto-Submit: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344826}
2024-08-21 16:02:52 +00:00
Charlie Reis
673ad73e6e Fix DCHECK on same-document navigations with a siteless SiteInstance.
Bug: 359807735
Change-Id: Iaa479fbf59410836cbeaa6bdc108b7c4ab84e420
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5789527
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1342384}
2024-08-15 18:32:08 +00:00
Erik Anderson
5d151f139c Clear visual properties when setting the main frame routing ID
Prior to this change, a race condition existed when a WebViewImpl
transitions from being a remote frame to a local frame. The updated
visual properties were not sent based on the timing of when different
navigations completed.

This race condition was commonly seen in Microsoft Edge with an internal
site which kicked off a top-level nav to another origin and immediately
afterward navigated an iframe to a page of the same origin.

The included test emulates this situation. Prior to this change, the
test consistently fails with the renderer having a 0x0-sized viewport.

Bug: 352093463
Change-Id: Ia2bab87a040395a534fda21069250b5fd08df6e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5785294
Reviewed-by: Jan Keitel <jkeitel@google.com>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Auto-Submit: Erik Anderson <Erik.Anderson@microsoft.com>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Cr-Commit-Position: refs/heads/main@{#1341485}
2024-08-14 06:18:05 +00:00
Khushal Sagar
71837ad827 Set hasUAVisualTransition while doing navigation transition.
Fixed: 331671779
Change-Id: I51d5f6abeec9a65cefab23687c6c232bf318344d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5660197
Commit-Queue: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Khushal Sagar <khushalsagar@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1339725}
2024-08-09 18:03:15 +00:00
Chris Fredrickson
cf24f1b21f Migrate to optional-based GetHeader overload
HttpRequestHeaders::GetHeader has a new overload
which returns an optional instead of using an out-
parameter. I'm migrating callers and will eventually
delete the old version of the method.

This CL was uploaded by git cl split.

R=boliu@chromium.org

Bug: 355451174
Change-Id: I0b0027bf9d418bb274b0f2da3fdda62a039b9731
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5748517
Reviewed-by: Bo Liu <boliu@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Commit-Queue: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1334969}
2024-07-30 17:49:34 +00:00
Rakina Zata Amni
df8d1b4957 Reland "Add WillCommitWithoutUrlLoader handling to RendererCancellationThrottle"
This is a reland of commit a0507e59a8

PS2 fixes the failing CreationNotDeferredWithoutURLLoader test.

Original change's description:
> Add WillCommitWithoutUrlLoader handling to RendererCancellationThrottle
>
> Currently it only handles WillProcessResponse, so it didn't capture
> no-URLLoader navigations like about:blank. This CL makes it so that
> it captures both navigations with and without URLLoader.
>
> Bug: 352352911
> Change-Id: I0a75a4f80c04d7ec540ed74c63a07098797293c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5741319
> Reviewed-by: Mingyu Lei <leimy@chromium.org>
> Commit-Queue: Mingyu Lei <leimy@chromium.org>
> Auto-Submit: Rakina Zata Amni <rakina@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1333343}

Bug: 352352911
Change-Id: I9dc788aff3b8b025a930fdd73e42606efdbde500
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5740921
Reviewed-by: Mingyu Lei <leimy@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1333443}
2024-07-26 09:21:25 +00:00
Jiacheng Guo
6dcc29cbbb Reland "Warm up spare renderer after each navigation on Android"
The creation of the render process may fail due to MAX_CONNECTION limit.
The reland increases the limit to 2.

This is a reland of commit 6fc523e321

Original change's description:
> Warm up spare renderer after each navigation on Android
>
> The CL introcudes feature flag AndroidAlwaysWarmUpSpareRenderer to warm
> up a spare renderer with timeout. The timing of the spare process
> creation is controlled by the parameter
> `spare_renderer_creation_timing`. Options are:
>   * After the loading finishes
>   * After first visible painting
>   * During the loading with a delay.
>
> The design doc can be found at
> https://docs.google.com/document/d/1DFMF6I_JvdpB7hnDg4nLFZJcg8bcfHBGSOnLFBmz0nY/edit?usp=sharing&resourcekey=0-RLeYvqmvtoiA3xMGHjUlWQ
>
> Bug: 350646322
> Change-Id: Ic47098ca35a4cf589dbd62877056fc4d2362b5de
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5669862
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Cr-Commit-Position: refs/heads/main@{#1332158}

Bug: 350646322
Change-Id: Iafaeb049065b256460cf301dedf993377bbf22bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5740074
Commit-Queue: Jiacheng Guo <gjc@google.com>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1333297}
2024-07-26 00:28:40 +00:00
Benoit Lize
27b6ed3441 Revert "Warm up spare renderer after each navigation on Android"
This reverts commit 6fc523e321.

Reason for revert: Suspected root cause (failing test) for crbug/355146121


Original change's description:
> Warm up spare renderer after each navigation on Android
>
> The CL introcudes feature flag AndroidAlwaysWarmUpSpareRenderer to warm
> up a spare renderer with timeout. The timing of the spare process
> creation is controlled by the parameter
> `spare_renderer_creation_timing`. Options are:
>   * After the loading finishes
>   * After first visible painting
>   * During the loading with a delay.
>
> The design doc can be found at
> https://docs.google.com/document/d/1DFMF6I_JvdpB7hnDg4nLFZJcg8bcfHBGSOnLFBmz0nY/edit?usp=sharing&resourcekey=0-RLeYvqmvtoiA3xMGHjUlWQ
>
> Bug: 350646322
> Change-Id: Ic47098ca35a4cf589dbd62877056fc4d2362b5de
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5669862
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Cr-Commit-Position: refs/heads/main@{#1332158}

Bug: 350646322, 355146121
Change-Id: I68e30b6ebd4522dd8b721b798a021096534c3e01
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5735103
Owners-Override: Benoit Lize <lizeb@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Benoit Lize <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1332689}
2024-07-25 00:05:55 +00:00
Jiacheng Guo
6fc523e321 Warm up spare renderer after each navigation on Android
The CL introcudes feature flag AndroidAlwaysWarmUpSpareRenderer to warm
up a spare renderer with timeout. The timing of the spare process
creation is controlled by the parameter
`spare_renderer_creation_timing`. Options are:
  * After the loading finishes
  * After first visible painting
  * During the loading with a delay.

The design doc can be found at
https://docs.google.com/document/d/1DFMF6I_JvdpB7hnDg4nLFZJcg8bcfHBGSOnLFBmz0nY/edit?usp=sharing&resourcekey=0-RLeYvqmvtoiA3xMGHjUlWQ

Bug: 350646322
Change-Id: Ic47098ca35a4cf589dbd62877056fc4d2362b5de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5669862
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1332158}
2024-07-24 05:43:35 +00:00
Michael Thiessen
7f85eed525 Disable Flaky NavigationCookiesBrowserTest.CookiesInheritedSrcDoc
Flaky on all platforms, more flaky on slower devices like Android
emulators.

Bug: 339033006
Change-Id: I533a68e9c67a4de3ed187191dd2e11d5605662a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5663886
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Auto-Submit: Michael Thiessen <mthiesse@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321060}
2024-06-28 17:38:25 +00:00
Jiacheng Guo
9c2f6f51a9 Reland 'Add UMA to record the deferred speculative RFHs'
This is a reland of commit Iebce93f58e73749780bc32389266f0f70b9b3403.
The CL is not the cause of the CI failure and incorrectly reverted.

Original change's description:
> The CL adds a UMA to record whether the speculative RFH creation is
> deferred and whether a spare render process is created.
>
> Bug: 332435024
> Change-Id: Iebce93f58e73749780bc32389266f0f70b9b3403
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5657751
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1320224}

Cq-Include-Trybots: luci.chromium.try:chromeos-amd64-generic-asan-rel
Bug: 332435024
Change-Id: I91b92244ff8cd891337e2841dbec55c1cee1d36a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5665335
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1320779}
2024-06-28 02:57:45 +00:00
Danila Kuzmin
83704f9ac1 [gardner] Revert "Add UMA to record the deferred speculative RFHs"
This reverts commit 18fc97e19f.

Reason for revert: LUCI bisect as a reason for chromeos-amd64-generic-asan-rel failure, which closed the tree.

Original change's description:
> Add UMA to record the deferred speculative RFHs
>
> The CL adds a UMA to record whether the speculative RFH creation is
> deferred and whether a spare render process is created.
>
> Bug: 332435024
> Change-Id: Iebce93f58e73749780bc32389266f0f70b9b3403
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5657751
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Jiacheng Guo <gjc@google.com>
> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1320224}

Bug: 332435024
Change-Id: Ief73c4c137e99c2cd7dbcb9d985a8f920ed70ecb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5661399
Owners-Override: Danila Kuzmin <dkuzmin@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Danila Kuzmin <dkuzmin@google.com>
Auto-Submit: Danila Kuzmin <dkuzmin@google.com>
Cr-Commit-Position: refs/heads/main@{#1320227}
2024-06-27 11:07:47 +00:00
Jiacheng Guo
18fc97e19f Add UMA to record the deferred speculative RFHs
The CL adds a UMA to record whether the speculative RFH creation is
deferred and whether a spare render process is created.

Bug: 332435024
Change-Id: Iebce93f58e73749780bc32389266f0f70b9b3403
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5657751
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1320224}
2024-06-27 10:21:38 +00:00
Jiacheng Guo
543893b05c Remove unnecessary process creation when deferring speculative RFH
The CL removes the unnecessary creation of the spare render process on
Android if BFCache is disabled.
The CL also disables the failing test NavigateWithPendingCommit on
android if BFCache is disabled. The issue is happening even without the
feature.

Bug: 348564931, 349487596
Change-Id: Iffe51c8726aa9e753703d8b69ca6bf1fbef23d3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5657750
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1320185}
2024-06-27 05:56:53 +00:00
Ashley Newson
5776acd69f Disable NavigationBrowserTests which still fail on Android bfcache bot
Bug: 348564931
Change-Id: Ic242affed6d51fc7da617d905400c9d2e6267bec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5650928
Owners-Override: Ashley Newson <ashleynewson@chromium.org>
Commit-Queue: Ashley Newson <ashleynewson@chromium.org>
Reviewed-by: Rupert Wiser <bewise@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1319084}
2024-06-25 12:49:57 +00:00
Jiacheng Guo
6ecb7ce4b9 Warm up spare render process when deferring the speculative RFH
The CL adds the parameter to warm-up a spare render process even if the
speculative RFH creation is deferred. This will boost the navigation on
Android where the creation of the render process is relatively slow.

Bug: 332435024
Change-Id: I32dfe0988d837dec8f7efb1c30afb22c878402ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645306
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1318975}
2024-06-25 07:07:21 +00:00
Jiacheng Guo
0d8204acf7 Fix failing DeferSpeculativeRFHCreationTest on bfcache-rel bots
The CL fixes the failing DeferSpeculativeRFHCreationTest tests by
enablint render document for all frames to ensure RFH is created.

Bug: 348564931
Cq-Include-Trybots: luci.chromium.try:linux-bfcache-rel
Cq-Include-Trybots: luci.chromium.try:android-bfcache-rel
Change-Id: I4af9b61e20d34629ee0d9fc5f43fdfcce9a4c4b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5647824
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1318955}
2024-06-25 06:12:27 +00:00
Nicola Tommasi
317f8d47cd [Gardener][Clank] Disable failing NavigationBrowserTest
Bug: 348564931
Change-Id: Ifcd5ba3aa1ce11d47bf79928f1dc7c292dd422dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5644963
Reviewed-by: Florian Leimgruber <fleimgruber@google.com>
Commit-Queue: Nicola Tommasi <tommasin@chromium.org>
Owners-Override: Nicola Tommasi <tommasin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1317882}
2024-06-21 12:11:01 +00:00
Jiacheng Guo
c1510465be Add browser tests for deferring speculative RFH creation
The CL adds browser tests for verifying:
* Basic flow when deferring the speculative RFH creation.
* Speculative RFH creation is not deferred for webUI and pages not
  requiring a url loader.
* Navigations pending commit will correctly block the speculative RFH
  creation.

Bug: 332435024
Change-Id: I7ea1bd4d9decf4710b7a3bde1ec88a42a3df3d3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5525909
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1317709}
2024-06-21 00:07:11 +00:00
Jiacheng Guo
4bdd0be647 Explicitly wait for creation of speculative RFH in tests
After the DeferSpeculativeRFH feature, the speculative RFH may not be
created when the navigation starts. The CL adds test utilities to
explicitly wait for the creation of the speculative RFH including:

* New functions added to the TestNavigationManager to wait for the
  speculative RFH and acquire the created speculative RFH.
* A new utility class SpeculativeRenderFrameHostObserver to wait for the
  speculative RFH without throttling the navigation.

All the failing tests have been modified to cater to the new feature.

The CL for the DeferSpeculativeRFH feature can be found at:
crrev.com/c/5400835
The design doc for the test fixes can be found at:
https://docs.google.com/document/d/14-hslQc3whJ3wa0rse3jdg1pzr5OZUM-5qDOuPAj-8o/edit?usp=sharing

Bug: 332435024
Change-Id: Ib1957784580624cd2546d9dd7d93a27178c879a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5401150
Reviewed-by: Jan Keitel <jkeitel@google.com>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1313739}
2024-06-11 23:35:21 +00:00
Nasko Oskov
ee48dfb4fa Prepare to remove //content/ from unsafe_bufers_paths.txt
Suppress unsafe buffer usage on a file-by-file basis.  Out of
approximately 5850 .cc and .h files only roughly 160 files fail
compilation with the unsafe buffers warning.

Suppress only, by inserting boilerplate into affected files. Do not
re-write any code to work around the issues. Properly fixing each file
will be done in follow-up CLs.

//content/ is not removed from unsafe_bufers_paths.txt file and will be
also done as a follow-up, so it makes potential reverts simpler.

Bug: 342213636
Change-Id: I4a936e63dea95a78951f7bfae6d5487708ae3c0b
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608913
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312393}
2024-06-08 05:13:06 +00:00