0
Commit Graph

13 Commits

Author SHA1 Message Date
ahmedmoussa
8ab9f7ac5c Setup GPU channel for video capture utility service on macOS
Build GPU channel by creating the viz::Gpu in the video capture utility
service, which is bind to viz::GpuClient of browser process. By this
way, video capture service can setup GPU channel to GPU process on
macOS platform to create shared images.

Bug: b:337294218
Change-Id: I8388baa24a7a3cafdfdbce6cea16ec931386adcd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5906709
Reviewed-by: Markus Handell <handellm@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Ahmed Moussa <ahmedmoussa@google.com>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1365112}
2024-10-07 20:13:36 +00:00
Colin Blundell
d659f10dbf [Viz] Remove GpuClient error connection handler
This functionality is unused, as all creators of GpuClient pass
base::DoNothing as the error connection handler.

Credit goes to vasilyt@ for noticing this on [1].

[1] https://chromium-review.googlesource.com/c/chromium/src/+/5573408

Bug: 342905184
Change-Id: I8882b13ce1af28a050bb69e8785522989b0c79d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5577895
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1307352}
2024-05-29 12:38:10 +00:00
Alex Gough
6a170e6d5f Reland "Guard binding viz.mojom.gpu in utilities"
This is a reland of commit 96dbfbb77a

bool fields changed to std::optional<> to ensure they are initialized
in all cases. Fixes failures on msan builds.

Original change's description:
> Guard binding viz.mojom.gpu in utilities
>
> Adds WithGpuClient() option and associated passkeys to the service
> process host so that only allowed utilities can access the gpu
> service by directly binding viz.mojom.gpu.
>
> Bug: 328099369
> Change-Id: I6561bd5f2f5ec41241c8fe2582fab83ea37d880a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5342901
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Commit-Queue: Alex Gough <ajgo@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1268729}

Bug: 328099369
Change-Id: I9ed8f30d28ef6b56ff27833a7df651d2599e0722
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5347643
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269305}
2024-03-07 00:07:22 +00:00
Mikihito Matsuura
f63d17d80b Revert "Guard binding viz.mojom.gpu in utilities"
This reverts commit 96dbfbb77a.

Reason for revert: Triggered MSAN failure
https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20ChromiumOS%20MSan%20Tests/41639/overview
```
==4524==WARNING: MemorySanitizer: use-of-uninitialized-value
     0x55ee8437b6b0 in content::(anonymous namespace)::LaunchServiceProcess(mojo::GenericPendingReceiver, content::ServiceProcessHost::Options, sandbox::mojom::Sandbox) ./../../content/browser/service_process_host_impl.cc:206:7
```

Original change's description:
> Guard binding viz.mojom.gpu in utilities
>
> Adds WithGpuClient() option and associated passkeys to the service
> process host so that only allowed utilities can access the gpu
> service by directly binding viz.mojom.gpu.
>
> Bug: 328099369
> Change-Id: I6561bd5f2f5ec41241c8fe2582fab83ea37d880a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5342901
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Commit-Queue: Alex Gough <ajgo@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1268729}

Bug: 328099369
Change-Id: I8331e3cfa5e90092d983af0402407a845ba6cbbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5348435
Owners-Override: Mikihito Matsuura <mikt@google.com>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Mikihito Matsuura <mikt@google.com>
Commit-Queue: Mikihito Matsuura <mikt@google.com>
Cr-Commit-Position: refs/heads/main@{#1268854}
2024-03-06 02:43:15 +00:00
Alex Gough
96dbfbb77a Guard binding viz.mojom.gpu in utilities
Adds WithGpuClient() option and associated passkeys to the service
process host so that only allowed utilities can access the gpu
service by directly binding viz.mojom.gpu.

Bug: 328099369
Change-Id: I6561bd5f2f5ec41241c8fe2582fab83ea37d880a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5342901
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Alex Gough <ajgo@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1268729}
2024-03-05 22:17:20 +00:00
seannli
665baba117 camera: Setup GPU channel for video capture utility service on ChromeOS
Build GPU channel by creating the viz::Gpu in the video capture utility
service, which is bind to viz::GpuClient of browser process. By this
way, video capture service can setup GPU channel to GPU process on
ChromeOS platform to create shared images.

Bug: b:314233378
Test: Verified that gpu buffer manager is available in utility process
Change-Id: I6e020b55efe6078fedc7739178f9f6202e4e8adb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5100650
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Sean Li <seannli@google.com>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1238439}
2023-12-17 02:51:13 +00:00
Yan,Shaobo
fc5d4227f3 Setup GPU channel for video capture utility service on Windows
Build GPU channel by creating the viz::Gpu in the video capture utility
service, which is bind to viz::GpuClient of browser process. By this
way, video capture service can setup GPU channel to GPU process on
windows platform to create shared images.

Bug: chromium:1236801
Change-Id: I1773e1c2b93bd35dc7993f39c8561e7002946917
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4619072
Reviewed-by: Ilya Nikolaevskiy <ilnik@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1163347}
2023-06-28 02:19:22 +00:00
Yaowei Zhou
c5cd4eb98d Setup GPU channel for video capture utility service in Linux
Build GPU channel by creating the viz::Gpu in the video capture utility
service, which is bind to viz::GpuClient of browser process. By this
way, video capture service can setup GPU channel to GPU process.

Bug: 1425770
Change-Id: If01c694489f53809efed3cefa591759f4eb23478
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4347663
Reviewed-by: Ilya Nikolaevskiy <ilnik@chromium.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1135084}
2023-04-25 07:54:58 +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
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

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

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Sean McAllister
4a991b979b Refactor OS_LINUX preprocessor directive for LaCrOS effort.
Currently, ChromeOS defines the OS_LINUX directive as well as
OS_CHROMEOS.  We're working to separate these two, so we're
making the fact that OS_LINUX == OS_LINUX || OS_CHROMEOS
explicit.

Bug: 1110266
Change-Id: I1152739ef3e8fbea113a657453fd89108fac0d31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352612
Commit-Queue: Sean McAllister <smcallis@google.com>
Reviewed-by: Luke Halliwell (slow) <halliwell@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Jan Krcal <jkrcal@chromium.org>
Reviewed-by: Vadym Doroshenko  <dvadym@chromium.org>
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799702}
2020-08-19 17:38:51 +00:00
Lingqi Chi
f7ef80f606 Sampling profiler: profile the NetworkService process
In the out-of-process case, network service runs on the IO thread of a
utility process handling network-related tasks. See
services/network/README.md for more details.
To track the utility network service process, this CL enables sampling
profiler in this process. It updates the StackSamplingConfiguration to
turn on the switch of profiler in the network service process. Then when
the switch is on, ChromeContentUtilityClient will create and start a
profiler for the IO thread, and build a message pipe between the utility
network service process and the browser process to pass the collected
profile data.
If the switch is on, the procedure will be:
1. In the |UtilityMain| function, which is the mainline routine of a
utility process, a |ChildProcess| is created. This instance contains the
delegate of the IO thread and its task runner. Then
|ChromeContentUtilityClient::PostIOThreadCreated| will create
and start a profiler for the IO thread.
2. A |UtilityThreadImpl| instance is created in the |UtilityMain| as
well, it will be the main thread of the process. To initialize the
instance, |UtilityThreadImpl::Init| function is called. This function
only runs once in every utility process so, in this function,
|ChromeContentUtilityClient::UtilityThreadStarted| will create a message
pipe between the utility network service process and the browser process
to pass the collected profile data.
Note that there are some in-process utility threads run in other
processes, so please check the process type before setting up the
collector and pipe.
3. More specifically, it will create a |PendingReceiver| of
|CallStackProfileCollector|. And the browser process will receive and
handle this receiver. The path is:
  |ChildThread::BindHostReceiver| =>
  |UtilityProcessHost::BindHostReceiver| =>
  |ChromeContentBrowserClient::BindUtilityHostReceiver|.
In the utility process side, |SetCollectorForChildProcess| is called to
supply the Service Manager's connector; and in the browser process side,
a |CallStackProfileCollector| will be created with the receiver.

Bug: 931432
Change-Id: I245f864089d82aee09c30a42c1606a93cf5ea1c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2186614
Commit-Queue: Lingqi Chi <lingqi@google.com>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: Mike Wittman <wittman@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#777632}
2020-06-12 02:04:46 +00:00
Robert Sesek
2382ca6f69 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 pass splits out BindHostReceiver calls.

Bug: 1012033
Change-Id: I390a26af782953625b603270e3201535ff4ee9d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880315
Reviewed-by: Yuchen Liu <yucliu@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710095}
2019-10-28 23:52:20 +00:00