summaryrefslogtreecommitdiff
path: root/Source/WebCore/fileapi/OperationNotAllowedException.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/fileapi/OperationNotAllowedException.cpp')
-rw-r--r--Source/WebCore/fileapi/OperationNotAllowedException.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/WebCore/fileapi/OperationNotAllowedException.cpp b/Source/WebCore/fileapi/OperationNotAllowedException.cpp
index 2c9bc8e11..582176df7 100644
--- a/Source/WebCore/fileapi/OperationNotAllowedException.cpp
+++ b/Source/WebCore/fileapi/OperationNotAllowedException.cpp
@@ -34,17 +34,13 @@
namespace WebCore {
-// FIXME: This should be an array of structs to pair the names and descriptions.
-static const char* const exceptionNames[] = {
- "NOT_ALLOWED_ERR"
+static struct OperationNotAllowedExceptionNameDescription {
+ const char* const name;
+ const char* const description;
+} operationNotAllowedExceptions[] = {
+ { "NOT_ALLOWED_ERR", "A read method was called while the object was in the LOADING state due to a previous read call." }
};
-static const char* const exceptionDescriptions[] = {
- "A read method was called while the object was in the LOADING state due to a previous read call."
-};
-
-COMPILE_ASSERT(WTF_ARRAY_LENGTH(exceptionNames) == WTF_ARRAY_LENGTH(exceptionDescriptions), OperationNotAllowedExceptionTablesMustMatch);
-
bool OperationNotAllowedException::initializeDescription(ExceptionCode ec, ExceptionCodeDescription* description)
{
if (ec < OperationNotAllowedExceptionOffset || ec > OperationNotAllowedExceptionMax)
@@ -54,11 +50,11 @@ bool OperationNotAllowedException::initializeDescription(ExceptionCode ec, Excep
description->code = ec - OperationNotAllowedExceptionOffset;
description->type = OperationNotAllowedExceptionType;
- size_t tableSize = WTF_ARRAY_LENGTH(exceptionNames);
+ size_t tableSize = WTF_ARRAY_LENGTH(operationNotAllowedExceptions);
size_t tableIndex = ec - NOT_ALLOWED_ERR;
- description->name = tableIndex < tableSize ? exceptionNames[tableIndex] : 0;
- description->description = tableIndex < tableSize ? exceptionDescriptions[tableIndex] : 0;
+ description->name = tableIndex < tableSize ? operationNotAllowedExceptions[tableIndex].name : 0;
+ description->description = tableIndex < tableSize ? operationNotAllowedExceptions[tableIndex].description : 0;
return true;
}