blob: 4a8ab42c430e93224a48bd364ca3f692cb24bdad [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2019 The Chromium Authors
Ken Rockot95fe3f62019-07-25 20:29:512// 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 Goughc54b2b22021-08-20 03:06:328#include "chrome/services/util_win/public/mojom/util_win.mojom.h"
Ken Rockot95fe3f62019-07-25 20:29:519#include "content/public/browser/service_process_host.h"
Francois Dorayb1d79a42024-07-19 20:24:1910#include "content/public/common/content_switches.h"
Ken Rockot95fe3f62019-07-25 20:29:5111
12mojo::Remote<chrome::mojom::UtilWin> LaunchUtilWinServiceInstance() {
Francois Dorayb1d79a42024-07-19 20:24:1913 content::ServiceProcessHost::Options options;
14 options.WithDisplayName(IDS_UTILITY_PROCESS_UTILITY_WIN_NAME);
Francois Pierre Dorayf768ec312025-03-19 22:16:5615 options.WithExtraCommandLineSwitches({switches::kMessageLoopTypeUi});
Francois Dorayb1d79a42024-07-19 20:24:1916
Alex Goughc54b2b22021-08-20 03:06:3217 // Runs with kNoSandbox from sandbox.mojom.Sandbox.
Ken Rockot95fe3f62019-07-25 20:29:5118 return content::ServiceProcessHost::Launch<chrome::mojom::UtilWin>(
Francois Dorayb1d79a42024-07-19 20:24:1919 options.Pass());
Ken Rockot95fe3f62019-07-25 20:29:5120}
Alex Gough0c7b1092021-06-25 15:55:4521
22mojo::Remote<chrome::mojom::ProcessorMetrics> LaunchProcessorMetricsService() {
Alex Goughc54b2b22021-08-20 03:06:3223 // Runs with kNoSandbox from sandbox.mojom.Sandbox.
Alex Gough0c7b1092021-06-25 15:55:4524 return content::ServiceProcessHost::Launch<chrome::mojom::ProcessorMetrics>(
25 content::ServiceProcessHost::Options()
26 .WithDisplayName(IDS_UTILITY_PROCESS_UTILITY_WIN_NAME)
27 .Pass());
28}