Index: content/browser/service_worker/service_worker_cache_quota_client.h |
diff --git a/content/browser/service_worker/service_worker_quota_client.h b/content/browser/service_worker/service_worker_cache_quota_client.h |
similarity index 53% |
copy from content/browser/service_worker/service_worker_quota_client.h |
copy to content/browser/service_worker/service_worker_cache_quota_client.h |
index 7b69b45c38737ede03e32821adfbef08d6d585f7..ec3185d292360f2d3cf277aefc5aef3218569c04 100644 |
--- a/content/browser/service_worker/service_worker_quota_client.h |
+++ b/content/browser/service_worker/service_worker_cache_quota_client.h |
@@ -2,24 +2,33 @@ |
// 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_QUOTA_CLIENT_H_ |
-#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
+#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_H_ |
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_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 ServiceWorkerContextWrapper; |
+class ServiceWorkerCacheStorageManager; |
-class ServiceWorkerQuotaClient : public storage::QuotaClient { |
+// ServiceWorkerCacheQuotaClient is owned by the QuotaManager. There is one per |
+// ServiceWorkerCacheStorageManager, and therefore one per ServiceWorkerContext. |
falken
2014/10/17 15:52:03
nit: ServiceWorkerContextCore
jkarlin
2014/10/17 16:14:00
Done.
|
+class CONTENT_EXPORT ServiceWorkerCacheQuotaClient |
+ : public storage::QuotaClient { |
public: |
- virtual ~ServiceWorkerQuotaClient(); |
+ explicit ServiceWorkerCacheQuotaClient( |
+ const scoped_refptr<ServiceWorkerCacheStorageManager>& cache_manager); |
+ virtual ~ServiceWorkerCacheQuotaClient(); |
- // QuotaClient method overrides |
+ // QuotaClient overrides |
virtual ID id() const override; |
virtual void OnQuotaManagerDestroyed() override; |
- virtual void GetOriginUsage(const GURL& origin, |
+ virtual void GetOriginUsage(const GURL& origin_url, |
storage::StorageType type, |
const GetUsageCallback& callback) override; |
virtual void GetOriginsForType(storage::StorageType type, |
@@ -33,17 +42,11 @@ class ServiceWorkerQuotaClient : public storage::QuotaClient { |
virtual bool DoesSupport(storage::StorageType type) const override; |
private: |
- friend class ServiceWorkerContextWrapper; |
- friend class ServiceWorkerQuotaClientTest; |
- |
- CONTENT_EXPORT explicit ServiceWorkerQuotaClient( |
- ServiceWorkerContextWrapper* context); |
- |
- scoped_refptr<ServiceWorkerContextWrapper> context_; |
+ scoped_refptr<ServiceWorkerCacheStorageManager> cache_manager_; |
- DISALLOW_COPY_AND_ASSIGN(ServiceWorkerQuotaClient); |
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheQuotaClient); |
}; |
} // namespace content |
-#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_H_ |