Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors |
Ken Rockot | 95fe3f6 | 2019-07-25 20:29:51 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/win/util_win_service.h" |
| 6 | |
| 7 | #include "chrome/grit/generated_resources.h" |
Alex Gough | c54b2b2 | 2021-08-20 03:06:32 | [diff] [blame] | 8 | #include "chrome/services/util_win/public/mojom/util_win.mojom.h" |
Ken Rockot | 95fe3f6 | 2019-07-25 20:29:51 | [diff] [blame] | 9 | #include "content/public/browser/service_process_host.h" |
Francois Doray | b1d79a4 | 2024-07-19 20:24:19 | [diff] [blame] | 10 | #include "content/public/common/content_switches.h" |
Ken Rockot | 95fe3f6 | 2019-07-25 20:29:51 | [diff] [blame] | 11 | |
| 12 | mojo::Remote<chrome::mojom::UtilWin> LaunchUtilWinServiceInstance() { |
Francois Doray | b1d79a4 | 2024-07-19 20:24:19 | [diff] [blame] | 13 | content::ServiceProcessHost::Options options; |
| 14 | options.WithDisplayName(IDS_UTILITY_PROCESS_UTILITY_WIN_NAME); |
Francois Pierre Doray | f768ec31 | 2025-03-19 22:16:56 | [diff] [blame] | 15 | options.WithExtraCommandLineSwitches({switches::kMessageLoopTypeUi}); |
Francois Doray | b1d79a4 | 2024-07-19 20:24:19 | [diff] [blame] | 16 | |
Alex Gough | c54b2b2 | 2021-08-20 03:06:32 | [diff] [blame] | 17 | // Runs with kNoSandbox from sandbox.mojom.Sandbox. |
Ken Rockot | 95fe3f6 | 2019-07-25 20:29:51 | [diff] [blame] | 18 | return content::ServiceProcessHost::Launch<chrome::mojom::UtilWin>( |
Francois Doray | b1d79a4 | 2024-07-19 20:24:19 | [diff] [blame] | 19 | options.Pass()); |
Ken Rockot | 95fe3f6 | 2019-07-25 20:29:51 | [diff] [blame] | 20 | } |
Alex Gough | 0c7b109 | 2021-06-25 15:55:45 | [diff] [blame] | 21 | |
| 22 | mojo::Remote<chrome::mojom::ProcessorMetrics> LaunchProcessorMetricsService() { |
Alex Gough | c54b2b2 | 2021-08-20 03:06:32 | [diff] [blame] | 23 | // Runs with kNoSandbox from sandbox.mojom.Sandbox. |
Alex Gough | 0c7b109 | 2021-06-25 15:55:45 | [diff] [blame] | 24 | return content::ServiceProcessHost::Launch<chrome::mojom::ProcessorMetrics>( |
| 25 | content::ServiceProcessHost::Options() |
| 26 | .WithDisplayName(IDS_UTILITY_PROCESS_UTILITY_WIN_NAME) |
| 27 | .Pass()); |
| 28 | } |