Title: [118835] trunk
Revision
118835
Author
[email protected]
Date
2012-05-29 14:20:30 -0700 (Tue, 29 May 2012)

Log Message

IndexedDB: Align codes and names for IDB-specific and DOM-specific errors/exceptions
https://bugs.webkit.org/show_bug.cgi?id=87276

Patch by Alec Flett <[email protected]> on 2012-05-29
Reviewed by Tony Chang.

Source/WebCore:

No new tests. Existing tests have been updated to use the new
exception constant values.

The IDB spec has evolved to DOM4-style DOMExceptions, which are
referred to with MixedCase, string-based style names for
exceptions rather than UNDERSCORE_CONSTANT_ERR codes. Change to
use MixedCase error/exception names, and tease out the
IDB-specific exception/error codes/names from the system-level
codes. Make sure that the legacy IDB-masked exception code values
match the DOM exception values. Make sure that
IDBDatabaseException[exception.name] still works.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
(WebCore::IDBDatabaseBackendImpl::setVersion):
(WebCore::IDBDatabaseBackendImpl::transaction):
* Modules/indexeddb/IDBDatabaseException.cpp:
(IDBDatabaseExceptionNameDescription):
(WebCore):
(WebCore::IDBDatabaseException::initializeDescription):
* Modules/indexeddb/IDBDatabaseException.h:
* Modules/indexeddb/IDBDatabaseException.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::index):
(WebCore::IDBObjectStoreBackendImpl::deleteIndex):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::abort):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::objectStore):

Source/WebKit/chromium:

* public/WebIDBDatabaseException.h:
* src/AssertMatchingEnums.cpp:

LayoutTests:

* storage/indexeddb/constants-expected.txt:
* storage/indexeddb/resources/constants.js:
(test):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (118834 => 118835)


--- trunk/LayoutTests/ChangeLog	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/LayoutTests/ChangeLog	2012-05-29 21:20:30 UTC (rev 118835)
@@ -1,3 +1,14 @@
+2012-05-29  Alec Flett  <[email protected]>
+
+        IndexedDB: Align codes and names for IDB-specific and DOM-specific errors/exceptions
+        https://bugs.webkit.org/show_bug.cgi?id=87276
+
+        Reviewed by Tony Chang.
+
+        * storage/indexeddb/constants-expected.txt:
+        * storage/indexeddb/resources/constants.js:
+        (test):
+
 2012-05-29  Csaba Osztrogonác  <[email protected]>
 
         [Qt] Unreviewed gardening, skip new failing tests

Modified: trunk/LayoutTests/storage/indexeddb/constants-expected.txt (118834 => 118835)


--- trunk/LayoutTests/storage/indexeddb/constants-expected.txt	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/LayoutTests/storage/indexeddb/constants-expected.txt	2012-05-29 21:20:30 UTC (rev 118835)
@@ -7,16 +7,16 @@
 
 PASS IDBDatabaseException.UNKNOWN_ERR is 1
 PASS IDBDatabaseException.NON_TRANSIENT_ERR is 2
-PASS IDBDatabaseException.NOT_FOUND_ERR is 3
 PASS IDBDatabaseException.CONSTRAINT_ERR is 4
 PASS IDBDatabaseException.DATA_ERR is 5
 PASS IDBDatabaseException.NOT_ALLOWED_ERR is 6
 PASS IDBDatabaseException.TRANSACTION_INACTIVE_ERR is 7
-PASS IDBDatabaseException.ABORT_ERR is 8
 PASS IDBDatabaseException.READ_ONLY_ERR is 9
-PASS IDBDatabaseException.TIMEOUT_ERR is 10
-PASS IDBDatabaseException.QUOTA_ERR is 11
 PASS IDBDatabaseException.VER_ERR is 12
+PASS IDBDatabaseException.TIMEOUT_ERR is DOMException.TIMEOUT_ERR
+PASS IDBDatabaseException.QUOTA_ERR is DOMException.QUOTA_EXCEEDED_ERR
+PASS IDBDatabaseException.ABORT_ERR is DOMException.ABORT_ERR
+PASS IDBDatabaseException.NOT_FOUND_ERR is DOMException.NOT_FOUND_ERR
 PASS IDBCursor.NEXT is 0
 PASS IDBCursor.NEXT_NO_DUPLICATE is 1
 PASS IDBCursor.PREV is 2

Modified: trunk/LayoutTests/storage/indexeddb/resources/constants.js (118834 => 118835)


--- trunk/LayoutTests/storage/indexeddb/resources/constants.js	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/LayoutTests/storage/indexeddb/resources/constants.js	2012-05-29 21:20:30 UTC (rev 118835)
@@ -10,17 +10,18 @@
     removeVendorPrefixes();
     shouldBe("IDBDatabaseException.UNKNOWN_ERR", "1");
     shouldBe("IDBDatabaseException.NON_TRANSIENT_ERR", "2");
-    shouldBe("IDBDatabaseException.NOT_FOUND_ERR", "3");
     shouldBe("IDBDatabaseException.CONSTRAINT_ERR", "4");
     shouldBe("IDBDatabaseException.DATA_ERR", "5");
     shouldBe("IDBDatabaseException.NOT_ALLOWED_ERR", "6");
     shouldBe("IDBDatabaseException.TRANSACTION_INACTIVE_ERR", "7");
-    shouldBe("IDBDatabaseException.ABORT_ERR", "8");
     shouldBe("IDBDatabaseException.READ_ONLY_ERR", "9");
-    shouldBe("IDBDatabaseException.TIMEOUT_ERR", "10");
-    shouldBe("IDBDatabaseException.QUOTA_ERR", "11");
     shouldBe("IDBDatabaseException.VER_ERR", "12");
 
+    shouldBe("IDBDatabaseException.TIMEOUT_ERR", "DOMException.TIMEOUT_ERR");
+    shouldBe("IDBDatabaseException.QUOTA_ERR", "DOMException.QUOTA_EXCEEDED_ERR");
+    shouldBe("IDBDatabaseException.ABORT_ERR", "DOMException.ABORT_ERR");
+    shouldBe("IDBDatabaseException.NOT_FOUND_ERR", "DOMException.NOT_FOUND_ERR");
+
     shouldBe("IDBCursor.NEXT", "0");
     shouldBe("IDBCursor.NEXT_NO_DUPLICATE", "1");
     shouldBe("IDBCursor.PREV", "2");

Modified: trunk/Source/WebCore/ChangeLog (118834 => 118835)


--- trunk/Source/WebCore/ChangeLog	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/ChangeLog	2012-05-29 21:20:30 UTC (rev 118835)
@@ -1,3 +1,45 @@
+2012-05-29  Alec Flett  <[email protected]>
+
+        IndexedDB: Align codes and names for IDB-specific and DOM-specific errors/exceptions
+        https://bugs.webkit.org/show_bug.cgi?id=87276
+
+        Reviewed by Tony Chang.
+
+        No new tests. Existing tests have been updated to use the new
+        exception constant values.
+
+        The IDB spec has evolved to DOM4-style DOMExceptions, which are
+        referred to with MixedCase, string-based style names for
+        exceptions rather than UNDERSCORE_CONSTANT_ERR codes. Change to
+        use MixedCase error/exception names, and tease out the
+        IDB-specific exception/error codes/names from the system-level
+        codes. Make sure that the legacy IDB-masked exception code values
+        match the DOM exception values. Make sure that
+        IDBDatabaseException[exception.name] still works.
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::createObjectStore):
+        (WebCore::IDBDatabase::transaction):
+        * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+        (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
+        (WebCore::IDBDatabaseBackendImpl::setVersion):
+        (WebCore::IDBDatabaseBackendImpl::transaction):
+        * Modules/indexeddb/IDBDatabaseException.cpp:
+        (IDBDatabaseExceptionNameDescription):
+        (WebCore):
+        (WebCore::IDBDatabaseException::initializeDescription):
+        * Modules/indexeddb/IDBDatabaseException.h:
+        * Modules/indexeddb/IDBDatabaseException.idl:
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::createIndex):
+        * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
+        (WebCore::IDBObjectStoreBackendImpl::index):
+        (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
+        * Modules/indexeddb/IDBRequest.cpp:
+        (WebCore::IDBRequest::abort):
+        * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
+        (WebCore::IDBTransactionBackendImpl::objectStore):
+
 2012-05-29  David Hyatt  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=87775

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -125,13 +125,13 @@
     IDB_TRACE("IDBCursor::update");
 
     if (!m_gotValue) {
-        ec = INVALID_STATE_ERR;
+        ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
         return 0;
     }
     RefPtr<SerializedScriptValue> value = prpValue;
     if (value->blobURLs().size() > 0) {
         // FIXME: Add Blob/File/FileList support
-        ec = DATA_CLONE_ERR;
+        ec = IDBDatabaseException::IDB_DATA_CLONE_ERR;
         return 0;
     }
 
@@ -148,7 +148,7 @@
 {
     IDB_TRACE("IDBCursor::advance");
     if (!m_gotValue) {
-        ec = INVALID_STATE_ERR;
+        ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
         return;
     }
 
@@ -186,7 +186,7 @@
     }
 
     if (!m_gotValue) {
-        ec = INVALID_STATE_ERR;
+        ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
         return;
     }
 
@@ -204,7 +204,7 @@
 {
     IDB_TRACE("IDBCursor::delete");
     if (!m_gotValue) {
-        ec = INVALID_STATE_ERR;
+        ec = IDBDatabaseException::IDB_INVALID_STATE_ERR;
         return 0;
     }
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -103,7 +103,7 @@
     }
 
     if (!keyPath.isNull() && !keyPath.isValid()) {
-        ec = SYNTAX_ERR;
+        ec = IDBDatabaseException::IDB_SYNTAX_ERR;
         return 0;
     }
 
@@ -112,7 +112,7 @@
         options.get("autoIncrement", autoIncrement);
 
     if (autoIncrement && ((keyPath.type() == IDBKeyPath::StringType && keyPath.string().isEmpty()) || keyPath.type() == IDBKeyPath::ArrayType)) {
-        ec = INVALID_ACCESS_ERR;
+        ec = IDBDatabaseException::IDB_INVALID_ACCESS_ERR;
         return 0;
     }
 
@@ -154,7 +154,7 @@
 {
     RefPtr<DOMStringList> storeNames = prpStoreNames;
     if (!storeNames || storeNames->isEmpty()) {
-        ec = INVALID_ACCESS_ERR;
+        ec = IDBDatabaseException::IDB_INVALID_ACCESS_ERR;
         return 0;
     }
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -189,7 +189,7 @@
 {
     RefPtr<IDBObjectStoreBackendImpl> objectStore = m_objectStores.get(name);
     if (!objectStore) {
-        ec = IDBDatabaseException::NOT_FOUND_ERR;
+        ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
         return;
     }
     RefPtr<IDBDatabaseBackendImpl> database = this;
@@ -213,7 +213,8 @@
     RefPtr<IDBCallbacks> callbacks = prpCallbacks;
     RefPtr<IDBDatabaseCallbacks> databaseCallbacks = prpDatabaseCallbacks;
     if (!m_databaseCallbacksSet.contains(databaseCallbacks)) {
-        callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::ABORT_ERR, "Connection was closed before set version transaction was created"));
+        // FIXME: IDBDatabaseError doesn't yet do proper translation of IDB-specific uses of error codes, this should be IDB_ABORT_ERR
+        callbacks->onError(IDBDatabaseError::createWithoutOffset(ABORT_ERR, "Connection was closed before set version transaction was created"));
         return;
     }
     for (DatabaseCallbacksSet::const_iterator it = m_databaseCallbacksSet.begin(); it != m_databaseCallbacksSet.end(); ++it) {
@@ -312,7 +313,7 @@
 {
     for (size_t i = 0; i < objectStoreNames->length(); ++i) {
         if (!m_objectStores.contains(objectStoreNames->item(i))) {
-            ec = IDBDatabaseException::NOT_FOUND_ERR;
+            ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
             return 0;
         }
     }

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.cpp (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -34,22 +34,34 @@
 
 namespace WebCore {
 
-static struct IDBDatabaseExceptionNameDescription {
+static const struct IDBDatabaseExceptionNameDescription {
     const char* const name;
     const char* const description;
+    const ExceptionCode legacyCode;
 } idbDatabaseExceptions[] = {
-    { "UNKNOWN_ERR", "An unknown error occurred within Indexed Database." },
-    { "NON_TRANSIENT_ERR", "NON_TRANSIENT_ERR" }, // FIXME: Write a better message if it's ever possible this is thrown.
-    { "NOT_FOUND_ERR", "The name supplied does not match any existing item." },
-    { "CONSTRAINT_ERR", "The request cannot be completed due to a failed constraint." },
-    { "DATA_ERR", "The data provided does not meet the requirements of the function." },
-    { "NOT_ALLOWED_ERR", "This function is not allowed to be called in such a context." },
-    { "TRANSACTION_INACTIVE_ERR", "A request was placed against a transaction which is either currently not active, or which is finished." },
-    { "ABORT_ERR", "The transaction was aborted, so the request cannot be fulfilled." },
-    { "READ_ONLY_ERR", "A write operation was attempted in a read-only transaction." },
-    { "TIMEOUT_ERR", "A lock for the transaction could not be obtained in a reasonable time." }, // FIXME: This isn't used yet.
-    { "QUOTA_ERR", "The operation failed because there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database." }, // FIXME: This isn't used yet
-    { "VER_ERR", "An attempt was made to open a database using a lower version than the existing version." } // FIXME: This isn't used yet
+    // These are IDB-specific errors from the spec.
+    { "UnknownError", "An unknown error occurred within Indexed Database.", 0 },
+    { "NonTransientError", "NonTransientError", 0 }, // FIXME: No longer in the spec
+    { 0, 0, 0 }, // FIXME: Previous/legacy value NOT_FOUND_ERR.
+    { "ConstraintError", "A mutation operation in the transaction failed because a constraint was not satisfied.", 0 },
+    { "DataError", "The data provided does not meet requirements.", 0 },
+    { "NotAllowedError", "This function is not allowed to be called in such a context.", 0}, // FIXME: no longer in the spec
+    { "TransactionInactiveError", "A request was placed against a transaction which is either currently not active, or which is finished.", 0 },
+    { 0, 0, 0 }, // FIXME: Previous/legacy value was ABORT_ERR.
+    { "ReadOnlyError", "A write operation was attempted in a read-only transaction.", 0 },
+    { 0, 0, 0 }, // FIXME: Previous/legacy value was TIMEOUT_ERR.
+    { 0, 0, 0 }, // FIXME: Previous/legacy value was QUOTA_ERR.
+    { "VersionError", "An attempt was made to open a database using a lower version than the existing version.", 0 }, // FIXME: This isn't used yet
+
+    // These are IDB-specific descriptions of generic DOM Exceptions when they are thrown from IDB APIs
+    { "NotFoundError", "An operation failed because the requested database object could not be found.", NOT_FOUND_ERR },
+    { "InvalidStateError", "An operation was called on an object on which it is not allowed or at a time when it is not allowed.", INVALID_STATE_ERR },
+    { "InvalidAccessError", "An invalid operation was performed on an object.", INVALID_ACCESS_ERR },
+    { "AbortError", "The transaction was aborted, so the request cannot be fulfilled.", ABORT_ERR },
+    { "TimeoutError", "A lock for the transaction could not be obtained in a reasonable time.", TIMEOUT_ERR }, // FIXME: This isn't used yet.
+    { "QuotaExceededError", "The operation failed because there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database.", QUOTA_EXCEEDED_ERR }, // FIXME: This isn't used yet
+    { "SyntaxError", "The keypath argument contains an invalid key path.", SYNTAX_ERR },
+    { "DataCloneError", "The data being stored could not be cloned by the internal structured cloning algorithm.", DATA_CLONE_ERR }
 };
 
 bool IDBDatabaseException::initializeDescription(ExceptionCode ec, ExceptionCodeDescription* description)
@@ -57,15 +69,18 @@
     if (ec < IDBDatabaseExceptionOffset || ec > IDBDatabaseExceptionMax)
         return false;
 
+    size_t tableSize = WTF_ARRAY_LENGTH(idbDatabaseExceptions);
+    size_t tableIndex = ec - IDBDatabaseException::UNKNOWN_ERR;
+
+    const IDBDatabaseExceptionNameDescription* entry = tableIndex < tableSize ? &idbDatabaseExceptions[tableIndex] : 0;
+
     description->typeName = "DOM IDBDatabase";
-    description->code = ec - IDBDatabaseExceptionOffset;
+    description->code = (entry && entry->legacyCode) ? entry->legacyCode : ec - IDBDatabaseExceptionOffset;
     description->type = IDBDatabaseExceptionType;
 
-    size_t tableSize = WTF_ARRAY_LENGTH(idbDatabaseExceptions);
-    size_t tableIndex = ec - UNKNOWN_ERR;
 
-    description->name = tableIndex < tableSize ? idbDatabaseExceptions[tableIndex].name : 0;
-    description->description = tableIndex < tableSize ? idbDatabaseExceptions[tableIndex].description : 0;
+    description->name = entry ? entry->name : 0;
+    description->description = entry ? entry->description : 0;
 
     return true;
 }

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.h (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.h	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.h	2012-05-29 21:20:30 UTC (rev 118835)
@@ -45,17 +45,26 @@
     enum IDBDatabaseExceptionCode {
         NO_ERR = IDBDatabaseExceptionOffset,
         UNKNOWN_ERR,
-        NON_TRANSIENT_ERR,
-        NOT_FOUND_ERR,
+        NON_TRANSIENT_ERR, // FIXME: No longer in the spec
+        LEGACY_NOT_FOUND_ERR, // FIXME: Placeholder.
         CONSTRAINT_ERR,
         DATA_ERR,
-        NOT_ALLOWED_ERR,
+        NOT_ALLOWED_ERR, // FIXME: No longer in the spec
         TRANSACTION_INACTIVE_ERR,
-        ABORT_ERR,
+        LEGACY_ABORT_ERR, // FIXME: Placeholder.
         READ_ONLY_ERR,
-        TIMEOUT_ERR,
-        QUOTA_ERR,
-        VER_ERR
+        LEGACY_TIMEOUT_ERR, // FIXME: Placeholder.
+        LEGACY_QUOTA_ERR, // FIXME: Placeholder.
+        VER_ERR,
+
+        IDB_NOT_FOUND_ERR,
+        IDB_INVALID_STATE_ERR,
+        IDB_INVALID_ACCESS_ERR,
+        IDB_ABORT_ERR,
+        IDB_TIMEOUT_ERR,
+        IDB_QUOTA_EXCEEDED_ERR,
+        IDB_SYNTAX_ERR,
+        IDB_DATA_CLONE_ERR,
     };
 
     static int ErrorCodeToExceptionCode(int errorCode)

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.idl (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.idl	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseException.idl	2012-05-29 21:20:30 UTC (rev 118835)
@@ -42,16 +42,17 @@
         const unsigned short NO_ERR = 0;
         const unsigned short UNKNOWN_ERR = 1;
         const unsigned short NON_TRANSIENT_ERR = 2;
-        const unsigned short NOT_FOUND_ERR = 3;
         const unsigned short CONSTRAINT_ERR = 4;
         const unsigned short DATA_ERR = 5;
         const unsigned short NOT_ALLOWED_ERR = 6;
         const unsigned short TRANSACTION_INACTIVE_ERR = 7;
-        const unsigned short ABORT_ERR = 8;
         const unsigned short READ_ONLY_ERR = 9;
-        const unsigned short TIMEOUT_ERR = 10;
-        const unsigned short QUOTA_ERR = 11;
         const unsigned short VER_ERR = 12;
+
+        const unsigned short NOT_FOUND_ERR = 8;
+        const unsigned short ABORT_ERR = 20;
+        const unsigned short TIMEOUT_ERR = 23;
+        const unsigned short QUOTA_ERR = 22;
     };
 
 }

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -126,7 +126,7 @@
     RefPtr<SerializedScriptValue> value = prpValue;
     if (value->blobURLs().size() > 0) {
         // FIXME: Add Blob/File/FileList support
-        ec = DATA_CLONE_ERR;
+        ec = IDBDatabaseException::IDB_DATA_CLONE_ERR;
         return 0;
     }
 
@@ -150,7 +150,7 @@
     RefPtr<SerializedScriptValue> value = prpValue;
     if (value->blobURLs().size() > 0) {
         // FIXME: Add Blob/File/FileList support
-        ec = DATA_CLONE_ERR;
+        ec = IDBDatabaseException::IDB_DATA_CLONE_ERR;
         return 0;
     }
 
@@ -227,7 +227,7 @@
 {
     IDB_TRACE("IDBObjectStore::createIndex");
     if (!keyPath.isValid()) {
-        ec = SYNTAX_ERR;
+        ec = IDBDatabaseException::IDB_SYNTAX_ERR;
         return 0;
     }
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -554,7 +554,7 @@
 {
     RefPtr<IDBIndexBackendInterface> index = m_indexes.get(name);
     if (!index) {
-        ec = IDBDatabaseException::NOT_FOUND_ERR;
+        ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
         return 0;
     }
     return index.release();
@@ -569,7 +569,7 @@
 
     RefPtr<IDBIndexBackendImpl> index = m_indexes.get(name);
     if (!index) {
-        ec = IDBDatabaseException::NOT_FOUND_ERR;
+        ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
         return;
     }
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -174,7 +174,7 @@
     m_errorCode = 0;
     m_errorMessage = String();
     m_result.clear();
-    onError(IDBDatabaseError::create(IDBDatabaseException::ABORT_ERR, "The transaction was aborted, so the request cannot be fulfilled."));
+    onError(IDBDatabaseError::createWithoutOffset(ABORT_ERR, "The transaction was aborted, so the request cannot be fulfilled."));
 }
 
 void IDBRequest::setCursorType(IDBCursorBackendInterface::CursorType cursorType)

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp (118834 => 118835)


--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -72,7 +72,7 @@
 
     // Does a linear search, but it really shouldn't be that slow in practice.
     if (m_mode != IDBTransaction::VERSION_CHANGE && !m_objectStoreNames->contains(name)) {
-        ec = IDBDatabaseException::NOT_FOUND_ERR;
+        ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
         return 0;
     }
 
@@ -82,7 +82,7 @@
     //        There's a bug to make this impossible in the spec. When we make it impossible here, we
     //        can remove this check.
     if (!objectStore) {
-        ec = IDBDatabaseException::NOT_FOUND_ERR;
+        ec = IDBDatabaseException::IDB_NOT_FOUND_ERR;
         return 0;
     }
     return objectStore.release();

Modified: trunk/Source/WebKit/chromium/ChangeLog (118834 => 118835)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-29 21:20:30 UTC (rev 118835)
@@ -1,3 +1,13 @@
+2012-05-29  Alec Flett  <[email protected]>
+
+        IndexedDB: Align codes and names for IDB-specific and DOM-specific errors/exceptions
+        https://bugs.webkit.org/show_bug.cgi?id=87276
+
+        Reviewed by Tony Chang.
+
+        * public/WebIDBDatabaseException.h:
+        * src/AssertMatchingEnums.cpp:
+
 2012-05-29  Rafael Weinstein  <[email protected]>
 
         Unreviewed.  Rolled DEPS.

Modified: trunk/Source/WebKit/chromium/public/WebIDBDatabaseException.h (118834 => 118835)


--- trunk/Source/WebKit/chromium/public/WebIDBDatabaseException.h	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebKit/chromium/public/WebIDBDatabaseException.h	2012-05-29 21:20:30 UTC (rev 118835)
@@ -35,7 +35,7 @@
 
 enum WebIDBDatabaseException {
     WebIDBDatabaseExceptionDataError = 1205,
-    WebIDBDatabaseExceptionQuotaError = 1211,
+    WebIDBDatabaseExceptionQuotaError = 1218,
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp (118834 => 118835)


--- trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2012-05-29 21:17:12 UTC (rev 118834)
+++ trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2012-05-29 21:20:30 UTC (rev 118835)
@@ -458,7 +458,7 @@
 COMPILE_ASSERT_MATCHING_ENUM(WebView::UserStyleInjectInSubsequentDocuments, InjectInSubsequentDocuments);
 
 COMPILE_ASSERT_MATCHING_ENUM(WebIDBDatabaseExceptionDataError, IDBDatabaseException::DATA_ERR);
-COMPILE_ASSERT_MATCHING_ENUM(WebIDBDatabaseExceptionQuotaError, IDBDatabaseException::QUOTA_ERR);
+COMPILE_ASSERT_MATCHING_ENUM(WebIDBDatabaseExceptionQuotaError, IDBDatabaseException::IDB_QUOTA_EXCEEDED_ERR);
 
 #if ENABLE(INDEXED_DATABASE)
 COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::InvalidType, IDBKey::InvalidType);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to