| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef FileError_h | 31 #ifndef FileError_h |
| 32 #define FileError_h | 32 #define FileError_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ScriptWrappable.h" | |
| 35 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 36 #include "core/dom/DOMError.h" | |
| 37 #include "platform/heap/Handle.h" | |
| 38 | 35 |
| 39 namespace blink { | 36 namespace blink { |
| 40 | 37 |
| 38 class DOMException; |
| 41 class ExceptionState; | 39 class ExceptionState; |
| 42 | 40 |
| 43 class CORE_EXPORT FileError final : public DOMError { | 41 namespace FileError { |
| 44 DEFINE_WRAPPERTYPEINFO(); | 42 |
| 45 public: | |
| 46 enum ErrorCode { | 43 enum ErrorCode { |
| 47 OK = 0, | 44 OK = 0, |
| 48 NOT_FOUND_ERR = 1, | 45 NOT_FOUND_ERR = 1, |
| 49 SECURITY_ERR = 2, | 46 SECURITY_ERR = 2, |
| 50 ABORT_ERR = 3, | 47 ABORT_ERR = 3, |
| 51 NOT_READABLE_ERR = 4, | 48 NOT_READABLE_ERR = 4, |
| 52 ENCODING_ERR = 5, | 49 ENCODING_ERR = 5, |
| 53 NO_MODIFICATION_ALLOWED_ERR = 6, | 50 NO_MODIFICATION_ALLOWED_ERR = 6, |
| 54 INVALID_STATE_ERR = 7, | 51 INVALID_STATE_ERR = 7, |
| 55 SYNTAX_ERR = 8, | 52 SYNTAX_ERR = 8, |
| 56 INVALID_MODIFICATION_ERR = 9, | 53 INVALID_MODIFICATION_ERR = 9, |
| 57 QUOTA_EXCEEDED_ERR = 10, | 54 QUOTA_EXCEEDED_ERR = 10, |
| 58 TYPE_MISMATCH_ERR = 11, | 55 TYPE_MISMATCH_ERR = 11, |
| 59 PATH_EXISTS_ERR = 12, | 56 PATH_EXISTS_ERR = 12, |
| 60 }; | 57 }; |
| 61 | 58 |
| 62 static const char abortErrorMessage[]; | 59 CORE_EXPORT extern const char abortErrorMessage[]; |
| 63 static const char encodingErrorMessage[]; | 60 CORE_EXPORT extern const char encodingErrorMessage[]; |
| 64 static const char invalidStateErrorMessage[]; | 61 CORE_EXPORT extern const char invalidStateErrorMessage[]; |
| 65 static const char noModificationAllowedErrorMessage[]; | 62 CORE_EXPORT extern const char noModificationAllowedErrorMessage[]; |
| 66 static const char notFoundErrorMessage[]; | 63 CORE_EXPORT extern const char notFoundErrorMessage[]; |
| 67 static const char notReadableErrorMessage[]; | 64 CORE_EXPORT extern const char notReadableErrorMessage[]; |
| 68 static const char pathExistsErrorMessage[]; | 65 CORE_EXPORT extern const char pathExistsErrorMessage[]; |
| 69 static const char quotaExceededErrorMessage[]; | 66 CORE_EXPORT extern const char quotaExceededErrorMessage[]; |
| 70 static const char securityErrorMessage[]; | 67 CORE_EXPORT extern const char securityErrorMessage[]; |
| 71 static const char syntaxErrorMessage[]; | 68 CORE_EXPORT extern const char syntaxErrorMessage[]; |
| 72 static const char typeMismatchErrorMessage[]; | 69 CORE_EXPORT extern const char typeMismatchErrorMessage[]; |
| 73 | 70 |
| 74 static FileError* create(ErrorCode code) | 71 CORE_EXPORT void throwDOMException(ExceptionState&, ErrorCode); |
| 75 { | 72 CORE_EXPORT DOMException* createDOMException(ErrorCode); |
| 76 return new FileError(code); | |
| 77 } | |
| 78 | 73 |
| 79 ErrorCode code() const { return m_code; } | 74 } // namespace FileError |
| 80 | |
| 81 static void throwDOMException(ExceptionState&, ErrorCode); | |
| 82 | |
| 83 private: | |
| 84 explicit FileError(ErrorCode); | |
| 85 | |
| 86 ErrorCode m_code; | |
| 87 }; | |
| 88 | 75 |
| 89 } // namespace blink | 76 } // namespace blink |
| 90 | 77 |
| 91 #endif // FileError_h | 78 #endif // FileError_h |
| OLD | NEW |