Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: net/disk_cache/simple/simple_backend_impl.cc

Issue 1086733002: Ensure tests have an active task runner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/test/test_renderer_host.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/public/test/test_renderer_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698