Commit c509c502 authored by Abhishek Bhardwaj's avatar Abhishek Bhardwaj Committed by Commit Bot

arc: Block only throttling calls on disable restriction flag

This change modifies SetArcCpuRestriction to allow calls to unthrottle
the ARC container when the disable restriction flag was set.
Previously, all calls i.e. throttle or unthrottle would be blocked
making the container always be throttled since boot.

Also, unthrottles the ARC container by default on boot when the disable
restriction flag is set. Together these two changes ensure that the ARC
instance is unthrottled during testing.

BUG=b:131047599
TEST=Manual testing.

Change-Id: I7444b81746ada5c9a362fb4761d09e238de9aed5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1564903
Commit-Queue: Abhishek Bhardwaj <abhishekbh@chromium.org>
Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653437}
parent 41613d64
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_restore.h" #include "chrome/browser/sessions/session_restore.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h" #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "chromeos/constants/chromeos_switches.h"
#include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/cryptohome/cryptohome_parameters.h"
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/dbus/session_manager/session_manager_client.h"
...@@ -236,6 +237,13 @@ void ArcBootPhaseMonitorBridge::OnExtensionsReady() { ...@@ -236,6 +237,13 @@ void ArcBootPhaseMonitorBridge::OnExtensionsReady() {
} }
void ArcBootPhaseMonitorBridge::MaybeDisableCpuRestriction() { void ArcBootPhaseMonitorBridge::MaybeDisableCpuRestriction() {
// Unthrottle ARC instance if the instance is being tested, indicated by the
// disable cpu restriction switch.
if (chromeos::switches::IsArcCpuRestrictionDisabled() && delegate_) {
delegate_->DisableCpuRestriction();
return;
}
if (throttle_) if (throttle_)
return; return;
if (!extensions_ready_ || !enabled_by_policy_) if (!extensions_ready_ || !enabled_by_policy_)
......
...@@ -198,7 +198,9 @@ void SetArcCpuRestriction(bool do_restrict) { ...@@ -198,7 +198,9 @@ void SetArcCpuRestriction(bool do_restrict) {
return; return;
} }
if (chromeos::switches::IsArcCpuRestrictionDisabled()) // Ignore any calls to restrict the ARC container if the specified command
// line flag is set.
if (chromeos::switches::IsArcCpuRestrictionDisabled() && do_restrict)
return; return;
const login_manager::ContainerCpuRestrictionState state = const login_manager::ContainerCpuRestrictionState state =
......
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