Index: net/disk_cache/simple/simple_backend_impl.cc |
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc |
index 38086441ebda528f93034956d4e85eb94945cbd3..b5a6c9ef36221bc20dc8faf9e4af7c0be6ca172a 100644 |
--- a/net/disk_cache/simple/simple_backend_impl.cc |
+++ b/net/disk_cache/simple/simple_backend_impl.cc |
@@ -735,7 +735,9 @@ void SimpleBackendImpl::DoomEntriesComplete( |
// static |
void SimpleBackendImpl::FlushWorkerPoolForTesting() { |
- g_sequenced_worker_pool.Get().FlushForTesting(); |
+ // We only need to do this if we there is an active task runner. |
+ if (base::ThreadTaskRunnerHandle::IsSet()) |
+ g_sequenced_worker_pool.Get().FlushForTesting(); |
} |
} // namespace disk_cache |