[email protected] | bcbd98d | 2012-05-07 04:10:10 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 20c2df6 | 2013-05-21 08:26:36 | [diff] [blame] | 5 | #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ |
6 | #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ | ||||
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 7 | |
8 | #include <set> | ||||
9 | #include <string> | ||||
10 | |||||
11 | #include "base/basictypes.h" | ||||
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 12 | #include "googleurl/src/gurl.h" |
[email protected] | 61d271f3 | 2013-05-28 04:59:23 | [diff] [blame] | 13 | #include "webkit/common/fileapi/file_system_types.h" |
[email protected] | bcded8d | 2012-10-18 09:09:04 | [diff] [blame] | 14 | #include "webkit/storage/webkit_storage_export.h" |
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 15 | |
[email protected] | e5006b9 | 2011-05-17 11:53:51 | [diff] [blame] | 16 | namespace base { |
[email protected] | bcbd98d | 2012-05-07 04:10:10 | [diff] [blame] | 17 | class SequencedTaskRunner; |
[email protected] | e5006b9 | 2011-05-17 11:53:51 | [diff] [blame] | 18 | } |
19 | |||||
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 20 | namespace quota { |
21 | class QuotaManagerProxy; | ||||
22 | } | ||||
23 | |||||
24 | namespace fileapi { | ||||
25 | |||||
[email protected] | 2289452 | 2012-05-23 07:14:58 | [diff] [blame] | 26 | class FileSystemContext; |
27 | |||||
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 28 | // An abstract interface that provides common quota-related utility functions |
[email protected] | caf6670 | 2012-09-07 07:02:20 | [diff] [blame] | 29 | // for file_system_quota_client. |
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 30 | // All the methods of this class are synchronous and need to be called on |
31 | // the thread that the method name implies. | ||||
[email protected] | bcded8d | 2012-10-18 09:09:04 | [diff] [blame] | 32 | class WEBKIT_STORAGE_EXPORT FileSystemQuotaUtil { |
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 33 | public: |
[email protected] | caf6670 | 2012-09-07 07:02:20 | [diff] [blame] | 34 | virtual ~FileSystemQuotaUtil() {} |
[email protected] | e5006b9 | 2011-05-17 11:53:51 | [diff] [blame] | 35 | |
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 36 | virtual void GetOriginsForTypeOnFileThread(fileapi::FileSystemType type, |
37 | std::set<GURL>* origins) = 0; | ||||
38 | |||||
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 39 | virtual void GetOriginsForHostOnFileThread(fileapi::FileSystemType type, |
40 | const std::string& host, | ||||
41 | std::set<GURL>* origins) = 0; | ||||
42 | |||||
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 43 | // Returns the amount of data used for the origin for usage tracking. |
[email protected] | 2289452 | 2012-05-23 07:14:58 | [diff] [blame] | 44 | virtual int64 GetOriginUsageOnFileThread( |
45 | fileapi::FileSystemContext* file_system_context, | ||||
46 | const GURL& origin_url, | ||||
47 | fileapi::FileSystemType type) = 0; | ||||
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 48 | |
[email protected] | 3458333 | 2011-08-31 08:59:47 | [diff] [blame] | 49 | virtual void InvalidateUsageCache(const GURL& origin_url, |
50 | fileapi::FileSystemType type) = 0; | ||||
[email protected] | bd4219cf | 2013-04-26 14:33:46 | [diff] [blame] | 51 | virtual void StickyInvalidateUsageCache(const GURL& origin, |
52 | fileapi::FileSystemType type) = 0; | ||||
[email protected] | 5caeb20 | 2011-05-17 07:42:07 | [diff] [blame] | 53 | }; |
54 | |||||
55 | } // namespace fileapi | ||||
56 | |||||
[email protected] | 20c2df6 | 2013-05-21 08:26:36 | [diff] [blame] | 57 | #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ |