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

Side by Side Diff: trunk/src/webkit/browser/fileapi/quota/quota_reservation_manager.cc

Issue 64883003: Revert 233815 "Quota: Implement QuotaBackendImpl" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "webkit/browser/fileapi/quota/quota_reservation_manager.h" 5 #include "webkit/browser/fileapi/quota/quota_reservation_manager.h"
6 6
7 #include "webkit/browser/fileapi/quota/quota_reservation.h" 7 #include "webkit/browser/fileapi/quota/quota_reservation.h"
8 #include "webkit/browser/fileapi/quota/quota_reservation_buffer.h" 8 #include "webkit/browser/fileapi/quota/quota_reservation_buffer.h"
9 9
10 namespace fileapi { 10 namespace fileapi {
11 11
12 QuotaReservationManager::QuotaReservationManager( 12 QuotaReservationManager::QuotaReservationManager(QuotaBackend* backend)
13 scoped_ptr<QuotaBackend> backend) 13 : backend_(backend),
14 : backend_(backend.Pass()),
15 weak_ptr_factory_(this) { 14 weak_ptr_factory_(this) {
16 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 15 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
17 } 16 }
18 17
19 QuotaReservationManager::~QuotaReservationManager() { 18 QuotaReservationManager::~QuotaReservationManager() {
20 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 19 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
21 } 20 }
22 21
23 void QuotaReservationManager::ReserveQuota( 22 void QuotaReservationManager::ReserveQuota(
24 const GURL& origin, 23 const GURL& origin,
25 FileSystemType type, 24 FileSystemType type,
26 int64 size, 25 int64 size,
27 const ReserveQuotaCallback& callback) { 26 const ReserveQuotaCallback& callback) {
28 backend_->ReserveQuota(origin, type, size, callback); 27 backend_->ReserveQuota(origin, type, size, callback);
29 } 28 }
30 29
31 void QuotaReservationManager::ReleaseReservedQuota( 30 void QuotaReservationManager::ReleaseReservedQuota(
32 const GURL& origin, 31 const GURL& origin,
33 FileSystemType type, 32 FileSystemType type,
34 int64 size) { 33 int64 size) {
35 backend_->ReleaseReservedQuota(origin, type, size); 34 backend_->ReleaseReservedQuota(origin, type, size);
36 } 35 }
37 36
38 void QuotaReservationManager::CommitQuotaUsage( 37 void QuotaReservationManager::CommitQuotaUsage(
39 const GURL& origin, 38 const GURL& origin,
40 FileSystemType type, 39 FileSystemType type,
41 int64 delta) { 40 int64 delta,
42 backend_->CommitQuotaUsage(origin, type, delta); 41 const StatusCallback& callback) {
42 backend_->CommitQuotaUsage(origin, type, delta, callback);
43 } 43 }
44 44
45 void QuotaReservationManager::IncrementDirtyCount(const GURL& origin, 45 void QuotaReservationManager::IncreaseDirtyCount(const GURL& origin,
46 FileSystemType type) { 46 FileSystemType type) {
47 backend_->IncrementDirtyCount(origin, type); 47 backend_->IncreaseDirtyCount(origin, type);
48 } 48 }
49 49
50 void QuotaReservationManager::DecrementDirtyCount(const GURL& origin, 50 void QuotaReservationManager::DecreaseDirtyCount(const GURL& origin,
51 FileSystemType type) { 51 FileSystemType type) {
52 backend_->DecrementDirtyCount(origin, type); 52 backend_->DecreaseDirtyCount(origin, type);
53 } 53 }
54 54
55 scoped_refptr<QuotaReservationBuffer> 55 scoped_refptr<QuotaReservationBuffer>
56 QuotaReservationManager::GetReservationBuffer( 56 QuotaReservationManager::GetReservationBuffer(
57 const GURL& origin, 57 const GURL& origin,
58 FileSystemType type) { 58 FileSystemType type) {
59 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 59 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
60 QuotaReservationBuffer** buffer = 60 QuotaReservationBuffer** buffer =
61 &reservation_buffers_[std::make_pair(origin, type)]; 61 &reservation_buffers_[std::make_pair(origin, type)];
62 if (!*buffer) { 62 if (!*buffer) {
(...skipping 12 matching lines...) Expand all
75 reservation_buffers_.erase(key); 75 reservation_buffers_.erase(key);
76 } 76 }
77 77
78 scoped_refptr<QuotaReservation> QuotaReservationManager::CreateReservation( 78 scoped_refptr<QuotaReservation> QuotaReservationManager::CreateReservation(
79 const GURL& origin, 79 const GURL& origin,
80 FileSystemType type) { 80 FileSystemType type) {
81 return GetReservationBuffer(origin, type)->CreateReservation();; 81 return GetReservationBuffer(origin, type)->CreateReservation();;
82 } 82 }
83 83
84 } // namespace fileapi 84 } // namespace fileapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698