diff options
author | Lei Zhang <thestig@chromium.org> | 2018-08-14 18:26:36 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-14 18:26:36 +0000 |
commit | 88798cff29934b58e0a8d81e94005472d612b964 (patch) | |
tree | 3b5a25faa2a627ac30de219b89c8152a9fff2f27 /testing/fx_string_testhelpers.cpp | |
parent | b9c3e2712f75363372622282023143b86b72f2df (diff) | |
download | pdfium-88798cff29934b58e0a8d81e94005472d612b964.tar.xz |
Remove CFX_BufferSeekableReadStream.
Replace it with CFX_ReadOnlyMemoryStream, which does the same thing.
Take some checks from CFX_BufferSeekableReadStream and add them
CFX_ReadOnlyMemoryStream.
Change-Id: I25554c3aec3ec96967f8df16ca68a64dba121b6f
Reviewed-on: https://pdfium-review.googlesource.com/40070
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'testing/fx_string_testhelpers.cpp')
-rw-r--r-- | testing/fx_string_testhelpers.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/testing/fx_string_testhelpers.cpp b/testing/fx_string_testhelpers.cpp index e3c443ac4e..96f2c64535 100644 --- a/testing/fx_string_testhelpers.cpp +++ b/testing/fx_string_testhelpers.cpp @@ -22,24 +22,3 @@ CFX_InvalidSeekableReadStream::CFX_InvalidSeekableReadStream( : data_size_(data_size) {} CFX_InvalidSeekableReadStream::~CFX_InvalidSeekableReadStream() = default; - -CFX_BufferSeekableReadStream::CFX_BufferSeekableReadStream( - pdfium::span<const uint8_t> data) - : data_(data) {} - -CFX_BufferSeekableReadStream::~CFX_BufferSeekableReadStream() = default; - -bool CFX_BufferSeekableReadStream::ReadBlock(void* buffer, - FX_FILESIZE offset, - size_t size) { - if (offset < 0 || static_cast<size_t>(offset) >= data_.size()) - return false; - - if (static_cast<size_t>(offset) + size > data_.size()) - size = data_.size() - static_cast<size_t>(offset); - if (size == 0) - return false; - - memcpy(buffer, &data_[offset], size); - return true; -} |