Skip to content
Commit 211317fe authored by Victor Costan's avatar Victor Costan Committed by Commit Bot
Browse files

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: default avatarenne <enne@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824559}
parent ff228a68
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment