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 #include "storage/browser/fileapi/quota/quota_reservation_manager.h" | 5 #include "storage/browser/fileapi/quota/quota_reservation_manager.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "storage/browser/fileapi/quota/quota_reservation.h" | 10 #include "storage/browser/fileapi/quota/quota_reservation.h" |
10 #include "storage/browser/fileapi/quota/quota_reservation_buffer.h" | 11 #include "storage/browser/fileapi/quota/quota_reservation_buffer.h" |
11 | 12 |
12 namespace storage { | 13 namespace storage { |
13 | 14 |
14 QuotaReservationManager::QuotaReservationManager( | 15 QuotaReservationManager::QuotaReservationManager( |
15 scoped_ptr<QuotaBackend> backend) | 16 scoped_ptr<QuotaBackend> backend) |
16 : backend_(backend.Pass()), | 17 : backend_(std::move(backend)), weak_ptr_factory_(this) { |
17 weak_ptr_factory_(this) { | |
18 sequence_checker_.DetachFromSequence(); | 18 sequence_checker_.DetachFromSequence(); |
19 } | 19 } |
20 | 20 |
21 QuotaReservationManager::~QuotaReservationManager() { | 21 QuotaReservationManager::~QuotaReservationManager() { |
22 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 22 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
23 } | 23 } |
24 | 24 |
25 void QuotaReservationManager::ReserveQuota( | 25 void QuotaReservationManager::ReserveQuota( |
26 const GURL& origin, | 26 const GURL& origin, |
27 FileSystemType type, | 27 FileSystemType type, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 scoped_refptr<QuotaReservation> QuotaReservationManager::CreateReservation( | 84 scoped_refptr<QuotaReservation> QuotaReservationManager::CreateReservation( |
85 const GURL& origin, | 85 const GURL& origin, |
86 FileSystemType type) { | 86 FileSystemType type) { |
87 DCHECK(origin.is_valid()); | 87 DCHECK(origin.is_valid()); |
88 return GetReservationBuffer(origin, type)->CreateReservation();; | 88 return GetReservationBuffer(origin, type)->CreateReservation();; |
89 } | 89 } |
90 | 90 |
91 } // namespace storage | 91 } // namespace storage |
OLD | NEW |