OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "storage/browser/quota/quota_client.h" | 10 #include "storage/browser/quota/quota_client.h" |
11 #include "storage/common/quota/quota_types.h" | 11 #include "storage/common/quota/quota_types.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 class ServiceWorkerContextWrapper; | 14 class ServiceWorkerContextWrapper; |
15 | 15 |
16 class ServiceWorkerQuotaClient : public storage::QuotaClient { | 16 class ServiceWorkerQuotaClient : public storage::QuotaClient { |
17 public: | 17 public: |
18 virtual ~ServiceWorkerQuotaClient(); | 18 ~ServiceWorkerQuotaClient() override; |
19 | 19 |
20 // QuotaClient method overrides | 20 // QuotaClient method overrides |
21 virtual ID id() const override; | 21 ID id() const override; |
22 virtual void OnQuotaManagerDestroyed() override; | 22 void OnQuotaManagerDestroyed() override; |
23 virtual void GetOriginUsage(const GURL& origin, | 23 void GetOriginUsage(const GURL& origin, |
24 storage::StorageType type, | 24 storage::StorageType type, |
25 const GetUsageCallback& callback) override; | 25 const GetUsageCallback& callback) override; |
26 virtual void GetOriginsForType(storage::StorageType type, | 26 void GetOriginsForType(storage::StorageType type, |
27 const GetOriginsCallback& callback) override; | 27 const GetOriginsCallback& callback) override; |
28 virtual void GetOriginsForHost(storage::StorageType type, | 28 void GetOriginsForHost(storage::StorageType type, |
29 const std::string& host, | 29 const std::string& host, |
30 const GetOriginsCallback& callback) override; | 30 const GetOriginsCallback& callback) override; |
31 virtual void DeleteOriginData(const GURL& origin, | 31 void DeleteOriginData(const GURL& origin, |
32 storage::StorageType type, | 32 storage::StorageType type, |
33 const DeletionCallback& callback) override; | 33 const DeletionCallback& callback) override; |
34 virtual bool DoesSupport(storage::StorageType type) const override; | 34 bool DoesSupport(storage::StorageType type) const override; |
35 | 35 |
36 private: | 36 private: |
37 friend class ServiceWorkerContextWrapper; | 37 friend class ServiceWorkerContextWrapper; |
38 friend class ServiceWorkerQuotaClientTest; | 38 friend class ServiceWorkerQuotaClientTest; |
39 | 39 |
40 CONTENT_EXPORT explicit ServiceWorkerQuotaClient( | 40 CONTENT_EXPORT explicit ServiceWorkerQuotaClient( |
41 ServiceWorkerContextWrapper* context); | 41 ServiceWorkerContextWrapper* context); |
42 | 42 |
43 scoped_refptr<ServiceWorkerContextWrapper> context_; | 43 scoped_refptr<ServiceWorkerContextWrapper> context_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerQuotaClient); | 45 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerQuotaClient); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace content | 48 } // namespace content |
49 | 49 |
50 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ | 50 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_QUOTA_CLIENT_H_ |
OLD | NEW |