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

Unified Diff: components/arc/arc_util.cc

Issue 2898273002: Move Voice Interaction shortcut to accelerator_controller.cc (Closed)
Patch Set: Move Voice Interaction shortcut to accelerator_controller.cc 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
« no previous file with comments | « 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 6a82a7046b5eb813c2bb2f7b40a01205326194f0..9f2b373744e82a231a7cee9964dec556d0840495 100644
--- a/components/arc/arc_util.cc
+++ b/components/arc/arc_util.cc
@@ -10,6 +10,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"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
@@ -29,6 +31,12 @@ constexpr char kAvailabilityNone[] = "none";
constexpr char kAvailabilityInstalled[] = "installed";
constexpr char kAvailabilityOfficiallySupported[] = "officially-supported";
+void SetArcCpuRestrictionCallback(bool success) {
+ VLOG(2) << "Finished prioritizing the instance: result=" << success;
+ if (!success)
+ LOG(ERROR) << "Failed to prioritize ARC";
+}
+
} // namespace
bool IsArcAvailable() {
@@ -105,4 +113,13 @@ bool IsArcAppWindow(aura::Window* window) {
static_cast<int>(ash::AppType::ARC_APP);
}
+void PrioritizeArcContainer() {
+ 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
« no previous file with comments | « components/arc/arc_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698