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

Unified Diff: chrome/renderer/indexed_db_dispatcher.cc

Issue 3165026: [IndexedDB] Add transaction coordinator. (Closed)
Patch Set: Fix Jeremy's comments Created 10 years, 4 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
Index: chrome/renderer/indexed_db_dispatcher.cc
diff --git a/chrome/renderer/indexed_db_dispatcher.cc b/chrome/renderer/indexed_db_dispatcher.cc
index a0595127a4f710496fe9b45f06c3dca12a18c5af..4d88bba1fa654b622664f2005257e3a5af08a202 100644
--- a/chrome/renderer/indexed_db_dispatcher.cc
+++ b/chrome/renderer/indexed_db_dispatcher.cc
@@ -44,6 +44,8 @@ bool IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) {
OnSuccessSerializedScriptValue)
IPC_MESSAGE_HANDLER(ViewMsg_IDBCallbacksError,
OnError)
+ IPC_MESSAGE_HANDLER(ViewMsg_IDBTransactionCallbacksAbort,
+ OnAbort)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -155,6 +157,12 @@ void IndexedDBDispatcher::RequestIDBObjectStoreRemoveIndex(
name));
}
+void IndexedDBDispatcher::RequestIDBTransactionSetCallbacks(
+ WebKit::WebIDBTransactionCallbacks* callbacks) {
+ pending_transaction_callbacks_.AddWithID(callbacks, callbacks->id());
+}
+
+
void IndexedDBDispatcher::OnSuccessNull(int32 response_id) {
WebKit::WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
callbacks->onSuccess();
@@ -202,3 +210,11 @@ void IndexedDBDispatcher::OnError(int32 response_id, int code,
callbacks->onError(WebIDBDatabaseError(code, message));
pending_callbacks_.Remove(response_id);
}
+
+void IndexedDBDispatcher::OnAbort(int transaction_id) {
+ WebKit::WebIDBTransactionCallbacks* callbacks =
+ pending_transaction_callbacks_.Lookup(transaction_id);
+ DCHECK(callbacks);
+ callbacks->onAbort();
+ pending_transaction_callbacks_.Remove(transaction_id);
+}

Powered by Google App Engine
This is Rietveld 408576698