OLD | NEW |
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_DOCUMENT_LOADER_H_ | 5 #ifndef PDF_DOCUMENT_LOADER_H_ |
6 #define PDF_DOCUMENT_LOADER_H_ | 6 #define PDF_DOCUMENT_LOADER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 29 matching lines...) Expand all Loading... |
40 virtual void OnDocumentComplete() = 0; | 40 virtual void OnDocumentComplete() = 0; |
41 }; | 41 }; |
42 | 42 |
43 explicit DocumentLoader(Client* client); | 43 explicit DocumentLoader(Client* client); |
44 ~DocumentLoader(); | 44 ~DocumentLoader(); |
45 | 45 |
46 bool Init(const pp::URLLoader& loader, | 46 bool Init(const pp::URLLoader& loader, |
47 const std::string& url, | 47 const std::string& url, |
48 const std::string& headers); | 48 const std::string& headers); |
49 | 49 |
50 // Data access interface. Return true is sucessful. | 50 // Data access interface. Return true is successful. |
51 bool GetBlock(uint32_t position, uint32_t size, void* buf) const; | 51 bool GetBlock(uint32_t position, uint32_t size, void* buf) const; |
52 | 52 |
53 // Data availability interface. Return true data avaialble. | 53 // Data availability interface. Return true data avaialble. |
54 bool IsDataAvailable(uint32_t position, uint32_t size) const; | 54 bool IsDataAvailable(uint32_t position, uint32_t size) const; |
55 | 55 |
56 // Data availability interface. Return true data avaialble. | 56 // Data availability interface. Return true data avaialble. |
57 void RequestData(uint32_t position, uint32_t size); | 57 void RequestData(uint32_t position, uint32_t size); |
58 | 58 |
59 bool IsDocumentComplete() const; | 59 bool IsDocumentComplete() const; |
60 uint32_t document_size() const { return document_size_; } | 60 uint32_t document_size() const { return document_size_; } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 bool header_request_; | 105 bool header_request_; |
106 bool is_multipart_; | 106 bool is_multipart_; |
107 std::string multipart_boundary_; | 107 std::string multipart_boundary_; |
108 uint32_t requests_count_; | 108 uint32_t requests_count_; |
109 std::list<std::vector<unsigned char> > chunk_buffer_; | 109 std::list<std::vector<unsigned char> > chunk_buffer_; |
110 }; | 110 }; |
111 | 111 |
112 } // namespace chrome_pdf | 112 } // namespace chrome_pdf |
113 | 113 |
114 #endif // PDF_DOCUMENT_LOADER_H_ | 114 #endif // PDF_DOCUMENT_LOADER_H_ |
OLD | NEW |