| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef STORAGE_BROWSER_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ |
| 6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ | 6 #define STORAGE_BROWSER_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 public: | 37 public: |
| 38 typedef std::map<base::FilePath, int64> PendingUpdateNotificationMap; | 38 typedef std::map<base::FilePath, int64> PendingUpdateNotificationMap; |
| 39 | 39 |
| 40 SandboxQuotaObserver(storage::QuotaManagerProxy* quota_manager_proxy, | 40 SandboxQuotaObserver(storage::QuotaManagerProxy* quota_manager_proxy, |
| 41 base::SequencedTaskRunner* update_notify_runner, | 41 base::SequencedTaskRunner* update_notify_runner, |
| 42 ObfuscatedFileUtil* sandbox_file_util, | 42 ObfuscatedFileUtil* sandbox_file_util, |
| 43 FileSystemUsageCache* file_system_usage_cache_); | 43 FileSystemUsageCache* file_system_usage_cache_); |
| 44 virtual ~SandboxQuotaObserver(); | 44 virtual ~SandboxQuotaObserver(); |
| 45 | 45 |
| 46 // FileUpdateObserver overrides. | 46 // FileUpdateObserver overrides. |
| 47 virtual void OnStartUpdate(const FileSystemURL& url) OVERRIDE; | 47 virtual void OnStartUpdate(const FileSystemURL& url) override; |
| 48 virtual void OnUpdate(const FileSystemURL& url, int64 delta) OVERRIDE; | 48 virtual void OnUpdate(const FileSystemURL& url, int64 delta) override; |
| 49 virtual void OnEndUpdate(const FileSystemURL& url) OVERRIDE; | 49 virtual void OnEndUpdate(const FileSystemURL& url) override; |
| 50 | 50 |
| 51 // FileAccessObserver overrides. | 51 // FileAccessObserver overrides. |
| 52 virtual void OnAccess(const FileSystemURL& url) OVERRIDE; | 52 virtual void OnAccess(const FileSystemURL& url) override; |
| 53 | 53 |
| 54 void SetUsageCacheEnabled(const GURL& origin, | 54 void SetUsageCacheEnabled(const GURL& origin, |
| 55 FileSystemType type, | 55 FileSystemType type, |
| 56 bool enabled); | 56 bool enabled); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 void ApplyPendingUsageUpdate(); | 59 void ApplyPendingUsageUpdate(); |
| 60 void UpdateUsageCacheFile(const base::FilePath& usage_file_path, int64 delta); | 60 void UpdateUsageCacheFile(const base::FilePath& usage_file_path, int64 delta); |
| 61 | 61 |
| 62 base::FilePath GetUsageCachePath(const FileSystemURL& url); | 62 base::FilePath GetUsageCachePath(const FileSystemURL& url); |
| 63 | 63 |
| 64 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; | 64 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; |
| 65 scoped_refptr<base::SequencedTaskRunner> update_notify_runner_; | 65 scoped_refptr<base::SequencedTaskRunner> update_notify_runner_; |
| 66 | 66 |
| 67 // Not owned; sandbox_file_util_ should have identical lifetime with this. | 67 // Not owned; sandbox_file_util_ should have identical lifetime with this. |
| 68 ObfuscatedFileUtil* sandbox_file_util_; | 68 ObfuscatedFileUtil* sandbox_file_util_; |
| 69 | 69 |
| 70 // Not owned; file_system_usage_cache_ should have longer lifetime than this. | 70 // Not owned; file_system_usage_cache_ should have longer lifetime than this. |
| 71 FileSystemUsageCache* file_system_usage_cache_; | 71 FileSystemUsageCache* file_system_usage_cache_; |
| 72 | 72 |
| 73 PendingUpdateNotificationMap pending_update_notification_; | 73 PendingUpdateNotificationMap pending_update_notification_; |
| 74 scoped_ptr<TimedTaskHelper> delayed_cache_update_helper_; | 74 scoped_ptr<TimedTaskHelper> delayed_cache_update_helper_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(SandboxQuotaObserver); | 76 DISALLOW_COPY_AND_ASSIGN(SandboxQuotaObserver); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace storage | 79 } // namespace storage |
| 80 | 80 |
| 81 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ | 81 #endif // STORAGE_BROWSER_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ |
| OLD | NEW |