| Index: webkit/browser/fileapi/quota/quota_reservation_manager.h
|
| diff --git a/webkit/browser/fileapi/quota/quota_reservation_manager.h b/webkit/browser/fileapi/quota/quota_reservation_manager.h
|
| index 2e3ae9358998baa42d48c96f635a514522db9660..d4c58ac9ab641bb28b288134db940bb2be860e2c 100644
|
| --- a/webkit/browser/fileapi/quota/quota_reservation_manager.h
|
| +++ b/webkit/browser/fileapi/quota/quota_reservation_manager.h
|
| @@ -6,6 +6,7 @@
|
| #define WEBKIT_BROWSER_FILEAPI_QUOTA_QUOTA_RESERVATION_MANAGER_H_
|
|
|
| #include <map>
|
| +#include <utility>
|
|
|
| #include "base/basictypes.h"
|
| #include "base/callback_forward.h"
|
| @@ -26,12 +27,18 @@ class OpenFileHandleContext;
|
| class WEBKIT_STORAGE_BROWSER_EXPORT QuotaReservationManager {
|
| public:
|
| typedef base::Callback<void(base::PlatformFileError error)> StatusCallback;
|
| +
|
| + // Callback for ReserveQuota. When this callback returns false, ReserveQuota
|
| + // operation should be reverted.
|
| typedef base::Callback<bool(base::PlatformFileError error)>
|
| ReserveQuotaCallback;
|
|
|
| // An abstraction of backing quota system.
|
| - class QuotaBackend {
|
| + class WEBKIT_STORAGE_BROWSER_EXPORT QuotaBackend {
|
| public:
|
| + QuotaBackend() {}
|
| + virtual ~QuotaBackend() {}
|
| +
|
| // Reserves or reclaims |delta| of quota for |origin| and |type| pair.
|
| // Reserved quota should be counted as usage, but it should be on-memory
|
| // and be cleared by a browser restart.
|
| @@ -55,15 +62,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaReservationManager {
|
| int64 delta,
|
| const StatusCallback& callback) = 0;
|
|
|
| - virtual void IncreaseDirtyCount(const GURL& origin,
|
| + virtual void IncrementDirtyCount(const GURL& origin,
|
| FileSystemType type) = 0;
|
| - virtual void DecreaseDirtyCount(const GURL& origin,
|
| + virtual void DecrementDirtyCount(const GURL& origin,
|
| FileSystemType type) = 0;
|
|
|
| - protected:
|
| - QuotaBackend() {}
|
| - virtual ~QuotaBackend() {}
|
| -
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(QuotaBackend);
|
| };
|
| @@ -98,17 +101,15 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaReservationManager {
|
| int64 delta,
|
| const StatusCallback& callback);
|
|
|
| - void IncreaseDirtyCount(const GURL& origin, FileSystemType type);
|
| - void DecreaseDirtyCount(const GURL& origin, FileSystemType type);
|
| + void IncrementDirtyCount(const GURL& origin, FileSystemType type);
|
| + void DecrementDirtyCount(const GURL& origin, FileSystemType type);
|
|
|
| scoped_refptr<QuotaReservationBuffer> GetReservationBuffer(
|
| const GURL& origin,
|
| FileSystemType type);
|
| void ReleaseReservationBuffer(QuotaReservationBuffer* reservation_pool);
|
|
|
| -
|
| - // Not owned. |backend_| should outlive QuotaReservationManager
|
| - QuotaBackend* backend_;
|
| + scoped_ptr<QuotaBackend> backend_;
|
|
|
| // Not owned. The destructor of ReservationBuffer should erase itself from
|
| // |reservation_buffers_| by calling ReleaseReservationBuffer.
|
|
|