retry_util: add a |success_functor| to GenericRetry

Add a feature to GenericRetry allowing it to call a functor upon
success. This allows users of this function to create "log upon
successful retry" behavior, or other features that require knowing the
attempt # of the successful call to the retried function.

BUG=None
TEST=unit tests added

Change-Id: I7eace243fce2282121625cabae8f52a888af0875
Reviewed-on: https://chromium-review.googlesource.com/289850
Trybot-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
2 files changed