Diff
Modified: trunk/LayoutTests/ChangeLog (131370 => 131371)
--- trunk/LayoutTests/ChangeLog 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/LayoutTests/ChangeLog 2012-10-15 22:19:08 UTC (rev 131371)
@@ -1,3 +1,15 @@
+2012-10-15 Joshua Bell <jsb...@chromium.org>
+
+ IndexedDB: Pass type of error causing abort to IDBTransaction::onAbort
+ https://bugs.webkit.org/show_bug.cgi?id=99097
+
+ Reviewed by Tony Chang.
+
+ Verify that IDBTransaction.error is reporting ConstraintError when indexing fails.
+
+ * storage/indexeddb/lazy-index-population-expected.txt:
+ * storage/indexeddb/lazy-index-population.html:
+
2012-10-15 Dana Jansens <dan...@chromium.org>
Rebaselines after 131358.
Modified: trunk/LayoutTests/storage/indexeddb/lazy-index-population-expected.txt (131370 => 131371)
--- trunk/LayoutTests/storage/indexeddb/lazy-index-population-expected.txt 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/LayoutTests/storage/indexeddb/lazy-index-population-expected.txt 2012-10-15 22:19:08 UTC (rev 131371)
@@ -25,6 +25,7 @@
PASS ++state is 2
transaction aborted
PASS ++state is 3
+PASS trans.error.name is 'ConstraintError'
Verify that uniqueness constraints are enforced when index is created before puts:
connection.setVersion('2')
@@ -41,6 +42,7 @@
PASS ++state is 2
transaction aborted
PASS ++state is 3
+PASS trans.error.name is 'ConstraintError'
Verify that uniqueness constraints are enforced when index is created after puts:
connection.setVersion('3')
@@ -57,6 +59,7 @@
PASS ++state is 2
transaction aborted
PASS ++state is 3
+PASS trans.error.name is 'ConstraintError'
Verify that uniqueness constraints are enforced when index is created between puts:
connection.setVersion('4')
@@ -73,6 +76,7 @@
PASS ++state is 2
transaction aborted
PASS ++state is 3
+PASS trans.error.name is 'ConstraintError'
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/storage/indexeddb/lazy-index-population.html (131370 => 131371)
--- trunk/LayoutTests/storage/indexeddb/lazy-index-population.html 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/LayoutTests/storage/indexeddb/lazy-index-population.html 2012-10-15 22:19:08 UTC (rev 131371)
@@ -58,6 +58,7 @@
trans._onabort_ = function () {
debug("transaction aborted");
shouldBe("++state", "3");
+ shouldBe("trans.error.name", "'ConstraintError'");
verifyCreateThenPut();
};
};
@@ -98,6 +99,7 @@
trans._onabort_ = function () {
debug("transaction aborted");
shouldBe("++state", "3");
+ shouldBe("trans.error.name", "'ConstraintError'");
verifyPutThenCreate();
};
};
@@ -137,6 +139,7 @@
trans._onabort_ = function () {
debug("transaction aborted");
shouldBe("++state", "3");
+ shouldBe("trans.error.name", "'ConstraintError'");
verifyPutThenCreateThenPut();
};
};
@@ -176,6 +179,7 @@
trans._onabort_ = function () {
debug("transaction aborted");
shouldBe("++state", "3");
+ shouldBe("trans.error.name", "'ConstraintError'");
finishJSTest();
};
};
Modified: trunk/Source/WebCore/ChangeLog (131370 => 131371)
--- trunk/Source/WebCore/ChangeLog 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/ChangeLog 2012-10-15 22:19:08 UTC (rev 131371)
@@ -1,3 +1,37 @@
+2012-10-15 Joshua Bell <jsb...@chromium.org>
+
+ IndexedDB: Pass type of error causing abort to IDBTransaction::onAbort
+ https://bugs.webkit.org/show_bug.cgi?id=99097
+
+ Reviewed by Tony Chang.
+
+ Include the error causing the abort in the callback from back end to
+ front end so it can be exposed on the IDBTransaction.error property.
+
+ Test: lazy-index-population.html
+
+ * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+ (WebCore::IDBDatabaseBackendImpl::setVersionInternal):
+ (WebCore::IDBDatabaseBackendImpl::setIntVersionInternal):
+ * Modules/indexeddb/IDBDatabaseCallbacks.h:
+ * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
+ (WebCore::IDBObjectStoreBackendImpl::putInternal):
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::onAbort):
+ * Modules/indexeddb/IDBTransaction.h:
+ (IDBTransaction):
+ * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
+ (WebCore::IDBTransactionBackendImpl::abort):
+ (WebCore):
+ (WebCore::IDBTransactionBackendImpl::commit):
+ * Modules/indexeddb/IDBTransactionBackendImpl.h:
+ (IDBTransactionBackendImpl):
+ * Modules/indexeddb/IDBTransactionCallbacks.h:
+ (IDBTransactionCallbacks):
+ * inspector/InspectorIndexedDBAgent.cpp:
+ (WebCore):
+
2012-10-15 Mike Reed <r...@google.com>
In Skia's ImageFrame, only set the isOpaque flag when the frame is complete
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp (131370 => 131371)
--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp 2012-10-15 22:19:08 UTC (rev 131371)
@@ -289,8 +289,9 @@
database->m_version = version;
database->m_intVersion = IDBDatabaseMetadata::NoIntVersion;
if (!database->m_backingStore->updateIDBDatabaseMetaData(transaction->backingStoreTransaction(), databaseId, database->m_version) || !database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
- transaction->abort();
+ RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage.");
+ callbacks->onError(error);
+ transaction->abort(error);
return;
}
callbacks->onSuccess(PassRefPtr<IDBTransactionBackendInterface>(transaction));
@@ -303,8 +304,9 @@
ASSERT(version > oldVersion);
database->m_intVersion = version;
if (!database->m_backingStore->updateIDBDatabaseIntVersion(transaction->backingStoreTransaction(), databaseId, database->m_intVersion)) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
- transaction->abort();
+ RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage.");
+ callbacks->onError(error);
+ transaction->abort(error);
return;
}
callbacks->onUpgradeNeeded(oldVersion, transaction, database);
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h (131370 => 131371)
--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h 2012-10-15 22:19:08 UTC (rev 131371)
@@ -28,6 +28,7 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBDatabaseError.h"
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp (131370 => 131371)
--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp 2012-10-15 22:19:08 UTC (rev 131371)
@@ -252,7 +252,7 @@
String errorMessage;
if (!makeIndexWriters(transaction, this, primaryKey, false, indexNames, indexKeys, &indexWriters, &errorMessage)) {
// FIXME: Need to deal with errorMessage here. makeIndexWriters only fails on uniqueness constraint errors.
- transaction->abort();
+ transaction->abort(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, "Duplicate index keys exist in the object store."));
return;
}
@@ -334,8 +334,9 @@
// Before this point, don't do any mutation. After this point, rollback the transaction in case of error.
if (!objectStore->backingStore()->putObjectStoreRecord(transaction->backingStoreTransaction(), objectStore->databaseId(), objectStore->id(), *key, value->toWireString(), recordIdentifier.get())) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
- transaction->abort();
+ RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage.");
+ callbacks->onError(error);
+ transaction->abort(error);
return;
}
@@ -348,8 +349,9 @@
objectStore->m_id,
objectStore->m_indexes.get(indexWriter->indexName())->id())) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage."));
- transaction->abort();
+ RefPtr<IDBDatabaseError> error = IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Error writing data to stable storage.");
+ callbacks->onError(error);
+ transaction->abort(error);
return;
}
}
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (131370 => 131371)
--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp 2012-10-15 22:19:08 UTC (rev 131371)
@@ -281,14 +281,14 @@
m_requestList.remove(request);
}
-void IDBTransaction::onAbort()
+void IDBTransaction::onAbort(PassRefPtr<IDBDatabaseError> error)
{
IDB_TRACE("IDBTransaction::onAbort");
ASSERT(m_state != Finished);
if (m_state != Finishing) {
- // FIXME: Propagate true cause from back end (e.g. QuotaError, UnknownError, etc.)
- setError(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::UNKNOWN_ERR)));
+ ASSERT(error.get());
+ setError(DOMError::create(error->name()));
// Abort was not triggered by front-end, so outstanding requests must
// be aborted now.
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h (131370 => 131371)
--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h 2012-10-15 22:19:08 UTC (rev 131371)
@@ -104,7 +104,7 @@
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
// IDBTransactionCallbacks
- virtual void onAbort();
+ virtual void onAbort(PassRefPtr<IDBDatabaseError>);
virtual void onComplete();
// EventTarget
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp (131370 => 131371)
--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp 2012-10-15 22:19:08 UTC (rev 131371)
@@ -111,6 +111,11 @@
void IDBTransactionBackendImpl::abort()
{
+ abort(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
+}
+
+void IDBTransactionBackendImpl::abort(PassRefPtr<IDBDatabaseError> error)
+{
IDB_TRACE("IDBTransactionBackendImpl::abort");
if (m_state == Finished)
return;
@@ -149,7 +154,7 @@
m_database->transactionFinished(this);
if (m_callbacks)
- m_callbacks->onAbort();
+ m_callbacks->onAbort(error);
m_database->transactionFinishedAndAbortFired(this);
@@ -238,7 +243,7 @@
m_callbacks->onComplete();
m_database->transactionFinishedAndCompleteFired(this);
} else {
- m_callbacks->onAbort();
+ m_callbacks->onAbort(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
m_database->transactionFinishedAndAbortFired(this);
}
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h (131370 => 131371)
--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h 2012-10-15 22:19:08 UTC (rev 131371)
@@ -30,6 +30,7 @@
#include "DOMStringList.h"
#include "IDBBackingStore.h"
+#include "IDBDatabaseError.h"
#include "IDBTransactionBackendInterface.h"
#include "IDBTransactionCallbacks.h"
#include "Timer.h"
@@ -56,6 +57,7 @@
virtual void abort();
virtual void setCallbacks(IDBTransactionCallbacks* callbacks) { m_callbacks = callbacks; }
+ void abort(PassRefPtr<IDBDatabaseError>);
void run();
unsigned short mode() const { return m_mode; }
bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task> task, PassOwnPtr<ScriptExecutionContext::Task> abortTask = nullptr) { return scheduleTask(NormalTask, task, abortTask); }
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionCallbacks.h (131370 => 131371)
--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionCallbacks.h 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionCallbacks.h 2012-10-15 22:19:08 UTC (rev 131371)
@@ -31,6 +31,7 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBDatabaseError.h"
#include <wtf/RefCounted.h>
namespace WebCore {
@@ -39,7 +40,7 @@
public:
virtual ~IDBTransactionCallbacks() { }
- virtual void onAbort() = 0;
+ virtual void onAbort(PassRefPtr<IDBDatabaseError>) = 0;
virtual void onComplete() = 0;
};
Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (131370 => 131371)
--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2012-10-15 22:19:08 UTC (rev 131371)
@@ -133,7 +133,7 @@
virtual ~InspectorIDBTransactionCallback() { }
- virtual void onAbort() { }
+ virtual void onAbort(PassRefPtr<IDBDatabaseError>) { }
virtual void onComplete() { }
private:
InspectorIDBTransactionCallback() { }
Modified: trunk/Source/WebKit/chromium/ChangeLog (131370 => 131371)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-10-15 22:19:08 UTC (rev 131371)
@@ -1,3 +1,25 @@
+2012-10-15 Joshua Bell <jsb...@chromium.org>
+
+ IndexedDB: Pass type of error causing abort to IDBTransaction::onAbort
+ https://bugs.webkit.org/show_bug.cgi?id=99097
+
+ Reviewed by Tony Chang.
+
+ Plumbing to pass details about the cause of the transaction abort through to the
+ front end.
+
+ * public/WebIDBTransactionCallbacks.h:
+ (WebKit):
+ (WebKit::WebIDBTransactionCallbacks::onAbort):
+ * src/IDBTransactionCallbacksProxy.cpp:
+ (WebKit::IDBTransactionCallbacksProxy::onAbort):
+ * src/IDBTransactionCallbacksProxy.h:
+ (IDBTransactionCallbacksProxy):
+ * src/WebIDBTransactionCallbacksImpl.cpp:
+ (WebKit::WebIDBTransactionCallbacksImpl::onAbort):
+ * src/WebIDBTransactionCallbacksImpl.h:
+ (WebIDBTransactionCallbacksImpl):
+
2012-10-15 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed. Rolled DEPS.
Modified: trunk/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp (131370 => 131371)
--- trunk/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp 2012-10-15 22:19:08 UTC (rev 131371)
@@ -31,6 +31,8 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBDatabaseError.h"
+#include "WebIDBDatabaseError.h"
#include "WebIDBTransactionCallbacks.h"
using namespace WebCore;
@@ -51,9 +53,9 @@
{
}
-void IDBTransactionCallbacksProxy::onAbort()
+void IDBTransactionCallbacksProxy::onAbort(PassRefPtr<IDBDatabaseError> idbDatabaseError)
{
- m_callbacks->onAbort();
+ m_callbacks->onAbort(WebIDBDatabaseError(idbDatabaseError));
}
void IDBTransactionCallbacksProxy::onComplete()
Modified: trunk/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h (131370 => 131371)
--- trunk/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h 2012-10-15 22:19:08 UTC (rev 131371)
@@ -44,7 +44,7 @@
static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebIDBTransactionCallbacks>);
virtual ~IDBTransactionCallbacksProxy();
- virtual void onAbort();
+ virtual void onAbort(PassRefPtr<WebCore::IDBDatabaseError>);
virtual void onComplete();
private:
Modified: trunk/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp (131370 => 131371)
--- trunk/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp 2012-10-15 22:19:08 UTC (rev 131371)
@@ -28,7 +28,9 @@
#if ENABLE(INDEXED_DATABASE)
+#include "IDBDatabaseError.h"
#include "IDBTransactionCallbacks.h"
+#include "WebIDBDatabaseError.h"
using namespace WebCore;
@@ -43,9 +45,9 @@
{
}
-void WebIDBTransactionCallbacksImpl::onAbort()
+void WebIDBTransactionCallbacksImpl::onAbort(const WebIDBDatabaseError& error)
{
- m_callbacks->onAbort();
+ m_callbacks->onAbort(error);
}
void WebIDBTransactionCallbacksImpl::onComplete()
Modified: trunk/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h (131370 => 131371)
--- trunk/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h 2012-10-15 22:15:46 UTC (rev 131370)
+++ trunk/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h 2012-10-15 22:19:08 UTC (rev 131371)
@@ -41,7 +41,7 @@
WebIDBTransactionCallbacksImpl(PassRefPtr<WebCore::IDBTransactionCallbacks>);
virtual ~WebIDBTransactionCallbacksImpl();
- virtual void onAbort();
+ virtual void onAbort(const WebIDBDatabaseError&);
virtual void onComplete();
private: