Skip to content

Commit

Permalink
[freezing] Update tab freezing entry in chrome://flags.
Browse files Browse the repository at this point in the history
This updates the tab freezing entry in chrome://flags to facilitate
testing the two configs that are candidate to ship in M79.

Bug: 980533
Change-Id: I1b5b671b90b8f76b03d842750673e504b894d279
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1856801
Auto-Submit: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705244}
  • Loading branch information
fdoray authored and Commit Bot committed Oct 11, 2019
1 parent d4e889a commit cd3a096
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 40 deletions.
46 changes: 20 additions & 26 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1020,31 +1020,26 @@ const FeatureEntry::FeatureVariation kOverscrollHistoryNavigationVariations[] =
#endif // defined(OS_ANDROID)

#if !defined(OS_ANDROID)
const FeatureEntry::FeatureParam kProactiveTabFreezeAndDiscard_FreezeOnly[] = {
const FeatureEntry::FeatureParam kTabFreeze_FreezeNoUnfreeze[] = {
{resource_coordinator::
kProactiveTabFreezeAndDiscard_ShouldProactivelyDiscardParam,
"false"},
{resource_coordinator::
kProactiveTabFreezeAndDiscard_ShouldPeriodicallyUnfreezeParam,
"false"}};
const FeatureEntry::FeatureParam
kProactiveTabFreezeAndDiscard_FreezeAndDiscard[] = {
{resource_coordinator::
kProactiveTabFreezeAndDiscard_ShouldProactivelyDiscardParam,
"true"}};
const FeatureEntry::FeatureParam
kProactiveTabFreezeAndDiscard_DisableHeuristics[] = {
{resource_coordinator::
kProactiveTabFreezeAndDiscard_ShouldProactivelyDiscardParam,
"true"},
{resource_coordinator::
kProactiveTabFreezeAndDiscard_DisableHeuristicsParam,
"true"}};
const FeatureEntry::FeatureVariation kProactiveTabFreezeAndDiscardVariations[] =
{{"Freeze only", kProactiveTabFreezeAndDiscard_FreezeOnly,
base::size(kProactiveTabFreezeAndDiscard_FreezeOnly), nullptr},
{"Freeze and discard", kProactiveTabFreezeAndDiscard_FreezeAndDiscard,
base::size(kProactiveTabFreezeAndDiscard_FreezeAndDiscard), nullptr},
{"Freeze and discard, heuristics disabled",
kProactiveTabFreezeAndDiscard_DisableHeuristics,
base::size(kProactiveTabFreezeAndDiscard_DisableHeuristics), nullptr}};
const FeatureEntry::FeatureParam kTabFreeze_FreezeWithUnfreeze[] = {
{resource_coordinator::
kProactiveTabFreezeAndDiscard_ShouldProactivelyDiscardParam,
"false"},
{resource_coordinator::
kProactiveTabFreezeAndDiscard_ShouldPeriodicallyUnfreezeParam,
"true"}};
const FeatureEntry::FeatureVariation kTabFreezeVariations[] = {
{"Freeze - No Unfreeze", kTabFreeze_FreezeNoUnfreeze,
base::size(kTabFreeze_FreezeNoUnfreeze), nullptr},
{"Freeze - Unfreeze 10 seconds every 15 minutes",
kTabFreeze_FreezeWithUnfreeze, base::size(kTabFreeze_FreezeWithUnfreeze),
nullptr}};
#endif

#if defined(OS_ANDROID)
Expand Down Expand Up @@ -3519,12 +3514,11 @@ const FeatureEntry kFeatureEntries[] = {
kOsDesktop,
FEATURE_VALUE_TYPE(
features::kSessionRestorePrioritizesBackgroundUseCases)},
{"proactive-tab-freeze-and-discard",
flag_descriptions::kProactiveTabFreezeAndDiscardName,
flag_descriptions::kProactiveTabFreezeAndDiscardDescription, kOsDesktop,
{"proactive-tab-freeze", flag_descriptions::kTabFreezeName,
flag_descriptions::kTabFreezeDescription, kOsDesktop,
FEATURE_WITH_PARAMS_VALUE_TYPE(
features::kProactiveTabFreezeAndDiscard,
kProactiveTabFreezeAndDiscardVariations,
kTabFreezeVariations,
resource_coordinator::kProactiveTabFreezeAndDiscardFeatureName)},
#endif

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/flag-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2923,9 +2923,9 @@
"expiry_milestone": 85
},
{
"name": "proactive-tab-freeze-and-discard",
"name": "proactive-tab-freeze",
"owners": [ "fdoray" ],
"expiry_milestone": 75
"expiry_milestone": 80
},
{
"name": "profile-menu-revamp",
Expand Down
9 changes: 4 additions & 5 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2989,11 +2989,10 @@ const char kOmniboxTabSwitchSuggestionsDedicatedRowDescription[] =
"Put each tab switch suggestion in a separate suggestion, immediately "
"following the original suggestion.";

const char kProactiveTabFreezeAndDiscardName[] =
"Proactive Tab Freeze and Discard";
const char kProactiveTabFreezeAndDiscardDescription[] =
"Enables proactive tab freezing and discarding. This requires "
"#enable-page-almost-idle.";
const char kTabFreezeName[] = "Tab Freeze";
const char kTabFreezeDescription[] =
"Enables freezing eligible tabs when they have been backgrounded for 5 "
"minutes.";

const char kWebUIA11yEnhancementsName[] =
"Enable accessibility enahncements in WebUI";
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1749,8 +1749,8 @@ extern const char kOmniboxTabSwitchSuggestionsDescription[];
extern const char kOmniboxTabSwitchSuggestionsDedicatedRowName[];
extern const char kOmniboxTabSwitchSuggestionsDedicatedRowDescription[];

extern const char kProactiveTabFreezeAndDiscardName[];
extern const char kProactiveTabFreezeAndDiscardDescription[];
extern const char kTabFreezeName[];
extern const char kTabFreezeDescription[];

extern const char kWebUIA11yEnhancementsName[];
extern const char kWebUIA11yEnhancementsDescription[];
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/resource_coordinator/tab_manager_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ const char kProactiveTabFreezeAndDiscardFeatureName[] =
"ProactiveTabFreezeAndDiscard";
const char kProactiveTabFreezeAndDiscard_ShouldProactivelyDiscardParam[] =
"ShouldProactivelyDiscard";
const char kProactiveTabFreezeAndDiscard_ShouldPeriodicallyUnfreezeParam[] =
"ShouldPeriodicallyUnfreeze";
const char kProactiveTabFreezeAndDiscard_DisableHeuristicsParam[] =
"DisableHeuristicsProtections";

Expand Down
14 changes: 9 additions & 5 deletions chrome/browser/resource_coordinator/tab_manager_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ extern const char kProactiveTabFreezeAndDiscardFeatureName[];
// ProactiveTabFreezeAndDiscard feature.
extern const char kProactiveTabFreezeAndDiscard_ShouldProactivelyDiscardParam[];

// The name of the |ShouldPeriodicallyUnfreeze| parameter of the
// ProactiveTabFreezeAndDiscard feature.
extern const char
kProactiveTabFreezeAndDiscard_ShouldPeriodicallyUnfreezeParam[];

// The name of the |DisableHeuristicsProtections| parameter of the
// ProactiveTabFreezeAndDiscard feature.
extern const char kProactiveTabFreezeAndDiscard_DisableHeuristicsParam[];
Expand Down Expand Up @@ -83,8 +88,8 @@ struct ProactiveTabFreezeAndDiscardParams {
&features::kProactiveTabFreezeAndDiscard,
kProactiveTabFreezeAndDiscard_ShouldProactivelyDiscardParam, false};
static constexpr base::FeatureParam<bool> kShouldPeriodicallyUnfreeze{
&features::kProactiveTabFreezeAndDiscard, "ShouldPeriodicallyUnfreeze",
false};
&features::kProactiveTabFreezeAndDiscard,
kProactiveTabFreezeAndDiscard_ShouldPeriodicallyUnfreezeParam, false};
static constexpr base::FeatureParam<bool>
kShouldProtectTabsSharingBrowsingInstance{
&features::kProactiveTabFreezeAndDiscard,
Expand Down Expand Up @@ -120,13 +125,12 @@ struct ProactiveTabFreezeAndDiscardParams {
10 * base::Time::kSecondsPerMinute};
static constexpr base::FeatureParam<int> kFreezeTimeout{
&features::kProactiveTabFreezeAndDiscard, "FreezeTimeout",
10 * base::Time::kSecondsPerMinute};
5 * base::Time::kSecondsPerMinute};
static constexpr base::FeatureParam<int> kUnfreezeTimeout{
&features::kProactiveTabFreezeAndDiscard, "UnfreezeTimeout",
15 * base::Time::kSecondsPerMinute};
static constexpr base::FeatureParam<int> kRefreezeTimeout{
&features::kProactiveTabFreezeAndDiscard, "RefreezeTimeout",
10 * base::Time::kSecondsPerMinute};
&features::kProactiveTabFreezeAndDiscard, "RefreezeTimeout", 10};

static constexpr base::FeatureParam<bool> kDisableHeuristicsProtections{
&features::kProactiveTabFreezeAndDiscard,
Expand Down

0 comments on commit cd3a096

Please sign in to comment.