| 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 CONTENT_BROWSER_RENDERER_HOST_PEPPER_QUOTA_RESERVATION_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_QUOTA_RESERVATION_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_QUOTA_RESERVATION_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_QUOTA_RESERVATION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // For unit testing only. A QuotaReservation intended for unit testing will | 73 // For unit testing only. A QuotaReservation intended for unit testing will |
| 74 // have file_system_context_ == NULL. | 74 // have file_system_context_ == NULL. |
| 75 QuotaReservation( | 75 QuotaReservation( |
| 76 scoped_refptr<fileapi::QuotaReservation> quota_reservation, | 76 scoped_refptr<fileapi::QuotaReservation> quota_reservation, |
| 77 const GURL& origin_url, | 77 const GURL& origin_url, |
| 78 fileapi::FileSystemType file_system_type); | 78 fileapi::FileSystemType file_system_type); |
| 79 | 79 |
| 80 ~QuotaReservation(); | 80 ~QuotaReservation(); |
| 81 | 81 |
| 82 void GotReservedQuota(const ReserveQuotaCallback& callback, | 82 void GotReservedQuota(const ReserveQuotaCallback& callback, |
| 83 base::PlatformFileError error); | 83 base::File::Error error); |
| 84 | 84 |
| 85 void DeleteOnCorrectThread() const; | 85 void DeleteOnCorrectThread() const; |
| 86 | 86 |
| 87 scoped_refptr<fileapi::FileSystemContext> file_system_context_; | 87 scoped_refptr<fileapi::FileSystemContext> file_system_context_; |
| 88 scoped_refptr<fileapi::QuotaReservation> quota_reservation_; | 88 scoped_refptr<fileapi::QuotaReservation> quota_reservation_; |
| 89 typedef std::map<int32_t, fileapi::OpenFileHandle*> FileMap; | 89 typedef std::map<int32_t, fileapi::OpenFileHandle*> FileMap; |
| 90 FileMap files_; | 90 FileMap files_; |
| 91 | 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(QuotaReservation); | 92 DISALLOW_COPY_AND_ASSIGN(QuotaReservation); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 struct QuotaReservationDeleter { | 95 struct QuotaReservationDeleter { |
| 96 static void Destruct(const QuotaReservation* quota_reservation) { | 96 static void Destruct(const QuotaReservation* quota_reservation) { |
| 97 quota_reservation->DeleteOnCorrectThread(); | 97 quota_reservation->DeleteOnCorrectThread(); |
| 98 } | 98 } |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace content | 101 } // namespace content |
| 102 | 102 |
| 103 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_QUOTA_RESERVATION_H_ | 103 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_QUOTA_RESERVATION_H_ |
| OLD | NEW |