| 1627 | } |
| 1628 | |
| 1629 | Status TmpFileGroup::Write(MemRange buffer, WriteDoneCallback cb, |
| 1630 | unique_ptr<TmpWriteHandle>* handle, const BufferPoolClientCounters* counters) { |
| 1631 | DCHECK_GE(buffer.len(), 0); |
| 1632 | |
| 1633 | unique_ptr<TmpWriteHandle> tmp_handle(new TmpWriteHandle(this, move(cb))); |
| 1634 | TmpWriteHandle* tmp_handle_ptr = tmp_handle.get(); // Pass ptr by value into lambda. |
| 1635 | WriteRange::WriteDoneCallback callback = [this, tmp_handle_ptr]( |
| 1636 | const Status& write_status) { |
| 1637 | WriteComplete(tmp_handle_ptr, write_status); |
| 1638 | }; |
| 1639 | RETURN_IF_ERROR(tmp_handle->Write(io_ctx_.get(), buffer, callback, counters)); |
| 1640 | *handle = move(tmp_handle); |
| 1641 | return Status::OK(); |
| 1642 | } |
| 1643 | |
| 1644 | Status TmpFileGroup::Read(TmpWriteHandle* handle, MemRange buffer) { |
| 1645 | RETURN_IF_ERROR(ReadAsync(handle, buffer)); |
nothing calls this directly
no test coverage detected