| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 base::Bind(&SimpleBackendImpl::IndexReadyForDoom, AsWeakPtr(), | 460 base::Bind(&SimpleBackendImpl::IndexReadyForDoom, AsWeakPtr(), |
| 461 initial_time, end_time, callback)); | 461 initial_time, end_time, callback)); |
| 462 } | 462 } |
| 463 | 463 |
| 464 int SimpleBackendImpl::DoomEntriesSince( | 464 int SimpleBackendImpl::DoomEntriesSince( |
| 465 const Time initial_time, | 465 const Time initial_time, |
| 466 const CompletionCallback& callback) { | 466 const CompletionCallback& callback) { |
| 467 return DoomEntriesBetween(initial_time, Time(), callback); | 467 return DoomEntriesBetween(initial_time, Time(), callback); |
| 468 } | 468 } |
| 469 | 469 |
| 470 class SimpleBackendImpl::SimpleIterator FINAL : public Iterator { | 470 class SimpleBackendImpl::SimpleIterator final : public Iterator { |
| 471 public: | 471 public: |
| 472 explicit SimpleIterator(base::WeakPtr<SimpleBackendImpl> backend) | 472 explicit SimpleIterator(base::WeakPtr<SimpleBackendImpl> backend) |
| 473 : backend_(backend), | 473 : backend_(backend), |
| 474 weak_factory_(this) { | 474 weak_factory_(this) { |
| 475 } | 475 } |
| 476 | 476 |
| 477 // From Backend::Iterator: | 477 // From Backend::Iterator: |
| 478 virtual int OpenNextEntry(Entry** next_entry, | 478 virtual int OpenNextEntry(Entry** next_entry, |
| 479 const CompletionCallback& callback) OVERRIDE { | 479 const CompletionCallback& callback) override { |
| 480 CompletionCallback open_next_entry_impl = | 480 CompletionCallback open_next_entry_impl = |
| 481 base::Bind(&SimpleIterator::OpenNextEntryImpl, | 481 base::Bind(&SimpleIterator::OpenNextEntryImpl, |
| 482 weak_factory_.GetWeakPtr(), next_entry, callback); | 482 weak_factory_.GetWeakPtr(), next_entry, callback); |
| 483 return backend_->index_->ExecuteWhenReady(open_next_entry_impl); | 483 return backend_->index_->ExecuteWhenReady(open_next_entry_impl); |
| 484 } | 484 } |
| 485 | 485 |
| 486 void OpenNextEntryImpl(Entry** next_entry, | 486 void OpenNextEntryImpl(Entry** next_entry, |
| 487 const CompletionCallback& callback, | 487 const CompletionCallback& callback, |
| 488 int index_initialization_error_code) { | 488 int index_initialization_error_code) { |
| 489 if (!backend_) { | 489 if (!backend_) { |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 this)); | 729 this)); |
| 730 callback.Run(result); | 730 callback.Run(result); |
| 731 } | 731 } |
| 732 | 732 |
| 733 void SimpleBackendImpl::FlushWorkerPoolForTesting() { | 733 void SimpleBackendImpl::FlushWorkerPoolForTesting() { |
| 734 if (g_sequenced_worker_pool) | 734 if (g_sequenced_worker_pool) |
| 735 g_sequenced_worker_pool->FlushForTesting(); | 735 g_sequenced_worker_pool->FlushForTesting(); |
| 736 } | 736 } |
| 737 | 737 |
| 738 } // namespace disk_cache | 738 } // namespace disk_cache |
| OLD | NEW |