From bcd295e06f3ce0359157472b94dd39b1c35086b5 Mon Sep 17 00:00:00 2001 From: "alecflett@chromium.org" Date: Tue, 13 Nov 2012 16:34:37 +0000 Subject: [PATCH] Remove legacy IDB backend IPC glue for string-based references. Now that webkit is using the int64-based references for objects, remove the glue code. BUG= Review URL: https://chromiumcodereview.appspot.com/11312178 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167396 0039d316-1c4b-4281-b951-d872f2087c98 --- .../indexed_db_dispatcher_host.cc | 162 ------------------ .../indexed_db_dispatcher_host.h | 33 ---- .../indexed_db/indexed_db_dispatcher.cc | 40 ----- .../common/indexed_db/indexed_db_dispatcher.h | 11 -- .../indexed_db_dispatcher_unittest.cc | 11 +- .../common/indexed_db/indexed_db_messages.h | 67 -------- .../indexed_db/proxy_webidbdatabase_impl.cc | 28 --- .../indexed_db/proxy_webidbdatabase_impl.h | 8 - .../proxy_webidbobjectstore_impl.cc | 79 --------- .../indexed_db/proxy_webidbobjectstore_impl.h | 21 --- .../proxy_webidbtransaction_impl.cc | 12 -- .../indexed_db/proxy_webidbtransaction_impl.h | 2 - 12 files changed, 5 insertions(+), 469 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 f238b1b489281f..ae5e92ed38af91 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -311,13 +311,9 @@ bool IndexedDBDispatcherHost::DatabaseDispatcherHost::OnMessageReceived( IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseMetadata, OnMetadata) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateObjectStore, OnCreateObjectStore) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteObjectStoreOld, - OnDeleteObjectStoreOld) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteObjectStore, OnDeleteObjectStore) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseSetVersion, OnSetVersion) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseTransactionOld, - OnTransactionOld) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseTransaction, OnTransaction) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseClose, OnClose) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDestroyed, OnDestroyed) @@ -392,23 +388,6 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( } } -void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDeleteObjectStoreOld( - int32 idb_database_id, - const string16& name, - int32 transaction_id, - WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( - &map_, idb_database_id); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, transaction_id); - if (!idb_database || !idb_transaction) - return; - - *ec = 0; - idb_database->deleteObjectStore(name, *idb_transaction, *ec); -} - void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDeleteObjectStore( int32 idb_database_id, int64 index_id, @@ -446,33 +425,6 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnSetVersion( *ec); } -void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnTransactionOld( - int32 thread_id, - int32 idb_database_id, - const std::vector& names, - int32 mode, - int32* idb_transaction_id, - WebKit::WebExceptionCode* ec) { - WebIDBDatabase* database = parent_->GetOrTerminateProcess( - &map_, idb_database_id); - if (!database) - return; - - WebDOMStringList object_stores; - for (std::vector::const_iterator it = names.begin(); - it != names.end(); ++it) { - object_stores.append(*it); - } - - *ec = 0; - WebIDBTransaction* transaction = database->transaction( - object_stores, mode, *ec); - DCHECK(!transaction != !*ec); - *idb_transaction_id = - *ec ? 0 : parent_->Add(transaction, thread_id, - database_url_map_[idb_database_id]); -} - void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnTransaction( int32 thread_id, int32 idb_database_id, @@ -675,23 +627,15 @@ bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived( IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::ObjectStoreDispatcherHost, message, *msg_is_ok) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGet, OnGet) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePutOld, OnPutOld) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePut, OnPut) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreSetIndexKeysOld, - OnSetIndexKeysOld) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreSetIndexKeys, OnSetIndexKeys) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreSetIndexesReadyOld, - OnSetIndexesReadyOld) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreSetIndexesReady, OnSetIndexesReady) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDelete, OnDelete) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreClear, OnClear) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreCreateIndex, OnCreateIndex) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndexOld, OnIndexOld) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndex, OnIndex) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDeleteIndexOld, - OnDeleteIndexOld) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDeleteIndex, OnDeleteIndex) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreOpenCursor, OnOpenCursor) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreCount, OnCount) @@ -728,31 +672,6 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet( DCHECK(!ec); } -void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnPutOld( - const IndexedDBHostMsg_ObjectStorePutOld_Params& params) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( - &map_, params.object_store_ipc_id); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, params.transaction_id); - if (!idb_transaction || !idb_object_store) - return; - - WebKit::WebExceptionCode ec = 0; - scoped_ptr callbacks( - new IndexedDBCallbacks(parent_, params.thread_id, - params.response_id)); - idb_object_store->putWithIndexKeys(params.serialized_value, params.key, - params.put_mode, callbacks.release(), - *idb_transaction, params.index_names, - params.index_keys, ec); - DCHECK(!ec); - int64 size = UTF16ToUTF8(params.serialized_value.data()).size(); - WebIDBTransactionIDToSizeMap* map = - &parent_->transaction_dispatcher_host_->transaction_size_map_; - (*map)[params.transaction_id] += size; -} - void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnPut( const IndexedDBHostMsg_ObjectStorePut_Params& params) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); @@ -776,24 +695,6 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnPut( (*map)[params.transaction_id] += size; } -void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnSetIndexKeysOld( - int32 object_store_ipc_id, - const IndexedDBKey& primary_key, - const std::vector& index_names, - const std::vector >& index_keys, - int32 transaction_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( - &map_, object_store_ipc_id); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, transaction_id); - if (!idb_transaction || !idb_object_store) - return; - idb_object_store->setIndexKeys(primary_key, - WebVector(index_names), - index_keys, *idb_transaction); -} - void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnSetIndexKeys( int32 object_store_ipc_id, const IndexedDBKey& primary_key, @@ -812,22 +713,6 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnSetIndexKeys( index_keys, *idb_transaction); } -void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnSetIndexesReadyOld( - int32 object_store_ipc_id, - const std::vector& index_names, - int32 transaction_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( - &map_, object_store_ipc_id); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, transaction_id); - if (!idb_transaction || !idb_object_store) - return; - - idb_object_store->setIndexesReady(WebVector(index_names), - *idb_transaction); -} - void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnSetIndexesReady( int32 object_store_ipc_id, const std::vector& index_ids, @@ -912,21 +797,6 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCreateIndex( } } -void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndexOld( - int32 object_store_ipc_id, - const string16& name, - int32* idb_index_id, - WebKit::WebExceptionCode* ec) { - WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( - &map_, object_store_ipc_id); - if (!idb_object_store) - return; - - *ec = 0; - WebIDBIndex* index = idb_object_store->index(name, *ec); - *idb_index_id = parent_->Add(index); -} - void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndex( int32 object_store_ipc_id, int64 index_id, @@ -940,23 +810,6 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndex( *idb_index_id = parent_->Add(index); } -void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDeleteIndexOld( - int32 object_store_ipc_id, - const string16& name, - int32 transaction_id, - WebKit::WebExceptionCode* ec) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); - WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( - &map_, object_store_ipc_id); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, transaction_id); - if (!idb_object_store || !idb_transaction) - return; - - *ec = 0; - idb_object_store->deleteIndex(name, *idb_transaction, *ec); -} - void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDeleteIndex( int32 object_store_ipc_id, int64 index_id, @@ -1169,8 +1022,6 @@ bool IndexedDBDispatcherHost::TransactionDispatcherHost::OnMessageReceived( message, *msg_is_ok) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionCommit, OnCommit) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionAbort, OnAbort) - IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStoreOld, - OnObjectStoreOld) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionObjectStore, OnObjectStore) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, OnDidCompleteTaskEvents) @@ -1205,19 +1056,6 @@ void IndexedDBDispatcherHost::TransactionDispatcherHost::OnAbort( idb_transaction->abort(); } -void IndexedDBDispatcherHost::TransactionDispatcherHost::OnObjectStoreOld( - int32 transaction_id, const string16& name, int32* object_store_ipc_id, - WebKit::WebExceptionCode* ec) { - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &map_, transaction_id); - if (!idb_transaction) - return; - - *ec = 0; - WebIDBObjectStore* object_store = idb_transaction->objectStore(name, *ec); - *object_store_ipc_id = object_store ? parent_->Add(object_store) : 0; -} - void IndexedDBDispatcherHost::TransactionDispatcherHost::OnObjectStore( int32 transaction_id, int64 object_store_id, int32* object_store_ipc_id, WebKit::WebExceptionCode* ec) { 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 3c044280e3b9f5..da591a2b396ab2 100644 --- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -24,7 +24,6 @@ struct IndexedDBHostMsg_IndexOpenCursor_Params; struct IndexedDBHostMsg_ObjectStoreCount_Params; struct IndexedDBHostMsg_ObjectStoreCreateIndex_Params; struct IndexedDBHostMsg_ObjectStoreOpenCursor_Params; -struct IndexedDBHostMsg_ObjectStorePutOld_Params; struct IndexedDBHostMsg_ObjectStorePut_Params; namespace WebKit { @@ -117,10 +116,6 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { void OnCreateObjectStore( const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params, int32* object_store_id, WebKit::WebExceptionCode* ec); - void OnDeleteObjectStoreOld(int32 idb_database_id, - const string16& name, - int32 transaction_id, - WebKit::WebExceptionCode* ec); void OnDeleteObjectStore(int32 idb_database_id, int64 object_store_id, int32 transaction_id, @@ -130,12 +125,6 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { int32 response_id, const string16& version, WebKit::WebExceptionCode* ec); - void OnTransactionOld(int32 thread_id, - int32 idb_database_id, - const std::vector& names, - int32 mode, - int32* idb_transaction_id, - WebKit::WebExceptionCode* ec); void OnTransaction(int32 thread_id, int32 idb_database_id, const std::vector& names, @@ -191,23 +180,13 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { int32 response_id, const IndexedDBKeyRange& key_range, int32 transaction_id); - void OnPutOld(const IndexedDBHostMsg_ObjectStorePutOld_Params& params); void OnPut(const IndexedDBHostMsg_ObjectStorePut_Params& params); - void OnSetIndexKeysOld( - int32 idb_object_store_id, - const IndexedDBKey& primary_key, - const std::vector& index_names, - const std::vector >& index_keys, - int32 transaction_id); void OnSetIndexKeys( int32 idb_object_store_id, const IndexedDBKey& primary_key, const std::vector& index_ids, const std::vector >& index_keys, int32 transaction_id); - void OnSetIndexesReadyOld(int32 idb_object_store_id, - const std::vector& names, - int32 transaction_id); void OnSetIndexesReady(int32 idb_object_store_id, const std::vector& ids, int32 transaction_id); @@ -224,17 +203,9 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params, int32* index_id, WebKit::WebExceptionCode* ec); - void OnIndexOld(int32 idb_object_store_id, - const string16& name, - int32* idb_index_id, - WebKit::WebExceptionCode* ec); void OnIndex(int32 idb_object_store_id, int64 index_id, int32* idb_index_id); - void OnDeleteIndexOld(int32 idb_object_store_id, - const string16& name, - int32 transaction_id, - WebKit::WebExceptionCode* ec); void OnDeleteIndex(int32 idb_object_store_id, int64 index_id, int32 transaction_id, @@ -293,10 +264,6 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter { void OnCommit(int32 transaction_id); void OnAbort(int32 transaction_id); - void OnObjectStoreOld(int32 transaction_id, - const string16& name, - int32* object_store_ipc_id, - WebKit::WebExceptionCode* ec); void OnObjectStore(int32 transaction_id, int64 object_store_id, int32* object_store_ipc_id, diff --git a/content/common/indexed_db/indexed_db_dispatcher.cc b/content/common/indexed_db/indexed_db_dispatcher.cc index b72da1fd856816..b666afe444514f 100644 --- a/content/common/indexed_db/indexed_db_dispatcher.cc +++ b/content/common/indexed_db/indexed_db_dispatcher.cc @@ -393,46 +393,6 @@ void IndexedDBDispatcher::RequestIDBObjectStoreGet( key_range, TransactionId(transaction))); } -void IndexedDBDispatcher::RequestIDBObjectStorePut( - const SerializedScriptValue& value, - const IndexedDBKey& key, - WebKit::WebIDBObjectStore::PutMode put_mode, - WebIDBCallbacks* callbacks_ptr, - int32 object_store_ipc_id, - const WebIDBTransaction& transaction, - const WebKit::WebVector& index_names, - const WebKit::WebVector >& index_keys, - WebExceptionCode* ec) { - ResetCursorPrefetchCaches(); - scoped_ptr callbacks(callbacks_ptr); - if (!value.is_null() && - (value.data().length() * sizeof(char16)) > kMaxIDBValueSizeInBytes) { - *ec = WebKit::WebIDBDatabaseExceptionDataError; - return; - } - IndexedDBHostMsg_ObjectStorePutOld_Params params; - params.thread_id = CurrentWorkerId(); - params.object_store_ipc_id = object_store_ipc_id; - params.response_id = pending_callbacks_.Add(callbacks.release()); - params.serialized_value = value; - params.key = key; - params.put_mode = put_mode; - params.transaction_id = TransactionId(transaction); - params.index_names.resize(index_names.size()); - for (size_t i = 0; i < index_names.size(); ++i) { - params.index_names[i] = index_names[i]; - } - - params.index_keys.resize(index_keys.size()); - for (size_t i = 0; i < index_keys.size(); ++i) { - params.index_keys[i].resize(index_keys[i].size()); - for (size_t j = 0; j < index_keys[i].size(); ++j) { - params.index_keys[i][j] = IndexedDBKey(index_keys[i][j]); - } - } - Send(new IndexedDBHostMsg_ObjectStorePutOld(params)); -} - void IndexedDBDispatcher::RequestIDBObjectStorePut( const SerializedScriptValue& value, const IndexedDBKey& key, diff --git a/content/common/indexed_db/indexed_db_dispatcher.h b/content/common/indexed_db/indexed_db_dispatcher.h index b6b0c62982e047..331f092818915e 100644 --- a/content/common/indexed_db/indexed_db_dispatcher.h +++ b/content/common/indexed_db/indexed_db_dispatcher.h @@ -158,17 +158,6 @@ class CONTENT_EXPORT IndexedDBDispatcher const WebKit::WebIDBTransaction& transaction, WebKit::WebExceptionCode* ec); - void RequestIDBObjectStorePut( - const SerializedScriptValue& value, - const IndexedDBKey& key, - WebKit::WebIDBObjectStore::PutMode putMode, - WebKit::WebIDBCallbacks* callbacks, - int32 object_store_ipc_id, - const WebKit::WebIDBTransaction& transaction, - const WebKit::WebVector& indexNames, - const WebKit::WebVector >& indexKeys, - WebKit::WebExceptionCode* ec); - void RequestIDBObjectStorePut( const SerializedScriptValue& value, const IndexedDBKey& key, diff --git a/content/common/indexed_db/indexed_db_dispatcher_unittest.cc b/content/common/indexed_db/indexed_db_dispatcher_unittest.cc index 36f52ca4e18485..ed0bbfa9bbb562 100644 --- a/content/common/indexed_db/indexed_db_dispatcher_unittest.cc +++ b/content/common/indexed_db/indexed_db_dispatcher_unittest.cc @@ -22,7 +22,9 @@ class FakeWebIDBTransaction : public WebKit::WebIDBTransaction { FakeWebIDBTransaction() {} }; -TEST(IndexedDBDispatcherTest, ValueSizeTest) { +// TODO(alecflett): Reenable this test when IDB code in webkit +// enforces size limits. See http://crbug.com/160577 +TEST(IndexedDBDispatcherTest, DISABLED_ValueSizeTest) { string16 data; data.resize(kMaxIDBValueSizeInBytes / sizeof(char16) + 1, 'x'); const bool kIsNull = false; @@ -34,7 +36,6 @@ TEST(IndexedDBDispatcherTest, ValueSizeTest) { IndexedDBDispatcher dispatcher; IndexedDBKey key; key.SetNumber(0); - WebKit::WebExceptionCode ec = 0; dispatcher.RequestIDBObjectStorePut( value, key, @@ -42,10 +43,8 @@ TEST(IndexedDBDispatcherTest, ValueSizeTest) { static_cast(NULL), dummy_id, FakeWebIDBTransaction(), - WebVector(), - WebVector >(), - &ec); - EXPECT_NE(ec, 0); + WebVector(), + WebVector >()); } } diff --git a/content/common/indexed_db/indexed_db_messages.h b/content/common/indexed_db/indexed_db_messages.h index 01460d6f3987ff..12e929c7c0e9b7 100644 --- a/content/common/indexed_db/indexed_db_messages.h +++ b/content/common/indexed_db/indexed_db_messages.h @@ -107,29 +107,6 @@ IPC_STRUCT_BEGIN(IndexedDBHostMsg_IndexCount_Params) IPC_STRUCT_MEMBER(int, transaction_id) IPC_STRUCT_END() -// Used to set a value in an object store. -IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStorePutOld_Params) - // The object store's id. - IPC_STRUCT_MEMBER(int32, object_store_ipc_id) - // The id any response should contain. - IPC_STRUCT_MEMBER(int32, thread_id) - IPC_STRUCT_MEMBER(int32, response_id) - // The value to set. - IPC_STRUCT_MEMBER(content::SerializedScriptValue, serialized_value) - // The key to set it on (may not be "valid"/set in some cases). - IPC_STRUCT_MEMBER(content::IndexedDBKey, key) - // Whether this is an add or a put. - IPC_STRUCT_MEMBER(WebKit::WebIDBObjectStore::PutMode, put_mode) - // The names of the indexes used below. - IPC_STRUCT_MEMBER(std::vector, index_names) - // The keys for each index, such that each inner vector corresponds - // to each index named in index_names, respectively. - IPC_STRUCT_MEMBER(std::vector >, - index_keys) - // The transaction it's associated with. - IPC_STRUCT_MEMBER(int, transaction_id) -IPC_STRUCT_END() - // Used to set a value in an object store. IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStorePut_Params) // The object store's id. @@ -410,13 +387,6 @@ IPC_SYNC_MESSAGE_CONTROL1_2(IndexedDBHostMsg_DatabaseCreateObjectStore, int32, /* object_store_ipc_id */ WebKit::WebExceptionCode /* ec */) -// WebIDBDatabase::deleteObjectStore() message. -IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_DatabaseDeleteObjectStoreOld, - int32, /* idb_database_id */ - string16, /* name */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - // WebIDBDatabase::deleteObjectStore() message. IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_DatabaseDeleteObjectStore, int32, /* idb_database_id */ @@ -438,13 +408,6 @@ IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_DatabaseSetVersion, // IDs to temporary IDs. We can then update the transaction // to its real ID asynchronously. // (Or make the key a pair .) -IPC_SYNC_MESSAGE_CONTROL4_2(IndexedDBHostMsg_DatabaseTransactionOld, - int32, /* thread_id */ - int32, /* idb_database_id */ - std::vector, /* object_stores */ - int32, /* mode */ - int32, /* idb_transaction_id */ - WebKit::WebExceptionCode /* ec */) IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_DatabaseTransaction, int32, /* thread_id */ int32, /* idb_database_id */ @@ -501,19 +464,10 @@ IPC_MESSAGE_CONTROL5(IndexedDBHostMsg_ObjectStoreGet, int32) /* transaction_id */ // WebIDBObjectStore::put() message. -IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_ObjectStorePutOld, - IndexedDBHostMsg_ObjectStorePutOld_Params) IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_ObjectStorePut, IndexedDBHostMsg_ObjectStorePut_Params) // WebIDBObjectStore::setIndexKeys() message. -IPC_MESSAGE_CONTROL5(IndexedDBHostMsg_ObjectStoreSetIndexKeysOld, - int32, /* object_store_ipc_id */ - content::IndexedDBKey, /* primary_key */ - std::vector, /* index_names */ - std::vector >, - /* index_keys */ - int32 /* transaction_id */) IPC_MESSAGE_CONTROL5(IndexedDBHostMsg_ObjectStoreSetIndexKeys, int32, /* object_store_ipc_id */ content::IndexedDBKey, /* primary_key */ @@ -523,10 +477,6 @@ IPC_MESSAGE_CONTROL5(IndexedDBHostMsg_ObjectStoreSetIndexKeys, int32 /* transaction_id */) // WebIDBObjectStore::setIndexesReady() message. -IPC_MESSAGE_CONTROL3(IndexedDBHostMsg_ObjectStoreSetIndexesReadyOld, - int32, /* object_store_ipc_id */ - std::vector, /* index_names */ - int32 /* transaction_id */) IPC_MESSAGE_CONTROL3(IndexedDBHostMsg_ObjectStoreSetIndexesReady, int32, /* object_store_ipc_id */ std::vector, /* index_names */ @@ -554,22 +504,12 @@ IPC_SYNC_MESSAGE_CONTROL1_2(IndexedDBHostMsg_ObjectStoreCreateIndex, WebKit::WebExceptionCode /* ec */) // WebIDBObjectStore::index() message. -IPC_SYNC_MESSAGE_CONTROL2_2(IndexedDBHostMsg_ObjectStoreIndexOld, - int32, /* object_store_ipc_id */ - string16, /* name */ - int32, /* idb_index_id */ - WebKit::WebExceptionCode /* ec */) IPC_SYNC_MESSAGE_CONTROL2_1(IndexedDBHostMsg_ObjectStoreIndex, int32, /* object_store_ipc_id */ int64, /* name */ int32) /* idb_index_id */ // WebIDBObjectStore::deleteIndex() message. -IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_ObjectStoreDeleteIndexOld, - int32, /* object_store_ipc_id */ - string16, /* name */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_ObjectStoreDeleteIndex, int32, /* object_store_ipc_id */ int64, /* object_store_id */ @@ -592,13 +532,6 @@ IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_ObjectStoreDestroyed, IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, int32 /* idb_cursor_id */) -// IDBTransaction::ObjectStore message. -IPC_SYNC_MESSAGE_CONTROL2_2(IndexedDBHostMsg_TransactionObjectStoreOld, - int32, /* transaction_id */ - string16, /* name */ - int32, /* object_store_ipc_id */ - WebKit::WebExceptionCode /* ec */) - // IDBTransaction::ObjectStore message. IPC_SYNC_MESSAGE_CONTROL2_2(IndexedDBHostMsg_TransactionObjectStore, int32, /* transaction_id */ diff --git a/content/common/indexed_db/proxy_webidbdatabase_impl.cc b/content/common/indexed_db/proxy_webidbdatabase_impl.cc index 215606736bc631..881af7c3f76f9f 100644 --- a/content/common/indexed_db/proxy_webidbdatabase_impl.cc +++ b/content/common/indexed_db/proxy_webidbdatabase_impl.cc @@ -116,16 +116,6 @@ WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore( return new RendererWebIDBObjectStoreImpl(object_store); } -void RendererWebIDBDatabaseImpl::deleteObjectStore( - const WebString& name, - const WebIDBTransaction& transaction, - WebExceptionCode& ec) { - IndexedDBDispatcher::Send( - new IndexedDBHostMsg_DatabaseDeleteObjectStoreOld( - idb_database_id_, name, - IndexedDBDispatcher::TransactionId(transaction), &ec)); -} - void RendererWebIDBDatabaseImpl::deleteObjectStore( long long object_store_id, const WebIDBTransaction& transaction, @@ -146,24 +136,6 @@ void RendererWebIDBDatabaseImpl::setVersion( version, callbacks, idb_database_id_, &ec); } -WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::transaction( - const WebDOMStringList& names, - unsigned short mode, - WebExceptionCode& ec) { - std::vector object_stores; - object_stores.reserve(names.length()); - for (unsigned int i = 0; i < names.length(); ++i) - object_stores.push_back(names.item(i)); - - int transaction_id; - IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseTransactionOld( - WorkerTaskRunner::Instance()->CurrentWorkerId(), - idb_database_id_, object_stores, mode, &transaction_id, &ec)); - if (!transaction_id) - return NULL; - return new RendererWebIDBTransactionImpl(transaction_id); -} - WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::transaction( const WebVector& object_store_ids, unsigned short mode) { diff --git a/content/common/indexed_db/proxy_webidbdatabase_impl.h b/content/common/indexed_db/proxy_webidbdatabase_impl.h index bfc1c3d049cd21..52778576bd7d7a 100644 --- a/content/common/indexed_db/proxy_webidbdatabase_impl.h +++ b/content/common/indexed_db/proxy_webidbdatabase_impl.h @@ -35,10 +35,6 @@ class RendererWebIDBDatabaseImpl : public WebKit::WebIDBDatabase { bool auto_increment, const WebKit::WebIDBTransaction& transaction, WebKit::WebExceptionCode& ec); - virtual void deleteObjectStore( - const WebKit::WebString& name, - const WebKit::WebIDBTransaction& transaction, - WebKit::WebExceptionCode& ec); virtual void deleteObjectStore( long long object_store_id, const WebKit::WebIDBTransaction& transaction, @@ -46,10 +42,6 @@ class RendererWebIDBDatabaseImpl : public WebKit::WebIDBDatabase { virtual void setVersion( const WebKit::WebString& version, WebKit::WebIDBCallbacks* callbacks, WebKit::WebExceptionCode& ec); - virtual WebKit::WebIDBTransaction* transaction( - const WebKit::WebDOMStringList& names, - unsigned short mode, - WebKit::WebExceptionCode& ec); virtual WebKit::WebIDBTransaction* transaction( const WebKit::WebVector& objectStoreIds, unsigned short mode); diff --git a/content/common/indexed_db/proxy_webidbobjectstore_impl.cc b/content/common/indexed_db/proxy_webidbobjectstore_impl.cc index a21e99fab1964b..1c64006d768c96 100644 --- a/content/common/indexed_db/proxy_webidbobjectstore_impl.cc +++ b/content/common/indexed_db/proxy_webidbobjectstore_impl.cc @@ -62,23 +62,6 @@ void RendererWebIDBObjectStoreImpl::get( object_store_ipc_id_, transaction, &ec); } -void RendererWebIDBObjectStoreImpl::putWithIndexKeys( - const WebSerializedScriptValue& value, - const WebIDBKey& key, - PutMode put_mode, - WebIDBCallbacks* callbacks, - const WebIDBTransaction& transaction, - const WebVector& index_names, - const WebVector >& index_keys, - WebExceptionCode& ec) { - IndexedDBDispatcher* dispatcher = - IndexedDBDispatcher::ThreadSpecificInstance(); - dispatcher->RequestIDBObjectStorePut( - SerializedScriptValue(value), IndexedDBKey(key), - put_mode, callbacks, object_store_ipc_id_, transaction, - index_names, index_keys, &ec); -} - void RendererWebIDBObjectStoreImpl::put( const WebSerializedScriptValue& value, const WebIDBKey& key, @@ -95,32 +78,6 @@ void RendererWebIDBObjectStoreImpl::put( index_ids, index_keys); } -void RendererWebIDBObjectStoreImpl::setIndexKeys( - const WebKit::WebIDBKey& primaryKey, - const WebKit::WebVector& index_names, - const WebKit::WebVector& index_keys, - const WebKit::WebIDBTransaction& transaction) { - std::vector index_names_list(index_names.size()); - for (size_t i = 0; i < index_names.size(); ++i) { - index_names_list[i] = index_names[i]; - } - - std::vector > - index_keys_list(index_keys.size()); - for (size_t i = 0; i < index_keys.size(); ++i) { - index_keys_list[i].resize(index_keys[i].size()); - for (size_t j = 0; j < index_keys[i].size(); ++j) { - index_keys_list[i][j] = content::IndexedDBKey(index_keys[i][j]); - } - } - IndexedDBDispatcher::Send(new IndexedDBHostMsg_ObjectStoreSetIndexKeysOld( - object_store_ipc_id_, - IndexedDBKey(primaryKey), - index_names_list, - index_keys_list, - IndexedDBDispatcher::TransactionId(transaction))); -} - void RendererWebIDBObjectStoreImpl::setIndexKeys( const WebKit::WebIDBKey& primaryKey, const WebKit::WebVector& index_ids, @@ -147,20 +104,6 @@ void RendererWebIDBObjectStoreImpl::setIndexKeys( IndexedDBDispatcher::TransactionId(transaction))); } -void RendererWebIDBObjectStoreImpl::setIndexesReady( - const WebKit::WebVector& index_names, - const WebKit::WebIDBTransaction& transaction) { - - std::vector index_name_list(index_names.size()); - for (size_t i = 0; i < index_names.size(); ++i) { - index_name_list[i] = index_names[i]; - } - - IndexedDBDispatcher::Send(new IndexedDBHostMsg_ObjectStoreSetIndexesReadyOld( - object_store_ipc_id_, - index_name_list, IndexedDBDispatcher::TransactionId(transaction))); -} - void RendererWebIDBObjectStoreImpl::setIndexesReady( const WebKit::WebVector& index_ids, const WebKit::WebIDBTransaction& transaction) { @@ -222,18 +165,6 @@ WebIDBIndex* RendererWebIDBObjectStoreImpl::createIndex( return new RendererWebIDBIndexImpl(index_id); } -WebIDBIndex* RendererWebIDBObjectStoreImpl::index( - const WebString& name, - WebExceptionCode& ec) { - int32 idb_index_id; - IndexedDBDispatcher::Send( - new IndexedDBHostMsg_ObjectStoreIndexOld(object_store_ipc_id_, name, - &idb_index_id, &ec)); - if (!idb_index_id) - return NULL; - return new RendererWebIDBIndexImpl(idb_index_id); -} - WebIDBIndex* RendererWebIDBObjectStoreImpl::index( const long long index_id) { int32 idb_index_id; @@ -245,16 +176,6 @@ WebIDBIndex* RendererWebIDBObjectStoreImpl::index( return new RendererWebIDBIndexImpl(idb_index_id); } -void RendererWebIDBObjectStoreImpl::deleteIndex( - const WebString& name, - const WebIDBTransaction& transaction, - WebExceptionCode& ec) { - IndexedDBDispatcher::Send( - new IndexedDBHostMsg_ObjectStoreDeleteIndexOld( - object_store_ipc_id_, name, - IndexedDBDispatcher::TransactionId(transaction), &ec)); -} - void RendererWebIDBObjectStoreImpl::deleteIndex( long long index_id, const WebIDBTransaction& transaction, diff --git a/content/common/indexed_db/proxy_webidbobjectstore_impl.h b/content/common/indexed_db/proxy_webidbobjectstore_impl.h index ad8a7931733dd2..90611ec84611a1 100644 --- a/content/common/indexed_db/proxy_webidbobjectstore_impl.h +++ b/content/common/indexed_db/proxy_webidbobjectstore_impl.h @@ -33,15 +33,6 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { WebKit::WebIDBCallbacks* callbacks, const WebKit::WebIDBTransaction& transaction, WebKit::WebExceptionCode& ec); - virtual void putWithIndexKeys( - const WebKit::WebSerializedScriptValue&, - const WebKit::WebIDBKey&, - PutMode, - WebKit::WebIDBCallbacks*, - const WebKit::WebIDBTransaction&, - const WebKit::WebVector&, - const WebKit::WebVector&, - WebKit::WebExceptionCode&); virtual void put( const WebKit::WebSerializedScriptValue&, const WebKit::WebIDBKey&, @@ -50,16 +41,10 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { const WebKit::WebIDBTransaction&, const WebKit::WebVector&, const WebKit::WebVector&); - virtual void setIndexKeys(const WebKit::WebIDBKey&, - const WebKit::WebVector&, - const WebKit::WebVector&, - const WebKit::WebIDBTransaction&); virtual void setIndexKeys(const WebKit::WebIDBKey&, const WebKit::WebVector&, const WebKit::WebVector&, const WebKit::WebIDBTransaction&); - virtual void setIndexesReady(const WebKit::WebVector&, - const WebKit::WebIDBTransaction&); virtual void setIndexesReady(const WebKit::WebVector&, const WebKit::WebIDBTransaction&); virtual void deleteFunction(const WebKit::WebIDBKeyRange& key_range, @@ -80,13 +65,7 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { WebKit::WebExceptionCode& ec); // Transfers ownership of the WebIDBIndex to the caller. - virtual WebKit::WebIDBIndex* index(const WebKit::WebString& name, - WebKit::WebExceptionCode& ec); virtual WebKit::WebIDBIndex* index(long long object_store_id); - virtual void deleteIndex(const WebKit::WebString& name, - const WebKit::WebIDBTransaction& transaction, - WebKit::WebExceptionCode& ec); - virtual void deleteIndex(long long index_id, const WebKit::WebIDBTransaction& transaction, WebKit::WebExceptionCode& ec); diff --git a/content/common/indexed_db/proxy_webidbtransaction_impl.cc b/content/common/indexed_db/proxy_webidbtransaction_impl.cc index d72dc15bc28fa3..033c3e54ddcba2 100644 --- a/content/common/indexed_db/proxy_webidbtransaction_impl.cc +++ b/content/common/indexed_db/proxy_webidbtransaction_impl.cc @@ -32,18 +32,6 @@ RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { idb_transaction_id_)); } -WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( - const WebString& name, - WebKit::WebExceptionCode& ec) { - int object_store_ipc_id; - IndexedDBDispatcher::Send( - new IndexedDBHostMsg_TransactionObjectStoreOld( - idb_transaction_id_, name, &object_store_ipc_id, &ec)); - if (!object_store_ipc_id) - return NULL; - return new RendererWebIDBObjectStoreImpl(object_store_ipc_id); -} - WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( long long object_store_id, WebKit::WebExceptionCode& ec) { diff --git a/content/common/indexed_db/proxy_webidbtransaction_impl.h b/content/common/indexed_db/proxy_webidbtransaction_impl.h index b0f144e5489cc3..e3d5b42de1c7ed 100644 --- a/content/common/indexed_db/proxy_webidbtransaction_impl.h +++ b/content/common/indexed_db/proxy_webidbtransaction_impl.h @@ -21,8 +21,6 @@ class RendererWebIDBTransactionImpl : public WebKit::WebIDBTransaction { explicit RendererWebIDBTransactionImpl(int32 idb_transaction_id); virtual ~RendererWebIDBTransactionImpl(); - virtual WebKit::WebIDBObjectStore* objectStore(const WebKit::WebString& name, - WebKit::WebExceptionCode&); virtual WebKit::WebIDBObjectStore* objectStore(long long object_store_id, WebKit::WebExceptionCode&); virtual void commit();