OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "net/disk_cache/simple/simple_backend_impl.h" | 5 #include "net/disk_cache/simple/simple_backend_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 #include <functional> | 9 #include <functional> |
10 | 10 |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 base::Bind(&SimpleBackendImpl::IndexReadyForDoom, AsWeakPtr(), | 463 base::Bind(&SimpleBackendImpl::IndexReadyForDoom, AsWeakPtr(), |
464 initial_time, end_time, callback)); | 464 initial_time, end_time, callback)); |
465 } | 465 } |
466 | 466 |
467 int SimpleBackendImpl::DoomEntriesSince( | 467 int SimpleBackendImpl::DoomEntriesSince( |
468 const Time initial_time, | 468 const Time initial_time, |
469 const CompletionCallback& callback) { | 469 const CompletionCallback& callback) { |
470 return DoomEntriesBetween(initial_time, Time(), callback); | 470 return DoomEntriesBetween(initial_time, Time(), callback); |
471 } | 471 } |
472 | 472 |
| 473 int SimpleBackendImpl::CalculateSizeOfAllEntries( |
| 474 const CompletionCallback& callback) { |
| 475 // TODO(msramek): Implement. |
| 476 return net::ERR_NOT_IMPLEMENTED; |
| 477 } |
| 478 |
473 class SimpleBackendImpl::SimpleIterator final : public Iterator { | 479 class SimpleBackendImpl::SimpleIterator final : public Iterator { |
474 public: | 480 public: |
475 explicit SimpleIterator(base::WeakPtr<SimpleBackendImpl> backend) | 481 explicit SimpleIterator(base::WeakPtr<SimpleBackendImpl> backend) |
476 : backend_(backend), | 482 : backend_(backend), |
477 weak_factory_(this) { | 483 weak_factory_(this) { |
478 } | 484 } |
479 | 485 |
480 // From Backend::Iterator: | 486 // From Backend::Iterator: |
481 int OpenNextEntry(Entry** next_entry, | 487 int OpenNextEntry(Entry** next_entry, |
482 const CompletionCallback& callback) override { | 488 const CompletionCallback& callback) override { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 } | 739 } |
734 | 740 |
735 // static | 741 // static |
736 void SimpleBackendImpl::FlushWorkerPoolForTesting() { | 742 void SimpleBackendImpl::FlushWorkerPoolForTesting() { |
737 // We only need to do this if we there is an active task runner. | 743 // We only need to do this if we there is an active task runner. |
738 if (base::ThreadTaskRunnerHandle::IsSet()) | 744 if (base::ThreadTaskRunnerHandle::IsSet()) |
739 g_sequenced_worker_pool.Get().FlushForTesting(); | 745 g_sequenced_worker_pool.Get().FlushForTesting(); |
740 } | 746 } |
741 | 747 |
742 } // namespace disk_cache | 748 } // namespace disk_cache |
OLD | NEW |