diff options
author | andreip@chromium.org <andreip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 10:30:15 +0000 |
---|---|---|
committer | andreip@chromium.org <andreip@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 10:30:15 +0000 |
commit | cb40fd2e6057b3d6b1fa4329b4fdffb9c271cc93 (patch) | |
tree | 16f47c63c7c7867418cac3cb8a19881602ff75af | |
parent | cf62b32198e4a3f809b5656369d4f30e6e41a82d (diff) | |
download | chromium_src-cb40fd2e6057b3d6b1fa4329b4fdffb9c271cc93.zip chromium_src-cb40fd2e6057b3d6b1fa4329b4fdffb9c271cc93.tar.gz chromium_src-cb40fd2e6057b3d6b1fa4329b4fdffb9c271cc93.tar.bz2 |
Add plumbing for IDBTransaction::abort()
BUG=
TEST=
Review URL: http://codereview.chromium.org/3441019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60274 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 19 insertions, 2 deletions
diff --git a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc index 958eb4f..292bbc0 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -141,6 +141,7 @@ bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) { case ViewHostMsg_IDBObjectStoreRemoveIndex::ID: case ViewHostMsg_IDBObjectStoreOpenCursor::ID: case ViewHostMsg_IDBObjectStoreDestroyed::ID: + case ViewHostMsg_IDBTransactionAbort::ID: case ViewHostMsg_IDBTransactionDestroyed::ID: case ViewHostMsg_IDBTransactionObjectStore::ID: break; @@ -923,6 +924,7 @@ bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( bool handled = true; IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::TransactionDispatcherHost, message, *msg_is_ok) + IPC_MESSAGE_HANDLER(ViewHostMsg_IDBTransactionAbort, OnAbort) IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBTransactionObjectStore, OnObjectStore) IPC_MESSAGE_HANDLER(ViewHostMsg_IDBTransactionDestroyed, OnDestroyed) @@ -939,6 +941,16 @@ void IndexedDBDispatcherHost::TransactionDispatcherHost::Send( parent_->Send(message); } +void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( + int32 transaction_id) { + WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( + &map_, transaction_id, 0, ViewHostMsg_IDBTransactionAbort::ID); + if (!idb_transaction) + return; + + idb_transaction->abort(); +} + void IndexedDBDispatcherHost::TransactionDispatcherHost::OnObjectStore( int32 transaction_id, const string16& name, IPC::Message* reply_msg) { WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( diff --git a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h index dc0bc47..654b3ab 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -213,6 +213,7 @@ class IndexedDBDispatcherHost void Send(IPC::Message* message); // TODO: add the rest of the transaction methods. + void OnAbort(int32 transaction_id); void OnObjectStore(int32 transaction_id, const string16& name, IPC::Message* reply_msg); void OnDestroyed(int32 idb_transaction_id); diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 612d662..969ea16 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -2547,6 +2547,10 @@ IPC_BEGIN_MESSAGES(ViewHost) string16, /* name */ int32 /* object_store_id */) + // WebIDBTransaction::abort() message. + IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionAbort, + int32 /* idb_transaction_id */) + // WebIDBTransaction::~WebIDBTransaction() message. IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionDestroyed, int32 /* idb_transaction_id */) diff --git a/chrome/renderer/renderer_webidbtransaction_impl.cc b/chrome/renderer/renderer_webidbtransaction_impl.cc index 230237f..dddb2d2 100644 --- a/chrome/renderer/renderer_webidbtransaction_impl.cc +++ b/chrome/renderer/renderer_webidbtransaction_impl.cc @@ -45,8 +45,8 @@ WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( void RendererWebIDBTransactionImpl::abort() { - // TODO: implement - DCHECK(false); + RenderThread::current()->Send(new ViewHostMsg_IDBTransactionAbort( + idb_transaction_id_)); } int RendererWebIDBTransactionImpl::id() const |