Changeset 262999 in webkit for trunk/Source/WebCore/fileapi/FileReaderSync.cpp
- Timestamp:
- Jun 13, 2020, 9:24:15 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/fileapi/FileReaderSync.cpp
r262953 r262999 35 35 #include "Blob.h" 36 36 #include "BlobURL.h" 37 #include "FileError.h"38 37 #include "FileReaderLoader.h" 39 38 #include <JavaScriptCore/ArrayBuffer.h> … … 74 73 } 75 74 76 ExceptionOr<void> FileReaderSync::errorCodeToException(FileError::ErrorCode errorCode)77 {78 switch (errorCode) {79 case FileError::OK:80 return { };81 case FileError::NOT_FOUND_ERR:82 return Exception { NotFoundError };83 case FileError::SECURITY_ERR:84 return Exception { SecurityError };85 case FileError::ABORT_ERR:86 return Exception { AbortError };87 case FileError::NOT_READABLE_ERR:88 return Exception { NotReadableError };89 case FileError::ENCODING_ERR:90 return Exception { EncodingError };91 case FileError::NO_MODIFICATION_ALLOWED_ERR:92 return Exception { NoModificationAllowedError };93 case FileError::INVALID_STATE_ERR:94 return Exception { InvalidStateError };95 case FileError::SYNTAX_ERR:96 return Exception { SyntaxError };97 case FileError::INVALID_MODIFICATION_ERR:98 return Exception { InvalidModificationError };99 case FileError::QUOTA_EXCEEDED_ERR:100 return Exception { QuotaExceededError };101 case FileError::TYPE_MISMATCH_ERR:102 return Exception { TypeMismatchError };103 case FileError::PATH_EXISTS_ERR:104 return Exception { NoModificationAllowedError };105 }106 return Exception { UnknownError };107 }108 109 75 ExceptionOr<void> FileReaderSync::startLoading(ScriptExecutionContext& scriptExecutionContext, FileReaderLoader& loader, Blob& blob) 110 76 { 111 77 loader.start(&scriptExecutionContext, blob); 112 return errorCodeToException(loader.errorCode()); 78 auto error = loader.errorCode(); 79 if (!error) 80 return { }; 81 82 return Exception { error.value() }; 113 83 } 114 84
Note:
See TracChangeset
for help on using the changeset viewer.