OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 | 28 |
29 #ifndef DOMCoreException_h | 29 #ifndef DOMCoreException_h |
30 #define DOMCoreException_h | 30 #define DOMCoreException_h |
31 | 31 |
32 #include "bindings/v8/ScriptWrappable.h" | 32 #include "bindings/v8/ScriptWrappable.h" |
33 #include "core/dom/ExceptionBase.h" | 33 #include "core/dom/ExceptionBase.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
| 37 // FIXME: This should be private once IDBDatabaseException is gone. |
| 38 enum { |
| 39 IndexSizeErrorLegacyCode = 1, |
| 40 HierarchyRequestErrorLegacyCode = 3, |
| 41 WrongDocumentErrorLegacyCode = 4, |
| 42 InvalidCharacterErrorLegacyCode = 5, |
| 43 NoModificationAllowedErrorLegacyCode = 7, |
| 44 NotFoundErrorLegacyCode = 8, |
| 45 NotSupportedErrorLegacyCode = 9, |
| 46 InuseAttributeErrorLegacyCode = 10, // Historical. Only used in setAttribute
Node etc which have been removed from the DOM specs. |
| 47 |
| 48 // Introduced in DOM Level 2: |
| 49 InvalidStateErrorLegacyCode = 11, |
| 50 SyntaxErrorLegacyCode = 12, |
| 51 InvalidModificationErrorLegacyCode = 13, |
| 52 NamespaceErrorLegacyCode = 14, |
| 53 InvalidAccessErrorLegacyCode = 15, |
| 54 |
| 55 // Introduced in DOM Level 3: |
| 56 TypeMismatchErrorLegacyCode = 17, // Historical; use TypeError instead |
| 57 |
| 58 // XMLHttpRequest extension: |
| 59 SecurityErrorLegacyCode = 18, |
| 60 |
| 61 // Others introduced in HTML5: |
| 62 NetworkErrorLegacyCode = 19, |
| 63 AbortErrorLegacyCode = 20, |
| 64 UrlMismatchErrorLegacyCode = 21, |
| 65 QuotaExceededErrorLegacyCode = 22, |
| 66 TimeoutErrorLegacyCode = 23, |
| 67 InvalidNodeTypeErrorLegacyCode = 24, |
| 68 DataCloneErrorLegacyCode = 25 |
| 69 }; |
| 70 |
37 class DOMCoreException : public ExceptionBase, public ScriptWrappable { | 71 class DOMCoreException : public ExceptionBase, public ScriptWrappable { |
38 public: | 72 public: |
39 static PassRefPtr<DOMCoreException> create(const ExceptionCodeDescription& d
escription) | 73 static PassRefPtr<DOMCoreException> create(const ExceptionCodeDescription& d
escription) |
40 { | 74 { |
41 return adoptRef(new DOMCoreException(description)); | 75 return adoptRef(new DOMCoreException(description)); |
42 } | 76 } |
43 | 77 |
44 static bool initializeDescription(ExceptionCode, ExceptionCodeDescription*); | 78 static bool initializeDescription(ExceptionCode, ExceptionCodeDescription*); |
| 79 static int getLegacyErrorCode(ExceptionCode); |
45 | 80 |
46 private: | 81 private: |
47 explicit DOMCoreException(const ExceptionCodeDescription& description) | 82 explicit DOMCoreException(const ExceptionCodeDescription& description) |
48 : ExceptionBase(description) | 83 : ExceptionBase(description) |
49 { | 84 { |
50 ScriptWrappable::init(this); | 85 ScriptWrappable::init(this); |
51 } | 86 } |
52 }; | 87 }; |
53 | 88 |
54 } // namespace WebCore | 89 } // namespace WebCore |
55 | 90 |
56 #endif // DOMCoreException_h | 91 #endif // DOMCoreException_h |
OLD | NEW |