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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 Client* const client_; | 102 Client* const client_; |
103 std::string url_; | 103 std::string url_; |
104 std::unique_ptr<URLLoaderWrapper> loader_; | 104 std::unique_ptr<URLLoaderWrapper> loader_; |
105 | 105 |
106 pp::CompletionCallbackFactory<DocumentLoader> loader_factory_; | 106 pp::CompletionCallbackFactory<DocumentLoader> loader_factory_; |
107 | 107 |
108 DataStream chunk_stream_; | 108 DataStream chunk_stream_; |
109 bool partial_loading_enabled_ = true; | 109 bool partial_loading_enabled_ = true; |
110 bool is_partial_loader_active_ = false; | 110 bool is_partial_loader_active_ = false; |
111 char buffer_[DataStream::kChunkSize]; | 111 |
| 112 static constexpr uint32_t kReadBufferSize = 256 * 1024; |
| 113 char buffer_[kReadBufferSize]; |
112 | 114 |
113 Chunk chunk_; | 115 Chunk chunk_; |
114 RangeSet pending_requests_; | 116 RangeSet pending_requests_; |
115 uint32_t count_of_bytes_received_ = 0; | 117 uint32_t count_of_bytes_received_ = 0; |
116 }; | 118 }; |
117 | 119 |
118 } // namespace chrome_pdf | 120 } // namespace chrome_pdf |
119 | 121 |
120 #endif // PDF_DOCUMENT_LOADER_H_ | 122 #endif // PDF_DOCUMENT_LOADER_H_ |
OLD | NEW |