0
Commit Graph

48 Commits

Author SHA1 Message Date
Chris Fredrickson
b854bbf9be Remove some usages of EXECUTE_SCRIPT_USE_MANUAL_REPLY under content/
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}
2023-03-27 17:27:44 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +00:00
Olga Sharonova
1f06be4004 Disable SnapshotBrowserTest.SyncMultiWindowTest on Win Release
Bug: 1376441
Change-Id: Id608c9999964f93fcdd44eb98ae50fab47a25702
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4031046
Owners-Override: Olga Sharonova <olka@google.com>
Reviewed-by: Fredrik Hernqvist <fhernqvist@google.com>
Auto-Submit: Olga Sharonova <olka@chromium.org>
Commit-Queue: Olga Sharonova <olka@chromium.org>
Commit-Queue: Fredrik Hernqvist <fhernqvist@google.com>
Cr-Commit-Position: refs/heads/main@{#1072189}
2022-11-16 14:03:01 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Yuki Shiino
0fde10ae31 sheriff: Disable SnapshotBrowserTest.SingleWindowTest
Bug: 1347296
Change-Id: I9211d29eaa4ea5043b7f1d99c142487f6889e632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3784699
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Takashi Sakamoto <tasak@google.com>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Auto-Submit: Yuki Shiino <yukishiino@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@google.com>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@google.com>
Owners-Override: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1028073}
2022-07-26 01:37:40 +00:00
Mike Wasserman
3b1ef88419 Sheriff: Disable flaky AsyncMultiWindowTest on more Linux configs
The test is observed to crash in the Vulkan backend.

Bug: 1164581
Change-Id: Icf10c384e1710371b353e8f4ce2f2388eb1f83b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3751871
Owners-Override: Mike Wasserman <msw@google.com>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Auto-Submit: Mike Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1021961}
2022-07-08 01:50:51 +00:00
Keishi Hattori
44d4f4e951 Rewrite more raw pointer fields to use raw_ptr<T>
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}
2022-06-16 06:01:20 +00:00
Fabrice de Gans
0cebf21b5d [fuchsia] Disable SnapshotBrowserTest.*syncMultiWindowTest
Bug: 1317446
Change-Id: Ice9709edd8d6c4e024bf529f18e56fcb1dc173a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3591640
Auto-Submit: Fabrice de Gans <fdegans@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#994097}
2022-04-20 08:50:15 +00:00
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Peter Kasting
eeda8cdf5a Fix some instances of -Wunused-but-set-variable: content/
Bug: 1203071
Change-Id: I09ca6541197bb99dc34b9d3937a41308841b87a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3055910
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#906004}
2021-07-28 01:35:49 +00:00
Lei Zhang
de1976728f Swap out base/stl_util.h for base/containers/contains.h.
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}
2021-04-29 08:11:24 +00:00
Avi Drissman
c91bd8ea79 Migrate to ExecJs/EvalJs in content/
Bug: 1157718
Change-Id: Ibb5bdb3f994630cc2b84f4e60adaf307fe646cb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2826401
Auto-Submit: Avi Drissman <avi@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874039}
2021-04-19 23:58:44 +00:00
Lei Zhang
df291f648f Do not return std::unique_ptr<T>() in content/.
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}
2021-04-14 17:23:44 +00:00
Jan Wilken Dörrie
2c470ea5c9 [LSC] Remove UTF8ToUTF16 from Literals without Escape Sequences
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}
2021-03-22 22:26:24 +00:00
Jan Wilken Dörrie
aace0cfef2 [LSC] Replace base::string16 with std::u16string in //{chrome*,content}
This change replaces base::string16 with std::u16string in //chrome,
//chromecast, //chromeos and //content.

Reproduction steps:
$ git grep -lw 'base::string16' chrome* content | \
      xargs sed -i 's/\bbase::string16\b/std::u16string/g'
$ git cl format

Bug: 1184339
Change-Id: I8fae0ab25b5d9bf1cb416ae5f47d7f680fb8f3ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752229
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#862152}
2021-03-11 22:01:58 +00:00
Yuta Hijikata
d0a8b6b606 LaCrOS: Replace defined(OS_CHROMEOS) with BUILDFLAG(IS_CHROMEOS_ASH)
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}
2020-11-20 16:36:15 +00:00
Sean McAllister
1a7c0a2e56 Refactor OS_LINUX preprocessor directive for LaCrOS effort.
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}
2020-08-24 12:40:17 +00:00
Sean McAllister
0d73ca3d80 Refactor OS_LINUX preprocessor directive for LaCrOS effort.
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.

Bug: 1110266
Change-Id: Iebbe654853bebeb4af49c9cb793dae5938416f3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351374
Commit-Queue: Sean McAllister <smcallis@google.com>
Reviewed-by: Drew Wilson <atwilson@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Mike Wittman <wittman@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799710}
2020-08-19 17:54:37 +00:00
Peter Kasting
919ce657e4 Add missing #includes of browser_test.h.
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}
2020-05-07 10:22:36 +00:00
Balazs Engedy
683d2c7a8f Revert "IWYU for browser_test.h."
This reverts commit 66a53c909a.

Reason for revert: Breaks compile on official branded builders.

Original change's description:
> IWYU for browser_test.h.
> 
> 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}

TBR=sky@chromium.org,pkasting@chromium.org,thestig@chromium.org

Change-Id: I4583916602404c310a93f571dd2c78645c6bd567
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2184132
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#765931}
2020-05-06 10:36:40 +00:00
Peter Kasting
66a53c909a IWYU for browser_test.h.
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}
2020-05-06 09:38:56 +00:00
danakj
f416ce9d3b Convert content/browser/ Callbacks to {Once,Repeating}Callback
Use OnceCallback where possible because the callback is only used once
and RepeatingCallback and BindRepeating otherwise.

R=avi@chromium.org

Bug: 1007760
Change-Id: I3d02fded4b40cdc843ac89e057a34bdf3766b1bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962545
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723954}
2019-12-11 20:45:45 +00:00
Alex Moshchuk
aeb20fe347 Fix remaining NavigateToURL expectations in content_browsertests.
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}
2019-09-25 17:40:01 +00:00
jonross
d0328d17bc Re-enable SnapshotBrowserTest.AsyncMultiWindowTest on Vulkan
We originally disabled this test on Vulkan due to failures on
Intel. However it seems to have been fixed since. Patchset 3 ran
the test 100 times without failures.

Let's try to re-enable it.

Originally disabled here:
https://chromium-review.googlesource.com/c/chromium/src/+/1801053

TBR=jam@chromium.org
TEST=SnapshotBrowserTest.AsyncMultiWindowTest

Bug: 1003375
Change-Id: I74d9002a42de8e1b638d52efa97a2ec9915ab6fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808594
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697392}
2019-09-17 22:52:12 +00:00
Zhenyao Mo
00f9b6a3c2 Disable SnapshotBrowserTest.{A}SyncMultiWindowTest on Linux ASAN
This is replaced by disbaling them on Linux in:
https://chromium-review.googlesource.com/c/chromium/src/+/1798984

Disabling on Linux is reverted in:
https://chromium-review.googlesource.com/c/chromium/src/+/1801053

However, we still need to add back Linux ASAN

BUG=771119,1003176
TEST=bots
TBR=kbr@chromium.org

Change-Id: I89383f22def3ac234acec68dd046c7d5b148cac7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1801919
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696141}
2019-09-12 19:56:47 +00:00
jonross
e3516fffda Re-enable SnapshotBrowserTest.AsyncMultiWindowTest on Linux
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}
2019-09-12 16:16:07 +00:00
Zhenyao Mo
1f985ddf3d Mark SnapshotBrowserTest.AsyncMultiWindowTest as fail on Linux
BUG=771119
TEST=bot
TBR=sky@chromium.org,kbr@chromium.org

Change-Id: Ie94c3b8cae2359a934cabfdf34139e76471f9367
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1798984
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695721}
2019-09-11 18:56:07 +00:00
Jan Wilken Dörrie
531be7ca19 [base] Replace Contains{Key,Value} with Contains in //content
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}
2019-06-07 10:05:57 +00:00
Sebastien Marchand
f8cbfab434 Include base/bind.h in the files that use it (in //content).
Gab, I've used your refactoring script for this, the rule is:
  matches = re.compile(r'(\n *[^/\n][^/\n]*base::Bind(Once|Repeating)?\b[^*])', re.DOTALL).findall(content)

  if not matches:
    return False

  updated_content = refactor_lib.AddInclude(file_path, content, "base/bind.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

TBR=gab@chromium.org

Change-Id: I6cca9dff7fa4937fd7accdc57fe774674f6c147b
Reviewed-on: https://chromium-review.googlesource.com/c/1437100
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626088}
2019-01-25 16:02:30 +00:00
Zhuoyu Qian
39a909a567 Use ContainsValue() instead of std::find() in content/
BUG=561800

Change-Id: Ia074881a22e83873ff26249ea056ad9c6365fe14
Reviewed-on: https://chromium-review.googlesource.com/c/1248141
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Cr-Commit-Position: refs/heads/master@{#599838}
2018-10-16 03:48:52 +00:00
Ella Ge
fbe452d8e1 Reland "Disable SnapshotBrowserTest.SyncMultiWindowTest on ChromeOS"
This reverts commit b90477746d.

Reason for revert: fix parentheses

Original change's description:
> Revert "Disable SnapshotBrowserTest.SyncMultiWindowTest on ChromeOS"
>
> This reverts commit 443298d812.
>
> Reason for revert: compile error
>
> Original change's description:
> > Disable SnapshotBrowserTest.SyncMultiWindowTest on ChromeOS
> >
> > TBR=ccameron@chromium.org
> > NOTRY=true
> >
> > Bug: 860337
> > Change-Id: I35e3bd87fa5551f21129b29de7aca56929ad07ad
> > Reviewed-on: https://chromium-review.googlesource.com/1126489
> > Reviewed-by: Ella Ge <eirage@chromium.org>
> > Commit-Queue: Ella Ge <eirage@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#572658}
>
> TBR=ccameron@chromium.org,eirage@chromium.org
>
> Change-Id: I3ba4b15f4de9d2b594ac018598c392414c6403ec
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 860337
> Reviewed-on: https://chromium-review.googlesource.com/1126289
> Reviewed-by: Ella Ge <eirage@chromium.org>
> Commit-Queue: Ella Ge <eirage@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#572659}

TBR=ccameron@chromium.org

Change-Id: I999efe9a736c87771477d5213a92d46a7e7cf9ab
No-Try: true
Bug: 860337
Reviewed-on: https://chromium-review.googlesource.com/1126290
Commit-Queue: Ella Ge <eirage@chromium.org>
Reviewed-by: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572661}
2018-07-04 21:50:06 +00:00
Ella Ge
b90477746d Revert "Disable SnapshotBrowserTest.SyncMultiWindowTest on ChromeOS"
This reverts commit 443298d812.

Reason for revert: compile error

Original change's description:
> Disable SnapshotBrowserTest.SyncMultiWindowTest on ChromeOS
> 
> TBR=ccameron@chromium.org
> NOTRY=true
> 
> Bug: 860337
> Change-Id: I35e3bd87fa5551f21129b29de7aca56929ad07ad
> Reviewed-on: https://chromium-review.googlesource.com/1126489
> Reviewed-by: Ella Ge <eirage@chromium.org>
> Commit-Queue: Ella Ge <eirage@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#572658}

TBR=ccameron@chromium.org,eirage@chromium.org

Change-Id: I3ba4b15f4de9d2b594ac018598c392414c6403ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 860337
Reviewed-on: https://chromium-review.googlesource.com/1126289
Reviewed-by: Ella Ge <eirage@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572659}
2018-07-04 21:43:16 +00:00
Ella Ge
443298d812 Disable SnapshotBrowserTest.SyncMultiWindowTest on ChromeOS
TBR=ccameron@chromium.org
NOTRY=true

Bug: 860337
Change-Id: I35e3bd87fa5551f21129b29de7aca56929ad07ad
Reviewed-on: https://chromium-review.googlesource.com/1126489
Reviewed-by: Ella Ge <eirage@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572658}
2018-07-04 21:35:32 +00:00
Christopher Cameron
8af34d702f Fix flakey SnapshotBrowserTest.SyncMultiWindowTest on Mac
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}
2018-06-22 02:35:29 +00:00
Marc Treib
7d7cea31e2 Disable flaky SnapshotBrowserTest.SyncMultiWindowTest on Mac
TBR=kbr@chromium.org
NOTRY=true

Bug: 853651
Change-Id: If04328135ede460ae8957e2e135c96ae691ae221
Reviewed-on: https://chromium-review.googlesource.com/1104165
Commit-Queue: Marc Treib <treib@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567964}
2018-06-18 10:05:47 +00:00
Sadrul Habib Chowdhury
fd767ebe78 latency: Remove snapshots from LatencyInfo.
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}
2018-06-14 16:27:48 +00:00
David Benjamin
5a792651a0 Remove the RenderViewHost branch of ToRenderFrameHost and migrate callers.
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}
2018-06-08 02:15:42 +00:00
Gabriel Charette
b164afef80 Fix IWYU for MessageLoop and RunLoop once again.
Round 3 of https: //chromium-review.googlesource.com/c/chromium/src/+/638550
Round 2 was: https://chromium-review.googlesource.com/667938

TBR=fdoray@chromium.org

Bug: Missing includes prevents header cleanup in
https://chromium-review.googlesource.com/c/chromium/src/+/638550

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win10_chromium_x64_rel_ng;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I99f2d37cf342f2ed38d167b9dcc3c57173b2f9a2
Reviewed-on: https://chromium-review.googlesource.com/782663
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518388}
2017-11-21 20:59:31 +00:00
Kenneth Russell
e11aae0c30 Disable multi-window tests on a couple of sanitizer configurations.
They seem to be too slow in these modes.

BUG=771119
TBR=skym@chromium.org

Change-Id: Ifd728033147204c48dd395ee48e4b5d418715984
Reviewed-on: https://chromium-review.googlesource.com/752047
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Sky Malice <skym@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513620}
2017-11-02 23:08:43 +00:00
Kenneth Russell
1c2dc2af94 Disable multi-window SnapshotBrowserTests on Win Debug.
They're timing out without reporting any errors. Let's see if they're
reliable on the other Debug bots.

BUG=771119
TBR=jonross@chromium.org, sky@chromium.org

Change-Id: I8c5c53bd6c1d94ff936f51b92ed89331a53d9846
Reviewed-on: https://chromium-review.googlesource.com/731365
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510589}
2017-10-20 22:37:18 +00:00
Kenneth Russell
064a1f3a59 Re-enable SnapshotBrowserTest.SyncMultiWindowTest.
The fix that just landed in Issue 772379 should make this test
reliable everywhere.

BUG=771119, 772379
TBR=fhorschig@chromium.org

Change-Id: I6a6a17f98e4b4c33d3bafa81253fc0cf46591657
Reviewed-on: https://chromium-review.googlesource.com/717698
Reviewed-by: Friedrich Horschig <fhorschig@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508755}
2017-10-13 18:10:53 +00:00
Kenneth Russell
745308be7b Wait for subordinate windows to be ready in SnapshotBrowserTest.
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}
2017-10-12 22:51:46 +00:00
Friedrich Horschig
2cba1253ea Redisable flaky SnapshotBrowserTest.SyncMultiWindowTest for Mac
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}
2017-10-12 13:10:40 +00:00
W. James MacLean
8e969b88c3 Disable AsyncMultiWindowTest.
This test is also timing out on non-debug bots.

Bug: 772379
Change-Id: I9bc0fff04a9629037dec631b09279c2b01f9cc4e

TBR=boliu@chromium.org,kbr@chromium.org

Change-Id: I9bc0fff04a9629037dec631b09279c2b01f9cc4e
Reviewed-on: https://chromium-review.googlesource.com/704057
Reviewed-by: James MacLean <wjmaclean@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507058}
2017-10-06 14:25:34 +00:00
Kenneth Russell
91495e7e47 Re-enable disabled SnapshotBrowserTests on Release bots.
BUG=771119
TBR=kjellander@chromium.org, huangs@chromium.org, jam@chromium.org

Change-Id: I91b75ed96e1d62a1dbc7d0220b5c2109ed5e1163
Reviewed-on: https://chromium-review.googlesource.com/698884
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506166}
2017-10-03 20:53:41 +00:00
Samuel Huang
73d124de26 Disable SnapshotBorwserTest.{Async,Sync}MultiWindowTest.
These tests are flaky on Mac10.9 Tests (dbg) and Win7 Tests (dbg).
Disabling on all platforms.

BUG=771119
TBR=kbr@chromium.org

Change-Id: I233128d186e8ac26656aa3669cb9f15688db0fdb
Reviewed-on: https://chromium-review.googlesource.com/698484
Reviewed-by: Samuel Huang <huangs@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506122}
2017-10-03 18:46:26 +00:00
Henrik Kjellander
f8e16ceabb Disable SnapshotBrowserTest.{Async,Sync}MultiWindowTest on Mac.
These tests are flaky on Mac10.9 Tests (dbg)

BUG=771119
TBR=kbr@chromium.org

Change-Id: I9f0cf8eb5e55232261615aafccbf9b15663ea132
Reviewed-on: https://chromium-review.googlesource.com/697305
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Commit-Queue: Henrik Kjellander <kjellander@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506006}
2017-10-03 11:32:02 +00:00
Kenneth Russell
05091caf53 Browser test verifying snapshots are properly synchronized.
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}
2017-10-02 19:52:47 +00:00