OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "webkit/browser/fileapi/file_system_quota_util.h" | 16 #include "storage/browser/fileapi/file_system_quota_util.h" |
17 #include "webkit/browser/quota/quota_client.h" | 17 #include "storage/browser/quota/quota_client.h" |
18 #include "webkit/browser/webkit_storage_browser_export.h" | 18 #include "storage/common/storage_export.h" |
19 #include "webkit/common/fileapi/file_system_types.h" | 19 #include "storage/common/fileapi/file_system_types.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
23 } | 23 } |
24 | 24 |
25 namespace fileapi { | 25 namespace storage { |
26 | 26 |
27 class FileSystemContext; | 27 class FileSystemContext; |
28 | 28 |
29 // An instance of this class is created per-profile. This class | 29 // An instance of this class is created per-profile. This class |
30 // is self-destructed and will delete itself when OnQuotaManagerDestroyed | 30 // is self-destructed and will delete itself when OnQuotaManagerDestroyed |
31 // is called. | 31 // is called. |
32 // All of the public methods of this class are called by the quota manager | 32 // All of the public methods of this class are called by the quota manager |
33 // (except for the constructor/destructor). | 33 // (except for the constructor/destructor). |
34 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemQuotaClient | 34 class STORAGE_EXPORT_PRIVATE FileSystemQuotaClient |
35 : public NON_EXPORTED_BASE(quota::QuotaClient) { | 35 : public NON_EXPORTED_BASE(quota::QuotaClient) { |
36 public: | 36 public: |
37 FileSystemQuotaClient( | 37 FileSystemQuotaClient(FileSystemContext* file_system_context, |
38 FileSystemContext* file_system_context, | 38 bool is_incognito); |
39 bool is_incognito); | |
40 virtual ~FileSystemQuotaClient(); | 39 virtual ~FileSystemQuotaClient(); |
41 | 40 |
42 // QuotaClient methods. | 41 // QuotaClient methods. |
43 virtual quota::QuotaClient::ID id() const OVERRIDE; | 42 virtual quota::QuotaClient::ID id() const OVERRIDE; |
44 virtual void OnQuotaManagerDestroyed() OVERRIDE; | 43 virtual void OnQuotaManagerDestroyed() OVERRIDE; |
45 virtual void GetOriginUsage(const GURL& origin_url, | 44 virtual void GetOriginUsage(const GURL& origin_url, |
46 quota::StorageType type, | 45 quota::StorageType type, |
47 const GetUsageCallback& callback) OVERRIDE; | 46 const GetUsageCallback& callback) OVERRIDE; |
48 virtual void GetOriginsForType( | 47 virtual void GetOriginsForType(quota::StorageType type, |
49 quota::StorageType type, | 48 const GetOriginsCallback& callback) OVERRIDE; |
50 const GetOriginsCallback& callback) OVERRIDE; | 49 virtual void GetOriginsForHost(quota::StorageType type, |
51 virtual void GetOriginsForHost( | 50 const std::string& host, |
52 quota::StorageType type, | 51 const GetOriginsCallback& callback) OVERRIDE; |
53 const std::string& host, | 52 virtual void DeleteOriginData(const GURL& origin, |
54 const GetOriginsCallback& callback) OVERRIDE; | 53 quota::StorageType type, |
55 virtual void DeleteOriginData( | 54 const DeletionCallback& callback) OVERRIDE; |
56 const GURL& origin, | |
57 quota::StorageType type, | |
58 const DeletionCallback& callback) OVERRIDE; | |
59 virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; | 55 virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; |
60 | 56 |
61 private: | 57 private: |
62 base::SequencedTaskRunner* file_task_runner() const; | 58 base::SequencedTaskRunner* file_task_runner() const; |
63 | 59 |
64 scoped_refptr<FileSystemContext> file_system_context_; | 60 scoped_refptr<FileSystemContext> file_system_context_; |
65 | 61 |
66 bool is_incognito_; | 62 bool is_incognito_; |
67 | 63 |
68 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClient); | 64 DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClient); |
69 }; | 65 }; |
70 | 66 |
71 } // namespace fileapi | 67 } // namespace storage |
72 | 68 |
73 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ | 69 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ |
OLD | NEW |