| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_QUOTA_QUOTA_BACKEND_IMPL_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_QUOTA_QUOTA_BACKEND_IMPL_H_ |
| 6 #define STORAGE_BROWSER_FILEAPI_QUOTA_QUOTA_BACKEND_IMPL_H_ | 6 #define STORAGE_BROWSER_FILEAPI_QUOTA_QUOTA_BACKEND_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "storage/browser/fileapi/quota/quota_reservation_manager.h" | 10 #include "storage/browser/fileapi/quota/quota_reservation_manager.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 class STORAGE_EXPORT QuotaBackendImpl | 33 class STORAGE_EXPORT QuotaBackendImpl |
| 34 : public QuotaReservationManager::QuotaBackend { | 34 : public QuotaReservationManager::QuotaBackend { |
| 35 public: | 35 public: |
| 36 typedef QuotaReservationManager::ReserveQuotaCallback | 36 typedef QuotaReservationManager::ReserveQuotaCallback |
| 37 ReserveQuotaCallback; | 37 ReserveQuotaCallback; |
| 38 | 38 |
| 39 QuotaBackendImpl(base::SequencedTaskRunner* file_task_runner, | 39 QuotaBackendImpl(base::SequencedTaskRunner* file_task_runner, |
| 40 ObfuscatedFileUtil* obfuscated_file_util, | 40 ObfuscatedFileUtil* obfuscated_file_util, |
| 41 FileSystemUsageCache* file_system_usage_cache, | 41 FileSystemUsageCache* file_system_usage_cache, |
| 42 storage::QuotaManagerProxy* quota_manager_proxy); | 42 storage::QuotaManagerProxy* quota_manager_proxy); |
| 43 virtual ~QuotaBackendImpl(); | 43 ~QuotaBackendImpl() override; |
| 44 | 44 |
| 45 // QuotaReservationManager::QuotaBackend overrides. | 45 // QuotaReservationManager::QuotaBackend overrides. |
| 46 virtual void ReserveQuota( | 46 void ReserveQuota(const GURL& origin, |
| 47 const GURL& origin, | 47 FileSystemType type, |
| 48 FileSystemType type, | 48 int64 delta, |
| 49 int64 delta, | 49 const ReserveQuotaCallback& callback) override; |
| 50 const ReserveQuotaCallback& callback) override; | 50 void ReleaseReservedQuota(const GURL& origin, |
| 51 virtual void ReleaseReservedQuota( | 51 FileSystemType type, |
| 52 const GURL& origin, | 52 int64 size) override; |
| 53 FileSystemType type, | 53 void CommitQuotaUsage(const GURL& origin, |
| 54 int64 size) override; | 54 FileSystemType type, |
| 55 virtual void CommitQuotaUsage( | 55 int64 delta) override; |
| 56 const GURL& origin, | 56 void IncrementDirtyCount(const GURL& origin, FileSystemType type) override; |
| 57 FileSystemType type, | 57 void DecrementDirtyCount(const GURL& origin, FileSystemType type) override; |
| 58 int64 delta) override; | |
| 59 virtual void IncrementDirtyCount( | |
| 60 const GURL& origin, | |
| 61 FileSystemType type) override; | |
| 62 virtual void DecrementDirtyCount( | |
| 63 const GURL& origin, | |
| 64 FileSystemType type) override; | |
| 65 | 58 |
| 66 private: | 59 private: |
| 67 friend class content::QuotaBackendImplTest; | 60 friend class content::QuotaBackendImplTest; |
| 68 | 61 |
| 69 struct QuotaReservationInfo { | 62 struct QuotaReservationInfo { |
| 70 QuotaReservationInfo(const GURL& origin, FileSystemType type, int64 delta); | 63 QuotaReservationInfo(const GURL& origin, FileSystemType type, int64 delta); |
| 71 ~QuotaReservationInfo(); | 64 ~QuotaReservationInfo(); |
| 72 | 65 |
| 73 GURL origin; | 66 GURL origin; |
| 74 FileSystemType type; | 67 FileSystemType type; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 97 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; | 90 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; |
| 98 | 91 |
| 99 base::WeakPtrFactory<QuotaBackendImpl> weak_ptr_factory_; | 92 base::WeakPtrFactory<QuotaBackendImpl> weak_ptr_factory_; |
| 100 | 93 |
| 101 DISALLOW_COPY_AND_ASSIGN(QuotaBackendImpl); | 94 DISALLOW_COPY_AND_ASSIGN(QuotaBackendImpl); |
| 102 }; | 95 }; |
| 103 | 96 |
| 104 } // namespace storage | 97 } // namespace storage |
| 105 | 98 |
| 106 #endif // STORAGE_BROWSER_FILEAPI_QUOTA_QUOTA_BACKEND_IMPL_H_ | 99 #endif // STORAGE_BROWSER_FILEAPI_QUOTA_QUOTA_BACKEND_IMPL_H_ |
| OLD | NEW |