AppCache: Add holder for AppCacheQuotaClient in AppCacheServiceImpl.
Before this CL, AppCacheServiceImpl owned (as much as a ref-counted class can be owned) AppCacheQuotaClient directly, via a scoped_refptr. This introduces the following complexity: * AppCacheQuotaClient (a complex class) is constructed on the UI thread, and accessed later on the IO thread. * AppCacheStorageImpl and AppCacheStorageImpl (two complex classes) live on the UI thread, but are responsible for thread-hopping to the IO thread when accessing AppCacheQuotaClient. * The owning reference for AppCacheQuotaClient lives in the UI thread, which forces AppCacheQuotaClient to inherit from RefCountedThreadSafe. This is the main reason why QuotaClient is ref-counted. This CL introduces a QuotaClientHolder class that's internal to AppCacheServiceImpl. This class lives on the UI thread, and takes on the responsibility for all thread-hopping needed to access AppCacheQuotaClient exclusively on the IO thread. Changing QuotaClient's ownership model away from ref-counting is left for future CLs, in the interest of keeping this CL manageable. This CL does not introduce any behavior changes. Bug: 1016065 Change-Id: I46d7029d054a674c9252fe4b975fef17cabde010 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519742 Reviewed-by:enne <enne@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#824559}
Loading
Please register or sign in to comment