예제 #1
0
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 { };
}
예제 #2
0
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();
}
예제 #3
0
void FileReaderSync::startLoading(ScriptExecutionContext* scriptExecutionContext, FileReaderLoader& loader, Blob* blob, ExceptionCode& ec)
{
    loader.start(scriptExecutionContext, blob);
    ec = FileException::ErrorCodeToExceptionCode(loader.errorCode());
}
예제 #4
0
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());
}