Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / dom / ExceptionCode.h
1 /*
2  *  Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3  *
4  *  This library is free software; you can redistribute it and/or
5  *  modify it under the terms of the GNU Lesser General Public
6  *  License as published by the Free Software Foundation; either
7  *  version 2 of the License, or (at your option) any later version.
8  *
9  *  This library is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  *  Lesser General Public License for more details.
13  *
14  *  You should have received a copy of the GNU Lesser General Public
15  *  License along with this library; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18
19 #ifndef ExceptionCode_h
20 #define ExceptionCode_h
21
22 namespace blink {
23
24     // The DOM standards use unsigned short for exception codes.
25     // In our DOM implementation we use int instead, and use different
26     // numerical ranges for different types of DOM exception, so that
27     // an exception of any type can be expressed with a single integer.
28     typedef int ExceptionCode;
29
30
31     // This list must be in sync with the |domExceptions| in PrivateScriptRunner.h.
32     // Some of these are considered historical since they have been
33     // changed or removed from the specifications.
34     enum {
35         IndexSizeError = 1,
36         HierarchyRequestError,
37         WrongDocumentError,
38         InvalidCharacterError,
39         NoModificationAllowedError,
40         NotFoundError,
41         NotSupportedError,
42         InUseAttributeError, // Historical. Only used in setAttributeNode etc which have been removed from the DOM specs.
43
44         // Introduced in DOM Level 2:
45         InvalidStateError,
46         SyntaxError,
47         InvalidModificationError,
48         NamespaceError,
49         InvalidAccessError,
50
51         // Introduced in DOM Level 3:
52         TypeMismatchError, // Historical; use TypeError instead
53
54         // XMLHttpRequest extension:
55         SecurityError,
56
57         // Others introduced in HTML5:
58         NetworkError,
59         AbortError,
60         URLMismatchError,
61         QuotaExceededError,
62         TimeoutError,
63         InvalidNodeTypeError,
64         DataCloneError,
65
66         // These are IDB-specific.
67         UnknownError,
68         ConstraintError,
69         DataError,
70         TransactionInactiveError,
71         ReadOnlyError,
72         VersionError,
73
74         // File system
75         NotReadableError,
76         EncodingError,
77         PathExistsError,
78
79         // SQL
80         SQLDatabaseError, // Naming conflict with DatabaseError class.
81
82         // Web Crypto
83         OperationError,
84     };
85
86     enum V8ErrorType {
87         V8GeneralError = 1000,
88         V8TypeError,
89         V8RangeError,
90         V8SyntaxError,
91         V8ReferenceError,
92     };
93
94 } // namespace blink
95
96 #endif // ExceptionCode_h