diff options
Diffstat (limited to 'chromium/pdf/chunk_stream.h')
-rw-r--r-- | chromium/pdf/chunk_stream.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chromium/pdf/chunk_stream.h b/chromium/pdf/chunk_stream.h index 7eb75cf61b8..7fc092e1ed5 100644 --- a/chromium/pdf/chunk_stream.h +++ b/chromium/pdf/chunk_stream.h @@ -81,6 +81,10 @@ class ChunkStream { return filled_chunks_.Contains(chunks_range); } + bool IsChunkAvailable(uint32_t chunk_index) const { + return filled_chunks_.Contains(chunk_index); + } + void set_eof_pos(uint32_t eof_pos) { eof_pos_ = eof_pos; } uint32_t eof_pos() const { return eof_pos_; } @@ -90,6 +94,10 @@ class ChunkStream { return eof_pos_ > 0 && IsRangeAvailable(gfx::Range(0, eof_pos_)); } + bool IsValidChunkIndex(uint32_t chunk_index) const { + return !eof_pos_ || (chunk_index <= GetChunkIndex(eof_pos_ - 1)); + } + void Clear() { data_.clear(); eof_pos_ = 0; |