blob: 0b3ce910923808ed8338df9d05190b49a638353c [file] [log] [blame]
[email protected]bcbd98d2012-05-07 04:10:101// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]5caeb202011-05-17 07:42:072// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]20c2df62013-05-21 08:26:365#ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_
6#define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_
[email protected]5caeb202011-05-17 07:42:077
8#include <set>
9#include <string>
10
11#include "base/basictypes.h"
[email protected]5caeb202011-05-17 07:42:0712#include "googleurl/src/gurl.h"
[email protected]61d271f32013-05-28 04:59:2313#include "webkit/common/fileapi/file_system_types.h"
[email protected]bcded8d2012-10-18 09:09:0414#include "webkit/storage/webkit_storage_export.h"
[email protected]5caeb202011-05-17 07:42:0715
[email protected]e5006b92011-05-17 11:53:5116namespace base {
[email protected]bcbd98d2012-05-07 04:10:1017class SequencedTaskRunner;
[email protected]e5006b92011-05-17 11:53:5118}
19
[email protected]5caeb202011-05-17 07:42:0720namespace quota {
21class QuotaManagerProxy;
22}
23
24namespace fileapi {
25
[email protected]22894522012-05-23 07:14:5826class FileSystemContext;
27
[email protected]5caeb202011-05-17 07:42:0728// An abstract interface that provides common quota-related utility functions
[email protected]caf66702012-09-07 07:02:2029// for file_system_quota_client.
[email protected]5caeb202011-05-17 07:42:0730// All the methods of this class are synchronous and need to be called on
31// the thread that the method name implies.
[email protected]bcded8d2012-10-18 09:09:0432class WEBKIT_STORAGE_EXPORT FileSystemQuotaUtil {
[email protected]5caeb202011-05-17 07:42:0733 public:
[email protected]caf66702012-09-07 07:02:2034 virtual ~FileSystemQuotaUtil() {}
[email protected]e5006b92011-05-17 11:53:5135
[email protected]5caeb202011-05-17 07:42:0736 virtual void GetOriginsForTypeOnFileThread(fileapi::FileSystemType type,
37 std::set<GURL>* origins) = 0;
38
[email protected]5caeb202011-05-17 07:42:0739 virtual void GetOriginsForHostOnFileThread(fileapi::FileSystemType type,
40 const std::string& host,
41 std::set<GURL>* origins) = 0;
42
[email protected]5caeb202011-05-17 07:42:0743 // Returns the amount of data used for the origin for usage tracking.
[email protected]22894522012-05-23 07:14:5844 virtual int64 GetOriginUsageOnFileThread(
45 fileapi::FileSystemContext* file_system_context,
46 const GURL& origin_url,
47 fileapi::FileSystemType type) = 0;
[email protected]5caeb202011-05-17 07:42:0748
[email protected]34583332011-08-31 08:59:4749 virtual void InvalidateUsageCache(const GURL& origin_url,
50 fileapi::FileSystemType type) = 0;
[email protected]bd4219cf2013-04-26 14:33:4651 virtual void StickyInvalidateUsageCache(const GURL& origin,
52 fileapi::FileSystemType type) = 0;
[email protected]5caeb202011-05-17 07:42:0753};
54
55} // namespace fileapi
56
[email protected]20c2df62013-05-21 08:26:3657#endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_