OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 virtual void GetOriginsForHostOnFileThread(fileapi::FileSystemType type, | 62 virtual void GetOriginsForHostOnFileThread(fileapi::FileSystemType type, |
63 const std::string& host, | 63 const std::string& host, |
64 std::set<GURL>* origins) = 0; | 64 std::set<GURL>* origins) = 0; |
65 | 65 |
66 // Called by quota client. | 66 // Called by quota client. |
67 // Returns the amount of data used for the origin for usage tracking. | 67 // Returns the amount of data used for the origin for usage tracking. |
68 virtual int64 GetOriginUsageOnFileThread(const GURL& origin_url, | 68 virtual int64 GetOriginUsageOnFileThread(const GURL& origin_url, |
69 fileapi::FileSystemType type) = 0; | 69 fileapi::FileSystemType type) = 0; |
70 | 70 |
71 // Called by quota file util. | 71 // Called by quota file util. |
72 // Returns the amount of data used for the origin for usage tracking. | |
73 virtual void UpdateOriginUsageOnFileThread(quota::QuotaManagerProxy* proxy, | 72 virtual void UpdateOriginUsageOnFileThread(quota::QuotaManagerProxy* proxy, |
74 const GURL& origin_url, | 73 const GURL& origin_url, |
75 fileapi::FileSystemType type, | 74 fileapi::FileSystemType type, |
76 int64 delta) = 0; | 75 int64 delta) = 0; |
77 | 76 |
78 // Called by file_system_operation. | 77 // Called by file_system_operation. |
79 // Called when a read operation accesses the origin's storage data. | 78 // Called when a read operation accesses the origin's storage data. |
80 virtual void NotifyOriginWasAccessedOnIOThread( | 79 virtual void NotifyOriginWasAccessedOnIOThread( |
81 quota::QuotaManagerProxy* proxy, | 80 quota::QuotaManagerProxy* proxy, |
82 const GURL& origin_url, | 81 const GURL& origin_url, |
83 fileapi::FileSystemType type) = 0; | 82 fileapi::FileSystemType type) = 0; |
84 | 83 |
85 // Called by quota_file_util or file_writer_delegate. | 84 // Called by quota_file_util or file_writer_delegate. |
86 // Called before an write operation modifies the origin's storage data. | 85 // Called before a write operation modifies the origin's storage data. |
87 virtual void StartUpdateOriginOnFileThread(const GURL& origin_url, | 86 virtual void StartUpdateOriginOnFileThread(const GURL& origin_url, |
88 fileapi::FileSystemType type) = 0; | 87 fileapi::FileSystemType type) = 0; |
89 | 88 |
90 // Called by quota_file_util or file_writer_delegate. | 89 // Called by quota_file_util or file_writer_delegate. |
91 // Called after an write operation modifies the origin's storage data. | 90 // Called after a write operation modifies the origin's storage data. |
92 virtual void EndUpdateOriginOnFileThread(const GURL& origin_url, | 91 virtual void EndUpdateOriginOnFileThread(const GURL& origin_url, |
93 fileapi::FileSystemType type) = 0; | 92 fileapi::FileSystemType type) = 0; |
94 | 93 |
95 Proxy* proxy() { return proxy_.get(); } | 94 Proxy* proxy() { return proxy_.get(); } |
96 | 95 |
97 protected: | 96 protected: |
98 explicit FileSystemQuotaUtil(base::MessageLoopProxy* file_thread); | 97 explicit FileSystemQuotaUtil(base::MessageLoopProxy* file_thread); |
99 virtual ~FileSystemQuotaUtil(); | 98 virtual ~FileSystemQuotaUtil(); |
100 | 99 |
101 private: | 100 private: |
102 scoped_refptr<Proxy> proxy_; | 101 scoped_refptr<Proxy> proxy_; |
103 }; | 102 }; |
104 | 103 |
105 } // namespace fileapi | 104 } // namespace fileapi |
106 | 105 |
107 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ | 106 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ |
OLD | NEW |