| 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_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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "webkit/fileapi/fileapi_export.h" | |
| 14 #include "webkit/fileapi/file_system_types.h" | 13 #include "webkit/fileapi/file_system_types.h" |
| 14 #include "webkit/storage/webkit_storage_export.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class SequencedTaskRunner; | 17 class SequencedTaskRunner; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace quota { | 20 namespace quota { |
| 21 class QuotaManagerProxy; | 21 class QuotaManagerProxy; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace fileapi { | 24 namespace fileapi { |
| 25 | 25 |
| 26 class FileSystemContext; | 26 class FileSystemContext; |
| 27 | 27 |
| 28 // An abstract interface that provides common quota-related utility functions | 28 // An abstract interface that provides common quota-related utility functions |
| 29 // for file_system_quota_client. | 29 // for file_system_quota_client. |
| 30 // All the methods of this class are synchronous and need to be called on | 30 // All the methods of this class are synchronous and need to be called on |
| 31 // the thread that the method name implies. | 31 // the thread that the method name implies. |
| 32 class FILEAPI_EXPORT FileSystemQuotaUtil { | 32 class WEBKIT_STORAGE_EXPORT FileSystemQuotaUtil { |
| 33 public: | 33 public: |
| 34 virtual ~FileSystemQuotaUtil() {} | 34 virtual ~FileSystemQuotaUtil() {} |
| 35 | 35 |
| 36 virtual void GetOriginsForTypeOnFileThread(fileapi::FileSystemType type, | 36 virtual void GetOriginsForTypeOnFileThread(fileapi::FileSystemType type, |
| 37 std::set<GURL>* origins) = 0; | 37 std::set<GURL>* origins) = 0; |
| 38 | 38 |
| 39 virtual void GetOriginsForHostOnFileThread(fileapi::FileSystemType type, | 39 virtual void GetOriginsForHostOnFileThread(fileapi::FileSystemType type, |
| 40 const std::string& host, | 40 const std::string& host, |
| 41 std::set<GURL>* origins) = 0; | 41 std::set<GURL>* origins) = 0; |
| 42 | 42 |
| 43 // Returns the amount of data used for the origin for usage tracking. | 43 // Returns the amount of data used for the origin for usage tracking. |
| 44 virtual int64 GetOriginUsageOnFileThread( | 44 virtual int64 GetOriginUsageOnFileThread( |
| 45 fileapi::FileSystemContext* file_system_context, | 45 fileapi::FileSystemContext* file_system_context, |
| 46 const GURL& origin_url, | 46 const GURL& origin_url, |
| 47 fileapi::FileSystemType type) = 0; | 47 fileapi::FileSystemType type) = 0; |
| 48 | 48 |
| 49 virtual void InvalidateUsageCache(const GURL& origin_url, | 49 virtual void InvalidateUsageCache(const GURL& origin_url, |
| 50 fileapi::FileSystemType type) = 0; | 50 fileapi::FileSystemType type) = 0; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace fileapi | 53 } // namespace fileapi |
| 54 | 54 |
| 55 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ | 55 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ |
| OLD | NEW |