[reland] 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

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-Original-Commit-Position: refs/heads/master@{#537949}
Change-Id: Id4e3d04802f247491b39585219482648733b2563
Reviewed-on: https://chromium-review.googlesource.com/939530
Cr-Commit-Position: refs/heads/master@{#539698}
2 files changed