Home | History | Annotate | Download | only in fileapi

Lines Matching refs:blob

54 const CString utf8BlobUUID(Blob* blob)
56 return blob->uuid().utf8();
59 const CString utf8FilePath(Blob* blob)
61 return blob->hasBackingFile() ? toFile(blob)->path().utf8() : "";
169 void FileReader::readAsArrayBuffer(Blob* blob, ExceptionState& exceptionState)
171 if (!blob) {
172 exceptionState.throwTypeError("The argument is not a Blob.");
176 WTF_LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
178 readInternal(blob, FileReaderLoader::ReadAsArrayBuffer, exceptionState);
181 void FileReader::readAsBinaryString(Blob* blob, ExceptionState& exceptionState)
183 if (!blob) {
184 exceptionState.throwTypeError("The argument is not a Blob.");
188 WTF_LOG(FileAPI, "FileReader: reading as binary: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
190 readInternal(blob, FileReaderLoader::ReadAsBinaryString, exceptionState);
193 void FileReader::readAsText(Blob* blob, const String& encoding, ExceptionState& exceptionState)
195 if (!blob) {
196 exceptionState.throwTypeError("The argument is not a Blob.");
200 WTF_LOG(FileAPI, "FileReader: reading as text: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
203 readInternal(blob, FileReaderLoader::ReadAsText, exceptionState);
206 void FileReader::readAsText(Blob* blob, ExceptionState& exceptionState)
208 readAsText(blob, String(), exceptionState);
211 void FileReader::readAsDataURL(Blob* blob, ExceptionState& exceptionState)
213 if (!blob) {
214 exceptionState.throwTypeError("The argument is not a Blob.");
218 WTF_LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
220 readInternal(blob, FileReaderLoader::ReadAsDataURL, exceptionState);
223 void FileReader::readInternal(Blob* blob, FileReaderLoader::ReadType type, ExceptionState& exceptionState)
231 if (blob->hasBeenClosed()) {
232 exceptionState.throwDOMException(InvalidStateError, String(blob->isFile() ? "File" : "Blob") + " has been closed.");
236 // "Snapshot" the Blob data rather than the Blob itself as ongoing
238 // the Blob being read.
239 m_blobDataHandle = blob->blobDataHandle();
240 m_blobType = blob->type();