ExceptionOr<void> FileReaderSync::startLoading(ScriptExecutionContext& scriptExecutionContext, FileReaderLoader& loader, Blob& blob) { loader.start(&scriptExecutionContext, blob); if (ExceptionCode code = FileException::ErrorCodeToExceptionCode(loader.errorCode())) return Exception { code }; return { }; }
ExceptionOr<String> FileReaderSync::startLoadingString(ScriptExecutionContext& scriptExecutionContext, FileReaderLoader& loader, Blob& blob) { auto result = startLoading(scriptExecutionContext, loader, blob); if (result.hasException()) return result.releaseException(); return loader.stringResult(); }
void FileReaderSync::startLoading(ScriptExecutionContext* scriptExecutionContext, FileReaderLoader& loader, Blob* blob, ExceptionCode& ec) { loader.start(scriptExecutionContext, blob); ec = FileException::ErrorCodeToExceptionCode(loader.errorCode()); }
void FileReaderSync::startLoading(ExecutionContext* executionContext, FileReaderLoader& loader, const Blob& blob, ExceptionState& exceptionState) { loader.start(executionContext, blob.blobDataHandle()); if (loader.errorCode()) FileError::throwDOMException(exceptionState, loader.errorCode()); }