summaryrefslogtreecommitdiffstats
path: root/chromium/webkit/browser/fileapi/quota/open_file_handle.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/webkit/browser/fileapi/quota/open_file_handle.h')
-rw-r--r--chromium/webkit/browser/fileapi/quota/open_file_handle.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/chromium/webkit/browser/fileapi/quota/open_file_handle.h b/chromium/webkit/browser/fileapi/quota/open_file_handle.h
index 79f1380a437..2bd7e93713a 100644
--- a/chromium/webkit/browser/fileapi/quota/open_file_handle.h
+++ b/chromium/webkit/browser/fileapi/quota/open_file_handle.h
@@ -10,6 +10,10 @@
#include "base/memory/weak_ptr.h"
#include "webkit/browser/webkit_storage_browser_export.h"
+namespace base {
+class FilePath;
+}
+
namespace fileapi {
class QuotaReservation;
@@ -24,13 +28,28 @@ class WEBKIT_STORAGE_BROWSER_EXPORT OpenFileHandle {
~OpenFileHandle();
// Updates cached file size and consumes quota for that.
- // This should be called for each modified file before calling RefreshQuota
- // and file close.
- // Returns updated base file size that should be used to measure quota
- // consumption by difference to this.
- int64 UpdateMaxWrittenOffset(int64 offset);
+ // Both this and AddAppendModeWriteAmount should be called for each modified
+ // file before calling QuotaReservation::RefreshQuota and before closing the
+ // file.
+ void UpdateMaxWrittenOffset(int64 offset);
+
+ // Notifies that |amount| of data is written to the file in append mode, and
+ // consumes quota for that.
+ // Both this and UpdateMaxWrittenOffset should be called for each modified
+ // file before calling QuotaReservation::RefreshQuota and before closing the
+ // file.
+ void AddAppendModeWriteAmount(int64 amount);
+
+ // Returns the estimated file size for the quota consumption calculation.
+ // The client must consume its reserved quota when it writes data to the file
+ // beyond the estimated file size.
+ // The estimated file size is greater than or equal to actual file size after
+ // all clients report their file usage, and is monotonically increasing over
+ // OpenFileHandle object life cycle, so that client may cache the value.
+ int64 GetEstimatedFileSize() const;
- int64 base_file_size() const;
+ int64 GetMaxWrittenOffset() const;
+ const base::FilePath& platform_path() const;
private:
friend class QuotaReservationBuffer;