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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 int result) { | 728 int result) { |
729 std::for_each( | 729 std::for_each( |
730 entry_hashes->begin(), entry_hashes->end(), | 730 entry_hashes->begin(), entry_hashes->end(), |
731 std::bind1st(std::mem_fun(&SimpleBackendImpl::OnDoomComplete), | 731 std::bind1st(std::mem_fun(&SimpleBackendImpl::OnDoomComplete), |
732 this)); | 732 this)); |
733 callback.Run(result); | 733 callback.Run(result); |
734 } | 734 } |
735 | 735 |
736 // static | 736 // static |
737 void SimpleBackendImpl::FlushWorkerPoolForTesting() { | 737 void SimpleBackendImpl::FlushWorkerPoolForTesting() { |
738 g_sequenced_worker_pool.Get().FlushForTesting(); | 738 // We only need to do this if we there is an active task runner. |
| 739 if (base::ThreadTaskRunnerHandle::IsSet()) |
| 740 g_sequenced_worker_pool.Get().FlushForTesting(); |
739 } | 741 } |
740 | 742 |
741 } // namespace disk_cache | 743 } // namespace disk_cache |
OLD | NEW |