| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/blockfile/file.h" | 5 #include "net/disk_cache/blockfile/file.h" | 
| 6 | 6 | 
| 7 #include <limits.h> | 7 #include <limits.h> | 
| 8 #include <utility> | 8 #include <utility> | 
| 9 | 9 | 
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" | 
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 55   } | 55   } | 
| 56 | 56 | 
| 57   if (data->callback_) | 57   if (data->callback_) | 
| 58     data->callback_->OnFileIOComplete(static_cast<int>(actual_bytes)); | 58     data->callback_->OnFileIOComplete(static_cast<int>(actual_bytes)); | 
| 59 | 59 | 
| 60   delete data; | 60   delete data; | 
| 61 } | 61 } | 
| 62 | 62 | 
| 63 MyOverlapped::MyOverlapped(disk_cache::File* file, size_t offset, | 63 MyOverlapped::MyOverlapped(disk_cache::File* file, size_t offset, | 
| 64                            disk_cache::FileIOCallback* callback) { | 64                            disk_cache::FileIOCallback* callback) { | 
| 65   memset(this, 0, sizeof(*this)); |  | 
| 66   context_.handler = g_completion_handler.Pointer(); |  | 
| 67   context_.overlapped.Offset = static_cast<DWORD>(offset); | 65   context_.overlapped.Offset = static_cast<DWORD>(offset); | 
| 68   file_ = file; | 66   file_ = file; | 
| 69   callback_ = callback; | 67   callback_ = callback; | 
| 70 } | 68 } | 
| 71 | 69 | 
| 72 }  // namespace | 70 }  // namespace | 
| 73 | 71 | 
| 74 namespace disk_cache { | 72 namespace disk_cache { | 
| 75 | 73 | 
| 76 File::File(base::File file) | 74 File::File(base::File file) | 
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 249     base::MessageLoopForIO::IOHandler* handler = g_completion_handler.Pointer(); | 247     base::MessageLoopForIO::IOHandler* handler = g_completion_handler.Pointer(); | 
| 250     base::MessageLoopForIO::current()->WaitForIOCompletion(100, handler); | 248     base::MessageLoopForIO::current()->WaitForIOCompletion(100, handler); | 
| 251   } | 249   } | 
| 252 } | 250 } | 
| 253 | 251 | 
| 254 // Static. | 252 // Static. | 
| 255 void File::DropPendingIO() { | 253 void File::DropPendingIO() { | 
| 256 } | 254 } | 
| 257 | 255 | 
| 258 }  // namespace disk_cache | 256 }  // namespace disk_cache | 
| OLD | NEW | 
|---|