0
Commit Graph

589 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
Fergal Daly
fbb93e42a6 Add support for NotRestoredReasons above 63 to BFCache tests.
Previously we only supported the enum values up to 63. This is being
done to support https://crrev.com/c/6198936.

This migrates the code to use EnumSet which matches the code in
back_forward_cache_metrics.cc more closely.

Change-Id: I1ba3e8a7e564b03a46cbd623466ffb891d1a694b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6217562
Commit-Queue: Fergal Daly <fergal@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414761}
2025-02-02 23:01:07 -08:00
Ramon Cano Aparicio
6797d4e5e1 Rename HistogramBase::Sample to Sample32 in content.
Add size to type name so the size is known without needing to lookup
the typedef.
Continuation of https://chromium-review.googlesource.com/c/chromium/src/+/6163590

Changed occurrences under chromium/content

Bug: 40899968
Change-Id: I18af5c2d8d86656d0afc3a6094ab1aa5cb1b2f4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6164150
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: Ryan Tarpine <rtarpine@chromium.org>
Reviewed-by: Roman Arora <romanarora@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Commit-Queue: Ramon Cano Aparicio <rcanoaparicio@google.com>
Cr-Commit-Position: refs/heads/main@{#1404808}
2025-01-10 08:09:02 -08:00
Charlie Reis
9e20dd1307 Reland: Record metrics and trace events for navigation start adjustments.
This reverts commit c33526f6ae.

Record metrics and trace events for navigation start adjustments.

These metrics will indicate how large the adjustments are in practice,
and how consistently they are made.

The previous attempt did not account for negative time adjustments,
which unfortunately can occur in practice. This CL allows us to gather
metrics for negative adjustments as well (diff from PS1).

Bug: 385170155
Change-Id: Id10060ae8ef6e225c09442aa8c72784ef56c2898
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6120967
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: Sharon Yang <yangsharon@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401543}
2025-01-02 12:11:53 -08:00
luci-bisection@appspot.gserviceaccount.com
c33526f6ae Revert "Record metrics and trace events for navigation start adjustments."
This reverts commit c7593abc58.

Reason for revert:
LUCI Bisection has identified this change as the cause of a test failure. See the analysis: https://ci.chromium.org/ui/p/chromium/bisection/test-analysis/b/5752743777009664

Sample build with failed test: https://ci.chromium.org/b/8727981549420340657
Affected test(s):
[ninja://chrome/test:browser_tests/ReferrerPolicyTest.History](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fchrome%2Ftest:browser_tests%2FReferrerPolicyTest.History?q=VHash%3A5a9885bd2bc5b6c9)
[ninja://chrome/test:browser_tests/SupervisedUserPendingStateNavigationTest.TestBlockedSiteMainFrameReauthInterstitial/WithThrottleClassifyUrlNavigationThrottle](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fchrome%2Ftest:browser_tests%2FSupervisedUserPendingStateNavigationTest.TestBlockedSiteMainFrameReauthInterstitial%2FWithThrottleClassifyUrlNavigationThrottle?q=VHash%3A5a9885bd2bc5b6c9)
[ninja://chrome/test:browser_tests/SupervisedUserPendingStateNavigationTest.TestBlockedSiteMainFrameReauthInterstitial/WithThrottleSupervisedUserNavigationThrottle](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fchrome%2Ftest:browser_tests%2FSupervisedUserPendingStateNavigationTest.TestBlockedSiteMainFrameReauthInterstitial%2FWithThrottleSupervisedUserNavigationThrottle?q=VHash%3A5a9885bd2bc5b6c9)
[ninja://chrome/test:browser_tests/SupervisedUserPendingStateNavigationTest.TestReauthInterstitialClosesSignInTabsAndReloads/WithThrottleSupervisedUserNavigationThrottle](https://ci.chromium.org/ui/test/chromium/ninja:%2F%2Fchrome%2Ftest:browser_tests%2FSupervisedUserPendingStateNavigationTest.TestReauthInterstitialClosesSignInTabsAndReloads%2FWithThrottleSupervisedUserNavigationThrottle?q=VHash%3A5a9885bd2bc5b6c9)

If this is a false positive, please report it at http://b.corp.google.com/createIssue?component=1199205&description=Analysis%3A+https%3A%2F%2Fci.chromium.org%2Fui%2Fp%2Fchromium%2Fbisection%2Ftest-analysis%2Fb%2F5752743777009664&format=PLAIN&priority=P3&title=Wrongly+blamed+https%3A%2F%2Fchromium-review.googlesource.com%2Fc%2Fchromium%2Fsrc%2F%2B%2F6112083&type=BUG

Original change's description:
> Record metrics and trace events for navigation start adjustments.
>
> These metrics will indicate how large the adjustments are in practice,
> and how consistently they are made.
>
> Bug: 385170155
> Change-Id: Ibb3e36730213f054e71f216331edb0c6bce5d5b8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6112083
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Reviewed-by: Chris Thompson <cthomp@chromium.org>
> Commit-Queue: Charlie Reis <creis@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1399424}
>

Bug: 385170155
Change-Id: If1af921a942d88459cc29b9bbf4ca9fce0a8aa54
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6115121
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Commit-Queue: Lingqi Chi <lingqi@chromium.org>
Owners-Override: Lingqi Chi <lingqi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1399691}
2024-12-22 18:37:14 -08:00
Charlie Reis
c7593abc58 Record metrics and trace events for navigation start adjustments.
These metrics will indicate how large the adjustments are in practice,
and how consistently they are made.

Bug: 385170155
Change-Id: Ibb3e36730213f054e71f216331edb0c6bce5d5b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6112083
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Chris Thompson <cthomp@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1399424}
2024-12-20 16:10:45 -08:00
Georg Neis
35ff854b7e Remove Lacros leftovers from content/browser, part 2
Main changes:
- Replace IS_CHROMEOS_ASH with the equivalent IS_CHROMEOS
- Remove obsolete build flag includes/dependencies

Bug: b:354842935
AX-Relnotes: n/a.
Change-Id: I079b003a4664a7a3f7281905323611b6fc4fe3da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6090635
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1397108}
2024-12-16 18:02:08 -08:00
Georg Neis
0dce333643 Remove Lacros leftovers from content/browser, part 1
Main changes:
- Remove IS_CHROMEOS_LACROS code
- Remove Lacros references from comments

Bug: b:365742770
AX-Relnotes: n/a.
Change-Id: I17a5d33d42845d2d566912a518d088073892372e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6090534
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395719}
2024-12-12 17:51:18 -08:00
Nathan Memmott
f54d81fa96 Code Health: Clean up stale EnableBackForwardCacheForOngoingSubframeNavigation
Bug: 356200701
Change-Id: I335ef18271a063b0371da2cfa311c4c8db5c1160
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6085626
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Reviewed-by: Ming-Ying Chung <mych@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394974}
2024-12-11 10:56:21 -08:00
Fergal Daly
7434e71369 Fix JS in many BFCache tests.
Many of the tests are using ExecJS to create a promise but ExecJS does
not wait for the promise to resolve.

This changes them to use EvalJS and to check the promise's resolved
value.

Change-Id: I7c45cd1da75ff82d09aad87b49c459b0c86d4f84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6086819
Commit-Queue: Fergal Daly <fergal@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394738}
2024-12-11 10:11:48 +00:00
Nathan Memmott
b2aa5665fe Code Health: Clean up stale BackForwardCache_NoMemoryLimit_Trial
Fixed: 356624186
Change-Id: I766de7721cabdca954506278449009596d79bdbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6085487
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Nathan Memmott <memmott@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394633}
2024-12-11 02:17:53 +00:00
Peter Boström
fc7ddc185b Migrate to NOTREACHED() in content/
NOTREACHED() and NOTREACHED_IN_MIGRATION() are both CHECK-fatal now.
The former is [[noreturn]] so this CL also performs dead-code removal
after the NOTREACHED().

This CL does not attempt to do additional rewrites of any surrounding
code, like:

if (!foo) {
  NOTREACHED();
}

to CHECK(foo);

Those transforms take a non-trivial amount of time (and there are
thousands of instances). Cleanup can be left as an exercise for the
reader.

This does clean up kCrashOnDanglingBrowserContext as both paths of the
kill switch are currently fatal. This has been rolled out for a long
time.

Bug: 40580068, 40062641
Change-Id: Ib88e710d003e2e48df3fc502ca54d2341d157a0e
Cq-Include-Trybots: luci.chromium.try:linux-dcheck-off-rel
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5974816
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1376522}
2024-10-31 19:37:21 +00:00
Anna Tsvirchkova
9774836e72 [Gardener] Disable flaky BFCache tests on Android
FiresDidFirstVisuallyNonEmptyPaintWhenRestoredFromCache and SetsThemeColorWhenRestoredFromCache became flaky in almost every build.

Bug: 373323989
Change-Id: Ib73b783c269e64d64bba703af81672b4ca0c18fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5929323
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Auto-Submit: Anna Tsvirchkova <atsvirchkova@google.com>
Reviewed-by: Ioana Pandele <ioanap@chromium.org>
Owners-Override: Anna Tsvirchkova <atsvirchkova@google.com>
Commit-Queue: Anna Tsvirchkova <atsvirchkova@google.com>
Cr-Commit-Position: refs/heads/main@{#1368188}
2024-10-14 12:23:49 +00:00
Tom Sepez
b55f2f1f5e Remove stray const when passing std::string_view arguments.
These may be remnants from a time before string_view when a const
char* would have made sense. Now the const doesn't matter.

Fully automated change.

Change-Id: I2dfc7ce30a54701639535a4f137dc18e71575fe2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5906184
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363323}
2024-10-02 21:54:33 +00:00
Lei Zhang
a6aac9da5a Use provided CommandLine in SetupCommandLine() in //content
Tests that override SetupCommandLine() already get the CommandLine as a
method argument. There is no need to call
base::CommandLine::ForCurrentProcess(). Consistently use the argument
instead.

Change-Id: I4643babbce672ceb304a14318cc0c3d73761e407
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5691228
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1325737}
2024-07-10 20:59:38 +00:00
Lei Zhang
05c13df891 Remove unnecessary ContentBrowserTest::SetUpCommandLine() calls
ContentBrowserTest::SetUpCommandLine() is actually not defined. Calls to
this method ends up running BrowserTestBase::SetUpCommandLine(), which
is always going to be empty. Since there is no point in calling this
method, delete all the callers from SetUpCommandLine() overrides. When
the override becomes empty, delete the override altogether.

Make a note of this in the comments in content_browser_test.h. Also fix
some lint errors along the way.

Change-Id: I81f263286d72ebdab68dfd9575ad4cf2b6378a3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5691227
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1325736}
2024-07-10 20:59:12 +00:00
Jiacheng Guo
02a0423adf Fix BackForwardCacheWithSubframeNavigationBrowserTest failures
The CL fixes BackForwardCacheWithSubframeNavigationBrowserTest timeouts
if a speculative render frame will not be created. The test field trial
is also enabled in the CL since the failing tests are resolved.

Bug: 332435024
Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome
Change-Id: I85131f3479430a5c606ff098a927a086f7a75a96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5624830
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1317182}
2024-06-20 02:03:56 +00:00
Jiacheng Guo
bf0ac0b14a Disable failing BackForwardCacheWithSubframeNavigationBrowserTest
The CL disables the BackForwardCacheWithSubframeNavigationBrowserTest
failing in ChromeOS and Android.

Bug: 346755002
No-Try: true
No-Tree-Checks: true
No-Presubmit: true
Change-Id: I5f54a4cc279032b729085c92b9fa1045c9ab7450
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5626371
Reviewed-by: Egor Pasko <pasko@chromium.org>
Commit-Queue: Vidhan Jain <vidhanj@google.com>
Reviewed-by: Vidhan Jain <vidhanj@google.com>
Owners-Override: Vidhan Jain <vidhanj@google.com>
Commit-Queue: Jiacheng Guo <gjc@google.com>
Cr-Commit-Position: refs/heads/main@{#1313955}
2024-06-12 14:13:44 +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
David Bertoni
3aec0aafec [Gardening] Disable a flaky test on Linux and Windows.
BackForwardCacheBrowserTest.PagehideRunsWhenPageIsHidden was re-enabled
back in 2022, but it is still flaky per new data added to the bug report.

Bug: 40165901
Change-Id: I15a9c1a0ec42886da5f66fc1a70329274eb3f417
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5598234
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Solomon Kinard <solomonkinard@chromium.org>
Commit-Queue: Solomon Kinard <solomonkinard@chromium.org>
Auto-Submit: David Bertoni <dbertoni@chromium.org>
Owners-Override: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1310963}
2024-06-05 23:09:25 +00:00
Peter Boström
8472105d01 Use NOTREACHED_IN_MIGRATION() in content/
This was generated by replacing "  NOTREACHED()" with
"  NOTREACHED_IN_MIGRATION()" and running git cl format.

This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.

Bug: 40580068
Change-Id: I3b48b89911ac5e9ffcb211622992f917f8f9e8d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539619
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301096}
2024-05-15 04:36:02 +00:00
Alison Gale
770f3fce37 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ibc66b8c440e4bcdef414e77fef4d9874d2ea9951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5493800
Auto-Submit: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1293330}
2024-04-27 00:39:58 +00:00
Alison Gale
81f4f2c793 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Iee14d10d544e9f0ec046117cc4ec8a55c427adc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469947
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290838}
2024-04-22 19:33:31 +00:00
Md Hasibul Hasan
a963a934b5 Convert base::StringPiece to std::string_view in content/browser
The changes of this CL are made using the following script.

```
target_directory="content/browser"
replace_string_in_files() {
  old_string="$1"
  new_string="$2"

  find "$target_directory" -type f \( -name "*.cc" -o -name "*.h" \) \
      -exec sed -i '' "s/$old_string/$new_string/g" {} +
}

delete_include() {
    find "$target_directory" \( -name "*.h" -o -name "*.cc" \) -print0 | while IFS= read -r -d '' file; do
        grep -v '#include "base/strings/string_piece.h"' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
    done
}

add_include() {
    find "$target_directory" \( -name "*.h" -o -name "*.cc" \) -print0 | while IFS= read -r -d '' file; do
        local include_added=false
        local tempfile=$(mktemp)

        if grep -qE 'std::(string|u16string)_view' "$file"; then
            while IFS= read -r line; do
                echo "$line" >> "$tempfile"
                if [[ $line =~ ^\s*#include ]]; then
                    if ! $include_added; then
                        echo "#include <string_view>" >> "$tempfile"
                        include_added=true
                    fi
                fi
            done < "$file"

            mv "$tempfile" "$file"

            if $include_added; then
                echo "Added #include <string_view> after the first include line in $file"
            else
                echo "No include line found in $file"
            fi
        else
            echo "std::string_view not found in $file"
        fi
    done
}

replace_string_in_files "base::StringPiece16" "std::u16string_view"
replace_string_in_files "base::StringPiece" "std::string_view"
delete_include
add_include
```

Replaced base::StringPiece16 with std::u16string_view
Replaced base::StringPiece with std::string_view
Removed header "base/strings/string_piece.h"
Added header "<string_view>" where applicable

Bug: 40506050
Change-Id: I2bc22c79dd9a0c839745afe065123f7a53c4a5ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5401117
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1281746}
2024-04-03 10:15:14 +00:00
Takumi Fujimoto
24fbc77fa2 Disable BackForwardCacheBrowserTests for flakiness on Lacros
Disabled tests:
- DoesNotFireDidFirstVisuallyNonEmptyPaintForSameDocumentNavigation
- SetsThemeColorWhenRestoredFromCache

Bug: 330798156
Change-Id: I35b2058d4755959875d8925012c1504345e293a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5380130
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Owners-Override: Takumi Fujimoto <takumif@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Takumi Fujimoto <takumif@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1276733}
2024-03-22 06:42:08 +00:00
Luke Gu
d2d21b8467 Replace string with url.mojom.Url for url field of ScriptSourceLocation
This patch changes the url field from string to url.mojom.Url in
script_source_location.mojom.

Bug: 324031239
Change-Id: I4cf8780b8b59718bc20eb42d6e337cdc7fff3287
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5358493
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274796}
2024-03-19 09:49:41 +00:00
rubberyuzu
7746fbc3fc [bfcache] Remove unused not restored reasons
This CL cleans up the unused not restored reasons. The only reason that's still reported but removed in this CL is kNoResponseHead. We used
to report this because it mysteriously was reported on its own without
any reason, but now the bug is fixed and it always appears with other
reasons, so it's now safe to remove it.

Change-Id: Ia21affe06037cfb619e7d619fb2471debec6aa8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5371653
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Yuzu Saijo <yuzus@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274057}
2024-03-18 10:28:34 +00:00
Rakina Zata Amni
c06ef3a495 Update chrome/ and content/ tests to expect same-site RenderFrameHost changes
These tests expected the RenderFrameHost to stay the same after
navigation, leading to failed expectations or dangling ptrs.

The CL updates the expectations, how we keep track of the ptrs,
or even skips the tests that no longer make sense with RenderDocument
enabled.

Bug: 936696
Change-Id: Ie7897fce62638215074d52d94a2eece372485c86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5358539
Reviewed-by: Christoph Schwering <schwering@google.com>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1271154}
2024-03-11 20:41:35 +00:00
Luke Gu
990c227b5f Reland "Replace string with url.mojom.Url for url field"
This is a reland of commit bc993a9b42

The revert crrev.com/c/5344232 doesn't seem to help with the failing
test (it's still failing:
https://ci.chromium.org/ui/p/chrome/builders/ci/android-arm-tests/23775/blamelist), so relanding the CL.

Original change's description:
> Replace string with url.mojom.Url for url field
>
> With this patch, the use of string for url is replaced with
> url.mojom.Url in back_forward_cache_not_restored_reasons.mojom.
>
> Bug: 324031239
> Change-Id: I2ecb81bd63cee177c582dbef49cb3414d42054dc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5320652
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1268274}

Bug: 324031239
Change-Id: I9945335ba1e524a086022d975c249a021a0fc9bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5346776
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269330}
2024-03-07 00:36:38 +00:00
Side Yilmaz
0f7e59a2df Revert "Replace string with url.mojom.Url for url field"
This reverts commit bc993a9b42.

Reason for revert: Cause to fail BackForwardCacheBrowserTestWithNotRestoredReasons.Reload
https://ci.chromium.org/ui/p/chrome/builders/ci/android-arm-tests

Bug:b/328205561

Original change's description:
> Replace string with url.mojom.Url for url field
>
> With this patch, the use of string for url is replaced with
> url.mojom.Url in back_forward_cache_not_restored_reasons.mojom.
>
> Bug: 324031239
> Change-Id: I2ecb81bd63cee177c582dbef49cb3414d42054dc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5320652
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1268274}

Bug: 324031239
Change-Id: I979b4f56f548bcac7bfe19870cbd8f4522e17d20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5344232
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Side Yilmaz <sideyilmaz@google.com>
Commit-Queue: Side Yilmaz <sideyilmaz@google.com>
Cr-Commit-Position: refs/heads/main@{#1268391}
2024-03-05 12:52:50 +00:00
Luke Gu
bc993a9b42 Replace string with url.mojom.Url for url field
With this patch, the use of string for url is replaced with
url.mojom.Url in back_forward_cache_not_restored_reasons.mojom.

Bug: 324031239
Change-Id: I2ecb81bd63cee177c582dbef49cb3414d42054dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5320652
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1268274}
2024-03-05 06:32:27 +00:00
Ming-Ying Chung
71d0b8e79e Force evicting subframe in NavigationRequest::OnStartChecksComplete()
In the case when a main frame and its subframe both starts navigations
around the same time, if the main frame commits the navigation earlier
than its subframe, the subframe may be incorrectly put into BFCache
along with the main frame before reaching this method, causing errors
like [1] after https://crrev.com/c/5308025 is submitted.

This CL forces evicting subframe in such case.

[1]: https://ci.chromium.org/ui/p/chromium/builders/try/mac-rel/1688922/overview

Bug: 41483740
Change-Id: Iccc0c81a358447fdbf50cf687ffa375b4e5fdd9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5316738
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Ming-Ying Chung <mych@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1267702}
2024-03-04 06:27:28 +00:00
Brian Begnoche
bc623f3488 Disable flaky BackForwardCacheBrowserTest.FiresDidFirstVisuallyNonEmptyPaintWhenRestoredFromCache in content_browsertests
Bug: 327195951
Change-Id: If017710c8fd381faf593636ade2f7643739512c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5327730
Auto-Submit: Brian Begnoche <bcb@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Owners-Override: Brian Begnoche <bcb@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1265888}
2024-02-27 17:46:19 +00:00
Kurumi Muto
03d7175691 [bfcache] Update comment in ~BackForwardCacheBrowserTest()
The enum for BFCache metrics was moved to another folder by the CL: If93d4a205bf1db4a30b921f4c90ae3c30d2cba80. So, updating the comment accordingly.

Change-Id: I8677e89b12c027cc053f574931cb315df7810320
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5316178
Reviewed-by: Yuzu Saijo <yuzus@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Kurumi Muto <mkurumi@google.com>
Cr-Commit-Position: refs/heads/main@{#1263790}
2024-02-22 04:55:53 +00:00
Kurumi Muto
0cf1280534 [bfcache] Refactor mojo structs for BFCache blockers
This CL creates a mojo struct that represents a source location. The goal is to have only two states when we manage source locations: 1. source location exists 2. no source location at all. Having a struct for source location allows us to make a source location itself nullable (avoiding having optional fields inside) and limit the possible cases to only the two.

Here are the specific changes in this CL:
- Created a new mojom file and defined a struct for source location there.
- BFCache-related structs now use the source location struct in common.

Bug: 324201881
Change-Id: I4061ad708010f895416e5881d46c16ba8a3251d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5276765
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Kurumi Muto <mkurumi@google.com>
Cr-Commit-Position: refs/heads/main@{#1263204}
2024-02-21 08:36:42 +00:00
Ivana Žužić
d514c141a1 [Gardener] Disable TextInputStateUpdated on Android
BackForwardCacheBrowserTest.TextInputStateUpdated is flaky in 15.75% of
runs.

Bug: b/324570785
Change-Id: I205dcf52374bec20b245d52c1e30536f14cb2cb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5282024
Owners-Override: Ivana Žužić <izuzic@google.com>
Commit-Queue: Ivana Žužić <izuzic@google.com>
Auto-Submit: Ivana Žužić <izuzic@google.com>
Reviewed-by: Adem Derinel <derinel@google.com>
Cr-Commit-Position: refs/heads/main@{#1258532}
2024-02-09 16:12:22 +00:00
Kurumi Muto
576c0a097c [bfcache] Change mojo struct so source location can be passed to the renderer side
This CL is to change the mojo struct `BackForwardCacheNotRestoredReasons` so it can pass source location information (i.e. url, line number, column number) to the renderer side. In a follow-up, we will send the actual source locations of reasons to the renderer's web local frame, so the NotRestoredReasons API can provide source locations.

Before this CL,
- In the mojo struct `BackForwardCacheNotRestoredReasons`, BFCache blocking reasons were represented as a vector of string without source location.
- The message is sent to the renderer side as mojo `CommitNavigationParams`'s not_restored_reasons: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/navigation/navigation_params.mojom;l=595?q=CommitNavigationParams%20-f:out&ss=chromium%2Fchromium%2Fsrc

In this CL,
- The mojo struct has fields for source location, therefore `CommitNavigationParams`'s not_restored_reasons can now contain source location information.
- But, actual source locations are not sent yet.

In follow-up CLs,
- Actual source locations gathered in back_forward_cache_impl.cc will be sent to a web local frame in the renderer.
- The NotRestoredReasons API will provide source locations.


Change-Id: I0c63b19ea3076ffa5aeb734ad87388a285961a3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5250654
Commit-Queue: Kurumi Muto <mkurumi@google.com>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257775}
2024-02-08 04:17:32 +00:00
Kurumi Muto
863fd9a362 [bfcache] Make kUnloadHandler block BFCache when unload is deprecated
This CL is to make `kUnloadHandler`, a BFCache blocking reason, block BFCache if the feature flag `kDeprecateUnload` is enabled. We expect pages with unload handlers to be still blocked from BFCaching even when unload is deprecated.

Bug: 1513120
Change-Id: Iaa4024c1264c0251e87d5a510ec1f3d5862dbeeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5252619
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Kurumi Muto <mkurumi@google.com>
Reviewed-by: Mingyu Lei <leimy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1256696}
2024-02-06 11:51:32 +00:00
rubberyuzu
6211b1c826 [bfcache] Update NotRestoredReasons to match the spec draft
This CL updates NotRestoredReasons API's implementation to conform to the spec draft[1].
Namely, this CL
(1) removes "preventedBFCache" enum,
(2) adds "masked" to the outermost main frame when cross-origin iframes are blocking, and
(3) creates NotRestoredReasonDetails class on the blink side to make the reason into a struct like {"reason": "error-document"}.

As for (2), when `kAllowCrossOriginSubframes` flag is on, we add "masked" to the randomly selected cross-origin iframe.
Also with (2), `reasons` field is no longer specific to same-origin frames, so I'm moving the field out of `SameOriginDetails`.

We also need to add "masked" when UA internal reasons such as memory pressure block, and that's going to be addressed in a follow-up.

[1]: https://github.com/whatwg/html/pull/9360/files

Bug: 1472637

Change-Id: I89702696a128eea31b2dd2af0ef8c9874e7213ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5086563
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1249965}
2024-01-22 02:30:48 +00:00
murakinonoka
bb2a6c1446 Defer subframe navigations with url-loader in WillStartRequest.
Currently, we only allow the page to be cached if subframe navigations
don't need URL loaders and haven't reached the pending commit stage.
This CL enables the page with has subframe(s) with url-loader
navigation(s) which have not sent network requests if flag is enabled.
This is because after the navigation has sent a network request,
the response might fill the relevant buffer while deferring the
navigation.

Design Doc:https://docs.google.com/document/d/1XLOQuHjCVmBfXAJhgrASkVyrHAK_DGmcYPyrTnOrSPM/edit?usp=sharing&resourcekey=0-uNz75Ux7INdCLhj2FWVILg

Bug: 1511153
Change-Id: I0b5948209d82975e2de67ffe8ae3adfb830e9229
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5186123
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Ming-Ying Chung <mych@chromium.org>
Commit-Queue: Nonoka Muraki <murakinonoka@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1248603}
2024-01-18 05:49:05 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
murakinonoka
97a8f0469b BFCaching pages with subframe no-url loader navigations.
Currently, we don’t make a page enter BFCache when it has a subframe
with ongoing navigation. This CL enables the page with subframe no-url
loader navs which hasn't reached ReadyToCommit to enter BFcache if
kEnableBackForwardCacheForOngoingSubframeNavigation flag is enabled.
The subframe nav is deferred and then resumed when the page is
navigated back.

Bug: 1511153
Design Doc:https://docs.google.com/document/d/1XLOQuHjCVmBfXAJhgrASkVyrHAK_DGmcYPyrTnOrSPM/edit?usp=sharing&resourcekey=0-uNz75Ux7INdCLhj2FWVILg

Change-Id: I849e7799f01dd6f7a279c7932b82e240c6746926
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5105768
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Nonoka Muraki <murakinonoka@chromium.org>
Reviewed-by: Ming-Ying Chung <mych@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245162}
2024-01-10 09:17:07 +00:00
Kurumi Muto
b3137e8971 [bfcache] Make unload a blocklisted feature to capture location
This CL adds a new BFCache blocklisted reason "kUnloadHandler". The purpose of this is to use existing functions that capture the source location of blocklisted features for unload handlers. It does not affect the ongoing analysis of unload handler usage because it keeps the original reasons "kUnloadExistsInMain/SubFrame" as they are, and reports the new reason separately.

Bug: 1513120
Change-Id: I0e4b47ad0fb90cf2566640905a80215d86e05ae7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5134730
Reviewed-by: Yuzu Saijo <yuzus@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mingyu Lei <leimy@chromium.org>
Commit-Queue: Kurumi Muto <mkurumi@google.com>
Cr-Commit-Position: refs/heads/main@{#1244599}
2024-01-09 12:28:02 +00:00
Mustapha Jaber
53892cc518 Avoid destruction of WebContents object if it's notifying observers
We are experiencing an increase in crashes during the installation of
WebApps when the app redirects or changes its manifest URL after the
loading of web app information has begun. In such cases, we attempt to
abort the installation and destroy the web content object created for
installation, but this triggers a CHECK that ensures web content is not
destroyed while notifying its observers.

To address this issue, we're posting a task to destroy WebContents which will ensure that it happens after observers are notified.

Bug: 1510481
Change-Id: I94d7b2a07451c6c40b31088c69e5502000af71c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5109695
Commit-Queue: Mustapha Jaber <mustjab@microsoft.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243223}
2024-01-05 01:13:33 +00:00
Rakina Zata Amni
01721acd83 Disable flaky BackForwardCacheBrowserTest.SubframeTextInputStateUpdated on Android
Bug: 1494866
Change-Id: I199289bacbfab8b618e771d98026c3f7fe9e1621
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5089818
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1233518}
2023-12-05 19:38:31 +00:00
Rakina Zata Amni
f504f34b9e Update BackForwardCacheBrowserUnloadHandlerTest.UnloadHandlerPresent to expect BFCaching when unload is deprecated
We can now bfcache pages with unload handlers when unload is deprecated

Bug: 1488371
Change-Id: I838fd4e44e8645306c18f6ca08beb22f3e2a1839
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5051283
Reviewed-by: Fergal Daly <fergal@chromium.org>
Auto-Submit: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1228700}
2023-11-24 09:28:49 +00:00
Lei Zhang
c5f765d5b4 Remove remaining base/strings/string_piece_forward.h usage
Switch all includes of base/strings/string_piece_forward.h to use
string_piece.h instead, except in string_piece.h. This will make
reduce potential churn when deleting string_piece_forward.h.

Bug: 691162
Change-Id: Icd204f97f574e764b46ebfba32bce7b742a2cacd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5009848
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1221311}
2023-11-08 00:53:33 +00:00
Fergal Daly
19b9048956 Fix flakes in PagehideAndVisibilitychangeRuns.
Expose WaitForLocalStorage in the .h file and use it in this test.

Bug: 1494646
Change-Id: I9e33f3cc22929712c465a802c110be7c1521c4af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4988389
Auto-Submit: Fergal Daly <fergal@chromium.org>
Commit-Queue: Mingyu Lei <leimy@chromium.org>
Reviewed-by: Mingyu Lei <leimy@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1217409}
2023-10-31 06:04:35 +00:00
Fergal Daly
91e62883f3 Try to fix flakiness in PagehideRunsWhenPageIsHidden.
If the update is not visible in the new renderer, wait for it to arrive.

Bug: 1494646
Change-Id: I70001e2125c132d4a3de144712fbcd2fa0a672b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4988743
Reviewed-by: Mingyu Lei <leimy@chromium.org>
Auto-Submit: Fergal Daly <fergal@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1216821}
2023-10-30 08:26:42 +00:00
Rakina Zata Amni
4cab0828fb Update BFCache code & tests to expect same-site RFH swap
With RenderDocument, cross-document navigations will use new
RenderFrameHosts (and RenderViewHosts, RenderWidgetHosts, etc for
main frame navigations). This CL updates tests and code around BFCache
that didn't expect that, including the related active counts counting.

Bug: 936696
Change-Id: I42942a87ea40125454f1f0fc41fbedc4a8674fec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4810154
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1215451}
2023-10-26 12:28:24 +00:00