Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: WebCore/dom/ExceptionCode.cpp

Issue 5722007: Merge 73605 - 2010-12-07 Jeremy Orlow <jorlow@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/dom/ExceptionCode.h ('k') | WebCore/storage/IDBDatabaseError.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/dom/ExceptionCode.cpp
===================================================================
--- WebCore/dom/ExceptionCode.cpp (revision 73908)
+++ WebCore/dom/ExceptionCode.cpp (working copy)
@@ -27,6 +27,7 @@
#include "ExceptionCode.h"
#include "EventException.h"
+#include "IDBDatabaseException.h"
#include "RangeException.h"
#include "XMLHttpRequestException.h"
@@ -209,6 +210,36 @@
};
#endif
+#if ENABLE(INDEXED_DATABASE)
+static const char* const idbDatabaseExceptionNames[] = {
+ "UNKNOWN_ERR",
+ "NON_TRANSIENT_ERR",
+ "NOT_FOUND_ERR",
+ "CONSTRAINT_ERR",
+ "DATA_ERR",
+ "NOT_ALLOWED_ERR",
+ "SERIAL_ERR",
+ "RECOVERABLE_ERR",
+ "TRANSIENT_ERR",
+ "TIMEOUT_ERR",
+ "DEADLOCK_ERR"
+};
+
+static const char* const idbDatabaseExceptionDescriptions[] = {
+ "An unknown error occurred within Indexed Database.",
+ "NON_TRANSIENT_ERR", // FIXME: Write a better message if it's ever possible this is thrown.
+ "The name supplied does not match any existing item.",
+ "The request cannot be completed due to a failed constraint.",
+ "The data provided does not meet the requirements of the function.",
+ "This function is not allowed to be called in such a context.",
+ "The data supplied cannot be serialized according to the structured cloning algorithm.",
+ "RECOVERABLE_ERR", // FIXME: This isn't even used.
+ "TRANSIENT_ERR", // FIXME: This isn't even used.
+ "TIMEOUT_ERR", // This can't be thrown.
+ "DEADLOCK_ERR" // This can't be thrown.
+};
+#endif
+
void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& description)
{
ASSERT(ec);
@@ -287,6 +318,16 @@
nameTableSize = WTF_ARRAY_LENGTH(fileExceptionNames);
nameTableOffset = FileException::NOT_FOUND_ERR;
#endif
+#if ENABLE(INDEXED_DATABASE)
+ } else if (code >= IDBDatabaseException::IDBDatabaseExceptionOffset && code <= IDBDatabaseException::IDBDatabaseExceptionMax) {
+ type = IDBDatabaseExceptionType;
+ typeName = "DOM IDBDatabase";
+ code -= IDBDatabaseException::IDBDatabaseExceptionOffset;
+ nameTable = idbDatabaseExceptionNames;
+ descriptionTable = idbDatabaseExceptionDescriptions;
+ nameTableSize = WTF_ARRAY_LENGTH(idbDatabaseExceptionNames);
+ nameTableOffset = IDBDatabaseException::UNKNOWN_ERR;
+#endif
} else {
type = DOMExceptionType;
typeName = "DOM";
« no previous file with comments | « WebCore/dom/ExceptionCode.h ('k') | WebCore/storage/IDBDatabaseError.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698