Index: content/browser/service_worker/service_worker_quota_client.h |
diff --git a/storage/browser/database/database_quota_client.h b/content/browser/service_worker/service_worker_quota_client.h |
similarity index 51% |
copy from storage/browser/database/database_quota_client.h |
copy to content/browser/service_worker/service_worker_quota_client.h |
index c561f3262e8fc5eab6102e774c39f14fdc3e95e3..b86ee96eee5c4c1496d30222b24b460b17788e9b 100644 |
--- a/storage/browser/database/database_quota_client.h |
+++ b/content/browser/service_worker/service_worker_quota_client.h |
@@ -1,38 +1,26 @@ |
-// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef STORAGE_BROWSER_DATABASE_DATABASE_QUOTA_CLIENT_H_ |
-#define STORAGE_BROWSER_DATABASE_DATABASE_QUOTA_CLIENT_H_ |
- |
-#include <set> |
-#include <string> |
+#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
#include "base/memory/ref_counted.h" |
-#include "base/message_loop/message_loop_proxy.h" |
+#include "content/common/content_export.h" |
#include "storage/browser/quota/quota_client.h" |
-#include "storage/browser/storage_browser_export.h" |
#include "storage/common/quota/quota_types.h" |
-namespace storage { |
- |
-class DatabaseTracker; |
+namespace content { |
+class ServiceWorkerContextWrapper; |
-// A QuotaClient implementation to integrate WebSQLDatabases |
-// with the quota management system. This interface is used |
-// on the IO thread by the quota manager. |
-class STORAGE_EXPORT_PRIVATE DatabaseQuotaClient |
- : public storage::QuotaClient { |
+class ServiceWorkerQuotaClient : public storage::QuotaClient { |
public: |
- DatabaseQuotaClient( |
- base::MessageLoopProxy* tracker_thread, |
- DatabaseTracker* tracker); |
- virtual ~DatabaseQuotaClient(); |
+ virtual ~ServiceWorkerQuotaClient(); |
// 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, |
@@ -46,12 +34,17 @@ class STORAGE_EXPORT_PRIVATE DatabaseQuotaClient |
virtual bool DoesSupport(storage::StorageType type) const override; |
private: |
- scoped_refptr<base::MessageLoopProxy> db_tracker_thread_; |
- scoped_refptr<DatabaseTracker> db_tracker_; // only used on its thread |
+ friend class ServiceWorkerContextWrapper; |
+ friend class ServiceWorkerQuotaClientTest; |
+ |
+ CONTENT_EXPORT explicit ServiceWorkerQuotaClient( |
+ ServiceWorkerContextWrapper* context); |
+ |
+ scoped_refptr<ServiceWorkerContextWrapper> context_; |
- DISALLOW_COPY_AND_ASSIGN(DatabaseQuotaClient); |
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerQuotaClient); |
}; |
-} // namespace storage |
+} // namespace content |
-#endif // STORAGE_BROWSER_DATABASE_DATABASE_QUOTA_CLIENT_H_ |
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |