| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm with nits
default:Nit: better to list all reasons and without a `default`, so that the compiler will catch missing cases if anyone adds a LifecycleUnitDiscardReason. Optionally add `NOTREACHED()` after the switch to also catch run-time failures, like if a bad cast or cosmic ray calls this function with an int that's not actually an enum member.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Nit: better to list all reasons and without a `default`, so that the compiler will catch missing cases if anyone adds a LifecycleUnitDiscardReason. Optionally add `NOTREACHED()` after the switch to also catch run-time failures, like if a bad cast or cosmic ray calls this function with an int that's not actually an enum member.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
Insertions: 9, Deletions: 1.
@@ -14,6 +14,7 @@
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
+#include "base/notreached.h"
#include "base/process/process_metrics.h"
#include "build/build_config.h"
#include "chrome/browser/devtools/devtools_window.h"
@@ -71,9 +72,16 @@
// The discard was explicitly requested by the Memory Saver feature,
// and we should respect the user's settings.
return false;
- default:
+ case LifecycleUnitDiscardReason::URGENT:
+ // Block urgent memory pressure discards during this experiment.
+ return true;
+ case LifecycleUnitDiscardReason::SUGGESTED:
+ // The discard is an optional suggestion to free up resources, which
+ // we block while the disable discarding experiment is active.
return true;
}
+
+ NOTREACHED();
}
} // namespace
```
[PerformanceManager] Fix kDisableTabDiscarding feature interactions
This CL fixes how the existing kDisableTabDiscarding experiment
interacts with memory policies:
* Refactors `TabLifecycleUnit::Discard` to allow `PROACTIVE` discards, ensuring the user's Memory Saver preference is respected.
* Guards the instantiation of `UrgentPageDiscardingPolicy` so it is not added to the graph when the disable flag is active.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |