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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 if (!blob) | 138 if (!blob) |
139 return; | 139 return; |
140 | 140 |
141 LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", utf8BlobURL(blob).d
ata(), utf8FilePath(blob).data()); | 141 LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", utf8BlobURL(blob).d
ata(), utf8FilePath(blob).data()); |
142 | 142 |
143 readInternal(blob, FileReaderLoader::ReadAsDataURL, ec); | 143 readInternal(blob, FileReaderLoader::ReadAsDataURL, ec); |
144 } | 144 } |
145 | 145 |
146 void FileReader::readInternal(Blob* blob, FileReaderLoader::ReadType type, Excep
tionCode& ec) | 146 void FileReader::readInternal(Blob* blob, FileReaderLoader::ReadType type, Excep
tionCode& ec) |
147 { | 147 { |
148 // If multiple concurrent read methods are called on the same FileReader, IN
VALID_STATE_ERR should be thrown when the state is LOADING. | 148 // If multiple concurrent read methods are called on the same FileReader, In
validStateError should be thrown when the state is LOADING. |
149 if (m_state == LOADING) { | 149 if (m_state == LOADING) { |
150 ec = INVALID_STATE_ERR; | 150 ec = InvalidStateError; |
151 return; | 151 return; |
152 } | 152 } |
153 | 153 |
154 setPendingActivity(this); | 154 setPendingActivity(this); |
155 | 155 |
156 m_blob = blob; | 156 m_blob = blob; |
157 m_readType = type; | 157 m_readType = type; |
158 m_state = LOADING; | 158 m_state = LOADING; |
159 m_error = 0; | 159 m_error = 0; |
160 | 160 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 271 } |
272 | 272 |
273 String FileReader::stringResult() | 273 String FileReader::stringResult() |
274 { | 274 { |
275 if (!m_loader || m_error) | 275 if (!m_loader || m_error) |
276 return String(); | 276 return String(); |
277 return m_loader->stringResult(); | 277 return m_loader->stringResult(); |
278 } | 278 } |
279 | 279 |
280 } // namespace WebCore | 280 } // namespace WebCore |
OLD | NEW |