Title: [113682] trunk/Source/WebCore
Revision
113682
Author
[email protected]
Date
2012-04-09 22:43:30 -0700 (Mon, 09 Apr 2012)

Log Message

combine two arrays in OperationNotAllowedException.cpp into one
https://bugs.webkit.org/show_bug.cgi?id=83445

Patch by Lu Guanqun <[email protected]> on 2012-04-09
Reviewed by Kentaro Hara.

No new tests required.

* fileapi/OperationNotAllowedException.cpp:
(OperationNotAllowedExceptionNameDescription):
(WebCore):
(WebCore::OperationNotAllowedException::initializeDescription):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (113681 => 113682)


--- trunk/Source/WebCore/ChangeLog	2012-04-10 05:39:23 UTC (rev 113681)
+++ trunk/Source/WebCore/ChangeLog	2012-04-10 05:43:30 UTC (rev 113682)
@@ -1,3 +1,17 @@
+2012-04-09  Lu Guanqun  <[email protected]>
+
+        combine two arrays in OperationNotAllowedException.cpp into one
+        https://bugs.webkit.org/show_bug.cgi?id=83445
+
+        Reviewed by Kentaro Hara.
+
+        No new tests required.
+
+        * fileapi/OperationNotAllowedException.cpp:
+        (OperationNotAllowedExceptionNameDescription):
+        (WebCore):
+        (WebCore::OperationNotAllowedException::initializeDescription):
+
 2012-04-09  Shinya Kawanaka  <[email protected]>
 
         Assert triggers VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries.

Modified: trunk/Source/WebCore/fileapi/OperationNotAllowedException.cpp (113681 => 113682)


--- trunk/Source/WebCore/fileapi/OperationNotAllowedException.cpp	2012-04-10 05:39:23 UTC (rev 113681)
+++ trunk/Source/WebCore/fileapi/OperationNotAllowedException.cpp	2012-04-10 05:43:30 UTC (rev 113682)
@@ -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;
+} exceptions[] = {
+    { "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 @@
     description->code = ec - OperationNotAllowedExceptionOffset;
     description->type = OperationNotAllowedExceptionType;
 
-    size_t tableSize = WTF_ARRAY_LENGTH(exceptionNames);
+    size_t tableSize = WTF_ARRAY_LENGTH(exceptions);
     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 ? exceptions[tableIndex].name : 0;
+    description->description = tableIndex < tableSize ? exceptions[tableIndex].description : 0;
 
     return true;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to