Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / webkit / fileapi / file_system_quota_util.h
blobe014b69de03da0f31f89808b25c823c90834be0c
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_
8 #include <set>
9 #include <string>
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"
16 namespace base {
17 class SequencedTaskRunner;
20 namespace quota {
21 class QuotaManagerProxy;
24 namespace fileapi {
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 {
33 public:
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_