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

Unified Diff: net/disk_cache/file_posix.cc

Issue 2819032: Revert 51312 - Disk cache: Switch the disk cache to use the cache_thread.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/eviction.cc ('k') | net/disk_cache/in_flight_backend_io.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/file_posix.cc
===================================================================
--- net/disk_cache/file_posix.cc (revision 51324)
+++ net/disk_cache/file_posix.cc (working copy)
@@ -193,9 +193,6 @@
io_list_.insert(operation.get());
file->AddRef(); // Balanced on InvokeCallback()
- if (!callback_thread_)
- callback_thread_ = MessageLoop::current();
-
WorkerPool::PostTask(FROM_HERE,
NewRunnableMethod(operation.get(), &BackgroundIO::Read),
true);
@@ -210,9 +207,6 @@
io_list_.insert(operation.get());
file->AddRef(); // Balanced on InvokeCallback()
- if (!callback_thread_)
- callback_thread_ = MessageLoop::current();
-
WorkerPool::PostTask(FROM_HERE,
NewRunnableMethod(operation.get(), &BackgroundIO::Write,
delete_buffer),
@@ -225,8 +219,6 @@
IOList::iterator it = io_list_.begin();
InvokeCallback(*it, true);
}
- // Unit tests can use different threads.
- callback_thread_ = NULL;
}
// Runs on a worker thread.
@@ -380,9 +372,8 @@
// Static.
void File::WaitForPendingIO(int* num_pending_io) {
- // We may be running unit tests so we should allow InFlightIO to reset the
- // message loop.
- Singleton<InFlightIO>::get()->WaitForPendingIO();
+ if (*num_pending_io)
+ Singleton<InFlightIO>::get()->WaitForPendingIO();
}
} // namespace disk_cache
Property changes on: net\disk_cache\file_posix.cc
___________________________________________________________________
Added: svn:mergeinfo
« no previous file with comments | « net/disk_cache/eviction.cc ('k') | net/disk_cache/in_flight_backend_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698