summaryrefslogtreecommitdiff
path: root/Source/WebCore/fileapi/OperationNotAllowedException.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/fileapi/OperationNotAllowedException.cpp
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
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;
}