android_webview
apps
ash
base
build
build_overrides
buildtools
cc
chrome
chromecast
chromeos
cloud_print
codelabs
components
content
app
app_shim_remote_cocoa
browser
accessibility
android
appcache
audio
background_fetch
background_sync
blob_storage
bluetooth
broadcast_channel
browser_plugin
browsing_data
buckets
cache_storage
client_hints
cocoa
code_cache
compositor
contacts
content_index
conversions
cookie_store
device
device_sensors
devtools
direct_sockets
display_cutout
dom_storage
download
federated_learning
file_system
file_system_access
font_access
font_unique_name_lookup
generic_sensor
geolocation
gpu
hid
hyphenation
idle
image_capture
indexed_db
installedapp
keyboard_lock
loader
locks
manifest
media
media_session
memory
native_io
net
notifications
origin_trials
payments
permissions
picture_in_picture
portal
prerender
presentation
process_internals
push_messaging
quota
renderer_host
resources
scheduler
screen_enumeration
screen_orientation
screenlock_monitor
serial
service_worker
shape_detection
sms
speech
ssl
tracing
wake_lock
web_contents
web_database
web_package
webauth
webid
webrtc
websockets
webtransport
webui
worker_host
xr
zygote_host
BUILD.gn
DEPS
OWNERS
PRESUBMIT.py
SITE_ISOLATION_OWNERS
about_url_loader_factory.cc
about_url_loader_factory.h
after_startup_task_utils.cc
after_startup_task_utils.h
back_forward_cache_browsertest.cc
bad_message.cc
bad_message.h
battery_monitor_browsertest.cc
bookmarklet_browsertest.cc
browser_associated_interface_unittest.cc
browser_child_process_host_impl.cc
browser_child_process_host_impl.h
browser_child_process_host_impl_receiver_bindings.cc
browser_context.cc
browser_interface_binders.cc
browser_interface_binders.h
browser_interface_broker_impl.h
browser_main.cc
browser_main.h
browser_main_loop.cc
browser_main_loop.h
browser_main_loop_unittest.cc
browser_main_runner_impl.cc
browser_main_runner_impl.h
browser_process_sub_thread.cc
browser_process_sub_thread.h
browser_thread_browsertest.cc
browser_thread_impl.cc
browser_thread_impl.h
browser_thread_unittest.cc
browser_url_handler_impl.cc
browser_url_handler_impl.h
browser_url_handler_impl_unittest.cc
browsing_instance.cc
browsing_instance.h
byte_stream.cc
byte_stream.h
byte_stream_unittest.cc
can_commit_status.h
child_process_launcher.cc
child_process_launcher.h
child_process_launcher_browsertest.cc
child_process_launcher_helper.cc
child_process_launcher_helper.h
child_process_launcher_helper_android.cc
child_process_launcher_helper_fuchsia.cc
child_process_launcher_helper_linux.cc
child_process_launcher_helper_mac.cc
child_process_launcher_helper_posix.cc
child_process_launcher_helper_posix.h
child_process_launcher_helper_win.cc
child_process_security_policy_browsertest.cc
child_process_security_policy_impl.cc
child_process_security_policy_impl.h
child_process_security_policy_unittest.cc
child_process_task_port_provider_mac.cc
child_process_task_port_provider_mac.h
child_process_task_port_provider_mac_unittest.cc
context_factory.cc
coop_coep_cross_origin_isolated_info.cc
coop_coep_cross_origin_isolated_info.h
cross_origin_opener_policy_browsertest.cc
cross_site_transfer_browsertest.cc
data_decoder_browsertest.cc
data_url_loader_factory.cc
data_url_loader_factory.h
database_browsertest.cc
do_not_track_browsertest.cc
eye_dropper_chooser_impl.cc
eye_dropper_chooser_impl.h
feature_observer.cc
feature_observer.h
field_trial_recorder.cc
field_trial_recorder.h
field_trial_synchronizer.cc
field_trial_synchronizer.h
find_in_page_client.cc
find_in_page_client.h
find_request_manager.cc
find_request_manager.h
find_request_manager_browsertest.cc
font_list_async.cc
font_service.cc
font_service.h
form_controls_browsertest.cc
gpu_data_manager_visual_proxy_ozone_linux.cc
gpu_data_manager_visual_proxy_ozone_linux.h
histogram_controller.cc
histogram_controller.h
histogram_subscriber.h
histogram_synchronizer.cc
histogram_synchronizer.h
histograms_internals_ui.cc
histograms_internals_ui.h
host_zoom_level_context.cc
host_zoom_level_context.h
host_zoom_map_impl.cc
host_zoom_map_impl.h
host_zoom_map_impl_browsertest.cc
host_zoom_map_impl_unittest.cc
initiator_csp_context.cc
initiator_csp_context.h
isolated_origin_browsertest.cc
isolated_origin_util.cc
isolated_origin_util.h
isolation_context.cc
isolation_context.h
keyboard_lock_browsertest.cc
keyboard_lock_browsertest.h
keyboard_lock_browsertest_mac.mm
launch_as_mojo_client_browsertest.cc
log_console_message.cc
log_console_message.h
message_port_provider.cc
message_port_provider_browsertest.cc
mime_registry_impl.cc
mime_registry_impl.h
mojo_binder_policy_applier.cc
mojo_binder_policy_applier.h
mojo_binder_policy_applier_unittest.cc
mojo_binder_policy_map_impl.cc
mojo_binder_policy_map_impl.h
mojo_binder_policy_map_impl_unittest.cc
mojo_sandbox_browsertest.cc
navigation_browsertest.cc
navigation_mhtml_browsertest.cc
navigation_subresource_loader_params.cc
navigation_subresource_loader_params.h
net_info_browsertest.cc
network_context_client_base_impl.cc
network_context_client_base_impl.h
network_context_client_base_impl_unittest.cc
network_service_browsertest.cc
network_service_client.cc
network_service_client.h
network_service_instance_impl.cc
network_service_instance_impl.h
network_service_restart_browsertest.cc
notification_service_impl.cc
notification_service_impl.h
notification_service_impl_unittest.cc
performance_memory_browsertest.cc
plugin_list.cc
plugin_list.h
plugin_list_unittest.cc
plugin_private_storage_helper.cc
plugin_private_storage_helper.h
plugin_service_impl.cc
plugin_service_impl.h
plugin_service_impl_browsertest.cc
pointer_lock_browsertest.cc
pointer_lock_browsertest.h
pointer_lock_browsertest_mac.mm
posix_file_descriptor_info_impl.cc
posix_file_descriptor_info_impl.h
posix_file_descriptor_info_impl_unittest.cc
power_monitor_browsertest.cc
ppapi_plugin_process_host.cc
ppapi_plugin_process_host.h
ppapi_plugin_process_host_receiver_bindings.cc
resource_context_impl.cc
resource_context_impl.h
resource_coordinator_service.cc
resource_loading_browsertest.cc
sandbox_host_linux.cc
sandbox_host_linux.h
sandbox_ipc_linux.cc
sandbox_ipc_linux.h
sandbox_mac_unittest.mm
sandbox_parameters_mac.h
sandbox_parameters_mac.mm
sandbox_support_mac_impl.h
sandbox_support_mac_impl.mm
scoped_active_url.cc
scoped_active_url.h
security_exploit_browsertest.cc
service_process_host_browsertest.cc
service_process_host_impl.cc
service_sandbox_type.h
session_history_browsertest.cc
shareable_file_reference_unittest.cc
site_instance_impl.cc
site_instance_impl.h
site_instance_impl_unittest.cc
site_per_process_browsertest.cc
site_per_process_browsertest.h
site_per_process_hit_test_browsertest.cc
site_per_process_mac_browsertest.mm
site_per_process_unload_browsertest.cc
snapshot_browsertest.cc
ssl_private_key_impl.cc
ssl_private_key_impl.h
startup_data_impl.cc
startup_data_impl.h
startup_helper.cc
startup_helper.h
startup_task_runner.cc
startup_task_runner.h
startup_task_runner_unittest.cc
storage_partition_impl.cc
storage_partition_impl.h
storage_partition_impl_browsertest.cc
storage_partition_impl_map.cc
storage_partition_impl_map.h
storage_partition_impl_map_unittest.cc
storage_partition_impl_unittest.cc
storage_service_restart_browsertest.cc
storage_service_sandbox_browsertest.cc
text_fragment_browsertest.cc
theme_helper.cc
theme_helper.h
theme_helper_mac.h
theme_helper_mac.mm
ukm_internals_ui.cc
ukm_internals_ui.h
url_loader_factory_getter.cc
url_loader_factory_getter.h
url_loader_factory_params_helper.cc
url_loader_factory_params_helper.h
utility_process_host.cc
utility_process_host.h
utility_process_host_browsertest.cc
utility_process_host_receiver_bindings.cc
utility_process_sandbox_browsertest.cc
utility_sandbox_delegate.cc
utility_sandbox_delegate.h
utility_sandbox_delegate_win.cc
v8_snapshot_files.cc
v8_snapshot_files.h
vibration_browsertest.cc
video_capture_service.cc
web_contents_receiver_set_browsertest.cc
webkit_browsertest.cc
worker_network_isolation_key_browsertest.cc
zoom_browsertest.cc
child
common
gpu
ppapi_plugin
public
renderer
services
shell
test
utility
web_test
zygote
BUILD.gn
DEPS
DIR_METADATA
OWNERS
README.md
content_resources.grd
dev_ui_content_resources.grd
courgette
crypto
dbus
device
docs
extensions
fuchsia
gin
google_apis
google_update
gpu
headless
infra
ios
ipc
jingle
media
mojo
native_client_sdk
net
pdf
ppapi
printing
remoting
rlz
sandbox
services
skia
sql
storage
styleguide
testing
third_party
tools
ui
url
weblayer
.clang-format
.clang-tidy
.eslintrc.js
.git-blame-ignore-revs
.gitattributes
.gitignore
.gn
.vpython
.vpython3
.yapfignore
AUTHORS
BUILD.gn
CODE_OF_CONDUCT.md
DEPS
DIR_METADATA
ENG_REVIEW_OWNERS
LICENSE
LICENSE.chromium_os
OWNERS
PRESUBMIT.py
PRESUBMIT_test.py
PRESUBMIT_test_mocks.py
README.md
WATCHLISTS
codereview.settings

This is [1] replicated over the fresh ToT. There is a proxy class that ensures that GPU sends back correct visuals on X11. The class was declared in the anonymous namespace in the content/browser/browser_main_loop.cc, which made it impossible to use on Ozone. This CL extracts the proxy and makes it available to use through the PlatformGLEGLUtility interface. In addition, the obsolete VisualID type used in gfx::GpuExtraInfo is replaced with the x11::VisualId. [1] https://chromium-review.googlesource.com/c/chromium/src/+/2252102 Bug: 789065 Change-Id: I6390ef8bc89cf118944be42fde78fd64a6c3d36d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2562182 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Robert Kroeger <rjkroege@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexander Dunaev <adunaev@igalia.com> Cr-Commit-Position: refs/heads/master@{#837069}
407 lines
13 KiB
C++
407 lines
13 KiB
C++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
|
|
#define CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "base/files/file_path.h"
|
|
#include "base/gtest_prod_util.h"
|
|
#include "base/macros.h"
|
|
#include "base/memory/ref_counted.h"
|
|
#include "base/task/thread_pool/thread_pool_instance.h"
|
|
#include "build/build_config.h"
|
|
#include "build/chromeos_buildflags.h"
|
|
#include "content/browser/browser_process_sub_thread.h"
|
|
#include "content/public/browser/browser_main_runner.h"
|
|
#include "media/media_buildflags.h"
|
|
#include "services/viz/public/mojom/compositing/compositing_mode_watcher.mojom.h"
|
|
#include "ui/base/buildflags.h"
|
|
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
|
#include "content/browser/media/keyboard_mic_registration.h"
|
|
#endif
|
|
|
|
#if defined(USE_AURA)
|
|
namespace aura {
|
|
class Env;
|
|
}
|
|
#endif
|
|
|
|
#if defined(USE_OZONE)
|
|
#include "ui/ozone/buildflags.h" // nogncheck
|
|
#if BUILDFLAG(OZONE_PLATFORM_X11)
|
|
#define USE_OZONE_PLATFORM_X11
|
|
#endif
|
|
#endif
|
|
|
|
namespace base {
|
|
class CommandLine;
|
|
class HighResolutionTimerManager;
|
|
class MemoryPressureMonitor;
|
|
class SingleThreadTaskRunner;
|
|
class SystemMonitor;
|
|
} // namespace base
|
|
|
|
namespace data_decoder {
|
|
class ServiceProvider;
|
|
}
|
|
|
|
namespace gpu {
|
|
class GpuChannelEstablishFactory;
|
|
}
|
|
|
|
namespace media {
|
|
class AudioManager;
|
|
class AudioSystem;
|
|
#if defined(OS_WIN)
|
|
class SystemMessageWindowWin;
|
|
#elif (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_UDEV)
|
|
class DeviceMonitorLinux;
|
|
#endif
|
|
class UserInputMonitor;
|
|
#if defined(OS_MAC)
|
|
class DeviceMonitorMac;
|
|
#endif
|
|
} // namespace media
|
|
|
|
namespace midi {
|
|
class MidiService;
|
|
} // namespace midi
|
|
|
|
namespace mojo {
|
|
namespace core {
|
|
class ScopedIPCSupport;
|
|
} // namespace core
|
|
} // namespace mojo
|
|
|
|
namespace net {
|
|
class NetworkChangeNotifier;
|
|
} // namespace net
|
|
|
|
namespace viz {
|
|
class CompositingModeReporterImpl;
|
|
class HostFrameSinkManager;
|
|
} // namespace viz
|
|
|
|
namespace content {
|
|
class BrowserMainParts;
|
|
class BrowserOnlineStateObserver;
|
|
class BrowserThreadImpl;
|
|
class FieldTrialSynchronizer;
|
|
class MediaKeysListenerManagerImpl;
|
|
class MediaStreamManager;
|
|
class SaveFileManager;
|
|
class ScreenlockMonitor;
|
|
class SmsProvider;
|
|
class SpeechRecognitionManagerImpl;
|
|
class StartupTaskRunner;
|
|
class TracingControllerImpl;
|
|
struct MainFunctionParams;
|
|
|
|
namespace responsiveness {
|
|
class Watcher;
|
|
} // namespace responsiveness
|
|
|
|
#if defined(OS_ANDROID)
|
|
class ScreenOrientationDelegate;
|
|
#endif
|
|
|
|
#if defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11)
|
|
class GpuDataManagerVisualProxyOzoneLinux;
|
|
#endif
|
|
|
|
// Implements the main browser loop stages called from BrowserMainRunner.
|
|
// See comments in browser_main_parts.h for additional info.
|
|
class CONTENT_EXPORT BrowserMainLoop {
|
|
public:
|
|
// Returns the current instance. This is used to get access to the getters
|
|
// that return objects which are owned by this class.
|
|
static BrowserMainLoop* GetInstance();
|
|
|
|
static media::AudioManager* GetAudioManager();
|
|
|
|
// The ThreadPoolInstance must exist but not to be started when building
|
|
// BrowserMainLoop.
|
|
explicit BrowserMainLoop(
|
|
const MainFunctionParams& parameters,
|
|
std::unique_ptr<base::ThreadPoolInstance::ScopedExecutionFence> fence);
|
|
virtual ~BrowserMainLoop();
|
|
|
|
void Init();
|
|
|
|
// Return value is exit status. Anything other than RESULT_CODE_NORMAL_EXIT
|
|
// is considered an error.
|
|
int EarlyInitialization();
|
|
|
|
// Initializes the toolkit. Returns whether the toolkit initialization was
|
|
// successful or not.
|
|
bool InitializeToolkit();
|
|
|
|
void PreMainMessageLoopStart();
|
|
void MainMessageLoopStart();
|
|
void PostMainMessageLoopStart();
|
|
void PreShutdown();
|
|
|
|
// Create and start running the tasks we need to complete startup. Note that
|
|
// this can be called more than once (currently only on Android) if we get a
|
|
// request for synchronous startup while the tasks created by asynchronous
|
|
// startup are still running.
|
|
void CreateStartupTasks();
|
|
|
|
// Perform the default message loop run logic.
|
|
void RunMainMessageLoopParts();
|
|
|
|
// Performs the shutdown sequence, starting with PostMainMessageLoopRun
|
|
// through stopping threads to PostDestroyThreads.
|
|
void ShutdownThreadsAndCleanUp();
|
|
|
|
int GetResultCode() const { return result_code_; }
|
|
|
|
media::AudioManager* audio_manager() const;
|
|
bool AudioServiceOutOfProcess() const;
|
|
media::AudioSystem* audio_system() const { return audio_system_.get(); }
|
|
MediaStreamManager* media_stream_manager() const {
|
|
return media_stream_manager_.get();
|
|
}
|
|
media::UserInputMonitor* user_input_monitor() const {
|
|
return user_input_monitor_.get();
|
|
}
|
|
MediaKeysListenerManagerImpl* media_keys_listener_manager() const {
|
|
return media_keys_listener_manager_.get();
|
|
}
|
|
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
|
// Only expose this on ChromeOS since it's only needed there. On Android this
|
|
// be null if this process started in reduced mode.
|
|
net::NetworkChangeNotifier* network_change_notifier() const {
|
|
return network_change_notifier_.get();
|
|
}
|
|
KeyboardMicRegistration* keyboard_mic_registration() {
|
|
return &keyboard_mic_registration_;
|
|
}
|
|
#endif
|
|
|
|
midi::MidiService* midi_service() const { return midi_service_.get(); }
|
|
|
|
// Returns the task runner for tasks that that are critical to producing a new
|
|
// CompositorFrame on resize. On Mac this will be the task runner provided by
|
|
// WindowResizeHelperMac, on other platforms it will just be the thread task
|
|
// runner.
|
|
scoped_refptr<base::SingleThreadTaskRunner> GetResizeTaskRunner();
|
|
|
|
gpu::GpuChannelEstablishFactory* gpu_channel_establish_factory() const;
|
|
|
|
#if defined(OS_ANDROID)
|
|
void SynchronouslyFlushStartupTasks();
|
|
|
|
// |enabled| Whether or not CreateStartupTasks() posts any tasks. This is
|
|
// useful because some javatests want to test native task posting without the
|
|
// whole browser loaded. In that scenario tasks posted by CreateStartupTasks()
|
|
// may crash if run.
|
|
static void EnableStartupTasks(bool enabled);
|
|
#endif // OS_ANDROID
|
|
|
|
#if !defined(OS_ANDROID)
|
|
// TODO(fsamuel): We should find an object to own HostFrameSinkManager on all
|
|
// platforms including Android. See http://crbug.com/732507.
|
|
viz::HostFrameSinkManager* host_frame_sink_manager() const {
|
|
return host_frame_sink_manager_.get();
|
|
}
|
|
#endif
|
|
|
|
// Binds a receiver to the singleton CompositingModeReporter.
|
|
void GetCompositingModeReporter(
|
|
mojo::PendingReceiver<viz::mojom::CompositingModeReporter> receiver);
|
|
|
|
#if defined(OS_MAC)
|
|
media::DeviceMonitorMac* device_monitor_mac() const {
|
|
return device_monitor_mac_.get();
|
|
}
|
|
#endif
|
|
|
|
SmsProvider* GetSmsProvider();
|
|
void SetSmsProviderForTesting(std::unique_ptr<SmsProvider>);
|
|
|
|
BrowserMainParts* parts() { return parts_.get(); }
|
|
|
|
private:
|
|
FRIEND_TEST_ALL_PREFIXES(BrowserMainLoopTest, CreateThreadsInSingleProcess);
|
|
FRIEND_TEST_ALL_PREFIXES(
|
|
BrowserMainLoopTest,
|
|
PostTaskToIOThreadBeforeThreadCreationDoesNotRunTask);
|
|
|
|
void InitializeMainThread();
|
|
|
|
// Called just before creating the threads
|
|
int PreCreateThreads();
|
|
|
|
// Create all secondary threads.
|
|
int CreateThreads();
|
|
|
|
// Called just after creating the threads.
|
|
int PostCreateThreads();
|
|
|
|
// Called right after the browser threads have been started.
|
|
int BrowserThreadsStarted();
|
|
|
|
int PreMainMessageLoopRun();
|
|
|
|
void MainMessageLoopRun();
|
|
|
|
void InitializeMojo();
|
|
|
|
void InitializeAudio();
|
|
|
|
bool UsingInProcessGpu() const;
|
|
|
|
void InitializeMemoryManagementComponent();
|
|
|
|
// Quick reference for initialization order:
|
|
// Constructor
|
|
// Init()
|
|
// EarlyInitialization()
|
|
// InitializeToolkit()
|
|
// PreMainMessageLoopStart()
|
|
// MainMessageLoopStart()
|
|
// InitializeMainThread()
|
|
// PostMainMessageLoopStart()
|
|
// CreateStartupTasks()
|
|
// PreCreateThreads()
|
|
// CreateThreads()
|
|
// PostCreateThreads()
|
|
// BrowserThreadsStarted()
|
|
// InitializeMojo()
|
|
// PreMainMessageLoopRun()
|
|
|
|
// Members initialized on construction ---------------------------------------
|
|
const MainFunctionParams& parameters_;
|
|
const base::CommandLine& parsed_command_line_;
|
|
int result_code_;
|
|
bool created_threads_; // True if the non-UI threads were created.
|
|
// //content must be initialized single-threaded until
|
|
// BrowserMainLoop::CreateThreads() as things initialized before it require an
|
|
// initialize-once happens-before relationship with all eventual content tasks
|
|
// running on other threads. This ScopedExecutionFence ensures that no tasks
|
|
// posted to ThreadPool gets to run before CreateThreads(); satisfying this
|
|
// requirement even though the ThreadPoolInstance is created and started
|
|
// before content is entered.
|
|
std::unique_ptr<base::ThreadPoolInstance::ScopedExecutionFence>
|
|
scoped_execution_fence_;
|
|
|
|
// BEST_EFFORT tasks are not allowed to run between //content initialization
|
|
// and startup completion.
|
|
//
|
|
// TODO(fdoray): Move this to a more elaborate class that prevents BEST_EFFORT
|
|
// tasks from running when resources are needed to respond to user actions.
|
|
base::Optional<base::ThreadPoolInstance::ScopedBestEffortExecutionFence>
|
|
scoped_best_effort_execution_fence_;
|
|
|
|
// Unregister UI thread from hang watching on destruction.
|
|
base::ScopedClosureRunner unregister_thread_closure_;
|
|
|
|
// Members initialized in |PostMainMessageLoopStart()| -----------------------
|
|
std::unique_ptr<BrowserProcessSubThread> io_thread_;
|
|
std::unique_ptr<base::SystemMonitor> system_monitor_;
|
|
std::unique_ptr<base::HighResolutionTimerManager> hi_res_timer_manager_;
|
|
std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_;
|
|
std::unique_ptr<ScreenlockMonitor> screenlock_monitor_;
|
|
|
|
// Per-process listener for online state changes.
|
|
std::unique_ptr<BrowserOnlineStateObserver> online_state_observer_;
|
|
|
|
#if defined(USE_AURA)
|
|
std::unique_ptr<aura::Env> env_;
|
|
#endif
|
|
|
|
#if defined(OS_ANDROID)
|
|
// Android implementation of ScreenOrientationDelegate
|
|
std::unique_ptr<ScreenOrientationDelegate> screen_orientation_delegate_;
|
|
#endif
|
|
|
|
// Members initialized in |Init()| -------------------------------------------
|
|
// Destroy |parts_| before |main_message_loop_| (required) and before other
|
|
// classes constructed in content (but after |main_thread_|).
|
|
std::unique_ptr<BrowserMainParts> parts_;
|
|
|
|
// Members initialized in |InitializeMainThread()| ---------------------------
|
|
// This must get destroyed before other threads that are created in |parts_|.
|
|
std::unique_ptr<BrowserThreadImpl> main_thread_;
|
|
|
|
// Members initialized in |CreateStartupTasks()| -----------------------------
|
|
std::unique_ptr<StartupTaskRunner> startup_task_runner_;
|
|
|
|
// Members initialized in |PreCreateThreads()| -------------------------------
|
|
// Torn down in ShutdownThreadsAndCleanUp.
|
|
std::unique_ptr<base::MemoryPressureMonitor> memory_pressure_monitor_;
|
|
#if defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11)
|
|
std::unique_ptr<GpuDataManagerVisualProxyOzoneLinux>
|
|
gpu_data_manager_visual_proxy_;
|
|
#endif
|
|
|
|
// Members initialized in |BrowserThreadsStarted()| --------------------------
|
|
std::unique_ptr<mojo::core::ScopedIPCSupport> mojo_ipc_support_;
|
|
std::unique_ptr<MediaKeysListenerManagerImpl> media_keys_listener_manager_;
|
|
|
|
// The FieldTrialSynchronizer tells child processes when a trial gets
|
|
// activated. This is mostly an optimization, as a consequence if renderers
|
|
// know a trial is already active they don't need to send anything to the
|
|
// browser.
|
|
scoped_refptr<FieldTrialSynchronizer> field_trial_synchronizer_;
|
|
|
|
// |user_input_monitor_| has to outlive |audio_manager_|, so declared first.
|
|
std::unique_ptr<media::UserInputMonitor> user_input_monitor_;
|
|
|
|
// Support for out-of-process Data Decoder.
|
|
std::unique_ptr<data_decoder::ServiceProvider> data_decoder_service_provider_;
|
|
|
|
// |audio_manager_| is not instantiated when the audio service runs out of
|
|
// process.
|
|
std::unique_ptr<media::AudioManager> audio_manager_;
|
|
|
|
std::unique_ptr<media::AudioSystem> audio_system_;
|
|
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
|
KeyboardMicRegistration keyboard_mic_registration_;
|
|
#endif
|
|
|
|
std::unique_ptr<midi::MidiService> midi_service_;
|
|
|
|
// Must be deleted on the IO thread.
|
|
std::unique_ptr<SpeechRecognitionManagerImpl> speech_recognition_manager_;
|
|
|
|
std::unique_ptr<SmsProvider> sms_provider_;
|
|
|
|
#if defined(OS_WIN)
|
|
std::unique_ptr<media::SystemMessageWindowWin> system_message_window_;
|
|
#elif (defined(OS_LINUX) || defined(OS_CHROMEOS)) && defined(USE_UDEV)
|
|
std::unique_ptr<media::DeviceMonitorLinux> device_monitor_linux_;
|
|
#elif defined(OS_MAC)
|
|
std::unique_ptr<media::DeviceMonitorMac> device_monitor_mac_;
|
|
#endif
|
|
|
|
std::unique_ptr<MediaStreamManager> media_stream_manager_;
|
|
scoped_refptr<SaveFileManager> save_file_manager_;
|
|
std::unique_ptr<content::TracingControllerImpl> tracing_controller_;
|
|
scoped_refptr<responsiveness::Watcher> responsiveness_watcher_;
|
|
#if !defined(OS_ANDROID)
|
|
std::unique_ptr<viz::HostFrameSinkManager> host_frame_sink_manager_;
|
|
|
|
// Reports on the compositing mode in the system for clients to submit
|
|
// resources of the right type. This is null if the display compositor
|
|
// is not in this process.
|
|
std::unique_ptr<viz::CompositingModeReporterImpl>
|
|
compositing_mode_reporter_impl_;
|
|
#endif
|
|
|
|
// DO NOT add members here. Add them to the right categories above.
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(BrowserMainLoop);
|
|
};
|
|
|
|
} // namespace content
|
|
|
|
#endif // CONTENT_BROWSER_BROWSER_MAIN_LOOP_H_
|