diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 12:24:53 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 12:24:53 +0000 |
commit | 284e0d6e941b4a87f56cfd7cab70a69194e50cae (patch) | |
tree | c8df36841e4a2533c630b9ea2e0ad2bee6257e80 /chrome/browser | |
parent | 341c086742954026993de725d0af8118e14d2862 (diff) | |
download | chromium_src-284e0d6e941b4a87f56cfd7cab70a69194e50cae.zip chromium_src-284e0d6e941b4a87f56cfd7cab70a69194e50cae.tar.gz chromium_src-284e0d6e941b4a87f56cfd7cab70a69194e50cae.tar.bz2 |
Revert 60275.
TEST=none
BUG=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc | 125 | ||||
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h | 23 |
2 files changed, 47 insertions, 101 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 91b0325..292bbc0 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc @@ -33,7 +33,6 @@ #include "webkit/glue/webkit_glue.h" using WebKit::WebDOMStringList; -using WebKit::WebIDBCallbacks; using WebKit::WebIDBCursor; using WebKit::WebIDBDatabase; using WebKit::WebIDBDatabaseError; @@ -559,75 +558,52 @@ void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenObjectCursor( const ViewHostMsg_IDBIndexOpenCursor_Params& params) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( - &map_, params.idb_index_id_, NULL, + &parent_->index_dispatcher_host_->map_, + params.idb_index_id_, NULL, ViewHostMsg_IDBIndexOpenObjectCursor::ID); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, - params.transaction_id_, NULL, ViewHostMsg_IDBIndexOpenObjectCursor::ID); - if (!idb_transaction || !idb_index) + if (!idb_index) return; - - scoped_ptr<WebIDBCallbacks> callbacks( - new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); idb_index->openObjectCursor( WebIDBKeyRange(params.left_key_, params.right_key_, params.key_flags_), - params.direction_, callbacks.release(), *idb_transaction); + params.direction_, + new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); } void IndexedDBDispatcherHost::IndexDispatcherHost::OnOpenCursor( const ViewHostMsg_IDBIndexOpenCursor_Params& params) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( - &map_, params.idb_index_id_, NULL, ViewHostMsg_IDBIndexOpenCursor::ID); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, params.transaction_id_, - NULL, ViewHostMsg_IDBIndexOpenCursor::ID); - if (!idb_transaction || !idb_index) + &parent_->index_dispatcher_host_->map_, + params.idb_index_id_, NULL, + ViewHostMsg_IDBIndexOpenCursor::ID); + if (!idb_index) return; - - scoped_ptr<WebIDBCallbacks> callbacks( - new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); idb_index->openCursor( WebIDBKeyRange(params.left_key_, params.right_key_, params.key_flags_), - params.direction_, callbacks.release(), *idb_transaction); + params.direction_, + new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); } void IndexedDBDispatcherHost::IndexDispatcherHost::OnGetObject( - int idb_index_id, - int32 response_id, - const IndexedDBKey& key, - int transaction_id) { + int idb_index_id, int32 response_id, const IndexedDBKey& key) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( &map_, idb_index_id, NULL, ViewHostMsg_IDBIndexGetObject::ID); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, - ViewHostMsg_IDBIndexGetObject::ID); - if (!idb_transaction || !idb_index) + if (!idb_index) return; - - scoped_ptr<WebIDBCallbacks> callbacks( - new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, response_id)); - idb_index->getObject(key, callbacks.release(), *idb_transaction); + idb_index->getObject(key, new IndexedDBCallbacks<WebSerializedScriptValue>( + parent_, response_id)); } void IndexedDBDispatcherHost::IndexDispatcherHost::OnGet( - int idb_index_id, - int32 response_id, - const IndexedDBKey& key, - int transaction_id) { + int idb_index_id, int32 response_id, const IndexedDBKey& key) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); WebIDBIndex* idb_index = parent_->GetOrTerminateProcess( &map_, idb_index_id, NULL, ViewHostMsg_IDBIndexGet::ID); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, - ViewHostMsg_IDBIndexGet::ID); - if (!idb_transaction || !idb_index) + if (!idb_index) return; - - scoped_ptr<WebIDBCallbacks> callbacks( - new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, response_id)); - idb_index->get(key, callbacks.release(), *idb_transaction); + idb_index->get(key, new IndexedDBCallbacks<WebSerializedScriptValue>( + parent_, response_id)); } void IndexedDBDispatcherHost::IndexDispatcherHost::OnDestroyed( @@ -710,59 +686,39 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndexNames( } void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet( - int idb_object_store_id, - int32 response_id, - const IndexedDBKey& key, - int transaction_id) { + int idb_object_store_id, int32 response_id, const IndexedDBKey& key) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, idb_object_store_id, NULL, ViewHostMsg_IDBObjectStoreGet::ID); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, - ViewHostMsg_IDBObjectStoreGet::ID); - if (!idb_transaction || !idb_object_store) + if (!idb_object_store) return; - - scoped_ptr<WebIDBCallbacks> callbacks( - new IndexedDBCallbacks<WebSerializedScriptValue>(parent_, response_id)); - idb_object_store->get(key, callbacks.release(), *idb_transaction); + idb_object_store->get(key, new IndexedDBCallbacks<WebSerializedScriptValue>( + parent_, response_id)); } void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnPut( - const ViewHostMsg_IDBObjectStorePut_Params& params) { + int idb_object_store_id, int32 response_id, + const SerializedScriptValue& value, const IndexedDBKey& key, + bool add_only) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( - &map_, params.idb_object_store_id_, NULL, - ViewHostMsg_IDBObjectStorePut::ID); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, params.transaction_id_, - NULL, ViewHostMsg_IDBObjectStorePut::ID); - if (!idb_transaction || !idb_object_store) + &map_, idb_object_store_id, NULL, ViewHostMsg_IDBObjectStorePut::ID); + if (!idb_object_store) return; - - scoped_ptr<WebIDBCallbacks> callbacks( - new IndexedDBCallbacks<WebIDBKey>(parent_, params.response_id_)); - idb_object_store->put(params.serialized_value_, params.key_, params.add_only_, - callbacks.release(), *idb_transaction); + idb_object_store->put( + value, key, add_only, new IndexedDBCallbacks<WebIDBKey>( + parent_, response_id)); } void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnRemove( - int idb_object_store_id, - int32 response_id, - const IndexedDBKey& key, - int transaction_id) { + int idb_object_store_id, int32 response_id, const IndexedDBKey& key) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); WebIDBObjectStore* idb_object_store = parent_->GetOrTerminateProcess( &map_, idb_object_store_id, NULL, ViewHostMsg_IDBObjectStoreRemove::ID); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, transaction_id, NULL, - ViewHostMsg_IDBObjectStoreRemove::ID); - if (!idb_transaction || !idb_object_store) + if (!idb_object_store) return; - - scoped_ptr<WebIDBCallbacks> callbacks( - new IndexedDBCallbacks<void>(parent_, response_id)); - idb_object_store->remove(key, callbacks.release(), *idb_transaction); + idb_object_store->remove(key, new IndexedDBCallbacks<void>(parent_, + response_id)); } void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnCreateIndex( @@ -812,17 +768,12 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnOpenCursor( &parent_->object_store_dispatcher_host_->map_, params.idb_object_store_id_, NULL, ViewHostMsg_IDBObjectStoreOpenCursor::ID); - WebIDBTransaction* idb_transaction = parent_->GetOrTerminateProcess( - &parent_->transaction_dispatcher_host_->map_, params.transaction_id_, - NULL, ViewHostMsg_IDBObjectStoreOpenCursor::ID); - if (!idb_transaction || !idb_object_store) + if (!idb_object_store) return; - - scoped_ptr<WebIDBCallbacks> callbacks( - new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); idb_object_store->openCursor( WebIDBKeyRange(params.left_key_, params.right_key_, params.flags_), - params.direction_, callbacks.release(), *idb_transaction); + params.direction_, + new IndexedDBCallbacks<WebIDBCursor>(parent_, params.response_id_)); } void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDestroyed( 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 982c861..654b3ab 100644 --- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h +++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h @@ -22,7 +22,6 @@ struct ViewHostMsg_IDBFactoryOpen_Params; struct ViewHostMsg_IDBIndexOpenCursor_Params; struct ViewHostMsg_IDBObjectStoreCreateIndex_Params; struct ViewHostMsg_IDBObjectStoreOpenCursor_Params; -struct ViewHostMsg_IDBObjectStorePut_Params; namespace WebKit { class WebIDBCursor; @@ -138,12 +137,10 @@ class IndexedDBDispatcherHost void OnOpenCursor(const ViewHostMsg_IDBIndexOpenCursor_Params& params); void OnGetObject(int idb_index_id, int32 response_id, - const IndexedDBKey& key, - int transaction_id); + const IndexedDBKey& key); void OnGet(int idb_index_id, int32 response_id, - const IndexedDBKey& key, - int transaction_id); + const IndexedDBKey& key); void OnDestroyed(int32 idb_index_id); IndexedDBDispatcherHost* parent_; @@ -161,15 +158,13 @@ class IndexedDBDispatcherHost void OnName(int32 idb_object_store_id, IPC::Message* reply_msg); void OnKeyPath(int32 idb_object_store_id, IPC::Message* reply_msg); void OnIndexNames(int32 idb_object_store_id, IPC::Message* reply_msg); - void OnGet(int idb_object_store_id, - int32 response_id, - const IndexedDBKey& key, - int transaction_id); - void OnPut(const ViewHostMsg_IDBObjectStorePut_Params& params); - void OnRemove(int idb_object_store_id, - int32 response_id, - const IndexedDBKey& key, - int transaction_id); + void OnGet(int idb_object_store_id, int32 response_id, + const IndexedDBKey& key); + void OnPut(int idb_object_store_id, int32 response_id, + const SerializedScriptValue& value, const IndexedDBKey& key, + bool add_only); + void OnRemove(int idb_object_store_id, int32 response_id, + const IndexedDBKey& key); void OnCreateIndex( const ViewHostMsg_IDBObjectStoreCreateIndex_Params& params); void OnIndex(int32 idb_object_store_id, const string16& name, |