Rewrite StaleHostResolver around CreateRequest() API
Motivation is that HostResolver::Resolve() is soon to be deleted and all usage converted to CreateRequest (or to network service APIs). Need to ensure cronet/StaleHostResolver continue working during transition. Fully implemented StaleHostResolver::CreateRequest(). StaleHostResolver::Resolve() now implemented using CreateRequest() and HostResolver::ResolveLegacy(). As the new API is more focused on the ResolveHostRequest object, it made more sense to convert the StaleHostResolver::RequestImpl to be a direct implementation, rather than using a separate Handle. Main difference is lifetime semantics. The object is now owned by the client instead of self-destroying on completion. Extra orphaned requests (allowed to complete to backfill the cache) are then detached to be owned by StaleHostResolver instance itself as the client will likely destroy the request after getting results. With added weak ptr back to StaleHostResolver, it became simpler to have RequestImpl directly read options_ and implement the stale usable checks rather than pass in a callback. Bug: 922699 Change-Id: Iadb48c0d574cc47ff6f79a6d313164b126c1d76d Reviewed-on: https://chromium-review.googlesource.com/c/1452699Reviewed-by:Paul Jensen <pauljensen@chromium.org> Commit-Queue: Eric Orth <ericorth@chromium.org> Cr-Commit-Position: refs/heads/master@{#629601}
Showing
This diff is collapsed.
Please register or sign in to comment