+Francois. Please take a first look.
| 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. |
PTAL
Last generic cleanup CL for this.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (base_selector != nullptr && IsMainThread()) {I'm assuming that it's correct to remove the IsMainThread() guard here because that was a limitation of the previous API.
memory_pressure_listener_registration_->Dispose();This is kind of ugly. Do we need to re-register here at all? What happens if we don't?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (base_selector != nullptr && IsMainThread()) {I'm assuming that it's correct to remove the IsMainThread() guard here because that was a limitation of the previous API.
Yes now that blink::MemoryPressureListenerRegistration is always an async registration, it works on all threads now.
This is kind of ugly. Do we need to re-register here at all? What happens if we don't?
Your comment made me realize I don't have to use the blink version of MemoryPressureListenerRegistration here, as ParkableStringManager is not garbage collected.
To answer the question though, it would have CHECK'ed since the blink version forces user to call Dispose().
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
memory_pressure_listener_registration_->Dispose();Patrick MonetteThis is kind of ugly. Do we need to re-register here at all? What happens if we don't?
Your comment made me realize I don't have to use the blink version of MemoryPressureListenerRegistration here, as ParkableStringManager is not garbage collected.
To answer the question though, it would have CHECK'ed since the blink version forces user to call Dispose().
Sorry, my question wasn't precise. I meant:
"Do we need to reset this at all? If so, why?"
I'm still wondering about that, and I'll assume there's a good reason, but I'm curious what the answer is :)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Thanks!
memory_pressure_listener_registration_->Dispose();Patrick MonetteThis is kind of ugly. Do we need to re-register here at all? What happens if we don't?
Daniel ChengYour comment made me realize I don't have to use the blink version of MemoryPressureListenerRegistration here, as ParkableStringManager is not garbage collected.
To answer the question though, it would have CHECK'ed since the blink version forces user to call Dispose().
Sorry, my question wasn't precise. I meant:
"Do we need to reset this at all? If so, why?"I'm still wondering about that, and I'll assume there's a good reason, but I'm curious what the answer is :)
Sorry I misunderstood the question!
I don't like the pattern of ResetForTesting(), but since that's the current design I'm staying with it. Resetting the registration ensures that any async notifications in the message queue that was sent before ResetForTesting() will not affect the next test.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Migrate blink::MemoryPressureListener to base::MemoryPressureListener
A future change will remove it, so that there is only one single
interface for listening to memory pressure in the code base.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |