Introduce UnownedUserDataSupplier to manage an UnownedUserData supplier
Combines all the setup/lifecycle management of UUD (UnownedUserData) and Supplier, which removes a bunch of boilerplate code for setting up and tearing down separate UUD/ObservableSuppliers. It works by providing an abstract base class, which is then subclassed by the specific type being supplied through UUD. This is similar to how we currently encapsulate UUD keys to keep them private. The base class, UnownedUserDataSupplier, stores an ObservableSupplier<E> in UUD during construction. After construction, users can immediately take a reference to the ObservableSupplier through the type subclass mentioned above. This UnownedUserDataSupplier will act like a normal ObservableSupplier until it's destroyed. Change-Id: I72d466e6b34fb8e634d23a6f99ab49ee1ace1dc8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2442011Reviewed-by:Tommy Nyquist <nyquist@chromium.org> Reviewed-by:
Sky Malice <skym@chromium.org> Reviewed-by:
Filip Gorski <fgorski@chromium.org> Reviewed-by:
David Trainor <dtrainor@chromium.org> Commit-Queue: Brandon Wylie <wylieb@chromium.org> Cr-Commit-Position: refs/heads/master@{#846402}
Showing
Please register or sign in to comment