Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1197)

Unified Diff: pdf/chunk_stream.h

Issue 1506023002: Minimize the number of range requests made by PDFium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issue with chunk_stream Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pdf/chunk_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/chunk_stream.h
diff --git a/pdf/chunk_stream.h b/pdf/chunk_stream.h
index fac1ec644de367c60a8a57c18eb7a15395292e96..048f9580025bc81fad44e2001188a81e13ad9afb 100644
--- a/pdf/chunk_stream.h
+++ b/pdf/chunk_stream.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <map>
+#include <utility>
#include <vector>
namespace chrome_pdf {
@@ -33,16 +34,20 @@ class ChunkStream {
bool IsRangeAvailable(size_t offset, size_t size) const;
size_t GetFirstMissingByte() const;
- size_t GetLastByteBefore(size_t offset) const;
- size_t GetFirstByteAfter(size_t offset) const;
+ // Finds the first byte of the missing byte interval that offset belongs to.
+ size_t GetFirstMissingByteInInterval(size_t offset) const;
+ // Returns the last byte of the missing byte interval that offset belongs to.
+ size_t GetLastMissingByteInInterval(size_t offset) const;
private:
std::vector<unsigned char> data_;
// Pair, first - begining of the chunk, second - size of the chunk.
std::map<size_t, size_t> chunks_;
+
+ size_t stream_size_;
};
}; // namespace chrome_pdf
-#endif
+#endif // PDF_CHUNK_STREAM_H_
« no previous file with comments | « no previous file | pdf/chunk_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698