Index: content/browser/service_worker/service_worker_quota_client.h |
diff --git a/content/browser/service_worker/service_worker_cache_quota_client.h b/content/browser/service_worker/service_worker_quota_client.h |
similarity index 55% |
copy from content/browser/service_worker/service_worker_cache_quota_client.h |
copy to content/browser/service_worker/service_worker_quota_client.h |
index 65ab01832c4016ee99f938053cb794473cb086c3..b86ee96eee5c4c1496d30222b24b460b17788e9b 100644 |
--- a/content/browser/service_worker/service_worker_cache_quota_client.h |
+++ b/content/browser/service_worker/service_worker_quota_client.h |
@@ -2,35 +2,25 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_H_ |
-#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_H_ |
+#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
-#include "base/memory/weak_ptr.h" |
+#include "base/memory/ref_counted.h" |
#include "content/common/content_export.h" |
#include "storage/browser/quota/quota_client.h" |
#include "storage/common/quota/quota_types.h" |
-namespace storage { |
-class QuotaManagerProxy; |
-} |
- |
namespace content { |
-class ServiceWorkerCacheStorageManager; |
+class ServiceWorkerContextWrapper; |
-// ServiceWorkerCacheQuotaClient is owned by the QuotaManager. There is one per |
-// ServiceWorkerCacheStorageManager, and therefore one per |
-// ServiceWorkerContextCore. |
-class CONTENT_EXPORT ServiceWorkerCacheQuotaClient |
- : public storage::QuotaClient { |
+class ServiceWorkerQuotaClient : public storage::QuotaClient { |
public: |
- explicit ServiceWorkerCacheQuotaClient( |
- base::WeakPtr<ServiceWorkerCacheStorageManager> cache_manager); |
- virtual ~ServiceWorkerCacheQuotaClient(); |
+ virtual ~ServiceWorkerQuotaClient(); |
- // QuotaClient overrides |
+ // QuotaClient method overrides |
virtual ID id() const override; |
virtual void OnQuotaManagerDestroyed() override; |
- virtual void GetOriginUsage(const GURL& origin_url, |
+ virtual void GetOriginUsage(const GURL& origin, |
storage::StorageType type, |
const GetUsageCallback& callback) override; |
virtual void GetOriginsForType(storage::StorageType type, |
@@ -44,11 +34,17 @@ class CONTENT_EXPORT ServiceWorkerCacheQuotaClient |
virtual bool DoesSupport(storage::StorageType type) const override; |
private: |
- base::WeakPtr<ServiceWorkerCacheStorageManager> cache_manager_; |
+ friend class ServiceWorkerContextWrapper; |
+ friend class ServiceWorkerQuotaClientTest; |
+ |
+ CONTENT_EXPORT explicit ServiceWorkerQuotaClient( |
+ ServiceWorkerContextWrapper* context); |
+ |
+ scoped_refptr<ServiceWorkerContextWrapper> context_; |
- DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheQuotaClient); |
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerQuotaClient); |
}; |
} // namespace content |
-#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_H_ |
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |