Delete unused downloads page asset.
[chromium-blink-merge.git] / storage / browser / fileapi / file_system_quota_client.h
blob869e63eefefbec10390bdb4a1fd246d70c475904
1 // Copyright (c) 2012 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 STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_
6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_
8 #include <set>
9 #include <string>
10 #include <utility>
12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h"
14 #include "base/files/file_path.h"
15 #include "base/memory/ref_counted.h"
16 #include "storage/browser/fileapi/file_system_quota_util.h"
17 #include "storage/browser/quota/quota_client.h"
18 #include "storage/browser/storage_browser_export.h"
19 #include "storage/common/fileapi/file_system_types.h"
21 namespace base {
22 class SequencedTaskRunner;
25 namespace storage {
27 class FileSystemContext;
29 // An instance of this class is created per-profile. This class
30 // is self-destructed and will delete itself when OnQuotaManagerDestroyed
31 // is called.
32 // All of the public methods of this class are called by the quota manager
33 // (except for the constructor/destructor).
34 class STORAGE_EXPORT_PRIVATE FileSystemQuotaClient
35 : public NON_EXPORTED_BASE(storage::QuotaClient) {
36 public:
37 FileSystemQuotaClient(
38 FileSystemContext* file_system_context,
39 bool is_incognito);
40 ~FileSystemQuotaClient() override;
42 // QuotaClient methods.
43 storage::QuotaClient::ID id() const override;
44 void OnQuotaManagerDestroyed() override;
45 void GetOriginUsage(const GURL& origin_url,
46 storage::StorageType type,
47 const GetUsageCallback& callback) override;
48 void GetOriginsForType(storage::StorageType type,
49 const GetOriginsCallback& callback) override;
50 void GetOriginsForHost(storage::StorageType type,
51 const std::string& host,
52 const GetOriginsCallback& callback) override;
53 void DeleteOriginData(const GURL& origin,
54 storage::StorageType type,
55 const DeletionCallback& callback) override;
56 bool DoesSupport(storage::StorageType type) const override;
58 private:
59 base::SequencedTaskRunner* file_task_runner() const;
61 scoped_refptr<FileSystemContext> file_system_context_;
63 bool is_incognito_;
65 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClient);
68 } // namespace storage
70 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_