Commit 1a4f374b authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

cros: Add a 'SessionManagerLongKillTimeout' feature

Session manager daemon will query this feature after it starts
chrome. If it is enabled, the daemon waits longer (12s) before
killing chrome.

Bug: 999214
Change-Id: I9ba16cb7a5eacbd1ed1c213385b350024bbb2f3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841739Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703328}
parent 3f49b808
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#include "chromeos/constants/chromeos_features.h"
#include "components/arc/arc_features.h" #include "components/arc/arc_features.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "dbus/bus.h" #include "dbus/bus.h"
...@@ -116,13 +117,14 @@ void ChromeFeaturesServiceProvider::IsFeatureEnabled( ...@@ -116,13 +117,14 @@ void ChromeFeaturesServiceProvider::IsFeatureEnabled(
dbus::MethodCall* method_call, dbus::MethodCall* method_call,
dbus::ExportedObject::ResponseSender response_sender) { dbus::ExportedObject::ResponseSender response_sender) {
static const base::Feature constexpr* kFeatureLookup[] = { static const base::Feature constexpr* kFeatureLookup[] = {
&features::kUsbbouncer, &::features::kUsbbouncer,
&features::kUsbguard, &::features::kUsbguard,
&arc::kBootCompletedBroadcastFeature, &arc::kBootCompletedBroadcastFeature,
&arc::kCustomTabsExperimentFeature, &arc::kCustomTabsExperimentFeature,
&arc::kFilePickerExperimentFeature, &arc::kFilePickerExperimentFeature,
&arc::kNativeBridgeToggleFeature, &arc::kNativeBridgeToggleFeature,
&arc::kPrintSpoolerExperimentFeature, &arc::kPrintSpoolerExperimentFeature,
&features::kSessionManagerLongKillTimeout,
}; };
dbus::MessageReader reader(method_call); dbus::MessageReader reader(method_call);
...@@ -173,7 +175,7 @@ void ChromeFeaturesServiceProvider::IsUsbguardEnabled( ...@@ -173,7 +175,7 @@ void ChromeFeaturesServiceProvider::IsUsbguardEnabled(
dbus::MethodCall* method_call, dbus::MethodCall* method_call,
dbus::ExportedObject::ResponseSender response_sender) { dbus::ExportedObject::ResponseSender response_sender) {
SendResponse(method_call, response_sender, SendResponse(method_call, response_sender,
base::FeatureList::IsEnabled(features::kUsbguard)); base::FeatureList::IsEnabled(::features::kUsbguard));
} }
void ChromeFeaturesServiceProvider::IsVmManagementCliAllowed( void ChromeFeaturesServiceProvider::IsVmManagementCliAllowed(
...@@ -182,7 +184,8 @@ void ChromeFeaturesServiceProvider::IsVmManagementCliAllowed( ...@@ -182,7 +184,8 @@ void ChromeFeaturesServiceProvider::IsVmManagementCliAllowed(
bool is_allowed = true; bool is_allowed = true;
// The policy is experimental; check that the corresponding feature flag // The policy is experimental; check that the corresponding feature flag
// is enabled. // is enabled.
if (base::FeatureList::IsEnabled(features::kCrostiniAdvancedAccessControls)) { if (base::FeatureList::IsEnabled(
::features::kCrostiniAdvancedAccessControls)) {
Profile* profile = GetSenderProfile(method_call, response_sender); Profile* profile = GetSenderProfile(method_call, response_sender);
is_allowed = profile->GetPrefs()->GetBoolean( is_allowed = profile->GetPrefs()->GetBoolean(
crostini::prefs::kVmManagementCliAllowedByPolicy); crostini::prefs::kVmManagementCliAllowedByPolicy);
......
...@@ -162,6 +162,13 @@ const base::Feature kParentalControlsSettings{ ...@@ -162,6 +162,13 @@ const base::Feature kParentalControlsSettings{
const base::Feature kReleaseNotes{"ReleaseNotes", const base::Feature kReleaseNotes{"ReleaseNotes",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enables or disables long kill timeout for session manager daemon. When
// enabled, session manager daemon waits for a longer time (e.g. 12s) for chrome
// to exit before sending SIGABRT. Otherwise, it uses the default time out
// (currently 3s).
const base::Feature kSessionManagerLongKillTimeout{
"SessionManagerLongKillTimeout", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables or disables the scrollable shelf. // Enables or disables the scrollable shelf.
const base::Feature kShelfScrollable{"ShelfScrollable", const base::Feature kShelfScrollable{"ShelfScrollable",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
......
...@@ -79,6 +79,8 @@ extern const base::Feature kParentalControlsSettings; ...@@ -79,6 +79,8 @@ extern const base::Feature kParentalControlsSettings;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kReleaseNotes; extern const base::Feature kReleaseNotes;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kSessionManagerLongKillTimeout;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kShelfScrollable; extern const base::Feature kShelfScrollable;
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const base::Feature kShowBluetoothDebugLogToggle; extern const base::Feature kShowBluetoothDebugLogToggle;
......
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