Commit 2797c4c1 authored by Kenichi Ishibashi's avatar Kenichi Ishibashi Committed by Commit Bot

Remove ServiceWorkerRegistry dependency from ServiceWorkerStorage

The reference was tentatively added to move some code from
ServiceWorkerStorage to ServiceWorkerRegistry but it isn't
needed any more.

Bug: 1039200
Change-Id: I59ac327e120bfd82d87c3c81b95d6da3d629dd5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035230
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737715}
parent 459e299a
......@@ -55,8 +55,7 @@ ServiceWorkerRegistry::ServiceWorkerRegistry(
storage_(ServiceWorkerStorage::Create(user_data_directory,
std::move(database_task_runner),
quota_manager_proxy,
special_storage_policy,
this)) {
special_storage_policy)) {
DCHECK(context_);
}
......@@ -64,7 +63,7 @@ ServiceWorkerRegistry::ServiceWorkerRegistry(
ServiceWorkerContextCore* context,
ServiceWorkerRegistry* old_registry)
: context_(context),
storage_(ServiceWorkerStorage::Create(old_registry->storage(), this)) {
storage_(ServiceWorkerStorage::Create(old_registry->storage())) {
DCHECK(context_);
}
......
......@@ -22,7 +22,6 @@
#include "content/browser/service_worker/service_worker_disk_cache.h"
#include "content/browser/service_worker/service_worker_info.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/service_worker/service_worker_registry.h"
#include "content/common/service_worker/service_worker_utils.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/completion_once_callback.h"
......@@ -104,21 +103,19 @@ std::unique_ptr<ServiceWorkerStorage> ServiceWorkerStorage::Create(
const base::FilePath& user_data_directory,
scoped_refptr<base::SequencedTaskRunner> database_task_runner,
storage::QuotaManagerProxy* quota_manager_proxy,
storage::SpecialStoragePolicy* special_storage_policy,
ServiceWorkerRegistry* registry) {
storage::SpecialStoragePolicy* special_storage_policy) {
return base::WrapUnique(new ServiceWorkerStorage(
user_data_directory, std::move(database_task_runner), quota_manager_proxy,
special_storage_policy, registry));
special_storage_policy));
}
// static
std::unique_ptr<ServiceWorkerStorage> ServiceWorkerStorage::Create(
ServiceWorkerStorage* old_storage,
ServiceWorkerRegistry* registry) {
ServiceWorkerStorage* old_storage) {
return base::WrapUnique(new ServiceWorkerStorage(
old_storage->user_data_directory_, old_storage->database_task_runner_,
old_storage->quota_manager_proxy_.get(),
old_storage->special_storage_policy_.get(), registry));
old_storage->special_storage_policy_.get()));
}
void ServiceWorkerStorage::FindRegistrationForClientUrl(
......@@ -910,8 +907,7 @@ ServiceWorkerStorage::ServiceWorkerStorage(
const base::FilePath& user_data_directory,
scoped_refptr<base::SequencedTaskRunner> database_task_runner,
storage::QuotaManagerProxy* quota_manager_proxy,
storage::SpecialStoragePolicy* special_storage_policy,
ServiceWorkerRegistry* registry)
storage::SpecialStoragePolicy* special_storage_policy)
: next_registration_id_(blink::mojom::kInvalidServiceWorkerRegistrationId),
next_version_id_(blink::mojom::kInvalidServiceWorkerVersionId),
next_resource_id_(ServiceWorkerConsts::kInvalidServiceWorkerResourceId),
......@@ -922,9 +918,7 @@ ServiceWorkerStorage::ServiceWorkerStorage(
quota_manager_proxy_(quota_manager_proxy),
special_storage_policy_(special_storage_policy),
is_purge_pending_(false),
has_checked_for_stale_resources_(false),
registry_(registry) {
DCHECK(registry_);
has_checked_for_stale_resources_(false) {
database_.reset(new ServiceWorkerDatabase(GetDatabasePath()));
}
......
......@@ -39,7 +39,6 @@ class SpecialStoragePolicy;
namespace content {
class ServiceWorkerDiskCache;
class ServiceWorkerRegistry;
class ServiceWorkerResponseMetadataWriter;
class ServiceWorkerResponseReader;
class ServiceWorkerResponseWriter;
......@@ -116,13 +115,11 @@ class CONTENT_EXPORT ServiceWorkerStorage {
const base::FilePath& user_data_directory,
scoped_refptr<base::SequencedTaskRunner> database_task_runner,
storage::QuotaManagerProxy* quota_manager_proxy,
storage::SpecialStoragePolicy* special_storage_policy,
ServiceWorkerRegistry* registry);
storage::SpecialStoragePolicy* special_storage_policy);
// Used for DeleteAndStartOver. Creates new storage based on |old_storage|.
static std::unique_ptr<ServiceWorkerStorage> Create(
ServiceWorkerStorage* old_storage,
ServiceWorkerRegistry* registry);
ServiceWorkerStorage* old_storage);
// Reads stored registrations for |client_url| or |scope| or
// |registration_id|. Returns blink::ServiceWorkerStatusCode::kOk with
......@@ -366,8 +363,7 @@ class CONTENT_EXPORT ServiceWorkerStorage {
const base::FilePath& user_data_directory,
scoped_refptr<base::SequencedTaskRunner> database_task_runner,
storage::QuotaManagerProxy* quota_manager_proxy,
storage::SpecialStoragePolicy* special_storage_policy,
ServiceWorkerRegistry* registry);
storage::SpecialStoragePolicy* special_storage_policy);
base::FilePath GetDatabasePath();
base::FilePath GetDiskCachePath();
......@@ -549,11 +545,6 @@ class CONTENT_EXPORT ServiceWorkerStorage {
bool has_checked_for_stale_resources_;
base::OnceClosure purging_complete_callback_for_test_;
// |registry_| owns this class and must outlive this.
// TODO(crbug.com/1039200): Remove this reference once
// ServiceWorkerRegistration dependencies are moved to ServiceWorkerRegistry.
ServiceWorkerRegistry* registry_;
base::WeakPtrFactory<ServiceWorkerStorage> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerStorage);
......
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