OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/disk_cache/blockfile/backend_impl.h" | 5 #include "net/disk_cache/blockfile/backend_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 : background_queue_(background_queue), | 1253 : background_queue_(background_queue), |
1254 iterator_(new Rankings::Iterator()) { | 1254 iterator_(new Rankings::Iterator()) { |
1255 } | 1255 } |
1256 | 1256 |
1257 virtual ~IteratorImpl() { | 1257 virtual ~IteratorImpl() { |
1258 if (background_queue_) | 1258 if (background_queue_) |
1259 background_queue_->EndEnumeration(iterator_.Pass()); | 1259 background_queue_->EndEnumeration(iterator_.Pass()); |
1260 } | 1260 } |
1261 | 1261 |
1262 virtual int OpenNextEntry(Entry** next_entry, | 1262 virtual int OpenNextEntry(Entry** next_entry, |
1263 const net::CompletionCallback& callback) OVERRIDE { | 1263 const net::CompletionCallback& callback) override { |
1264 if (!background_queue_) | 1264 if (!background_queue_) |
1265 return net::ERR_FAILED; | 1265 return net::ERR_FAILED; |
1266 background_queue_->OpenNextEntry(iterator_.get(), next_entry, callback); | 1266 background_queue_->OpenNextEntry(iterator_.get(), next_entry, callback); |
1267 return net::ERR_IO_PENDING; | 1267 return net::ERR_IO_PENDING; |
1268 } | 1268 } |
1269 | 1269 |
1270 private: | 1270 private: |
1271 const base::WeakPtr<InFlightBackendIO> background_queue_; | 1271 const base::WeakPtr<InFlightBackendIO> background_queue_; |
1272 scoped_ptr<Rankings::Iterator> iterator_; | 1272 scoped_ptr<Rankings::Iterator> iterator_; |
1273 }; | 1273 }; |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2080 if (total_memory > kMaxBuffersSize || total_memory <= 0) | 2080 if (total_memory > kMaxBuffersSize || total_memory <= 0) |
2081 total_memory = kMaxBuffersSize; | 2081 total_memory = kMaxBuffersSize; |
2082 | 2082 |
2083 done = true; | 2083 done = true; |
2084 } | 2084 } |
2085 | 2085 |
2086 return static_cast<int>(total_memory); | 2086 return static_cast<int>(total_memory); |
2087 } | 2087 } |
2088 | 2088 |
2089 } // namespace disk_cache | 2089 } // namespace disk_cache |
OLD | NEW |