OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef FileReaderLoader_h | 31 #ifndef FileReaderLoader_h |
32 #define FileReaderLoader_h | 32 #define FileReaderLoader_h |
33 | 33 |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "core/fileapi/FileError.h" | 35 #include "core/fileapi/FileError.h" |
36 #include "core/loader/ThreadableLoaderClient.h" | 36 #include "core/loader/ThreadableLoaderClient.h" |
37 #include "platform/heap/Handle.h" | |
38 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
39 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
40 #include "wtf/PtrUtil.h" | 39 #include "wtf/PtrUtil.h" |
41 #include "wtf/text/TextEncoding.h" | 40 #include "wtf/text/TextEncoding.h" |
42 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
43 #include "wtf/typed_arrays/ArrayBufferBuilder.h" | 42 #include "wtf/typed_arrays/ArrayBufferBuilder.h" |
44 #include <memory> | 43 #include <memory> |
45 | 44 |
46 namespace blink { | 45 namespace blink { |
47 | 46 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 116 |
118 static FileError::ErrorCode httpStatusCodeToErrorCode(int); | 117 static FileError::ErrorCode httpStatusCodeToErrorCode(int); |
119 | 118 |
120 ReadType m_readType; | 119 ReadType m_readType; |
121 FileReaderLoaderClient* m_client; | 120 FileReaderLoaderClient* m_client; |
122 WTF::TextEncoding m_encoding; | 121 WTF::TextEncoding m_encoding; |
123 String m_dataType; | 122 String m_dataType; |
124 | 123 |
125 KURL m_urlForReading; | 124 KURL m_urlForReading; |
126 bool m_urlForReadingIsStream; | 125 bool m_urlForReadingIsStream; |
127 Persistent<ThreadableLoader> m_loader; | 126 std::unique_ptr<ThreadableLoader> m_loader; |
128 | 127 |
129 std::unique_ptr<ArrayBufferBuilder> m_rawData; | 128 std::unique_ptr<ArrayBufferBuilder> m_rawData; |
130 bool m_isRawDataConverted; | 129 bool m_isRawDataConverted; |
131 | 130 |
132 String m_stringResult; | 131 String m_stringResult; |
133 | 132 |
134 // The decoder used to decode the text data. | 133 // The decoder used to decode the text data. |
135 std::unique_ptr<TextResourceDecoder> m_decoder; | 134 std::unique_ptr<TextResourceDecoder> m_decoder; |
136 | 135 |
137 bool m_finishedLoading; | 136 bool m_finishedLoading; |
138 long long m_bytesLoaded; | 137 long long m_bytesLoaded; |
139 // If the total size of the resource is unknown, m_totalBytes is set to -1 | 138 // If the total size of the resource is unknown, m_totalBytes is set to -1 |
140 // until completion of loading, and the buffer for receiving data is set to | 139 // until completion of loading, and the buffer for receiving data is set to |
141 // dynamically grow. Otherwise, m_totalBytes is set to the total size and | 140 // dynamically grow. Otherwise, m_totalBytes is set to the total size and |
142 // the buffer for receiving data of m_totalBytes is allocated and never grow | 141 // the buffer for receiving data of m_totalBytes is allocated and never grow |
143 // even when extra data is appeneded. | 142 // even when extra data is appeneded. |
144 long long m_totalBytes; | 143 long long m_totalBytes; |
145 | 144 |
146 bool m_hasRange; | 145 bool m_hasRange; |
147 unsigned m_rangeStart; | 146 unsigned m_rangeStart; |
148 unsigned m_rangeEnd; | 147 unsigned m_rangeEnd; |
149 | 148 |
150 FileError::ErrorCode m_errorCode; | 149 FileError::ErrorCode m_errorCode; |
151 }; | 150 }; |
152 | 151 |
153 } // namespace blink | 152 } // namespace blink |
154 | 153 |
155 #endif // FileReaderLoader_h | 154 #endif // FileReaderLoader_h |
OLD | NEW |