diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 19:27:51 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 19:27:51 +0000 |
commit | de9b8a94dfd440760cf78d46df6f21f51c3590bb (patch) | |
tree | 46e9b1b2b8471d9b0d6cf79d27b5669be83e49b8 /chrome | |
parent | 07ec1df8020cf3d64e7bb4d385442ef3d7f3ff3b (diff) | |
download | chromium_src-de9b8a94dfd440760cf78d46df6f21f51c3590bb.zip chromium_src-de9b8a94dfd440760cf78d46df6f21f51c3590bb.tar.gz chromium_src-de9b8a94dfd440760cf78d46df6f21f51c3590bb.tar.bz2 |
Land 6266021 for David.
Plumbing for initial close() support for indexed db.
BUG=64049
TEST=browser_tests --gtest_filter=IndexedDBBrowserTest.*
Review URL: http://codereview.chromium.org/6348027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
5 files changed, 23 insertions, 3 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 05de7c3..f7461a7 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -287,6 +287,7 @@ bool IndexedDBDispatcherHost::DatabaseDispatcherHost::OnMessageReceived( OnDeleteObjectStore) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseSetVersion, OnSetVersion) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseTransaction, OnTransaction) + IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseClose, OnClose) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDestroyed, OnDestroyed) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() @@ -400,7 +401,14 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnTransaction( *idb_transaction_id = *ec ? 0 : parent_->Add(transaction); } -void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed( +void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnClose( + int32 idb_database_id) { + WebIDBDatabase* database = parent_->GetOrTerminateProcess( + &map_, idb_database_id); + database->close(); +} + + void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed( int32 object_id) { parent_->DestroyObject(&map_, object_id); } 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 1559fe1..8bc3f1a 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -105,6 +105,7 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { int32 mode, int32 timeout, int32* idb_transaction_id, WebKit::WebExceptionCode* ec); + void OnClose(int32 idb_database_id); void OnDestroyed(int32 idb_database_id); IndexedDBDispatcherHost* parent_; diff --git a/chrome/common/indexed_db_messages.h b/chrome/common/indexed_db_messages.h index 7b920f7..72d71ea7 100644 --- a/chrome/common/indexed_db_messages.h +++ b/chrome/common/indexed_db_messages.h @@ -343,6 +343,10 @@ IPC_SYNC_MESSAGE_CONTROL4_2(IndexedDBHostMsg_DatabaseTransaction, int32, /* idb_transaction_id */ WebKit::WebExceptionCode /* ec */) +// WebIDBDatabase::close() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseClose, + int32 /* idb_database_id */) + // WebIDBDatabase::~WebIDBDatabase() message. IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseDestroyed, int32 /* idb_database_id */) diff --git a/chrome/renderer/renderer_webidbdatabase_impl.cc b/chrome/renderer/renderer_webidbdatabase_impl.cc index 78bb24c..9f37018 100644 --- a/chrome/renderer/renderer_webidbdatabase_impl.cc +++ b/chrome/renderer/renderer_webidbdatabase_impl.cc @@ -26,7 +26,7 @@ RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(int32 idb_database_id) RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() { // It's not possible for there to be pending callbacks that address this - // object since inside WebKit, they hold a reference to the object wich owns + // object since inside WebKit, they hold a reference to the object which owns // this object. But, if that ever changed, then we'd need to invalidate // any such pointers. RenderThread::current()->Send(new IndexedDBHostMsg_DatabaseDestroyed( @@ -74,7 +74,8 @@ WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore( int object_store; RenderThread::current()->Send( - new IndexedDBHostMsg_DatabaseCreateObjectStore(params, &object_store, &ec)); + new IndexedDBHostMsg_DatabaseCreateObjectStore( + params, &object_store, &ec)); if (!object_store) return NULL; return new RendererWebIDBObjectStoreImpl(object_store); @@ -119,3 +120,8 @@ WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::transaction( return NULL; return new RendererWebIDBTransactionImpl(transaction_id); } + +void RendererWebIDBDatabaseImpl::close() { + RenderThread::current()->Send( + new IndexedDBHostMsg_DatabaseClose(idb_database_id_)); +} diff --git a/chrome/renderer/renderer_webidbdatabase_impl.h b/chrome/renderer/renderer_webidbdatabase_impl.h index 24552e7..0912b63 100644 --- a/chrome/renderer/renderer_webidbdatabase_impl.h +++ b/chrome/renderer/renderer_webidbdatabase_impl.h @@ -43,6 +43,7 @@ class RendererWebIDBDatabaseImpl : public WebKit::WebIDBDatabase { const WebKit::WebDOMStringList& names, unsigned short mode, unsigned long timeout, WebKit::WebExceptionCode& ec); + virtual void close(); private: int32 idb_database_id_; |