diff options
author | jsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-28 19:44:06 +0000 |
---|---|---|
committer | jsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-28 19:44:06 +0000 |
commit | e2bd079d48698a45c7b65217e60a36f5512419b7 (patch) | |
tree | c7b261e90c8c3eb0287eb56a45a5c2f57174b329 | |
parent | 41c5a3638e3effed8085314bcd45bbbf112c34f3 (diff) | |
download | chromium_src-e2bd079d48698a45c7b65217e60a36f5512419b7.zip chromium_src-e2bd079d48698a45c7b65217e60a36f5512419b7.tar.gz chromium_src-e2bd079d48698a45c7b65217e60a36f5512419b7.tar.bz2 |
IndexedDB: IPC plumbing for WebIDBTransaction::commit()
WebKit patch http://webkit.org/b/89379 requires the ability for IDBTransaction front-ends to trigger the commit of transactions, which mandates plumbing of the WebKit::WebIDBTransaction::commit() call through the IPC layers. Nothing exciting in this patch itself.
R=jam@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10692017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144778 0039d316-1c4b-4281-b951-d872f2087c98
7 files changed, 32 insertions, 16 deletions
diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc index 8c217e0..080a564 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -1068,6 +1068,7 @@ bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( bool handled = true; IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::TransactionDispatcherHost, message, *msg_is_ok) + IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionCommit, OnCommit) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionMode, OnMode) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStore, OnObjectStore) @@ -1084,6 +1085,16 @@ void IndexedDBDispatcherHost::TransactionDispatcherHost::Send( parent_->Send(message); } +void IndexedDBDispatcherHost::TransactionDispatcherHost::OnCommit( + int32 transaction_id) { + WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( + &map_, transaction_id); + if (!idb_transaction) + return; + + idb_transaction->commit(); +} + void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( int32 transaction_id) { WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h index 07010d9..c9f7de11 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -283,7 +283,7 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter { bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); void Send(IPC::Message* message); - // TODO: add the rest of the transaction methods. + void OnCommit(int32 transaction_id); void OnAbort(int32 transaction_id); void OnMode(int32 transaction_id, int* mode); void OnObjectStore(int32 transaction_id, diff --git a/content/browser/in_process_webkit/indexed_db_layout_browsertest.cc b/content/browser/in_process_webkit/indexed_db_layout_browsertest.cc index a082903..420a8f0 100644 --- a/content/browser/in_process_webkit/indexed_db_layout_browsertest.cc +++ b/content/browser/in_process_webkit/indexed_db_layout_browsertest.cc @@ -74,9 +74,10 @@ static const char* kKeyTests[] = { static const char* kTransactionTests[] = { // "transaction-abort.html", // Flaky, http://crbug.com/83226 - "transaction-abort-with-js-recursion-cross-frame.html", - "transaction-abort-with-js-recursion.html", - "transaction-abort-workers.html", +// TODO(jsbell): Re-enable the following 3 tests after http://webkit.org/b/89379 lands. +// "transaction-complete-with-js-recursion-cross-frame.html", +// "transaction-complete-with-js-recursion.html", +// "transaction-complete-workers.html", "transaction-after-close.html", "transaction-and-objectstore-calls.html", "transaction-basics.html", diff --git a/content/common/indexed_db/indexed_db_messages.h b/content/common/indexed_db/indexed_db_messages.h index b430720..4c80eef 100644 --- a/content/common/indexed_db/indexed_db_messages.h +++ b/content/common/indexed_db/indexed_db_messages.h @@ -509,6 +509,10 @@ IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_TransactionMode, int32, /* idb_transaction_id */ int /* mode */) +// WebIDBTransaction::commit() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionCommit, + int32 /* idb_transaction_id */) + // WebIDBTransaction::abort() message. IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionAbort, int32 /* idb_transaction_id */) diff --git a/content/common/indexed_db/proxy_webidbcursor_impl.cc b/content/common/indexed_db/proxy_webidbcursor_impl.cc index c904000..90325a6 100644 --- a/content/common/indexed_db/proxy_webidbcursor_impl.cc +++ b/content/common/indexed_db/proxy_webidbcursor_impl.cc @@ -121,8 +121,7 @@ void RendererWebIDBCursorImpl::deleteFunction(WebIDBCallbacks* callbacks, dispatcher->RequestIDBCursorDelete(callbacks, idb_cursor_id_, &ec); } -void RendererWebIDBCursorImpl::postSuccessHandlerCallback() -{ +void RendererWebIDBCursorImpl::postSuccessHandlerCallback() { pending_onsuccess_callbacks_--; // If the onsuccess callback called continue() on the cursor again, diff --git a/content/common/indexed_db/proxy_webidbtransaction_impl.cc b/content/common/indexed_db/proxy_webidbtransaction_impl.cc index 2a08b02..75d4743 100644 --- a/content/common/indexed_db/proxy_webidbtransaction_impl.cc +++ b/content/common/indexed_db/proxy_webidbtransaction_impl.cc @@ -30,8 +30,7 @@ RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { idb_transaction_id_)); } -int RendererWebIDBTransactionImpl::mode() const -{ +int RendererWebIDBTransactionImpl::mode() const { int mode; IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionMode( idb_transaction_id_, &mode)); @@ -40,8 +39,7 @@ int RendererWebIDBTransactionImpl::mode() const WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( const WebString& name, - WebKit::WebExceptionCode& ec) -{ + WebKit::WebExceptionCode& ec) { int object_store_id; IndexedDBDispatcher::Send( new IndexedDBHostMsg_TransactionObjectStore( @@ -51,22 +49,24 @@ WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( return new RendererWebIDBObjectStoreImpl(object_store_id); } -void RendererWebIDBTransactionImpl::abort() -{ +void RendererWebIDBTransactionImpl::commit() { + IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionCommit( + idb_transaction_id_)); +} + +void RendererWebIDBTransactionImpl::abort() { IndexedDBDispatcher::Send(new IndexedDBHostMsg_TransactionAbort( idb_transaction_id_)); } -void RendererWebIDBTransactionImpl::didCompleteTaskEvents() -{ +void RendererWebIDBTransactionImpl::didCompleteTaskEvents() { IndexedDBDispatcher::Send( new IndexedDBHostMsg_TransactionDidCompleteTaskEvents( idb_transaction_id_)); } void RendererWebIDBTransactionImpl::setCallbacks( - WebIDBTransactionCallbacks* callbacks) -{ + WebIDBTransactionCallbacks* callbacks) { IndexedDBDispatcher* dispatcher = IndexedDBDispatcher::ThreadSpecificInstance(); dispatcher->RegisterWebIDBTransactionCallbacks(callbacks, diff --git a/content/common/indexed_db/proxy_webidbtransaction_impl.h b/content/common/indexed_db/proxy_webidbtransaction_impl.h index abe4134..4ddfd48 100644 --- a/content/common/indexed_db/proxy_webidbtransaction_impl.h +++ b/content/common/indexed_db/proxy_webidbtransaction_impl.h @@ -23,6 +23,7 @@ class RendererWebIDBTransactionImpl : public WebKit::WebIDBTransaction { virtual int mode() const; virtual WebKit::WebIDBObjectStore* objectStore(const WebKit::WebString& name, WebKit::WebExceptionCode&); + virtual void commit(); virtual void abort(); virtual void didCompleteTaskEvents(); virtual void setCallbacks(WebKit::WebIDBTransactionCallbacks*); |