Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: components/arc/arc_util.cc

Issue 2898273002: Move Voice Interaction shortcut to accelerator_controller.cc (Closed)
Patch Set: Refactor Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« components/arc/arc_util.h ('K') | « components/arc/arc_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« components/arc/arc_util.h ('K') | « components/arc/arc_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698