Chromium Base MessageLoop Internals (0)
Our fancy star in this post is class base::MessageLoopCurrent
.
MessageLoopCurrent
Version: r70_3538
File: base/message_loop/message_loop_current.{h, cc}
MessageLoopCurernt is a proxy class for interactions with the MessageLoop bound to the current thread.
It is introduced to avoid direct uses of MessageLoop::current()
, quoting from original comments:
Why: Historically MessageLoop::current() gave access to the full MessageLoop API, preventing both addition of powerful owner-only APIs as well as making it harder to remove callers of deprecated APIs (that need to stick around for a few owner-only use cases and re-accrue callers after cleanup per remaining publicly available).
Because it is a light-weight proxy, it contains only a single pointer to the MessageLoop bound to the current thread.