| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
@Takashi friendly ping
| 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. |
+Philip for third_party/blink
+Arthur for content/
PTAL
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks Patrick!
content/ LGTM, but I think I found a bug in blink ;-)
// Don't notify duplicate NONE pressure level.The code handled CRITICAL differently from NONE and MODERATE.
Are you sure the comment is correct? It feels incorrect. Or maybe MODERATE isn't really used at the moment?
level != base::MEMORY_PRESSURE_LEVEL_CRITICAL) {Consider adding a brief comment explaining why CRITICAL is exempted from the check (i.e., supporting legacy listeners that rely on polling/repeated signals).
last_critical_generated_ = std::nullopt;See my comment in Generate. We are going to immediately set it to "now" in L108.
// Only generate a signal if the last generated signal was not NONE.This repeats the code, so it adds no value, only noise.
last_critical_generated_ = now;There is a bug here. You should probably check `level == CRITICAL` before assigning this.
Could you please add a regression test checking the transition CRITICAL => NONE => CRITICAL.
Even if the transition NONE => CRITICAL is quick, we should check the the critical signal isn't delayed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks for the thorough review Arthur! PTAnL
The code handled CRITICAL differently from NONE and MODERATE.
Are you sure the comment is correct? It feels incorrect. Or maybe MODERATE isn't really used at the moment?
Yeah moderate is not used yet, but I agree the code and the comment looked contradictory. Fixed.
Consider adding a brief comment explaining why CRITICAL is exempted from the check (i.e., supporting legacy listeners that rely on polling/repeated signals).
Done
See my comment in Generate. We are going to immediately set it to "now" in L108.
Good catch! I fixed Generate() now.
// Only generate a signal if the last generated signal was not NONE.This repeats the code, so it adds no value, only noise.
Done
There is a bug here. You should probably check `level == CRITICAL` before assigning this.
Could you please add a regression test checking the transition CRITICAL => NONE => CRITICAL.
Even if the transition NONE => CRITICAL is quick, we should check the the critical signal isn't delayed.
| 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. |
| Code-Review | +1 |
| 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. |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
12 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
Propagate NONE level in UserLevelMemoryPressureSignalGenerator
In preparation for migrating all base::MemoryPressureListener
implementations to base::MemoryConsumer, the memory pressure signal
must become stateful.
In its current state, the MEMORY_PRESSURE_LEVEL_NONE is never sent to
MemoryPressureListeners. The API works by repeatedly sending either
MEMORY_PRESSURE_LEVEL_CRITICAL or MEMORY_PRESSURE_LEVEL_MODERATE until
the memory pressure state resolves.
The new base::MemoryConsumer API will work by only notifying state
transitions. There will no longer be repeat identical notifications,
and implementers can assume the memory pressure holds as long as they
don't receive another notification.
This change will enable the migration from the old behavior to the new
as it is a mix of both.
| 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. |