| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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)); | 65 memset(this, 0, sizeof(*this)); |
| 66 context_.handler = g_completion_handler.Pointer(); | |
| 67 context_.overlapped.Offset = static_cast<DWORD>(offset); | 66 context_.overlapped.Offset = static_cast<DWORD>(offset); |
| 68 file_ = file; | 67 file_ = file; |
| 69 callback_ = callback; | 68 callback_ = callback; |
| 70 } | 69 } |
| 71 | 70 |
| 72 } // namespace | 71 } // namespace |
| 73 | 72 |
| 74 namespace disk_cache { | 73 namespace disk_cache { |
| 75 | 74 |
| 76 File::File(base::File file) | 75 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(); | 248 base::MessageLoopForIO::IOHandler* handler = g_completion_handler.Pointer(); |
| 250 base::MessageLoopForIO::current()->WaitForIOCompletion(100, handler); | 249 base::MessageLoopForIO::current()->WaitForIOCompletion(100, handler); |
| 251 } | 250 } |
| 252 } | 251 } |
| 253 | 252 |
| 254 // Static. | 253 // Static. |
| 255 void File::DropPendingIO() { | 254 void File::DropPendingIO() { |
| 256 } | 255 } |
| 257 | 256 |
| 258 } // namespace disk_cache | 257 } // namespace disk_cache |
| OLD | NEW |