Commit da0f6035 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

AppCache: Reflect ownership changes in AppCacheServiceImpl constructor.

Before this CL, AppCacheServiceImpl took a QuotaManagerProxy* argument,
then stored the value in a scoped_refptr. This CL updates the
constructor signature to make it clear that the constructor saves a
reference to the QuotaManagerProxy, and propagates this update to
ChromeAppCacheService.

Change-Id: Iee7d9459e4839a5a0e7b5a454adb593aca2f1e4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2513231
Commit-Queue: enne <enne@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823834}
parent 915a3854
......@@ -377,13 +377,13 @@ AppCacheStorageReference::~AppCacheStorageReference() = default;
// AppCacheServiceImpl -------
AppCacheServiceImpl::AppCacheServiceImpl(
storage::QuotaManagerProxy* quota_manager_proxy,
scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy,
base::WeakPtr<StoragePartitionImpl> partition)
: db_task_runner_(base::ThreadPool::CreateSequencedTaskRunner(
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN})),
appcache_policy_(nullptr),
quota_manager_proxy_(quota_manager_proxy),
quota_manager_proxy_(std::move(quota_manager_proxy)),
force_keep_session_state_(false),
partition_(std::move(partition)) {
if (quota_manager_proxy_.get()) {
......
......@@ -90,9 +90,10 @@ class CONTENT_EXPORT AppCacheServiceImpl : public AppCacheService {
virtual ~Observer() = default;
};
// If not using quota management, the proxy may be NULL.
AppCacheServiceImpl(storage::QuotaManagerProxy* quota_manager_proxy,
base::WeakPtr<StoragePartitionImpl> partition);
// If not using quota management, the proxy may be null.
AppCacheServiceImpl(
scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy,
base::WeakPtr<StoragePartitionImpl> partition);
~AppCacheServiceImpl() override;
void Initialize(const base::FilePath& cache_directory);
......
......@@ -21,9 +21,10 @@
namespace content {
ChromeAppCacheService::ChromeAppCacheService(
storage::QuotaManagerProxy* quota_manager_proxy,
scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy,
base::WeakPtr<StoragePartitionImpl> partition)
: AppCacheServiceImpl(quota_manager_proxy, std::move(partition)) {}
: AppCacheServiceImpl(std::move(quota_manager_proxy),
std::move(partition)) {}
void ChromeAppCacheService::Initialize(
const base::FilePath& cache_path,
......
......@@ -47,7 +47,7 @@ class CONTENT_EXPORT ChromeAppCacheService
public AppCacheServiceImpl,
public AppCachePolicy {
public:
ChromeAppCacheService(storage::QuotaManagerProxy* proxy,
ChromeAppCacheService(scoped_refptr<storage::QuotaManagerProxy> proxy,
base::WeakPtr<StoragePartitionImpl> partition);
// If |cache_path| is empty we will use in-memory structs.
......
......@@ -1283,7 +1283,7 @@ void StoragePartitionImpl::Initialize(
if (StoragePartition::IsAppCacheEnabled()) {
appcache_service_ = base::MakeRefCounted<ChromeAppCacheService>(
quota_manager_proxy.get(), weak_factory_.GetWeakPtr());
quota_manager_proxy, weak_factory_.GetWeakPtr());
}
dedicated_worker_service_ = std::make_unique<DedicatedWorkerServiceImpl>();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment