OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/backend_impl.h" | 5 #include "net/disk_cache/backend_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 background_queue_.DoomEntry(key, callback); | 1408 background_queue_.DoomEntry(key, callback); |
1409 return net::ERR_IO_PENDING; | 1409 return net::ERR_IO_PENDING; |
1410 } | 1410 } |
1411 | 1411 |
1412 int BackendImpl::DoomAllEntries(OldCompletionCallback* callback) { | 1412 int BackendImpl::DoomAllEntries(OldCompletionCallback* callback) { |
1413 DCHECK(callback); | 1413 DCHECK(callback); |
1414 background_queue_.DoomAllEntries(callback); | 1414 background_queue_.DoomAllEntries(callback); |
1415 return net::ERR_IO_PENDING; | 1415 return net::ERR_IO_PENDING; |
1416 } | 1416 } |
1417 | 1417 |
| 1418 int BackendImpl::DoomAllEntries(const net::CompletionCallback& callback) { |
| 1419 DCHECK(!callback.is_null()); |
| 1420 background_queue_.DoomAllEntries(callback); |
| 1421 return net::ERR_IO_PENDING; |
| 1422 } |
| 1423 |
1418 int BackendImpl::DoomEntriesBetween(const base::Time initial_time, | 1424 int BackendImpl::DoomEntriesBetween(const base::Time initial_time, |
1419 const base::Time end_time, | 1425 const base::Time end_time, |
1420 OldCompletionCallback* callback) { | 1426 OldCompletionCallback* callback) { |
1421 DCHECK(callback); | 1427 DCHECK(callback); |
1422 background_queue_.DoomEntriesBetween(initial_time, end_time, callback); | 1428 background_queue_.DoomEntriesBetween(initial_time, end_time, callback); |
1423 return net::ERR_IO_PENDING; | 1429 return net::ERR_IO_PENDING; |
1424 } | 1430 } |
1425 | 1431 |
| 1432 int BackendImpl::DoomEntriesBetween(const base::Time initial_time, |
| 1433 const base::Time end_time, |
| 1434 const net::CompletionCallback& callback) { |
| 1435 DCHECK(!callback.is_null()); |
| 1436 background_queue_.DoomEntriesBetween(initial_time, end_time, callback); |
| 1437 return net::ERR_IO_PENDING; |
| 1438 } |
| 1439 |
1426 int BackendImpl::DoomEntriesSince(const base::Time initial_time, | 1440 int BackendImpl::DoomEntriesSince(const base::Time initial_time, |
1427 OldCompletionCallback* callback) { | 1441 OldCompletionCallback* callback) { |
1428 DCHECK(callback); | 1442 DCHECK(callback); |
1429 background_queue_.DoomEntriesSince(initial_time, callback); | 1443 background_queue_.DoomEntriesSince(initial_time, callback); |
1430 return net::ERR_IO_PENDING; | 1444 return net::ERR_IO_PENDING; |
1431 } | 1445 } |
1432 | 1446 |
1433 int BackendImpl::OpenNextEntry(void** iter, Entry** next_entry, | 1447 int BackendImpl::OpenNextEntry(void** iter, Entry** next_entry, |
1434 OldCompletionCallback* callback) { | 1448 OldCompletionCallback* callback) { |
1435 DCHECK(callback); | 1449 DCHECK(callback); |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2248 if (total_memory > kMaxBuffersSize || total_memory <= 0) | 2262 if (total_memory > kMaxBuffersSize || total_memory <= 0) |
2249 total_memory = kMaxBuffersSize; | 2263 total_memory = kMaxBuffersSize; |
2250 | 2264 |
2251 done = true; | 2265 done = true; |
2252 } | 2266 } |
2253 | 2267 |
2254 return static_cast<int>(total_memory); | 2268 return static_cast<int>(total_memory); |
2255 } | 2269 } |
2256 | 2270 |
2257 } // namespace disk_cache | 2271 } // namespace disk_cache |
OLD | NEW |