Commit 6b18e4e3 authored by Yusuke Sato's avatar Yusuke Sato Committed by Commit Bot

Move SchedulerConfigurationManager to browser_process_platform_part_chromeos.h

This will allow chromeos::CrostiniManager to access
SchedulerConfigurationManager.

BUG=1011559
TEST=arc.Boot, ARCVM still starts

Change-Id: Idf76dbf595a652c09ca444fa90c9738976553dc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1972293Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Yusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#725997}
parent 16386eda
......@@ -18,6 +18,7 @@
#include "chrome/browser/chromeos/net/delay_network_call.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/scheduler_configuration_manager.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/system/automatic_reboot_manager.h"
#include "chrome/browser/chromeos/system/device_disabling_manager.h"
......@@ -30,6 +31,7 @@
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "chromeos/components/account_manager/account_manager_factory.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/geolocation/simple_geolocation_provider.h"
#include "chromeos/timezone/timezone_resolver.h"
#include "components/keep_alive_registry/keep_alive_types.h"
......@@ -147,6 +149,18 @@ void BrowserProcessPlatformPart::ShutdownCrosComponentManager() {
cros_component_manager_.reset();
}
void BrowserProcessPlatformPart::InitializeSchedulerConfigurationManager() {
DCHECK(!scheduler_configuration_manager_);
scheduler_configuration_manager_ =
std::make_unique<chromeos::SchedulerConfigurationManager>(
chromeos::DBusThreadManager::Get()->GetDebugDaemonClient(),
g_browser_process->local_state());
}
void BrowserProcessPlatformPart::ShutdownSchedulerConfigurationManager() {
scheduler_configuration_manager_.reset();
}
void BrowserProcessPlatformPart::InitializePrimaryProfileServices(
Profile* primary_profile) {
DCHECK(primary_profile);
......
......@@ -23,6 +23,7 @@ class ChromeSessionManager;
class ChromeUserManager;
class InSessionPasswordChangeManager;
class ProfileHelper;
class SchedulerConfigurationManager;
class TimeZoneResolver;
namespace system {
......@@ -64,6 +65,9 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase {
void InitializeCrosComponentManager();
void ShutdownCrosComponentManager();
void InitializeSchedulerConfigurationManager();
void ShutdownSchedulerConfigurationManager();
// Initializes all services that need the primary profile. Gets called as soon
// as the primary profile is available, which implies that the primary user
// has logged in. The services are shut down automatically when the primary
......@@ -101,6 +105,10 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase {
return chrome_user_manager_.get();
}
chromeos::SchedulerConfigurationManager* scheduler_configuration_manager() {
return scheduler_configuration_manager_.get();
}
chromeos::system::DeviceDisablingManager* device_disabling_manager() {
return device_disabling_manager_.get();
}
......@@ -172,6 +180,9 @@ class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase {
std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
primary_profile_shutdown_subscription_;
std::unique_ptr<chromeos::SchedulerConfigurationManager>
scheduler_configuration_manager_;
SEQUENCE_CHECKER(sequence_checker_);
DISALLOW_COPY_AND_ASSIGN(BrowserProcessPlatformPart);
......
......@@ -576,13 +576,9 @@ void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() {
discover_manager_ = std::make_unique<DiscoverManager>();
scheduler_configuration_manager_ =
std::make_unique<SchedulerConfigurationManager>(
DBusThreadManager::Get()->GetDebugDaemonClient(),
g_browser_process->local_state());
g_browser_process->platform_part()->InitializeSchedulerConfigurationManager();
arc_service_launcher_ = std::make_unique<arc::ArcServiceLauncher>(
scheduler_configuration_manager_.get());
g_browser_process->platform_part()->scheduler_configuration_manager());
session_termination_manager_ =
std::make_unique<chromeos::SessionTerminationManager>();
......@@ -1146,8 +1142,8 @@ void ChromeBrowserMainPartsChromeos::PostMainMessageLoopRun() {
// Specifically, this should be done after Profile destruction run in
// ChromeBrowserMainPartsLinux::PostMainMessageLoopRun().
arc_service_launcher_.reset();
// |arc_service_launcher_| uses |scheduler_configuration_manager_|.
scheduler_configuration_manager_.reset();
// |arc_service_launcher_| uses SchedulerConfigurationManager.
g_browser_process->platform_part()->ShutdownSchedulerConfigurationManager();
if (pre_profile_init_called_) {
AccessibilityManager::Shutdown();
......
......@@ -55,7 +55,6 @@ class NetworkPrefStateObserver;
class NetworkThrottlingObserver;
class PowerMetricsReporter;
class RendererFreezer;
class SchedulerConfigurationManager;
class SessionTerminationManager;
class ShutdownPolicyForwarder;
class SystemTokenCertDBInitializer;
......@@ -163,8 +162,6 @@ class ChromeBrowserMainPartsChromeos : public ChromeBrowserMainPartsLinux {
std::unique_ptr<DemoModeResourcesRemover> demo_mode_resources_remover_;
std::unique_ptr<crostini::CrosvmMetrics> crosvm_metrics_;
std::unique_ptr<DiscoverManager> discover_manager_;
std::unique_ptr<SchedulerConfigurationManager>
scheduler_configuration_manager_;
std::unique_ptr<CrosUsbDetector> cros_usb_detector_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment