memory-infra: don't pass mojo callback to MDM from client process
Passing these callbacks from the client process code means that MDM begins owning the callback. However, these callbacks *must* be run before destruction. While this is not a problem with MDM per-se as MDM is a leaky singleton, MDM ocassionally passes ownership of this callback to a thread loop. On destruction of the thread loop with the callback posted, the callback could be destroyed without being run which can cause problems. To solve this, instead of passing the callback into a situation where it could be destroyed, we instead store the callback inside the client process itself. As the client is also a leaky singleton, the destructor of these callbacks will no longer be run so we do not have the above problem. Bug: 788658 Change-Id: I9dd65fe7748e0afaedd1bf5a3d25ac9cadfe9853 Reviewed-on: https://chromium-review.googlesource.com/790591Reviewed-by:Primiano Tucci <primiano@chromium.org> Commit-Queue: Primiano Tucci <primiano@chromium.org> Cr-Commit-Position: refs/heads/master@{#519517}
Showing
Please register or sign in to comment