Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Unified Diff: content/browser/service_worker/service_worker_cache_quota_client.h

Issue 651983002: [ServiceWorkerCache] Implement storage::QuotaClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from PS7 Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_cache_quota_client.h
diff --git a/storage/browser/database/database_quota_client.h b/content/browser/service_worker/service_worker_cache_quota_client.h
similarity index 52%
copy from storage/browser/database/database_quota_client.h
copy to content/browser/service_worker/service_worker_cache_quota_client.h
index c561f3262e8fc5eab6102e774c39f14fdc3e95e3..0872e0c516cd117a8c8da279706fbe483289567d 100644
--- a/storage/browser/database/database_quota_client.h
+++ b/content/browser/service_worker/service_worker_cache_quota_client.h
@@ -1,35 +1,29 @@
-// 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_
+#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_H_
+#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_H_
-#include <set>
-#include <string>
-
-#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 QuotaManagerProxy;
+}
-class DatabaseTracker;
+namespace content {
+class ServiceWorkerCacheStorageManager;
falken 2014/10/17 02:27:15 Could you add a lightweight comment about who owns
jkarlin 2014/10/17 13:58:43 Done.
-// 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
+class CONTENT_EXPORT ServiceWorkerCacheQuotaClient
: public storage::QuotaClient {
public:
- DatabaseQuotaClient(
- base::MessageLoopProxy* tracker_thread,
- DatabaseTracker* tracker);
- virtual ~DatabaseQuotaClient();
+ 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_url,
@@ -46,12 +40,11 @@ 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
+ scoped_refptr<ServiceWorkerCacheStorageManager> cache_manager_;
- DISALLOW_COPY_AND_ASSIGN(DatabaseQuotaClient);
+ DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheQuotaClient);
};
-} // namespace storage
+} // namespace content
-#endif // STORAGE_BROWSER_DATABASE_DATABASE_QUOTA_CLIENT_H_
+#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_QUOTA_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698