Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: webkit/browser/fileapi/quota/quota_reservation.h

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/browser/fileapi/quota/quota_reservation.h
diff --git a/webkit/browser/fileapi/quota/quota_reservation.h b/webkit/browser/fileapi/quota/quota_reservation.h
deleted file mode 100644
index 9233a243b976d1dfc47ac4cfc30d8db3dd36d46f..0000000000000000000000000000000000000000
--- a/webkit/browser/fileapi/quota/quota_reservation.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef WEBKIT_BROWSER_FILEAPI_QUOTA_QUOTA_RESERVATION_H_
-#define WEBKIT_BROWSER_FILEAPI_QUOTA_QUOTA_RESERVATION_H_
-
-#include "base/basictypes.h"
-#include "base/files/file.h"
-#include "base/files/file_path.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "webkit/browser/fileapi/quota/quota_reservation_manager.h"
-#include "webkit/browser/webkit_storage_browser_export.h"
-#include "webkit/common/fileapi/file_system_types.h"
-
-class GURL;
-
-namespace fileapi {
-
-class QuotaReservationBuffer;
-class OpenFileHandle;
-
-// Represents a unit of quota reservation.
-class WEBKIT_STORAGE_BROWSER_EXPORT QuotaReservation
- : public base::RefCounted<QuotaReservation> {
- public:
- typedef base::Callback<void(base::File::Error error)> StatusCallback;
-
- // Reclaims unused quota and reserves another |size| of quota. So that the
- // resulting new |remaining_quota_| will be same as |size| as far as available
- // space is enough. |remaining_quota_| may be less than |size| if there is
- // not enough space available.
- // Invokes |callback| upon completion.
- void RefreshReservation(int64 size, const StatusCallback& callback);
-
- // Associates |platform_path| to the QuotaReservation instance.
- // Returns an OpenFileHandle instance that represents a quota managed file.
- scoped_ptr<OpenFileHandle> GetOpenFileHandle(
- const base::FilePath& platform_path);
-
- // Should be called when the associated client is crashed.
- // This implies the client can no longer report its consumption of the
- // reserved quota.
- // QuotaReservation puts all remaining quota to the QuotaReservationBuffer, so
- // that the remaining quota will be reclaimed after all open files associated
- // to the origin and type.
- void OnClientCrash();
-
- // Consumes |size| of reserved quota for a associated file.
- // Consumed quota is sent to associated QuotaReservationBuffer for staging.
- void ConsumeReservation(int64 size);
-
- // Returns amount of unused reserved quota.
- int64 remaining_quota() const { return remaining_quota_; }
-
- QuotaReservationManager* reservation_manager();
- const GURL& origin() const;
- FileSystemType type() const;
-
- private:
- friend class QuotaReservationBuffer;
-
- // Use QuotaReservationManager as the entry point.
- explicit QuotaReservation(QuotaReservationBuffer* reservation_buffer);
-
- friend class base::RefCounted<QuotaReservation>;
- virtual ~QuotaReservation();
-
- static bool AdaptDidUpdateReservedQuota(
- const base::WeakPtr<QuotaReservation>& reservation,
- int64 previous_size,
- const StatusCallback& callback,
- base::File::Error error,
- int64 delta);
- bool DidUpdateReservedQuota(int64 previous_size,
- const StatusCallback& callback,
- base::File::Error error,
- int64 delta);
-
- bool client_crashed_;
- bool running_refresh_request_;
- int64 remaining_quota_;
-
- scoped_refptr<QuotaReservationBuffer> reservation_buffer_;
-
- base::SequenceChecker sequence_checker_;
- base::WeakPtrFactory<QuotaReservation> weak_ptr_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(QuotaReservation);
-};
-
-} // namespace fileapi
-
-#endif // WEBKIT_BROWSER_FILEAPI_QUOTA_QUOTA_RESERVATION_H_
« no previous file with comments | « webkit/browser/fileapi/quota/quota_backend_impl.cc ('k') | webkit/browser/fileapi/quota/quota_reservation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698