0
Commit Graph

352 Commits

Author SHA1 Message Date
Georg Neis
18fc514f17 Remove Lacros leftovers from content/{app,child,common,gpu}
- Remove IS_CHROMEOS_LACROS code
- Replace IS_CHROMEOS_ASH with the equivalent IS_CHROMEOS
- Similarly for is_chromeos_lacros/is_chromeos_ash.
- Drop obsolete includes/build dependencies.

No change in behavior.

Bug: b:365742770, b:365741912
AX-Relnotes: n/a.
Change-Id: I168caff153c160cdd9852f5bd8201a37c1bea27d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6096745
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1397666}
2024-12-17 16:58:41 -08:00
Alex Mitra
c246bcc072 Set custom Skia GrContextOptions for WebView on Android TV
This creates a new embedder delegate that allows the embedder to modify
the GrContextOptions passed to skia. Behind a flag that is disabled by
default, this CL disables mip map sharpening and sets MSAA sample count
to 0.

Bug: 364872963
Change-Id: Ifec3c530d0a9bf837b313b01ed7c41094446e483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5982515
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Alex Mitra <alexmitra@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389835}
2024-11-29 16:22:10 +00:00
Colin Blundell
7eb345bacc [//content] Make some ContentGpuClient methods Android-only
These methods are present only for Android WebView. By making them
Android-only, we make it more clear that it is not possible on other
platforms for the respective dependencies to be created externally to
Viz itself.

Change-Id: Ia4ac7854245451e8ff98ff46c836445c00468242
Bug: 330865436
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5991439
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1378273}
2024-11-05 13:20:14 +00:00
Helmut Januschka
bcf73217bf Shift PowerMonitor to non static
Bug: 346931324
Change-Id: I80fab35a422083c5a9db1d9ee4a2ccd34e11d32f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5806403
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1350494}
2024-09-03 23:49:18 +00:00
Scott Violet
43a6a68066 base: removes base/allocator/allocator_extension
Looks it's dead code.

Bug: none
Change-Id: I41969fc9c9ef585cd2bcd3bd834567b52ce3a508
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5320270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1264712}
2024-02-23 20:18:45 +00:00
Matthew Denton
66b2fa5ba5 Linux/Cros: Proxy SetThreadType calls out of sandboxed processes
As a followup to https://crrev.com/c/4898004, this uses
content::mojom::ThreadTypeSwitcher mojo interface in the GPU and
utility processes by instantiating a SandboxedProcessThreadTypeHandler
in those processes.

Bug: 1317590
Change-Id: I195df85221dc087504f723bb51e046d9b72ff1c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4918825
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1210563}
2023-10-17 00:54:22 +00:00
Bo Liu
01d003e4e7 gpu: Refactor load program binary shm flag
This is a refactor that does not intend to change behavior, but prepares
for fixing logic for deleting shader cache if shader loading fails.

Motivation is making ActivityFlags since there can be multiple GPU
threads that load shaders now. ActivityFlags has only ever had one
flag since its inception years ago. So just remove the support for
multiple flags and just turn it into a count that's incremented
atomically. Switch to using std::atomic since base::subtle::Atomics
is deprecated.

Rename everything from "activity flags" to "use shader cache shm
count".

Bug: 1470074
Change-Id: Ie77b6d347e86402ecff8891d600efd36e49d0418
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4762849
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184321}
2023-08-16 19:46:50 +00:00
Aman Verma
8c1c5e6191 Add UkmRecorderFactory which allows to create bidirectional
communication between UkmRecorder<->MojoUkmRecorder.

Add UkmRecorderFactory mojo interface and implementation to allow
sending updates to UkmRecorderParameters when kUkmReduceAddEntryIPC
experiment is enabled along with allowing MojoUkmRecorder to send
information to UkmRecorder. |client_remote| argument in
CreateUkmRecorder method of UkmRecorderFactory is optional.

Bug: b/261857368, b/275542357

Change-Id: I7a3a17560474cb93a945f0a3381abd22d33f06c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4334311
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Aman Verma <amanvr@google.com>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Carlos Caballero Grolimund <carlscab@google.com>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1125695}
2023-04-03 23:33:58 +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
Sean Maher
5b9af51fdd task posting v3: moving away from ThreadTaskRunnerHandle
To continue the migration away from TaskRunnerHandles, the codebase
was refactored using the following scripts:
shell script:
https://paste.googleplex.com/4673967729147904
python:
https://paste.googleplex.com/5824001174667264

This will do a few sed-like modifications, changing calls to methods of
ThreadTaskRunnerHandle to calls to methods of
SingleThreadTaskRunner::CurrentDefaultHandle, and swapping includes.

Bug: 1026641
AX-Relnotes: n/a.
Change-Id: Ia33b6dfebb15937481c619f5c838720ce7bb2676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4031817
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1074085}
2022-11-21 15:32:47 +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
Bo Liu
eca0009fac aw: Raise sequence priority waited by render thread
Most of the files touched are for plumbing to so that the same
gpu::Scheduler instance is accessible on both render thread and
gpu thread.

Add a scoped struct in gpu::Scheduler to raise priority of a
sequence. And use it in TaskForwardingSequence::RunTask if it
ends up waiting on a sync token.

Also remove unused DeferredGpuCommandService.

Bug: 1353805
Change-Id: I26ea2c6b77de6fda548269ac745d2a73b10a2c6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3843038
Commit-Queue: Bo Liu <boliu@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1039482}
2022-08-25 22:59:32 +00:00
Sean Maher
f36d812785 Change base::Time to base::TimeTicks in GPU initialization start_time
Use base::TimeTicks instead of base::Time to be more accurate due to monotonicity.

Bug: 1350257
Change-Id: I0c3820cb936465237a7d66cbe8e974c1b494bc0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3812398
Reviewed-by: Etienne Bergeron <etienneb@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Sean Maher <spvw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1031745}
2022-08-05 02:33:35 +00:00
David Sanders
9669d510df Add missing includes of thread_task_runner_handle.h in //content
Bug: 1300573
Change-Id: I6fbf67ba8f5973374a8b06c7fe6cba47f39036a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3543797
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: David Sanders <dsanders11@ucsbalum.com>
Cr-Commit-Position: refs/heads/main@{#984348}
2022-03-23 15:39:16 +00:00
Eric Sum
c8607e77db Set global SkFontConfigInterface in the gpu process.
Why: It's a combination of 2 things:
* ChromeOS is beginning to use Skottie for some of its animations.
  The animation may contain text embedded in it, in addition to
  specifying the font for said text.
* ChromeOS uses OOP (out-of-process) raster, meaning all raster
  operations happen in the GPU process. More specifically in this
  case, a skottie animation object is instantiated in the GPU
  process and we call skottie::Animation::render() in it. As such,
  the GPU process must somehow have access to the font cache, or
  Skottie fails to load the appropriate font typeface when rendering.

This follows the exact same pattern as what's done in the render
process (see renderer_blink_platform_impl.cc) and utility process by
connecting to the font service that's hosted in the browser process.

Bug: b:217271404

Cq-Include-Trybots: luci.chrome.try:linux-chromeos-chrome
Change-Id: I4d6dfd1d96f8e412a21c71c0391401848efd4da3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3464510
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Eric Sum <esum@google.com>
Cr-Commit-Position: refs/heads/main@{#972745}
2022-02-18 00:48:03 +00:00
Xiaohan Wang
62737b5015 content/gpu: 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: I0d41c7ac2c83c21206763cee67ce7cb4008b66fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3391492
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@{#959627}
2022-01-15 18:09:02 +00:00
Ted Meyer
68b35b98c2 Plumb GPUInfo into gpu_mojo_media_client for vulkan version information
VaapiVideoDecoder on linux requires Vulkan > 21.1.5, and so requires
a check for this when deciding whether HW video decoding is supported.

Bug: 1236697
Change-Id: I1306dbb0c3fd72f534b33610f1777d59faebffcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3230232
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#943789}
2021-11-20 02:35:23 +00:00
Patrick Monette
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
Patrick Monette
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
Ken Rockot
019750bca5 Revert "Remove primordial IPC Channel from GPU processes"
This reverts commit 6dc0acff58.

Reason for revert: Still breaks some GPU integration tests on Mac ASAN, probably timing issues.

Original change's description:
> Remove primordial IPC Channel from GPU processes
>
> GPU processes do not use this for anything other than monitoring process
> lifetime, implicitly through generic ChildProcessHostImpl and
> ChildThreadImpl behavior. Since these objects are now capable of
> coordinating process lifetime without a legacy IPC Channel present, the
> Channel does not need to exist at all for GPU processes. This CL removes
> it.
>
> Bug: 1196476
> Change-Id: Id4e5231303572f85c37048b58e3f7dbe791d4782
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2986000
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Ken Rockot <rockot@google.com>
> Cr-Commit-Position: refs/heads/master@{#895924}

Bug: 1196476
Change-Id: I36ba8bd735035b2c0a83e5731ed3dfdd76d9cb6d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2988012
Auto-Submit: Ken Rockot <rockot@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Owners-Override: Andy Paicu <andypaicu@google.com>
Cr-Commit-Position: refs/heads/master@{#896034}
2021-06-25 13:52:26 +00:00
Ken Rockot
6dc0acff58 Remove primordial IPC Channel from GPU processes
GPU processes do not use this for anything other than monitoring process
lifetime, implicitly through generic ChildProcessHostImpl and
ChildThreadImpl behavior. Since these objects are now capable of
coordinating process lifetime without a legacy IPC Channel present, the
Channel does not need to exist at all for GPU processes. This CL removes
it.

Bug: 1196476
Change-Id: Id4e5231303572f85c37048b58e3f7dbe791d4782
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2986000
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#895924}
2021-06-25 05:02:39 +00:00
Ken Rockot
2d483bc436 Reland "Remove unused legacy IPC APIs from GPU & Utility processes"
This is a reland of 51c5fcb851
which just removes the unused APIs and omits the the change to
IPC Channel initialization for GPU processes. That change needs
to be investigated further due to subtle breaking side effects
around GpuProcessHost lifetime and/or related events in the
browser.

Original change's description:
> Remove unused legacy IPC APIs from GPU & Utility processes
>
> GPU and Utility processes no longer use any legacy IPCs. This removes
> their process hosts' implementation of IPC::Sender and IPC::Listener
> interfaces, as well as from GpuChildThread.
>
> This also omits initialization of the main legacy IPC Channel for
> GPU processes, as it's no longer used.
>
> Bug: 993189, 1196476
> Change-Id: Ie0e74d09ef1b6bbcd4ebbc2d482dcaebb79481b4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2967049
> Commit-Queue: Ken Rockot <rockot@google.com>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#893274}

Bug: 993189, 1196476
Change-Id: I3c1fe87ecd7e6e9a8d8ee768af4167571e66c5c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2970603
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#893591}
2021-06-17 22:39:02 +00:00
Shrek Shao
060e114d31 Revert "Remove unused legacy IPC APIs from GPU & Utility processes"
This reverts commit 51c5fcb851.

Reason for revert: Mac FYI GPU ASAN Release seems to consistly fails likely caused by low power gpu not used. Try reverting this one since it's the only gpu change in the blamelist

Original change's description:
> Remove unused legacy IPC APIs from GPU & Utility processes
>
> GPU and Utility processes no longer use any legacy IPCs. This removes
> their process hosts' implementation of IPC::Sender and IPC::Listener
> interfaces, as well as from GpuChildThread.
>
> This also omits initialization of the main legacy IPC Channel for
> GPU processes, as it's no longer used.
>
> Bug: 993189, 1196476
> Change-Id: Ie0e74d09ef1b6bbcd4ebbc2d482dcaebb79481b4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2967049
> Commit-Queue: Ken Rockot <rockot@google.com>
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#893274}

Bug: 993189, 1196476, 1221227
Change-Id: Iab2062d99bf6f2c6ce13380709228937e2d32d6f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2969707
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Owners-Override: Shrek Shao <shrekshao@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Cr-Commit-Position: refs/heads/master@{#893534}
2021-06-17 18:54:54 +00:00
Ken Rockot
51c5fcb851 Remove unused legacy IPC APIs from GPU & Utility processes
GPU and Utility processes no longer use any legacy IPCs. This removes
their process hosts' implementation of IPC::Sender and IPC::Listener
interfaces, as well as from GpuChildThread.

This also omits initialization of the main legacy IPC Channel for
GPU processes, as it's no longer used.

Bug: 993189, 1196476
Change-Id: Ie0e74d09ef1b6bbcd4ebbc2d482dcaebb79481b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2967049
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893274}
2021-06-17 02:12:42 +00:00
Ken Rockot
7f8a282a64 Move VizMain to its own interface pipe
VizMain is bound in the GPU process as an interface associated with the
main legacy IPC Channel. That Channel is no longer used for any other
purpose though, so the association serves no purpose. The only legacy
IPC Channels in use by the GPU process are created later, as an
implementation detail of Viz (via EstablishGpuChannel IPCs).

This changes the VizMain interface to use a regular interface pipe
instead of an associated interface.

Bug: None
Change-Id: Id6b3b6352f7d2327ab5c9808893155f2d5ce445a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2806255
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Ken Buchanan <kenrb@chromium.org>
Auto-Submit: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#869760}
2021-04-06 23:27:52 +00:00
Peter Boström
dd7e40ec31 Apply modernize-make-unique to content/
This is a large-scale change: go/chromium-modernize-make-unique

Bug: 1194272
Change-Id: Id035e6a5058ab109a4333f1b8f8225da1c6989e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2803034
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/master@{#869261}
2021-04-05 20:40:10 +00:00
Oksana Zhuravlova
0465118ab1 [android] Notify ProcessVisibilityTracker in the GPU process
This change:
- adds GpuServiceImpl::SetVisibilityChangedCallback() method
to register a callback;
- updates GpuServiceImpl::OnBackgrounded/OnForegrounded to run
the callback on the main thread;
- registers the callback in it GpuChildThread::OnGpuServiceConnection
for an out-of-process GPU service.

This will only work on Android since OnBackgrounded/OnForegrounded is
only called there.

Bug: 1177542
Change-Id: Ia11ff91726f986ad46519a3299fd7e7c12f93dc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2717340
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#859110}
2021-03-02 20:52:20 +00:00
Ken Rockot
2391246064 Delete service_names.mojom
Content hasn't actually used Service Manager-based services in ages, and
these names are only relevant to those things. They're still used by
//chromecast, but in extremely limited capacity.

This moves a few constant definitions into //chromecast C++ code and
wipes out service_names.mojom. Most of the CL is deletion of stale
includes of the generated header.

Bug: 977637
Change-Id: Ica638ae5bd2b1238a998ce76faa943ce85775b5d
Tbr: boliu@chromium.org
Tbr: blundell@chromium.org
Tbr: caseq@chromium.org
Tbr: kinuko@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2568681
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835309}
2020-12-09 19:32:42 +00:00
danakj
db9ae7941a Rename includes from bind_helpers.h to callback_helpers.h
R=dcheng@chromium.org
NOPRESUBMIT=true
TBR=
NOTRY=true

Change-Id: I93bc6a9360997fae7adeab8c01f56e08fc025dd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523543
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826289}
2020-11-11 16:01:35 +00:00
Chunbo Hua
d90bffb2ca Wire GPU workarounds for VEA and VDA.
Bug: 1129754
Change-Id: I6e9c50880541095008f8b71d25455e9a59128f77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2397669
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Gary Kacmarcik <garykac@chromium.org>
Reviewed-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Chunbo Hua <chunbo.hua@intel.com>
Cr-Commit-Position: refs/heads/master@{#811248}
2020-09-28 15:34:36 +00:00
kylechar
4664a16794 Change GPU process mojo error handler
The GPU process mojo error handler would cache the error string for 5
seconds and if a specific crash was triggered the error string would be
put in a crash key. This produced some unexpected error strings, see
https://crbug.com/1075495#c32, for deserialization errors on
viz.mojom.CompositorFrameSink interface between browser and GPU.

Change the error handler to immediately DumpWithoutCrashing() so we get
a stack trace during deserialization. Hopefully the stack trace will
provide some better clues as to what went wrong.

Bug: 1075495
Change-Id: Iaa9d6c0cddb43132603c5c0fffc1e9a76c745631
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2405413
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806878}
2020-09-15 03:19:34 +00:00
Sebastien Marchand
17797d94f0 Record the creation location of the MemoryPressureListener
This also emits a tracing event before calling each listener.

TBRing per https://chromium.googlesource.com/chromium/src/+/master/docs/code_reviews.md#mechanical-changes

TBR: fdoray@chromium.org
Change-Id: I6d73a0f1796dcb06a01cbf9201116639eab37bf1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2244692
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781505}
2020-06-23 20:27:59 +00:00
Patrick To
df5911c50f Kill the GPU process with an error code in exit_on_context_lost
When the exit_on_context_lost workaround is enabled, the GPU process is
terminated when a context lost occurs. This CL causes the termination
to return an error code rather than a normal exit code.

In addition, a normal termination of the GPU process should not block
the domain for WebGL. GpuProcessHost currently blocks WebGL for normal
termination except on Android because terminating for context lost
previously registered as a normal termination. Now that exiting for
context lost is no longer registered as a normal termination, we can
prevent WebGL from being blocked for normal terminations.

Bug: 598400
Change-Id: Ib912f5f905db0d622e8e561a3202d1630ee20afb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2140773
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Patrick To <patrto@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#767923}
2020-05-12 19:31:42 +00:00
Kramer Ge
10cfcc67f6 Clean up legacy IPC code in Ozone(2/3)
OzoneDrmMojo is 100% on. This is 2nd CL to remove more Legacy IPC code in ozone.
Another CL(3/3) will remove ui/ozone/common/gpu/ozone_gpu_message_params.h and related files.

Bug: 620927,806092
Change-Id: Id5cdca9f98677a617a551999d89864f10b753115
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167765
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kramer Ge <fangzhoug@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763571}
2020-04-28 21:49:22 +00:00
Robert Sesek
fc472ffae2 Remove unused content::BrowserContext accessor for service_manager::Connector.
Also removes all the unused #includes for the types.

Change-Id: I50b28c65bf132d8bf970863f9375bc4316781bdb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138504
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758309}
2020-04-10 22:18:38 +00:00
Dale Curtis
1b6becebb4 Ensure GPU logs are not lost during some stages of startup.
Prior to this change there exists a window between when GpuMain()
hands off log collection and when GpuServiceImpl::InitializeWithHost()
starts forwarding to the GpuProcessHost. We have sometimes lost key
debugging logs in these cases.

Now GpuServiceImpl handles collection of GpuMain() logs all the way up
until GpuServiceImpl::InitializeWithHost() takes over, so no logs are
lost during startup.

Fixed: 1065082
Change-Id: I1d0376ca917218cb6cb6c7298ad59021ba6832ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2123329
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754614}
2020-03-30 20:13:35 +00:00
Tom McKee
1467915aef Fix gpu process dependency injection plumbing
When running the GPU process, we use dependency injection to customize
its behaviour through the ExternalDependencies struct. VizMainImpl's
constructor takes an ExternalDependencies parameter and std::moves it to
a member field. Some of the code, however, continued to reference the
parameter instead of the field. This lead to the code assuming that some
dependencies were stubbed out.

This CL updates VizMainImpl's constructor to consistently check the
member field for the injected values and adds tests to check that some
injected values end up in use.

Bug: 1040583
Change-Id: If1c7922f4c7286c2a73afd33572b287ad29f64ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992701
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Tom McKee <tommckee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733385}
2020-01-20 16:06:52 +00:00
kylechar
ae6f313eb9 Remove VizDisplayCompositor feature checks
The feature is launched everywhere so the feature checks are no longer
necessary.

Bug: 936425
Change-Id: I7ad1800cc44dc9260ea2348825b7d11aa330e842
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972314
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726023}
2019-12-18 18:25:14 +00:00
Ken Rockot
a2924176ef GPU: Fix service startup race in GPU process
Recent refactorings have allowed some service interfaces to be bound
in the GPU process before the GPU process is fully initialized. In some
cases this can cause crashes due to use of an uninitialized
GpuServiceFactory instance.

This restores the intended queueing behavior for service interface
binding requests so that their processing is deferred until full GPU
initialization.

Fixed: 1034746
Change-Id: I33e39ca71c977772cdd08a2f8b96b18d9c0e836c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972456
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#725817}
2019-12-18 03:27:05 +00:00
Ken Rockot
965b477924 Move Media Service off Service Manager APIs
This removes dependencies on Service Manager from the Media Service
implementation and public API. The service already had a main
MediaService interface used by the browser, so this just exposes that
directly from a content::GetMediaService() helper API rather than
requiring clients to go through a Service Manager Connector.

This preserves the behavior where the Media Service instance may run
in either the GPU process, the browser process, or a standalone service
process depending on a GN arg value. The logic around this is now
centralized within the content::GetMediaService() implementation.

This also replaces the "media_renderer" service with a slightly less
obscure mechanism -- content::MediaInterfaceProxy will ask the Content
client to create a secondary in-process-only instance of the Media
Service if possible. If created, MediaInterfaceProxy will use the
secondary instance in all the same scenarios where "media_renderer" was
used before. This is functionally equivalent to the behavior before
this change.

Bug: 977637
Change-Id: Ib29ff575f718444032334a1fee8300be7a62528d
Tbr: alexclarke@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1944629
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#724392}
2019-12-12 23:23:01 +00:00
Zhenyao Mo
b1d5bfc25c When shutting down GPU process due to context lost, do it immediately.
Do it in an atomic way rather than cleanly releasing resources, etc.

The latter has been the source of many hangs and crashes. It's not
worth the efforts.

When browser process exits, I believe we already shuts down GPU
process atomically.

After this change, the only clean exit for GPU process is the
unsandboxed GPU process that is to collect extra GPU information.
It needs to shut down cleanly to make sure the info collected
has been received by browser process.

BUG=896565,1018233,1027137
TEST=manual
R=kbr@chromium.org,sunnyps@chromium.org

Change-Id: I082a06945d261db0fb9a4549859adf1e057212ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949671
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721319}
2019-12-04 02:20:24 +00:00
Ken Rockot
41856b6533 Remove most remaining ConnectionFilter references
This removes most remaining references to ConnectionFilter and its
related headers. Any actual usage here is replaced with use of the
ChildProcess API in conjunction with a BinderMap.

Also deletes common_browser_interfaces.cc/h which haven't actually
been built for some time now.

Bug: 977637
Change-Id: Iaff4abfa569414c4f143292ae32dec2beb853c51
Tbr: boliu@chromium.org
Tbr: yucliu@chromium.org
Tbr: rouslan@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1910846
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715738}
2019-11-15 17:37:30 +00:00
Ken Rockot
6d9ed95036 Move GPU interfaces off of Service Manager
This changes the GPU process to expose browser-facing interfaces through
the Content ChildProcess interface.

ChildThreadImpl now allows subclasses to provide a BinderMap to handle
incoming interface binding requests from the browser. This is a fairly
simple drop-in replacement for what used to be done through
the Service Manager with a ConnectionFilter.

There should be no behavioral changes here. In particular for
GPU interfaces, this CL is careful to preserve the behavior which avoids
binding incoming interface receivers until |OnGpuServiceConnection()| is
invoked.

Bug: 977637
Change-Id: Id00a1f0b1178f9c3fed2816eea9808f162829798
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1905050
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#714969}
2019-11-13 17:20:47 +00:00
Miyoung Shin
18de6bf3cc Convert AndroidOverlayProvider to new Mojo types
This CL converts AndroidOverlayProvider{Ptr, Request} in content
and media to the new Mojo type.

Bug: 955171
Change-Id: I77b964ffa895c4e1260f25f8e8de1a9c1b8e9348
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864775
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Cr-Commit-Position: refs/heads/master@{#706809}
2019-10-17 07:06:24 +00:00
Robert Sesek
4fed6f1e6a Split some Mojo binding sites into _receiver_bindings files under SECURITY_OWNERS review.
With the Service Manager going away, the manifest files that previously
mediated access to Mojo services across processes are going away too.
Under the new system, various //content classes have methods that bind
mojo::Receiver<T> objects via GenericPendingReceiver. Since these call
sites control access to objects across a privilege boundary, they should
be under the SECURITY_OWNERS review system.

This first pass splits out several //content and //chrome ones, but
more to come.

Bug: 1012033
Change-Id: Ic09c825c8503c570393fa7ce4d89b58bb6efe391
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1848416
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706219}
2019-10-15 23:31:01 +00:00
Jeffrey Kardatzke
67d88fb581 Use GpuMemoryBufferFactory instead of Ozone in PlatformVideoFramePool
This removes the usage of Ozone directly in PlatformVideoFramePool via
the associated util file. This will allow for unit testing of more
code since the whole Ozone dependency will not be dragged into this code
and we can mock out the GpuMemoryBufferFactory instead.

Bug: 1007487
Test: Unit tests, video_decode_accelerator_test --use_vd,
video_encode_accelerator_unittest and image_processor_test (same results
as ToT for both), YT playback on nocturne

Change-Id: Iabed106319ace56096a34189b9c8986a03d80653
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827888
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: David Staessens <dstaessens@chromium.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
Cr-Commit-Position: refs/heads/master@{#703849}
2019-10-08 19:02:05 +00:00
Ken Rockot
47c47d8620 Remove most Connector usage from child processes
This removes almost all remaining usage of Connector from child
processes, instead preferring use of ChildProcessHost.BindHostReceiver
to acquire process-scoped interfaces from the browser.

The one remaining use case after this CL is for the Device Service's
PowerMonitor API. This is left as a separate change because it requires
substantial additional support code for testing.

Bug: 977637
Change-Id: I679c6d7f5ec01d1bc1bb6852e0f79a3f1650df34
Tbr: penghuang@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1815731
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700317}
2019-09-26 17:38:07 +00:00
Ken Rockot
8322a04ad5 Move Shape Detection off Service Manager
This service is run in the GPU process and its interfaces are bound only
by the browser, brokering unfiltered requests from renderers. Logic is
simplified by removing all dependencies on Service Manager APIs, in
favor of the browser's brokering logic talking directly to
GpuProcessHost and maintaining a persistent connection to the service.

Bug: 977637
Change-Id: I9047889de659b8ff61df4bae40867d3b81d8127f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761689
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688616}
2019-08-20 18:02:00 +00:00
Bo Liu
a7b2ce6dc4 Add VizCompositorThreadRunnerWebView
Make VizCompositorThreadRunner into an abstract interface and move the
existing implementation to VizCompositorThreadRunnerImpl. Then add
VizCompositorThreadRunnerWebView which will be webview's entry point
into creating and establishing viz objects.

Add code paths to ContentGpuClient so that webview can optionally
override the default instance.

Currently VizCompositorThreadRunnerWebView doesn't do much, except it
uses TaskQueueViz and exposes a simple API to run and block for work on
viz while allowing viz to schedule tasks on the render thread.

Bug: 805739
Change-Id: Ic5d2c45666ebc1fc9381c8cd5c71b0de57dd0136
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1731135
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683768}
2019-08-02 22:16:23 +00:00
Miyoung Shin
2be27f5c11 Rename traits and mojo directory in //services/viz/privileged
This CL renames mojo to mojom and *_struct_traits.* to
*_mojom_traits.* in //services/viz/privileged.

*_struct_traits.* => *_mojom_traits.*
services/viz/privileged/interfaces => services/viz/privileged/mojom

Bug: 806965
Change-Id: I5ab3e9200b2a9eb31651a416e55d2110434e803a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715171
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681639}
2019-07-27 15:35:39 +00:00