• danakj's avatar
    Allow chaining OnceCallback.Then(RepeatingCallback). · 788a3897
    danakj authored
    Because the input type to OnceCallback::Then() is a templated type as
    OnceCallback<U>, a RepeatingCallback does not bind and implicitly
    convert to a OnceCallback. This is because templated pattern matching
    does not try conversions, so it must match exactly.
    
    Add an overload of OnceCallback::Then() to receive a RepeatingCallback
    and cast it explicitly to a OnceCallback, forwarding it on to the
    original Then() method.
    
    R=dcheng@chromium.org
    
    Bug: 1140582
    Change-Id: Ib571eb361922588a3f200e6aea5c045aad0f72d7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2510411
    Commit-Queue: danakj <danakj@chromium.org>
    Auto-Submit: danakj <danakj@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#822850}
    788a3897
callback.h 9.33 KB