Add allow_reentrancy parameter to ObserverList

Certain client code wants to make sure that no loop is
performed while looping to avoid unexpected behaivor.
Use this new parameter to check this condition in debug build & unit tests.

Introduced ReentrantObserverList (which is currently same as defualt)
to replace the ones that indeed have to be reentrant in a separate CL.

BUG=812109
TEST=Covered by unittests

Change-Id: Idcf2ed59215ad9d3d8da278d15eddfcd2dedffa9
Reviewed-on: https://chromium-review.googlesource.com/915441
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537949}

CrOS-Libchrome-Original-Commit: 7a30eec9fe13e9f5c91b2373fe96871c1e16ad3c
2 files changed
tree: de894ae98671f721226536aae777077207cd3a36
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/