diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 00:29:09 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 00:29:09 +0000 |
commit | 92ac0b815ab28656139ecbbe3af11edaecfce61a (patch) | |
tree | 8275b85bca8cebff7f359b37fc06d995cf67ffe3 /net/disk_cache/cache_util_win.cc | |
parent | da6970fe3c1c5901070f02379123fa5f5d2a3c11 (diff) | |
download | chromium_src-92ac0b815ab28656139ecbbe3af11edaecfce61a.zip chromium_src-92ac0b815ab28656139ecbbe3af11edaecfce61a.tar.gz chromium_src-92ac0b815ab28656139ecbbe3af11edaecfce61a.tar.bz2 |
Revert cl 23919 to investigate valgrind failures.
TBR=willchan
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/174205
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/cache_util_win.cc')
-rw-r--r-- | net/disk_cache/cache_util_win.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/disk_cache/cache_util_win.cc b/net/disk_cache/cache_util_win.cc index 3a99836..a82231a 100644 --- a/net/disk_cache/cache_util_win.cc +++ b/net/disk_cache/cache_util_win.cc @@ -39,6 +39,9 @@ void DeleteFiles(const wchar_t* path, const wchar_t* search_name) { namespace disk_cache { +// Implemented in file_win.cc. +MessageLoopForIO::IOHandler* GetFileIOHandler(); + bool MoveCache(const std::wstring& from_path, const std::wstring& to_path) { // I don't want to use the shell version of move because if something goes // wrong, that version will attempt to move file by file and fail at the end. @@ -61,4 +64,12 @@ bool DeleteCacheFile(const std::wstring& name) { return DeleteFile(name.c_str()) ? true : false; } +void WaitForPendingIO(int* num_pending_io) { + while (*num_pending_io) { + // Asynchronous IO operations may be in flight and the completion may end + // up calling us back so let's wait for them. + MessageLoopForIO::current()->WaitForIOCompletion(100, GetFileIOHandler()); + } +} + } // namespace disk_cache |