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