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

Unified Diff: content/common/indexed_db/indexed_db_dispatcher.cc

Issue 11114022: IndexedDB: Plumbing to allow cause of transaction abort to be passed to script (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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 | « content/common/indexed_db/indexed_db_dispatcher.h ('k') | content/common/indexed_db/indexed_db_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/indexed_db/indexed_db_dispatcher.cc
diff --git a/content/common/indexed_db/indexed_db_dispatcher.cc b/content/common/indexed_db/indexed_db_dispatcher.cc
index 4a31ca0c8f165e373381201b875961effdf27928..ccd1152d7cc4ac929bed64d8bdf0bcdb537062f4 100644
--- a/content/common/indexed_db/indexed_db_dispatcher.cc
+++ b/content/common/indexed_db/indexed_db_dispatcher.cc
@@ -105,6 +105,8 @@ void IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksBlocked, OnBlocked)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksIntBlocked, OnIntBlocked)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksUpgradeNeeded, OnUpgradeNeeded)
+ IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksAbortLegacy,
+ OnAbortLegacy)
IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksAbort, OnAbort)
IPC_MESSAGE_HANDLER(IndexedDBMsg_TransactionCallbacksComplete, OnComplete)
IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksForcedClose,
@@ -687,7 +689,8 @@ void IndexedDBDispatcher::OnError(int32 thread_id, int32 response_id, int code,
pending_callbacks_.Remove(response_id);
}
-void IndexedDBDispatcher::OnAbort(int32 thread_id, int32 transaction_id) {
+// TODO(jsbell): Remove once WK99097 has landed.
+void IndexedDBDispatcher::OnAbortLegacy(int32 thread_id, int32 transaction_id) {
DCHECK_EQ(thread_id, CurrentWorkerId());
WebIDBTransactionCallbacks* callbacks =
pending_transaction_callbacks_.Lookup(transaction_id);
@@ -697,6 +700,17 @@ void IndexedDBDispatcher::OnAbort(int32 thread_id, int32 transaction_id) {
pending_transaction_callbacks_.Remove(transaction_id);
}
+void IndexedDBDispatcher::OnAbort(int32 thread_id, int32 transaction_id,
+ int code, const string16& message) {
+ DCHECK_EQ(thread_id, CurrentWorkerId());
+ WebIDBTransactionCallbacks* callbacks =
+ pending_transaction_callbacks_.Lookup(transaction_id);
+ if (!callbacks)
+ return;
+ callbacks->onAbort(WebIDBDatabaseError(code, message));
+ pending_transaction_callbacks_.Remove(transaction_id);
+}
+
void IndexedDBDispatcher::OnComplete(int32 thread_id, int32 transaction_id) {
DCHECK_EQ(thread_id, CurrentWorkerId());
WebIDBTransactionCallbacks* callbacks =
« no previous file with comments | « content/common/indexed_db/indexed_db_dispatcher.h ('k') | content/common/indexed_db/indexed_db_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698