| 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" |
| 37 #include "platform/weborigin/KURL.h" | 38 #include "platform/weborigin/KURL.h" |
| 38 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
| 39 #include "wtf/PtrUtil.h" | 40 #include "wtf/PtrUtil.h" |
| 40 #include "wtf/text/TextEncoding.h" | 41 #include "wtf/text/TextEncoding.h" |
| 41 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
| 42 #include "wtf/typed_arrays/ArrayBufferBuilder.h" | 43 #include "wtf/typed_arrays/ArrayBufferBuilder.h" |
| 43 #include <memory> | 44 #include <memory> |
| 44 | 45 |
| 45 namespace blink { | 46 namespace blink { |
| 46 | 47 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 117 |
| 117 static FileError::ErrorCode httpStatusCodeToErrorCode(int); | 118 static FileError::ErrorCode httpStatusCodeToErrorCode(int); |
| 118 | 119 |
| 119 ReadType m_readType; | 120 ReadType m_readType; |
| 120 FileReaderLoaderClient* m_client; | 121 FileReaderLoaderClient* m_client; |
| 121 WTF::TextEncoding m_encoding; | 122 WTF::TextEncoding m_encoding; |
| 122 String m_dataType; | 123 String m_dataType; |
| 123 | 124 |
| 124 KURL m_urlForReading; | 125 KURL m_urlForReading; |
| 125 bool m_urlForReadingIsStream; | 126 bool m_urlForReadingIsStream; |
| 126 std::unique_ptr<ThreadableLoader> m_loader; | 127 Persistent<ThreadableLoader> m_loader; |
| 127 | 128 |
| 128 std::unique_ptr<ArrayBufferBuilder> m_rawData; | 129 std::unique_ptr<ArrayBufferBuilder> m_rawData; |
| 129 bool m_isRawDataConverted; | 130 bool m_isRawDataConverted; |
| 130 | 131 |
| 131 String m_stringResult; | 132 String m_stringResult; |
| 132 | 133 |
| 133 // The decoder used to decode the text data. | 134 // The decoder used to decode the text data. |
| 134 std::unique_ptr<TextResourceDecoder> m_decoder; | 135 std::unique_ptr<TextResourceDecoder> m_decoder; |
| 135 | 136 |
| 136 bool m_finishedLoading; | 137 bool m_finishedLoading; |
| 137 long long m_bytesLoaded; | 138 long long m_bytesLoaded; |
| 138 // If the total size of the resource is unknown, m_totalBytes is set to -1 | 139 // If the total size of the resource is unknown, m_totalBytes is set to -1 |
| 139 // until completion of loading, and the buffer for receiving data is set to | 140 // until completion of loading, and the buffer for receiving data is set to |
| 140 // dynamically grow. Otherwise, m_totalBytes is set to the total size and | 141 // dynamically grow. Otherwise, m_totalBytes is set to the total size and |
| 141 // the buffer for receiving data of m_totalBytes is allocated and never grow | 142 // the buffer for receiving data of m_totalBytes is allocated and never grow |
| 142 // even when extra data is appeneded. | 143 // even when extra data is appeneded. |
| 143 long long m_totalBytes; | 144 long long m_totalBytes; |
| 144 | 145 |
| 145 bool m_hasRange; | 146 bool m_hasRange; |
| 146 unsigned m_rangeStart; | 147 unsigned m_rangeStart; |
| 147 unsigned m_rangeEnd; | 148 unsigned m_rangeEnd; |
| 148 | 149 |
| 149 FileError::ErrorCode m_errorCode; | 150 FileError::ErrorCode m_errorCode; |
| 150 }; | 151 }; |
| 151 | 152 |
| 152 } // namespace blink | 153 } // namespace blink |
| 153 | 154 |
| 154 #endif // FileReaderLoader_h | 155 #endif // FileReaderLoader_h |
| OLD | NEW |