0
Commit Graph

79415 Commits

Author SHA1 Message Date
e8489b6e53 viz: Skip direct composition underlays for non-opaque texture quads.
Texture quads are considered as "requires overlay" quads which means
that non-opaque occluded texture quads will be put into an overlay
without any possibility of blending. This is ok for video since overlay
compatible YUV video quads don't have any alpha, but texture quads can
have alpha. A totally transparent texture quad would show up as black.

This CL fixes that by applying the underlay validation check to texture
quads. Multiple texture quads are still promoted if possible, but a quad
could be skipped if it's occluded and non-opaque. This CL also adds a
pixel test for this scenario.

Bug: 1122638
Change-Id: I5c4f120d88ce8ad2bd340b7a4aa33d59fe1ef116
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380161
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805096}
2020-09-08 21:55:58 +00:00
d46483a800 indexeddb: add recursion limit for idb key decoding
Bug: 1114430
Change-Id: I8379fe033e39ffc898e8799cd3c1e1e8e1743984
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2393188
Commit-Queue: enne <enne@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Auto-Submit: enne <enne@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805089}
2020-09-08 21:32:46 +00:00
d28a686fdf Disable TwoSubframesCreatePopupMenuWidgetsSimultaneously
Disable SitePerProcessBrowserTest.
TwoSubframesCreatePopupMenuWidgetsSimultaneously on Linux and Chrome OS
due to flaky.

Bug: 1126165
Change-Id: I56b956c03578a1ecf55e79cead3a6f1b676a379f
Tbr: kenrb@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399307
Reviewed-by: Owen Min <zmin@chromium.org>
Commit-Queue: Owen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805077}
2020-09-08 21:09:29 +00:00
84f055e51e Fix file scheme downloads back to work without RenderFrameHost
Fixes crrev.com/c/2337411 which inadvertently changed file scheme
downloads to only work when a RenderFrameHost exists.

Bug: 1106995
Change-Id: I9f87c6c2b1b8719e1c78b2aa670b02ff8ac65381
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2397041
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Min Qin <qinmin@chromium.org>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805070}
2020-09-08 20:57:13 +00:00
a6b7f4923d Disable VisualPropertiesPropagation_DisplayMode
Disable RenderWidgetHostViewChildFrameBrowserTest.
VisualPropertiesPropagation_DisplayMode on Mac and Linux due to flaky.

Bug: 1126153
Tbr: kenrb@chromium.org
Change-Id: If31a8b4ede074539f250b2869307e36add8b4c1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399302
Reviewed-by: Owen Min <zmin@chromium.org>
Commit-Queue: Owen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805058}
2020-09-08 20:36:34 +00:00
309d048269 Fix playback state on entering PiP for paused player
Adding a player to MediaSessionImpl automatically requests the audio
focus. We need to fix this up in case a paused player is added due to
entering Picture-in-Picture.

Bug: 1117390, 1117397
Change-Id: I1c8b69dbefe19f6d8a99a3b8d2a01fa2123a47f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2387643
Reviewed-by: Becca Hughes <beccahughes@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#805056}
2020-09-08 20:32:57 +00:00
1f77378d5e Simplify ChildProcess init by removing ChildProcessHostBootstrap interface
Before this CL, the child process start-up flow went like this:
 1.) Browser would create a Mojo invitation, with a mojom::ChildProcess
     receiver, that ChildThreadImpl would recover and bind.
 2.) ChildThreadImpl immediately creates a remote for its
     ChildProcessHost so it can start queueing messages for the browser
     process, even though it is not bound to the browser.
 3.) ChildThreadImpl asynchronously waits for ChildProcess::Initialize
     to be invoked by the browser process; this supplies a remote for
     mojom::ChildProcessHostBootstrap, which the child process uses to
     send the receiver for the remote created in (1).
 4.) Browser receives this, binding it to either
     RenderProcessHostImpl::io_thread_host_impl_ or ChildProcessHostImpl

In short, there's an awkward dance that has to be done between the
browser <-> renderer ((3) above), so that they can both immediately
initialize remotes for each other. This CL removes the extra IPC round
trip by removing ChildProcessHostBootstrap, and steps (3) & (4) above.
This is done by attaching a second message pipe to the mojo invitation
corresponding to the ChildProcessHost receiver, so the child process has
it immediately on init. At this point, the child process can create a
remote for the ChildProcessHost, and immediately bind it to the pipe
which is bound to the browser process's ChildProcessHost receiver.

Bug: N/A
R=haraken@chromium.org,rockot@google.com

Change-Id: I8f7b4b698b82e25d1c5c991c9639e57de05a6360
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2393158
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Martin Barbella <mbarbella@chromium.org>
Reviewed-by: Tal Pressman <talp@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805037}
2020-09-08 20:03:36 +00:00
363d1da56b Remove unused AccessibilityTreeFormatter::BuildAccessibilityTreeForProcess method
It was introduced in 724239 to inspect accessible trees by process id but this feature was removed in 1113674 as duplicate of inspect by window id feature

Bug: None
Change-Id: Ifec72d6ad2aef9238632588e8a65a77a37ca66d2
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390852
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Alexander Surkov <asurkov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#805036}
2020-09-08 20:03:14 +00:00
5eca737b04 [FS] Auto-grant read access to directories when dropped.
https://crrev.com/c/2353193 added a "kDragDrop" UserAction to be used when
accessing dropped entries via the native file system API. But somehow I
forgot to actually hook this up to the D&D code.

This hooks it up by adding a UserAction parameter to CreateFileEntryFromPath
and CreateDirectoryEntryFromPath (and simplifying some bits of code a bit).

Bug: 1124833
Change-Id: Ic8b165441996c64f2849fada1787a613adeee675
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392772
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805034}
2020-09-08 19:58:08 +00:00
0c6f3763bb Updating XTBs based on .GRDs from branch master
TBR=govind@chromium.org

Change-Id: I94d408a0cfea9d20d19678f40970670d14f61c90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399006
Reviewed-by: Ben Mason <benmason@chromium.org>
Reviewed-by: Krishna Govind <govind@chromium.org>
Commit-Queue: Ben Mason <benmason@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805032}
2020-09-08 19:55:55 +00:00
844bebe565 webgl: Use correct format for exported low latency canvas resource.
SkiaRenderer is strict about ensuring that the resource format passed in
to the display compositor via TransferableResource, which is used to
create the GrSurfaceProxy, matches the underlying SharedImageBacking's
format which is the GrSurfaceBackend.

In the context of DrawingBuffer this means that for low latency mode,
the ExternalCanvasResource must have the same format as the shared image
or swap chain. One problematic case is RGBA8 vs BGRA8 because the
default CanvasColorParams() used when creating the resource uses the
platform specific default for Skia, which is based on endianness, to
determine the format passed to the display compositor.

To solve this problem, this CL adds the shared image resource format to
ColorBuffer, and makes it the source of truth for all places that need
the format in DrawingBuffer. In particular, the CanvasColorParams is
constructed to match the underlying resource format instead of relying
on the defaults.

Bug: 1122638
Change-Id: I8c4e93d7f08566e695a3948505f98541d55b7216
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391410
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805027}
2020-09-08 19:48:55 +00:00
4e780537d5 Reland "Remove INVALIDATE_TYPE_LOAD and INVALIDATE_TYPE_TAB on WebContentsImpl::LoadStateChanged()"
This is a reland of d4c213d376

Original change's description:
> Remove INVALIDATE_TYPE_LOAD and INVALIDATE_TYPE_TAB on WebContentsImpl::LoadStateChanged()
> 
> Since WebContentsImpl::DidStartLoading/DidStopLoading is already sending
> NotifyNavigationStateChanged(INVALIDATE_TYPE_LOAD) by way of
> LoadingStateChanged, it's no longer necessary to send this out in
> WebContentsImpl::LoadStateChanged. This change can reduce the number
> of call of TabStripModelObserver.TabChangedAt with TabChangeType.kAll
> a lot to increase performance throughout the browser
> 
> Bug: 1112496
> Change-Id: I96d8942d7e1ebd5ffc8b3f3389497936f62848c7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2357960
> Commit-Queue: Yuheng Huang <yuhengh@chromium.org>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#798852}

Bug: 1112496
Change-Id: I19b697d515cb56088a5dde836d51c7d5cf3c54b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2393155
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Yuheng Huang <yuhengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805007}
2020-09-08 19:10:01 +00:00
a5de3e8482 Return valid selection for degenerate range in GetSelection()
Currently AXPlatformNodeTextProviderWin::GetSelection() populates
selection SAFEARRAY as nullptr if the selection is a degenerate range on
a non editable node. Hence correct selection range is not returned on
deselecting the selected character.

This CL adds the change to return a valid selection for a degenerate
range. It also adds the conditions in
AXPlatformNodeTextRangeProviderWin::Select() to prevent selections
inside of a list marker. Relevant unit tests are added to validate the
change.

AX-Relnotes: Fixed an issue with character selection for Narrator users.

Bug: 1114779
Change-Id: I882ca2c6ade013678b948548918b02417d85aee6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346095
Commit-Queue: Kurt Catti-Schmidt <kschmi@microsoft.com>
Reviewed-by: Kurt Catti-Schmidt <kschmi@microsoft.com>
Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#804982}
2020-09-08 18:16:31 +00:00
566e5fcc1f Disable test NavigateBackForwardRepeatedly
The test BackForwardCacheBrowserTest.NavigateBackForwardRepeatedly is
flaky on Mac, Linux and ChromeOS. Disable the test on those platforms.

Bug: 1099395
TBR: altimin@chromium.org
Change-Id: Ib4adf13ffe75fce14b42e9b93b7a2383d60b8a34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2398899
Commit-Queue: Owen Min <zmin@chromium.org>
Reviewed-by: Owen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804931}
2020-09-08 16:01:05 +00:00
bc5c4c1783 [Security] Add a cross origin redirect test for crossOriginIsolated
This test verifies that the candidate SiteInstance is not used for a
cross origin redirect, that would lead to have a SiteInstance hosting
a crossOriginIsolated page with an incorrect top level origin as
initially registered.

Bug: 1107814
Change-Id: If52fef13528ca8d2f8dcf8af04b6510462072f43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2396379
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804894}
2020-09-08 11:46:49 +00:00
ba8fe2994d Reject makeXRCompatible if feature policy for WebXR is disabled
If the xr-spatial-tracking feature policy is disabled, throw a
SecurityError on makeXRCompatible. This is to prevent an unnecessary
restart of the GPU process.

The WebXR spec isn't clear on the behavior when the xrCompatible flag
is set when requesting a context. In this scenario, this change simply
sets the flag to false without throwing an exception.

The WebXR spec has also been updated to specify that an
InvalidStateError should be thrown if there are no devices available.
The kNotCompatible enum is split into specific reasons for why we
can't be XR compatible to be able to throw the corresponding exception.

A subsequent change will add a blink feature for multi-GPU and add
corresponding tests

Bug: 1124024
Change-Id: I5207ed56d838d76eedf2287f0bd6e1fffd2c5b95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388902
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Patrick To <patrto@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#804891}
2020-09-08 11:30:07 +00:00
5fdeff2a67 [content] Annotate WebContentsImpl methods with trace events
WebContentsImpl is a major class responsible for routing many events
between different parts of //content and between //content and the rest
of the codebase (e.g. //chrome and //components).

Add trace events to all non-trivial methods to ensure that it's possible
to understand the execution flow from reading the trace.

Together with crrev.com/2343269 this in particular would allow the
user of the tracing to know which WebContentsObserver notifications were
dispatched.

R=nasko@chromium.org
BUG=1043616

Change-Id: If00550c233ab16186a2ebf9f4042c5f1fd457fdd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2240326
Commit-Queue: Alexander Timin <altimin@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804869}
2020-09-08 09:20:37 +00:00
1ddd7b5ef7 Change cross-origin isolated DCHECK, add history tests
The equality of the "cross origin isolated" value should not be checked
if it's still speculative, and some other cases covered by
IsSiteInstanceCompatibleWithCoopCoepCrossOriginIsolation.

Bug: 1107814, 1096135
Change-Id: I37152bbc348d598dc4612666bfc181da60e75555
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2385255
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804854}
2020-09-08 07:54:34 +00:00
e78968173b Change EditingNG from experimental to test
EditingNG has some instabilities such as <crbug.com/1121885>.
In order to help users who turn on "Experimental Web Platform
features" from hitting these issues, this patch changes
EditingNG back from "experimental" to "test".

Once ourstanding issues were resolved, we will change it back
to "experimental".

This is a revert of r791809 <crrev.com/c/2319947>. Some
rebaselines are needed because these tests do not seem to
honor "test" status.

Bug: 707656, 1125477
Change-Id: I433200cb7fb450036a631ee8ed578ab395413540
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390936
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804839}
2020-09-08 05:21:32 +00:00
d111b3c809 [OnionSoup] Move content::IsOriginSecure into Blink
Currently, content::IsOriginSecure() util is used by
ResourceDispatcher, which will be removed along with OnionSoup.

This patch moves content::IsOriginSecure() into Blink, so that we
could onion-soupify the ResourceDispatcher.

Change-Id: I7b9975ccc50bb28e13c37107588c9e071450f39f
Bug: 1110032
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392044
Commit-Queue: Minggang Wang <minggang.wang@intel.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804829}
2020-09-08 02:13:19 +00:00
d2fc1c79cb Remove unused return values of ServiceWorkerStorageControl
|deleted_version_id| and |newly_purgeable_resources| aren't used
anymore as of crrev.com/c/2348734.

Bug: 1055677
Change-Id: I66d5e144a4631894b919171565a51dd03303c645
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2395320
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804818}
2020-09-08 00:44:19 +00:00
bc0fd7ab4a Rename directory.mojom to match file_util.h naming
To be consistent with the base functions that are being called,
rename functions to be DeleteFile/DeletePathRecursively.
RemoveFile is no longer needed as DeleteFile handles both
deleting files and non-recursive directories.

This is a follow-up to:
https://chromium-review.googlesource.com/c/chromium/src/+/2365358

Bug: 1119547
Change-Id: I4b34722e18d04fec9456753ddde525fa6c672d6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391657
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Auto-Submit: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804783}
2020-09-07 17:51:35 +00:00
3c01b472bf Parse plugin-types CSP directive in services/network
This CL adds logic for parsing the plugin-types
Content-Security-Policy directive to the services/network CSP parser.

Bug: 1094909
Change-Id: I05dd7caf7b2d3c513b80f2265723bc1a0be04b3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346657
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804774}
2020-09-07 17:23:23 +00:00
2a809d9b27 [OnionSoup] Move functions defined in network_utils.h into namespace blink::network_utils
Along with the OnionSoup for loading, we will have more utils
needed to be moved into Blink.

This patch puts these utils defined in network_utils.h/cc into
namespace blink::network_utils to avoid contaminating
namespace blink.

Bug: 860403
Change-Id: I1b9de8ece4427e70a9897a95898efd2e6b10c7d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392632
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Minggang Wang <minggang.wang@intel.com>
Cr-Commit-Position: refs/heads/master@{#804760}
2020-09-07 14:52:32 +00:00
cf002f9246 Simplify AncestorThrottleNavigationTest
This CL simplifies the test
AncestorThrottleNavigationTest.WillStartRequestAddsSecRequiredCSPHeader
relying upon fixes / new functionalities added to the
NavigationSimulatorImpl in https://crrev.com/c/2294801 and
https://crrev.com/c/2310416.

Bug: 1094909
Change-Id: I155fc027748cb2de7255199fb07184b5375136b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2320831
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804753}
2020-09-07 13:56:41 +00:00
fb55a079ac BackForwardCache: Add two more UKMs for detailed analysis
This CL adds two HistoryNavigation UKMs

  * BackForwardCache.BlocklistedFeature
  * BackForwardCache.BrowsingInstanceNotSwappedReason

for further analysis.

The UKM privacy doc is:
https://docs.google.com/document/d/1GDsehNwMEHXef_o2XqNbsXk2F0pdhXt1khVVE4cRcLw/edit?usp=sharing

Bug: 1122491

Change-Id: I1a98db768dd97b8224caa03db700667c84ff980e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2374916
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Brian White <bcwhite@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804741}
2020-09-07 12:04:25 +00:00
dffbe66e98 Migrate ViewHostMsg_UpdateTargetURL/ViewMsg_UpdateTargetURL_ACK to mojo
This CL migrates these two legacy IPC messages out of view_messages.h
to the {Local,Remote}MainFrameHost mojo interfaces from Blink, by using
the newly defined method UpdateTargetURL() in both interfaces (required
to work both when the main frame in the renderer is local or remote).

Additionally, this CL moves the  UpdateTargetURL() method present in
RenderViewHostDelegate into RenderFrameHostDelegate, now that the IPC
message will be now received in the browser process by a RenderFrame,
instead of being handled by RenderViewHost as it was the case before.

Last, the UpdateTargetURLWithInvalidURL unit test has been moved out of
RenderViewBrowserTest and into WebViewTest, as that reflects better the
situation in the renderer side now, and also to get friend access to
the |target_url_| private attribute, which is now part of WebViewImpl.

Bug: 993189, 1047464
Change-Id: Ib97ee5270221efc48d50138cf3f075619430d063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2387801
Reviewed-by: Aaron Colwell <acolwell@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#804735}
2020-09-07 12:01:08 +00:00
84563d6c1d Remove response_headers_from_testing from NavigationRequest
After https://crrev.com/c/2310416 removes usage of
NavigationRequest::set_response_headers_from_testing from the
NavigationSimulatorImpl, it is now feasible to drop the
NavigationRequest::response_headers_from_testing, as this CL does.

Change-Id: I8ea4f24e47ba9a98d5c6bc32d5fb15b1e51af4bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2312097
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804725}
2020-09-07 11:55:33 +00:00
b51bef1c12 Removed unused header
This CL removes an unused header, histogram_functions.

Bug: None
Change-Id: I1b96ab271f0b08984eedb400c31514767de0ebf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2395736
Reviewed-by: Richard Knoll <knollr@chromium.org>
Commit-Queue: Mohamed Adel <adelm@google.com>
Cr-Commit-Position: refs/heads/master@{#804716}
2020-09-07 11:51:10 +00:00
45bde6db99 Move some histogram recordings to ServiceWorkerStorage
This CL removes ServiceWorkerMetrics dependency from
ServiceWorkerStorage by embedding UMA recordings into it.
ServiceWorkerStorage will be moved to //components/services/storage
but ServiceWorkerMetrics will remain //content. This means that
ServiceWorkerStorage cannot use ServiceWorkerMetrics.

This CL also applies histogram guidelines
(//tools/metrics/histograms/README.md).

Bug: 1016064
Change-Id: I79ba99c096fc422166b0f0f23d27728804701113
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394899
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804710}
2020-09-07 09:26:53 +00:00
796807c5a0 Clean up NavigationSimulator::FailWithResponseHeaders
This change removes all calls from NavigationSimulatorImpl to
NavigationRequest::set_response_headers_from_testing. Those calls are
not needed anymore, since https://crrev.com/c/2294801 added a method
NavigationSimulator::SetResponseHeaders which allows to mock response
headers going through the URLLoader.

The function NavigationSimulator::FailWithResponseHeaders, which was
relying on NavigationRequest::set_response_headers_from_testing, turn
out not to be needed anymore and has been removed in this CL.

Change-Id: I7ab18e0c2306aab97f4d04ad655fec5aa050f43c
Bug: 1094909
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310416
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
Reviewed-by: John Delaney <johnidel@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Tim Schumann <tschumann@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804701}
2020-09-07 08:54:25 +00:00
d3552dbe18 code cache: Remove sync primitives from task runner.
It does not look like this trait is needed.

Change-Id: I17868f8ee29b405d43a100e87e6fa0cae65b3615
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394876
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804688}
2020-09-07 07:51:43 +00:00
223c9e10b8 code cache: Remove obsolete TODOs about array vs BigBuffer vs data pipe.
The linked bug was closed and the decision was to use BigBuffer, which
the current implementation is doing.

Bug: 867848
Change-Id: I7a4915df4836ae63ba0495c2d5a1aa462edd61f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392176
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804687}
2020-09-07 07:50:03 +00:00
9dbc16bf92 Use DEFINE_THREAD_SAFE_STATIC_LOCAL @WebAudioOutputIPCFactory::get()
... as per section 2.2.2 in [1].

[1] https://docs.google.com/document/d/19Zk6Fv1E-6QTQ2c33rpBjDNEkzlsSKvjb3hWkvZAE80

Also rename it to GetInstance().

Last, previous, the WebAudioOutputIPCFactory instance was held by
RenderThreadImpl, and some test suite (eg content_browsertests and
components_browsertests) do not instantiate RenderThreadImpl at all.
Hence, the instance needed to be null-checked prior to being used.
Now that WebAudioOutputIPCFactory is a lazy initialized singleton,
this CL now null-checks WebAudioOutputIPCFactory::io_task_runner(),
since it is the object that is null on the aforementioned test suites.
This check does not affect production code.

TBR=spang@chromium.org

BUG=787252
R=guidou@chromium.org, haraken@chromium.org

Change-Id: Ie3e662c973e1d1e2287aa4bc9a9378379f88a792
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391177
Auto-Submit: Antonio Gomes (GMT-4) <tonikitoo@igalia.com>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804680}
2020-09-07 07:26:39 +00:00
b2061e74a4 Use base::TaskEnvironment in ServiceWorkerStorageControlImplTest
The test will be moved out of content/. Replace BrowserTaskEnvironment
with TaskEnvironment.

Bug: 1016064
Change-Id: I018eeacf44a3d10462ee12c5c688d804115097f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394898
Reviewed-by: Makoto Shimazu <shimazu@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804661}
2020-09-07 05:10:55 +00:00
4074761b08 Remove unused content::ThreadSafeSender.
Tbr: lazyboy
Change-Id: I2c05fe707f912a7de3d32e2cccdcb458b8c6482b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390596
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804656}
2020-09-07 03:51:32 +00:00
2555755752 loading: Remove unused BlobRegistry from fetch contexts.
Also remove unused Send() method.

Change-Id: I68118f84c4851c85310ec04287126c47042c3e69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394600
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804648}
2020-09-07 02:45:43 +00:00
6549065bd7 Remove ink trails state tracking in RenderWidgetHostViewBase
This state shadows states from the RenderWidgetHostImpl and we can
just rely on that.

Then, RenderWidgetHostViewBase no longer needs to act as an observer of
RenderFrameMetadata submissions. The platform specific implementations
do, but they can each do so on their own. This avoids multiple levels of
implementations of this interface.

While we're at it, RenderWidgetHostViews should always be destroyed by
calling Destroy(), so we make the destructors protected and fix up some
code that relied on them being public.

R=avi@chromium.org

Change-Id: I45ee67c7e3fa73a33ba6d8dc83071a75baa2b2ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392622
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804617}
2020-09-05 20:29:36 +00:00
6131eb9078 Remove //content/browser dependency in //chrome/browser/ui/webui
crrev.com/c/2259537 made ChromeWebUINavigationBrowserTest use
RenderFrameHostImpl directly for testing instead of using the
existing content::PwnMessageHelper::OpenURL(). But, it's a layer
violation. So this CL restores OpenURL() in content::PwnMessageHelper
in browser_test_utils.h again, then makes it use
content::PwnMessageHelper::OpenURL() to fix the layer violation.

Additionally, all test methods of PwnMessageHelper start to use
Mojo methods instead of IPC method. So, this CL updates the comments
properly.

Bug: 1093920
Change-Id: I8608cb7bc5a3e84628c741020ed2515d28445e2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2387541
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#804591}
2020-09-05 01:13:36 +00:00
6d9b12cf7d WebLayer: hook up contacts picker for navigator.contacts.
Bug: 1016938
Change-Id: I4e259c8782382305d38834a68f5225b92d28ec2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386835
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804576}
2020-09-04 19:26:46 +00:00
425a446262 Only set DropData::referrer_policy for 'downloadurl' mime type
The referrer policy is only used when dragging a link out of the WebView
results in a download. This is handled on Windows when the mime type is
'downloadurl'. This CL avoids storing the policy unconditionally when
converting the DragData Mojo type to DropData.

Bug: 1039255
Change-Id: Id0b94a7bddb274b53aba2e5c163407f0c875d95c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391068
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/master@{#804573}
2020-09-04 18:49:47 +00:00
f5cf34c08e ChildThreadImpl comment typo
R=haraken@chromium.org

Bug: N/A
Change-Id: I00a2274e866abc0680db244d8f2a64fa3e17a909
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391418
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804561}
2020-09-04 16:42:42 +00:00
c5000adc0e Use DEFINE_THREAD_SAFE_STATIC_LOCAL @WebAudioInputIPCFactory::get()
... as per section 2.1.2 in [1].

Method is also renamed to GetInstance().

[1] https://docs.google.com/document/d/19Zk6Fv1E-6QTQ2c33rpBjDNEkzlsSKvjb3hWkvZAE80

BUG=787252
R=guidou@chromim.org, haraken@chromium.org

Change-Id: I5a80ee2168d8b150439559ce74e9ce3fd6089b07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391005
Commit-Queue: Antonio Gomes (GMT-4) <tonikitoo@igalia.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804551}
2020-09-04 14:24:42 +00:00
167f7d6b5c Rename blink::AudioInputIPCFactory with a 'Web' prefix
This is a follow up of https://crrev.com/c/2388721, done separately
so that the rename itself was not noisy to reviewers.

BUG=787252
R=guidou@chromim.org, haraken@chromium.org

Change-Id: Ia64f7c4da453b8a2c313f79e13f811ccc41eba18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2389018
Commit-Queue: Antonio Gomes (GMT-4) <tonikitoo@igalia.com>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804544}
2020-09-04 11:49:22 +00:00
cc8ec3cb11 Fix AXPosition::AtEndOfTextSpan to not rely on CreateParentPosition
AXPosition::AtEndOfTextSpan relies on CreateParentPosition to
determine if an inline text box marks the end of text span. Since
CreateParentPosition calls into AtStartOfLine which calls
AtEndOfTextSpan so we end up with an infinite loop and stack overflow.

https://crrev.com/c/2245611 fixed most cases with this infinite loop
of AtStartOfLine/CreateParentPosition/AtEndOfTextSpan by checking for
AtEndOfAnchor first before calling AtEndOfTextSpan.

However consider the following example:
<style>
  .required-label::after {
    content: " *";
  }
</style>
<label class="required-label">Required </label>

labelText 
++staticText name='Required ' nextOnLineId=inlineTextBox  
++++inlineTextBox name='Required ' nextOnLineId=inlineTextBox 
++staticText name=' *' previousOnLineId=inlineTextBox 
++++inlineTextBox name='*' previousOnLineId=inlineTextBox 

AtEndOfAnchor check would not prevent this infinite loop, if
AtStartOfLine is called on staticText  name=' *' as the max text
offsets differ between staticText  and its inlineText .

This CL fixes the above issue by making AtEndOfTextSpan not to call
CreateParentPosition. Instead it determines end of text span by
directly looking at the current position's parent role and its index
among its siblings.

AX-Relnotes: Fixes hangs in certain accessibility scenarios.

Bug: 1120636
Change-Id: Ic99c27b069f220f26da736b3946560ef23d6b622
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369681
Commit-Queue: Victor Fei <vicfei@microsoft.com>
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804531}
2020-09-04 07:12:36 +00:00
dd1293630f Move Contacts Picker code out of UiUtils.
The ui_utils_java target is not a suitable place for this code because
it needs to use WindowAndroid instead of Context (for WebLayer's sake),
and ui_utils_java can't depend on WindowAndroid.

This glue code is moved to org.chromium.content_public.browser.

Bug: 1117536,1016938
Change-Id: Ic18275e2f0eca0739b850418af6c71d2079c6da5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380343
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804505}
2020-09-04 01:55:43 +00:00
f932c5fa40 FontAccess: Enumeration timer for windows
Adds an UMA metric to time font enumeration time on Windows.

Bug: 1043306
Change-Id: I6e8a3e51ee752f3e62388a08fd05b06456e7ccd3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392992
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Olivier Yiptong <oyiptong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804493}
2020-09-04 00:53:56 +00:00
07bd8d4be7 Re-enable tests for fixed ANGLE issues
Attempting to re-enable all WebGL tests associated with fixed ANGLE issues

Bug: chromium:1099961, angleproject:3701, angleproject:2103
Bug: angleproject:2909, angleproject:2722
Bug: angleproject:2915, angleproject:2898, angleproject:3766
Bug: angleproject:2046, angleproject:5014, angleproject:1506
Bug: angleproject:4986, angleproject:5015
Change-Id: I9999eef4f7f15282d0fa8abd3d31de52475a7b65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392980
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804456}
2020-09-03 22:59:33 +00:00
9b4cbe496e Port ax_dump_tree tool on mac: generalize LineIndexesMap to reuse it for native mac accessible trees
Bug: 1124366
Change-Id: Id0071572ef54856fee9f6ecd1b5d379fdbb3a079
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391468
Commit-Queue: Alexander Surkov <asurkov@igalia.com>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804455}
2020-09-03 22:55:15 +00:00
7e282a9446 [Lookalike URLs] Test lookalike URL logic with signed exchanges
This CL adds a lookalike navigation browser test for signed exchanges.
The current lookalikes code blocks signed exchanges in both of the
following cases:
- The target URL of the SGX package is a lookalike
- The URL that serves the SGX is a lookalike

For the first case, the test navigates to a signed exchange URL that
serves a SGX for google-com.example.org and checks that the URL is
blocked by the target embedding heuristic. The second case serves the
SGX from google-com.example.org and checks that it's blocked.

There is an argument to be made for the latter case to not be blocked
since the URL that serves the SGX is never seen by the user during
normal browsing such as clicking links. However, there is still a chance
that such a URL is shared from outside Chrome (e.g. coming in an email).
We still want to block those cases.

Additionally, detecting that a navigation will end up as a SGX isn't
trivial as the SGX package needs to be fully validated before its
contents can be displayed. It might be too late to block the original
navigation by the time the SGX is validated. This needs to be confirmed
and might be changed in follow up CLs.

Bug: 1110151
Change-Id: I2b2e4841eb142b3f2d1c1cedf82138f578e770a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386429
Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
Reviewed-by: Joe DeBlasio <jdeblasio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804412}
2020-09-03 21:11:44 +00:00