This is needed in order to reduce the boilerplate involved in converting Notifications into callbacks. It is intended to be the callback version of ObserverList.

Usage Assumptions:
-Publishers outlive listeners (or at least, we can refactor things such that this is the case).

Usage Requirements:
-Typesafe: no blobs and casts.
-Decentralized: listener registers with publisher directly, instead of through a central service.
-Flexible: A listener may register callbacks with several publishers.
-Ease-of-use: Listener does not need to explicitly hold a reference to a publisher to deregister from it.
-Minimizes the risks of use-after-free: detect dangerous states (e.g dead listener is still registered) and fail in predictable ways instead. Also make it explicitly difficult to end up in those states.

BUG=268984
TEST=base/callback_list_unittest.cc

Review URL: https://chromiumcodereview.appspot.com/22877038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222559 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 893c81606ab11ea6734f310d6f54f5473d2f763f
4 files changed
tree: 00d9d20827dea3cfa8410ac56f8015795336a255
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. ipc/
  6. mojo/
  7. testing/
  8. third_party/
  9. ui/