| Index: components/arc/arc_util.cc
|
| diff --git a/components/arc/arc_util.cc b/components/arc/arc_util.cc
|
| index 7c3ee3f5a080b7e1b4d0b82dc0bbc686873c5b5e..f16f56f7cb8481b7293ac706ba016042d1334dae 100644
|
| --- a/components/arc/arc_util.cc
|
| +++ b/components/arc/arc_util.cc
|
| @@ -9,6 +9,8 @@
|
| #include "base/command_line.h"
|
| #include "base/feature_list.h"
|
| #include "chromeos/chromeos_switches.h"
|
| +#include "chromeos/dbus/dbus_thread_manager.h"
|
| +#include "chromeos/dbus/session_manager_client.h"
|
| #include "components/user_manager/user_manager.h"
|
|
|
| namespace arc {
|
| @@ -28,6 +30,12 @@ constexpr char kAvailabilityOfficiallySupported[] = "officially-supported";
|
| constexpr char kAvailabilityOfficiallySupportedWithActiveDirectory[] =
|
| "officially-supported-with-active-directory";
|
|
|
| +void SetArcCpuRestrictionCallback(bool success) {
|
| + VLOG(2) << "Finished prioritizing the instance: result=" << success;
|
| + if (!success)
|
| + LOG(ERROR) << "Failed to prioritize ARC";
|
| +}
|
| +
|
| } // namespace
|
|
|
| bool IsArcAvailable() {
|
| @@ -111,4 +119,13 @@ bool IsArcOptInVerificationDisabled() {
|
| chromeos::switches::kDisableArcOptInVerification);
|
| }
|
|
|
| +void PrioritizeArcContainerStartup() {
|
| + VLOG(2) << "Prioritizing the instance";
|
| + chromeos::SessionManagerClient* session_manager_client =
|
| + chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
|
| + session_manager_client->SetArcCpuRestriction(
|
| + login_manager::CONTAINER_CPU_RESTRICTION_FOREGROUND,
|
| + base::Bind(SetArcCpuRestrictionCallback));
|
| +}
|
| +
|
| } // namespace arc
|
|
|