blob: 96278c01581b59ee723202b9019110771cf9083b [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2012 The Chromium Authors
[email protected]b48c9182011-10-26 18:03:302// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
6#define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
[email protected]b48c9182011-10-26 18:03:307
dcheng59716272016-04-09 05:19:088#include <memory>
Arthur Sonzognic686e8f2024-01-11 08:36:379#include <optional>
dcheng59716272016-04-09 05:19:0810
Jan Keitel748d58e02024-01-19 21:55:3811#include "base/callback_list.h"
Avi Drissmanadac21992023-01-11 23:46:3912#include "base/functional/callback_helpers.h"
Francois Doray6d3c649692017-06-16 19:20:2513#include "base/gtest_prod_util.h"
Ali Hijazid87307d2022-11-07 20:15:0314#include "base/memory/raw_ref.h"
[email protected]57624ab2013-08-01 16:01:5115#include "base/memory/ref_counted.h"
Gabriel Charetteeadf58862019-08-29 05:20:2716#include "base/task/thread_pool/thread_pool_instance.h"
Gabriel Charette7870bb62021-11-30 14:32:5017#include "base/types/strong_alias.h"
avib7348942015-12-25 20:57:1018#include "build/build_config.h"
John Abd-El-Malekf3243dc2021-05-07 16:20:0119#include "content/browser/browser_process_io_thread.h"
Lei Zhang7ab313752021-11-17 01:26:0020#include "content/common/content_export.h"
[email protected]57624ab2013-08-01 16:01:5121#include "content/public/browser/browser_main_runner.h"
Scott Violeta35f9a42018-03-22 22:00:4422#include "media/media_buildflags.h"
Miyoung Shin99505dd2019-07-27 12:45:3523#include "services/viz/public/mojom/compositing/compositing_mode_watcher.mojom.h"
Scott Violetb72577d2019-01-09 22:18:1824#include "ui/base/buildflags.h"
Eriko Kurimotobb0e760c2023-12-04 15:13:2025#include "ui/base/ozone_buildflags.h"
[email protected]b48c9182011-10-26 18:03:3026
sadrul578205fa2016-04-11 22:43:5627#if defined(USE_AURA)
28namespace aura {
29class Env;
30}
31#endif
32
[email protected]b48c9182011-10-26 18:03:3033namespace base {
[email protected]2f3b1cc2014-03-17 23:07:1534class CommandLine;
[email protected]89bf27e2013-06-27 18:04:5635class HighResolutionTimerManager;
gab3ee0e442016-12-16 17:43:1136class MemoryPressureMonitor;
kylecharee7cefd2017-07-13 16:05:0337class SingleThreadTaskRunner;
[email protected]b48c9182011-10-26 18:03:3038class SystemMonitor;
[email protected]111494e2013-07-24 18:38:2939} // namespace base
[email protected]b48c9182011-10-26 18:03:3040
Ken Rockot27a62d52019-10-30 01:57:0141namespace data_decoder {
42class ServiceProvider;
43}
44
sadrul059bc532017-07-05 21:22:1645namespace gpu {
46class GpuChannelEstablishFactory;
47}
48
[email protected]67dfea902012-04-03 01:49:0949namespace media {
alokp2cbd4fc2017-05-13 04:13:2450class AudioManager;
olkaef762c92017-02-06 16:45:1651class AudioSystem;
Xiaohan Wang1ecfd002022-01-19 22:33:1052#if BUILDFLAG(IS_WIN)
mcasas96388e92016-03-02 02:18:0753class SystemMessageWindowWin;
Xiaohan Wang1ecfd002022-01-19 22:33:1054#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV)
mcasas9d2063682016-02-11 22:12:3955class DeviceMonitorLinux;
56#endif
toyoshim59e319712016-10-13 06:43:2957} // namespace media
58
toyoshim78b9d632015-05-08 04:58:3159namespace midi {
toyoshim967340a2016-12-15 06:18:2960class MidiService;
toyoshim78b9d632015-05-08 04:58:3161} // namespace midi
[email protected]67dfea902012-04-03 01:49:0962
amistrycafcdff2016-06-17 03:33:4863namespace mojo {
Ken Rockotdba46db2018-07-04 18:41:0464namespace core {
amistrycafcdff2016-06-17 03:33:4865class ScopedIPCSupport;
Ken Rockot8a7f35f2018-07-04 19:40:5666} // namespace core
amistrycafcdff2016-06-17 03:33:4867} // namespace mojo
68
[email protected]b48c9182011-10-26 18:03:3069namespace net {
70class NetworkChangeNotifier;
[email protected]111494e2013-07-24 18:38:2971} // namespace net
[email protected]b48c9182011-10-26 18:03:3072
fsamuelea6969822017-06-12 21:14:3273namespace viz {
danakjab9ef4d2017-10-31 23:38:3374class CompositingModeReporterImpl;
Fady Samueldea5e8f2017-07-19 21:41:3375class HostFrameSinkManager;
François Dorayf6b9b342019-07-15 15:34:3476} // namespace viz
fsamuelea6969822017-06-12 21:14:3277
[email protected]b48c9182011-10-26 18:03:3078namespace content {
Greg Thompsond97b8382023-08-22 10:18:3979class BrowserAccessibilityStateImpl;
[email protected]b48c9182011-10-26 18:03:3080class BrowserMainParts;
Alex Attar63ab3bd2023-07-11 19:31:4481class BackgroundTracingManager;
[email protected]2208a74d2012-10-29 17:09:4482class BrowserOnlineStateObserver;
[email protected]c38831a12011-10-28 12:44:4983class BrowserThreadImpl;
Tommy Steimel561c68b2019-01-24 07:27:0484class MediaKeysListenerManagerImpl;
[email protected]1d232b92012-10-29 17:39:0785class MediaStreamManager;
ananta73296c572016-08-15 21:58:2586class SaveFileManager;
braveyaoab81ed652018-10-03 17:37:5187class ScreenlockMonitor;
Ayu Ishiiae5d9bf2020-05-01 18:50:0988class SmsProvider;
[email protected]fcb8e0212012-10-29 11:57:1889class SpeechRecognitionManagerImpl;
[email protected]232e09d2013-08-27 15:29:5690class StartupTaskRunner;
Ehsan Chiniforooshanc77b44e2017-10-10 18:12:1091class TracingControllerImpl;
[email protected]97646c92012-07-31 20:30:0892struct MainFunctionParams;
93
erikchencfb4c3832018-08-13 20:49:2894namespace responsiveness {
95class Watcher;
96} // namespace responsiveness
97
Xiaohan Wang1ecfd002022-01-19 22:33:1098#if BUILDFLAG(IS_ANDROID)
jonross36980292014-10-08 15:55:1099class ScreenOrientationDelegate;
[email protected]97646c92012-07-31 20:30:08100#endif
[email protected]b48c9182011-10-26 18:03:30101
[email protected]53ab4802012-04-12 22:14:35102// Implements the main browser loop stages called from BrowserMainRunner.
[email protected]b48c9182011-10-26 18:03:30103// See comments in browser_main_parts.h for additional info.
[email protected]89acda82013-06-25 20:52:50104class CONTENT_EXPORT BrowserMainLoop {
[email protected]b48c9182011-10-26 18:03:30105 public:
[email protected]aa445462013-06-21 17:12:36106 // Returns the current instance. This is used to get access to the getters
107 // that return objects which are owned by this class.
108 static BrowserMainLoop* GetInstance();
109
Xi Han57b856f82018-06-22 18:10:10110 static media::AudioManager* GetAudioManager();
111
Gabriel Charette43fd3702019-05-29 16:36:51112 // The ThreadPoolInstance must exist but not to be started when building
Xi Hanf19a89e82018-06-14 13:26:30113 // BrowserMainLoop.
Xi Han8012e462018-10-05 19:52:30114 explicit BrowserMainLoop(
Gabriel Charettefbeeb1c2021-11-10 20:50:06115 MainFunctionParams parameters,
Gabriel Charette43fd3702019-05-29 16:36:51116 std::unique_ptr<base::ThreadPoolInstance::ScopedExecutionFence> fence);
Peter Boström828b9022021-09-21 02:28:43117
118 BrowserMainLoop(const BrowserMainLoop&) = delete;
119 BrowserMainLoop& operator=(const BrowserMainLoop&) = delete;
120
[email protected]b48c9182011-10-26 18:03:30121 virtual ~BrowserMainLoop();
122
Xi Han4090dcc2018-07-11 03:15:20123 void Init();
[email protected]b48c9182011-10-26 18:03:30124
Scott Violet9068b4df2018-01-12 16:44:21125 // Return value is exit status. Anything other than RESULT_CODE_NORMAL_EXIT
126 // is considered an error.
127 int EarlyInitialization();
thestig7e202d1a2015-05-27 21:54:55128
[email protected]d957b102014-04-25 20:17:19129 // Initializes the toolkit. Returns whether the toolkit initialization was
130 // successful or not.
131 bool InitializeToolkit();
thestig7e202d1a2015-05-27 21:54:55132
Gabriel Charette09c6a96e2021-05-17 14:52:59133 void PreCreateMainMessageLoop();
Gabriel Charettec716bcf32021-03-16 16:25:35134 // Creates the main message loop, bringing APIs like
Sean Maher70f2942932023-01-04 22:15:06135 // SingleThreadTaskRunner::GetCurrentDefault() online.
Gabriel Charette09c6a96e2021-05-17 14:52:59136 void CreateMainMessageLoop();
137 void PostCreateMainMessageLoop();
[email protected]f573ed6b2012-02-10 15:58:52138
Alexander Dunaev05210172022-01-19 19:43:09139 // Creates a "bare" message loop that is required to exit gracefully at the
140 // early stage if the toolkit failed to initialise.
141 void CreateMessageLoopForEarlyShutdown();
142
[email protected]232e09d2013-08-27 15:29:56143 // Create and start running the tasks we need to complete startup. Note that
144 // this can be called more than once (currently only on Android) if we get a
145 // request for synchronous startup while the tasks created by asynchronous
Gabriel Charettec716bcf32021-03-16 16:25:35146 // startup are still running. Completes tasks synchronously as part of this
147 // method on non-Android platforms.
[email protected]57624ab2013-08-01 16:01:51148 void CreateStartupTasks();
[email protected]f573ed6b2012-02-10 15:58:52149
Gabriel Charettec716bcf32021-03-16 16:25:35150 // Performs the default message loop run logic.
151 void RunMainMessageLoop();
152
153 // Performs the pre-shutdown steps.
154 void PreShutdown();
[email protected]f573ed6b2012-02-10 15:58:52155
156 // Performs the shutdown sequence, starting with PostMainMessageLoopRun
157 // through stopping threads to PostDestroyThreads.
158 void ShutdownThreadsAndCleanUp();
[email protected]b48c9182011-10-26 18:03:30159
160 int GetResultCode() const { return result_code_; }
161
Shelley Vohr98d85352021-10-28 17:11:36162 // Needed by some embedders.
163 void SetResultCode(int code) { result_code_ = code; }
164
Olga Sharonova57964cb2018-05-17 11:08:00165 media::AudioManager* audio_manager() const;
Olga Sharonova57964cb2018-05-17 11:08:00166 bool AudioServiceOutOfProcess() const;
olkaef762c92017-02-06 16:45:16167 media::AudioSystem* audio_system() const { return audio_system_.get(); }
[email protected]aa445462013-06-21 17:12:36168 MediaStreamManager* media_stream_manager() const {
169 return media_stream_manager_.get();
170 }
Tommy Steimel561c68b2019-01-24 07:27:04171 MediaKeysListenerManagerImpl* media_keys_listener_manager() const {
172 return media_keys_listener_manager_.get();
173 }
Marina Ciocea350907942018-05-07 07:54:23174
Eriko Kurimoto64656462022-07-21 01:07:49175#if BUILDFLAG(IS_CHROMEOS)
John Abd-El-Malek03438952019-05-16 22:53:51176 // Only expose this on ChromeOS since it's only needed there. On Android this
177 // be null if this process started in reduced mode.
178 net::NetworkChangeNotifier* network_change_notifier() const {
179 return network_change_notifier_.get();
180 }
Marina Ciocea350907942018-05-07 07:54:23181#endif
182
toyoshim967340a2016-12-15 06:18:29183 midi::MidiService* midi_service() const { return midi_service_.get(); }
[email protected]52e456b92012-02-23 17:13:18184
kylecharee7cefd2017-07-13 16:05:03185 // Returns the task runner for tasks that that are critical to producing a new
186 // CompositorFrame on resize. On Mac this will be the task runner provided by
187 // WindowResizeHelperMac, on other platforms it will just be the thread task
188 // runner.
189 scoped_refptr<base::SingleThreadTaskRunner> GetResizeTaskRunner();
190
sadrul059bc532017-07-05 21:22:16191 gpu::GpuChannelEstablishFactory* gpu_channel_establish_factory() const;
192
Xiaohan Wang1ecfd002022-01-19 22:33:10193#if BUILDFLAG(IS_ANDROID)
Bo Liu79c92c3b2017-06-28 18:52:25194 void SynchronouslyFlushStartupTasks();
Alex Clarkebc880882019-04-05 16:48:00195
196 // |enabled| Whether or not CreateStartupTasks() posts any tasks. This is
197 // useful because some javatests want to test native task posting without the
198 // whole browser loaded. In that scenario tasks posted by CreateStartupTasks()
199 // may crash if run.
200 static void EnableStartupTasks(bool enabled);
Xiaohan Wang1ecfd002022-01-19 22:33:10201#endif // BUILDFLAG(IS_ANDROID)
Bo Liu79c92c3b2017-06-28 18:52:25202
Xiaohan Wang1ecfd002022-01-19 22:33:10203#if !BUILDFLAG(IS_ANDROID)
danakj4def4a242017-06-24 01:18:37204 // TODO(fsamuel): We should find an object to own HostFrameSinkManager on all
fsamuelea6969822017-06-12 21:14:32205 // platforms including Android. See http://crbug.com/732507.
danakj4def4a242017-06-24 01:18:37206 viz::HostFrameSinkManager* host_frame_sink_manager() const {
207 return host_frame_sink_manager_.get();
fsamuelea6969822017-06-12 21:14:32208 }
209#endif
210
Gyuyoung Kim11f483a12019-09-18 02:15:13211 // Binds a receiver to the singleton CompositingModeReporter.
danakjab9ef4d2017-10-31 23:38:33212 void GetCompositingModeReporter(
Gyuyoung Kim11f483a12019-09-18 02:15:13213 mojo::PendingReceiver<viz::mojom::CompositingModeReporter> receiver);
danakjab9ef4d2017-10-31 23:38:33214
Ayu Ishiiae5d9bf2020-05-01 18:50:09215 SmsProvider* GetSmsProvider();
216 void SetSmsProviderForTesting(std::unique_ptr<SmsProvider>);
217
Scott Violeta41777b2018-01-18 20:43:41218 BrowserMainParts* parts() { return parts_.get(); }
219
Michael Thiessenc8842d02023-02-16 17:06:02220 // This should only be called after the IO thread has been started (and will
221 // crash otherwise). May block on the thread ID being initialized if the IO
222 // thread ThreadMain has not yet run.
223 base::PlatformThreadId GetIOThreadId();
224
[email protected]b48c9182011-10-26 18:03:30225 private:
Francois Doray6d3c649692017-06-16 19:20:25226 FRIEND_TEST_ALL_PREFIXES(BrowserMainLoopTest, CreateThreadsInSingleProcess);
Carlos Caballeroe840fc32019-05-27 14:16:37227 FRIEND_TEST_ALL_PREFIXES(
228 BrowserMainLoopTest,
229 PostTaskToIOThreadBeforeThreadCreationDoesNotRunTask);
Francois Doray6d3c649692017-06-16 19:20:25230
[email protected]57624ab2013-08-01 16:01:51231 // Called just before creating the threads
232 int PreCreateThreads();
233
234 // Create all secondary threads.
235 int CreateThreads();
236
Xi Cheng8c9653712018-01-24 06:07:27237 // Called just after creating the threads.
238 int PostCreateThreads();
Gabriel Charettec716bcf32021-03-16 16:25:35239 void PostCreateThreadsImpl();
[email protected]57624ab2013-08-01 16:01:51240
241 int PreMainMessageLoopRun();
[email protected]99907362012-01-11 05:41:40242
Gabriel Charette7870bb62021-11-30 14:32:50243 // One last opportunity to intercept the upcoming MainMessageLoopRun (or
244 // before yielding to the native loop on Android). Returns false iff the run
245 // should proceed after this call.
246 using ProceedWithMainMessageLoopRun =
247 base::StrongAlias<class ProceedWithMainMessageLoopRunTag, bool>;
248 ProceedWithMainMessageLoopRun InterceptMainMessageLoopRun();
249
sadrula15cfccb2016-08-08 18:04:07250 void InitializeMojo();
[email protected]1eb14612013-11-21 01:04:58251
Olga Sharonovac0c0d242018-06-19 10:13:47252 void InitializeAudio();
alokp2cbd4fc2017-05-13 04:13:24253
boliu7439d042015-01-27 22:51:11254 bool UsingInProcessGpu() const;
thestig7e202d1a2015-05-27 21:54:55255
bashi58dd2fa2016-10-17 00:01:07256 void InitializeMemoryManagementComponent();
257
thestig7e202d1a2015-05-27 21:54:55258 // Quick reference for initialization order:
259 // Constructor
260 // Init()
261 // EarlyInitialization()
262 // InitializeToolkit()
Gabriel Charette09c6a96e2021-05-17 14:52:59263 // PreCreateMainMessageLoop()
264 // CreateMainMessageLoop()
265 // PostCreateMainMessageLoop()
thestig7e202d1a2015-05-27 21:54:55266 // CreateStartupTasks()
267 // PreCreateThreads()
Gabriel Charettec716bcf32021-03-16 16:25:35268 // InitializeMemoryManagementComponent()
thestig7e202d1a2015-05-27 21:54:55269 // CreateThreads()
Xi Cheng8c9653712018-01-24 06:07:27270 // PostCreateThreads()
Gabriel Charettec716bcf32021-03-16 16:25:35271 // PostCreateThreadsImpl()
272 // InitializeMojo()
273 // InitializeAudio()
274 // PreMainMessageLoopRun()
275 // MainMessageLoopRun()
Gabriel Charettee35e7db2021-05-12 15:30:02276 // OnFirstIdle()
boliu7439d042015-01-27 22:51:11277
[email protected]b48c9182011-10-26 18:03:30278 // Members initialized on construction ---------------------------------------
Gabriel Charettefbeeb1c2021-11-10 20:50:06279 MainFunctionParams parameters_;
Ali Hijazid87307d2022-11-07 20:15:03280 const raw_ref<const base::CommandLine> parsed_command_line_;
[email protected]b48c9182011-10-26 18:03:30281 int result_code_;
thestig7e202d1a2015-05-27 21:54:55282 bool created_threads_; // True if the non-UI threads were created.
Xi Han8012e462018-10-05 19:52:30283 // //content must be initialized single-threaded until
284 // BrowserMainLoop::CreateThreads() as things initialized before it require an
285 // initialize-once happens-before relationship with all eventual content tasks
286 // running on other threads. This ScopedExecutionFence ensures that no tasks
Gabriel Charette52fa3ae2019-04-15 21:44:37287 // posted to ThreadPool gets to run before CreateThreads(); satisfying this
Gabriel Charette43fd3702019-05-29 16:36:51288 // requirement even though the ThreadPoolInstance is created and started
289 // before content is entered.
290 std::unique_ptr<base::ThreadPoolInstance::ScopedExecutionFence>
Xi Han8012e462018-10-05 19:52:30291 scoped_execution_fence_;
[email protected]b48c9182011-10-26 18:03:30292
François Dorayf6b9b342019-07-15 15:34:34293 // BEST_EFFORT tasks are not allowed to run between //content initialization
294 // and startup completion.
295 //
296 // TODO(fdoray): Move this to a more elaborate class that prevents BEST_EFFORT
297 // tasks from running when resources are needed to respond to user actions.
Arthur Sonzognic686e8f2024-01-11 08:36:37298 std::optional<base::ThreadPoolInstance::ScopedBestEffortExecutionFence>
François Dorayf6b9b342019-07-15 15:34:34299 scoped_best_effort_execution_fence_;
300
Gabriel Charettee35e7db2021-05-12 15:30:02301 // Members initialized in |Init()| -------------------------------------------
302 std::unique_ptr<mojo::core::ScopedIPCSupport> mojo_ipc_support_;
thestig7e202d1a2015-05-27 21:54:55303
Gabriel Charettee35e7db2021-05-12 15:30:02304 // Members initialized in |InitializeToolkit()| ------------------------------
sadrul578205fa2016-04-11 22:43:56305#if defined(USE_AURA)
306 std::unique_ptr<aura::Env> env_;
307#endif
308
Gabriel Charette09c6a96e2021-05-17 14:52:59309 // Members initialized in |PostCreateMainMessageLoop()| ----------------------
Gabriel Charettee35e7db2021-05-12 15:30:02310 std::unique_ptr<base::SystemMonitor> system_monitor_;
311 std::unique_ptr<base::HighResolutionTimerManager> hi_res_timer_manager_;
312 std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_;
313 std::unique_ptr<ScreenlockMonitor> screenlock_monitor_;
314 // Per-process listener for online state changes.
315 std::unique_ptr<BrowserOnlineStateObserver> online_state_observer_;
Xiaohan Wang1ecfd002022-01-19 22:33:10316#if BUILDFLAG(IS_ANDROID)
jonross36980292014-10-08 15:55:10317 // Android implementation of ScreenOrientationDelegate
dcheng59716272016-04-09 05:19:08318 std::unique_ptr<ScreenOrientationDelegate> screen_orientation_delegate_;
jonross36980292014-10-08 15:55:10319#endif
Greg Thompsond97b8382023-08-22 10:18:39320 std::unique_ptr<BrowserAccessibilityStateImpl> browser_accessibility_state_;
chrishadc837f52015-05-15 03:09:06321
Gabriel Charettee35e7db2021-05-12 15:30:02322 // Destroy |parts_| before above members (except the ones that are explicitly
323 // reset() on shutdown) but after |main_thread_| and services below.
dcheng59716272016-04-09 05:19:08324 std::unique_ptr<BrowserMainParts> parts_;
[email protected]50462bf02011-11-21 19:13:31325
Gabriel Charette09c6a96e2021-05-17 14:52:59326 // Members initialized in |CreateMainMessageLoop()| --------------------------
thestig7e202d1a2015-05-27 21:54:55327 // This must get destroyed before other threads that are created in |parts_|.
dcheng59716272016-04-09 05:19:08328 std::unique_ptr<BrowserThreadImpl> main_thread_;
[email protected]60b122d2012-01-09 23:00:07329
thestig7e202d1a2015-05-27 21:54:55330 // Members initialized in |CreateStartupTasks()| -----------------------------
dcheng59716272016-04-09 05:19:08331 std::unique_ptr<StartupTaskRunner> startup_task_runner_;
[email protected]99907362012-01-11 05:41:40332
thestig7e202d1a2015-05-27 21:54:55333 // Members initialized in |PreCreateThreads()| -------------------------------
334 // Torn down in ShutdownThreadsAndCleanUp.
dcheng59716272016-04-09 05:19:08335 std::unique_ptr<base::MemoryPressureMonitor> memory_pressure_monitor_;
thestig7e202d1a2015-05-27 21:54:55336
Gabriel Charettee35e7db2021-05-12 15:30:02337 // Members initialized in |CreateThreads()| ----------------------------------
338 std::unique_ptr<BrowserProcessIOThread> io_thread_;
339
340 // BEGIN Members initialized in |PostCreateThreads()| ------------------------
341 // ***************************************************************************
Tommy Steimel561c68b2019-01-24 07:27:04342 std::unique_ptr<MediaKeysListenerManagerImpl> media_keys_listener_manager_;
[email protected]b48c9182011-10-26 18:03:30343
Ken Rockot27a62d52019-10-30 01:57:01344 // Support for out-of-process Data Decoder.
345 std::unique_ptr<data_decoder::ServiceProvider> data_decoder_service_provider_;
346
Olga Sharonova57964cb2018-05-17 11:08:00347 // |audio_manager_| is not instantiated when the audio service runs out of
348 // process.
alokp2cbd4fc2017-05-13 04:13:24349 std::unique_ptr<media::AudioManager> audio_manager_;
Olga Sharonova57964cb2018-05-17 11:08:00350
olkaef762c92017-02-06 16:45:16351 std::unique_ptr<media::AudioSystem> audio_system_;
[email protected]cec95632014-07-02 18:01:50352
toyoshim967340a2016-12-15 06:18:29353 std::unique_ptr<midi::MidiService> midi_service_;
thestig7e202d1a2015-05-27 21:54:55354
Kevin Marshallf7882372017-06-06 00:14:34355 // Must be deleted on the IO thread.
356 std::unique_ptr<SpeechRecognitionManagerImpl> speech_recognition_manager_;
357
Xiaohan Wang1ecfd002022-01-19 22:33:10358#if BUILDFLAG(IS_WIN)
dcheng59716272016-04-09 05:19:08359 std::unique_ptr<media::SystemMessageWindowWin> system_message_window_;
Xiaohan Wang1ecfd002022-01-19 22:33:10360#elif (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV)
dcheng59716272016-04-09 05:19:08361 std::unique_ptr<media::DeviceMonitorLinux> device_monitor_linux_;
thestig7e202d1a2015-05-27 21:54:55362#endif
363
dcheng59716272016-04-09 05:19:08364 std::unique_ptr<MediaStreamManager> media_stream_manager_;
ananta73296c572016-08-15 21:58:25365 scoped_refptr<SaveFileManager> save_file_manager_;
Ehsan Chiniforooshanc77b44e2017-10-10 18:12:10366 std::unique_ptr<content::TracingControllerImpl> tracing_controller_;
Alex Attar63ab3bd2023-07-11 19:31:44367 std::unique_ptr<BackgroundTracingManager> background_tracing_manager_;
Xiaohan Wang1ecfd002022-01-19 22:33:10368#if !BUILDFLAG(IS_ANDROID)
danakj4def4a242017-06-24 01:18:37369 std::unique_ptr<viz::HostFrameSinkManager> host_frame_sink_manager_;
thestig7e202d1a2015-05-27 21:54:55370
danakjab9ef4d2017-10-31 23:38:33371 // Reports on the compositing mode in the system for clients to submit
372 // resources of the right type. This is null if the display compositor
373 // is not in this process.
374 std::unique_ptr<viz::CompositingModeReporterImpl>
375 compositing_mode_reporter_impl_;
danakj4ee301c2017-11-29 16:19:43376#endif
Gabriel Charettee35e7db2021-05-12 15:30:02377 // ***************************************************************************
378 // END Members initialized in |PostCreateThreads()| --------------------------
379
380 // Members initialized in |PreMainMessageLoopRun()| --------------------------
381 scoped_refptr<responsiveness::Watcher> responsiveness_watcher_;
Jan Keitel748d58e02024-01-19 21:55:38382 base::CallbackListSubscription idle_callback_subscription_;
Gabriel Charettee35e7db2021-05-12 15:30:02383
384 // Members not associated with a specific phase.
Gabriel Charettee35e7db2021-05-12 15:30:02385 std::unique_ptr<SmsProvider> sms_provider_;
danakjab9ef4d2017-10-31 23:38:33386
thestig7e202d1a2015-05-27 21:54:55387 // DO NOT add members here. Add them to the right categories above.
[email protected]b48c9182011-10-26 18:03:30388};
389
390} // namespace content
391
392#endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_