1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_QUOTA_CLIENT_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_QUOTA_CLIENT_H_
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h"
13 #include "content/common/content_export.h"
14 #include "storage/browser/quota/quota_client.h"
15 #include "storage/browser/quota/quota_task.h"
16 #include "storage/common/quota/quota_types.h"
19 class IndexedDBContextImpl
;
21 // A QuotaClient implementation to integrate IndexedDB
22 // with the quota management system. This interface is used
23 // on the IO thread by the quota manager.
24 class IndexedDBQuotaClient
: public storage::QuotaClient
{
26 CONTENT_EXPORT
explicit IndexedDBQuotaClient(
27 IndexedDBContextImpl
* indexed_db_context
);
28 CONTENT_EXPORT
~IndexedDBQuotaClient() override
;
30 // QuotaClient method overrides
31 ID
id() const override
;
32 void OnQuotaManagerDestroyed() override
;
33 CONTENT_EXPORT
void GetOriginUsage(const GURL
& origin_url
,
34 storage::StorageType type
,
35 const GetUsageCallback
& callback
) override
;
36 CONTENT_EXPORT
void GetOriginsForType(
37 storage::StorageType type
,
38 const GetOriginsCallback
& callback
) override
;
39 CONTENT_EXPORT
void GetOriginsForHost(
40 storage::StorageType type
,
41 const std::string
& host
,
42 const GetOriginsCallback
& callback
) override
;
43 CONTENT_EXPORT
void DeleteOriginData(
45 storage::StorageType type
,
46 const DeletionCallback
& callback
) override
;
47 bool DoesSupport(storage::StorageType type
) const override
;
50 scoped_refptr
<IndexedDBContextImpl
> indexed_db_context_
;
52 DISALLOW_COPY_AND_ASSIGN(IndexedDBQuotaClient
);
55 } // namespace content
57 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_QUOTA_CLIENT_H_