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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 // Notification called when partial information about document is available. | 32 // Notification called when partial information about document is available. |
33 // Only called for urls that returns full content size and supports byte | 33 // Only called for urls that returns full content size and supports byte |
34 // range requests. | 34 // range requests. |
35 virtual void OnPartialDocumentLoaded() = 0; | 35 virtual void OnPartialDocumentLoaded() = 0; |
36 // Notification called when all outstanding pending requests are complete. | 36 // Notification called when all outstanding pending requests are complete. |
37 virtual void OnPendingRequestComplete() = 0; | 37 virtual void OnPendingRequestComplete() = 0; |
38 // Notification called when new data is available. | 38 // Notification called when new data is available. |
39 virtual void OnNewDataAvailable() = 0; | 39 virtual void OnNewDataAvailable() = 0; |
40 // Notification called when document is fully loaded. | 40 // Notification called when document is fully loaded. |
41 virtual void OnDocumentComplete() = 0; | 41 virtual void OnDocumentComplete() = 0; |
| 42 // Notification called if the document unrecoverably fails to load. |
| 43 virtual void DocumentLoadFailed() = 0; |
42 }; | 44 }; |
43 | 45 |
44 explicit DocumentLoader(Client* client); | 46 explicit DocumentLoader(Client* client); |
45 ~DocumentLoader(); | 47 ~DocumentLoader(); |
46 | 48 |
47 bool Init(const pp::URLLoader& loader, | 49 bool Init(const pp::URLLoader& loader, |
48 const std::string& url, | 50 const std::string& url, |
49 const std::string& headers); | 51 const std::string& headers); |
50 | 52 |
51 // Data access interface. Return true is successful. | 53 // Data access interface. Return true is successful. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 bool header_request_; | 129 bool header_request_; |
128 bool is_multipart_; | 130 bool is_multipart_; |
129 std::string multipart_boundary_; | 131 std::string multipart_boundary_; |
130 uint32_t requests_count_; | 132 uint32_t requests_count_; |
131 std::vector<std::vector<unsigned char> > chunk_buffer_; | 133 std::vector<std::vector<unsigned char> > chunk_buffer_; |
132 }; | 134 }; |
133 | 135 |
134 } // namespace chrome_pdf | 136 } // namespace chrome_pdf |
135 | 137 |
136 #endif // PDF_DOCUMENT_LOADER_H_ | 138 #endif // PDF_DOCUMENT_LOADER_H_ |
OLD | NEW |