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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 FileError::ErrorCode GetErrorCode() const { return error_code_; } | 106 FileError::ErrorCode GetErrorCode() const { return error_code_; } |
107 | 107 |
108 void SetEncoding(const String&); | 108 void SetEncoding(const String&); |
109 void SetDataType(const String& data_type) { data_type_ = data_type; } | 109 void SetDataType(const String& data_type) { data_type_ = data_type; } |
110 | 110 |
111 private: | 111 private: |
112 FileReaderLoader(ReadType, FileReaderLoaderClient*); | 112 FileReaderLoader(ReadType, FileReaderLoaderClient*); |
113 | 113 |
114 void Cleanup(); | 114 void Cleanup(); |
| 115 void ReportAdditionalMemoryUsageToV8(int64_t usage); |
| 116 void UnreportMemoryUsageToV8(); |
115 | 117 |
116 void Failed(FileError::ErrorCode); | 118 void Failed(FileError::ErrorCode); |
117 void ConvertToText(); | 119 void ConvertToText(); |
118 void ConvertToDataURL(); | 120 void ConvertToDataURL(); |
119 | 121 |
120 static FileError::ErrorCode HttpStatusCodeToErrorCode(int); | 122 static FileError::ErrorCode HttpStatusCodeToErrorCode(int); |
121 | 123 |
122 ReadType read_type_; | 124 ReadType read_type_; |
123 FileReaderLoaderClient* client_; | 125 FileReaderLoaderClient* client_; |
124 WTF::TextEncoding encoding_; | 126 WTF::TextEncoding encoding_; |
(...skipping 18 matching lines...) Expand all Loading... |
143 // dynamically grow. Otherwise, m_totalBytes is set to the total size and | 145 // dynamically grow. Otherwise, m_totalBytes is set to the total size and |
144 // the buffer for receiving data of m_totalBytes is allocated and never grow | 146 // the buffer for receiving data of m_totalBytes is allocated and never grow |
145 // even when extra data is appeneded. | 147 // even when extra data is appeneded. |
146 long long total_bytes_; | 148 long long total_bytes_; |
147 | 149 |
148 bool has_range_; | 150 bool has_range_; |
149 unsigned range_start_; | 151 unsigned range_start_; |
150 unsigned range_end_; | 152 unsigned range_end_; |
151 | 153 |
152 FileError::ErrorCode error_code_; | 154 FileError::ErrorCode error_code_; |
| 155 |
| 156 int64_t memory_usage_reported_to_v8_ = 0; |
153 }; | 157 }; |
154 | 158 |
155 } // namespace blink | 159 } // namespace blink |
156 | 160 |
157 #endif // FileReaderLoader_h | 161 #endif // FileReaderLoader_h |
OLD | NEW |