AU/PM: Easier destruction of provider variables
This affords as simple, automated and safe destruction of global
Variable pointer.
* We define a ScopedPtrVarCloser<T> class, which frees and nullifies the
pointer it is pointing to. This is placed in provider_utils.h (for
now), for use by provider implementations.
* Accordingly, it is straightforward to define a closer member in
a concrete provider implementation via the typeof directive (see
random_provider.h).
* It's now safe to remove trivial desctructors in Providers, e.g. the
one of RandomProvider.
BUG=None
TEST=Builds and passes unit tests.
Change-Id: I956a0b28a6ae6d1e22e669fdc4f28e9ac5c67415
Reviewed-on: https://chromium-review.googlesource.com/184353
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
5 files changed