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

Side by Side Diff: pdf/chunk_stream.h

Issue 317803005: Add function to document_loader to get PDF as pp::FileRef (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « .gitignore ('k') | pdf/document_loader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef PDF_CHUNK_STREAM_H_ 5 #ifndef PDF_CHUNK_STREAM_H_
6 #define PDF_CHUNK_STREAM_H_ 6 #define PDF_CHUNK_STREAM_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 18 matching lines...) Expand all
29 29
30 // Returns vector of pairs where first is an offset, second is a size. 30 // Returns vector of pairs where first is an offset, second is a size.
31 bool GetMissedRanges(size_t offset, size_t size, 31 bool GetMissedRanges(size_t offset, size_t size,
32 std::vector<std::pair<size_t, size_t> >* ranges) const; 32 std::vector<std::pair<size_t, size_t> >* ranges) const;
33 bool IsRangeAvailable(size_t offset, size_t size) const; 33 bool IsRangeAvailable(size_t offset, size_t size) const;
34 size_t GetFirstMissingByte() const; 34 size_t GetFirstMissingByte() const;
35 35
36 size_t GetLastByteBefore(size_t offset) const; 36 size_t GetLastByteBefore(size_t offset) const;
37 size_t GetFirstByteAfter(size_t offset) const; 37 size_t GetFirstByteAfter(size_t offset) const;
38 38
39 const std::vector<unsigned char>& data() const { return data_; }
40
39 private: 41 private:
40 std::vector<unsigned char> data_; 42 std::vector<unsigned char> data_;
41 43
42 // Pair, first - begining of the chunk, second - size of the chunk. 44 // Pair, first - begining of the chunk, second - size of the chunk.
43 std::map<size_t, size_t> chunks_; 45 std::map<size_t, size_t> chunks_;
44 }; 46 };
45 47
46 }; // namespace chrome_pdf 48 }; // namespace chrome_pdf
47 49
48 #endif 50 #endif
OLDNEW
« no previous file with comments | « .gitignore ('k') | pdf/document_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698