Index: webkit/fileapi/sandbox_quota_observer.h |
diff --git a/webkit/fileapi/sandbox_quota_observer.h b/webkit/fileapi/sandbox_quota_observer.h |
index d2d6326c7c7576b9a100f161af53789d66810ab6..5548a08327e3abafdb07fd7b7d2590910d1e1565 100644 |
--- a/webkit/fileapi/sandbox_quota_observer.h |
+++ b/webkit/fileapi/sandbox_quota_observer.h |
@@ -5,12 +5,15 @@ |
#ifndef WEBKIT_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ |
#define WEBKIT_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ |
+#include <map> |
+ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
#include "base/file_path.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "webkit/fileapi/file_observers.h" |
+#include "webkit/fileapi/file_system_url.h" |
namespace base { |
class SequencedTaskRunner; |
@@ -29,6 +32,8 @@ class SandboxQuotaObserver |
: public FileUpdateObserver, |
public FileAccessObserver { |
public: |
+ typedef std::map<FilePath, int64> PendingUpdateNotificationMap; |
+ |
SandboxQuotaObserver( |
quota::QuotaManagerProxy* quota_manager_proxy, |
base::SequencedTaskRunner* update_notify_runner, |
@@ -44,6 +49,9 @@ class SandboxQuotaObserver |
virtual void OnAccess(const FileSystemURL& url) OVERRIDE; |
private: |
+ void ApplyPendingUsageUpdate(); |
+ void UpdateUsageCacheFile(const FilePath& usage_file_path, int64 delta); |
+ |
FilePath GetUsageCachePath(const FileSystemURL& url); |
scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
@@ -52,6 +60,9 @@ class SandboxQuotaObserver |
// Not owned; sandbox_file_util_ should have identical lifetime with this. |
ObfuscatedFileUtil* sandbox_file_util_; |
+ PendingUpdateNotificationMap pending_update_notification_; |
+ bool running_delayed_cache_update_; |
+ |
DISALLOW_COPY_AND_ASSIGN(SandboxQuotaObserver); |
}; |