Removing reliance on EXECUTE_SCRIPT_USE_MANUAL_REPLY forces the
JavaScript to be written in terms of promises, which makes the code
less bug-prone since double-sends are systematically prevented (see
https://crrev.com/c/4318742 for an example bug that would have been
prevented by this).
There are still more usages, especially under content/browser/webrtc,
but those removals are not as mechanical and will be attempted in
followups.
Bug: 1423407, 1422660
Change-Id: Ib8f153da50f0bd3e2d09e00615973264dc3214d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4332196
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1122508}
This reapplies the rewrite_raw_ptr_fields rewriter on Android platform.
This change is a merge of the following changes:
PS10 CheckedPtr rewrite generated by
rewrite-multiple-platforms.sh android
on fb0bde7910
PS11 manual build fixes
PS12 unrewrite fields in ServiceProvider because they are initialized in a constexpr
PS13 Add .get() because raw_ptr<T>'s operator ->* has been removed due to a GCC compiler bug.
Bug: 1073933
Change-Id: I26458f381f2221a2bf7b378c6d519c3eef2c6afc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3692507
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Owners-Override: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1014807}
Files that only use base::Contains() and no other base/stl_util.h helper
can replace base/stl_util.h with base/containers/contains.h.
Use grep to find all the files that include base/stl_util.h. Then filter
out the ones that need base/stl_util.h by running "grep -L base::func"
where "func" is a function that base/stl_util.h provides. For the
remaining files, grep for ones that use base::Contains(), and do search
and replace for stl_util.h. Take the resulting CL and run clang format.
Bug: 970209
Change-Id: I2fb47d7c91d910a2d431ab178b398f9bfa0eb8c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2853072
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#877398}
This is just a convoluted way of writing nullptr, so rewrite it in the
simpler form. PRESUBMIT.py already disallows new instances of
std::unique_ptr<T>(). This removes existing instances.
Change-Id: Id2bbf661765d1ef149164d655c09a4ea6e2e476c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2824941
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#872501}
This change removes calls to base::UTF8ToUTF16 with a single-line string
literal not containing escape sequences and replaces them with a u"..."
literal instead.
This is a mechanical change:
$ git grep -lw UTF8ToUTF16 | \
xargs sed -i 's/\(base::\)\?UTF8ToUTF16(\("[^\\"]*"\))/u\2/g'
$ git cl format
AX-Relnotes: n/a.
Bug: 1189439
Change-Id: I6df2e531f62926a12be3f610ce8627d94ec407f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2776021
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865390}
The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with
is_chromeos_ash with some special cases (For those cases please
refer to http://go/lacros-macros).
The patch is made in preparation to switching lacros build from
target_os=linux to target_os=chromeos. This will prevent lacros from
changing behaviour after the switch.
Bug: 1052397
Change-Id: Ieb265e116ff6ada5e2f99d609ff12fb9f92727e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2534271
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829687}
Currently, ChromeOS defines the OS_LINUX directive as well as
OS_CHROMEOS. We're working to separate these two, so we're
making the fact that OS_LINUX == OS_LINUX || OS_CHROMEOS
explicit.
This is changes for /content/browser
This CL was uploaded by git cl split.
R=boliu@chromium.org
Bug: 1110266
Change-Id: I953a64f3145beb1840c3138680dc13c7e88b497b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2370295
Auto-Submit: Sean McAllister <smcallis@google.com>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800970}
This is a step towards doing full IWYU of browser_test.h, which will
have other benefits.
Completely mechanical and already R+ed as part of r765923.
Tbr: sky
Bug: none
Change-Id: Icb7ab728098a6cf29c0920da4b524e96a7c024c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186411
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766361}
Include this directly in relevant test files. This lets us convert the
HAS_OUT_OF_PROC_TEST_RUNNER checks in this file and
view_event_test_base.h into #errors, and force people to not even
include this file in files that can't use it.
Bug: none
Tbr: sky
Change-Id: I86626099eb047eb53e8b3611de38ba6bebc01a0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136117
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#765923}
This is hopefully the last step before finally adding
WARN_UNUSED_RESULT to NavigateToURL().
Apart from adding straightforward expectations for regular and redirect
cases, this fixes a couple more bugs:
- AppendingFrameInWebUIDoesNotCrash was broken on Android, because it
used chrome://tracing, which doesn't exist on Android.
- A couple of tests in WebContentsImplBrowserTest (e.g.,
ChangeDisplayMode) were navigating to about://blank (instead of
about:blank), which results in an error rather than a blank page.
Bug: 425335
Change-Id: Id80040de9c3383c517f2df95b819f314e6b29f30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819852
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699854}
This change re-enables the SnapshotBrowserTest.AsyncMultiWindowTest on Linux.
While adding an early exit for variants running Vulkan. We currently lack a way
to mark gtests as expecting to fail for certain flag variants.
This will enable us to maintain coverage on Linux, while we separately
investigate the root cause on Vulkan.
TBR=kbr@chromium.org, jam@chromium.org
TEST: SnapshotBrowserTest.AsyncMultiWindowTest
Bug: 1003176, 1003375
Change-Id: I290f812546a9d1d02dceea40966b29f616562fc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1801053
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696055}
This change replaces usages of base::ContainsKey() and base::ContainsValue()
with base::Contains() in //content.
Reproduction:
- sed -i 's/\bbase::ContainsKey\b/base::Contains/g'
- sed -i 's/\bbase::ContainsValue\b/base::Contains/g'
- git cl format
This CL was uploaded by git cl split.
R=falken@chromium.org
Bug: 970209
Change-Id: Icbe57df713f3b326c5729cad76348c425d59fb7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1648187
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667069}
This is a race between navigation and surfaces on their way to the
browser.
Here is the way that things work when the test passes:
1. Renderer process navigates
a. Renderer calls RenderFrameImpl::DidCommitNavigationInternal
- This will go more-or-less directly to the browser process
b. Renderer calls SubmitCompositorFrame with the current surface id
- This goes off to the viz process, and eventually will land
back in the browser
2. The browser process gets the message from [1.a.]
a. Comes in as RWHI::DidNavigate
b. Calls RWHV::DidNavigate
- This will skip allocating a new surface id, because this is the
first navigation
c. STARTS the NewContentRenderTimeout (at the end of
RHWI::DidNavigate)
3. The browser process gets notified of the frame sent in [1.b.]
a. Comes in as DelegatedFrameHost::OnFirstSurfaceActivation
b. STOPS the NewContentRenderTimeout (in
RHWI::DidReceiveFirstFrameAfterNavigation).
So we stop the timer, and so we don't evict our frame.
But notice how we're relying on [1.a.] arriving at the browser before
[1.b.], even though they take completely independent routes?
What ends up happening to us when we get a flake is:
1. Renderer process navigates
a. Renderer calls RenderFrameImpl::DidCommitNavigationInternal
b. Renderer calls SubmitCompositorFrame with the current surface id
2. The browser process gets notified of the frame sent in [1.b.]
a. Comes in as DelegatedFrameHost::OnFirstSurfaceActivation
b. In RHWI::DidReceiveFirstFrameAfterNavigation, we don't stop the
NewContentRenderTimeout, because we never started it.
3. The browser process gets the message from [1.a.]
a. Comes in as RWHI::DidNavigate
b. Calls RWHV::DidNavigate
- This will skip allocating a new surface id, because this is the
first navigation
c. STARTS the new NewContentRenderTimeout (at the end of
RHWI::DidNavigate)
We'll never hit OnFirstSurfaceActivation for this surface id again
(because we already hit it), and so the timeout will always fire.
The fix is to change RHWI::DidNavigate to only start the timer when
RWHV::DidNavigate changes the surface id. Two reasons:
- If we didn't change the surface id, it was because this was the
first navigation, and so we don't need to clear the frame.
- If we allocate a new surface id, then that will kick the renderer
to trigger OnFirstSurfaceActivation that will tell us to stop the
timer (and if we don't allocate a new id, we won't necessarily hit
OnFirstSurfaceActivation, and we won't stop the timer).
R=samans, kbr
TBR=piman (for content/ OWNERship)
Bug: 853651
Change-Id: I25a8fbf5f6b618b64d764546056fd342e8fc50f9
Reviewed-on: https://chromium-review.googlesource.com/1109448
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Saman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569513}
This changes how snapshot-requests via Page.captureScreenshot in
devtools are handled. Instead of notifying the browser directly from the
display-compositor, the renderer requests a presentation-time for the
new force-redraw frame. Upon receipt of the presentation time, renderer
notifies the browser, which can then capture the screenshot (either via
chrome, or directly from the underlying platform window).
This allows removing the snapshots from LatencyInfo, which was an odd
fit. This also enables the gpu and display-compositor code to be unaware
of snapshot-requests.
BUG=851504
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I16d8cb070ce883e95ac40ed5fd05ebaf3e96f0b1
Reviewed-on: https://chromium-review.googlesource.com/1095562
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567297}
This cuts down on many existing uses of RenderViewHost in tests. While
there are still uses of RVH that are difficult to migrate, these are
easy because every caller has a WebContents available (with one
exception where I just called GetMainFrame.)
Bug: none
Change-Id: If4a9a6642c2fee3726fc5b86e82ad71a9a9ae182
Reviewed-on: https://chromium-review.googlesource.com/1078941
Commit-Queue: David Benjamin <davidben@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565513}
In order to force all the windows to share the same renderer process,
the test calls window.open() from JavaScript, which doesn't have the
same synchronization guarantees as content_browser_test_utils'
NavigateToURL. Wait for the script to execute in each window before
proceeding with the test.
BUG=772379
Change-Id: Id5aff8aca03e22c65d06e5ed35c4aeff13997ac2
Reviewed-on: https://chromium-review.googlesource.com/714684
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508514}
This test used to cause failures and recently apparently got better but
now it's failing again. Redisabling it for Mac and reopening the bugs.
TBR=kbr@chromium.org
Bug: 774050, 771119
Change-Id: I3d581fa76f44d8fc1bdc0359892547c43f9d7221
Reviewed-on: https://chromium-review.googlesource.com/715898
Reviewed-by: Friedrich Horschig <fhorschig@chromium.org>
Commit-Queue: Friedrich Horschig <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508327}
This test is needed to prevent regressions in the handling of snapshot
requests as they propagate through Chrome's compositing pipeline.
These are currently transmitted in LatencyInfo, though there are
attempts underway to simplify them.
The new AsyncMultiWindowTest, in particular, catches a regression that
would otherwise have been introduced recently, and which is difficult
to provoke via the public DevTools API, due to the synchronous nature
of that API.
Bug: 753640
Change-Id: Ieacf1e4e9c48d70e716b34d5c9ed73bc04ac5a70
Reviewed-on: https://chromium-review.googlesource.com/636853
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505740}