0
Commit Graph

325 Commits

Author SHA1 Message Date
2bb13b67d2 Fix some out of order base/memory/raw_ptr.h includes.
The automated raw_ptr rewrite in https://crrev.com/945735 occasionally
put base/memory/raw_ptr.h in the wrong spot. Fix some instances of this.

Change-Id: I2de43ce12fb1983e6e2422b79059566c53774934
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3413717
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Owners-Override: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#963295}
2022-01-26 00:11:58 +00:00
a2686b594a Remove unneeded includes from mojo's serialization_util.h.
Then do IWYU to fix the build for files that use std::queue, but did not
include <queue>.

Bug: 242216
Change-Id: I01fe13e9ba7f4b7bd31d4394b7ada0ffd3fbd865
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3373925
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#963102}
2022-01-25 18:48:26 +00:00
ca83d4877f Use SwANGLE for WebGL on all platforms
This CL removes legacy SwiftShader from the
SetSoftwareWebGLCommandLineSwitches function
and uses SwANGLE for WebGL on all platforms.

Bug: chromium:1060139
Change-Id: Ie1ad81e6d648026f4143c09a103cdbd0d628fb48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3408178
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: danakj chromium <danakj@chromium.org>
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#963033}
2022-01-25 16:52:37 +00:00
053d474806 [web_tests] Relocate server port 8083 => 8093 due to collisions.
WPT server port 8083 conflicts with the default port used by Fuchsia's
system update service.

The port is changed to 8093, which has no known conflicts and
works well for web_tests.

Bug: 1280263
Change-Id: If1aaff3b43675705ca57eacde717cb4de07d5d83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3345623
Auto-Submit: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#962162}
2022-01-22 00:09:06 +00:00
f1aa4e0d19 cc: Ensure correct render surface dependency tracking for transitions.
During a transition, each shared element induces a render surface to
generate its content as an image. This image is then drawn using a
pseudo element which can be animated for the duration of the transition.
This pseudo element is drawn using a cc::DocumentTransitionContentLayer
tagged with the same SharedElementResourceId that the shared element's
render surface is tagged with.

Since the shared element's render surface output is drawn where the
DocumentTransitionContentLayer quad draws (instead of its actual
render target), this results in incorrect render surface dependency
tracking.

This change fixes this by updating the shared element's target render
surface to the render target of its corresponding
DocumentTransitionContentLayer (or to the layer itself if it has a
render surface).

This ensures that render passes are created in correct dependency order.

R=vasilyt@chromium.org, kylechar@chromium.org

Bug: 1277772
Change-Id: I9972eff032cbf9d76a1f8c2770a0937322de8907
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3396605
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961631}
2022-01-20 21:56:41 +00:00
5e27657b77 Privacy Sandbox Settings: Update FLEDGE Content Browser client functions
Connects the ChromeContentBrowserClient implementation of
IsInterestGroupAPIAllowed to the recently added access control function
for joining an interest group.

To support distinguishing joins from other interest group operations,
an InterestGroupApiOperation is added, and to better clarify the
contents, usage of GURL for the auction party is changed to Origin.

Additionally, to allow the PageSpecificContentSettings to be informed
of attempts to join interest groups, the interface is adjusted to
take the RenderFrameHost instead of the BrowserContext.

Stubs for PageSpecificContentSettings functionality are included, these
will be included in a follow up.

Bug: 1286276
Change-Id: If02aefa75e8cf80940b18bd122418c36bdb65665
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3398639
Reviewed-by: Russ Hamilton <behamilton@google.com>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Theodore Olsauskas-Warren <sauski@google.com>
Cr-Commit-Position: refs/heads/main@{#961098}
2022-01-19 20:09:13 +00:00
4b68d634a3 content/web_test: 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: I457447ccc57b2743595044276f5293161f979cf0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3391498
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@{#959614}
2022-01-15 17:26:01 +00:00
b9711b579a Implement Subresource Filter for WebTransport
This change needs adding GetLoadPolicyForWebTransportConnect to
WebDocumentSubresourceFilter as well as WebSocket.

Bug: 1244432
Change-Id: I4e344bd82258bbcccbfc91e10aa3e3287a5212f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3302999
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/main@{#958999}
2022-01-14 02:32:20 +00:00
aa7669591c Don't finish a web test twice when window.close() is called.
If window.close() is called by a web test right *after* it has
completed, don't call OnTestFinished twice.  Doing so leads to an extra
result being reported, and thus future web tests being matched to the
wrong expectations.

Fixed: 1283172
Change-Id: I8a3fd7eff9b553786ce1241e1d82875a1bdf9ddd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3383610
Auto-Submit: David Baron <dbaron@chromium.org>
Reviewed-by: danakj chromium <danakj@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#958865}
2022-01-13 22:16:00 +00:00
5d5d48d6be Use std::ignore rather than ignore_result in content/
Bug: 1285085
Change-Id: Ibaf186980d86cb86769bf1c64faf0ba979da5ee9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3370429
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#956643}
2022-01-07 20:23:58 +00:00
8a554ab51f Correct inconsistency in iterating RenderFrameHosts in web_tests.
When the layout dumps were stitched together we would use
web_contents()->GetMainFrame()->ForEachRenderFrameHost() but when
requesting dumps we would use web_contents()->ForEachRenderFrameHost().

Since back/forward cache can share the FrameTreeNode ids it is possible
that we'd iterate RenderFrameHosts in the back/forward cache and those
would get already handled causing the DCHECK.

There are two ways to fix this 1) Actually use a GlobalFrameRoutingID
which uniquely maps to a RenderFrameHost 2) Fix the inconsistency
which seems more correct. WebTest currently doesn't require dumps from
prerender or bfcached pages so it is more appropriate to iterate only
the active page.

BUG=1267581

Change-Id: I9c6fa2ef612e3a85c3a569359418897cb36677be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3345138
Reviewed-by: danakj chromium <danakj@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#952487}
2021-12-16 20:14:15 +00:00
1109e2852c [v8][api] Update users of v8::Object::CreationContext
v8::Object::CreationContext is deprecated, replace users with one of
the two following alternatives:

- MaybeLocal<Context> v8::Object::GetCreationContext()
- Local<Context> v8::Object::GetCreationContextChecked()

Bug: v8:11165
Change-Id: I1ebfc6948dc0c1d289d31d07fca7d940b2fa9073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3275976
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#951508}
2021-12-14 15:53:13 +00:00
809ea1a799 Use SwANGLE for Web Tests on MacOS
Bug: chromium:1060139
Change-Id: Ic6eaa423a1dffebc71064f467d76029fbd1f0ae9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3310778
Reviewed-by: danakj chromium <danakj@chromium.org>
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#950703}
2021-12-10 23:50:33 +00:00
c8da65866b Fix use-after-free in testRunner
The frame is destroyed when the invalid_ flag is set. Add missing checks
for invalid_ before access to frame_.

Bug: 1276715
Change-Id: Ic5176ce436a0ad0a6afb1cacb841dd48c9da3fc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3327223
Reviewed-by: danakj chromium <danakj@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#950070}
2021-12-09 15:13:00 +00:00
9f9ed356f1 CodeHealth: Replace DictionaryValue::Clear() with DictClear() [1/N]
DictionaryValue::Clear() is deprecated. So this CL changes the
call sites to use Value::DictClear().

Bug: 1187021
Change-Id: I6ff1bc51daea09ec670989fb07e2ff6b35696183
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3308487
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#949241}
2021-12-07 23:30:08 +00:00
0e004cbe4c Clean up includes in content/public/common/child_process_host.h.
Remove unnecessary includes and replace them with missing includes if
necessary. Fix the build by adding missing includes in various files
that depended on child_process_host.h's includes.

Also uninline ~ChildProcessHost().

Bug: 242216
Change-Id: I387ac9782910af2eedeed82de5355707dd63de48
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3309695
Reviewed-by: Alexander Timin <altimin@chromium.org>
Owners-Override: Alexander Timin <altimin@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#947045}
2021-12-01 16:43:34 +00:00
0306cbaff6 Remove unneeded base/compiler_specific.h includes in //content and //ui.
Bug: 242216
Change-Id: Id89d638f8859731d00ab17b760f93dd77a2df7a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3292226
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946514}
2021-11-30 17:32:28 +00:00
f086479789 Code health: port away from deprecated ListValue::GetString
This is a portion for /content/web_test/browser.
(And in some cases also adjust away from other deprecated Value APIs,
 when convenient/nearby)

This CL was uploaded by git cl split.

R=mkwst@chromium.org

Bug: 1187090
Change-Id: I7d842e43bc99cd584dfdc083673c9d6ec145ad5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3306903
Auto-Submit: Maksim Orlovich <morlovich@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946369}
2021-11-30 09:09:45 +00:00
afd3c658f9 Create initial NavigationEntry on FrameTree initialization
Introduces the initial NavigationEntry, created on FrameTree
initialization, which is not associated with any navigation. It will
be replaced or lose its initial-ness when the first navigation in the
main frame committed. With the initial NavigationEntry, we can always
guarantee that a NavigationEntry always exists, even when no navigation
has committed. This has many benefits, as outlined in the doc:
https://docs.google.com/document/d/1H81oAG13f21fUf-IGHH8AnjNVJFtaThowl5Ki9hWw5E/edit#heading=h.sbcge7snrbj3

This CL introduces a few changes of behavior:
- After initialization, a FrameTree/NavigationController will always
  have a NavigationEntry. This will be reflected in content/public
  functions such as GetLastCommittedEntry(), GetVisibleEntry(),
  GetActiveEntry(), GetEntryCount(), GetLastCommittedEntryIndex(),
  GetCurrentEntryIndex()
- Navigations that are previously ignored because there is no committed
  entry to attach to or clone are now no longer ignored, except for the
  synchronous about:blank commit for window.open().

What this CL does not change:
- This CL does not change the behavior of any navigation that wasn't
  previously ignored, including initial empty document replacements.
- Web-platform-exposed behaviors, including history.length which will
  still start at 0 instead of 1 on a tab that hasn't navigated at all.
- Behavior of WebView APIs. WebBackForwardList, which exposes the
  whole session history list, remove initial NavigationEntry.
  getOriginalURL() will continue to return null when there's no
  committed navigation.
- Similarly, behavior of WebLayer APIs will not change. The values
  returned by APIs such as GetNavigationListCurrentIndex() and
  GetNavigationListSize() will continue to be what they were before (-1
  and 0 respectively) even when the initial NavigationEntry exists,
  preserving their previous behaviors.

This CL corresponds to Step 1 of the implementation plan in this doc:
https://docs.google.com/document/d/1H81oAG13f21fUf-IGHH8AnjNVJFtaThowl5Ki9hWw5E/edit#heading=h.8n643ug2wk11

This CL also applies all the changes detailed in the audit doc, except
for most of the "remove nullcheck" changes:
https://docs.google.com/spreadsheets/d/1MJyLNd6T5b7QWCO-qsSdnzmyLhubCddns1Uu9X8mEIk/edit#gid=0

Bug: 524208, 1215096
Change-Id: I9dbc17feeb451ae32954a8544cc32bb39ec37150
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3237491
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Owners-Override: Charlie Reis <creis@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946343}
2021-11-30 06:19:17 +00:00
0e45c020c4 Rewrite most Foo* field_ pointer fields to raw_ptr<Foo> field_.
DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA)/sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial.

This commit was generated automatically, by running the following script: tools/clang/rewrite_raw_ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e

For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_ptr documentation in //base/memory/raw_ptr.md.

FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this.

[1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sharing
[2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ

Binary-Size: Increase of around 500kb was approved for MiraclePtr
Include-Ci-Only-Tests: true
No-Tree-Checks: true
No-Presubmit: true
Bug: 1272324, 1073933
Change-Id: I05c86a83bbb4b3f4b017f361dd7f4e7437697f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3305132
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#945735}
2021-11-27 09:25:52 +00:00
b65361a401 Replace call to v8::Isolate::GetEmbedderHeapTracer
Requires crrev.com/c/3293413

Bug: v8:12407
Change-Id: Ie6076c20448834befdc93fd460887f3456fb57ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3289127
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944254}
2021-11-22 21:46:49 +00:00
71fe2db597 Clean up WebScriptSource constructors
- Remove a constructor with start_line that is never used
- Make a 1-argument constructor explicit

This CL doesn't change the behavior.

Bug: 1111134
Change-Id: Idbb4ae8437ce542dc1a73c1990dfbcc7826f5208
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3261873
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942466}
2021-11-17 05:11:10 +00:00
efed826aae appcache: Remove WebPreference/WebSetting
Bug: 582750
Change-Id: I3fae048c7e787ea1941510ede113ddd26d9bb59e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3279737
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Auto-Submit: enne <enne@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942300}
2021-11-16 23:09:07 +00:00
cd0c08cc4d MPArch: Deny PermissionRequests from fenced frames
Currently CHECK_EQ() at permission_request_manager.cc line 196 fails
when the permission is requested from a fenced frame. This is because
IsInactiveAndDisallowActivation() returns false for fenced frames.

This CL fix this by checking IsNestedWithinFencedFrame() in
PermissionContextBase::GetPermissionStatus().

Bug: 1190825, 1259837
Change-Id: Ieed75c6939d861da2f6fd2396fdbab7a43eb37a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3220941
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Ravjit Singh Uppal <ravjit@chromium.org>
Reviewed-by: Adithya Srinivasan <adithyas@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942118}
2021-11-16 14:01:44 +00:00
b1973a98d6 Use gfx::Point[F] for scroll offsets (out of blink renderer)
As discussed in https://bit.ly/3qtrn9s we want to use gfx::PointF for
scroll offset (out of blink renderer) and gfx::Vector2dF for scroll
delta, instead of gfx::Vector2dF for both, for the following purposes:

1. To make it easier to do the correct thing: passing blink scroll
   position (currently using FloatPoint, will be changed to gfx::PointF)
   to out-of-blink scroll offset (and vice versa); and to make it
   difficult to do the incorrect thing: passing blink scroll offset [1]
   to out-of-blink scroll offset. Without this CL, the incorrect thing
   would be easier to do than the correct thing because of the data
   type mismatches.

2. We can better distinguish scroll offset and scroll delta with
   different data types.

3. Make it consistent to use gfx::Point[F] for absolute scroll offsets
   throughout Chromium.

[1] See third_party/blink/core/layout/README.md for detailed explanation
    for of scroll position and scroll offset in blink renderer.

Bug: 738465
Change-Id: Ic9ac9658b8f3154514608ef4039780d0f20883bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3267944
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Owners-Override: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941498}
2021-11-14 16:12:06 +00:00
2e6be1400a Rename "base/macros.h" => "base/ignore_result.h"
This file only contains ignore_result() and is no longer a collection of
macros.

This change fixes a couple of missing IWYU removals as well.

Bug: 1010217
No-Try: true
Change-Id: Iaad1aaa48343e86b0429898bd55e4f0c56222852
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3279210
Commit-Queue: Peter Boström <pbos@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/main@{#941411}
2021-11-13 01:28:25 +00:00
1d6a095400 Remove unused "base/macros.h" in content/
Removes `#include "base/macros.h"` from files in content/ that do not
contain `ignore_result(`.

Bug: 1010217
No-Try: true
Change-Id: I887403408704241047e3bd66e953ff7df195368b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3274993
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940781}
2021-11-11 16:07:03 +00:00
fbeeb1c228 [content] Make ContentMainParams and MainFunctionParams move-only
This is taking care of a long-standing TODO to move these OnceClosure
holders rather than copy them around with their OnceClosure* members.

This is a precursor to
https://chromium-review.googlesource.com/c/chromium/src/+/3187153/35#message-fcc92e9f85e73f0e5ba6c03610a95cda8736f1f9
which highlighted a problem where some tests see a non-null
MainFunctionParams::ui_task but running the closure results in a UAF.
Logs show that the test hitting the UAF is not the one setting this
field. This CL makes that impossible and fixes the issue in the
follow-up CL.

This CL is intended to be a logical no-op.
This CL touches a lot of files and must happen all at once.

The core change is that ContentMainParams and MainFunctionParams's
moveable fields (ui_task, created_main_parts_closure, and startup_data)
are now held by moveable types rather than raw pointers.

This trickles in the following chain:
main() (in various *_main.cc)
(or SetUp() in !OS_ANDROID browser_test_base.cc)
  -> ContentMain()
    -> ContentMainRunnerImpl::Initialize()
      (forwards arg into MainFunctionParams)
      -> RunBrowser()
        -> BrowserMain()
          -> BrowserMainRunnerImpl::Initialize()
            -> BrowserMainLoop (stores MainFunctionParams)
            -> BrowserMainLoop::Init
              -> ContentBrowserClient::CreateBrowserMainParts()
                -> (Embedder)ContentBrowserClient::CreateBrowserMainParts()
                  -> (Embedder)BrowserMainParts(Platform)
                    -> (Embedder)BrowserMainParts
      -> RunOtherNamedProcessTypeMain()
        -> (Embedder)ContentMainDelegate::RunProcess()
        (or)
        -> FooMain() (kMainFunctions)
        (or)
        -> RunZygote()
          (creates its own MainFunctionParams)
          -> (Embedder)ContentMainDelegate::RunProcess()
(on OS_ANDROID, browser_test_base.cc calls directly into
 ContentMainDelegate::RunProcess())

Few of these needed the params after passing them down so a move-only
model was simple to adapt (even if invasive). The few exceptions like
BrowserMainRunnerImpl::Initialize consuming |created_main_parts_closure|
are better off in the new model (where they take the OnceClosure before
passing down the params) because that prevents others down the chain
from having access to a OnceClosure they shouldn't invoke anyways.

Noteworthy:
 - ContentMainDelegate::RunProcess():
   Returned an exit_code >= 0 to indicate the embedder elected to handle
   the run request given these params. With move-only semantics it is
   necessary to return the params back when the embedder declines
   handling this run request. An absl::variant return value is used
   to satisfy this requirement.

- content/public/test/test_launcher.h : GetContentMainParams():
  Becomes CopyContentMainParams() and only exposes a copy of copyable
  params. Uses new ContentMainParams::ShallowCopyForTesting() which
  verifies that moveable fields are still null by that time as should be
  the case in the order browser tests are initialized.

- MainFunctionParams::command_line being const& violated the style-guide
  rule to "avoid defining functions that require a const reference
  parameter to outlive the call". This also prevented moving. The type
  was hence switched to a const CommandLine*.

- BUILD.gn changes for nacl_helper_win_64 which requires static linking
  of its minimal //content deps (was previously missing a dep but was
  getting away with it because MainFunctionParams was .h only; required
  now with .cc). This was already done for static_switches and this CL
  adds static_main_function_params, reusing a similar static_features
  target that already existed but was no longer required in
  /c/nacl/broker, cleaning that up by replacing rather than copying that
  target's definition in this CL.

- ContentMainParams::minimal_browser_mode was weirdly passed as a
  parameter to ContentMainRunner::Run(bool start_minimal_browser) but
  that method also has access to the ContentMainParams originally passed
  via ContentMainRunner::Init(). Passing the param again from Run()
  would be a use-after-move in content_main.cc, instead
  content_main_runner_impl.cc was updated to use the param it already
  has in store.

Bug: 1175074
Change-Id: I3af90505525e426383c59107a3903d645d455682
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244976
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Owners-Override: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940478}
2021-11-10 20:50:06 +00:00
3a3f943614 Add #include "base/macros.h" for ignore_result()
This fixes IWYU for existing instances of ignore_result() to make
removal of #include "base/macros.h" from files using it for DISALLOW_*
macros easier.

Bug: 1010217
Change-Id: If20eb9d217830bc70b27e433334994ebaf7113e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3268446
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#939514}
2021-11-08 21:04:37 +00:00
2ac2c31fcb ozone: //content: clean up from USE_X11
This is another CL that removes USE_X11 define and
gn arg usage from //content and also removes
IsUsingOzonePlatform condition as it's no longer
needed as it always resolves to true.

Bug: 1096425
Change-Id: Ibbf2e861b46ffd8156dfe6fd5c6df75c54b83ba9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198073
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/main@{#937765}
2021-11-03 08:00:12 +00:00
9039359eba Remove all line numbers from test console output
These line numbers are sometimes included and sometimes not,
and they are "test only" output. So to avoid tests that flaky-
fail for no reason related to the test, this CL removes line
numbers completely.

While this CL is quite large, the only material changes are to
these two files:

content/web_test/renderer/web_frame_test_proxy.cc
 - Remove line numbers
third_party/blink/web_tests/TestExpectations
 - Remove many now-passing, non-flaky tests.

The remainder of the files are rebaselines that remove the
string "line Xyz: " from expectations output. I verified both
automatically and by manual inspection that these are the only
changes in expectations. Of course, it'd be great if reviewers
double-spot-checked this.

For posterity (and FYI), I used this filter to look for expectations
changes that are unrelated to the console line numbers:

  git diff HEAD^ -U0 --diff-filter=d | grep '^[+-]' | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -v "CONSOLE"

The only thing it returns are the two files mentioned above.

Fixed: 896194
Change-Id: Idc318795c56dd78d2eb8575897a144ba4bc0de63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3246152
Commit-Queue: Mason Freed <masonf@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/main@{#937717}
2021-11-03 05:36:25 +00:00
bf2505247a Change name on variable on content/public API.
In https://crrev.com/e352b6b the boolean provided was changed to be
the primary main frame however the name wasn't updated.

Update the name to reflect what the value provides.

BUG=1219655

Change-Id: Ia7ae0cd3fc5b2d91392507a28c6d5929461e6972
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3256171
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#937551}
2021-11-02 21:51:29 +00:00
bad7b5f5ba Update default action verb logic
- Default action will not be exposed on elements just because they
  have a given ARIA role -- there needs to be a mouse event handler
  as well, on that element or an ancestor. Otherwise, clicking on
  the ARIA element wouldn't do anything. For example, Chrome won't
  assume that a role=button or role=menuitem is actionable.
- Elements that are considered disabled for any reason are not
  considered "clickable".
- Remove unused code, such as code only used in web tests. The unused
  web test code was actually incorrect. A link as a "jump" action,
  not "press".
- Remove 2 antiquated tests from WebKit that do not test anything
  relevant to our architecture that isn't tested better elsewhere.

This work is a precursor to CL:3252847

Bug: 1248236
Change-Id: I26ff7367d8d0bbfd3e0a28ec105f766f34adc377
NOTRY: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3252113
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Daniel Libby <dlibby@microsoft.com>
Reviewed-by: Mark Schillaci <mschillaci@google.com>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#937539}
2021-11-02 21:22:56 +00:00
0200e0cb1f [test] Use 127.0.0.1 instead of localhost for DevTools
This CL fixes timeouts when running DevTools web tests massively in
parallel (e.g. via the `-f` option for run_web_test.py).

DevTools web tests have two WebContents. One loads the DevTools
frontend plus the test source, while the second loads the inspected
page resources.

In content_shell the DevTools frontend is loaded via apache.
The devtools:// scheme is only available in chrome.

Currently, the DevTools frontend is loaded via `localhost`, while
the test source and the inspected page resources are loaded from
`127.0.0.1`. This is a mismatch, as the DevTools page
(i.e. integration_test_runner.html) dynamically imports from
a different origin.

Either loading DevTools from `127.0.0.1` or loading the test source
from `localhost` fixes the issue, as the dynamic import is now
same-origin. We are not sure why though. Regardless, its probably
better to be consistent and load from the same origin in the
DevTools WebContents.

R=alexrudenko@chromium.org

Bug: None
Change-Id: Ib13af2dd1a705bdc9a780a4d3f08351d2cf1fa5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3250903
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#937261}
2021-11-02 10:41:50 +00:00
9b036533b6 Remove DISALLOW_* macros from content/
This inlines all remaining DISALLOW_* macros in content/. This is done
manually (vim regex + manually finding insertion position).

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: I8b5ea6dd9f8a3f584cf3eef82634017a38b15be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193883
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#936160}
2021-10-28 23:37:28 +00:00
41f46ebea6 Deprecate |ariaInvalidValue| in favor of |invalidState|.
'Spelling' and 'Grammar' values for |ariaInvalidValue| are represented
with markers, and the invalid state can be read through |invalidState|.
Therefore |ariaInvalidValue| is redundant and can be removed.
Also, based on the spec, |invalidState| will be set to true for all
non-empty and non-false values.

Bug: 1259555
AX-Relnotes: n/a.
Change-Id: I794b0554c1396bf2f8994fa41eeb7d7b145578b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3221050
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: Mark Schillaci <mschillaci@google.com>
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Reviewed-by: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#935841}
2021-10-28 12:24:22 +00:00
eb6a38f6fa Replace sandbox::policy::SandboxType with mojom Sandbox enum
sandbox.mojom.Sandbox can now be used as the sandbox type so we
replace it everywhere.

The guts of the change are in //sandbox/policy/sandbox_type.h where
SandboxType is now deleted, and //sandbox/policy/mojom/sandbox.mojom
where sandbox types that are not already used in mojom ServiceSandbox
attributes are added.

Some cascading changes:-

 - kService wasn't implemented on Mac (as it is equivalent to kUtility).
 As we cannot alias enum fields in mojo like we can in C++ I have added
 kService for Mac. The alternative is to define platform specific
 ServiceSandbox attributes for all kService interfaces which seems to
 put this complexity in the wrong place.
 - sandbox_type.h included a number of buildflag headers that other files
 then relied on. As sandbox_type.h is no longer needed in many places
 and no longer needs these defines, they have been introduced where
 required.
 - sandbox::mojom::Sandbox is forward declared in a couple of headers
 that are widely imported, hopefully reducing the number of times the
 mojom.h is included but not used.
 - some build deps must be modified.
 - LibAssistantService needs a sandbox to be defined even when hosted
 in process, so has kNoSandbox now when enable_cros_libassistant is
 false.

Bug: 1210301
Change-Id: I13fa4fa8cbbb3090a38806fe5532787bbdf1e2fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3213677
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Reviewed-by: Derek Schuff <dschuff@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Tao Wu <wutao@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#934126}
2021-10-22 01:55:13 +00:00
7eeb346993 Move fontconfig parts of test_fonts into a subdirectory
PDFium loads fonts directly, so only requires the test_fonts files
without the fontconfig parts.  This CL moves the fontconfig-
specific parts of test_fonts into a subdirectory so that the
fontconfig dependency may be removed.  This is required since otherwise
building 'all' would fail due to a missing fontconfig dependency.

R=thestig

Bug: 1250250
Change-Id: I773ed63a236e09666e1850cd3cb82765b395ae9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3227476
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#933047}
2021-10-19 16:46:49 +00:00
6d3f0a32ff Reland "Implement AuctionWorkletDevToolsAgentHost"
This is a reland of 540f4182cd

Change on reland: normalize title of about:blank targets

Original change's description:
> Implement AuctionWorkletDevToolsAgentHost
>
> This is a sibling CL with https://chromium-review.googlesource.com/2953363
>
> Bug: 1209620
>
> Change-Id: Ifa05b6fb338d2d7c5b2713d1e84d41ee4a6fc21d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3067509
> Reviewed-by: Kent Tamura <tkent@chromium.org>
> Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#932118}

Bug: 1209620
Change-Id: I7fd754736e9a4723e5fd73b4f370fbfa55ff22ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3227559
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932614}
2021-10-18 19:01:30 +00:00
12eabbf88e Revert "Implement AuctionWorkletDevToolsAgentHost"
This reverts commit 540f4182cd.

Reason for revert: The new test is consistently failing on some bots:
https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=blink_web_tests&tests=virtual%2Ffledge%2Fhttp%2Ftests%2Finspector-protocol%2Ftarget%2Fauto-attach-auction-worklet.js

Original change's description:
> Implement AuctionWorkletDevToolsAgentHost
>
> This is a sibling CL with https://chromium-review.googlesource.com/2953363
>
> Bug: 1209620
>
> Change-Id: Ifa05b6fb338d2d7c5b2713d1e84d41ee4a6fc21d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3067509
> Reviewed-by: Kent Tamura <tkent@chromium.org>
> Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Matt Menke <mmenke@chromium.org>
> Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#932118}

Bug: 1209620
Change-Id: Ie452cf9c95a5170c48861b78a510b931c89d613b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3227300
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Yi Gu <yigu@chromium.org>
Owners-Override: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932201}
2021-10-15 20:53:40 +00:00
643cdf6190 Replace base/task/ temporary forward headers with their final locations
Note to QA: This merely changes includes and should not be blamed
for files it touched.

Bug: 1255932
Change-Id: I1ce4e31efd5792ebf2080812e665cae838a54972
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226943
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932153}
2021-10-15 19:13:42 +00:00
540f4182cd Implement AuctionWorkletDevToolsAgentHost
This is a sibling CL with https://chromium-review.googlesource.com/2953363

Bug: 1209620

Change-Id: Ifa05b6fb338d2d7c5b2713d1e84d41ee4a6fc21d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3067509
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Maksim Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932118}
2021-10-15 18:17:30 +00:00
0fcf5214ca Eliminate DictionaryValue::GetInteger in content/
Bug: 1187034
Change-Id: I84a4ed3abea0825c524a7e84452b5ca453d6e0fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3222805
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931961}
2021-10-15 10:53:37 +00:00
800532c0bf Deprecate returning a GURL from GURL::GetOrigin().
This patch renames `GURL::GetOrigin()` to
`GURL::DeprecatedGetOriginAsURL()`. A subsequent patch will
reintroduce a `GURL::GetOrigin()` that returns a `url::Origin`
rather than a `GURL`.

This patch was brought to you by sed, followed by a little manual
work to deal with look-alike methods (most notably
`CascadePriority::GetOrigin()` and `NudgeTracker::GetOrigin()`) and
two or three spots that held pointers to GURLs:

```
git grep -n -l ".GetOrigin(" | \
  xargs -L1 sed -i '' \
    -e 's/\.GetOrigin(/.DeprecatedGetOriginAsURL(/g'
```

Bug: 512374
Change-Id: I03fb290650b8759d9849af0911cad9bdc92a5132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3220292
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931431}
2021-10-14 09:26:52 +00:00
4ead0363e1 DevTools: only allow certain protocol commands to certain clients
Bug: 1256885
Change-Id: Ieccc5b897ca7d60ac40db98ce34d13b6a02b3b7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3215079
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931377}
2021-10-14 05:01:51 +00:00
607a7cca05 MPArch: Move UpdateBrowserControlsState I/F from RFH to WebContents
This is a follow up CL for:
https://chromium-review.googlesource.com/c/chromium/src/+/3202052/comments/a963c207_8b7edbd6

A browser controls state is usually a per-tab level state.
However, the current interface misleads it as per-page level state.
As suggested in the previous CL comment, this CL moves the public
UpdateBrowserControlsState method from RenderFrameHost to WebContents.
All //content/public API users should use UpdateBrowserControlsState
in WebContents instead of RenderFrameHost.

Note that sources inside //content can use UpdateBrowserControlsStates
in RenderFrameHostImpl.  For the back forward cache implementation,
RestoreBrowserControlsState is called before |cached_rfh| is restored
from the back forward cache, and we should not update browser control
state for the primary main frame but the cached frame.
For that purpose, RenderFrameHostImpl keeps UpdateBrowserControlsState
so that it can be called from back_forward_cache_impl.cc as before.
It was suggested in this CL comment.

Bug: 1256696
Change-Id: I6d5a753f66d396c23a9e609ca98551247e753d73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3212280
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Owners-Override: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#931355}
2021-10-14 02:45:36 +00:00
199cc40f9b SVG-AAM Implementation: Description calculation
* Ensure the 'desc' element participates in the description calculation
* Fall back on the 'title' element if it wasn't used for the name and
  there is no other description source.
* Fall back on the 'xlink:title' attribute if it wasn't used for the
  name and there is no other description source.
* Ensure the 'title' child of a 'use' element participates in the
  name calculation of its instantiated element.

AX-Relnotes: Improved the accessible text alternative computation for
SVG elements.

Bug: 231654
Change-Id: I38c50e606b5c038d0702dae6e696a03faad3c818
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3189722
Reviewed-by: David Tseng <dtseng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Joanmarie Diggs <jdiggs@igalia.com>
Cr-Commit-Position: refs/heads/main@{#931162}
2021-10-13 18:47:30 +00:00
fcf6f0ec3f Add Lacros support for text to speech: unify voices.
This cl implements Lacros support for TTS voice handling part (behind
the flag feature::kTtsLacrosSupport):

1. Add Lacros support for tts.getVoices extension API and speech web API
SpeechSynthesis.getVoices to return all the voices provided by both Ash
and Lacros tts engines. The voices registered with Ash and Lacros are
available in both Ash and Lacros TTS for the primary profile.

2. The TtsController in Ash is the source of the truth, which knows all
the voices registered in both Ash and Lacros, queues up all the
utterances from both Ash and Lacros, and process them in sequence.
TtsControllerProxy in Lacros handles the speech requests from tts
extension API and web speech API, and sends them to Ash. I have built an
end to end prototype to support the speak API, in which Ash can speak out
a Lacros utterance with a Ash voice using either a voice from tts
extension engines that supports onSpeak(onSpeakWithAudioSteam is not
supported yet), or a native platform voice, and routes the TTS events
back to the calling client in Lacros. This cl contains only the voices
part.

3. When Lacros starts and loads a profile, TttsControllerProxy will
creates a BrowserContext keyed service TtsClientLacros which implements
mojom::TtsClient interface and registers itself with TtsAsh in Ash.
TtsAsh pulls Lacros voices with mojom::TtsClient::getLacrosVoices and
cached them. When the cached Lacros voices change, it will notify
TtsController. RemoteTtsEngineDelegate will provide the cached Lacros
voices to TtsController. TtsController::getVoices runs synchronously
as it does today.

4. TtsAsh observes voices change in Ash TtsController, and notify the
remote TtsClient in Lacros, so that TtsCliet in Lacros will call
mojom::Tts::getVoices to retrieve the entire set of the voices from ash
and cache them. TtsControllerProxy::GetVoices will retrieve the cached
voices from TtsClientLacros when requested.

5. The code is structured in such a way that can be extended to support
multiple user profiles later if multi-profile becomes available in
Lacros, but it has not implemented all the logic for handling
multi-profile since I don't want to add too much complexity at this
stage.

6. Adds support for incognito mode by override
TtsClientFactoryLacros::GetBrowserContextToUse to use its original
profile to create/get TtsClientLacros, so that incognito mode will be
handled in the same way as its original profile.

7. Duplicated voices: When Lacros becomes the only browser on ChromeOS,
Ash will contain the voices provided by 1st party Tts extension engines
(patts, eSpeak,Enhanced Network Engine), and the native platform; users
can installed 3rd party tts engine extensions only in Lacros. We simply
include all these voices tomake them available in both Ash and Lacros.
However, during a transitional phase when ash-chrome and lacros-chrome
runs side by side, it is possible to have the same TTS engine extension
installed in both Ash and Lacros, which leads to the duplicated voices.
Since this will be an edge case only for the transitional phase,
I didn't add sophisticated logic to merge and resolve the duplicated
voices; instead, I just have all voices included in the voice set, with
Ash voices listed before Lacros voices, so that Ash TtsController will
match the ash voice first if it has a duplicated one from Lacros.

Bug: 1227543
Change-Id: I29430502c039a5b9574dfe25466d5aa46af51955
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3178786
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Clemens Arbesser <arbesser@google.com>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Commit-Queue: Jenny Zhang <jennyz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929891}
2021-10-08 22:16:21 +00:00
3d7d70920a Replace task-related headers to their equivalent in base/task/
This CL was generated by using tools/git/move_source_file.py to change
the includes for those files:
base/bind_post_task.h
base/deferred_sequenced_task_runner.h
base/post_task_and_reply_with_result_internal.h
base/sequenced_task_runner.h
base/sequenced_task_runner_helpers.h
base/single_thread_task_runner.h
base/task_runner.h
base/task_runner_util.h
base/updateable_sequenced_task_runner.h

Then formatted using "git cl format". DEPS files were fixed with a
simple search and replace script.

Bug: 1255932
Change-Id: I0d9b5ddd9260fde5e4581e6c6e0080bdb0ed2c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3209175
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929867}
2021-10-08 20:27:23 +00:00
199852e14b Allow the browser to take focus in web tests.
Introduce a new TestRunner binding "setBrowserHandlesFocus" to allow
webtests to let the browser get a crack at handling focus between
pages. With mparch the browser is responsible for moving focus into the
parent from an inner frame tree.

BUG=1257595

Change-Id: I6b740ca032af8dfe13a62003aa60ae512701c460
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3212534
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929419}
2021-10-07 21:29:15 +00:00